@devvit/public-api 0.11.14-next-2025-04-28-2d05f2817.0 → 0.11.14-next-2025-04-28-635d9edc2.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/devvit/Devvit.d.ts +28 -7
- package/devvit/Devvit.d.ts.map +1 -1
- package/devvit/Devvit.js +38 -11
- package/meta.json +3 -3
- package/meta.min.json +4 -4
- package/package.json +7 -7
- package/public-api.d.ts +28 -7
- package/public-api.iife.js +36 -12
- package/public-api.min.js +5 -5
- package/public-api.min.js.map +3 -3
package/devvit/Devvit.d.ts
CHANGED
|
@@ -129,19 +129,29 @@ export declare class Devvit extends Actor {
|
|
|
129
129
|
*/
|
|
130
130
|
static addSchedulerJob<T extends JSONObject | undefined>(job: ScheduledJobType<T>): void;
|
|
131
131
|
/**
|
|
132
|
-
* Add settings that can be configured to customize the behavior of your app.
|
|
133
|
-
*
|
|
132
|
+
* Add settings that can be configured to customize the behavior of your app.
|
|
133
|
+
*
|
|
134
|
+
* There are two levels of settings:
|
|
135
|
+
* - App settings (scope: 'app')
|
|
136
|
+
* - Installation settings (scope: 'installation' or unspecified scope).
|
|
137
|
+
*
|
|
138
|
+
* Installation settings are meant to be configured by the user that installs your app.
|
|
134
139
|
* This is a good place to add anything that a user might want to change to personalize the app (e.g. the default city to show the weather for or a
|
|
135
140
|
* specific sport team that a subreddit follows). Note that these are good for subreddit level customization but not necessarily good for things
|
|
136
141
|
* that might be different for two users in a subreddit (e.g. setting the default city to show the weather for is only useful at a sub level if
|
|
137
|
-
* the sub is for a specific city or region).
|
|
142
|
+
* the sub is for a specific city or region).
|
|
143
|
+
* Installation settings can be viewed and configured here: https://developers.reddit.com/r/subreddit-name/apps/app-name.
|
|
144
|
+
*
|
|
138
145
|
* App settings can be accessed and consumed by all installations of the app. This is mainly useful for developer secrets/API keys that your
|
|
139
146
|
* app needs to function. They can only be changed/viewed by you via the CLI (devvit settings set and devvit settings list). This ensures secrets
|
|
140
|
-
* are persisted in an encrypted store and don't get committed in the source code.
|
|
141
|
-
*
|
|
147
|
+
* are persisted in an encrypted store and don't get committed in the source code.
|
|
148
|
+
*
|
|
149
|
+
* Warning: You should never paste your actual key into any fields passed into Devvit.addSettings - this is merely where you state what your API key's name and description are. You will be able to set the actual value of the key via CLI.
|
|
150
|
+
*
|
|
142
151
|
* Note: setting names must be unique across all settings.
|
|
152
|
+
*
|
|
143
153
|
* @param fields - Fields for the app and installation settings.
|
|
144
|
-
* @example
|
|
154
|
+
* @example Add multiple fields
|
|
145
155
|
* ```ts
|
|
146
156
|
* Devvit.addSettings([
|
|
147
157
|
* {
|
|
@@ -175,8 +185,19 @@ export declare class Devvit extends Actor {
|
|
|
175
185
|
* },
|
|
176
186
|
* ]);
|
|
177
187
|
* ```
|
|
188
|
+
*
|
|
189
|
+
* @example Add a single field
|
|
190
|
+
* ```ts
|
|
191
|
+
* Devvit.addSettings({
|
|
192
|
+
* type: 'string',
|
|
193
|
+
* name: 'weather-api-key',
|
|
194
|
+
* label: 'My weather.com API key',
|
|
195
|
+
* scope: SettingScope.App,
|
|
196
|
+
* isSecret: true
|
|
197
|
+
* });
|
|
198
|
+
* ```
|
|
178
199
|
*/
|
|
179
|
-
static addSettings(fields: SettingsFormField[]): void;
|
|
200
|
+
static addSettings(fields: SettingsFormField[] | SettingsFormField): void;
|
|
180
201
|
/**
|
|
181
202
|
* Add a trigger handler that will be invoked when the given event
|
|
182
203
|
* occurs in a subreddit where the app is installed.
|
package/devvit/Devvit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Devvit.d.ts","sourceRoot":"","sources":["../../src/devvit/Devvit.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAItD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,C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AC;AAKF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAkB,SAAQ,MAAM,CAAC,MAAM,CAAC,iBAAiB;SAAG;QAEtE,KAAK,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtC,KAAK,WAAW,GAAG,YAAY,GAAG,GAAG,CAAC,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;QAClF,KAAK,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QAClD,KAAK,wBAAwB,GAAG;YAAE,QAAQ,EAAE,EAAE,CAAA;SAAE,CAAC;QACjD,KAAK,QAAQ,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;QAC5C,KAAK,KAAK,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG;YAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,eAAe,CAAA;SAAE,CAAC;QAE1E,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;KACrF;CACF"}
|
package/devvit/Devvit.js
CHANGED
|
@@ -186,19 +186,29 @@ export class Devvit extends Actor {
|
|
|
186
186
|
__classPrivateFieldGet(this, _a, "f", _Devvit_scheduledJobHandlers).set(job.name, job.onRun);
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
|
-
* Add settings that can be configured to customize the behavior of your app.
|
|
190
|
-
*
|
|
189
|
+
* Add settings that can be configured to customize the behavior of your app.
|
|
190
|
+
*
|
|
191
|
+
* There are two levels of settings:
|
|
192
|
+
* - App settings (scope: 'app')
|
|
193
|
+
* - Installation settings (scope: 'installation' or unspecified scope).
|
|
194
|
+
*
|
|
195
|
+
* Installation settings are meant to be configured by the user that installs your app.
|
|
191
196
|
* This is a good place to add anything that a user might want to change to personalize the app (e.g. the default city to show the weather for or a
|
|
192
197
|
* specific sport team that a subreddit follows). Note that these are good for subreddit level customization but not necessarily good for things
|
|
193
198
|
* that might be different for two users in a subreddit (e.g. setting the default city to show the weather for is only useful at a sub level if
|
|
194
|
-
* the sub is for a specific city or region).
|
|
199
|
+
* the sub is for a specific city or region).
|
|
200
|
+
* Installation settings can be viewed and configured here: https://developers.reddit.com/r/subreddit-name/apps/app-name.
|
|
201
|
+
*
|
|
195
202
|
* App settings can be accessed and consumed by all installations of the app. This is mainly useful for developer secrets/API keys that your
|
|
196
203
|
* app needs to function. They can only be changed/viewed by you via the CLI (devvit settings set and devvit settings list). This ensures secrets
|
|
197
|
-
* are persisted in an encrypted store and don't get committed in the source code.
|
|
198
|
-
*
|
|
204
|
+
* are persisted in an encrypted store and don't get committed in the source code.
|
|
205
|
+
*
|
|
206
|
+
* Warning: You should never paste your actual key into any fields passed into Devvit.addSettings - this is merely where you state what your API key's name and description are. You will be able to set the actual value of the key via CLI.
|
|
207
|
+
*
|
|
199
208
|
* Note: setting names must be unique across all settings.
|
|
209
|
+
*
|
|
200
210
|
* @param fields - Fields for the app and installation settings.
|
|
201
|
-
* @example
|
|
211
|
+
* @example Add multiple fields
|
|
202
212
|
* ```ts
|
|
203
213
|
* Devvit.addSettings([
|
|
204
214
|
* {
|
|
@@ -232,17 +242,34 @@ export class Devvit extends Actor {
|
|
|
232
242
|
* },
|
|
233
243
|
* ]);
|
|
234
244
|
* ```
|
|
245
|
+
*
|
|
246
|
+
* @example Add a single field
|
|
247
|
+
* ```ts
|
|
248
|
+
* Devvit.addSettings({
|
|
249
|
+
* type: 'string',
|
|
250
|
+
* name: 'weather-api-key',
|
|
251
|
+
* label: 'My weather.com API key',
|
|
252
|
+
* scope: SettingScope.App,
|
|
253
|
+
* isSecret: true
|
|
254
|
+
* });
|
|
255
|
+
* ```
|
|
235
256
|
*/
|
|
236
257
|
static addSettings(fields) {
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
const
|
|
258
|
+
// if the fields is a single field, convert it to an array
|
|
259
|
+
const fieldsArray = Array.isArray(fields) ? fields : [fields];
|
|
260
|
+
const installSettings = fieldsArray.filter((field) => field.type === 'group' || !field.scope || field.scope === SettingScope.Installation);
|
|
261
|
+
const appSettings = fieldsArray.filter((field) => field.type !== 'group' && field.scope === SettingScope.App);
|
|
240
262
|
if (installSettings.length > 0) {
|
|
241
|
-
|
|
263
|
+
// initialize the installation settings with empty array if it is not initialized
|
|
264
|
+
__classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _Devvit_installationSettings) ?? [], "f", _Devvit_installationSettings);
|
|
265
|
+
__classPrivateFieldGet(this, _a, "f", _Devvit_installationSettings).push(...installSettings);
|
|
242
266
|
}
|
|
243
267
|
if (appSettings.length > 0) {
|
|
244
|
-
|
|
268
|
+
// initialize the app settings with empty array if it is not initialized
|
|
269
|
+
__classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _Devvit_appSettings) ?? [], "f", _Devvit_appSettings);
|
|
270
|
+
__classPrivateFieldGet(this, _a, "f", _Devvit_appSettings).push(...appSettings);
|
|
245
271
|
}
|
|
272
|
+
assertValidFormFields([...(__classPrivateFieldGet(this, _a, "f", _Devvit_installationSettings) ?? []), ...(__classPrivateFieldGet(this, _a, "f", _Devvit_appSettings) ?? [])]);
|
|
246
273
|
if (!__classPrivateFieldGet(this, _a, "f", _Devvit_pluginClients)[protos.SettingsDefinition.fullName]) {
|
|
247
274
|
this.use(protos.SettingsDefinition);
|
|
248
275
|
}
|
package/meta.json
CHANGED
|
@@ -8798,7 +8798,7 @@
|
|
|
8798
8798
|
"format": "esm"
|
|
8799
8799
|
},
|
|
8800
8800
|
"src/devvit/Devvit.ts": {
|
|
8801
|
-
"bytes":
|
|
8801
|
+
"bytes": 35096,
|
|
8802
8802
|
"imports": [
|
|
8803
8803
|
{
|
|
8804
8804
|
"path": "../protos/dist/index.js",
|
|
@@ -10308,7 +10308,7 @@
|
|
|
10308
10308
|
"bytesInOutput": 1424
|
|
10309
10309
|
},
|
|
10310
10310
|
"src/devvit/Devvit.ts": {
|
|
10311
|
-
"bytesInOutput":
|
|
10311
|
+
"bytesInOutput": 19701
|
|
10312
10312
|
},
|
|
10313
10313
|
"src/apis/reddit/helpers/makeGettersEnumerable.ts": {
|
|
10314
10314
|
"bytesInOutput": 344
|
|
@@ -10392,7 +10392,7 @@
|
|
|
10392
10392
|
"bytesInOutput": 4013
|
|
10393
10393
|
}
|
|
10394
10394
|
},
|
|
10395
|
-
"bytes":
|
|
10395
|
+
"bytes": 12538035
|
|
10396
10396
|
}
|
|
10397
10397
|
}
|
|
10398
10398
|
}
|
package/meta.min.json
CHANGED
|
@@ -1607,7 +1607,7 @@
|
|
|
1607
1607
|
"format": "esm"
|
|
1608
1608
|
},
|
|
1609
1609
|
"src/devvit/Devvit.ts": {
|
|
1610
|
-
"bytes":
|
|
1610
|
+
"bytes": 35096,
|
|
1611
1611
|
"imports": [
|
|
1612
1612
|
{
|
|
1613
1613
|
"path": "@devvit/protos",
|
|
@@ -2536,7 +2536,7 @@
|
|
|
2536
2536
|
"imports": [],
|
|
2537
2537
|
"exports": [],
|
|
2538
2538
|
"inputs": {},
|
|
2539
|
-
"bytes":
|
|
2539
|
+
"bytes": 1072531
|
|
2540
2540
|
},
|
|
2541
2541
|
"dist/public-api.min.js": {
|
|
2542
2542
|
"imports": [
|
|
@@ -2811,7 +2811,7 @@
|
|
|
2811
2811
|
"bytesInOutput": 1363
|
|
2812
2812
|
},
|
|
2813
2813
|
"src/devvit/Devvit.ts": {
|
|
2814
|
-
"bytesInOutput":
|
|
2814
|
+
"bytesInOutput": 5928
|
|
2815
2815
|
},
|
|
2816
2816
|
"../shared-types/dist/Actor.js": {
|
|
2817
2817
|
"bytesInOutput": 31
|
|
@@ -3093,7 +3093,7 @@
|
|
|
3093
3093
|
"bytesInOutput": 107
|
|
3094
3094
|
}
|
|
3095
3095
|
},
|
|
3096
|
-
"bytes":
|
|
3096
|
+
"bytes": 221071
|
|
3097
3097
|
}
|
|
3098
3098
|
}
|
|
3099
3099
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/public-api",
|
|
3
|
-
"version": "0.11.14-next-2025-04-28-
|
|
3
|
+
"version": "0.11.14-next-2025-04-28-635d9edc2.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
},
|
|
31
31
|
"types": "./index.d.ts",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@devvit/metrics": "0.11.14-next-2025-04-28-
|
|
34
|
-
"@devvit/protos": "0.11.14-next-2025-04-28-
|
|
35
|
-
"@devvit/shared-types": "0.11.14-next-2025-04-28-
|
|
33
|
+
"@devvit/metrics": "0.11.14-next-2025-04-28-635d9edc2.0",
|
|
34
|
+
"@devvit/protos": "0.11.14-next-2025-04-28-635d9edc2.0",
|
|
35
|
+
"@devvit/shared-types": "0.11.14-next-2025-04-28-635d9edc2.0",
|
|
36
36
|
"base64-js": "1.5.1",
|
|
37
37
|
"clone-deep": "4.0.1",
|
|
38
38
|
"moderndash": "4.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@ampproject/filesize": "4.3.0",
|
|
42
|
-
"@devvit/repo-tools": "0.11.14-next-2025-04-28-
|
|
43
|
-
"@devvit/tsconfig": "0.11.14-next-2025-04-28-
|
|
42
|
+
"@devvit/repo-tools": "0.11.14-next-2025-04-28-635d9edc2.0",
|
|
43
|
+
"@devvit/tsconfig": "0.11.14-next-2025-04-28-635d9edc2.0",
|
|
44
44
|
"@microsoft/api-extractor": "7.41.0",
|
|
45
45
|
"@reddit/faceplate-ui": "18.0.1",
|
|
46
46
|
"@types/clone-deep": "4.0.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"source": "./src/index.ts",
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c8c669392fd230c2076f47e4cf29e080aa0fa91c"
|
|
65
65
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -7642,19 +7642,29 @@ export declare class Devvit extends Actor {
|
|
|
7642
7642
|
*/
|
|
7643
7643
|
static addSchedulerJob<T extends JSONObject | undefined>(job: ScheduledJobType<T>): void;
|
|
7644
7644
|
/**
|
|
7645
|
-
* Add settings that can be configured to customize the behavior of your app.
|
|
7646
|
-
*
|
|
7645
|
+
* Add settings that can be configured to customize the behavior of your app.
|
|
7646
|
+
*
|
|
7647
|
+
* There are two levels of settings:
|
|
7648
|
+
* - App settings (scope: 'app')
|
|
7649
|
+
* - Installation settings (scope: 'installation' or unspecified scope).
|
|
7650
|
+
*
|
|
7651
|
+
* Installation settings are meant to be configured by the user that installs your app.
|
|
7647
7652
|
* This is a good place to add anything that a user might want to change to personalize the app (e.g. the default city to show the weather for or a
|
|
7648
7653
|
* specific sport team that a subreddit follows). Note that these are good for subreddit level customization but not necessarily good for things
|
|
7649
7654
|
* that might be different for two users in a subreddit (e.g. setting the default city to show the weather for is only useful at a sub level if
|
|
7650
|
-
* the sub is for a specific city or region).
|
|
7655
|
+
* the sub is for a specific city or region).
|
|
7656
|
+
* Installation settings can be viewed and configured here: https://developers.reddit.com/r/subreddit-name/apps/app-name.
|
|
7657
|
+
*
|
|
7651
7658
|
* App settings can be accessed and consumed by all installations of the app. This is mainly useful for developer secrets/API keys that your
|
|
7652
7659
|
* app needs to function. They can only be changed/viewed by you via the CLI (devvit settings set and devvit settings list). This ensures secrets
|
|
7653
|
-
* are persisted in an encrypted store and don't get committed in the source code.
|
|
7654
|
-
*
|
|
7660
|
+
* are persisted in an encrypted store and don't get committed in the source code.
|
|
7661
|
+
*
|
|
7662
|
+
* Warning: You should never paste your actual key into any fields passed into Devvit.addSettings - this is merely where you state what your API key's name and description are. You will be able to set the actual value of the key via CLI.
|
|
7663
|
+
*
|
|
7655
7664
|
* Note: setting names must be unique across all settings.
|
|
7665
|
+
*
|
|
7656
7666
|
* @param fields - Fields for the app and installation settings.
|
|
7657
|
-
* @example
|
|
7667
|
+
* @example Add multiple fields
|
|
7658
7668
|
* ```ts
|
|
7659
7669
|
* Devvit.addSettings([
|
|
7660
7670
|
* {
|
|
@@ -7688,8 +7698,19 @@ export declare class Devvit extends Actor {
|
|
|
7688
7698
|
* },
|
|
7689
7699
|
* ]);
|
|
7690
7700
|
* ```
|
|
7701
|
+
*
|
|
7702
|
+
* @example Add a single field
|
|
7703
|
+
* ```ts
|
|
7704
|
+
* Devvit.addSettings({
|
|
7705
|
+
* type: 'string',
|
|
7706
|
+
* name: 'weather-api-key',
|
|
7707
|
+
* label: 'My weather.com API key',
|
|
7708
|
+
* scope: SettingScope.App,
|
|
7709
|
+
* isSecret: true
|
|
7710
|
+
* });
|
|
7711
|
+
* ```
|
|
7691
7712
|
*/
|
|
7692
|
-
static addSettings(fields: SettingsFormField[]): void;
|
|
7713
|
+
static addSettings(fields: SettingsFormField[] | SettingsFormField): void;
|
|
7693
7714
|
/**
|
|
7694
7715
|
* Add a trigger handler that will be invoked when the given event
|
|
7695
7716
|
* occurs in a subreddit where the app is installed.
|