octalens-mentions 0.0.6 → 0.0.8

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.
@@ -4,6 +4,19 @@ const bootstrap = ({ strapi }) => {
4
4
  const destroy = ({ strapi }) => {
5
5
  };
6
6
  const register = ({ strapi }) => {
7
+ strapi.server.use(async (ctx, next) => {
8
+ if (ctx.path === "/api/octalens-mentions/ingest" && ctx.method === "POST") {
9
+ console.log("=== INGEST REQUEST RECEIVED ===");
10
+ console.log("Path:", ctx.path);
11
+ console.log("Method:", ctx.method);
12
+ console.log("Content-Type:", ctx.request.headers["content-type"]);
13
+ if (ctx.request.body) {
14
+ console.log("Parsed Body:", JSON.stringify(ctx.request.body, null, 2));
15
+ }
16
+ console.log("=================================");
17
+ }
18
+ await next();
19
+ });
7
20
  };
8
21
  const config = {
9
22
  default: {},
@@ -79,7 +92,7 @@ const attributes = {
79
92
  type: "string"
80
93
  },
81
94
  viewId: {
82
- type: "string"
95
+ type: "integer"
83
96
  },
84
97
  viewName: {
85
98
  type: "string"
@@ -141,7 +154,7 @@ const controller = ({ strapi }) => ({
141
154
  bookmarked: requestBody.data?.bookmarked || false,
142
155
  language: requestBody.data?.language || "",
143
156
  sentimentLabel: requestBody.data?.sentimentLabel || "",
144
- viewId: requestBody.data?.viewId ? String(requestBody.data.viewId) : "",
157
+ viewId: requestBody.data?.viewId || null,
145
158
  viewName: requestBody.data?.viewName || "",
146
159
  subreddit: requestBody.data?.subreddit || ""
147
160
  };
@@ -3,6 +3,19 @@ const bootstrap = ({ strapi }) => {
3
3
  const destroy = ({ strapi }) => {
4
4
  };
5
5
  const register = ({ strapi }) => {
6
+ strapi.server.use(async (ctx, next) => {
7
+ if (ctx.path === "/api/octalens-mentions/ingest" && ctx.method === "POST") {
8
+ console.log("=== INGEST REQUEST RECEIVED ===");
9
+ console.log("Path:", ctx.path);
10
+ console.log("Method:", ctx.method);
11
+ console.log("Content-Type:", ctx.request.headers["content-type"]);
12
+ if (ctx.request.body) {
13
+ console.log("Parsed Body:", JSON.stringify(ctx.request.body, null, 2));
14
+ }
15
+ console.log("=================================");
16
+ }
17
+ await next();
18
+ });
6
19
  };
7
20
  const config = {
8
21
  default: {},
@@ -78,7 +91,7 @@ const attributes = {
78
91
  type: "string"
79
92
  },
80
93
  viewId: {
81
- type: "string"
94
+ type: "integer"
82
95
  },
83
96
  viewName: {
84
97
  type: "string"
@@ -140,7 +153,7 @@ const controller = ({ strapi }) => ({
140
153
  bookmarked: requestBody.data?.bookmarked || false,
141
154
  language: requestBody.data?.language || "",
142
155
  sentimentLabel: requestBody.data?.sentimentLabel || "",
143
- viewId: requestBody.data?.viewId ? String(requestBody.data.viewId) : "",
156
+ viewId: requestBody.data?.viewId || null,
144
157
  viewName: requestBody.data?.viewName || "",
145
158
  subreddit: requestBody.data?.subreddit || ""
146
159
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.6",
2
+ "version": "0.0.8",
3
3
  "keywords": [],
4
4
  "type": "commonjs",
5
5
  "exports": {