@domino-sdk/relay 1.24.1 → 1.29.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.
Files changed (57) hide show
  1. package/dist/{accounts-B31dWEYD.d.ts → accounts-DRPENuZe.d.ts} +1 -1
  2. package/dist/{attempt-captures-JDIgz2lY.d.ts → attempt-captures-BPMbTDYG.d.ts} +2 -2
  3. package/dist/authoring.d.ts +60 -60
  4. package/dist/authoring.js +7 -7
  5. package/dist/{automatic-outcomes-T9lEIvTj.d.ts → automatic-outcomes-CGAxTwEj.d.ts} +2 -2
  6. package/dist/avatar.d.ts +2 -2
  7. package/dist/browser.d.ts +10 -10
  8. package/dist/browser.js +10 -10
  9. package/dist/{capability-error-oTd3eYFH.d.ts → capability-error-CvSZaif2.d.ts} +1 -1
  10. package/dist/{chunk-B4EZ76WX.js → chunk-22QERRAG.js} +3 -3
  11. package/dist/{chunk-MC6V6VMG.js → chunk-4OC7REYX.js} +1 -1
  12. package/dist/{chunk-JKFSDBQX.js → chunk-5FQ2BNG2.js} +1 -1
  13. package/dist/{chunk-UCZGXYCN.js → chunk-6YLULKQM.js} +10 -10
  14. package/dist/{chunk-6UFXPKLA.js → chunk-BVEWY2ZL.js} +99 -39
  15. package/dist/{chunk-MRU7GX2V.js → chunk-C3KL5SGM.js} +21 -8
  16. package/dist/{chunk-WOGCRDFT.js → chunk-CCTZIHWN.js} +1 -1
  17. package/dist/{chunk-G75JVB4D.js → chunk-DDA7G23P.js} +3 -3
  18. package/dist/{chunk-USVER53M.js → chunk-DP4YWFMY.js} +7 -0
  19. package/dist/{chunk-W33PYWYQ.js → chunk-JNBNL7FE.js} +2 -2
  20. package/dist/{chunk-AXQYGVOP.js → chunk-LPURBE7D.js} +1 -1
  21. package/dist/{chunk-GB26FIZT.js → chunk-MNL5NSC4.js} +8 -8
  22. package/dist/{chunk-JUQ2GNMD.js → chunk-PNCLJOUD.js} +2 -2
  23. package/dist/{chunk-FMQDD2MT.js → chunk-V4FGPIR3.js} +47 -16
  24. package/dist/{chunk-FE6SQTXF.js → chunk-VP63H7IE.js} +2 -2
  25. package/dist/{chunk-ENBQ6UEE.js → chunk-W2HGXOZ5.js} +3 -3
  26. package/dist/{chunk-E7MVYASS.js → chunk-W7PDXGYB.js} +1 -1
  27. package/dist/{chunk-LR2HLHIF.js → chunk-ZLYVOLU2.js} +595 -147
  28. package/dist/{client-HG0uMG0Q.d.ts → client-D4WMWeWC.d.ts} +123 -58
  29. package/dist/{deployments-DQY0PNUk.d.ts → deployments-r5RxhZ9x.d.ts} +184 -184
  30. package/dist/{groups-CfyRewkJ.d.ts → groups-BNUhmxYY.d.ts} +26 -3
  31. package/dist/{images-DwNmzqWv.d.ts → images-PPPTL2Ct.d.ts} +2 -2
  32. package/dist/index.d.ts +13 -13
  33. package/dist/index.js +12 -10
  34. package/dist/{integrations-BMNtARU_.d.ts → integrations-CllF-kWg.d.ts} +1 -1
  35. package/dist/internal.d.ts +10 -10
  36. package/dist/internal.js +9 -9
  37. package/dist/{offers-CEwkAGsB.d.ts → offers-CdB5jnRl.d.ts} +3 -3
  38. package/dist/{pages-D1xrbGJl.d.ts → pages-BUmWkUu2.d.ts} +17 -3
  39. package/dist/{participant-activity-DYdUUhw2.d.ts → participant-activity-BPZiW7m7.d.ts} +1 -1
  40. package/dist/{participant-rewards-3duLb8YJ.d.ts → participant-rewards-BcWkBRn_.d.ts} +1 -1
  41. package/dist/portal-proxy.js +4 -4
  42. package/dist/{profiles-D29SS12z.d.ts → profiles-BHuQdzsW.d.ts} +1 -1
  43. package/dist/react/index.d.ts +13 -13
  44. package/dist/react/index.js +16 -15
  45. package/dist/{schema-D57mhL2q.d.ts → schema-lmOnv5C5.d.ts} +164 -2
  46. package/dist/schema.d.ts +441 -442
  47. package/dist/schema.js +22 -8
  48. package/dist/server/index.d.ts +10 -10
  49. package/dist/server/index.js +978 -723
  50. package/dist/{streaks-CWyq8Px5.d.ts → streaks-0YuipsUQ.d.ts} +1 -1
  51. package/dist/{submission-input-DjXg0o-r.d.ts → submission-input-DdvTz7ac.d.ts} +3 -3
  52. package/dist/{telegram-browser-DaP0Rawg.d.ts → telegram-browser-SK3KxXBL.d.ts} +13 -5
  53. package/dist/testing.d.ts +8 -8
  54. package/dist/testing.js +15 -15
  55. package/dist/{transport-BNOvDy_4.d.ts → transport-BNdKQ_m4.d.ts} +6773 -3922
  56. package/dist/{wallet-CDyo-U4n.d.ts → wallet-t7uNDg9p.d.ts} +1 -1
  57. package/package.json +1 -1
@@ -4,20 +4,20 @@ import {
4
4
  retryAfter,
5
5
  retrying,
6
6
  validTimeout
7
- } from "./chunk-WOGCRDFT.js";
7
+ } from "./chunk-CCTZIHWN.js";
8
8
  import {
9
9
  clientIdentity
10
- } from "./chunk-JKFSDBQX.js";
10
+ } from "./chunk-5FQ2BNG2.js";
11
11
  import {
12
12
  authScopeSchema
13
- } from "./chunk-JUQ2GNMD.js";
13
+ } from "./chunk-PNCLJOUD.js";
14
14
  import {
15
15
  RequestError,
16
16
  appIdentityKindSchema,
17
17
  isRequestError,
18
18
  knownResponse,
19
19
  openIdentityKindSchema
20
- } from "./chunk-6UFXPKLA.js";
20
+ } from "./chunk-BVEWY2ZL.js";
21
21
 
22
22
  // src/configuration.ts
23
23
  function questConfiguration(release) {
@@ -34,7 +34,7 @@ function questConfiguration(release) {
34
34
  }
35
35
 
36
36
  // src/identity-integration.ts
37
- import { z } from "zod";
37
+ import * as z from "zod";
38
38
  var identityIntegrationInputSchema = z.object({
39
39
  name: z.string().trim().min(1).max(80),
40
40
  origin: z.string().url().refine((value) => {
@@ -102,7 +102,7 @@ var participantExchangeSchema = z.object({
102
102
  }).strict();
103
103
 
104
104
  // src/server/errors.ts
105
- import { z as z2 } from "zod";
105
+ import * as z2 from "zod";
106
106
  var ManagementErrorCode = {
107
107
  /** The input or an option failed validation before anything was sent (kind `client`). */
108
108
  InvalidInput: "invalid-input",
@@ -167,7 +167,7 @@ var ManagementError = class extends RequestError {
167
167
  var DEFAULT_MANAGEMENT_TIMEOUT = MANAGEMENT_TIMEOUT;
168
168
 
169
169
  // src/server/transport.ts
170
- import { z as z3 } from "zod";
170
+ import * as z3 from "zod";
171
171
  function failureCause(error) {
172
172
  if (typeof error !== "object" || error === null || !("cause" in error)) {
173
173
  return {};
@@ -199,6 +199,18 @@ function checkedTimeout(timeout) {
199
199
  }
200
200
  function managementTransport(options) {
201
201
  const clientTimeout = checkedTimeout(options.timeout) ?? DEFAULT_MANAGEMENT_TIMEOUT;
202
+ try {
203
+ const headers = new Headers(options.headers);
204
+ headers.set("X-Relay-Organization", options.organization ?? "");
205
+ headers.set("X-Relay-Project", options.project ?? "");
206
+ } catch (error) {
207
+ throw new ManagementError({
208
+ kind: "client",
209
+ code: ManagementErrorCode.InvalidInput,
210
+ message: "Management headers, organization and project must be valid HTTP header values",
211
+ cause: error
212
+ });
213
+ }
202
214
  function callLifetime(call) {
203
215
  return lifetime(
204
216
  checkedTimeout(call?.timeout) ?? clientTimeout,
@@ -277,11 +289,27 @@ function managementTransport(options) {
277
289
  if (life.signal.aborted) {
278
290
  throw transportFailure(life.reason(), context, life, false);
279
291
  }
280
- const headers = new Headers(fetchInit.headers);
292
+ const headers = new Headers(options.headers);
293
+ new Headers(fetchInit.headers).forEach(
294
+ (value, name) => headers.set(name, value)
295
+ );
281
296
  headers.set("X-Domino-Client", options.client ?? clientIdentity());
282
297
  const token = await credential(context, life);
283
298
  if (token) {
284
- headers.set("Authorization", `Bearer ${token}`);
299
+ try {
300
+ headers.set("Authorization", `Bearer ${token}`);
301
+ } catch (error) {
302
+ throw new ManagementError({
303
+ ...context,
304
+ kind: "client",
305
+ code: ManagementErrorCode.Credential,
306
+ uncertain: false,
307
+ message: "getToken returned a value that is not a token",
308
+ cause: error
309
+ });
310
+ }
311
+ } else if (options.getToken) {
312
+ headers.delete("Authorization");
285
313
  }
286
314
  if (options.organization) {
287
315
  headers.set("X-Relay-Organization", options.organization);
@@ -294,12 +322,15 @@ function managementTransport(options) {
294
322
  }
295
323
  let response;
296
324
  try {
297
- response = await fetch(`${options.baseUrl}/management/v1${path}`, {
298
- ...fetchInit,
299
- headers,
300
- signal: life.signal,
301
- ...options.redirect ? { redirect: options.redirect } : {}
302
- });
325
+ response = await (options.fetch ?? fetch)(
326
+ `${options.baseUrl}/management/v1${path}`,
327
+ {
328
+ ...fetchInit,
329
+ headers,
330
+ signal: life.signal,
331
+ ...options.redirect ? { redirect: options.redirect } : {}
332
+ }
333
+ );
303
334
  } catch (error) {
304
335
  throw transportFailure(error, context, life, !unsent(error));
305
336
  }
@@ -442,7 +473,7 @@ function managementTransport(options) {
442
473
  }
443
474
 
444
475
  // src/sequence-cursor.ts
445
- import { z as z4 } from "zod";
476
+ import * as z4 from "zod";
446
477
  var sequenceCursorSchema = z4.string().regex(/^[1-9][0-9]{0,15}$/, "Invalid cursor").transform(Number).pipe(z4.number().int().positive().safe());
447
478
 
448
479
  // src/referral-reward-kinds.ts
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRelayClient
3
- } from "./chunk-LR2HLHIF.js";
3
+ } from "./chunk-ZLYVOLU2.js";
4
4
  import {
5
5
  RelayErrorCode,
6
6
  asRelayError,
7
7
  clientError,
8
8
  cosmosChain
9
- } from "./chunk-6UFXPKLA.js";
9
+ } from "./chunk-BVEWY2ZL.js";
10
10
 
11
11
  // src/base58.ts
12
12
  var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
@@ -4,13 +4,13 @@ import {
4
4
  imageFieldsSchema,
5
5
  imageInspectionSchema,
6
6
  imageSightingsSchema
7
- } from "./chunk-B4EZ76WX.js";
7
+ } from "./chunk-22QERRAG.js";
8
8
  import {
9
9
  photoResultSchema
10
- } from "./chunk-6UFXPKLA.js";
10
+ } from "./chunk-BVEWY2ZL.js";
11
11
 
12
12
  // src/image-results.ts
13
- import { z } from "zod";
13
+ import * as z from "zod";
14
14
  var invalid = (message, path) => new z.ZodError([{ code: "custom", message, path, input: void 0 }]);
15
15
  function parseImageExtraction(raw, value) {
16
16
  const result = imageExtractionSchema.parse(value);
@@ -2,7 +2,7 @@ import {
2
2
  RelayErrorCode,
3
3
  clientError,
4
4
  isRequestError
5
- } from "./chunk-6UFXPKLA.js";
5
+ } from "./chunk-BVEWY2ZL.js";
6
6
 
7
7
  // src/action.ts
8
8
  function withActionId(value) {