@devvit/build-pack 0.11.19-next-2025-07-09-18-27-51-6ad27532e.0 → 0.11.19-next-2025-07-09-20-04-18-3938f00aa.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-spec-util.d.ts","sourceRoot":"","sources":["../../src/esbuild/dependency-spec-util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dependency-spec-util.d.ts","sourceRoot":"","sources":["../../src/esbuild/dependency-spec-util.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAC9B,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,EACzC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,GAC7B,cAAc,CA6FhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppSettingsDefinition, ContextActionDefinition, CustomPostDefinition, Definition, FlairDefinition, GraphQLDefinition, HTTPDefinition, InstallationSettingsDefinition, LinksAndCommentsDefinition, ListingsDefinition, MediaServiceDefinition, ModerationDefinition, ModlogDefinition, ModNoteDefinition, NewModmailDefinition, OnAppInstallDefinition, OnAppUpgradeDefinition, PrivateMessagesDefinition, RealtimeDefinition, RedisAPIDefinition, SchedulerHandlerDefinition, SettingsDefinition, SubredditsDefinition, UIEventHandlerDefinition, UserActionsDefinition, UsersDefinition, WidgetsDefinition, WikiDefinition, } from '@devvit/protos';
|
|
1
|
+
import { AppSettingsDefinition, ContextActionDefinition, CustomPostDefinition, Definition, FlairDefinition, GraphQLDefinition, HTTPDefinition, InstallationSettingsDefinition, LinksAndCommentsDefinition, ListingsDefinition, MediaServiceDefinition, ModerationDefinition, ModlogDefinition, ModNoteDefinition, NewModmailDefinition, OnAppInstallDefinition, OnAppUpgradeDefinition, OnAutomoderatorFilterCommentDefinition, OnAutomoderatorFilterPostDefinition, OnCommentCreateDefinition, OnCommentDeleteDefinition, OnCommentReportDefinition, OnCommentSubmitDefinition, OnCommentUpdateDefinition, OnModActionDefinition, OnModMailDefinition, OnPostCreateDefinition, OnPostDeleteDefinition, OnPostFlairUpdateDefinition, OnPostNsfwUpdateDefinition, OnPostReportDefinition, OnPostSpoilerUpdateDefinition, OnPostSubmitDefinition, OnPostUpdateDefinition, PrivateMessagesDefinition, RealtimeDefinition, RedisAPIDefinition, SchedulerHandlerDefinition, SettingsDefinition, SubredditsDefinition, UIEventHandlerDefinition, UserActionsDefinition, UsersDefinition, WidgetsDefinition, WikiDefinition, } from '@devvit/protos';
|
|
2
2
|
import { PaymentProcessorDefinition, PaymentsServiceDefinition } from '@devvit/protos/payments.js';
|
|
3
3
|
import { WebbitServerDefinition } from '@devvit/protos/types/devvit/actor/webbit/webbit.js';
|
|
4
4
|
import { normalizeDomains } from '@devvit/shared-types/fetch-domains.js';
|
|
@@ -61,28 +61,47 @@ export function createDependencySpec(actorSpec, config, namespace) {
|
|
|
61
61
|
provide(spec, OnAppUpgradeDefinition);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
if (config.triggers) {
|
|
65
|
+
if (config.triggers.onAppInstall)
|
|
66
|
+
provide(spec, OnAppInstallDefinition);
|
|
67
|
+
if (config.triggers.onAppUpgrade)
|
|
68
|
+
provide(spec, OnAppUpgradeDefinition);
|
|
69
|
+
if (config.triggers.onAutomoderatorFilterComment)
|
|
70
|
+
provide(spec, OnAutomoderatorFilterCommentDefinition);
|
|
71
|
+
if (config.triggers.onAutomoderatorFilterPost)
|
|
72
|
+
provide(spec, OnAutomoderatorFilterPostDefinition);
|
|
73
|
+
if (config.triggers.onCommentCreate)
|
|
74
|
+
provide(spec, OnCommentCreateDefinition);
|
|
75
|
+
if (config.triggers.onCommentDelete)
|
|
76
|
+
provide(spec, OnCommentDeleteDefinition);
|
|
77
|
+
if (config.triggers.onCommentReport)
|
|
78
|
+
provide(spec, OnCommentReportDefinition);
|
|
79
|
+
if (config.triggers.onCommentSubmit)
|
|
80
|
+
provide(spec, OnCommentSubmitDefinition);
|
|
81
|
+
if (config.triggers.onCommentUpdate)
|
|
82
|
+
provide(spec, OnCommentUpdateDefinition);
|
|
83
|
+
if (config.triggers.onModAction)
|
|
84
|
+
provide(spec, OnModActionDefinition);
|
|
85
|
+
if (config.triggers.onModMail)
|
|
86
|
+
provide(spec, OnModMailDefinition);
|
|
87
|
+
if (config.triggers.onPostCreate)
|
|
88
|
+
provide(spec, OnPostCreateDefinition);
|
|
89
|
+
if (config.triggers.onPostDelete)
|
|
90
|
+
provide(spec, OnPostDeleteDefinition);
|
|
91
|
+
if (config.triggers.onPostFlairUpdate)
|
|
92
|
+
provide(spec, OnPostFlairUpdateDefinition);
|
|
93
|
+
if (config.triggers.onPostNsfwUpdate)
|
|
94
|
+
provide(spec, OnPostNsfwUpdateDefinition);
|
|
95
|
+
if (config.triggers.onPostReport)
|
|
96
|
+
provide(spec, OnPostReportDefinition);
|
|
97
|
+
if (config.triggers.onPostSpoilerUpdate)
|
|
98
|
+
provide(spec, OnPostSpoilerUpdateDefinition);
|
|
99
|
+
if (config.triggers.onPostSubmit)
|
|
100
|
+
provide(spec, OnPostSubmitDefinition);
|
|
101
|
+
if (config.triggers.onPostUpdate)
|
|
102
|
+
provide(spec, OnPostUpdateDefinition);
|
|
103
|
+
}
|
|
64
104
|
// to-do: when settings, SettingsDefinition / AppSettingsDefinition / InstallationSettingsDefinition.
|
|
65
|
-
// to-do: when form, UIEventHandlerDefinition.
|
|
66
|
-
// to-do: when triggers:
|
|
67
|
-
// OnAppInstallDefinition
|
|
68
|
-
// OnAppUpgradeDefinition
|
|
69
|
-
// OnAutomoderatorFilterCommentDefinition
|
|
70
|
-
// OnAutomoderatorFilterPostDefinition
|
|
71
|
-
// OnCommentCreateDefinition
|
|
72
|
-
// OnCommentDeleteDefinition
|
|
73
|
-
// OnCommentReportDefinition
|
|
74
|
-
// OnCommentSubmitDefinition
|
|
75
|
-
// OnCommentUpdateDefinition
|
|
76
|
-
// OnModActionDefinition
|
|
77
|
-
// OnModMailDefinition
|
|
78
|
-
// OnPostCreateDefinition
|
|
79
|
-
// OnPostDeleteDefinition
|
|
80
|
-
// OnPostFlairUpdateDefinition
|
|
81
|
-
// OnPostNsfwUpdateDefinition
|
|
82
|
-
// OnPostReportDefinition
|
|
83
|
-
// OnPostSpoilerUpdateDefinition
|
|
84
|
-
// OnPostSubmitDefinition
|
|
85
|
-
// OnPostUpdateDefinition
|
|
86
105
|
return spec;
|
|
87
106
|
}
|
|
88
107
|
function provide(spec, ...definitions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.template.d.ts","sourceRoot":"","sources":["../../../src/esbuild/templatizer/blocks.template.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,MAAM,EACN,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"blocks.template.d.ts","sourceRoot":"","sources":["../../../src/esbuild/templatizer/blocks.template.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,MAAM,EACN,KAAK,OAAO,EAOb,MAAM,oBAAoB,CAAC;AAK5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAkBtE,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAO,CAAC;AAqH7D,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CA4D/D;AAwKD,eAAe,MAAM,CAAC"}
|
|
@@ -86,6 +86,21 @@ function configureForms(forms) {
|
|
|
86
86
|
formKeyMap[name] = Devvit.createForm({ fields: [] }, (ev, ctx) => handleFormResponse(endpoint, ev, ctx));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
function configureTriggers(triggers) {
|
|
90
|
+
for (const [name, endpoint] of Object.entries(triggers)) {
|
|
91
|
+
const ev = name.replace(/^on/, '');
|
|
92
|
+
Devvit.addTrigger({
|
|
93
|
+
event: ev,
|
|
94
|
+
async onEvent(ev, ctx) {
|
|
95
|
+
// Convert the hydrated old Protobuf to JSON. Don't use
|
|
96
|
+
// Protobuf.toJSON() which would omit default values.
|
|
97
|
+
const body = JSON.parse(JSON.stringify(ev));
|
|
98
|
+
// Cast to JSONObject since interfaces are open types.
|
|
99
|
+
await callWebbitEndpoint(endpoint, body, ctx.debug.metadata);
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
89
104
|
async function handleFormResponse(endpoint, event, ctx) {
|
|
90
105
|
const responseJson = await callWebbitEndpoint(endpoint, event.values, ctx.debug.metadata);
|
|
91
106
|
const uiResponse = responseJson;
|
|
@@ -202,10 +217,7 @@ function configureScheduler(schedulerConfig) {
|
|
|
202
217
|
Devvit.addSchedulerJob({
|
|
203
218
|
name: name,
|
|
204
219
|
onRun: async (event, context) => {
|
|
205
|
-
await callWebbitEndpoint(task.endpoint, {
|
|
206
|
-
name: event.name,
|
|
207
|
-
data: event.data ?? null, // JSONObject wants null not undefined
|
|
208
|
-
}, context.debug.metadata);
|
|
220
|
+
await callWebbitEndpoint(task.endpoint, { name: event.name, data: event.data }, context.debug.metadata);
|
|
209
221
|
},
|
|
210
222
|
});
|
|
211
223
|
// Tasks with cron specified require a bit more work further down
|
|
@@ -276,5 +288,7 @@ if (config) {
|
|
|
276
288
|
configureScheduler(config.scheduler);
|
|
277
289
|
if (config.forms)
|
|
278
290
|
configureForms(config.forms);
|
|
291
|
+
if (config.triggers)
|
|
292
|
+
configureTriggers(config.triggers);
|
|
279
293
|
}
|
|
280
294
|
export default Devvit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/build-pack",
|
|
3
|
-
"version": "0.11.19-next-2025-07-09-
|
|
3
|
+
"version": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"types": "./index.d.ts",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@devvit/protos": "0.11.19-next-2025-07-09-
|
|
27
|
-
"@devvit/shared-types": "0.11.19-next-2025-07-09-
|
|
26
|
+
"@devvit/protos": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
27
|
+
"@devvit/shared-types": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
28
28
|
"esbuild": "0.23.0",
|
|
29
29
|
"rxjs": "7.8.1",
|
|
30
30
|
"tsv": "0.2.0",
|
|
@@ -35,11 +35,12 @@
|
|
|
35
35
|
"@devvit/shared": "*"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@devvit/public-api": "0.11.19-next-2025-07-09-
|
|
39
|
-
"@devvit/repo-tools": "0.11.19-next-2025-07-09-
|
|
40
|
-
"@devvit/
|
|
41
|
-
"@devvit/
|
|
42
|
-
"@devvit/
|
|
38
|
+
"@devvit/public-api": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
39
|
+
"@devvit/repo-tools": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
40
|
+
"@devvit/scheduler": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
41
|
+
"@devvit/server": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
42
|
+
"@devvit/shared": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
43
|
+
"@devvit/tsconfig": "0.11.19-next-2025-07-09-20-04-18-3938f00aa.0",
|
|
43
44
|
"@types/tsv": "0.2.1",
|
|
44
45
|
"eslint": "9.11.1",
|
|
45
46
|
"vitest": "1.6.1"
|
|
@@ -48,5 +49,5 @@
|
|
|
48
49
|
"directory": "dist"
|
|
49
50
|
},
|
|
50
51
|
"source": "./src/index.ts",
|
|
51
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "302b8fa7590281eec003b2fcf082d8e9fc303971"
|
|
52
53
|
}
|