@domino-sdk/relay 1.55.0 → 1.59.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 +85 -0
- package/dist/{accounts-DRPENuZe.d.ts → accounts-CVonEkdb.d.ts} +18 -7
- package/dist/{attempt-captures-CxxO7DeD.d.ts → attempt-captures-DBj-rxak.d.ts} +1 -1
- package/dist/authoring.d.ts +306 -72
- package/dist/authoring.js +264 -9
- package/dist/{automatic-outcomes-DxW_v5Wc.d.ts → automatic-outcomes-FS9okvBP.d.ts} +1 -1
- package/dist/avatar.d.ts +1 -2
- package/dist/browser.d.ts +8 -9
- package/dist/browser.js +10 -10
- package/dist/{capability-error-DSd8EMQC.d.ts → capability-error-DDJl0LY-.d.ts} +0 -6
- package/dist/{chunk-IZRITLVV.js → chunk-2LKGAL63.js} +2 -2
- package/dist/{chunk-GL43VQ5D.js → chunk-577DG2IT.js} +38 -8
- package/dist/{chunk-UY6KMLQG.js → chunk-6U5WWH3W.js} +141 -100
- package/dist/{chunk-YCOKTQ4E.js → chunk-AWWCEP7F.js} +1403 -882
- package/dist/{chunk-56DBFNR2.js → chunk-EQF4ID47.js} +1 -1
- package/dist/{chunk-YEVD4A5X.js → chunk-IBROKMFV.js} +2 -2
- package/dist/{chunk-XALIFNMD.js → chunk-KBCTII6C.js} +1 -1
- package/dist/{chunk-WHG5WE43.js → chunk-KYUQEZZA.js} +1 -1
- package/dist/{chunk-WUEQOKJH.js → chunk-LDLOB2UZ.js} +4 -4
- package/dist/{chunk-IUF7DW76.js → chunk-M2JQPDUX.js} +39 -9
- package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
- package/dist/{chunk-TLK2MD4S.js → chunk-R4S6BFOH.js} +1 -1
- package/dist/{chunk-VFBQVY4X.js → chunk-TZJT5CRF.js} +1 -1
- package/dist/{chunk-C7QZ4UBB.js → chunk-UEMLYPKJ.js} +21 -5
- package/dist/{chunk-F6HECAXA.js → chunk-W42KMMH5.js} +140 -101
- package/dist/{chunk-WHMXXHPX.js → chunk-XGXDINGM.js} +16 -3
- package/dist/{chunk-SABMNPF2.js → chunk-YMWRLAAP.js} +1 -1
- package/dist/{chunk-YE3XYB2F.js → chunk-YRSU2X2P.js} +2 -2
- package/dist/{client-C4zUZKpj.d.ts → client-3b9HjSzZ.d.ts} +191 -117
- package/dist/{deployments-B32QS1CI.d.ts → deployments-BydFVj4Q.d.ts} +798 -235
- package/dist/{groups-O6onGPmC.d.ts → groups-CFuTfFqG.d.ts} +15 -9
- package/dist/index.d.ts +9 -10
- package/dist/index.js +9 -9
- package/dist/{integrations-C6_uUh-s.d.ts → integrations-DrbKQSTD.d.ts} +42 -22
- package/dist/internal.d.ts +10 -10
- package/dist/internal.js +9 -9
- package/dist/{offers-BMDNcvwB.d.ts → offers-DAfe1O3_.d.ts} +211 -2
- package/dist/{pages-BFloMpyQ.d.ts → pages-ChDVLrgR.d.ts} +95 -10
- package/dist/portal-proxy.js +4 -4
- package/dist/react/index.d.ts +149 -72
- package/dist/react/index.js +65 -10
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/BG43KQ2T.js +1 -0
- package/dist/runtime/chunks/EWU4OKSY.js +62 -0
- package/dist/runtime/manifest.json +5 -5
- package/dist/runtime/schema.js +1 -1
- package/dist/runtime/zod.js +1 -1
- package/dist/{schema-C4m9RhCR.d.ts → schema-BA0nRRlt.d.ts} +184 -35
- package/dist/schema.d.ts +1265 -697
- package/dist/schema.js +96 -12
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +1644 -1105
- package/dist/{submission-input-BbdawqVy.d.ts → submission-input-DxQ6RnKo.d.ts} +2 -2
- package/dist/{telegram-browser-CwaxROAZ.d.ts → telegram-browser-o3OIxGrJ.d.ts} +3 -3
- package/dist/testing.d.ts +89 -9
- package/dist/testing.js +215 -10
- package/dist/{transport-CZJOW5Sr.d.ts → transport-D_Eqf78J.d.ts} +8592 -4384
- package/dist/wallet-B06zvDXp.d.ts +972 -0
- package/dist/{x-1czZFVUW.d.ts → x-C28SNifw.d.ts} +2 -2
- package/package.json +2 -2
- package/dist/profiles-BoOK03cR.d.ts +0 -299
- package/dist/runtime/chunks/IDOMZWRY.js +0 -40
- package/dist/runtime/chunks/WKATKZXE.js +0 -1
- package/dist/util.d-w9f9t3ua.d.ts +0 -5
- package/dist/wallet-Ac7OFpOr.d.ts +0 -228
|
@@ -2,10 +2,45 @@ import {
|
|
|
2
2
|
identifier,
|
|
3
3
|
resourceHandle,
|
|
4
4
|
responseShape
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AWWCEP7F.js";
|
|
6
6
|
|
|
7
|
-
// src/
|
|
7
|
+
// src/youtube.ts
|
|
8
8
|
import * as z from "zod";
|
|
9
|
+
var youtubeShortBodySchema = z.object({
|
|
10
|
+
title: z.string(),
|
|
11
|
+
description: z.string(),
|
|
12
|
+
tags: z.array(z.string()),
|
|
13
|
+
durationSeconds: z.number().int().nonnegative(),
|
|
14
|
+
/** When the video was published, epoch milliseconds. */
|
|
15
|
+
publishedAt: z.number().int().nonnegative()
|
|
16
|
+
});
|
|
17
|
+
var youtubeShortMetrics = ["views", "likes", "comments"];
|
|
18
|
+
|
|
19
|
+
// src/tiktok.ts
|
|
20
|
+
import * as z2 from "zod";
|
|
21
|
+
var tiktokVideoBodySchema = z2.object({
|
|
22
|
+
title: z2.string(),
|
|
23
|
+
/** The creator's caption, `video_description` in TikTok's API. */
|
|
24
|
+
description: z2.string(),
|
|
25
|
+
durationSeconds: z2.number().int().nonnegative(),
|
|
26
|
+
width: z2.number().int().nonnegative(),
|
|
27
|
+
height: z2.number().int().nonnegative(),
|
|
28
|
+
/** When the video was posted, epoch milliseconds. */
|
|
29
|
+
createdAt: z2.number().int().nonnegative(),
|
|
30
|
+
/** TikTok's shareable link to the video. */
|
|
31
|
+
shareUrl: z2.string(),
|
|
32
|
+
/** Whether the creator labelled the video as AI-generated content. */
|
|
33
|
+
isAigc: z2.boolean()
|
|
34
|
+
});
|
|
35
|
+
var tiktokVideoMetrics = [
|
|
36
|
+
"views",
|
|
37
|
+
"likes",
|
|
38
|
+
"comments",
|
|
39
|
+
"shares"
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
// src/server/analytics.ts
|
|
43
|
+
import * as z3 from "zod";
|
|
9
44
|
function once(build) {
|
|
10
45
|
let built;
|
|
11
46
|
return () => built ??= build();
|
|
@@ -22,41 +57,41 @@ function lazyShape(builders) {
|
|
|
22
57
|
return shape;
|
|
23
58
|
}
|
|
24
59
|
var analyticsRanges = ["7d", "30d", "90d", "all"];
|
|
25
|
-
var amount = once(() =>
|
|
26
|
-
var amounts = once(() =>
|
|
27
|
-
var instant = once(() =>
|
|
60
|
+
var amount = once(() => z3.number().int().safe());
|
|
61
|
+
var amounts = once(() => z3.array(amount()));
|
|
62
|
+
var instant = once(() => z3.iso.datetime({ offset: true }));
|
|
28
63
|
var bucket = once(
|
|
29
|
-
() =>
|
|
64
|
+
() => z3.object({
|
|
30
65
|
/** The period's label in its time zone, such as `2026-10-08@Europe/Budapest` or `2026-W41@UTC`. */
|
|
31
|
-
key:
|
|
66
|
+
key: z3.string(),
|
|
32
67
|
start: instant(),
|
|
33
68
|
end: instant()
|
|
34
69
|
})
|
|
35
70
|
);
|
|
36
71
|
var range = once(
|
|
37
|
-
() =>
|
|
38
|
-
key:
|
|
72
|
+
() => z3.object({
|
|
73
|
+
key: z3.enum(analyticsRanges),
|
|
39
74
|
from: instant(),
|
|
40
75
|
/** Now, by the database's clock, when the read ran. */
|
|
41
76
|
to: instant(),
|
|
42
|
-
bucket:
|
|
77
|
+
bucket: z3.enum(["day", "week"]),
|
|
43
78
|
/** The project calendar's time zone now. Buckets before a time zone change follow the old one. */
|
|
44
|
-
timeZone:
|
|
45
|
-
buckets:
|
|
79
|
+
timeZone: z3.string(),
|
|
80
|
+
buckets: z3.array(bucket())
|
|
46
81
|
})
|
|
47
82
|
);
|
|
48
83
|
var previousRange = once(
|
|
49
|
-
() =>
|
|
84
|
+
() => z3.object({ from: instant(), to: instant() }).optional()
|
|
50
85
|
);
|
|
51
|
-
var analyticsQuerySchema =
|
|
86
|
+
var analyticsQuerySchema = z3.strictObject(
|
|
52
87
|
lazyShape({
|
|
53
|
-
range: () =>
|
|
88
|
+
range: () => z3.enum(analyticsRanges),
|
|
54
89
|
/** A point ledger's key or ID. Defaults to the first ledger that is not archived. */
|
|
55
90
|
ledger: () => identifier.optional()
|
|
56
91
|
})
|
|
57
92
|
);
|
|
58
93
|
var metric = once(
|
|
59
|
-
() =>
|
|
94
|
+
() => z3.object({
|
|
60
95
|
total: amount(),
|
|
61
96
|
previousTotal: amount().optional(),
|
|
62
97
|
series: amounts()
|
|
@@ -64,9 +99,9 @@ var metric = once(
|
|
|
64
99
|
);
|
|
65
100
|
var optionalMetric = once(() => metric().optional());
|
|
66
101
|
var quest = once(
|
|
67
|
-
() =>
|
|
102
|
+
() => z3.object({
|
|
68
103
|
quest: identifier,
|
|
69
|
-
title:
|
|
104
|
+
title: z3.string(),
|
|
70
105
|
/** Attempts created in the range. */
|
|
71
106
|
attempts: amount(),
|
|
72
107
|
/** Completions in the range that were never revoked. */
|
|
@@ -78,57 +113,57 @@ var quest = once(
|
|
|
78
113
|
/** Attempts created in the range that went to staff review. */
|
|
79
114
|
needsReview: amount(),
|
|
80
115
|
/** `rejected ÷ decided`, or null below 10 decided attempts. */
|
|
81
|
-
rejectionRate:
|
|
116
|
+
rejectionRate: z3.number().min(0).max(1).nullable(),
|
|
82
117
|
/**
|
|
83
118
|
* The 5 most common rejections, most frequent first. Rejections with a code (an evaluator's
|
|
84
119
|
* reject code or one Relay writes, such as `budget-exhausted`) group by it, and `reason` is the
|
|
85
120
|
* latest rejection's reason; rejections without one group by their exact reason.
|
|
86
121
|
*/
|
|
87
|
-
topReasons:
|
|
88
|
-
|
|
89
|
-
reason:
|
|
90
|
-
code:
|
|
122
|
+
topReasons: z3.array(
|
|
123
|
+
z3.object({
|
|
124
|
+
reason: z3.string(),
|
|
125
|
+
code: z3.string().nullable(),
|
|
91
126
|
count: amount()
|
|
92
127
|
})
|
|
93
128
|
),
|
|
94
129
|
/** Rejections by who made them: the evaluator, staff, an exhausted budget, an expired deferral. */
|
|
95
|
-
rejectionsBySource:
|
|
130
|
+
rejectionsBySource: z3.object({
|
|
96
131
|
evaluator: amount(),
|
|
97
132
|
staff: amount(),
|
|
98
133
|
budget: amount(),
|
|
99
134
|
expired: amount()
|
|
100
135
|
}),
|
|
101
136
|
/** Attempts and completions per bucket. */
|
|
102
|
-
series:
|
|
137
|
+
series: z3.object({ attempts: amounts(), completions: amounts() })
|
|
103
138
|
})
|
|
104
139
|
);
|
|
105
|
-
var analyticsReadSchema =
|
|
140
|
+
var analyticsReadSchema = z3.object(
|
|
106
141
|
lazyShape({
|
|
107
142
|
range,
|
|
108
143
|
previous: previousRange,
|
|
109
|
-
members: () =>
|
|
144
|
+
members: () => z3.object({
|
|
110
145
|
/** Members who joined the project. */
|
|
111
146
|
signUps: metric(),
|
|
112
147
|
/** Distinct members with an attempt; the total counts each member once over the range. */
|
|
113
148
|
active: metric()
|
|
114
149
|
}),
|
|
115
|
-
quests: () =>
|
|
150
|
+
quests: () => z3.object({
|
|
116
151
|
attempts: metric(),
|
|
117
152
|
completions: metric(),
|
|
118
153
|
rejections: metric(),
|
|
119
154
|
needsReview: metric(),
|
|
120
155
|
/** Quests with activity in the range, most attempted first. */
|
|
121
|
-
byQuest:
|
|
156
|
+
byQuest: z3.array(quest())
|
|
122
157
|
}),
|
|
123
|
-
points: () =>
|
|
158
|
+
points: () => z3.object({
|
|
124
159
|
/** The project's point ledgers, oldest first. */
|
|
125
|
-
ledgers:
|
|
126
|
-
|
|
160
|
+
ledgers: z3.array(
|
|
161
|
+
z3.object({ key: identifier, name: z3.string(), archived: z3.boolean() })
|
|
127
162
|
),
|
|
128
163
|
/** The ledger this section reads, or null when the project has none to read. */
|
|
129
164
|
ledger: identifier.nullable(),
|
|
130
165
|
/** Whether the ledger has a spend entry. `spent` and `net` are present only when it does. */
|
|
131
|
-
hasSpending:
|
|
166
|
+
hasSpending: z3.boolean(),
|
|
132
167
|
/** Points in award entries. */
|
|
133
168
|
awarded: metric(),
|
|
134
169
|
/** Points in spend entries, as a positive number. */
|
|
@@ -139,20 +174,20 @@ var analyticsReadSchema = z.object(
|
|
|
139
174
|
membersEarning: metric()
|
|
140
175
|
}),
|
|
141
176
|
/** Fulfilled offer redemptions. Present only when the project has an offer. */
|
|
142
|
-
offers: () =>
|
|
177
|
+
offers: () => z3.object({
|
|
143
178
|
redemptions: metric(),
|
|
144
179
|
/** Every offer, most redeemed first. */
|
|
145
|
-
byOffer:
|
|
146
|
-
|
|
180
|
+
byOffer: z3.array(
|
|
181
|
+
z3.object({
|
|
147
182
|
offer: identifier,
|
|
148
|
-
title:
|
|
183
|
+
title: z3.string(),
|
|
149
184
|
redemptions: amount(),
|
|
150
185
|
series: amounts()
|
|
151
186
|
})
|
|
152
187
|
)
|
|
153
188
|
}).optional(),
|
|
154
189
|
/** Present only when the project has a referral program. */
|
|
155
|
-
referrals: () =>
|
|
190
|
+
referrals: () => z3.object({
|
|
156
191
|
/** Referrals accepted. */
|
|
157
192
|
accepted: metric(),
|
|
158
193
|
/** Active qualifications, by when they first qualified; suspended referrals still count. */
|
|
@@ -163,13 +198,13 @@ var analyticsReadSchema = z.object(
|
|
|
163
198
|
* `acceptedQualified.total ÷ accepted.total` is the share of the range's friends who have
|
|
164
199
|
* qualified since, never above 1.
|
|
165
200
|
*/
|
|
166
|
-
acceptedQualified:
|
|
201
|
+
acceptedQualified: z3.object({
|
|
167
202
|
total: amount(),
|
|
168
203
|
previousTotal: amount().optional()
|
|
169
204
|
})
|
|
170
205
|
}).optional(),
|
|
171
206
|
/** Present only in the test environment. */
|
|
172
|
-
testEnvironment: () =>
|
|
207
|
+
testEnvironment: () => z3.object({
|
|
173
208
|
/** When a test member was last reset, deleting their history, or null. */
|
|
174
209
|
lastResetAt: instant().nullable(),
|
|
175
210
|
/** Test members whose clock is advanced, so their activity can be dated in the future. */
|
|
@@ -360,17 +395,17 @@ var analyticsCatalog = {
|
|
|
360
395
|
var analyticsMetricIds = Object.keys(
|
|
361
396
|
analyticsCatalog
|
|
362
397
|
);
|
|
363
|
-
var analyticsCatalogSchema =
|
|
398
|
+
var analyticsCatalogSchema = z3.object(
|
|
364
399
|
lazyShape({
|
|
365
|
-
metrics: () =>
|
|
366
|
-
|
|
367
|
-
id:
|
|
368
|
-
definition:
|
|
369
|
-
kind:
|
|
370
|
-
breakdowns:
|
|
371
|
-
filters:
|
|
372
|
-
charts:
|
|
373
|
-
ledger:
|
|
400
|
+
metrics: () => z3.array(
|
|
401
|
+
z3.object({
|
|
402
|
+
id: z3.string(),
|
|
403
|
+
definition: z3.string(),
|
|
404
|
+
kind: z3.enum(["count", "distinct", "rate"]),
|
|
405
|
+
breakdowns: z3.array(z3.string()),
|
|
406
|
+
filters: z3.array(z3.string()),
|
|
407
|
+
charts: z3.array(z3.string()),
|
|
408
|
+
ledger: z3.boolean(),
|
|
374
409
|
/** For a rate, the denominator below which a value is empty. */
|
|
375
410
|
minimumDenominator: amount().optional()
|
|
376
411
|
})
|
|
@@ -378,63 +413,63 @@ var analyticsCatalogSchema = z.object(
|
|
|
378
413
|
})
|
|
379
414
|
);
|
|
380
415
|
var analyticsQueryLimit = 100;
|
|
381
|
-
var analyticsMetricQuerySchema =
|
|
416
|
+
var analyticsMetricQuerySchema = z3.strictObject(
|
|
382
417
|
lazyShape({
|
|
383
|
-
metric: () =>
|
|
384
|
-
range: () =>
|
|
385
|
-
breakdown: () =>
|
|
418
|
+
metric: () => z3.string().min(1).max(100),
|
|
419
|
+
range: () => z3.enum(analyticsRanges),
|
|
420
|
+
breakdown: () => z3.string().min(1).max(100).optional(),
|
|
386
421
|
/** Each filter names one key or a list of keys; a list matches any of them. */
|
|
387
|
-
filter: () =>
|
|
388
|
-
|
|
389
|
-
|
|
422
|
+
filter: () => z3.record(
|
|
423
|
+
z3.string().min(1).max(100),
|
|
424
|
+
z3.union([identifier, z3.array(identifier).min(1).max(100)])
|
|
390
425
|
).optional(),
|
|
391
426
|
/** A point ledger's key or ID, archived ledgers included. Points metrics need one. */
|
|
392
427
|
ledger: () => identifier.optional(),
|
|
393
428
|
/** Breakdown rows to return, 1 to 100 (default 100); the rest are summed into `other`. */
|
|
394
|
-
limit: () =>
|
|
429
|
+
limit: () => z3.number().int().optional()
|
|
395
430
|
})
|
|
396
431
|
);
|
|
397
|
-
var measureNumber = once(() =>
|
|
432
|
+
var measureNumber = once(() => z3.number().nullable());
|
|
398
433
|
var measure = once(() => ({
|
|
399
434
|
total: measureNumber(),
|
|
400
435
|
previousTotal: measureNumber().optional(),
|
|
401
|
-
series:
|
|
436
|
+
series: z3.array(measureNumber())
|
|
402
437
|
}));
|
|
403
|
-
var analyticsMetricResultSchema =
|
|
438
|
+
var analyticsMetricResultSchema = z3.object(
|
|
404
439
|
lazyShape({
|
|
405
|
-
metric: () =>
|
|
440
|
+
metric: () => z3.string(),
|
|
406
441
|
/** How the value reads: a `count`, a `distinct` count of members, or a `rate` from 0 to 1. */
|
|
407
|
-
kind: () =>
|
|
442
|
+
kind: () => z3.enum(["count", "distinct", "rate"]),
|
|
408
443
|
range,
|
|
409
444
|
previous: previousRange,
|
|
410
445
|
/** The point ledger a points metric read, by key. */
|
|
411
446
|
ledger: () => identifier.optional(),
|
|
412
447
|
/** The metric over everything the filters match, every breakdown row included. */
|
|
413
|
-
value: () =>
|
|
414
|
-
breakdown: () =>
|
|
415
|
-
dimension:
|
|
448
|
+
value: () => z3.object(measure()),
|
|
449
|
+
breakdown: () => z3.object({
|
|
450
|
+
dimension: z3.string(),
|
|
416
451
|
/**
|
|
417
452
|
* Sorted by total, largest first (an empty rate last), at most `limit`. Every matching
|
|
418
453
|
* quest, offer, program, group, tracker or leaderboard that is not archived has a row, and an archived one has a row
|
|
419
454
|
* when it has activity in the range or the range before.
|
|
420
455
|
*/
|
|
421
|
-
rows:
|
|
422
|
-
|
|
456
|
+
rows: z3.array(
|
|
457
|
+
z3.object({
|
|
423
458
|
/** The resource's key (its ID when it has none), the source, the outcome, or the reason's code or text. */
|
|
424
|
-
key:
|
|
425
|
-
title:
|
|
426
|
-
archived:
|
|
459
|
+
key: z3.string(),
|
|
460
|
+
title: z3.string(),
|
|
461
|
+
archived: z3.boolean(),
|
|
427
462
|
...measure()
|
|
428
463
|
})
|
|
429
464
|
),
|
|
430
465
|
/** The rows past `limit`, summed; for a rate, their summed numerators over denominators. */
|
|
431
|
-
other:
|
|
466
|
+
other: z3.object({ rows: amount(), ...measure() }).optional()
|
|
432
467
|
}).optional()
|
|
433
468
|
})
|
|
434
469
|
);
|
|
435
470
|
|
|
436
471
|
// src/dashboards.ts
|
|
437
|
-
import * as
|
|
472
|
+
import * as z4 from "zod";
|
|
438
473
|
var dashboardLimits = { panels: 24, dashboards: 20 };
|
|
439
474
|
var defaultPanelWidths = {
|
|
440
475
|
number: 1,
|
|
@@ -442,63 +477,63 @@ var defaultPanelWidths = {
|
|
|
442
477
|
bar: 2,
|
|
443
478
|
table: 4
|
|
444
479
|
};
|
|
445
|
-
var title =
|
|
446
|
-
var description =
|
|
447
|
-
var filterValue =
|
|
448
|
-
var filter =
|
|
480
|
+
var title = z4.string().trim().min(1).max(120);
|
|
481
|
+
var description = z4.string().trim().min(1).max(500);
|
|
482
|
+
var filterValue = z4.union([identifier, z4.array(identifier).min(1).max(100)]);
|
|
483
|
+
var filter = z4.record(z4.string().min(1).max(100), filterValue);
|
|
449
484
|
var panelFields = {
|
|
450
485
|
key: identifier,
|
|
451
486
|
title,
|
|
452
487
|
description: description.optional(),
|
|
453
488
|
/** A metric ID from the catalog (`analytics.catalog`). */
|
|
454
|
-
metric:
|
|
455
|
-
breakdown:
|
|
489
|
+
metric: z4.string().min(1).max(100),
|
|
490
|
+
breakdown: z4.string().min(1).max(100).optional(),
|
|
456
491
|
/** Each filter names one key or a list of keys; a list matches any of them. */
|
|
457
492
|
filter: filter.optional(),
|
|
458
493
|
/** The point ledger a points metric reads, by key. */
|
|
459
494
|
ledger: identifier.optional(),
|
|
460
|
-
chart:
|
|
495
|
+
chart: z4.enum(analyticsCharts)
|
|
461
496
|
};
|
|
462
|
-
var dashboardPanelAuthoringSchema =
|
|
497
|
+
var dashboardPanelAuthoringSchema = z4.strictObject({
|
|
463
498
|
...panelFields,
|
|
464
|
-
width:
|
|
499
|
+
width: z4.number().int().min(1).max(4).optional()
|
|
465
500
|
});
|
|
466
|
-
var dashboardAuthoringSchema =
|
|
501
|
+
var dashboardAuthoringSchema = z4.strictObject({
|
|
467
502
|
key: identifier,
|
|
468
503
|
title,
|
|
469
504
|
description: description.optional(),
|
|
470
505
|
/** The range the dashboard opens with. Defaults to `30d`. */
|
|
471
|
-
defaultRange:
|
|
506
|
+
defaultRange: z4.enum(analyticsRanges).optional(),
|
|
472
507
|
/** Orders dashboards in lists: by position, those without one last, then by title. */
|
|
473
|
-
position:
|
|
474
|
-
sections:
|
|
475
|
-
|
|
508
|
+
position: z4.number().int().min(0).max(1e3).optional(),
|
|
509
|
+
sections: z4.array(
|
|
510
|
+
z4.strictObject({
|
|
476
511
|
title: title.optional(),
|
|
477
|
-
panels:
|
|
512
|
+
panels: z4.array(dashboardPanelAuthoringSchema).min(1).max(100)
|
|
478
513
|
})
|
|
479
514
|
).min(1).max(100)
|
|
480
515
|
});
|
|
481
|
-
var dashboardDefinitionSchema =
|
|
516
|
+
var dashboardDefinitionSchema = z4.strictObject({
|
|
482
517
|
key: identifier,
|
|
483
518
|
title,
|
|
484
519
|
description: description.optional(),
|
|
485
|
-
defaultRange:
|
|
486
|
-
position:
|
|
487
|
-
sections:
|
|
488
|
-
|
|
520
|
+
defaultRange: z4.enum(analyticsRanges),
|
|
521
|
+
position: z4.number().int().min(0).max(1e3).optional(),
|
|
522
|
+
sections: z4.array(
|
|
523
|
+
z4.strictObject({
|
|
489
524
|
title: title.optional(),
|
|
490
|
-
panels:
|
|
491
|
-
|
|
525
|
+
panels: z4.array(
|
|
526
|
+
z4.strictObject({
|
|
492
527
|
...panelFields,
|
|
493
|
-
width:
|
|
528
|
+
width: z4.number().int().min(1).max(4)
|
|
494
529
|
})
|
|
495
530
|
)
|
|
496
531
|
})
|
|
497
532
|
)
|
|
498
533
|
});
|
|
499
|
-
var dashboardArtifactSchema =
|
|
534
|
+
var dashboardArtifactSchema = z4.union([
|
|
500
535
|
dashboardAuthoringSchema,
|
|
501
|
-
|
|
536
|
+
z4.object({ code: z4.string().min(1).max(2e6) }).strict()
|
|
502
537
|
]);
|
|
503
538
|
function normalizeDashboard(input) {
|
|
504
539
|
const dashboard = dashboardAuthoringSchema.parse(input);
|
|
@@ -603,11 +638,11 @@ function dashboardIssue(dashboard) {
|
|
|
603
638
|
return null;
|
|
604
639
|
}
|
|
605
640
|
var dashboardPreviewSchema = responseShape(
|
|
606
|
-
|
|
641
|
+
z4.object({
|
|
607
642
|
key: identifier,
|
|
608
|
-
title:
|
|
643
|
+
title: z4.string(),
|
|
609
644
|
/** `unchanged`: the definition equals the published one, and publishing writes no version. */
|
|
610
|
-
change:
|
|
645
|
+
change: z4.enum(["created", "updated", "unchanged"]),
|
|
611
646
|
definition: dashboardDefinitionSchema
|
|
612
647
|
})
|
|
613
648
|
);
|
|
@@ -635,6 +670,10 @@ function defineDashboard(input) {
|
|
|
635
670
|
}
|
|
636
671
|
|
|
637
672
|
export {
|
|
673
|
+
youtubeShortBodySchema,
|
|
674
|
+
youtubeShortMetrics,
|
|
675
|
+
tiktokVideoBodySchema,
|
|
676
|
+
tiktokVideoMetrics,
|
|
638
677
|
analyticsRanges,
|
|
639
678
|
analyticsQuerySchema,
|
|
640
679
|
analyticsReadSchema,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
accountConnectionSchema,
|
|
3
3
|
identifier,
|
|
4
4
|
pageCursorSchema
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AWWCEP7F.js";
|
|
6
6
|
|
|
7
7
|
// src/point-ledgers.ts
|
|
8
8
|
import * as z from "zod";
|
|
@@ -132,7 +132,6 @@ var telegramChatMemberSchema = z2.object({
|
|
|
132
132
|
/** When a paid subscription or a restriction ends, epoch milliseconds; null when it does not. */
|
|
133
133
|
untilDate: z2.number().nullable()
|
|
134
134
|
});
|
|
135
|
-
var telegramReactionsNamespace = "telegram-reactions";
|
|
136
135
|
var telegramReactionDataSchema = z2.object({
|
|
137
136
|
/** The chat's numeric ID, as a string. */
|
|
138
137
|
chatId: z2.string(),
|
|
@@ -153,6 +152,20 @@ var telegramReactionDataSchema = z2.object({
|
|
|
153
152
|
/** Whether the reactor was the chat's creator or an administrator then. */
|
|
154
153
|
reactorIsAdmin: z2.boolean()
|
|
155
154
|
});
|
|
155
|
+
var telegramMessageDataSchema = z2.object({
|
|
156
|
+
/** The chat's numeric ID, as a string. */
|
|
157
|
+
chatId: z2.string(),
|
|
158
|
+
/** `group` or `supergroup`: channel posts are authored by the channel and never recorded. */
|
|
159
|
+
chatType: z2.string(),
|
|
160
|
+
messageId: z2.number(),
|
|
161
|
+
/** The ID of the message it replies to in the same chat; null when it is not a reply. */
|
|
162
|
+
replyToMessageId: z2.number().nullable(),
|
|
163
|
+
/**
|
|
164
|
+
* The message thread it belongs to: the forum topic in a supergroup with topics, or the reply
|
|
165
|
+
* thread otherwise. Null when Telegram names none.
|
|
166
|
+
*/
|
|
167
|
+
threadId: z2.number().nullable()
|
|
168
|
+
});
|
|
156
169
|
|
|
157
170
|
// src/profiles.ts
|
|
158
171
|
import * as z3 from "zod";
|
|
@@ -319,8 +332,8 @@ export {
|
|
|
319
332
|
telegramChatConnectionSchema,
|
|
320
333
|
telegramMemberInputSchema,
|
|
321
334
|
telegramChatMemberSchema,
|
|
322
|
-
telegramReactionsNamespace,
|
|
323
335
|
telegramReactionDataSchema,
|
|
336
|
+
telegramMessageDataSchema,
|
|
324
337
|
profileVisibilitySchema,
|
|
325
338
|
avatarProviderSchema,
|
|
326
339
|
profileDefaultProviderSchema,
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
imageFieldsSchema,
|
|
5
5
|
imageInspectionSchema,
|
|
6
6
|
imageSightingsSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IBROKMFV.js";
|
|
8
8
|
import {
|
|
9
9
|
photoResultSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AWWCEP7F.js";
|
|
11
11
|
|
|
12
12
|
// src/image-results.ts
|
|
13
13
|
import * as z from "zod";
|