godprotocol 2.2.65 → 2.2.67

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": "godprotocol",
3
- "version": "2.2.65",
3
+ "version": "2.2.67",
4
4
  "description": "A distributed computing environment for Web 4.0 — integrating AI, decentralisation, and virtual computation.",
5
5
  "main": "Index.js",
6
6
  "type": "module",
@@ -183,12 +183,15 @@ class Route_table extends Headers {
183
183
  let route = await this.get_route(name);
184
184
 
185
185
  if (!route) {
186
- return {
187
- ok: false,
188
- status: 404,
189
- message: "Route not found",
190
- data: { path: `/${name}`, name },
191
- };
186
+ route = await this.get_route("*");
187
+ if (!route) {
188
+ return {
189
+ ok: false,
190
+ status: 404,
191
+ message: "Route not found",
192
+ data: { path: `/${name}`, name },
193
+ };
194
+ }
192
195
  }
193
196
 
194
197
  let { handler, config } = route;
@@ -136,11 +136,15 @@ class Services {
136
136
 
137
137
  handle_webhook_after = async (req, result) => {
138
138
  let { headers, body, route } = req;
139
- let { xplatform, platform } = headers;
139
+ let { xplatform, third_party, platform } = headers;
140
140
 
141
141
  if (xplatform && xplatform.uri !== platform.uri) {
142
- if (xplatform.webhook?.enabled) {
143
- let { webhook } = xplatform;
142
+ let webhook = third_party?.webhook || xplatform.webhook;
143
+
144
+ if (webhook?.enabled) {
145
+ if (webhook?.routes?.length && !webhook?.routes?.includes(route))
146
+ return;
147
+
144
148
  await fetch(webhook?.url, {
145
149
  method: "POST",
146
150
  headers: {