@tiger16601/n8n-nodes-fastgpt 1.1.9 → 1.1.11

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.
@@ -0,0 +1,266 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appFields = exports.appOperations = void 0;
4
+ const GenericFunctions_1 = require("./GenericFunctions");
5
+ // NEW: 应用操作 - FastGPT应用管理
6
+ exports.appOperations = [
7
+ {
8
+ displayName: "Operation",
9
+ name: "operation",
10
+ type: "options",
11
+ noDataExpression: true,
12
+ displayOptions: {
13
+ show: {
14
+ resource: ["app"],
15
+ },
16
+ },
17
+ options: [
18
+ // NEW: 获取应用总体数据统计
19
+ {
20
+ name: "获取应用总体数据统计",
21
+ value: "获取应用总体数据统计",
22
+ action: "获取应用总体数据统计",
23
+ description: "获取指定应用的总体数据统计信息。",
24
+ routing: {
25
+ request: {
26
+ method: "GET",
27
+ // NEW: 获取应用总体数据统计端点(商业版)
28
+ url: "/proApi/core/app/logs/getTotalData",
29
+ },
30
+ output: {
31
+ postReceive: [GenericFunctions_1.sendErrorPostReceive],
32
+ },
33
+ },
34
+ },
35
+ // NEW: 获取应用图表数据
36
+ {
37
+ name: "获取应用图表数据",
38
+ value: "获取应用图表数据",
39
+ action: "获取应用图表数据",
40
+ description:
41
+ "获取指定应用的图表数据,支持按时间、来源、时间跨度筛选。",
42
+ routing: {
43
+ request: {
44
+ method: "POST",
45
+ // NEW: 获取应用图表数据端点(商业版)
46
+ url: "/proApi/core/app/logs/getChartData",
47
+ },
48
+ output: {
49
+ postReceive: [GenericFunctions_1.sendErrorPostReceive],
50
+ },
51
+ },
52
+ },
53
+ ],
54
+ default: "获取应用总体数据统计",
55
+ },
56
+ ];
57
+ const completeOperations = [
58
+ // NEW: 应用ID - 用于获取应用总体数据统计
59
+ {
60
+ displayName: "应用ID",
61
+ description: "FastGPT应用的App ID",
62
+ name: "appId",
63
+ type: "string",
64
+ default: "",
65
+ required: true,
66
+ displayOptions: {
67
+ show: {
68
+ operation: ["获取应用总体数据统计"],
69
+ resource: ["app"],
70
+ },
71
+ },
72
+ routing: {
73
+ send: {
74
+ type: "query",
75
+ property: "appId",
76
+ },
77
+ },
78
+ },
79
+ // NEW: 获取应用图表数据相关字段
80
+ {
81
+ displayName: "应用ID",
82
+ description: "FastGPT应用的App ID",
83
+ name: "chartAppId",
84
+ type: "string",
85
+ default: "",
86
+ required: true,
87
+ displayOptions: {
88
+ show: {
89
+ operation: ["获取应用图表数据"],
90
+ resource: ["app"],
91
+ },
92
+ },
93
+ routing: {
94
+ send: {
95
+ type: "body",
96
+ property: "appId",
97
+ },
98
+ },
99
+ },
100
+ {
101
+ displayName: "开始时间",
102
+ description: "数据统计开始时间,ISO格式,如:2025-09-19T16:00:00.000Z",
103
+ name: "chartDateStart",
104
+ type: "string",
105
+ default: "",
106
+ displayOptions: {
107
+ show: {
108
+ operation: ["获取应用图表数据"],
109
+ resource: ["app"],
110
+ },
111
+ },
112
+ routing: {
113
+ send: {
114
+ type: "body",
115
+ property: "dateStart",
116
+ },
117
+ },
118
+ },
119
+ {
120
+ displayName: "结束时间",
121
+ description: "数据统计结束时间,ISO格式,如:2025-09-27T15:59:59.999Z",
122
+ name: "chartDateEnd",
123
+ type: "string",
124
+ default: "",
125
+ displayOptions: {
126
+ show: {
127
+ operation: ["获取应用图表数据"],
128
+ resource: ["app"],
129
+ },
130
+ },
131
+ routing: {
132
+ send: {
133
+ type: "body",
134
+ property: "dateEnd",
135
+ },
136
+ },
137
+ },
138
+ {
139
+ displayName: "偏移量",
140
+ description: "用户留存偏移量,单位随userTimespan变化",
141
+ name: "chartOffset",
142
+ type: "number",
143
+ default: 1,
144
+ displayOptions: {
145
+ show: {
146
+ operation: ["获取应用图表数据"],
147
+ resource: ["app"],
148
+ },
149
+ },
150
+ routing: {
151
+ send: {
152
+ type: "body",
153
+ property: "offset",
154
+ },
155
+ },
156
+ },
157
+ {
158
+ displayName: "日志来源",
159
+ description: "日志来源,多个用逗号分隔,如:test,online,share,api",
160
+ name: "chartSource",
161
+ type: "string",
162
+ default: "test,online,share,api",
163
+ displayOptions: {
164
+ show: {
165
+ operation: ["获取应用图表数据"],
166
+ resource: ["app"],
167
+ },
168
+ },
169
+ routing: {
170
+ send: {
171
+ type: "body",
172
+ property: "source",
173
+ // NEW: 将逗号分隔的字符串转为数组
174
+ preSend: [
175
+ async function (requestOptions) {
176
+ const sourceStr = String(
177
+ this.getNodeParameter("chartSource"),
178
+ );
179
+ if (sourceStr) {
180
+ requestOptions.body.source = sourceStr
181
+ .split(",")
182
+ .map((s) => s.trim())
183
+ .filter((s) => s);
184
+ }
185
+ return requestOptions;
186
+ },
187
+ ],
188
+ },
189
+ },
190
+ },
191
+ {
192
+ displayName: "用户数据时间跨度",
193
+ name: "chartUserTimespan",
194
+ type: "options",
195
+ default: "day",
196
+ displayOptions: {
197
+ show: {
198
+ operation: ["获取应用图表数据"],
199
+ resource: ["app"],
200
+ },
201
+ },
202
+ options: [
203
+ { name: "天", value: "day" },
204
+ { name: "周", value: "week" },
205
+ { name: "月", value: "month" },
206
+ { name: "季度", value: "quarter" },
207
+ ],
208
+ routing: {
209
+ send: {
210
+ type: "body",
211
+ property: "userTimespan",
212
+ },
213
+ },
214
+ },
215
+ {
216
+ displayName: "对话数据时间跨度",
217
+ name: "chartChatTimespan",
218
+ type: "options",
219
+ default: "day",
220
+ displayOptions: {
221
+ show: {
222
+ operation: ["获取应用图表数据"],
223
+ resource: ["app"],
224
+ },
225
+ },
226
+ options: [
227
+ { name: "天", value: "day" },
228
+ { name: "周", value: "week" },
229
+ { name: "月", value: "month" },
230
+ { name: "季度", value: "quarter" },
231
+ ],
232
+ routing: {
233
+ send: {
234
+ type: "body",
235
+ property: "chatTimespan",
236
+ },
237
+ },
238
+ },
239
+ {
240
+ displayName: "应用数据时间跨度",
241
+ name: "chartAppTimespan",
242
+ type: "options",
243
+ default: "day",
244
+ displayOptions: {
245
+ show: {
246
+ operation: ["获取应用图表数据"],
247
+ resource: ["app"],
248
+ },
249
+ },
250
+ options: [
251
+ { name: "天", value: "day" },
252
+ { name: "周", value: "week" },
253
+ { name: "月", value: "month" },
254
+ { name: "季度", value: "quarter" },
255
+ ],
256
+ routing: {
257
+ send: {
258
+ type: "body",
259
+ property: "appTimespan",
260
+ },
261
+ },
262
+ },
263
+ ];
264
+ const sharedOperations = [];
265
+ exports.appFields = [...completeOperations, ...sharedOperations];
266
+ //# sourceMappingURL=AppDescription.js.map