@devvit/shared-types 0.12.0-next-2025-04-30-2e2a14dbe.0 → 0.12.0-next-2025-08-12-20-19-11-8d352335b.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/AdsMetadata.d.ts +6 -0
  2. package/AdsMetadata.d.ts.map +1 -0
  3. package/AdsMetadata.js +5 -0
  4. package/Assets.d.ts +0 -2
  5. package/Assets.d.ts.map +1 -1
  6. package/Assets.js +0 -2
  7. package/CircuitBreaker.d.ts.map +1 -1
  8. package/Config.d.ts +3 -3
  9. package/Config.d.ts.map +1 -1
  10. package/ConfigImpl.d.ts +8 -8
  11. package/ConfigImpl.d.ts.map +1 -1
  12. package/ConfigImpl.js +22 -31
  13. package/Header.d.ts +1 -0
  14. package/Header.d.ts.map +1 -1
  15. package/Header.js +1 -0
  16. package/PostData.d.ts +8 -0
  17. package/PostData.d.ts.map +1 -0
  18. package/ProjectTemplateInfo.d.ts +21 -0
  19. package/ProjectTemplateInfo.d.ts.map +1 -0
  20. package/ProjectTemplateInfo.js +10 -0
  21. package/client/emit-effect.d.ts +24 -0
  22. package/client/emit-effect.d.ts.map +1 -0
  23. package/client/emit-effect.js +56 -0
  24. package/client/emit-effect.test.d.ts.map +1 -0
  25. package/client/share.d.ts +3 -0
  26. package/client/share.d.ts.map +1 -0
  27. package/client/share.js +2 -0
  28. package/constants.d.ts +9 -0
  29. package/constants.d.ts.map +1 -1
  30. package/constants.js +9 -0
  31. package/fetch-domains.d.ts +14 -0
  32. package/fetch-domains.d.ts.map +1 -0
  33. package/fetch-domains.js +42 -0
  34. package/fetch-domains.test.d.ts.map +1 -0
  35. package/isDevvitDependency.js +1 -1
  36. package/json.d.ts +12 -12
  37. package/package.json +18 -13
  38. package/richtext/index.d.ts +6 -0
  39. package/richtext/index.d.ts.map +1 -0
  40. package/richtext/index.js +1 -0
  41. package/schemas/config-file.v1.d.ts +272 -0
  42. package/schemas/config-file.v1.d.ts.map +1 -0
  43. package/schemas/config-file.v1.js +254 -0
  44. package/schemas/config-file.v1.json +683 -0
  45. package/schemas/config-file.v1.test.d.ts.map +1 -0
  46. package/schemas/constants.d.ts +4 -0
  47. package/schemas/constants.d.ts.map +1 -0
  48. package/schemas/constants.js +3 -0
  49. package/{payments/products.schema.json → schemas/products.json} +1 -1
  50. package/{payments/productSchemaJSONValidator.d.ts → schemas/productsSchemaJSONValidator.d.ts} +2 -2
  51. package/schemas/productsSchemaJSONValidator.d.ts.map +1 -0
  52. package/{payments/productSchemaJSONValidator.js → schemas/productsSchemaJSONValidator.js} +1 -1
  53. package/schemas/productsSchemaJSONValidator.test.d.ts.map +1 -0
  54. package/server/get-devvit-config.d.ts +7 -0
  55. package/server/get-devvit-config.d.ts.map +1 -0
  56. package/server/get-devvit-config.js +10 -0
  57. package/shared/devvit-worker-global.d.ts +47 -0
  58. package/shared/devvit-worker-global.d.ts.map +1 -0
  59. package/shared/devvit-worker-global.js +7 -0
  60. package/{forms/types.d.ts → shared/form.d.ts} +16 -72
  61. package/shared/form.d.ts.map +1 -0
  62. package/tid.d.ts +26 -32
  63. package/tid.d.ts.map +1 -1
  64. package/tid.js +43 -62
  65. package/web-view-scripts-constants.d.ts +14 -0
  66. package/web-view-scripts-constants.d.ts.map +1 -0
  67. package/web-view-scripts-constants.js +13 -0
  68. package/forms/assertValidFormFields.d.ts +0 -11
  69. package/forms/assertValidFormFields.d.ts.map +0 -1
  70. package/forms/assertValidFormFields.js +0 -29
  71. package/forms/assertValidFormFields.test.d.ts.map +0 -1
  72. package/forms/getFormValues.d.ts +0 -6
  73. package/forms/getFormValues.d.ts.map +0 -1
  74. package/forms/getFormValues.js +0 -31
  75. package/forms/getFormValues.test.d.ts.map +0 -1
  76. package/forms/transformForm.d.ts +0 -4
  77. package/forms/transformForm.d.ts.map +0 -1
  78. package/forms/transformForm.js +0 -141
  79. package/forms/transformForm.test.d.ts.map +0 -1
  80. package/forms/types.d.ts.map +0 -1
  81. package/index.d.ts +0 -2
  82. package/index.d.ts.map +0 -1
  83. package/payments/index.d.ts +0 -4
  84. package/payments/index.d.ts.map +0 -1
  85. package/payments/index.js +0 -3
  86. package/payments/productSchemaJSONValidator.d.ts.map +0 -1
  87. package/payments/productSchemaJSONValidator.test.d.ts.map +0 -1
  88. /package/{index.js → PostData.js} +0 -0
  89. /package/{forms/types.js → shared/form.js} +0 -0
@@ -0,0 +1,683 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://developers.reddit.com/schema/config-file.v1.json",
4
+ "title": "Devvit app config file schema",
5
+ "type": "object",
6
+ "description": "A JSON representation of a Devvit app config file.",
7
+ "$defs": {
8
+ "CronSchedule": {
9
+ "type": "string",
10
+ "description": "The cron schedule for the task. Uses standard five-part UNIX cron format, or a six-part version with second-level granularity. If not provided, you'll need to schedule the task manually using `@devvit/web/server`.",
11
+ "examples": ["0 * * * *", "*/30 * * * * *"]
12
+ },
13
+ "Entrypoint": {
14
+ "type": "object",
15
+ "description": "Key-value pairs mapping entrypoint name to a specific post entrypoint configuration.",
16
+ "additionalProperties": false,
17
+ "properties": {
18
+ "entry": {
19
+ "type": "string",
20
+ "description": "Web view document shown in the post. Can be an HTML file path (resolved relative to the web view domain root) or a server endpoint path starting with `/api/`. May include query parameters.",
21
+ "pattern": "^(/api/)?[^/].*$"
22
+ },
23
+ "height": {
24
+ "description": "The height configuration for this post view.",
25
+ "enum": ["regular", "tall"],
26
+ "default": "tall"
27
+ }
28
+ }
29
+ },
30
+ "InternalEndpoint": {
31
+ "type": "string",
32
+ "description": "HTTP path. Requests are POSTed JSON, and response bodies must also be in JSON format.",
33
+ "examples": [
34
+ "/internal/menu/post-create",
35
+ "/internal/triggers/delete-post",
36
+ "/internal/cron/daily-job"
37
+ ],
38
+ "pattern": "^/internal/.+"
39
+ },
40
+ "Path": {
41
+ "type": "string",
42
+ "pattern": "^[^\\\\\\\\]+$"
43
+ },
44
+ "StringSetting": {
45
+ "type": "object",
46
+ "required": ["type"],
47
+ "additionalProperties": false,
48
+ "properties": {
49
+ "type": {
50
+ "const": "string"
51
+ },
52
+ "label": {
53
+ "type": "string",
54
+ "description": "The display label for this setting."
55
+ },
56
+ "helpText": {
57
+ "type": "string",
58
+ "description": "Help text to explain the purpose or usage of this setting."
59
+ },
60
+ "validationEndpoint": {
61
+ "$ref": "#/$defs/InternalEndpoint",
62
+ "description": "Optional endpoint for server-side validation of this setting value."
63
+ },
64
+ "placeholder": {
65
+ "type": "string",
66
+ "description": "Placeholder text to show in the input field."
67
+ },
68
+ "defaultValue": {
69
+ "type": "string",
70
+ "description": "Default value for this setting."
71
+ }
72
+ }
73
+ },
74
+ "ParagraphSetting": {
75
+ "type": "object",
76
+ "required": ["type"],
77
+ "additionalProperties": false,
78
+ "properties": {
79
+ "type": {
80
+ "const": "paragraph"
81
+ },
82
+ "label": {
83
+ "type": "string",
84
+ "description": "The display label for this setting."
85
+ },
86
+ "helpText": {
87
+ "type": "string",
88
+ "description": "Help text to explain the purpose or usage of this setting."
89
+ },
90
+ "validationEndpoint": {
91
+ "$ref": "#/$defs/InternalEndpoint",
92
+ "description": "Optional endpoint for server-side validation of this setting value."
93
+ },
94
+ "placeholder": {
95
+ "type": "string",
96
+ "description": "Placeholder text to show in the textarea."
97
+ },
98
+ "defaultValue": {
99
+ "type": "string",
100
+ "description": "Default value for this setting."
101
+ }
102
+ }
103
+ },
104
+ "NumberSetting": {
105
+ "type": "object",
106
+ "required": ["type"],
107
+ "additionalProperties": false,
108
+ "properties": {
109
+ "type": {
110
+ "const": "number"
111
+ },
112
+ "label": {
113
+ "type": "string",
114
+ "description": "The display label for this setting."
115
+ },
116
+ "helpText": {
117
+ "type": "string",
118
+ "description": "Help text to explain the purpose or usage of this setting."
119
+ },
120
+ "validationEndpoint": {
121
+ "$ref": "#/$defs/InternalEndpoint",
122
+ "description": "Optional endpoint for server-side validation of this setting value."
123
+ },
124
+ "defaultValue": {
125
+ "type": "number",
126
+ "description": "Default value for this setting."
127
+ }
128
+ }
129
+ },
130
+ "BooleanSetting": {
131
+ "type": "object",
132
+ "required": ["type"],
133
+ "additionalProperties": false,
134
+ "properties": {
135
+ "type": {
136
+ "const": "boolean"
137
+ },
138
+ "label": {
139
+ "type": "string",
140
+ "description": "The display label for this setting."
141
+ },
142
+ "helpText": {
143
+ "type": "string",
144
+ "description": "Help text to explain the purpose or usage of this setting."
145
+ },
146
+ "validationEndpoint": {
147
+ "$ref": "#/$defs/InternalEndpoint",
148
+ "description": "Optional endpoint for server-side validation of this setting value."
149
+ },
150
+ "defaultValue": {
151
+ "type": "boolean",
152
+ "description": "Default value for this setting."
153
+ }
154
+ }
155
+ },
156
+ "SelectSetting": {
157
+ "type": "object",
158
+ "required": ["type", "options"],
159
+ "additionalProperties": false,
160
+ "properties": {
161
+ "type": {
162
+ "const": "select"
163
+ },
164
+ "label": {
165
+ "type": "string",
166
+ "description": "The display label for this setting."
167
+ },
168
+ "helpText": {
169
+ "type": "string",
170
+ "description": "Help text to explain the purpose or usage of this setting."
171
+ },
172
+ "validationEndpoint": {
173
+ "$ref": "#/$defs/InternalEndpoint",
174
+ "description": "Optional endpoint for server-side validation of this setting value."
175
+ },
176
+ "options": {
177
+ "type": "array",
178
+ "description": "List of available options for this select setting.",
179
+ "items": {
180
+ "type": "object",
181
+ "description": "An option for a select-type setting.",
182
+ "additionalProperties": false,
183
+ "required": ["label", "value"],
184
+ "properties": {
185
+ "label": {
186
+ "type": "string",
187
+ "description": "The display label for this option."
188
+ },
189
+ "value": {
190
+ "type": "string",
191
+ "description": "The value that will be stored when this option is selected."
192
+ }
193
+ }
194
+ },
195
+ "minItems": 1
196
+ },
197
+ "defaultValue": {
198
+ "type": "string",
199
+ "description": "Default selected option."
200
+ }
201
+ }
202
+ },
203
+ "MultiSelectSetting": {
204
+ "type": "object",
205
+ "required": ["type", "options"],
206
+ "additionalProperties": false,
207
+ "properties": {
208
+ "type": {
209
+ "const": "multiSelect"
210
+ },
211
+ "label": {
212
+ "type": "string",
213
+ "description": "The display label for this setting."
214
+ },
215
+ "helpText": {
216
+ "type": "string",
217
+ "description": "Help text to explain the purpose or usage of this setting."
218
+ },
219
+ "validationEndpoint": {
220
+ "$ref": "#/$defs/InternalEndpoint",
221
+ "description": "Optional endpoint for server-side validation of this setting value."
222
+ },
223
+ "options": {
224
+ "type": "array",
225
+ "description": "List of available options for this select setting.",
226
+ "items": {
227
+ "type": "object",
228
+ "description": "An option for a select-type setting.",
229
+ "additionalProperties": false,
230
+ "required": ["label", "value"],
231
+ "properties": {
232
+ "label": {
233
+ "type": "string",
234
+ "description": "The display label for this option."
235
+ },
236
+ "value": {
237
+ "type": "string",
238
+ "description": "The value that will be stored when this option is selected."
239
+ }
240
+ }
241
+ },
242
+ "minItems": 1
243
+ },
244
+ "defaultValue": {
245
+ "type": "array",
246
+ "items": {
247
+ "type": "string"
248
+ },
249
+ "description": "Default selected options."
250
+ }
251
+ }
252
+ },
253
+ "GlobalStringSetting": {
254
+ "type": "object",
255
+ "required": ["type"],
256
+ "additionalProperties": false,
257
+ "properties": {
258
+ "type": {
259
+ "const": "string"
260
+ },
261
+ "label": {
262
+ "type": "string",
263
+ "description": "The display label for this setting."
264
+ },
265
+ "helpText": {
266
+ "type": "string",
267
+ "description": "Help text to explain the purpose or usage of this setting."
268
+ },
269
+ "validationEndpoint": {
270
+ "$ref": "#/$defs/InternalEndpoint",
271
+ "description": "Optional endpoint for server-side validation of this setting value."
272
+ },
273
+ "placeholder": {
274
+ "type": "string",
275
+ "description": "Placeholder text to show in the input field."
276
+ },
277
+ "defaultValue": {
278
+ "type": "string",
279
+ "description": "Default value for this setting."
280
+ },
281
+ "isSecret": {
282
+ "type": "boolean",
283
+ "description": "Whether this setting contains secret/sensitive information."
284
+ }
285
+ }
286
+ },
287
+ "GlobalSetting": {
288
+ "oneOf": [
289
+ { "$ref": "#/$defs/GlobalStringSetting" },
290
+ { "$ref": "#/$defs/ParagraphSetting" },
291
+ { "$ref": "#/$defs/NumberSetting" },
292
+ { "$ref": "#/$defs/BooleanSetting" },
293
+ { "$ref": "#/$defs/SelectSetting" },
294
+ { "$ref": "#/$defs/MultiSelectSetting" }
295
+ ]
296
+ },
297
+ "SubredditSetting": {
298
+ "oneOf": [
299
+ { "$ref": "#/$defs/StringSetting" },
300
+ { "$ref": "#/$defs/ParagraphSetting" },
301
+ { "$ref": "#/$defs/NumberSetting" },
302
+ { "$ref": "#/$defs/BooleanSetting" },
303
+ { "$ref": "#/$defs/SelectSetting" },
304
+ { "$ref": "#/$defs/MultiSelectSetting" }
305
+ ]
306
+ }
307
+ },
308
+ "required": ["name"],
309
+ "anyOf": [{ "required": ["post"] }, { "required": ["server"] }, { "required": ["blocks"] }],
310
+ "dependentRequired": { "triggers": ["server"] },
311
+ "properties": {
312
+ "name": {
313
+ "type": "string",
314
+ "description": "App account name and Community URL slug.",
315
+ "minLength": 3,
316
+ "maxLength": 20,
317
+ "pattern": "^[a-z][a-z0-9-]*$"
318
+ },
319
+ "media": {
320
+ "type": "object",
321
+ "description": "Static asset config. All assets are available to the app client and server via the asset plugin. No overlap with the media plugin or permission.",
322
+ "additionalProperties": false,
323
+ "properties": {
324
+ "dir": {
325
+ "$ref": "#/$defs/Path",
326
+ "description": "Public assets path relative project root. All files within are uploaded to Reddit.",
327
+ "default": "assets"
328
+ }
329
+ }
330
+ },
331
+ "permissions": {
332
+ "type": "object",
333
+ "description": "What an app is allowed to do.",
334
+ "additionalProperties": false,
335
+ "properties": {
336
+ "http": {
337
+ "type": "object",
338
+ "description": "HTTP plugin config (`fetch()`).",
339
+ "additionalProperties": false,
340
+ "properties": {
341
+ "enable": {
342
+ "type": "boolean",
343
+ "description": "Enables the HTTP plugin.",
344
+ "default": true
345
+ },
346
+ "domains": {
347
+ "type": "array",
348
+ "description": "Domains the app may communicate with. `/api/` is implied and `\"reddit.com\"` or subdomains should not be included.",
349
+ "items": {
350
+ "type": "string",
351
+ "description": "Allowed domain.",
352
+ "examples": ["example.com", "wikipedia.org", "query.wikidata.org"]
353
+ },
354
+ "uniqueItems": true,
355
+ "default": []
356
+ }
357
+ }
358
+ },
359
+ "media": {
360
+ "type": "boolean",
361
+ "description": "Enables the media plugin (uploads).",
362
+ "default": false
363
+ },
364
+ "payments": {
365
+ "type": "boolean",
366
+ "description": "Enables the payments plugin.",
367
+ "default": false
368
+ },
369
+ "realtime": {
370
+ "type": "boolean",
371
+ "description": "Enables the realtime plugin (client and server messaging).",
372
+ "default": false
373
+ },
374
+ "redis": {
375
+ "type": "boolean",
376
+ "description": "Enables the Redis plugin (storage).",
377
+ "default": false
378
+ },
379
+ "reddit": {
380
+ "type": "object",
381
+ "description": "Reddit API plugin config.",
382
+ "additionalProperties": false,
383
+ "properties": {
384
+ "enable": {
385
+ "type": "boolean",
386
+ "description": "Enables the Reddit API plugin.",
387
+ "default": true
388
+ },
389
+ "scope": {
390
+ "description": "APIs available. `\"moderator\"` includes all of `\"user\"`.",
391
+ "enum": ["user", "moderator"],
392
+ "default": "user"
393
+ },
394
+ "asUser": {
395
+ "type": "array",
396
+ "description": "APIs to execute from the user account instead of the app account (`name`). These are not currently in use, please set scope to `\"user\"` instead to submit posts or comments as the user.",
397
+ "items": {
398
+ "enum": ["SUBMIT_POST", "SUBMIT_COMMENT", "SUBSCRIBE_TO_SUBREDDIT"]
399
+ },
400
+ "uniqueItems": true,
401
+ "default": []
402
+ }
403
+ }
404
+ }
405
+ }
406
+ },
407
+ "post": {
408
+ "type": "object",
409
+ "description": "Custom post config. Web views can only fetch from `/api/` endpoints when `server` is enabled.",
410
+ "additionalProperties": false,
411
+ "properties": {
412
+ "dir": {
413
+ "$ref": "#/$defs/Path",
414
+ "description": "Client directory relative to project root for all public web view assets. All files within are uploaded to Reddit.",
415
+ "default": "public"
416
+ },
417
+ "entrypoints": {
418
+ "type": "object",
419
+ "description": "Map of named entrypoints for post rendering.",
420
+ "additionalProperties": false,
421
+ "required": ["default"],
422
+ "properties": {
423
+ "default": {
424
+ "$ref": "#/$defs/Entrypoint",
425
+ "properties": { "entry": { "default": "index.html" } }
426
+ }
427
+ },
428
+ "patternProperties": {
429
+ "^[a-zA-Z0-9_-]+$": {
430
+ "$ref": "#/$defs/Entrypoint",
431
+ "required": ["entry"]
432
+ }
433
+ }
434
+ }
435
+ }
436
+ },
437
+ "server": {
438
+ "type": "object",
439
+ "description": "Node.js server config. Enables server usage and `/api/` calls from the web view.",
440
+ "additionalProperties": false,
441
+ "properties": {
442
+ "dir": {
443
+ "$ref": "#/$defs/Path",
444
+ "description": "Server bundle directory relative to project root. This directory is private and server-side only.",
445
+ "default": "dist/server"
446
+ },
447
+ "entry": {
448
+ "$ref": "#/$defs/Path",
449
+ "description": "Server bundle filename within `server.dir`. Must be a self-contained JavaScript file except for standard Node.js API imports in CommonJS format. This code is private and server-side only.",
450
+ "default": "index.js"
451
+ }
452
+ }
453
+ },
454
+ "triggers": {
455
+ "type": "object",
456
+ "description": "Event triggers config.",
457
+ "additionalProperties": false,
458
+ "properties": {
459
+ "onAppInstall": { "$ref": "#/$defs/InternalEndpoint" },
460
+ "onAppUpgrade": { "$ref": "#/$defs/InternalEndpoint" },
461
+ "onAutomoderatorFilterComment": { "$ref": "#/$defs/InternalEndpoint" },
462
+ "onAutomoderatorFilterPost": { "$ref": "#/$defs/InternalEndpoint" },
463
+ "onCommentCreate": { "$ref": "#/$defs/InternalEndpoint" },
464
+ "onCommentDelete": { "$ref": "#/$defs/InternalEndpoint" },
465
+ "onCommentReport": { "$ref": "#/$defs/InternalEndpoint" },
466
+ "onCommentSubmit": { "$ref": "#/$defs/InternalEndpoint" },
467
+ "onCommentUpdate": { "$ref": "#/$defs/InternalEndpoint" },
468
+ "onModAction": { "$ref": "#/$defs/InternalEndpoint" },
469
+ "onModMail": { "$ref": "#/$defs/InternalEndpoint" },
470
+ "onPostCreate": { "$ref": "#/$defs/InternalEndpoint" },
471
+ "onPostDelete": { "$ref": "#/$defs/InternalEndpoint" },
472
+ "onPostFlairUpdate": { "$ref": "#/$defs/InternalEndpoint" },
473
+ "onPostNsfwUpdate": { "$ref": "#/$defs/InternalEndpoint" },
474
+ "onPostReport": { "$ref": "#/$defs/InternalEndpoint" },
475
+ "onPostSpoilerUpdate": { "$ref": "#/$defs/InternalEndpoint" },
476
+ "onPostSubmit": { "$ref": "#/$defs/InternalEndpoint" },
477
+ "onPostUpdate": { "$ref": "#/$defs/InternalEndpoint" }
478
+ }
479
+ },
480
+ "blocks": {
481
+ "type": "object",
482
+ "description": "Blocks migration config.",
483
+ "deprecated": true,
484
+ "additionalProperties": false,
485
+ "properties": {
486
+ "entry": {
487
+ "$ref": "#/$defs/Path",
488
+ "description": "TypeScript or JavaScript Blocks client entrypoint relative project root. Use for migration.",
489
+ "default": "src/main.tsx"
490
+ },
491
+ "menu": {
492
+ "type": "object",
493
+ "description": "Blocks menu config.",
494
+ "additionalProperties": false,
495
+ "properties": {
496
+ "enable": {
497
+ "type": "boolean",
498
+ "description": "Whether menu items are added through Blocks.",
499
+ "default": true
500
+ }
501
+ }
502
+ },
503
+ "settings": {
504
+ "type": "object",
505
+ "description": "Settings plugin config.",
506
+ "additionalProperties": false,
507
+ "properties": {
508
+ "enable": {
509
+ "type": "boolean",
510
+ "description": "Whether settings are added through Blocks.",
511
+ "default": true
512
+ }
513
+ }
514
+ }
515
+ }
516
+ },
517
+ "menu": {
518
+ "type": "object",
519
+ "description": "Menu configuration for the app.",
520
+ "additionalProperties": false,
521
+ "required": ["items"],
522
+ "properties": {
523
+ "items": {
524
+ "type": "array",
525
+ "description": "Menu items shown in a subreddit when this app is installed there.",
526
+ "items": {
527
+ "type": "object",
528
+ "required": ["label", "location", "endpoint"],
529
+ "additionalProperties": false,
530
+ "properties": {
531
+ "label": {
532
+ "type": "string",
533
+ "description": "Menu item text displayed to users."
534
+ },
535
+ "description": {
536
+ "type": "string",
537
+ "description": "Short, user-facing sub-label to describe what this action is going to do."
538
+ },
539
+ "forUserType": {
540
+ "type": "string",
541
+ "enum": ["moderator", "user"],
542
+ "description": "Types of users who can see and invoke this menu item.",
543
+ "default": "moderator"
544
+ },
545
+ "location": {
546
+ "oneOf": [
547
+ { "enum": ["comment", "post", "subreddit"] },
548
+ {
549
+ "type": "array",
550
+ "items": { "enum": ["comment", "post", "subreddit"] },
551
+ "minItems": 1,
552
+ "uniqueItems": true
553
+ }
554
+ ],
555
+ "description": "Locations where this menu item is available within the installed subreddit."
556
+ },
557
+ "endpoint": { "$ref": "#/$defs/InternalEndpoint" },
558
+ "postFilter": {
559
+ "enum": ["none", "currentApp"],
560
+ "description": "If 'currentApp', only show this menu item on posts made by this app.",
561
+ "default": "none"
562
+ }
563
+ }
564
+ }
565
+ }
566
+ }
567
+ },
568
+
569
+ "forms": {
570
+ "type": "object",
571
+ "description": "Key-value pairs mapping form identifiers to their submit URLs.",
572
+ "additionalProperties": false,
573
+ "patternProperties": {
574
+ "^[a-zA-Z_][a-zA-Z0-9_-]*$": { "$ref": "#/$defs/InternalEndpoint" }
575
+ }
576
+ },
577
+
578
+ "dev": {
579
+ "type": "object",
580
+ "description": "Development config.",
581
+ "additionalProperties": false,
582
+ "properties": {
583
+ "subreddit": {
584
+ "type": "string",
585
+ "description": "Default subreddit name without r/ prefix to use for development. Can be overridden by the `DEVVIT_SUBREDDIT` environment variable.",
586
+ "minLength": 3,
587
+ "maxLength": 21,
588
+ "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$"
589
+ }
590
+ }
591
+ },
592
+
593
+ "scheduler": {
594
+ "type": "object",
595
+ "description": "Scheduler config.",
596
+ "additionalProperties": false,
597
+ "required": ["tasks"],
598
+ "properties": {
599
+ "tasks": {
600
+ "type": "object",
601
+ "description": "List of all scheduled tasks the app might use, and what endpoints they map to.",
602
+ "additionalProperties": false,
603
+ "patternProperties": {
604
+ "^.+$": {
605
+ "description": "The key is the task name - it can be anything you'd like. If your code uses the scheduler plugin, you'll pass this name in to schedule your tasks.",
606
+ "oneOf": [
607
+ {
608
+ "description": "An object specifying the task config, with an endpoint to call and optionally a cron schedule.",
609
+ "type": "object",
610
+ "required": ["endpoint"],
611
+ "additionalProperties": false,
612
+ "properties": {
613
+ "endpoint": { "$ref": "#/$defs/InternalEndpoint" }
614
+ }
615
+ },
616
+ {
617
+ "description": "An object specifying the task config, with an endpoint to call and optionally a cron schedule.",
618
+ "type": "object",
619
+ "required": ["endpoint", "cron"],
620
+ "additionalProperties": false,
621
+ "properties": {
622
+ "endpoint": { "$ref": "#/$defs/InternalEndpoint" },
623
+ "cron": { "$ref": "#/$defs/CronSchedule" },
624
+ "data": {
625
+ "type": "object",
626
+ "description": "Optional data to pass to a cron-based task when it runs.",
627
+ "additionalProperties": true
628
+ }
629
+ }
630
+ },
631
+ {
632
+ "$ref": "#/$defs/InternalEndpoint"
633
+ }
634
+ ]
635
+ }
636
+ }
637
+ }
638
+ }
639
+ },
640
+
641
+ "settings": {
642
+ "type": "object",
643
+ "description": "Settings config.",
644
+ "additionalProperties": false,
645
+ "anyOf": [{ "required": ["global"] }, { "required": ["subreddit"] }],
646
+ "properties": {
647
+ "global": {
648
+ "type": "object",
649
+ "description": "Settings that apply globally, across all use of this app.",
650
+ "additionalProperties": false,
651
+ "patternProperties": {
652
+ "^[a-zA-Z_][a-zA-Z0-9_-]*$": {
653
+ "$ref": "#/$defs/GlobalSetting"
654
+ }
655
+ }
656
+ },
657
+ "subreddit": {
658
+ "type": "object",
659
+ "description": "Settings that can be configured by the installer per subreddit.",
660
+ "additionalProperties": false,
661
+ "patternProperties": {
662
+ "^[a-zA-Z_][a-zA-Z0-9_-]*$": {
663
+ "$ref": "#/$defs/SubredditSetting"
664
+ }
665
+ }
666
+ }
667
+ }
668
+ },
669
+
670
+ "marketingAssets": {
671
+ "type": "object",
672
+ "description": "Marketing assets config.",
673
+ "additionalProperties": false,
674
+ "required": ["icon"],
675
+ "properties": {
676
+ "icon": {
677
+ "type": "string",
678
+ "description": "Path to the icon file relative to the project root. This should be a square PNG image, 1024x1024 pixels."
679
+ }
680
+ }
681
+ }
682
+ }
683
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-file.v1.test.d.ts","sourceRoot":"","sources":["../../src/schemas/config-file.v1.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export declare const UNINITIALIZED_APP_NAME = "<% name %>";
2
+ /** The default and fallback entrypoint every web view app must provide. */
3
+ export declare const defaultPostEntry: "default";
4
+ //# sourceMappingURL=constants.d.ts.map