@domino-sdk/relay 0.19.0 → 0.23.1
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 +3 -2
- package/dist/authoring.js +3 -2
- package/dist/browser.d.ts +99 -90
- package/dist/browser.js +5 -5
- package/dist/{chunk-6GH4NC2T.js → chunk-57TGYC5Y.js} +1 -1
- package/dist/{chunk-MVDIVWR5.js → chunk-ND3CVNIW.js} +1 -1
- package/dist/{chunk-TQUK4DIW.js → chunk-RTBIXGMH.js} +301 -112
- package/dist/{chunk-23ZZTCDK.js → chunk-UYS522ER.js} +5 -0
- package/dist/{chunk-FBOW2TLN.js → chunk-ZOL7RYHW.js} +1 -1
- package/dist/index.d.ts +269 -103
- package/dist/index.js +38 -4
- package/dist/portal-proxy.js +3 -3
- package/dist/react/index.d.ts +179 -94
- package/dist/react/index.js +36 -5
- package/dist/schema.d.ts +11 -3
- package/dist/schema.js +3 -1
- package/dist/{submission-input-C67qt2Ph.d.ts → submission-input-CK4Dy19H.d.ts} +258 -1
- package/package.json +1 -1
|
@@ -18,12 +18,12 @@ import {
|
|
|
18
18
|
referralHistorySchema,
|
|
19
19
|
referralSummarySchema,
|
|
20
20
|
validateAuthoringIdentity
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZOL7RYHW.js";
|
|
22
22
|
import {
|
|
23
23
|
authScopeSchema,
|
|
24
24
|
exchangeResultSchema,
|
|
25
25
|
sessionSchema
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-57TGYC5Y.js";
|
|
27
27
|
import {
|
|
28
28
|
accountConnectionSchema,
|
|
29
29
|
attemptSchema,
|
|
@@ -42,9 +42,8 @@ import {
|
|
|
42
42
|
errorSchema,
|
|
43
43
|
evidenceSchema,
|
|
44
44
|
identifier,
|
|
45
|
-
memberListSchema,
|
|
46
|
-
memberPageSchema,
|
|
47
45
|
memberProgressSchema,
|
|
46
|
+
photoResultSchema,
|
|
48
47
|
pickupAvailabilitySchema,
|
|
49
48
|
pickupSelectionSchema,
|
|
50
49
|
publishedReleaseSchema,
|
|
@@ -52,19 +51,18 @@ import {
|
|
|
52
51
|
questDescriptionSchema,
|
|
53
52
|
quizEvidenceSchema,
|
|
54
53
|
releaseSchema,
|
|
55
|
-
reviewListSchema,
|
|
56
54
|
reviewModeSchema,
|
|
57
|
-
reviewPageSchema,
|
|
58
55
|
settingsValuesSchema,
|
|
59
56
|
snapshotSchema,
|
|
60
57
|
storedReviewModeSchema,
|
|
61
58
|
submissionEvidenceSchema,
|
|
62
59
|
templateSchema,
|
|
60
|
+
tieredRewardReferenceSchema,
|
|
63
61
|
trackerArtifactSchema,
|
|
64
62
|
validateSubmissionValue,
|
|
65
63
|
valueEvidenceSchema,
|
|
66
64
|
xTweetSchema
|
|
67
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-UYS522ER.js";
|
|
68
66
|
|
|
69
67
|
// src/point-ledgers.ts
|
|
70
68
|
import { z } from "zod";
|
|
@@ -77,6 +75,11 @@ var pointLedgerSchema = pointLedgerPropertiesSchema.extend({
|
|
|
77
75
|
id: identifier
|
|
78
76
|
});
|
|
79
77
|
var pointLedgerDeclarationSchema = pointLedgerPropertiesSchema.extend({ key: identifier }).strict();
|
|
78
|
+
var pointLedgerReferenceSchema = z.object({
|
|
79
|
+
id: identifier,
|
|
80
|
+
key: identifier.nullable(),
|
|
81
|
+
name: z.string()
|
|
82
|
+
});
|
|
80
83
|
|
|
81
84
|
// src/reward-deliveries.ts
|
|
82
85
|
import { z as z2 } from "zod";
|
|
@@ -202,12 +205,27 @@ var saveQuestDraftSchema = z3.object({
|
|
|
202
205
|
changes: questDraftChangesSchema
|
|
203
206
|
}).strict();
|
|
204
207
|
var publishQuestDraftSchema = z3.object({ id: identifier, expectedRevision: z3.number().int().positive() }).strict();
|
|
208
|
+
var questRewardViewSchema = z3.discriminatedUnion("kind", [
|
|
209
|
+
z3.object({
|
|
210
|
+
kind: z3.literal("points"),
|
|
211
|
+
label: z3.string(),
|
|
212
|
+
amount: z3.number().int().nonnegative(),
|
|
213
|
+
ledger: pointLedgerReferenceSchema
|
|
214
|
+
}),
|
|
215
|
+
z3.object({
|
|
216
|
+
kind: z3.literal("tier"),
|
|
217
|
+
label: z3.string(),
|
|
218
|
+
reward: tieredRewardReferenceSchema.extend({ title: z3.string() }),
|
|
219
|
+
tier: identifier
|
|
220
|
+
}),
|
|
221
|
+
z3.object({ kind: z3.literal("integration"), label: z3.string() })
|
|
222
|
+
]);
|
|
205
223
|
var questViewSchema = memberProgressSchema.shape.quests.element.extend(
|
|
206
224
|
{
|
|
207
225
|
release: identifier,
|
|
208
226
|
interaction: interactionSchema,
|
|
209
227
|
lifecycle: z3.enum(["active", "paused", "archived"]),
|
|
210
|
-
rewards: z3.array(
|
|
228
|
+
rewards: z3.array(questRewardViewSchema)
|
|
211
229
|
}
|
|
212
230
|
);
|
|
213
231
|
var collectionViewSchema = z3.object({
|
|
@@ -803,7 +821,7 @@ function observeProgress(transport, listener, options = {}, onDispose = () => {
|
|
|
803
821
|
}
|
|
804
822
|
|
|
805
823
|
// src/index.ts
|
|
806
|
-
import { z as
|
|
824
|
+
import { z as z11 } from "zod";
|
|
807
825
|
|
|
808
826
|
// src/wallet.ts
|
|
809
827
|
import { z as z5 } from "zod";
|
|
@@ -870,88 +888,245 @@ function questConfiguration(release) {
|
|
|
870
888
|
}
|
|
871
889
|
|
|
872
890
|
// src/deployments.ts
|
|
891
|
+
import { z as z9 } from "zod";
|
|
892
|
+
|
|
893
|
+
// src/images.ts
|
|
894
|
+
import { z as z8 } from "zod";
|
|
895
|
+
|
|
896
|
+
// src/x.ts
|
|
873
897
|
import { z as z7 } from "zod";
|
|
898
|
+
var xIdSchema = z7.string().regex(/^[0-9]{1,20}$/);
|
|
899
|
+
var xConnectionSchema = z7.object({ userId: xIdSchema });
|
|
900
|
+
var xProfileSchema = z7.object({
|
|
901
|
+
id: xIdSchema,
|
|
902
|
+
username: z7.string(),
|
|
903
|
+
name: z7.string(),
|
|
904
|
+
bio: z7.string().nullable(),
|
|
905
|
+
profileImageUrl: z7.string().url().nullable(),
|
|
906
|
+
followersCount: z7.number().int().nonnegative().nullable(),
|
|
907
|
+
verified: z7.boolean().nullable()
|
|
908
|
+
});
|
|
909
|
+
var xPostSchema = xTweetSchema.extend({
|
|
910
|
+
quotedTweetId: xIdSchema.nullish().transform((v) => v ?? null),
|
|
911
|
+
inReplyToUserId: xIdSchema.nullish().transform((v) => v ?? null),
|
|
912
|
+
inReplyToStatusId: xIdSchema.nullish().transform((v) => v ?? null),
|
|
913
|
+
retweetedTweetId: xIdSchema.nullish().transform((v) => v ?? null),
|
|
914
|
+
/**
|
|
915
|
+
* Attached media in post order. Videos and GIFs carry their preview image URL. Like the tracker
|
|
916
|
+
* projection (migration 0056), a list with any malformed item is dropped whole, so positions
|
|
917
|
+
* never shift and a bad entry never fails the post read.
|
|
918
|
+
*/
|
|
919
|
+
media: z7.unknown().transform(
|
|
920
|
+
(value) => z7.array(z7.object({ type: z7.string(), url: z7.string() })).safeParse(value).data ?? []
|
|
921
|
+
)
|
|
922
|
+
});
|
|
923
|
+
var xRequestSchema = z7.discriminatedUnion("operation", [
|
|
924
|
+
z7.object({ operation: z7.literal("connection") }).strict(),
|
|
925
|
+
z7.object({ operation: z7.literal("profile") }).strict(),
|
|
926
|
+
z7.object({ operation: z7.literal("post"), postId: xIdSchema }).strict(),
|
|
927
|
+
z7.object({ operation: z7.literal("follows"), userId: xIdSchema }).strict(),
|
|
928
|
+
z7.object({ operation: z7.literal("reposted"), postId: xIdSchema }).strict()
|
|
929
|
+
]);
|
|
930
|
+
|
|
931
|
+
// src/images.ts
|
|
932
|
+
var imageReferenceSchema = z8.union([
|
|
933
|
+
z8.strictObject({ evidence: z8.string().min(1).max(256) }),
|
|
934
|
+
z8.strictObject({ x: z8.literal("profile") }),
|
|
935
|
+
z8.strictObject({
|
|
936
|
+
x: z8.literal("post"),
|
|
937
|
+
postId: xIdSchema,
|
|
938
|
+
index: z8.number().int().min(0).max(3).default(0)
|
|
939
|
+
}),
|
|
940
|
+
z8.strictObject({ asset: identifier })
|
|
941
|
+
]);
|
|
942
|
+
var criteria = z8.string().trim().min(1).max(2e3);
|
|
943
|
+
var imageFieldSchema = z8.strictObject({
|
|
944
|
+
type: z8.enum(["string", "number", "boolean"]),
|
|
945
|
+
description: z8.string().trim().min(1).max(500)
|
|
946
|
+
});
|
|
947
|
+
var imageFieldsSchema = z8.record(z8.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/), imageFieldSchema).refine((fields) => {
|
|
948
|
+
const count = Object.keys(fields).length;
|
|
949
|
+
return count >= 1 && count <= 12;
|
|
950
|
+
}, "Declare between 1 and 12 fields");
|
|
951
|
+
var imageRequestSchema = z8.discriminatedUnion("operation", [
|
|
952
|
+
z8.strictObject({
|
|
953
|
+
operation: z8.literal("inspect"),
|
|
954
|
+
image: imageReferenceSchema
|
|
955
|
+
}),
|
|
956
|
+
z8.strictObject({
|
|
957
|
+
operation: z8.literal("compare"),
|
|
958
|
+
images: z8.tuple([imageReferenceSchema, imageReferenceSchema])
|
|
959
|
+
}),
|
|
960
|
+
z8.strictObject({
|
|
961
|
+
operation: z8.literal("review"),
|
|
962
|
+
images: z8.array(imageReferenceSchema).min(1).max(4),
|
|
963
|
+
criteria
|
|
964
|
+
}),
|
|
965
|
+
z8.strictObject({
|
|
966
|
+
operation: z8.literal("extract"),
|
|
967
|
+
image: imageReferenceSchema,
|
|
968
|
+
fields: imageFieldsSchema
|
|
969
|
+
}),
|
|
970
|
+
z8.strictObject({
|
|
971
|
+
operation: z8.literal("seen"),
|
|
972
|
+
image: imageReferenceSchema,
|
|
973
|
+
maxDistance: z8.number().int().min(0).max(8).default(8)
|
|
974
|
+
})
|
|
975
|
+
]);
|
|
976
|
+
var hash = z8.string().regex(/^[0-9a-f]{16}$/);
|
|
977
|
+
var imageInspectionSchema = z8.strictObject({
|
|
978
|
+
width: z8.number().int().positive(),
|
|
979
|
+
height: z8.number().int().positive(),
|
|
980
|
+
format: z8.enum(["jpeg", "png", "webp", "gif", "avif"]),
|
|
981
|
+
bytes: z8.number().int().positive(),
|
|
982
|
+
sha256: z8.string().regex(/^[0-9a-f]{64}$/),
|
|
983
|
+
phash: hash,
|
|
984
|
+
dhash: hash
|
|
985
|
+
});
|
|
986
|
+
var distance = z8.number().int().min(0).max(64);
|
|
987
|
+
var imageComparisonSchema = z8.strictObject({
|
|
988
|
+
identical: z8.boolean(),
|
|
989
|
+
phashDistance: distance,
|
|
990
|
+
dhashDistance: distance
|
|
991
|
+
});
|
|
992
|
+
var imageExtractionSchema = z8.strictObject({
|
|
993
|
+
values: z8.record(
|
|
994
|
+
z8.string(),
|
|
995
|
+
z8.union([z8.string().max(2e3), z8.number(), z8.boolean(), z8.null()])
|
|
996
|
+
),
|
|
997
|
+
reason: z8.string().min(1).max(2e3)
|
|
998
|
+
});
|
|
999
|
+
var imageSightingsSchema = z8.strictObject({
|
|
1000
|
+
matches: z8.number().int().nonnegative(),
|
|
1001
|
+
closestDistance: distance.nullable(),
|
|
1002
|
+
firstSeenAt: z8.number().int().nonnegative().nullable()
|
|
1003
|
+
});
|
|
1004
|
+
var sha256 = z8.string().regex(/^[0-9a-f]{64}$/);
|
|
1005
|
+
var imageSize = z8.number().int().positive().max(5 * 1024 * 1024);
|
|
1006
|
+
var imageAssetArtifactSchema = z8.strictObject({
|
|
1007
|
+
key: identifier,
|
|
1008
|
+
sha256,
|
|
1009
|
+
size: imageSize,
|
|
1010
|
+
path: z8.string().min(1).max(500).optional()
|
|
1011
|
+
});
|
|
1012
|
+
var imageUploadRequestSchema = z8.strictObject({
|
|
1013
|
+
images: z8.array(
|
|
1014
|
+
z8.strictObject({
|
|
1015
|
+
sha256,
|
|
1016
|
+
size: imageSize,
|
|
1017
|
+
type: z8.enum(["image/jpeg", "image/png", "image/webp"])
|
|
1018
|
+
})
|
|
1019
|
+
).min(1).max(10)
|
|
1020
|
+
});
|
|
1021
|
+
var imageUploadsSchema = z8.strictObject({
|
|
1022
|
+
images: z8.array(
|
|
1023
|
+
z8.strictObject({
|
|
1024
|
+
sha256,
|
|
1025
|
+
upload: z8.strictObject({
|
|
1026
|
+
url: z8.string().url(),
|
|
1027
|
+
headers: z8.record(z8.string(), z8.string()),
|
|
1028
|
+
expiresAt: z8.number().int().positive()
|
|
1029
|
+
}).nullable()
|
|
1030
|
+
})
|
|
1031
|
+
)
|
|
1032
|
+
});
|
|
1033
|
+
var publishedImageSchema = z8.strictObject({
|
|
1034
|
+
key: identifier,
|
|
1035
|
+
sha256,
|
|
1036
|
+
type: z8.enum(["image/jpeg", "image/png", "image/webp"]),
|
|
1037
|
+
size: imageSize,
|
|
1038
|
+
width: z8.number().int().positive(),
|
|
1039
|
+
height: z8.number().int().positive()
|
|
1040
|
+
});
|
|
1041
|
+
function parseImageExtraction(raw, value) {
|
|
1042
|
+
const result = imageExtractionSchema.parse(value);
|
|
1043
|
+
const fields = imageFieldsSchema.parse(raw);
|
|
1044
|
+
for (const [key, field] of Object.entries(fields)) {
|
|
1045
|
+
const extracted = result.values[key];
|
|
1046
|
+
if (extracted === void 0) {
|
|
1047
|
+
throw new Error("Image extraction omitted " + key);
|
|
1048
|
+
}
|
|
1049
|
+
if (extracted !== null && typeof extracted !== field.type) {
|
|
1050
|
+
throw new Error("Image extraction returned the wrong type for " + key);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
if (Object.keys(result.values).some((key) => !Object.hasOwn(fields, key))) {
|
|
1054
|
+
throw new Error("Image extraction returned an undeclared field");
|
|
1055
|
+
}
|
|
1056
|
+
return result;
|
|
1057
|
+
}
|
|
1058
|
+
function parseImageResult(request, value) {
|
|
1059
|
+
switch (request.operation) {
|
|
1060
|
+
case "inspect":
|
|
1061
|
+
return imageInspectionSchema.parse(value);
|
|
1062
|
+
case "compare":
|
|
1063
|
+
return imageComparisonSchema.parse(value);
|
|
1064
|
+
case "review":
|
|
1065
|
+
return photoResultSchema.parse(value);
|
|
1066
|
+
case "extract":
|
|
1067
|
+
return parseImageExtraction(request.fields, value);
|
|
1068
|
+
case "seen":
|
|
1069
|
+
return imageSightingsSchema.parse(value);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
// src/deployments.ts
|
|
874
1074
|
var projectCatalogArtifactSchema = catalogDeploymentSchema.omit({ expectedRevision: true }).extend({
|
|
875
|
-
engagement:
|
|
876
|
-
trackers:
|
|
877
|
-
pointLedgers:
|
|
878
|
-
referrals:
|
|
879
|
-
leaderboards:
|
|
1075
|
+
engagement: z9.array(engagementArtifactSchema).max(50).default([]),
|
|
1076
|
+
trackers: z9.array(trackerArtifactSchema).max(50).default([]),
|
|
1077
|
+
pointLedgers: z9.array(pointLedgerDeclarationSchema).max(50).default([]),
|
|
1078
|
+
referrals: z9.array(referralArtifactSchema).max(50).default([]),
|
|
1079
|
+
leaderboards: z9.array(leaderboardArtifactSchema).max(50).default([]),
|
|
1080
|
+
images: z9.array(imageAssetArtifactSchema).max(10).default([])
|
|
880
1081
|
});
|
|
881
|
-
var projectDeploymentSchema = projectCatalogArtifactSchema.extend({ releases:
|
|
882
|
-
(value) => value.engagement.length > 0 || value.trackers.length > 0 || value.pointLedgers.length > 0 || value.releases.length > 0 || value.leaderboards.length > 0 || value.referrals.length > 0 || value.types.length > 0 || value.collections.length > 0 || value.supportedInteractions !== void 0,
|
|
883
|
-
"No resources configured. Add engagement, trackers, quests, questTypes, pointLedgers, leaderboards, referrals, collections, or supportedInteractions to relay.json."
|
|
1082
|
+
var projectDeploymentSchema = projectCatalogArtifactSchema.extend({ releases: z9.array(releaseSchema).max(50).default([]) }).refine(
|
|
1083
|
+
(value) => value.engagement.length > 0 || value.trackers.length > 0 || value.pointLedgers.length > 0 || value.releases.length > 0 || value.leaderboards.length > 0 || value.referrals.length > 0 || value.images.length > 0 || value.types.length > 0 || value.collections.length > 0 || value.supportedInteractions !== void 0,
|
|
1084
|
+
"No resources configured. Add engagement, trackers, quests, questTypes, pointLedgers, leaderboards, referrals, images, collections, or supportedInteractions to relay.json."
|
|
884
1085
|
);
|
|
885
|
-
var deploymentPreviewSchema =
|
|
1086
|
+
var deploymentPreviewSchema = z9.object({
|
|
886
1087
|
id: identifier,
|
|
887
|
-
engagement:
|
|
888
|
-
trackers:
|
|
889
|
-
baseRevision:
|
|
890
|
-
pointLedgers:
|
|
891
|
-
releases:
|
|
892
|
-
types:
|
|
893
|
-
collections:
|
|
894
|
-
supportedInteractions:
|
|
895
|
-
referrals:
|
|
896
|
-
leaderboards:
|
|
1088
|
+
engagement: z9.array(engagementDeploymentEntrySchema).default([]),
|
|
1089
|
+
trackers: z9.array(publishedTrackerSchema).default([]),
|
|
1090
|
+
baseRevision: z9.number().int().nonnegative(),
|
|
1091
|
+
pointLedgers: z9.array(pointLedgerSchema).default([]),
|
|
1092
|
+
releases: z9.array(publishedReleaseSchema),
|
|
1093
|
+
types: z9.array(questTypeVersionSchema),
|
|
1094
|
+
collections: z9.array(questCollectionSchema),
|
|
1095
|
+
supportedInteractions: z9.array(interactionSchema),
|
|
1096
|
+
referrals: z9.array(publishedReferralSchema).default([]),
|
|
1097
|
+
leaderboards: z9.array(leaderboardPreviewSchema).default([]),
|
|
1098
|
+
images: z9.array(publishedImageSchema).default([])
|
|
897
1099
|
});
|
|
898
|
-
var publishDeploymentSchema =
|
|
1100
|
+
var publishDeploymentSchema = z9.object({ id: identifier }).strict();
|
|
899
1101
|
var deploymentResultSchema = deploymentPreviewSchema.extend({
|
|
900
|
-
revision:
|
|
1102
|
+
revision: z9.number().int().positive()
|
|
901
1103
|
});
|
|
902
1104
|
|
|
903
1105
|
// src/identity-integration.ts
|
|
904
|
-
import { z as
|
|
905
|
-
var identityIntegrationInputSchema =
|
|
906
|
-
name:
|
|
907
|
-
origin:
|
|
1106
|
+
import { z as z10 } from "zod";
|
|
1107
|
+
var identityIntegrationInputSchema = z10.object({
|
|
1108
|
+
name: z10.string().trim().min(1).max(80),
|
|
1109
|
+
origin: z10.string().url().refine((value) => {
|
|
908
1110
|
const url = new URL(value);
|
|
909
1111
|
return url.protocol === "https:" && url.origin === value;
|
|
910
1112
|
}, "Use an exact HTTPS application origin")
|
|
911
1113
|
}).strict();
|
|
912
1114
|
var identityIntegrationSchema = authScopeSchema.extend({
|
|
913
|
-
id:
|
|
914
|
-
name:
|
|
915
|
-
origin:
|
|
916
|
-
expiresAt:
|
|
1115
|
+
id: z10.string().uuid(),
|
|
1116
|
+
name: z10.string(),
|
|
1117
|
+
origin: z10.string(),
|
|
1118
|
+
expiresAt: z10.number()
|
|
917
1119
|
});
|
|
918
1120
|
var identityIntegrationSecretSchema = identityIntegrationSchema.extend(
|
|
919
1121
|
{
|
|
920
|
-
token:
|
|
1122
|
+
token: z10.string()
|
|
921
1123
|
}
|
|
922
1124
|
);
|
|
923
|
-
var participantExchangeSchema =
|
|
924
|
-
subject:
|
|
925
|
-
previousToken:
|
|
1125
|
+
var participantExchangeSchema = z10.object({
|
|
1126
|
+
subject: z10.string().min(1).max(200),
|
|
1127
|
+
previousToken: z10.string().max(200).optional()
|
|
926
1128
|
}).strict();
|
|
927
1129
|
|
|
928
|
-
// src/x.ts
|
|
929
|
-
import { z as z9 } from "zod";
|
|
930
|
-
var xIdSchema = z9.string().regex(/^[0-9]{1,20}$/);
|
|
931
|
-
var xConnectionSchema = z9.object({ userId: xIdSchema });
|
|
932
|
-
var xProfileSchema = z9.object({
|
|
933
|
-
id: xIdSchema,
|
|
934
|
-
username: z9.string(),
|
|
935
|
-
name: z9.string(),
|
|
936
|
-
bio: z9.string().nullable(),
|
|
937
|
-
profileImageUrl: z9.string().url().nullable(),
|
|
938
|
-
followersCount: z9.number().int().nonnegative().nullable(),
|
|
939
|
-
verified: z9.boolean().nullable()
|
|
940
|
-
});
|
|
941
|
-
var xPostSchema = xTweetSchema.extend({
|
|
942
|
-
quotedTweetId: xIdSchema.nullish().transform((v) => v ?? null),
|
|
943
|
-
inReplyToUserId: xIdSchema.nullish().transform((v) => v ?? null),
|
|
944
|
-
inReplyToStatusId: xIdSchema.nullish().transform((v) => v ?? null),
|
|
945
|
-
retweetedTweetId: xIdSchema.nullish().transform((v) => v ?? null)
|
|
946
|
-
});
|
|
947
|
-
var xRequestSchema = z9.discriminatedUnion("operation", [
|
|
948
|
-
z9.object({ operation: z9.literal("connection") }).strict(),
|
|
949
|
-
z9.object({ operation: z9.literal("profile") }).strict(),
|
|
950
|
-
z9.object({ operation: z9.literal("post"), postId: xIdSchema }).strict(),
|
|
951
|
-
z9.object({ operation: z9.literal("follows"), userId: xIdSchema }).strict(),
|
|
952
|
-
z9.object({ operation: z9.literal("reposted"), postId: xIdSchema }).strict()
|
|
953
|
-
]);
|
|
954
|
-
|
|
955
1130
|
// src/index.ts
|
|
956
1131
|
function createRelayClient(options) {
|
|
957
1132
|
async function send(path, init = {}) {
|
|
@@ -1083,19 +1258,33 @@ function createRelayClient(options) {
|
|
|
1083
1258
|
}
|
|
1084
1259
|
return {
|
|
1085
1260
|
referrals: {
|
|
1086
|
-
list: () => request("/v1/referrals",
|
|
1261
|
+
list: () => request("/v1/referrals", z11.array(referralDefinitionSchema)),
|
|
1087
1262
|
summary: () => request("/v1/referrals/me", referralSummarySchema),
|
|
1088
1263
|
history: (before) => request(
|
|
1089
1264
|
query("/v1/referrals/history", { before }),
|
|
1090
1265
|
referralHistorySchema
|
|
1091
1266
|
),
|
|
1092
|
-
accept: (input) => request("/v1/referrals/accept",
|
|
1267
|
+
accept: (input) => request("/v1/referrals/accept", z11.object({ ok: z11.literal(true) }), {
|
|
1093
1268
|
method: "POST",
|
|
1094
1269
|
body: JSON.stringify(referralAcceptSchema.parse(input))
|
|
1095
1270
|
})
|
|
1096
1271
|
},
|
|
1272
|
+
tieredRewards: {
|
|
1273
|
+
/**
|
|
1274
|
+
* The project's tiered rewards with their keys. Entitlements and reward
|
|
1275
|
+
* definitions name them by ID: use this to find the ID for a key.
|
|
1276
|
+
*/
|
|
1277
|
+
list: () => request("/v1/tiered-rewards", z11.array(tieredRewardReferenceSchema))
|
|
1278
|
+
},
|
|
1279
|
+
pointLedgers: {
|
|
1280
|
+
/**
|
|
1281
|
+
* The project's point ledgers with their keys and names. Reads return
|
|
1282
|
+
* ledger IDs: use this to find the ID for a key, or a ledger's name.
|
|
1283
|
+
*/
|
|
1284
|
+
list: () => request("/v1/point-ledgers", z11.array(pointLedgerReferenceSchema))
|
|
1285
|
+
},
|
|
1097
1286
|
leaderboards: {
|
|
1098
|
-
list: () => request("/v1/leaderboards",
|
|
1287
|
+
list: () => request("/v1/leaderboards", z11.array(leaderboardDefinitionSchema)),
|
|
1099
1288
|
standings: (board, options2 = {}) => {
|
|
1100
1289
|
const parsed = leaderboardQuerySchema.parse(options2);
|
|
1101
1290
|
return request(
|
|
@@ -1180,25 +1369,25 @@ function createRelayClient(options) {
|
|
|
1180
1369
|
auth: {
|
|
1181
1370
|
providers: () => request(
|
|
1182
1371
|
"/v1/auth/providers",
|
|
1183
|
-
|
|
1184
|
-
providers:
|
|
1185
|
-
|
|
1372
|
+
z11.object({
|
|
1373
|
+
providers: z11.array(
|
|
1374
|
+
z11.object({
|
|
1186
1375
|
provider: authProviderSchema,
|
|
1187
|
-
configured:
|
|
1376
|
+
configured: z11.boolean()
|
|
1188
1377
|
})
|
|
1189
1378
|
),
|
|
1190
|
-
email:
|
|
1191
|
-
demo:
|
|
1379
|
+
email: z11.boolean(),
|
|
1380
|
+
demo: z11.boolean()
|
|
1192
1381
|
})
|
|
1193
1382
|
),
|
|
1194
1383
|
start: (provider, mode) => request(
|
|
1195
1384
|
"/v1/auth/start",
|
|
1196
|
-
|
|
1385
|
+
z11.object({ url: z11.string() }),
|
|
1197
1386
|
json({ provider, mode })
|
|
1198
1387
|
),
|
|
1199
1388
|
emailStart: (email) => request(
|
|
1200
1389
|
"/v1/auth/email/start",
|
|
1201
|
-
|
|
1390
|
+
z11.object({ challenge: z11.string() }),
|
|
1202
1391
|
json({ email })
|
|
1203
1392
|
),
|
|
1204
1393
|
emailVerify: (challenge, code) => changeSession(
|
|
@@ -1208,25 +1397,25 @@ function createRelayClient(options) {
|
|
|
1208
1397
|
json({ challenge, code })
|
|
1209
1398
|
)
|
|
1210
1399
|
),
|
|
1211
|
-
accounts: () => request("/v1/auth/accounts",
|
|
1400
|
+
accounts: () => request("/v1/auth/accounts", z11.array(accountConnectionSchema)),
|
|
1212
1401
|
disconnect: (provider) => request(
|
|
1213
1402
|
"/v1/auth/accounts/disconnect",
|
|
1214
|
-
|
|
1403
|
+
z11.object({ ok: z11.boolean() }),
|
|
1215
1404
|
json({ provider })
|
|
1216
1405
|
),
|
|
1217
1406
|
connections: () => request(
|
|
1218
1407
|
"/v1/auth/connections",
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
provider:
|
|
1222
|
-
subject:
|
|
1223
|
-
signInEnabled:
|
|
1408
|
+
z11.array(
|
|
1409
|
+
z11.object({
|
|
1410
|
+
provider: z11.string(),
|
|
1411
|
+
subject: z11.string(),
|
|
1412
|
+
signInEnabled: z11.boolean()
|
|
1224
1413
|
})
|
|
1225
1414
|
)
|
|
1226
1415
|
),
|
|
1227
1416
|
session: () => request("/v1/auth/session", sessionSchema.nullable()),
|
|
1228
1417
|
signOut: () => changeSession(
|
|
1229
|
-
() => request("/v1/auth/logout",
|
|
1418
|
+
() => request("/v1/auth/logout", z11.object({ ok: z11.boolean() }), json({}))
|
|
1230
1419
|
),
|
|
1231
1420
|
/** Local development only. Existing hosted apps use createParticipantBackend from /portal-proxy. */
|
|
1232
1421
|
exchange: (input) => request("/v1/auth/exchange", exchangeResultSchema, json(input))
|
|
@@ -1275,22 +1464,6 @@ function createRelayClient(options) {
|
|
|
1275
1464
|
body: file
|
|
1276
1465
|
})
|
|
1277
1466
|
},
|
|
1278
|
-
/** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
|
|
1279
|
-
reviews: {
|
|
1280
|
-
list: (options2 = {}, requestOptions) => request(
|
|
1281
|
-
query("/v1/reviews", reviewListSchema.parse(options2)),
|
|
1282
|
-
reviewPageSchema,
|
|
1283
|
-
requestOptions
|
|
1284
|
-
)
|
|
1285
|
-
},
|
|
1286
|
-
/** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
|
|
1287
|
-
members: {
|
|
1288
|
-
list: (options2 = {}, requestOptions) => request(
|
|
1289
|
-
query("/v1/members", memberListSchema.parse(options2)),
|
|
1290
|
-
memberPageSchema,
|
|
1291
|
-
requestOptions
|
|
1292
|
-
)
|
|
1293
|
-
},
|
|
1294
1467
|
evidence: {
|
|
1295
1468
|
async download(id, requestOptions) {
|
|
1296
1469
|
const response = await send(
|
|
@@ -1307,11 +1480,11 @@ function createRelayClient(options) {
|
|
|
1307
1480
|
/** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
|
|
1308
1481
|
lookupMember: (issuer, subject) => request(
|
|
1309
1482
|
"/v1/members/lookup",
|
|
1310
|
-
|
|
1483
|
+
z11.object({ member: z11.string() }),
|
|
1311
1484
|
json({ issuer, subject })
|
|
1312
1485
|
),
|
|
1313
1486
|
/** @deprecated Removed from the participant API. Build quests with `domino` and `@domino-sdk/relay/build`. */
|
|
1314
|
-
journeyTemplate: () => request("/v1/journey-template",
|
|
1487
|
+
journeyTemplate: () => request("/v1/journey-template", z11.array(templateSchema)),
|
|
1315
1488
|
/** @deprecated Removed from the participant API. Build quests with `domino` and `@domino-sdk/relay/build`. */
|
|
1316
1489
|
template: () => request("/v1/template", templateSchema),
|
|
1317
1490
|
/** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
|
|
@@ -1321,7 +1494,7 @@ function createRelayClient(options) {
|
|
|
1321
1494
|
/** @deprecated The participant API rejects publication. Publish with `domino deploy` or the management API. */
|
|
1322
1495
|
publishBatch: (releases) => request(
|
|
1323
1496
|
"/v1/releases/batch",
|
|
1324
|
-
|
|
1497
|
+
z11.array(publishedReleaseSchema),
|
|
1325
1498
|
json({ releases })
|
|
1326
1499
|
),
|
|
1327
1500
|
progress: (member) => request(
|
|
@@ -1411,6 +1584,7 @@ export {
|
|
|
1411
1584
|
createPointLedgerSchema,
|
|
1412
1585
|
pointLedgerSchema,
|
|
1413
1586
|
pointLedgerDeclarationSchema,
|
|
1587
|
+
pointLedgerReferenceSchema,
|
|
1414
1588
|
rewardDeliverySchema,
|
|
1415
1589
|
rewardDeliveriesSchema,
|
|
1416
1590
|
interactionSchema,
|
|
@@ -1427,6 +1601,7 @@ export {
|
|
|
1427
1601
|
catalogDeploymentPreviewSchema,
|
|
1428
1602
|
saveQuestDraftSchema,
|
|
1429
1603
|
publishQuestDraftSchema,
|
|
1604
|
+
questRewardViewSchema,
|
|
1430
1605
|
questViewSchema,
|
|
1431
1606
|
collectionViewSchema,
|
|
1432
1607
|
questExperienceSchema,
|
|
@@ -1449,6 +1624,25 @@ export {
|
|
|
1449
1624
|
collectionBeginSchema,
|
|
1450
1625
|
collectionPreviewSchema,
|
|
1451
1626
|
questConfiguration,
|
|
1627
|
+
xIdSchema,
|
|
1628
|
+
xConnectionSchema,
|
|
1629
|
+
xProfileSchema,
|
|
1630
|
+
xPostSchema,
|
|
1631
|
+
xRequestSchema,
|
|
1632
|
+
imageReferenceSchema,
|
|
1633
|
+
imageFieldSchema,
|
|
1634
|
+
imageFieldsSchema,
|
|
1635
|
+
imageRequestSchema,
|
|
1636
|
+
imageInspectionSchema,
|
|
1637
|
+
imageComparisonSchema,
|
|
1638
|
+
imageExtractionSchema,
|
|
1639
|
+
imageSightingsSchema,
|
|
1640
|
+
imageAssetArtifactSchema,
|
|
1641
|
+
imageUploadRequestSchema,
|
|
1642
|
+
imageUploadsSchema,
|
|
1643
|
+
publishedImageSchema,
|
|
1644
|
+
parseImageExtraction,
|
|
1645
|
+
parseImageResult,
|
|
1452
1646
|
projectCatalogArtifactSchema,
|
|
1453
1647
|
projectDeploymentSchema,
|
|
1454
1648
|
deploymentPreviewSchema,
|
|
@@ -1458,10 +1652,5 @@ export {
|
|
|
1458
1652
|
identityIntegrationSchema,
|
|
1459
1653
|
identityIntegrationSecretSchema,
|
|
1460
1654
|
participantExchangeSchema,
|
|
1461
|
-
xIdSchema,
|
|
1462
|
-
xConnectionSchema,
|
|
1463
|
-
xProfileSchema,
|
|
1464
|
-
xPostSchema,
|
|
1465
|
-
xRequestSchema,
|
|
1466
1655
|
createRelayClient
|
|
1467
1656
|
};
|
|
@@ -860,6 +860,10 @@ var tieredRewardDefinitionSchema = z12.object({
|
|
|
860
860
|
inventory: z12.object({ kind: z12.literal("untracked") }).strict(),
|
|
861
861
|
fulfillment: z12.object({ kind: z12.literal("staff-handover") }).strict()
|
|
862
862
|
}).strict();
|
|
863
|
+
var tieredRewardReferenceSchema = z12.object({
|
|
864
|
+
id: identifier,
|
|
865
|
+
key: identifier.nullable()
|
|
866
|
+
});
|
|
863
867
|
var tierRewardSchema = z12.object({
|
|
864
868
|
kind: z12.literal("tier"),
|
|
865
869
|
reward: tieredRewardDefinitionSchema,
|
|
@@ -1452,6 +1456,7 @@ export {
|
|
|
1452
1456
|
compatibleSettingKinds,
|
|
1453
1457
|
pointsRewardSchema,
|
|
1454
1458
|
tieredRewardDefinitionSchema,
|
|
1459
|
+
tieredRewardReferenceSchema,
|
|
1455
1460
|
tierRewardSchema,
|
|
1456
1461
|
integrationRewardSchema,
|
|
1457
1462
|
rewardSchema,
|