@helyx/bot 0.4.5 → 0.4.7
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 +12 -0
- package/dist/interactions.js +3 -1
- package/dist/shard-contracts.d.ts +177 -177
- package/dist/shard-contracts.js +60 -27
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Preserve the source Discord message identity for select-menu interactions so modules can resolve their managed message safely.
|
|
8
|
+
|
|
9
|
+
## 0.4.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Make generated shard-contract declarations deterministic across clean and cached Node builds by using explicit enum maps.
|
|
14
|
+
|
|
3
15
|
## 0.4.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/interactions.js
CHANGED
|
@@ -286,7 +286,9 @@ function createContext(interaction, services) {
|
|
|
286
286
|
false,
|
|
287
287
|
...(interaction.guildId ? { serverId: interaction.guildId } : {}),
|
|
288
288
|
...(interaction.channelId ? { channelId: interaction.channelId } : {}),
|
|
289
|
-
...(interaction.
|
|
289
|
+
...(interaction.isMessageComponent()
|
|
290
|
+
? { messageId: interaction.message.id }
|
|
291
|
+
: {}),
|
|
290
292
|
services,
|
|
291
293
|
deferReply: async (ephemeral = false) => {
|
|
292
294
|
if (interaction.deferred || interaction.replied)
|
|
@@ -9,12 +9,12 @@ export declare const SHARD_LEASE_HEARTBEAT_TIMEOUT_MS = 20000;
|
|
|
9
9
|
export declare const shardIdentitySchema: z.ZodObject<{
|
|
10
10
|
version: z.ZodLiteral<1>;
|
|
11
11
|
mode: z.ZodEnum<{
|
|
12
|
-
auto: "auto";
|
|
13
|
-
fixed: "fixed";
|
|
12
|
+
readonly auto: "auto";
|
|
13
|
+
readonly fixed: "fixed";
|
|
14
14
|
}>;
|
|
15
15
|
scope: z.ZodEnum<{
|
|
16
|
-
local: "local";
|
|
17
|
-
coordinated: "coordinated";
|
|
16
|
+
readonly local: "local";
|
|
17
|
+
readonly coordinated: "coordinated";
|
|
18
18
|
}>;
|
|
19
19
|
generation: z.ZodString;
|
|
20
20
|
deploymentOrder: z.ZodOptional<z.ZodNumber>;
|
|
@@ -38,12 +38,12 @@ export type GatewayBotInformation = z.infer<typeof gatewayBotInformationSchema>;
|
|
|
38
38
|
export declare const shardProcessHealthSchema: z.ZodObject<{
|
|
39
39
|
shardId: z.ZodNumber;
|
|
40
40
|
status: z.ZodEnum<{
|
|
41
|
-
starting: "starting";
|
|
42
|
-
ready: "ready";
|
|
43
|
-
disconnected: "disconnected";
|
|
44
|
-
reconnecting: "reconnecting";
|
|
45
|
-
stopped: "stopped";
|
|
46
|
-
failed: "failed";
|
|
41
|
+
readonly starting: "starting";
|
|
42
|
+
readonly ready: "ready";
|
|
43
|
+
readonly disconnected: "disconnected";
|
|
44
|
+
readonly reconnecting: "reconnecting";
|
|
45
|
+
readonly stopped: "stopped";
|
|
46
|
+
readonly failed: "failed";
|
|
47
47
|
}>;
|
|
48
48
|
guildCount: z.ZodNumber;
|
|
49
49
|
gatewayPingMs: z.ZodNumber;
|
|
@@ -82,20 +82,20 @@ export type SchedulerOperationalHealth = z.infer<typeof schedulerOperationalHeal
|
|
|
82
82
|
export declare const shardHealthSnapshotSchema: z.ZodObject<{
|
|
83
83
|
version: z.ZodLiteral<1>;
|
|
84
84
|
mode: z.ZodEnum<{
|
|
85
|
-
off: "off";
|
|
86
|
-
auto: "auto";
|
|
87
|
-
fixed: "fixed";
|
|
85
|
+
readonly off: "off";
|
|
86
|
+
readonly auto: "auto";
|
|
87
|
+
readonly fixed: "fixed";
|
|
88
88
|
}>;
|
|
89
89
|
scope: z.ZodEnum<{
|
|
90
|
-
local: "local";
|
|
91
|
-
coordinated: "coordinated";
|
|
90
|
+
readonly local: "local";
|
|
91
|
+
readonly coordinated: "coordinated";
|
|
92
92
|
}>;
|
|
93
93
|
status: z.ZodEnum<{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
unavailable: "unavailable";
|
|
98
|
-
stale: "stale";
|
|
94
|
+
readonly healthy: "healthy";
|
|
95
|
+
readonly degraded: "degraded";
|
|
96
|
+
readonly starting: "starting";
|
|
97
|
+
readonly unavailable: "unavailable";
|
|
98
|
+
readonly stale: "stale";
|
|
99
99
|
}>;
|
|
100
100
|
observedAt: z.ZodISODateTime;
|
|
101
101
|
generation: z.ZodString;
|
|
@@ -104,15 +104,15 @@ export declare const shardHealthSnapshotSchema: z.ZodObject<{
|
|
|
104
104
|
readyShardCount: z.ZodNumber;
|
|
105
105
|
coordination: z.ZodObject<{
|
|
106
106
|
redis: z.ZodEnum<{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
readonly not_required: "not_required";
|
|
108
|
+
readonly healthy: "healthy";
|
|
109
|
+
readonly degraded: "degraded";
|
|
110
|
+
readonly unavailable: "unavailable";
|
|
111
111
|
}>;
|
|
112
112
|
database: z.ZodEnum<{
|
|
113
|
-
healthy: "healthy";
|
|
114
|
-
degraded: "degraded";
|
|
115
|
-
unavailable: "unavailable";
|
|
113
|
+
readonly healthy: "healthy";
|
|
114
|
+
readonly degraded: "degraded";
|
|
115
|
+
readonly unavailable: "unavailable";
|
|
116
116
|
}>;
|
|
117
117
|
}, z.core.$strict>;
|
|
118
118
|
scheduler: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -148,12 +148,12 @@ export declare const shardHealthSnapshotSchema: z.ZodObject<{
|
|
|
148
148
|
shards: z.ZodArray<z.ZodObject<{
|
|
149
149
|
shardId: z.ZodNumber;
|
|
150
150
|
status: z.ZodEnum<{
|
|
151
|
-
starting: "starting";
|
|
152
|
-
ready: "ready";
|
|
153
|
-
disconnected: "disconnected";
|
|
154
|
-
reconnecting: "reconnecting";
|
|
155
|
-
stopped: "stopped";
|
|
156
|
-
failed: "failed";
|
|
151
|
+
readonly starting: "starting";
|
|
152
|
+
readonly ready: "ready";
|
|
153
|
+
readonly disconnected: "disconnected";
|
|
154
|
+
readonly reconnecting: "reconnecting";
|
|
155
|
+
readonly stopped: "stopped";
|
|
156
|
+
readonly failed: "failed";
|
|
157
157
|
}>;
|
|
158
158
|
guildCount: z.ZodNumber;
|
|
159
159
|
gatewayPingMs: z.ZodNumber;
|
|
@@ -194,10 +194,10 @@ export declare const shardControlOperationSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
194
194
|
version: z.ZodNumber;
|
|
195
195
|
module: z.ZodObject<{
|
|
196
196
|
preset: z.ZodEnum<{
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
readonly everyone: "everyone";
|
|
198
|
+
readonly moderators: "moderators";
|
|
199
|
+
readonly administrators: "administrators";
|
|
200
|
+
readonly custom: "custom";
|
|
201
201
|
}>;
|
|
202
202
|
allowedRoleIds: z.ZodArray<z.ZodString>;
|
|
203
203
|
deniedRoleIds: z.ZodArray<z.ZodString>;
|
|
@@ -208,10 +208,10 @@ export declare const shardControlOperationSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
208
208
|
enabled: z.ZodBoolean;
|
|
209
209
|
policy: z.ZodObject<{
|
|
210
210
|
preset: z.ZodEnum<{
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
readonly everyone: "everyone";
|
|
212
|
+
readonly moderators: "moderators";
|
|
213
|
+
readonly administrators: "administrators";
|
|
214
|
+
readonly custom: "custom";
|
|
215
215
|
}>;
|
|
216
216
|
allowedRoleIds: z.ZodArray<z.ZodString>;
|
|
217
217
|
deniedRoleIds: z.ZodArray<z.ZodString>;
|
|
@@ -280,8 +280,8 @@ export declare const shardControlOperationSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
280
280
|
moduleId: z.ZodString;
|
|
281
281
|
resourceType: z.ZodString;
|
|
282
282
|
intent: z.ZodEnum<{
|
|
283
|
-
draft: "draft";
|
|
284
|
-
publish: "publish";
|
|
283
|
+
readonly draft: "draft";
|
|
284
|
+
readonly publish: "publish";
|
|
285
285
|
}>;
|
|
286
286
|
value: z.ZodRecord<z.ZodString, z.ZodCustom<ManagedResourceValue, ManagedResourceValue>>;
|
|
287
287
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -320,22 +320,22 @@ export declare const shardControlOperationSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
320
320
|
notificationId: z.ZodUUID;
|
|
321
321
|
reference: z.ZodString;
|
|
322
322
|
caseType: z.ZodEnum<{
|
|
323
|
-
bug: "bug";
|
|
324
|
-
general_support: "general_support";
|
|
325
|
-
security: "security";
|
|
323
|
+
readonly bug: "bug";
|
|
324
|
+
readonly general_support: "general_support";
|
|
325
|
+
readonly security: "security";
|
|
326
326
|
}>;
|
|
327
327
|
categoryOrModule: z.ZodString;
|
|
328
328
|
reportedSeverity: z.ZodNullable<z.ZodEnum<{
|
|
329
|
-
low: "low";
|
|
330
|
-
medium: "medium";
|
|
331
|
-
high: "high";
|
|
332
|
-
critical: "critical";
|
|
329
|
+
readonly low: "low";
|
|
330
|
+
readonly medium: "medium";
|
|
331
|
+
readonly high: "high";
|
|
332
|
+
readonly critical: "critical";
|
|
333
333
|
}>>;
|
|
334
334
|
source: z.ZodEnum<{
|
|
335
|
-
dashboard_bug: "dashboard_bug";
|
|
336
|
-
dashboard_support: "dashboard_support";
|
|
337
|
-
dashboard_security: "dashboard_security";
|
|
338
|
-
discord_command: "discord_command";
|
|
335
|
+
readonly dashboard_bug: "dashboard_bug";
|
|
336
|
+
readonly dashboard_support: "dashboard_support";
|
|
337
|
+
readonly dashboard_security: "dashboard_security";
|
|
338
|
+
readonly discord_command: "discord_command";
|
|
339
339
|
}>;
|
|
340
340
|
}, z.core.$strict>, z.ZodObject<{
|
|
341
341
|
kind: z.ZodLiteral<"privacy.providers.list">;
|
|
@@ -392,10 +392,10 @@ export declare const shardControlRequestSchema: z.ZodObject<{
|
|
|
392
392
|
version: z.ZodNumber;
|
|
393
393
|
module: z.ZodObject<{
|
|
394
394
|
preset: z.ZodEnum<{
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
395
|
+
readonly everyone: "everyone";
|
|
396
|
+
readonly moderators: "moderators";
|
|
397
|
+
readonly administrators: "administrators";
|
|
398
|
+
readonly custom: "custom";
|
|
399
399
|
}>;
|
|
400
400
|
allowedRoleIds: z.ZodArray<z.ZodString>;
|
|
401
401
|
deniedRoleIds: z.ZodArray<z.ZodString>;
|
|
@@ -406,10 +406,10 @@ export declare const shardControlRequestSchema: z.ZodObject<{
|
|
|
406
406
|
enabled: z.ZodBoolean;
|
|
407
407
|
policy: z.ZodObject<{
|
|
408
408
|
preset: z.ZodEnum<{
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
readonly everyone: "everyone";
|
|
410
|
+
readonly moderators: "moderators";
|
|
411
|
+
readonly administrators: "administrators";
|
|
412
|
+
readonly custom: "custom";
|
|
413
413
|
}>;
|
|
414
414
|
allowedRoleIds: z.ZodArray<z.ZodString>;
|
|
415
415
|
deniedRoleIds: z.ZodArray<z.ZodString>;
|
|
@@ -478,8 +478,8 @@ export declare const shardControlRequestSchema: z.ZodObject<{
|
|
|
478
478
|
moduleId: z.ZodString;
|
|
479
479
|
resourceType: z.ZodString;
|
|
480
480
|
intent: z.ZodEnum<{
|
|
481
|
-
draft: "draft";
|
|
482
|
-
publish: "publish";
|
|
481
|
+
readonly draft: "draft";
|
|
482
|
+
readonly publish: "publish";
|
|
483
483
|
}>;
|
|
484
484
|
value: z.ZodRecord<z.ZodString, z.ZodCustom<ManagedResourceValue, ManagedResourceValue>>;
|
|
485
485
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -518,22 +518,22 @@ export declare const shardControlRequestSchema: z.ZodObject<{
|
|
|
518
518
|
notificationId: z.ZodUUID;
|
|
519
519
|
reference: z.ZodString;
|
|
520
520
|
caseType: z.ZodEnum<{
|
|
521
|
-
bug: "bug";
|
|
522
|
-
general_support: "general_support";
|
|
523
|
-
security: "security";
|
|
521
|
+
readonly bug: "bug";
|
|
522
|
+
readonly general_support: "general_support";
|
|
523
|
+
readonly security: "security";
|
|
524
524
|
}>;
|
|
525
525
|
categoryOrModule: z.ZodString;
|
|
526
526
|
reportedSeverity: z.ZodNullable<z.ZodEnum<{
|
|
527
|
-
low: "low";
|
|
528
|
-
medium: "medium";
|
|
529
|
-
high: "high";
|
|
530
|
-
critical: "critical";
|
|
527
|
+
readonly low: "low";
|
|
528
|
+
readonly medium: "medium";
|
|
529
|
+
readonly high: "high";
|
|
530
|
+
readonly critical: "critical";
|
|
531
531
|
}>>;
|
|
532
532
|
source: z.ZodEnum<{
|
|
533
|
-
dashboard_bug: "dashboard_bug";
|
|
534
|
-
dashboard_support: "dashboard_support";
|
|
535
|
-
dashboard_security: "dashboard_security";
|
|
536
|
-
discord_command: "discord_command";
|
|
533
|
+
readonly dashboard_bug: "dashboard_bug";
|
|
534
|
+
readonly dashboard_support: "dashboard_support";
|
|
535
|
+
readonly dashboard_security: "dashboard_security";
|
|
536
|
+
readonly discord_command: "discord_command";
|
|
537
537
|
}>;
|
|
538
538
|
}, z.core.$strict>, z.ZodObject<{
|
|
539
539
|
kind: z.ZodLiteral<"privacy.providers.list">;
|
|
@@ -584,9 +584,9 @@ declare const shardCloudOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
584
584
|
kind: z.ZodLiteral<"cloud.enrol">;
|
|
585
585
|
token: z.ZodString;
|
|
586
586
|
source: z.ZodEnum<{
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
587
|
+
readonly discord: "discord";
|
|
588
|
+
readonly file: "file";
|
|
589
|
+
readonly startup: "startup";
|
|
590
590
|
}>;
|
|
591
591
|
}, z.core.$strict>, z.ZodObject<{
|
|
592
592
|
kind: z.ZodLiteral<"cloud.disconnect">;
|
|
@@ -622,9 +622,9 @@ export declare const shardCloudRequestSchema: z.ZodObject<{
|
|
|
622
622
|
kind: z.ZodLiteral<"cloud.enrol">;
|
|
623
623
|
token: z.ZodString;
|
|
624
624
|
source: z.ZodEnum<{
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
625
|
+
readonly discord: "discord";
|
|
626
|
+
readonly file: "file";
|
|
627
|
+
readonly startup: "startup";
|
|
628
628
|
}>;
|
|
629
629
|
}, z.core.$strict>, z.ZodObject<{
|
|
630
630
|
kind: z.ZodLiteral<"cloud.disconnect">;
|
|
@@ -670,20 +670,20 @@ export declare const shardOperationsHealthResponseSchema: z.ZodObject<{
|
|
|
670
670
|
health: z.ZodObject<{
|
|
671
671
|
version: z.ZodLiteral<1>;
|
|
672
672
|
mode: z.ZodEnum<{
|
|
673
|
-
off: "off";
|
|
674
|
-
auto: "auto";
|
|
675
|
-
fixed: "fixed";
|
|
673
|
+
readonly off: "off";
|
|
674
|
+
readonly auto: "auto";
|
|
675
|
+
readonly fixed: "fixed";
|
|
676
676
|
}>;
|
|
677
677
|
scope: z.ZodEnum<{
|
|
678
|
-
local: "local";
|
|
679
|
-
coordinated: "coordinated";
|
|
678
|
+
readonly local: "local";
|
|
679
|
+
readonly coordinated: "coordinated";
|
|
680
680
|
}>;
|
|
681
681
|
status: z.ZodEnum<{
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
unavailable: "unavailable";
|
|
686
|
-
stale: "stale";
|
|
682
|
+
readonly healthy: "healthy";
|
|
683
|
+
readonly degraded: "degraded";
|
|
684
|
+
readonly starting: "starting";
|
|
685
|
+
readonly unavailable: "unavailable";
|
|
686
|
+
readonly stale: "stale";
|
|
687
687
|
}>;
|
|
688
688
|
observedAt: z.ZodISODateTime;
|
|
689
689
|
generation: z.ZodString;
|
|
@@ -692,15 +692,15 @@ export declare const shardOperationsHealthResponseSchema: z.ZodObject<{
|
|
|
692
692
|
readyShardCount: z.ZodNumber;
|
|
693
693
|
coordination: z.ZodObject<{
|
|
694
694
|
redis: z.ZodEnum<{
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
695
|
+
readonly not_required: "not_required";
|
|
696
|
+
readonly healthy: "healthy";
|
|
697
|
+
readonly degraded: "degraded";
|
|
698
|
+
readonly unavailable: "unavailable";
|
|
699
699
|
}>;
|
|
700
700
|
database: z.ZodEnum<{
|
|
701
|
-
healthy: "healthy";
|
|
702
|
-
degraded: "degraded";
|
|
703
|
-
unavailable: "unavailable";
|
|
701
|
+
readonly healthy: "healthy";
|
|
702
|
+
readonly degraded: "degraded";
|
|
703
|
+
readonly unavailable: "unavailable";
|
|
704
704
|
}>;
|
|
705
705
|
}, z.core.$strict>;
|
|
706
706
|
scheduler: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -736,12 +736,12 @@ export declare const shardOperationsHealthResponseSchema: z.ZodObject<{
|
|
|
736
736
|
shards: z.ZodArray<z.ZodObject<{
|
|
737
737
|
shardId: z.ZodNumber;
|
|
738
738
|
status: z.ZodEnum<{
|
|
739
|
-
starting: "starting";
|
|
740
|
-
ready: "ready";
|
|
741
|
-
disconnected: "disconnected";
|
|
742
|
-
reconnecting: "reconnecting";
|
|
743
|
-
stopped: "stopped";
|
|
744
|
-
failed: "failed";
|
|
739
|
+
readonly starting: "starting";
|
|
740
|
+
readonly ready: "ready";
|
|
741
|
+
readonly disconnected: "disconnected";
|
|
742
|
+
readonly reconnecting: "reconnecting";
|
|
743
|
+
readonly stopped: "stopped";
|
|
744
|
+
readonly failed: "failed";
|
|
745
745
|
}>;
|
|
746
746
|
guildCount: z.ZodNumber;
|
|
747
747
|
gatewayPingMs: z.ZodNumber;
|
|
@@ -762,12 +762,12 @@ export declare const shardScheduledTaskRequestSchema: z.ZodObject<{
|
|
|
762
762
|
identity: z.ZodObject<{
|
|
763
763
|
version: z.ZodLiteral<1>;
|
|
764
764
|
mode: z.ZodEnum<{
|
|
765
|
-
auto: "auto";
|
|
766
|
-
fixed: "fixed";
|
|
765
|
+
readonly auto: "auto";
|
|
766
|
+
readonly fixed: "fixed";
|
|
767
767
|
}>;
|
|
768
768
|
scope: z.ZodEnum<{
|
|
769
|
-
local: "local";
|
|
770
|
-
coordinated: "coordinated";
|
|
769
|
+
readonly local: "local";
|
|
770
|
+
readonly coordinated: "coordinated";
|
|
771
771
|
}>;
|
|
772
772
|
generation: z.ZodString;
|
|
773
773
|
deploymentOrder: z.ZodOptional<z.ZodNumber>;
|
|
@@ -803,8 +803,8 @@ export declare const shardScheduledTaskResponseSchema: z.ZodObject<{
|
|
|
803
803
|
outcome: z.ZodLiteral<"completed">;
|
|
804
804
|
}, z.core.$strict>, z.ZodObject<{
|
|
805
805
|
outcome: z.ZodEnum<{
|
|
806
|
-
deferred: "deferred";
|
|
807
|
-
retry: "retry";
|
|
806
|
+
readonly deferred: "deferred";
|
|
807
|
+
readonly retry: "retry";
|
|
808
808
|
}>;
|
|
809
809
|
delayMs: z.ZodNumber;
|
|
810
810
|
safeCode: z.ZodString;
|
|
@@ -850,10 +850,10 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
850
850
|
version: z.ZodNumber;
|
|
851
851
|
module: z.ZodObject<{
|
|
852
852
|
preset: z.ZodEnum<{
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
853
|
+
readonly everyone: "everyone";
|
|
854
|
+
readonly moderators: "moderators";
|
|
855
|
+
readonly administrators: "administrators";
|
|
856
|
+
readonly custom: "custom";
|
|
857
857
|
}>;
|
|
858
858
|
allowedRoleIds: z.ZodArray<z.ZodString>;
|
|
859
859
|
deniedRoleIds: z.ZodArray<z.ZodString>;
|
|
@@ -864,10 +864,10 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
864
864
|
enabled: z.ZodBoolean;
|
|
865
865
|
policy: z.ZodObject<{
|
|
866
866
|
preset: z.ZodEnum<{
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
867
|
+
readonly everyone: "everyone";
|
|
868
|
+
readonly moderators: "moderators";
|
|
869
|
+
readonly administrators: "administrators";
|
|
870
|
+
readonly custom: "custom";
|
|
871
871
|
}>;
|
|
872
872
|
allowedRoleIds: z.ZodArray<z.ZodString>;
|
|
873
873
|
deniedRoleIds: z.ZodArray<z.ZodString>;
|
|
@@ -936,8 +936,8 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
936
936
|
moduleId: z.ZodString;
|
|
937
937
|
resourceType: z.ZodString;
|
|
938
938
|
intent: z.ZodEnum<{
|
|
939
|
-
draft: "draft";
|
|
940
|
-
publish: "publish";
|
|
939
|
+
readonly draft: "draft";
|
|
940
|
+
readonly publish: "publish";
|
|
941
941
|
}>;
|
|
942
942
|
value: z.ZodRecord<z.ZodString, z.ZodCustom<ManagedResourceValue, ManagedResourceValue>>;
|
|
943
943
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -976,22 +976,22 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
976
976
|
notificationId: z.ZodUUID;
|
|
977
977
|
reference: z.ZodString;
|
|
978
978
|
caseType: z.ZodEnum<{
|
|
979
|
-
bug: "bug";
|
|
980
|
-
general_support: "general_support";
|
|
981
|
-
security: "security";
|
|
979
|
+
readonly bug: "bug";
|
|
980
|
+
readonly general_support: "general_support";
|
|
981
|
+
readonly security: "security";
|
|
982
982
|
}>;
|
|
983
983
|
categoryOrModule: z.ZodString;
|
|
984
984
|
reportedSeverity: z.ZodNullable<z.ZodEnum<{
|
|
985
|
-
low: "low";
|
|
986
|
-
medium: "medium";
|
|
987
|
-
high: "high";
|
|
988
|
-
critical: "critical";
|
|
985
|
+
readonly low: "low";
|
|
986
|
+
readonly medium: "medium";
|
|
987
|
+
readonly high: "high";
|
|
988
|
+
readonly critical: "critical";
|
|
989
989
|
}>>;
|
|
990
990
|
source: z.ZodEnum<{
|
|
991
|
-
dashboard_bug: "dashboard_bug";
|
|
992
|
-
dashboard_support: "dashboard_support";
|
|
993
|
-
dashboard_security: "dashboard_security";
|
|
994
|
-
discord_command: "discord_command";
|
|
991
|
+
readonly dashboard_bug: "dashboard_bug";
|
|
992
|
+
readonly dashboard_support: "dashboard_support";
|
|
993
|
+
readonly dashboard_security: "dashboard_security";
|
|
994
|
+
readonly discord_command: "discord_command";
|
|
995
995
|
}>;
|
|
996
996
|
}, z.core.$strict>, z.ZodObject<{
|
|
997
997
|
kind: z.ZodLiteral<"privacy.providers.list">;
|
|
@@ -1031,20 +1031,20 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1031
1031
|
health: z.ZodObject<{
|
|
1032
1032
|
version: z.ZodLiteral<1>;
|
|
1033
1033
|
mode: z.ZodEnum<{
|
|
1034
|
-
off: "off";
|
|
1035
|
-
auto: "auto";
|
|
1036
|
-
fixed: "fixed";
|
|
1034
|
+
readonly off: "off";
|
|
1035
|
+
readonly auto: "auto";
|
|
1036
|
+
readonly fixed: "fixed";
|
|
1037
1037
|
}>;
|
|
1038
1038
|
scope: z.ZodEnum<{
|
|
1039
|
-
local: "local";
|
|
1040
|
-
coordinated: "coordinated";
|
|
1039
|
+
readonly local: "local";
|
|
1040
|
+
readonly coordinated: "coordinated";
|
|
1041
1041
|
}>;
|
|
1042
1042
|
status: z.ZodEnum<{
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
unavailable: "unavailable";
|
|
1047
|
-
stale: "stale";
|
|
1043
|
+
readonly healthy: "healthy";
|
|
1044
|
+
readonly degraded: "degraded";
|
|
1045
|
+
readonly starting: "starting";
|
|
1046
|
+
readonly unavailable: "unavailable";
|
|
1047
|
+
readonly stale: "stale";
|
|
1048
1048
|
}>;
|
|
1049
1049
|
observedAt: z.ZodISODateTime;
|
|
1050
1050
|
generation: z.ZodString;
|
|
@@ -1053,15 +1053,15 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1053
1053
|
readyShardCount: z.ZodNumber;
|
|
1054
1054
|
coordination: z.ZodObject<{
|
|
1055
1055
|
redis: z.ZodEnum<{
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1056
|
+
readonly not_required: "not_required";
|
|
1057
|
+
readonly healthy: "healthy";
|
|
1058
|
+
readonly degraded: "degraded";
|
|
1059
|
+
readonly unavailable: "unavailable";
|
|
1060
1060
|
}>;
|
|
1061
1061
|
database: z.ZodEnum<{
|
|
1062
|
-
healthy: "healthy";
|
|
1063
|
-
degraded: "degraded";
|
|
1064
|
-
unavailable: "unavailable";
|
|
1062
|
+
readonly healthy: "healthy";
|
|
1063
|
+
readonly degraded: "degraded";
|
|
1064
|
+
readonly unavailable: "unavailable";
|
|
1065
1065
|
}>;
|
|
1066
1066
|
}, z.core.$strict>;
|
|
1067
1067
|
scheduler: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1097,12 +1097,12 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1097
1097
|
shards: z.ZodArray<z.ZodObject<{
|
|
1098
1098
|
shardId: z.ZodNumber;
|
|
1099
1099
|
status: z.ZodEnum<{
|
|
1100
|
-
starting: "starting";
|
|
1101
|
-
ready: "ready";
|
|
1102
|
-
disconnected: "disconnected";
|
|
1103
|
-
reconnecting: "reconnecting";
|
|
1104
|
-
stopped: "stopped";
|
|
1105
|
-
failed: "failed";
|
|
1100
|
+
readonly starting: "starting";
|
|
1101
|
+
readonly ready: "ready";
|
|
1102
|
+
readonly disconnected: "disconnected";
|
|
1103
|
+
readonly reconnecting: "reconnecting";
|
|
1104
|
+
readonly stopped: "stopped";
|
|
1105
|
+
readonly failed: "failed";
|
|
1106
1106
|
}>;
|
|
1107
1107
|
guildCount: z.ZodNumber;
|
|
1108
1108
|
gatewayPingMs: z.ZodNumber;
|
|
@@ -1122,12 +1122,12 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1122
1122
|
identity: z.ZodObject<{
|
|
1123
1123
|
version: z.ZodLiteral<1>;
|
|
1124
1124
|
mode: z.ZodEnum<{
|
|
1125
|
-
auto: "auto";
|
|
1126
|
-
fixed: "fixed";
|
|
1125
|
+
readonly auto: "auto";
|
|
1126
|
+
readonly fixed: "fixed";
|
|
1127
1127
|
}>;
|
|
1128
1128
|
scope: z.ZodEnum<{
|
|
1129
|
-
local: "local";
|
|
1130
|
-
coordinated: "coordinated";
|
|
1129
|
+
readonly local: "local";
|
|
1130
|
+
readonly coordinated: "coordinated";
|
|
1131
1131
|
}>;
|
|
1132
1132
|
generation: z.ZodString;
|
|
1133
1133
|
deploymentOrder: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1160,12 +1160,12 @@ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1160
1160
|
identity: z.ZodObject<{
|
|
1161
1161
|
version: z.ZodLiteral<1>;
|
|
1162
1162
|
mode: z.ZodEnum<{
|
|
1163
|
-
auto: "auto";
|
|
1164
|
-
fixed: "fixed";
|
|
1163
|
+
readonly auto: "auto";
|
|
1164
|
+
readonly fixed: "fixed";
|
|
1165
1165
|
}>;
|
|
1166
1166
|
scope: z.ZodEnum<{
|
|
1167
|
-
local: "local";
|
|
1168
|
-
coordinated: "coordinated";
|
|
1167
|
+
readonly local: "local";
|
|
1168
|
+
readonly coordinated: "coordinated";
|
|
1169
1169
|
}>;
|
|
1170
1170
|
generation: z.ZodString;
|
|
1171
1171
|
deploymentOrder: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1213,9 +1213,9 @@ export declare const workerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodDiscrimi
|
|
|
1213
1213
|
kind: z.ZodLiteral<"cloud.enrol">;
|
|
1214
1214
|
token: z.ZodString;
|
|
1215
1215
|
source: z.ZodEnum<{
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1216
|
+
readonly discord: "discord";
|
|
1217
|
+
readonly file: "file";
|
|
1218
|
+
readonly startup: "startup";
|
|
1219
1219
|
}>;
|
|
1220
1220
|
}, z.core.$strict>, z.ZodObject<{
|
|
1221
1221
|
kind: z.ZodLiteral<"cloud.disconnect">;
|
|
@@ -1245,8 +1245,8 @@ export declare const workerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodDiscrimi
|
|
|
1245
1245
|
outcome: z.ZodLiteral<"completed">;
|
|
1246
1246
|
}, z.core.$strict>, z.ZodObject<{
|
|
1247
1247
|
outcome: z.ZodEnum<{
|
|
1248
|
-
deferred: "deferred";
|
|
1249
|
-
retry: "retry";
|
|
1248
|
+
readonly deferred: "deferred";
|
|
1249
|
+
readonly retry: "retry";
|
|
1250
1250
|
}>;
|
|
1251
1251
|
delayMs: z.ZodNumber;
|
|
1252
1252
|
safeCode: z.ZodString;
|
|
@@ -1260,12 +1260,12 @@ export declare const workerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodDiscrimi
|
|
|
1260
1260
|
identity: z.ZodObject<{
|
|
1261
1261
|
version: z.ZodLiteral<1>;
|
|
1262
1262
|
mode: z.ZodEnum<{
|
|
1263
|
-
auto: "auto";
|
|
1264
|
-
fixed: "fixed";
|
|
1263
|
+
readonly auto: "auto";
|
|
1264
|
+
readonly fixed: "fixed";
|
|
1265
1265
|
}>;
|
|
1266
1266
|
scope: z.ZodEnum<{
|
|
1267
|
-
local: "local";
|
|
1268
|
-
coordinated: "coordinated";
|
|
1267
|
+
readonly local: "local";
|
|
1268
|
+
readonly coordinated: "coordinated";
|
|
1269
1269
|
}>;
|
|
1270
1270
|
generation: z.ZodString;
|
|
1271
1271
|
deploymentOrder: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1277,12 +1277,12 @@ export declare const workerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodDiscrimi
|
|
|
1277
1277
|
health: z.ZodObject<{
|
|
1278
1278
|
shardId: z.ZodNumber;
|
|
1279
1279
|
status: z.ZodEnum<{
|
|
1280
|
-
starting: "starting";
|
|
1281
|
-
ready: "ready";
|
|
1282
|
-
disconnected: "disconnected";
|
|
1283
|
-
reconnecting: "reconnecting";
|
|
1284
|
-
stopped: "stopped";
|
|
1285
|
-
failed: "failed";
|
|
1280
|
+
readonly starting: "starting";
|
|
1281
|
+
readonly ready: "ready";
|
|
1282
|
+
readonly disconnected: "disconnected";
|
|
1283
|
+
readonly reconnecting: "reconnecting";
|
|
1284
|
+
readonly stopped: "stopped";
|
|
1285
|
+
readonly failed: "failed";
|
|
1286
1286
|
}>;
|
|
1287
1287
|
guildCount: z.ZodNumber;
|
|
1288
1288
|
gatewayPingMs: z.ZodNumber;
|
package/dist/shard-contracts.js
CHANGED
|
@@ -16,7 +16,12 @@ const mutationContext = z
|
|
|
16
16
|
.strict();
|
|
17
17
|
const permissionPolicy = z
|
|
18
18
|
.object({
|
|
19
|
-
preset: z.enum(
|
|
19
|
+
preset: z.enum({
|
|
20
|
+
everyone: "everyone",
|
|
21
|
+
moderators: "moderators",
|
|
22
|
+
administrators: "administrators",
|
|
23
|
+
custom: "custom",
|
|
24
|
+
}),
|
|
20
25
|
allowedRoleIds: z.array(snowflake).max(100),
|
|
21
26
|
deniedRoleIds: z.array(snowflake).max(100),
|
|
22
27
|
})
|
|
@@ -61,7 +66,7 @@ const scheduledTaskResult = z.discriminatedUnion("outcome", [
|
|
|
61
66
|
z.object({ outcome: z.literal("completed") }).strict(),
|
|
62
67
|
z
|
|
63
68
|
.object({
|
|
64
|
-
outcome: z.enum(
|
|
69
|
+
outcome: z.enum({ deferred: "deferred", retry: "retry" }),
|
|
65
70
|
delayMs: z.number().int().min(100).max(86_400_000),
|
|
66
71
|
safeCode: z.string().regex(/^[a-z0-9][a-z0-9._-]{0,99}$/u),
|
|
67
72
|
})
|
|
@@ -76,8 +81,8 @@ const scheduledTaskResult = z.discriminatedUnion("outcome", [
|
|
|
76
81
|
export const shardIdentitySchema = z
|
|
77
82
|
.object({
|
|
78
83
|
version: z.literal(SHARD_CONTRACT_VERSION),
|
|
79
|
-
mode: z.enum(
|
|
80
|
-
scope: z.enum(
|
|
84
|
+
mode: z.enum({ auto: "auto", fixed: "fixed" }),
|
|
85
|
+
scope: z.enum({ local: "local", coordinated: "coordinated" }),
|
|
81
86
|
generation: safeIdentifier,
|
|
82
87
|
deploymentOrder: z.number().int().positive().optional(),
|
|
83
88
|
supervisorId: z.uuid(),
|
|
@@ -111,14 +116,14 @@ export const gatewayBotInformationSchema = z
|
|
|
111
116
|
export const shardProcessHealthSchema = z
|
|
112
117
|
.object({
|
|
113
118
|
shardId: z.number().int().min(0).max(4_095),
|
|
114
|
-
status: z.enum(
|
|
115
|
-
"starting",
|
|
116
|
-
"ready",
|
|
117
|
-
"disconnected",
|
|
118
|
-
"reconnecting",
|
|
119
|
-
"stopped",
|
|
120
|
-
"failed",
|
|
121
|
-
|
|
119
|
+
status: z.enum({
|
|
120
|
+
starting: "starting",
|
|
121
|
+
ready: "ready",
|
|
122
|
+
disconnected: "disconnected",
|
|
123
|
+
reconnecting: "reconnecting",
|
|
124
|
+
stopped: "stopped",
|
|
125
|
+
failed: "failed",
|
|
126
|
+
}),
|
|
122
127
|
guildCount: z.number().int().min(0),
|
|
123
128
|
gatewayPingMs: z.number().finite().min(-1).max(300_000),
|
|
124
129
|
uptimeSeconds: z.number().finite().min(0),
|
|
@@ -162,9 +167,15 @@ export const schedulerOperationalHealthSchema = z.discriminatedUnion("status", [
|
|
|
162
167
|
export const shardHealthSnapshotSchema = z
|
|
163
168
|
.object({
|
|
164
169
|
version: z.literal(SHARD_CONTRACT_VERSION),
|
|
165
|
-
mode: z.enum(
|
|
166
|
-
scope: z.enum(
|
|
167
|
-
status: z.enum(
|
|
170
|
+
mode: z.enum({ off: "off", auto: "auto", fixed: "fixed" }),
|
|
171
|
+
scope: z.enum({ local: "local", coordinated: "coordinated" }),
|
|
172
|
+
status: z.enum({
|
|
173
|
+
healthy: "healthy",
|
|
174
|
+
degraded: "degraded",
|
|
175
|
+
starting: "starting",
|
|
176
|
+
unavailable: "unavailable",
|
|
177
|
+
stale: "stale",
|
|
178
|
+
}),
|
|
168
179
|
observedAt: dateTime,
|
|
169
180
|
generation: safeIdentifier,
|
|
170
181
|
supervisorId: z.uuid(),
|
|
@@ -172,8 +183,17 @@ export const shardHealthSnapshotSchema = z
|
|
|
172
183
|
readyShardCount: z.number().int().min(0).max(4_096),
|
|
173
184
|
coordination: z
|
|
174
185
|
.object({
|
|
175
|
-
redis: z.enum(
|
|
176
|
-
|
|
186
|
+
redis: z.enum({
|
|
187
|
+
not_required: "not_required",
|
|
188
|
+
healthy: "healthy",
|
|
189
|
+
degraded: "degraded",
|
|
190
|
+
unavailable: "unavailable",
|
|
191
|
+
}),
|
|
192
|
+
database: z.enum({
|
|
193
|
+
healthy: "healthy",
|
|
194
|
+
degraded: "degraded",
|
|
195
|
+
unavailable: "unavailable",
|
|
196
|
+
}),
|
|
177
197
|
})
|
|
178
198
|
.strict(),
|
|
179
199
|
scheduler: schedulerOperationalHealthSchema.optional(),
|
|
@@ -297,7 +317,7 @@ export const shardControlOperationSchema = z.discriminatedUnion("kind", [
|
|
|
297
317
|
guildId: snowflake,
|
|
298
318
|
moduleId,
|
|
299
319
|
resourceType,
|
|
300
|
-
intent: z.enum(
|
|
320
|
+
intent: z.enum({ draft: "draft", publish: "publish" }),
|
|
301
321
|
value: managedResourceObject,
|
|
302
322
|
...mutationContext.shape,
|
|
303
323
|
})
|
|
@@ -344,17 +364,26 @@ export const shardControlOperationSchema = z.discriminatedUnion("kind", [
|
|
|
344
364
|
guildId: snowflake,
|
|
345
365
|
notificationId: z.uuid(),
|
|
346
366
|
reference: z.string().trim().min(1).max(40),
|
|
347
|
-
caseType: z.enum(
|
|
367
|
+
caseType: z.enum({
|
|
368
|
+
bug: "bug",
|
|
369
|
+
general_support: "general_support",
|
|
370
|
+
security: "security",
|
|
371
|
+
}),
|
|
348
372
|
categoryOrModule: z.string().trim().min(1).max(100),
|
|
349
373
|
reportedSeverity: z
|
|
350
|
-
.enum(
|
|
374
|
+
.enum({
|
|
375
|
+
low: "low",
|
|
376
|
+
medium: "medium",
|
|
377
|
+
high: "high",
|
|
378
|
+
critical: "critical",
|
|
379
|
+
})
|
|
351
380
|
.nullable(),
|
|
352
|
-
source: z.enum(
|
|
353
|
-
"dashboard_bug",
|
|
354
|
-
"dashboard_support",
|
|
355
|
-
"dashboard_security",
|
|
356
|
-
"discord_command",
|
|
357
|
-
|
|
381
|
+
source: z.enum({
|
|
382
|
+
dashboard_bug: "dashboard_bug",
|
|
383
|
+
dashboard_support: "dashboard_support",
|
|
384
|
+
dashboard_security: "dashboard_security",
|
|
385
|
+
discord_command: "discord_command",
|
|
386
|
+
}),
|
|
358
387
|
})
|
|
359
388
|
.strict(),
|
|
360
389
|
z.object({ kind: z.literal("privacy.providers.list") }).strict(),
|
|
@@ -428,7 +457,11 @@ const shardCloudOperationSchema = z.discriminatedUnion("kind", [
|
|
|
428
457
|
.object({
|
|
429
458
|
kind: z.literal("cloud.enrol"),
|
|
430
459
|
token: z.string().min(1).max(200),
|
|
431
|
-
source: z.enum(
|
|
460
|
+
source: z.enum({
|
|
461
|
+
discord: "discord",
|
|
462
|
+
file: "file",
|
|
463
|
+
startup: "startup",
|
|
464
|
+
}),
|
|
432
465
|
})
|
|
433
466
|
.strict(),
|
|
434
467
|
z.object({ kind: z.literal("cloud.disconnect") }).strict(),
|