@devvit/shared-types 0.11.20-next-2025-08-07-22-47-18-edda21056.0 → 0.11.20-next-2025-08-08-16-39-07-0861787df.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/shared-types",
|
|
3
|
-
"version": "0.11.20-next-2025-08-
|
|
3
|
+
"version": "0.11.20-next-2025-08-08-16-39-07-0861787df.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"types": "./dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@devvit/protos": "0.11.20-next-2025-08-
|
|
36
|
+
"@devvit/protos": "0.11.20-next-2025-08-08-16-39-07-0861787df.0",
|
|
37
37
|
"jsonschema": "1.4.1",
|
|
38
38
|
"uuid": "9.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@devvit/repo-tools": "0.11.20-next-2025-08-
|
|
42
|
-
"@devvit/tsconfig": "0.11.20-next-2025-08-
|
|
41
|
+
"@devvit/repo-tools": "0.11.20-next-2025-08-08-16-39-07-0861787df.0",
|
|
42
|
+
"@devvit/tsconfig": "0.11.20-next-2025-08-08-16-39-07-0861787df.0",
|
|
43
43
|
"@types/redis-mock": "0.17.1",
|
|
44
44
|
"@types/uuid": "9.0.0",
|
|
45
45
|
"chokidar-cli": "3.0.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"vitest": "1.6.1"
|
|
52
52
|
},
|
|
53
53
|
"source": "./src/index.ts",
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "e89245b07b63e23988c43c7e00455b1f29d102dd"
|
|
55
55
|
}
|
|
@@ -18,6 +18,7 @@ export type AppConfig = {
|
|
|
18
18
|
dev?: AppDevConfig;
|
|
19
19
|
menu?: AppMenuConfig;
|
|
20
20
|
scheduler?: AppSchedulerConfig;
|
|
21
|
+
settings?: AppSettingsConfig;
|
|
21
22
|
forms?: AppFormsConfig;
|
|
22
23
|
marketingAssets?: AppMarketingAssetsConfig;
|
|
23
24
|
/** The original config as parsed. Used for writebacks. */
|
|
@@ -122,6 +123,56 @@ export type AppSchedulerTaskConfig = {
|
|
|
122
123
|
cron?: string;
|
|
123
124
|
data?: JsonObject;
|
|
124
125
|
};
|
|
126
|
+
export type AppSettingsConfig = {
|
|
127
|
+
global?: {
|
|
128
|
+
[name: string]: AppSettingConfig;
|
|
129
|
+
};
|
|
130
|
+
subreddit?: {
|
|
131
|
+
[name: string]: AppSettingConfig;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export type AppSettingConfig = AppStringSettingConfig | AppParagraphSettingConfig | AppNumberSettingConfig | AppBooleanSettingConfig | AppSelectSettingConfig | AppMultiSelectSettingConfig;
|
|
135
|
+
export type AppBaseSettingConfig = {
|
|
136
|
+
name: string;
|
|
137
|
+
label: string;
|
|
138
|
+
helpText?: string;
|
|
139
|
+
validationEndpoint?: string;
|
|
140
|
+
};
|
|
141
|
+
export type AppStringSettingConfig = AppBaseSettingConfig & {
|
|
142
|
+
type: 'string';
|
|
143
|
+
placeholder?: string;
|
|
144
|
+
defaultValue?: string;
|
|
145
|
+
isSecret?: boolean;
|
|
146
|
+
};
|
|
147
|
+
export type AppParagraphSettingConfig = AppBaseSettingConfig & {
|
|
148
|
+
type: 'paragraph';
|
|
149
|
+
placeholder?: string;
|
|
150
|
+
defaultValue?: string;
|
|
151
|
+
};
|
|
152
|
+
export type AppNumberSettingConfig = AppBaseSettingConfig & {
|
|
153
|
+
type: 'number';
|
|
154
|
+
defaultValue?: number;
|
|
155
|
+
};
|
|
156
|
+
export type AppBooleanSettingConfig = AppBaseSettingConfig & {
|
|
157
|
+
type: 'boolean';
|
|
158
|
+
defaultValue?: boolean;
|
|
159
|
+
};
|
|
160
|
+
export type AppSelectSettingConfig = AppBaseSettingConfig & {
|
|
161
|
+
type: 'select';
|
|
162
|
+
options: Array<{
|
|
163
|
+
label: string;
|
|
164
|
+
value: string;
|
|
165
|
+
}>;
|
|
166
|
+
defaultValue?: string;
|
|
167
|
+
};
|
|
168
|
+
export type AppMultiSelectSettingConfig = AppBaseSettingConfig & {
|
|
169
|
+
type: 'multiSelect';
|
|
170
|
+
options: Array<{
|
|
171
|
+
label: string;
|
|
172
|
+
value: string;
|
|
173
|
+
}>;
|
|
174
|
+
defaultValue?: string[];
|
|
175
|
+
};
|
|
125
176
|
/**
|
|
126
177
|
* https://transform.tools/json-schema-to-typescript
|
|
127
178
|
* @internal
|
|
@@ -186,6 +237,14 @@ export type AppConfigJson = {
|
|
|
186
237
|
subreddit?: string;
|
|
187
238
|
};
|
|
188
239
|
scheduler?: AppSchedulerConfigJson;
|
|
240
|
+
settings?: {
|
|
241
|
+
global?: {
|
|
242
|
+
[name: string]: AppSettingConfigJson;
|
|
243
|
+
};
|
|
244
|
+
subreddit?: {
|
|
245
|
+
[name: string]: AppSettingConfigJson;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
189
248
|
marketingAssets?: {
|
|
190
249
|
icon?: string;
|
|
191
250
|
};
|
|
@@ -201,6 +260,7 @@ export type AppSchedulerConfigJson = {
|
|
|
201
260
|
[name: string]: AppSchedulerTaskConfig | string;
|
|
202
261
|
};
|
|
203
262
|
};
|
|
263
|
+
export type AppSettingConfigJson = Omit<AppStringSettingConfig, 'name'> | Omit<AppParagraphSettingConfig, 'name'> | Omit<AppNumberSettingConfig, 'name'> | Omit<AppBooleanSettingConfig, 'name'> | Omit<AppSelectSettingConfig, 'name'> | Omit<AppMultiSelectSettingConfig, 'name'>;
|
|
204
264
|
export declare function parseAppConfig(str: string, allowUninitializedConfig: boolean): AppConfig;
|
|
205
265
|
export declare function parseAppConfigJson(json: JsonValue, allowUninitializedConfig: boolean): AppConfig;
|
|
206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AACF,MAAM,MAAM,oBAAoB,GAC5B,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,GACpC,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,GACvC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,GACpC,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,GACrC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,GACpC,IAAI,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;AAE9C,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,wBAAwB,EAAE,OAAO,GAAG,SAAS,CAWxF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,wBAAwB,EAAE,OAAO,GAAG,SAAS,CA8BhG;AAyMD,gBAAgB;AAChB,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAiC1D"}
|
|
@@ -72,6 +72,8 @@ function AppConfig(json) {
|
|
|
72
72
|
partial.menu = AppMenuConfig(json);
|
|
73
73
|
if (json.scheduler)
|
|
74
74
|
partial.scheduler = AppSchedulerConfig(json);
|
|
75
|
+
if (json.settings)
|
|
76
|
+
partial.settings = AppSettingsConfig(json);
|
|
75
77
|
if (json.forms)
|
|
76
78
|
partial.forms = json.forms;
|
|
77
79
|
if (json.marketingAssets)
|
|
@@ -195,11 +197,50 @@ function AppMenuConfig(json) {
|
|
|
195
197
|
}
|
|
196
198
|
return { items };
|
|
197
199
|
}
|
|
200
|
+
function AppSettingsConfig(json) {
|
|
201
|
+
const appSettingsConfig = {};
|
|
202
|
+
if (json.settings?.global) {
|
|
203
|
+
appSettingsConfig.global = {};
|
|
204
|
+
for (const [name, setting] of Object.entries(json.settings.global)) {
|
|
205
|
+
appSettingsConfig.global[name] = {
|
|
206
|
+
...setting,
|
|
207
|
+
name: name,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (json.settings?.subreddit) {
|
|
212
|
+
appSettingsConfig.subreddit = {};
|
|
213
|
+
for (const [name, setting] of Object.entries(json.settings.subreddit)) {
|
|
214
|
+
appSettingsConfig.subreddit[name] = {
|
|
215
|
+
...setting,
|
|
216
|
+
name: name,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return appSettingsConfig;
|
|
221
|
+
}
|
|
198
222
|
/** @internal */
|
|
199
223
|
export function validate(config) {
|
|
200
224
|
const errs = [];
|
|
201
225
|
if (config.menu?.items?.length && !config.permissions.redis)
|
|
202
226
|
errs.push('`config.menu.items` requires `config.permissions.redis` to be enabled');
|
|
227
|
+
// If there are any select settings, their default values must be in the options,
|
|
228
|
+
// and if it's not a multi-select, the default value must be a single string.
|
|
229
|
+
const settingValues = [
|
|
230
|
+
...Object.values(config.settings?.global ?? {}),
|
|
231
|
+
...Object.values(config.settings?.subreddit ?? {}),
|
|
232
|
+
];
|
|
233
|
+
for (const setting of settingValues) {
|
|
234
|
+
if (setting.type === 'select' && setting.defaultValue) {
|
|
235
|
+
if (!setting.options.some((option) => option.value === setting.defaultValue))
|
|
236
|
+
errs.push(`Setting "${setting.name}" default value "${setting.defaultValue}" is not in
|
|
237
|
+
options "${setting.options.map((option) => option.value).join(', ')}"`);
|
|
238
|
+
}
|
|
239
|
+
if (setting.type === 'multiSelect' && setting.defaultValue) {
|
|
240
|
+
if (!setting.defaultValue.every((value) => setting.options.some((option) => option.value === value)))
|
|
241
|
+
errs.push(`Setting "${setting.name}" default values "${setting.defaultValue.join(', ')}" are not in options "${setting.options.map((option) => option.value).join(', ')}"`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
203
244
|
if (errs.length)
|
|
204
245
|
throw Error(`${errs.join('; ')}.`);
|
|
205
246
|
}
|
|
@@ -40,6 +40,269 @@
|
|
|
40
40
|
"Path": {
|
|
41
41
|
"type": "string",
|
|
42
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
|
+
]
|
|
43
306
|
}
|
|
44
307
|
},
|
|
45
308
|
"required": ["name"],
|
|
@@ -375,6 +638,35 @@
|
|
|
375
638
|
}
|
|
376
639
|
},
|
|
377
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
|
+
|
|
378
670
|
"marketingAssets": {
|
|
379
671
|
"type": "object",
|
|
380
672
|
"description": "Marketing assets config.",
|