@domino-sdk/relay 1.62.0 → 1.63.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/CHANGELOG.md +120 -0
- package/dist/{accounts-CCqCKCVx.d.ts → accounts-nz3mzfRQ.d.ts} +21 -3
- package/dist/{attempt-captures-Cm-5G0PC.d.ts → attempt-captures-DMi8oR9T.d.ts} +1 -1
- package/dist/authoring.d.ts +54 -20
- package/dist/authoring.js +58 -24
- package/dist/{automatic-outcomes-pAsOyIVp.d.ts → automatic-outcomes-C_LLQU1p.d.ts} +11 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +15 -13
- package/dist/capability-error-CuI_F7yM.d.ts +296 -0
- package/dist/{catalog--ZIlskAo.d.ts → catalog-BaTOKpNw.d.ts} +21 -10
- package/dist/{chunk-3PYYGFSB.js → chunk-3RFP6GT5.js} +3 -3
- package/dist/{chunk-HTZHBTIL.js → chunk-4GQW43UU.js} +193 -357
- package/dist/{chunk-D26YNACF.js → chunk-4NOFSGAL.js} +56 -56
- package/dist/{chunk-UW5232GG.js → chunk-5XLZ34PV.js} +5 -5
- package/dist/{chunk-QYPMPWVX.js → chunk-7X67QLPB.js} +43 -43
- package/dist/{chunk-5TEYFX6X.js → chunk-7Z4SZ6YM.js} +2 -2
- package/dist/{chunk-Y322OTCH.js → chunk-AQOL3SK5.js} +1 -1
- package/dist/{chunk-CICDIBOF.js → chunk-EHUSD3O2.js} +76 -72
- package/dist/chunk-FO2LCZTL.js +19 -0
- package/dist/{chunk-3KLC4AMA.js → chunk-FU5CGNTR.js} +135 -173
- package/dist/{chunk-K2KS3JLY.js → chunk-GLH6MEI2.js} +7 -2
- package/dist/chunk-ICXZZNPS.js +199 -0
- package/dist/{chunk-MK425RXJ.js → chunk-ID3BZXFZ.js} +709 -640
- package/dist/{chunk-UAKYDVT3.js → chunk-KP2MCX3R.js} +111 -89
- package/dist/{chunk-GKIFABGN.js → chunk-LZWXCBUB.js} +74 -247
- package/dist/{chunk-6WCIWXUV.js → chunk-MTKRIQEU.js} +2 -2
- package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
- package/dist/{chunk-XJFYAXET.js → chunk-N4BDKS6Y.js} +19 -19
- package/dist/{chunk-E6IKQHTX.js → chunk-N4LNEGQX.js} +2 -2
- package/dist/chunk-NQDEWJWE.js +554 -0
- package/dist/{chunk-GTDW453U.js → chunk-QR6HH4DI.js} +100 -114
- package/dist/chunk-TLSQETTY.js +41 -0
- package/dist/{chunk-CZFXGGEK.js → chunk-U66GUVSG.js} +2 -2
- package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
- package/dist/chunk-UZ765UGH.js +18 -0
- package/dist/{chunk-XNKSSE32.js → chunk-VWQGWGCH.js} +7 -7
- package/dist/{chunk-WSBYWVTZ.js → chunk-W7YSMSGC.js} +166 -158
- package/dist/{client-B-hbHX30.d.ts → client-DHmG7rn6.d.ts} +25 -61
- package/dist/{capability-error-DFMwSuSf.d.ts → dashboards-CLemT6kj.d.ts} +14 -294
- package/dist/{deployments-M4OHn7G3.d.ts → deployments-DTULi7dF.d.ts} +46 -3
- package/dist/{identity-integration-3mX6b5iH.d.ts → identity-integration-DOeNZaxF.d.ts} +32 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +13 -11
- package/dist/internal.d.ts +27 -13
- package/dist/internal.js +41 -13
- package/dist/{analytics-BwAKLi7O.d.ts → limits-kNzYdZ00.d.ts} +124 -3
- package/dist/{offers-DhAtss4_.d.ts → offers-CYeN_I0Y.d.ts} +3 -2
- package/dist/portal-proxy.d.ts +19 -3
- package/dist/portal-proxy.js +64 -22
- package/dist/react/index.d.ts +21 -14
- package/dist/react/index.js +55 -29
- package/dist/{pages-B8q8Y_dQ.d.ts → reward-deliveries-drp-x1G-.d.ts} +300 -233
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/UGDV5W4N.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +193 -18
- package/dist/schema.js +31 -26
- package/dist/server/index.d.ts +13 -13
- package/dist/server/index.js +5885 -6224
- package/dist/{sign-in-providers-BkjcDsFF.d.ts → sign-in-providers-B1Q9eDRm.d.ts} +7 -2
- package/dist/{submission-input-DHGKhXfp.d.ts → submission-input-DZCbjQUH.d.ts} +3 -2
- package/dist/{telegram-browser-BCE7zdOb.d.ts → telegram-browser-NL0Asmsi.d.ts} +4 -4
- package/dist/telegram.d.ts +8 -8
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +228 -26
- package/dist/testing.js +137 -92
- package/dist/{tracker-data-Hb1uQnk5.d.ts → tracker-data-esm3WG8R.d.ts} +34 -8
- package/dist/{transport-DkhX2Cbs.d.ts → transport-Czht_irp.d.ts} +41259 -39835
- package/dist/{wallet-DTO7SXj7.d.ts → wallet-B7e06v4m.d.ts} +14 -4
- package/package.json +1 -1
- package/dist/chunk-UPQPUJOU.js +0 -457
- package/dist/runtime/chunks/Y4OAVXFR.js +0 -1
package/dist/internal.js
CHANGED
|
@@ -2,23 +2,34 @@ import {
|
|
|
2
2
|
REFERRAL_INTEGRATION_REWARD_ERROR,
|
|
3
3
|
containsReferralIntegrationReward,
|
|
4
4
|
managementTransport,
|
|
5
|
+
nextScheduleRun,
|
|
5
6
|
questConfiguration,
|
|
6
7
|
sequenceCursorSchema
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NQDEWJWE.js";
|
|
8
9
|
import {
|
|
9
10
|
parseImageExtraction,
|
|
10
11
|
parseImageResult
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-N4LNEGQX.js";
|
|
13
|
+
import "./chunk-7X67QLPB.js";
|
|
13
14
|
import {
|
|
14
15
|
sourceDataSchema,
|
|
15
16
|
sourceRoles,
|
|
16
17
|
validateQuestShape
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7Z4SZ6YM.js";
|
|
19
|
+
import {
|
|
20
|
+
dashboardIssue,
|
|
21
|
+
normalizeDashboard
|
|
22
|
+
} from "./chunk-FU5CGNTR.js";
|
|
23
|
+
import {
|
|
24
|
+
bareOrigin,
|
|
25
|
+
loopbackHosts,
|
|
26
|
+
secureOrLoopbackOrigin
|
|
27
|
+
} from "./chunk-UZ765UGH.js";
|
|
18
28
|
import {
|
|
19
29
|
accountVouchedBySchema,
|
|
20
30
|
identityIntegrationAccountVouchingInputSchema,
|
|
21
31
|
identityIntegrationInputSchema,
|
|
32
|
+
identityIntegrationKeySchema,
|
|
22
33
|
identityIntegrationSchema,
|
|
23
34
|
identityIntegrationSecretSchema,
|
|
24
35
|
identityKindClaimSchema,
|
|
@@ -26,50 +37,64 @@ import {
|
|
|
26
37
|
participantExchangeAccountsSchema,
|
|
27
38
|
participantExchangeResultSchema,
|
|
28
39
|
participantExchangeSchema
|
|
29
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-KP2MCX3R.js";
|
|
30
41
|
import {
|
|
31
42
|
isIntegrationParticipantPath,
|
|
32
43
|
isParticipantRoute,
|
|
33
44
|
participantRoutePattern,
|
|
34
45
|
participantRoutes
|
|
35
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-U66GUVSG.js";
|
|
36
47
|
import {
|
|
37
48
|
hostEnvironmentPath,
|
|
38
49
|
hostEnvironmentSchema
|
|
39
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-UYVJZR33.js";
|
|
51
|
+
import "./chunk-ICXZZNPS.js";
|
|
52
|
+
import "./chunk-FO2LCZTL.js";
|
|
40
53
|
import {
|
|
41
54
|
MANAGEMENT_TIMEOUT,
|
|
42
55
|
lifetime,
|
|
43
56
|
retryAfter,
|
|
44
57
|
retrying
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import "./chunk-
|
|
58
|
+
} from "./chunk-3RFP6GT5.js";
|
|
59
|
+
import "./chunk-N4BDKS6Y.js";
|
|
47
60
|
import {
|
|
61
|
+
compatibleSettingKinds,
|
|
62
|
+
isBoundSetting,
|
|
48
63
|
schemaCheckedReader,
|
|
64
|
+
sourceContent,
|
|
49
65
|
trackerDataBatchSteps,
|
|
50
66
|
trackerDataIssue,
|
|
51
67
|
trackerDataIssues,
|
|
52
68
|
trackerDataPathTypes,
|
|
53
69
|
trackerDataRecordSteps,
|
|
54
|
-
whereSchemaIssue
|
|
55
|
-
|
|
56
|
-
|
|
70
|
+
whereSchemaIssue,
|
|
71
|
+
whereSettings
|
|
72
|
+
} from "./chunk-ID3BZXFZ.js";
|
|
73
|
+
import "./chunk-GLH6MEI2.js";
|
|
57
74
|
export {
|
|
58
75
|
MANAGEMENT_TIMEOUT,
|
|
59
76
|
REFERRAL_INTEGRATION_REWARD_ERROR,
|
|
60
77
|
accountVouchedBySchema,
|
|
78
|
+
bareOrigin,
|
|
79
|
+
compatibleSettingKinds,
|
|
61
80
|
containsReferralIntegrationReward,
|
|
81
|
+
dashboardIssue,
|
|
62
82
|
hostEnvironmentPath,
|
|
63
83
|
hostEnvironmentSchema,
|
|
64
84
|
identityIntegrationAccountVouchingInputSchema,
|
|
65
85
|
identityIntegrationInputSchema,
|
|
86
|
+
identityIntegrationKeySchema,
|
|
66
87
|
identityIntegrationSchema,
|
|
67
88
|
identityIntegrationSecretSchema,
|
|
68
89
|
identityKindClaimSchema,
|
|
90
|
+
isBoundSetting,
|
|
69
91
|
isIntegrationParticipantPath,
|
|
70
92
|
isParticipantRoute,
|
|
71
93
|
lifetime,
|
|
94
|
+
loopbackHosts,
|
|
72
95
|
managementTransport,
|
|
96
|
+
nextScheduleRun,
|
|
97
|
+
normalizeDashboard,
|
|
73
98
|
parseImageExtraction,
|
|
74
99
|
parseImageResult,
|
|
75
100
|
participantExchangeAccountResultSchema,
|
|
@@ -82,7 +107,9 @@ export {
|
|
|
82
107
|
retryAfter,
|
|
83
108
|
retrying,
|
|
84
109
|
schemaCheckedReader,
|
|
110
|
+
secureOrLoopbackOrigin,
|
|
85
111
|
sequenceCursorSchema,
|
|
112
|
+
sourceContent,
|
|
86
113
|
sourceDataSchema,
|
|
87
114
|
sourceRoles,
|
|
88
115
|
trackerDataBatchSteps,
|
|
@@ -91,5 +118,6 @@ export {
|
|
|
91
118
|
trackerDataPathTypes,
|
|
92
119
|
trackerDataRecordSteps,
|
|
93
120
|
validateQuestShape,
|
|
94
|
-
whereSchemaIssue
|
|
121
|
+
whereSchemaIssue,
|
|
122
|
+
whereSettings
|
|
95
123
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { aa as PhotoResult, V as AttemptCodeSource } from './accounts-
|
|
2
|
+
import { aa as PhotoResult, V as AttemptCodeSource } from './accounts-nz3mzfRQ.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Quest code names an image; the platform fetches, decodes and pins it. No bytes or URLs cross the
|
|
@@ -729,7 +729,11 @@ declare const analyticsCatalogSchema: z.ZodObject<{
|
|
|
729
729
|
}, z.core.$strip>>;
|
|
730
730
|
}, z.core.$strip>;
|
|
731
731
|
type AnalyticsCatalog = z.infer<typeof analyticsCatalogSchema>;
|
|
732
|
-
/**
|
|
732
|
+
/**
|
|
733
|
+
* A breakdown or query returns up to this many rows; the rest are summed into `other`.
|
|
734
|
+
*
|
|
735
|
+
* @deprecated Use `limits.analyticsQueryRows`, which a 1.x release can raise.
|
|
736
|
+
*/
|
|
733
737
|
declare const analyticsQueryLimit = 100;
|
|
734
738
|
/**
|
|
735
739
|
* What `analytics.query` reads on the wire. The metric, breakdown and filter names are checked by
|
|
@@ -823,4 +827,121 @@ declare const analyticsMetricResultSchema: z.ZodObject<{
|
|
|
823
827
|
type AnalyticsMetricResult = z.infer<typeof analyticsMetricResultSchema>;
|
|
824
828
|
type AnalyticsBreakdownRow = NonNullable<AnalyticsMetricResult["breakdown"]>["rows"][number];
|
|
825
829
|
|
|
826
|
-
|
|
830
|
+
/**
|
|
831
|
+
* Relay's platform limits. A 1.x release can raise them, and add new ones. Released SDKs keep
|
|
832
|
+
* checking the values they shipped with, so Relay answers them within those.
|
|
833
|
+
*
|
|
834
|
+
* @compat output
|
|
835
|
+
*/
|
|
836
|
+
type Limits = {
|
|
837
|
+
/** Quests one deployment, draft or release batch can hold. */
|
|
838
|
+
readonly quests: number;
|
|
839
|
+
/** Quest types one deployment, draft or release batch can hold. */
|
|
840
|
+
readonly questTypes: number;
|
|
841
|
+
/** Collections one deployment, draft or release batch can hold. */
|
|
842
|
+
readonly collections: number;
|
|
843
|
+
/** The SDK runtime a quest bundle imports instead of bundling. */
|
|
844
|
+
readonly sdkRuntime: {
|
|
845
|
+
/** Modules in one runtime. */
|
|
846
|
+
readonly modules: number;
|
|
847
|
+
/** Characters of module source, summed over all modules. */
|
|
848
|
+
readonly size: number;
|
|
849
|
+
};
|
|
850
|
+
/** The most completions one `ctx.member.completions()` call returns, and its default `limit`. */
|
|
851
|
+
readonly memberCompletions: number;
|
|
852
|
+
/** Panels one dashboard holds. */
|
|
853
|
+
readonly dashboardPanels: number;
|
|
854
|
+
/** Dashboards that are not archived one project holds. */
|
|
855
|
+
readonly dashboards: number;
|
|
856
|
+
/** Bounds for successful non-terminal evaluator decisions, independent of failure retries. */
|
|
857
|
+
readonly defer: {
|
|
858
|
+
readonly minRetryAfterMs: number;
|
|
859
|
+
readonly maxRetryAfterMs: number;
|
|
860
|
+
/** The delay a defer without `retryAfterMs` waits. */
|
|
861
|
+
readonly retryAfterMs: number;
|
|
862
|
+
/** How long after the first defer an attempt can still be deferred. */
|
|
863
|
+
readonly horizonMs: number;
|
|
864
|
+
readonly maxDefers: number;
|
|
865
|
+
};
|
|
866
|
+
/**
|
|
867
|
+
* Bounds of a quest's retry cooldown (`retryCooldownMs`) and completion cooldown
|
|
868
|
+
* (`completionCooldownMs`).
|
|
869
|
+
*/
|
|
870
|
+
readonly retryCooldown: {
|
|
871
|
+
readonly minMs: number;
|
|
872
|
+
readonly maxMs: number;
|
|
873
|
+
};
|
|
874
|
+
/** Rows an analytics breakdown or query returns; the rest are summed into `other`. */
|
|
875
|
+
readonly analyticsQueryRows: number;
|
|
876
|
+
/** Limits of hosted apps, per project environment. */
|
|
877
|
+
readonly apps: {
|
|
878
|
+
/** App secrets one project environment holds. */
|
|
879
|
+
readonly secrets: number;
|
|
880
|
+
/** KV stores one app declares. */
|
|
881
|
+
readonly kvStores: number;
|
|
882
|
+
/** SQL stores one app declares. */
|
|
883
|
+
readonly sqlStores: number;
|
|
884
|
+
/** Migrations one SQL store holds. */
|
|
885
|
+
readonly migrations: number;
|
|
886
|
+
/** Bytes of one migration file. */
|
|
887
|
+
readonly migrationFileBytes: number;
|
|
888
|
+
/** Bytes of one SQL store's migrations, summed. */
|
|
889
|
+
readonly migrationTotalBytes: number;
|
|
890
|
+
/** Rows per page when browsing a SQL store's table. */
|
|
891
|
+
readonly storageRows: number;
|
|
892
|
+
/** Longest text a browsed cell or KV value shows; longer values end in `truncated`. */
|
|
893
|
+
readonly storagePreviewCharacters: number;
|
|
894
|
+
/** Characters a full SQL value read returns per page. */
|
|
895
|
+
readonly storageCellCharacters: number;
|
|
896
|
+
/** Schedules one app declares. */
|
|
897
|
+
readonly schedules: number;
|
|
898
|
+
/** The shortest interval between two runs of one schedule, in milliseconds. */
|
|
899
|
+
readonly scheduleMinIntervalMs: number;
|
|
900
|
+
/** How long Relay waits for a scheduled route to answer, in milliseconds. */
|
|
901
|
+
readonly scheduleTimeoutMs: number;
|
|
902
|
+
/**
|
|
903
|
+
* The most a scheduled route's JSON answer can hold for Relay to record it as the run's result.
|
|
904
|
+
*/
|
|
905
|
+
readonly scheduleResultBytes: number;
|
|
906
|
+
};
|
|
907
|
+
/** Caps on a build's staged quest and catalog code. */
|
|
908
|
+
readonly stagedDeployment: {
|
|
909
|
+
/** Bytes of JSON, uncompressed. */
|
|
910
|
+
readonly size: number;
|
|
911
|
+
/** Bytes of the Brotli-compressed object. */
|
|
912
|
+
readonly compressedSize: number;
|
|
913
|
+
};
|
|
914
|
+
/**
|
|
915
|
+
* The most capability calls one hosted evaluation run can make, shared by all capabilities. The
|
|
916
|
+
* next call throws a `CapabilityError` with code `capability-limit`.
|
|
917
|
+
*/
|
|
918
|
+
readonly capabilityCalls: number;
|
|
919
|
+
/** Bounds of a tracker data schema. */
|
|
920
|
+
readonly trackerData: {
|
|
921
|
+
/** The most branches one union may list. */
|
|
922
|
+
readonly branches: number;
|
|
923
|
+
/**
|
|
924
|
+
* The most properties, `required` keys, enum values or allowed key names one schema node lists.
|
|
925
|
+
*/
|
|
926
|
+
readonly entries: number;
|
|
927
|
+
};
|
|
928
|
+
/** Bounds of an X search preview: one sample, never stored, never a tracker. */
|
|
929
|
+
readonly trackerPreview: {
|
|
930
|
+
readonly pages: number;
|
|
931
|
+
readonly posts: number;
|
|
932
|
+
readonly days: number;
|
|
933
|
+
};
|
|
934
|
+
/**
|
|
935
|
+
* The most wallets of one chain family a member can have linked to one project at a time. Sign-in
|
|
936
|
+
* wallets do not count: signing in always links the wallet.
|
|
937
|
+
*/
|
|
938
|
+
readonly walletsPerChain: number;
|
|
939
|
+
/** The most logs one `ctx.wallet.events()` read may match before `where` filters them. */
|
|
940
|
+
readonly walletEventLogs: number;
|
|
941
|
+
/** The most transactions one `ctx.wallet.transactions()` read fetches per wallet. */
|
|
942
|
+
readonly walletTransactions: number;
|
|
943
|
+
};
|
|
944
|
+
/** Relay's platform limits. A 1.x release can raise them, so read them here at run time. */
|
|
945
|
+
declare const limits: Limits;
|
|
946
|
+
|
|
947
|
+
export { type AnalyticsQuest as $, type AnalyticsMetricId as A, publishedImageSchema as B, xConnectionSchema as C, xIdSchema as D, type Extracted as E, xPostSchema as F, xProfileSchema as G, xRequestSchema as H, type ImageReader as I, xUserLookupInputSchema as J, xUserSchema as K, type Limits as L, xUsernameSchema as M, type AnalyticsQuery as N, type AnalyticsRead as O, type PublishedImage as P, type AnalyticsCatalog as Q, type AnalyticsMetricQuery as R, type AnalyticsMetricResult as S, type AnalyticsBreakdown as T, type AnalyticsBreakdownRow as U, type AnalyticsCatalogEntry as V, type AnalyticsChart as W, type XReader as X, type AnalyticsFilter as Y, type AnalyticsMetric as Z, type AnalyticsMetricKind as _, analyticsCatalog as a, type AnalyticsRange as a0, analyticsBreakdowns as a1, analyticsCatalogSchema as a2, analyticsCharts as a3, analyticsFilters as a4, analyticsMetricIds as a5, analyticsMetricQuerySchema as a6, analyticsMetricResultSchema as a7, analyticsQueryLimit as a8, analyticsQuerySchema as a9, analyticsRanges as aa, analyticsReadSchema as ab, type ImageAssetArtifact as b, type ImageComparison as c, type ImageExtraction as d, type ImageFields as e, type ImageInspection as f, type ImageReference as g, type ImageRequest as h, type ImageSightings as i, type XConnection as j, type XPost as k, limits as l, type XProfile as m, type XUser as n, type XUserLookupInput as o, imageAssetArtifactSchema as p, imageComparisonSchema as q, imageExtractionSchema as r, imageFieldSchema as s, imageFieldsSchema as t, imageInspectionSchema as u, imageReferenceSchema as v, imageRequestSchema as w, imageSightingsSchema as x, imageUploadRequestSchema as y, imageUploadsSchema as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { R as ResourceHandle } from './tracker-data-
|
|
3
|
-
import { Z as AuthoringIdentity } from './accounts-
|
|
2
|
+
import { R as ResourceHandle } from './tracker-data-esm3WG8R.js';
|
|
3
|
+
import { Z as AuthoringIdentity } from './accounts-nz3mzfRQ.js';
|
|
4
4
|
|
|
5
5
|
declare const badgePropertiesSchema: z.ZodObject<{
|
|
6
6
|
name: z.ZodString;
|
|
@@ -92,6 +92,7 @@ type ManagedBadge = z.infer<typeof managedBadgeSchema>;
|
|
|
92
92
|
type MemberBadge = z.infer<typeof memberBadgeSchema>;
|
|
93
93
|
/** @compat output */
|
|
94
94
|
type MemberBadges = z.infer<typeof memberBadgesSchema>;
|
|
95
|
+
/** The active badge catalog, as `GET /v1/badges/catalog` returns it. */
|
|
95
96
|
type BadgeCatalog = z.infer<typeof badgeCatalogSchema>;
|
|
96
97
|
|
|
97
98
|
declare const offerPriceSchema: z.ZodObject<{
|
package/dist/portal-proxy.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MemberImportVouchedAccount, P as ParticipantExchangeAccountResult,
|
|
1
|
+
import { M as MemberImportVouchedAccount, P as ParticipantExchangeAccountResult, a as ParticipantExchangeResult, I as IdentityIntegrationKey } from './identity-integration-DOeNZaxF.js';
|
|
2
2
|
import { R as RequestError } from './request-error-D_dUPLwo.js';
|
|
3
|
-
import './tracker-data-
|
|
3
|
+
import './tracker-data-esm3WG8R.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -60,6 +60,18 @@ declare function exchangeParticipant(options: {
|
|
|
60
60
|
accounts?: MemberImportVouchedAccount[];
|
|
61
61
|
fetch?: typeof fetch;
|
|
62
62
|
}): Promise<ParticipantExchangeResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Which integration an app login key (`di_…`) belongs to: its organization, project, environment,
|
|
65
|
+
* origin and the expiry of this key, never a secret. Checking a key does not count as using it.
|
|
66
|
+
* `baseUrl` is the participant API origin: HTTPS, or a loopback HTTP origin for a local stack.
|
|
67
|
+
* Throws ParticipantExchangeError when Domino refuses the key: 401 `invalid-credential` for a key
|
|
68
|
+
* that is unknown, expired or revoked, or whose project was deleted.
|
|
69
|
+
*/
|
|
70
|
+
declare function inspectIntegrationKey(options: {
|
|
71
|
+
baseUrl: string;
|
|
72
|
+
integrationKey: string;
|
|
73
|
+
fetch?: typeof fetch;
|
|
74
|
+
}): Promise<IdentityIntegrationKey>;
|
|
63
75
|
/**
|
|
64
76
|
* Use only in an app server route. authenticate must verify the app's own session.
|
|
65
77
|
* `origin` is the app's exact HTTPS origin, or a loopback HTTP origin
|
|
@@ -69,6 +81,9 @@ declare function exchangeParticipant(options: {
|
|
|
69
81
|
* `authenticate` may also return `accounts` the app vouches belong to the user, which needs the
|
|
70
82
|
* key's **Vouches accounts** setting; `onAccounts` receives each one's outcome, such as an account
|
|
71
83
|
* another member holds.
|
|
84
|
+
* `onExchangeError` receives each refused exchange as Domino answered it (status, code, message and
|
|
85
|
+
* `retryAfter`) before the browser gets its answer, so the server can log why sign-in failed. The
|
|
86
|
+
* browser's answer does not change, and a callback that throws does not change it either.
|
|
72
87
|
*/
|
|
73
88
|
declare function createParticipantBackend(options: {
|
|
74
89
|
baseUrl: string;
|
|
@@ -79,6 +94,7 @@ declare function createParticipantBackend(options: {
|
|
|
79
94
|
accounts?: MemberImportVouchedAccount[];
|
|
80
95
|
} | null>;
|
|
81
96
|
onAccounts?: (results: ParticipantExchangeAccountResult[], request: Request) => void | Promise<void>;
|
|
97
|
+
onExchangeError?: (error: ParticipantExchangeError, request: Request) => void | Promise<void>;
|
|
82
98
|
fetch?: typeof fetch;
|
|
83
99
|
}): (request: Request) => Promise<Response>;
|
|
84
100
|
/**
|
|
@@ -117,4 +133,4 @@ declare function signedInMember(request: Request, env: HostedAppEnv, options: {
|
|
|
117
133
|
fetch?: typeof fetch;
|
|
118
134
|
}): Promise<string | null>;
|
|
119
135
|
|
|
120
|
-
export { type HostedAppEnv, ParticipantExchangeError, createParticipantBackend, exchangeParticipant, handleHostedApp, hostedAppRequest, isParticipantExchangeError, proxyParticipant, signedInMember };
|
|
136
|
+
export { type HostedAppEnv, ParticipantExchangeError, createParticipantBackend, exchangeParticipant, handleHostedApp, hostedAppRequest, inspectIntegrationKey, isParticipantExchangeError, proxyParticipant, signedInMember };
|
package/dist/portal-proxy.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
+
secureOrLoopbackOrigin
|
|
3
|
+
} from "./chunk-UZ765UGH.js";
|
|
4
|
+
import {
|
|
5
|
+
identityIntegrationKeySchema,
|
|
2
6
|
participantExchangeAccountsSchema,
|
|
3
7
|
participantExchangeResultSchema
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KP2MCX3R.js";
|
|
5
9
|
import {
|
|
6
10
|
isParticipantRoute
|
|
7
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-U66GUVSG.js";
|
|
8
12
|
import {
|
|
9
13
|
clientIdentity,
|
|
10
14
|
retryAfter
|
|
11
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3RFP6GT5.js";
|
|
12
16
|
import {
|
|
13
17
|
participantPrincipalSchema,
|
|
14
18
|
sessionMember
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-N4BDKS6Y.js";
|
|
20
|
+
import "./chunk-ID3BZXFZ.js";
|
|
17
21
|
import {
|
|
18
22
|
RequestError,
|
|
19
23
|
isRequestError
|
|
20
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GLH6MEI2.js";
|
|
21
25
|
|
|
22
26
|
// src/portal-proxy.ts
|
|
23
27
|
import * as z from "zod";
|
|
@@ -110,9 +114,9 @@ function requestExchange(options, body) {
|
|
|
110
114
|
})
|
|
111
115
|
});
|
|
112
116
|
}
|
|
113
|
-
var participantExchangeErrorBrand = /* @__PURE__ */ Symbol.for(
|
|
117
|
+
var participantExchangeErrorBrand = /* @__PURE__ */ (() => /* @__PURE__ */ Symbol.for(
|
|
114
118
|
"@domino-sdk/relay.ParticipantExchangeError"
|
|
115
|
-
);
|
|
119
|
+
))();
|
|
116
120
|
function isParticipantExchangeError(value) {
|
|
117
121
|
return isRequestError(value) && value[participantExchangeErrorBrand] === true;
|
|
118
122
|
}
|
|
@@ -139,24 +143,53 @@ async function exchangeParticipant(options) {
|
|
|
139
143
|
accounts: options.accounts
|
|
140
144
|
});
|
|
141
145
|
if (!exchanged.ok) {
|
|
142
|
-
|
|
143
|
-
throw new ParticipantExchangeError(
|
|
144
|
-
typeof body?.error === "string" ? body.error : `Domino identity exchange failed with status ${exchanged.status}`,
|
|
145
|
-
{
|
|
146
|
-
status: exchanged.status,
|
|
147
|
-
code: typeof body?.code === "string" ? body.code : statusCode(exchanged.status),
|
|
148
|
-
retryAfter: retryAfter(exchanged.headers)
|
|
149
|
-
}
|
|
150
|
-
);
|
|
146
|
+
throw await refusal(exchanged, "Domino identity exchange");
|
|
151
147
|
}
|
|
152
148
|
return participantExchangeResultSchema.parse(await exchanged.json());
|
|
153
149
|
}
|
|
154
|
-
|
|
150
|
+
async function refusal(response, what) {
|
|
151
|
+
return refusalError(response, await response.json().catch(() => null), what);
|
|
152
|
+
}
|
|
153
|
+
function refusalError(response, body, what) {
|
|
154
|
+
return new ParticipantExchangeError(
|
|
155
|
+
typeof body?.error === "string" ? body.error : `${what} failed with status ${response.status}`,
|
|
156
|
+
{
|
|
157
|
+
status: response.status,
|
|
158
|
+
code: typeof body?.code === "string" ? body.code : statusCode(response.status),
|
|
159
|
+
retryAfter: retryAfter(response.headers)
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
async function inspectIntegrationKey(options) {
|
|
164
|
+
const base = new URL(options.baseUrl);
|
|
165
|
+
if (!secureOrLoopbackOrigin(base) || base.origin !== options.baseUrl) {
|
|
166
|
+
throw new Error("Configure the exact participant API origin");
|
|
167
|
+
}
|
|
168
|
+
if (!options.integrationKey.startsWith("di_")) {
|
|
169
|
+
throw new Error(
|
|
170
|
+
"Use an identity integration server key from Console Settings"
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
const answered = await (options.fetch ?? fetch)(
|
|
174
|
+
options.baseUrl + "/v1/auth/integration",
|
|
175
|
+
{
|
|
176
|
+
method: "GET",
|
|
177
|
+
redirect: "manual",
|
|
178
|
+
headers: {
|
|
179
|
+
Authorization: "Bearer " + options.integrationKey,
|
|
180
|
+
"X-Domino-Client": clientIdentity()
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
if (!answered.ok) {
|
|
185
|
+
throw await refusal(answered, "Domino app login key check");
|
|
186
|
+
}
|
|
187
|
+
return identityIntegrationKeySchema.parse(await answered.json());
|
|
188
|
+
}
|
|
155
189
|
function createParticipantBackend(options) {
|
|
156
190
|
const origin = new URL(options.origin);
|
|
157
191
|
const base = new URL(options.baseUrl);
|
|
158
|
-
|
|
159
|
-
if (origin.protocol !== "https:" && !loopback || origin.origin !== options.origin || base.protocol !== "https:" || base.origin !== options.baseUrl) {
|
|
192
|
+
if (!secureOrLoopbackOrigin(origin) || origin.origin !== options.origin || base.protocol !== "https:" || base.origin !== options.baseUrl) {
|
|
160
193
|
throw new Error(
|
|
161
194
|
"Configure exact HTTPS application and participant API origins"
|
|
162
195
|
);
|
|
@@ -167,6 +200,7 @@ function createParticipantBackend(options) {
|
|
|
167
200
|
);
|
|
168
201
|
}
|
|
169
202
|
const send = options.fetch ?? fetch;
|
|
203
|
+
const loopback = origin.protocol === "http:";
|
|
170
204
|
const cookie = (token) => (
|
|
171
205
|
// WebKit drops a Secure cookie on http://localhost, so a loopback origin sets it without.
|
|
172
206
|
`domino_app_session=${token}; Path=/relay; HttpOnly;${loopback ? "" : " Secure;"} SameSite=Lax; Max-Age=${token ? 28800 : 0}`
|
|
@@ -204,8 +238,15 @@ function createParticipantBackend(options) {
|
|
|
204
238
|
});
|
|
205
239
|
if (!exchanged.ok) {
|
|
206
240
|
const body = await exchanged.json().catch(() => null);
|
|
207
|
-
const
|
|
241
|
+
const failure = refusalError(exchanged, body, "Domino identity exchange");
|
|
242
|
+
const { code } = failure;
|
|
208
243
|
const wait = exchanged.headers.get("Retry-After");
|
|
244
|
+
if (options.onExchangeError) {
|
|
245
|
+
try {
|
|
246
|
+
await options.onExchangeError(failure, request);
|
|
247
|
+
} catch {
|
|
248
|
+
}
|
|
249
|
+
}
|
|
209
250
|
return Response.json(
|
|
210
251
|
{
|
|
211
252
|
error: (exchanged.status === 409 || code === "ACCOUNT_VOUCHING_OFF") && typeof body?.error === "string" ? body.error : exchanged.status === 409 ? "Domino refused this account. Ask an organizer." : "Domino identity exchange failed. Check the server integration key and its expiry in Console Settings.",
|
|
@@ -320,13 +361,14 @@ async function signedInMember(request, env, options) {
|
|
|
320
361
|
);
|
|
321
362
|
return session.success ? sessionMember(session.data) : null;
|
|
322
363
|
}
|
|
323
|
-
var signedInSessionSchema = z.object({ principal: participantPrincipalSchema }).nullable();
|
|
364
|
+
var signedInSessionSchema = /* @__PURE__ */ (() => z.object({ principal: participantPrincipalSchema }).nullable())();
|
|
324
365
|
export {
|
|
325
366
|
ParticipantExchangeError,
|
|
326
367
|
createParticipantBackend,
|
|
327
368
|
exchangeParticipant,
|
|
328
369
|
handleHostedApp,
|
|
329
370
|
hostedAppRequest,
|
|
371
|
+
inspectIntegrationKey,
|
|
330
372
|
isParticipantExchangeError,
|
|
331
373
|
proxyParticipant,
|
|
332
374
|
signedInMember
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { B as Badge, c as MemberBadges, O as Offer, f as Redemption } from '../offers-
|
|
1
|
+
import { B as Badge, c as MemberBadges, O as Offer, f as Redemption } from '../offers-CYeN_I0Y.js';
|
|
2
2
|
import { b as ParticipantSession, R as RelayEvent, P as ParticipantActivity, M as MemberSummary } from '../participant-activity-D-Drp24G.js';
|
|
3
|
-
import { g as RelayError, R as RelayClient, m as SubmissionDraft } from '../client-
|
|
4
|
-
import { P as Page,
|
|
5
|
-
export { C as ConsentChannel, b as ConsentSource, c as ConsentState, d as CreatorAccount, f as CreatorAccounts, g as KnownConsentSource, h as KnownConsentState } from '../
|
|
3
|
+
import { g as RelayError, R as RelayClient, m as SubmissionDraft } from '../client-DHmG7rn6.js';
|
|
4
|
+
import { P as Page, u as RewardDeliveryAction, e as CreatorAccountProvider, K as KnownConsentChannel, M as MemberConsent, n as QuestOutcomeQuery, l as QuestOutcome } from '../reward-deliveries-drp-x1G-.js';
|
|
5
|
+
export { C as ConsentChannel, b as ConsentSource, c as ConsentState, d as CreatorAccount, f as CreatorAccounts, g as KnownConsentSource, h as KnownConsentState } from '../reward-deliveries-drp-x1G-.js';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import { ReactNode } from 'react';
|
|
8
8
|
import * as z from 'zod';
|
|
9
9
|
import { z as z$1 } from 'zod';
|
|
10
|
-
import { l as collectionViewSchema, b as QuestView } from '../catalog
|
|
11
|
-
import { E as Entitlement, b as AttemptStatus, V as AttemptCodeSource, c as AuthProvider, J as SignInProvider, A as AccountConnection, I as SignInAccountStatus, p as LeaderboardPlacement, dL as referralSummarySchema, o as LeaderboardPage, u as PointEntry, t as PointBalances, y as PointLedgerReference, U as TieredRewardReference } from '../accounts-
|
|
12
|
-
export { S as SignInAccount, N as SignInProviderOption } from '../accounts-
|
|
13
|
-
import { c as SignInMethods, C as CosmosChains, d as SignInOption, P as ProviderSignInOption, f as SignInUnavailable, T as TelegramSignInOption, g as SignInWallet, D as DiscoveredWallet } from '../telegram-browser-
|
|
14
|
-
export { a as EmailSignInOption, O as OAuthSignInOption, b as SignInIcon, W as WalletSignInOption, t as telegramMiniAppInitData } from '../telegram-browser-
|
|
15
|
-
import { m as WalletSigner, k as WalletSignInNetwork, L as LinkedWallet, g as ProfileUpdate, f as ProfileSummary, b as ProfileCompletion, e as ProfileReferral } from '../wallet-
|
|
16
|
-
export { T as TelegramAccountConnection, a as TelegramSignInMethods } from '../submission-input-
|
|
17
|
-
import '../tracker-data-
|
|
10
|
+
import { l as collectionViewSchema, b as QuestView } from '../catalog-BaTOKpNw.js';
|
|
11
|
+
import { E as Entitlement, b as AttemptStatus, V as AttemptCodeSource, c as AuthProvider, J as SignInProvider, A as AccountConnection, I as SignInAccountStatus, p as LeaderboardPlacement, dL as referralSummarySchema, o as LeaderboardPage, u as PointEntry, t as PointBalances, y as PointLedgerReference, U as TieredRewardReference } from '../accounts-nz3mzfRQ.js';
|
|
12
|
+
export { S as SignInAccount, N as SignInProviderOption } from '../accounts-nz3mzfRQ.js';
|
|
13
|
+
import { c as SignInMethods, C as CosmosChains, d as SignInOption, P as ProviderSignInOption, f as SignInUnavailable, T as TelegramSignInOption, g as SignInWallet, D as DiscoveredWallet } from '../telegram-browser-NL0Asmsi.js';
|
|
14
|
+
export { a as EmailSignInOption, O as OAuthSignInOption, b as SignInIcon, W as WalletSignInOption, t as telegramMiniAppInitData } from '../telegram-browser-NL0Asmsi.js';
|
|
15
|
+
import { m as WalletSigner, k as WalletSignInNetwork, L as LinkedWallet, g as ProfileUpdate, f as ProfileSummary, b as ProfileCompletion, e as ProfileReferral } from '../wallet-B7e06v4m.js';
|
|
16
|
+
export { T as TelegramAccountConnection, a as TelegramSignInMethods } from '../submission-input-DZCbjQUH.js';
|
|
17
|
+
import '../tracker-data-esm3WG8R.js';
|
|
18
18
|
import '../request-error-D_dUPLwo.js';
|
|
19
19
|
import '../action-9Xl0StBg.js';
|
|
20
|
-
import '../sign-in-providers-
|
|
20
|
+
import '../sign-in-providers-B1Q9eDRm.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* A query's identity: plain JSON values, outermost group first, such as
|
|
@@ -342,13 +342,20 @@ declare function useRelay(): RelayClient;
|
|
|
342
342
|
* experience every `polling.snapshotMs` (30 seconds), for changes no event announces and as the
|
|
343
343
|
* fallback when the feed is unavailable. A new `polling` value takes effect like a new client.
|
|
344
344
|
*
|
|
345
|
+
* After a wallet sign-in, the provider follows the wallet: when it switches to another account or
|
|
346
|
+
* locks, the member is signed out, so the page never shows one account's progress beside another
|
|
347
|
+
* account's wallet. Pass `followWallet={false}` to keep the session until the member signs out,
|
|
348
|
+
* for an app that handles `accountsChanged` itself.
|
|
349
|
+
*
|
|
345
350
|
* On a staging host, Domino's test toolbar fires `domino:test-state-changed` on `window` after it
|
|
346
351
|
* changes test data under the page; the provider then reads the session and every query again.
|
|
347
352
|
*/
|
|
348
|
-
declare function RelayProvider({ client, baseUrl, polling, children, }: {
|
|
353
|
+
declare function RelayProvider({ client, baseUrl, polling, followWallet, children, }: {
|
|
349
354
|
client?: RelayClient;
|
|
350
355
|
baseUrl?: string;
|
|
351
356
|
polling?: RelayPolling;
|
|
357
|
+
/** Sign the member out when the wallet they signed in with switches account or locks. Default true. */
|
|
358
|
+
followWallet?: boolean;
|
|
352
359
|
children: ReactNode;
|
|
353
360
|
}): react.JSX.Element;
|
|
354
361
|
|