@nocobase/plugin-notification-in-app-message 2.2.0-beta.1 → 2.2.0-beta.10
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/dist/client/index.js +1 -1
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +10 -10
- package/dist/node_modules/uuid/package.json +1 -1
- package/dist/swagger/index.d.ts +357 -0
- package/dist/swagger/index.js +375 -0
- package/package.json +2 -2
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var swagger_exports = {};
|
|
28
|
+
__export(swagger_exports, {
|
|
29
|
+
default: () => swagger_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(swagger_exports);
|
|
32
|
+
const jsonObjectSchema = {
|
|
33
|
+
type: "object",
|
|
34
|
+
additionalProperties: true
|
|
35
|
+
};
|
|
36
|
+
const listParameters = [
|
|
37
|
+
{
|
|
38
|
+
name: "filter",
|
|
39
|
+
in: "query",
|
|
40
|
+
required: false,
|
|
41
|
+
description: "Filter object encoded as JSON.",
|
|
42
|
+
schema: jsonObjectSchema
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "page",
|
|
46
|
+
in: "query",
|
|
47
|
+
required: false,
|
|
48
|
+
schema: {
|
|
49
|
+
type: "integer"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "pageSize",
|
|
54
|
+
in: "query",
|
|
55
|
+
required: false,
|
|
56
|
+
schema: {
|
|
57
|
+
type: "integer"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
const myInAppChannelListParameters = [
|
|
62
|
+
{
|
|
63
|
+
name: "filter",
|
|
64
|
+
in: "query",
|
|
65
|
+
required: false,
|
|
66
|
+
description: "Filter object encoded as JSON. Supports `status`, `name`, and `latestMsgReceiveTimestamp.$lt` for cursor-like pagination.",
|
|
67
|
+
schema: jsonObjectSchema
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "limit",
|
|
71
|
+
in: "query",
|
|
72
|
+
required: false,
|
|
73
|
+
schema: {
|
|
74
|
+
type: "integer",
|
|
75
|
+
default: 30
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
const userIdSchema = {
|
|
80
|
+
oneOf: [
|
|
81
|
+
{
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "User id serialized as a string. This is common for bigInt identifiers."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: "integer",
|
|
87
|
+
description: "User id when the runtime serializes the value as a JSON number."
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
};
|
|
91
|
+
var swagger_default = {
|
|
92
|
+
openapi: "3.0.2",
|
|
93
|
+
info: {
|
|
94
|
+
title: "NocoBase API - Notification in-app message plugin"
|
|
95
|
+
},
|
|
96
|
+
paths: {
|
|
97
|
+
"/myInAppMessages:list": {
|
|
98
|
+
get: {
|
|
99
|
+
tags: ["myInAppMessages"],
|
|
100
|
+
summary: "List current user in-app messages",
|
|
101
|
+
description: "List messages for the current user. The server always scopes results to `ctx.state.currentUser.id`.",
|
|
102
|
+
parameters: listParameters,
|
|
103
|
+
responses: {
|
|
104
|
+
200: {
|
|
105
|
+
description: "OK",
|
|
106
|
+
content: {
|
|
107
|
+
"application/json": {
|
|
108
|
+
schema: {
|
|
109
|
+
$ref: "#/components/schemas/MyInAppMessagesResponse"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"/myInAppMessages:count": {
|
|
118
|
+
get: {
|
|
119
|
+
tags: ["myInAppMessages"],
|
|
120
|
+
summary: "Count current user unread in-app messages",
|
|
121
|
+
responses: {
|
|
122
|
+
200: {
|
|
123
|
+
description: "OK",
|
|
124
|
+
content: {
|
|
125
|
+
"application/json": {
|
|
126
|
+
schema: {
|
|
127
|
+
type: "object",
|
|
128
|
+
properties: {
|
|
129
|
+
count: {
|
|
130
|
+
type: "integer"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"/myInAppChannels:list": {
|
|
141
|
+
get: {
|
|
142
|
+
tags: ["myInAppChannels"],
|
|
143
|
+
summary: "List current user in-app message channels",
|
|
144
|
+
description: "List channels that have messages for the current user, including unread counts and latest message metadata.",
|
|
145
|
+
parameters: myInAppChannelListParameters,
|
|
146
|
+
responses: {
|
|
147
|
+
200: {
|
|
148
|
+
description: "OK",
|
|
149
|
+
content: {
|
|
150
|
+
"application/json": {
|
|
151
|
+
schema: {
|
|
152
|
+
$ref: "#/components/schemas/MyInAppChannelsResponse"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"/notificationInAppMessages:list": {
|
|
161
|
+
get: {
|
|
162
|
+
tags: ["notificationInAppMessages"],
|
|
163
|
+
summary: "List in-app message records",
|
|
164
|
+
parameters: listParameters,
|
|
165
|
+
responses: {
|
|
166
|
+
200: {
|
|
167
|
+
description: "OK",
|
|
168
|
+
content: {
|
|
169
|
+
"application/json": {
|
|
170
|
+
schema: {
|
|
171
|
+
type: "object",
|
|
172
|
+
properties: {
|
|
173
|
+
data: {
|
|
174
|
+
type: "array",
|
|
175
|
+
items: {
|
|
176
|
+
$ref: "#/components/schemas/InAppMessage"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
meta: jsonObjectSchema
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"/notificationInAppMessages:get": {
|
|
189
|
+
get: {
|
|
190
|
+
tags: ["notificationInAppMessages"],
|
|
191
|
+
summary: "Get one in-app message record",
|
|
192
|
+
parameters: [
|
|
193
|
+
{
|
|
194
|
+
name: "filterByTk",
|
|
195
|
+
in: "query",
|
|
196
|
+
required: true,
|
|
197
|
+
description: "In-app message UUID.",
|
|
198
|
+
schema: {
|
|
199
|
+
type: "string",
|
|
200
|
+
format: "uuid"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
responses: {
|
|
205
|
+
200: {
|
|
206
|
+
description: "OK",
|
|
207
|
+
content: {
|
|
208
|
+
"application/json": {
|
|
209
|
+
schema: {
|
|
210
|
+
type: "object",
|
|
211
|
+
properties: {
|
|
212
|
+
data: {
|
|
213
|
+
$ref: "#/components/schemas/InAppMessage"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"/notificationInAppMessages:updateMyOwn": {
|
|
224
|
+
post: {
|
|
225
|
+
tags: ["notificationInAppMessages"],
|
|
226
|
+
summary: "Update current user own in-app message",
|
|
227
|
+
description: "Update only the current user own message. The action merges `filter.userId` from the current user and whitelists `status`.",
|
|
228
|
+
parameters: [
|
|
229
|
+
{
|
|
230
|
+
name: "filterByTk",
|
|
231
|
+
in: "query",
|
|
232
|
+
required: false,
|
|
233
|
+
description: "In-app message UUID.",
|
|
234
|
+
schema: {
|
|
235
|
+
type: "string",
|
|
236
|
+
format: "uuid"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "filter",
|
|
241
|
+
in: "query",
|
|
242
|
+
required: false,
|
|
243
|
+
schema: jsonObjectSchema
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
requestBody: {
|
|
247
|
+
required: true,
|
|
248
|
+
content: {
|
|
249
|
+
"application/json": {
|
|
250
|
+
schema: {
|
|
251
|
+
type: "object",
|
|
252
|
+
required: ["status"],
|
|
253
|
+
properties: {
|
|
254
|
+
status: {
|
|
255
|
+
type: "string",
|
|
256
|
+
enum: ["read", "unread"]
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
responses: {
|
|
264
|
+
200: {
|
|
265
|
+
description: "OK",
|
|
266
|
+
content: {
|
|
267
|
+
"application/json": {
|
|
268
|
+
schema: {
|
|
269
|
+
type: "object",
|
|
270
|
+
properties: {
|
|
271
|
+
data: {
|
|
272
|
+
$ref: "#/components/schemas/InAppMessage"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
components: {
|
|
284
|
+
schemas: {
|
|
285
|
+
InAppMessage: {
|
|
286
|
+
type: "object",
|
|
287
|
+
properties: {
|
|
288
|
+
id: {
|
|
289
|
+
type: "string",
|
|
290
|
+
format: "uuid"
|
|
291
|
+
},
|
|
292
|
+
userId: {
|
|
293
|
+
...userIdSchema
|
|
294
|
+
},
|
|
295
|
+
channelName: {
|
|
296
|
+
type: "string"
|
|
297
|
+
},
|
|
298
|
+
title: {
|
|
299
|
+
type: "string"
|
|
300
|
+
},
|
|
301
|
+
content: {
|
|
302
|
+
type: "string"
|
|
303
|
+
},
|
|
304
|
+
status: {
|
|
305
|
+
type: "string",
|
|
306
|
+
enum: ["read", "unread"]
|
|
307
|
+
},
|
|
308
|
+
receiveTimestamp: {
|
|
309
|
+
type: "integer",
|
|
310
|
+
format: "int64"
|
|
311
|
+
},
|
|
312
|
+
options: jsonObjectSchema,
|
|
313
|
+
createdAt: {
|
|
314
|
+
type: "string",
|
|
315
|
+
format: "date-time"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
additionalProperties: true
|
|
319
|
+
},
|
|
320
|
+
MyInAppMessagesResponse: {
|
|
321
|
+
type: "object",
|
|
322
|
+
properties: {
|
|
323
|
+
messages: {
|
|
324
|
+
type: "array",
|
|
325
|
+
items: {
|
|
326
|
+
$ref: "#/components/schemas/InAppMessage"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
MyInAppChannel: {
|
|
332
|
+
type: "object",
|
|
333
|
+
properties: {
|
|
334
|
+
name: {
|
|
335
|
+
type: "string"
|
|
336
|
+
},
|
|
337
|
+
title: {
|
|
338
|
+
type: "string"
|
|
339
|
+
},
|
|
340
|
+
userId: {
|
|
341
|
+
...userIdSchema
|
|
342
|
+
},
|
|
343
|
+
unreadMsgCnt: {
|
|
344
|
+
type: "integer"
|
|
345
|
+
},
|
|
346
|
+
totalMsgCnt: {
|
|
347
|
+
type: "integer"
|
|
348
|
+
},
|
|
349
|
+
latestMsgReceiveTimestamp: {
|
|
350
|
+
type: "integer",
|
|
351
|
+
format: "int64"
|
|
352
|
+
},
|
|
353
|
+
latestMsgTitle: {
|
|
354
|
+
type: "string"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
additionalProperties: true
|
|
358
|
+
},
|
|
359
|
+
MyInAppChannelsResponse: {
|
|
360
|
+
type: "object",
|
|
361
|
+
properties: {
|
|
362
|
+
rows: {
|
|
363
|
+
type: "array",
|
|
364
|
+
items: {
|
|
365
|
+
$ref: "#/components/schemas/MyInAppChannel"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
count: {
|
|
369
|
+
type: "integer"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-notification-in-app-message",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.10",
|
|
4
4
|
"displayName": "Notification: In-app message",
|
|
5
5
|
"displayName.ru-RU": "Уведомления: Всплывающие сообщения внутри приложения",
|
|
6
6
|
"displayName.zh-CN": "通知:站内信",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"react-router-dom": "^6.x"
|
|
34
34
|
},
|
|
35
35
|
"license": "Apache-2.0",
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "d572beec24de46df948f28db72b25303a63bf62d"
|
|
37
37
|
}
|