openxiangda 1.0.122 → 1.0.123

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.
@@ -61,6 +61,27 @@ await sdk.notification.sendByType({
61
61
  });
62
62
  ```
63
63
 
64
+ User-facing in-app message centers should read the platform inbox instead of
65
+ creating app-specific message/log forms:
66
+
67
+ ```ts
68
+ const inbox = await sdk.notification.listInbox({
69
+ page: 1,
70
+ limit: 20,
71
+ readStatus: "unread",
72
+ });
73
+
74
+ await sdk.notification.markRead(messageId);
75
+ await sdk.notification.markAllRead();
76
+
77
+ const unread = await sdk.notification.getUnreadCount();
78
+ ```
79
+
80
+ Inbox APIs are app-scoped and only return the current logged-in user's `inapp`
81
+ messages. Use `keyword`, `templateCode`, and `readStatus` for server-side
82
+ filtering. Do not expose `/api/message/history` to normal users; it is an
83
+ administrative send-history surface.
84
+
64
85
  CLI smoke tests:
65
86
 
66
87
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.122",
3
+ "version": "1.0.123",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {
@@ -2445,6 +2445,45 @@ var createPageSdk = (context) => {
2445
2445
  ...params,
2446
2446
  appType: resolveAppType(context, params.appType)
2447
2447
  }
2448
+ }),
2449
+ listInbox: (params = {}) => request({
2450
+ path: buildOpenXiangdaAppPath(
2451
+ context,
2452
+ params.appType,
2453
+ "/notifications/inbox"
2454
+ ),
2455
+ method: "get",
2456
+ query: {
2457
+ page: params.page,
2458
+ limit: params.limit,
2459
+ readStatus: params.readStatus,
2460
+ keyword: params.keyword,
2461
+ templateCode: params.templateCode
2462
+ }
2463
+ }),
2464
+ getUnreadCount: (params = {}) => request({
2465
+ path: buildOpenXiangdaAppPath(
2466
+ context,
2467
+ params.appType,
2468
+ "/notifications/inbox/unread-count"
2469
+ ),
2470
+ method: "get"
2471
+ }),
2472
+ markRead: (messageId, params = {}) => request({
2473
+ path: buildOpenXiangdaAppPath(
2474
+ context,
2475
+ params.appType,
2476
+ `/notifications/inbox/${encodePathSegment(messageId)}/read`
2477
+ ),
2478
+ method: "post"
2479
+ }),
2480
+ markAllRead: (params = {}) => request({
2481
+ path: buildOpenXiangdaAppPath(
2482
+ context,
2483
+ params.appType,
2484
+ "/notifications/inbox/read-all"
2485
+ ),
2486
+ method: "post"
2448
2487
  })
2449
2488
  };
2450
2489
  const sdk = {