@mastra/core 0.1.26 → 0.1.27-alpha.0
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/agents/index.d.ts +6 -3
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/core.cjs.development.js +821 -7486
- package/dist/core.cjs.development.js.map +1 -1
- package/dist/core.cjs.production.min.js +1 -1
- package/dist/core.cjs.production.min.js.map +1 -1
- package/dist/core.esm.js +817 -7429
- package/dist/core.esm.js.map +1 -1
- package/dist/framework.d.ts +3 -13
- package/dist/framework.d.ts.map +1 -1
- package/dist/index.d.ts +1 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/integration.d.ts +1 -0
- package/dist/integration.d.ts.map +1 -1
- package/dist/lib/index.d.ts +0 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/next-src/agent/index.d.ts +62 -0
- package/dist/next-src/agent/index.d.ts.map +1 -0
- package/dist/next-src/index.d.ts +41 -0
- package/dist/next-src/index.d.ts.map +1 -0
- package/dist/next-src/integration/index.d.ts +30 -0
- package/dist/next-src/integration/index.d.ts.map +1 -0
- package/dist/next-src/logger/index.d.ts +61 -0
- package/dist/next-src/logger/index.d.ts.map +1 -0
- package/dist/next-src/tools/index.d.ts +4 -0
- package/dist/next-src/tools/index.d.ts.map +1 -0
- package/dist/next-src/tools/types.d.ts +27 -0
- package/dist/next-src/tools/types.d.ts.map +1 -0
- package/dist/workflows/handler.d.ts +5 -0
- package/dist/workflows/handler.d.ts.map +1 -1
- package/package.json +14 -17
- package/dist/data-access/index.d.ts +0 -351
- package/dist/data-access/index.d.ts.map +0 -1
- package/dist/generated-types/index.d.ts +0 -5
- package/dist/generated-types/index.d.ts.map +0 -1
- package/dist/lib/logger-utils/logger.d.ts +0 -118
- package/dist/lib/logger-utils/logger.d.ts.map +0 -1
- package/dist/lib/query-builder/constants.d.ts +0 -17
- package/dist/lib/query-builder/constants.d.ts.map +0 -1
- package/dist/lib/query-builder/filters/sql.d.ts +0 -9
- package/dist/lib/query-builder/filters/sql.d.ts.map +0 -1
- package/dist/lib/query-builder/schema.d.ts +0 -37
- package/dist/lib/query-builder/schema.d.ts.map +0 -1
- package/dist/lib/query-builder/sorts/sql.d.ts +0 -8
- package/dist/lib/query-builder/sorts/sql.d.ts.map +0 -1
- package/dist/lib/query-builder/types.d.ts +0 -31
- package/dist/lib/query-builder/types.d.ts.map +0 -1
- package/dist/lib/query-builder/utils.d.ts +0 -27
- package/dist/lib/query-builder/utils.d.ts.map +0 -1
- package/dist/prisma/client.d.ts +0 -3
- package/dist/prisma/client.d.ts.map +0 -1
- package/dist/prisma/client.ts +0 -31
- package/dist/prisma/gen.js +0 -140
- package/dist/prisma/schema.prisma +0 -130
- package/dist/service/service.property.d.ts +0 -25
- package/dist/service/service.property.d.ts.map +0 -1
- package/dist/service/service.record.d.ts +0 -25
- package/dist/service/service.record.d.ts.map +0 -1
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
import { Prisma, PrismaClient, Credential } from '@prisma-app/client';
|
|
2
|
-
import { FilterObject } from '../lib/query-builder/types';
|
|
3
|
-
import { prisma } from '../prisma/client';
|
|
4
|
-
import { RecordService } from '../service/service.record';
|
|
5
|
-
import { CredentialValue } from '../types';
|
|
6
|
-
export declare class DataLayer {
|
|
7
|
-
db: PrismaClient;
|
|
8
|
-
recordService: RecordService<typeof prisma>;
|
|
9
|
-
constructor({ url }: {
|
|
10
|
-
url: string;
|
|
11
|
-
provider: string;
|
|
12
|
-
});
|
|
13
|
-
createConnection({ connection, credential, }: {
|
|
14
|
-
connection: Prisma.ConnectionUncheckedCreateInput;
|
|
15
|
-
credential: Omit<Prisma.CredentialUncheckedCreateInput, 'k_id'>;
|
|
16
|
-
}): Promise<{
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
createdAt: Date;
|
|
20
|
-
updatedAt: Date | null;
|
|
21
|
-
issues: string[];
|
|
22
|
-
syncConfig: Prisma.JsonValue | null;
|
|
23
|
-
connectionId: string;
|
|
24
|
-
lastSyncAt: Date | null;
|
|
25
|
-
subscriptionId: string | null;
|
|
26
|
-
} & {
|
|
27
|
-
credential: Credential;
|
|
28
|
-
}>;
|
|
29
|
-
deleteConnection({ connectionId }: {
|
|
30
|
-
connectionId: string;
|
|
31
|
-
}): Promise<{
|
|
32
|
-
id: string;
|
|
33
|
-
name: string;
|
|
34
|
-
createdAt: Date;
|
|
35
|
-
updatedAt: Date | null;
|
|
36
|
-
issues: string[];
|
|
37
|
-
syncConfig: Prisma.JsonValue | null;
|
|
38
|
-
connectionId: string;
|
|
39
|
-
lastSyncAt: Date | null;
|
|
40
|
-
subscriptionId: string | null;
|
|
41
|
-
}>;
|
|
42
|
-
getConnection({ connectionId, name, }: {
|
|
43
|
-
name: string;
|
|
44
|
-
connectionId: string;
|
|
45
|
-
}): Promise<{
|
|
46
|
-
id: string;
|
|
47
|
-
name: string;
|
|
48
|
-
createdAt: Date;
|
|
49
|
-
updatedAt: Date | null;
|
|
50
|
-
issues: string[];
|
|
51
|
-
syncConfig: Prisma.JsonValue | null;
|
|
52
|
-
connectionId: string;
|
|
53
|
-
lastSyncAt: Date | null;
|
|
54
|
-
subscriptionId: string | null;
|
|
55
|
-
} | null>;
|
|
56
|
-
getConnectionsByIntegrationName({ name }: {
|
|
57
|
-
name: string;
|
|
58
|
-
}): Promise<{
|
|
59
|
-
id: string;
|
|
60
|
-
name: string;
|
|
61
|
-
createdAt: Date;
|
|
62
|
-
updatedAt: Date | null;
|
|
63
|
-
issues: string[];
|
|
64
|
-
syncConfig: Prisma.JsonValue | null;
|
|
65
|
-
connectionId: string;
|
|
66
|
-
lastSyncAt: Date | null;
|
|
67
|
-
subscriptionId: string | null;
|
|
68
|
-
}[]>;
|
|
69
|
-
getAllConnections(): Promise<{
|
|
70
|
-
name: string;
|
|
71
|
-
connectionId: string;
|
|
72
|
-
}[]>;
|
|
73
|
-
getConnectionById({ k_id }: {
|
|
74
|
-
k_id: string;
|
|
75
|
-
}): Promise<{
|
|
76
|
-
id: string;
|
|
77
|
-
name: string;
|
|
78
|
-
createdAt: Date;
|
|
79
|
-
updatedAt: Date | null;
|
|
80
|
-
issues: string[];
|
|
81
|
-
syncConfig: Prisma.JsonValue | null;
|
|
82
|
-
connectionId: string;
|
|
83
|
-
lastSyncAt: Date | null;
|
|
84
|
-
subscriptionId: string | null;
|
|
85
|
-
} | null>;
|
|
86
|
-
getCredentialsByConnection(k_id: string): Promise<{
|
|
87
|
-
connection: {
|
|
88
|
-
id: string;
|
|
89
|
-
name: string;
|
|
90
|
-
createdAt: Date;
|
|
91
|
-
updatedAt: Date | null;
|
|
92
|
-
issues: string[];
|
|
93
|
-
syncConfig: Prisma.JsonValue | null;
|
|
94
|
-
connectionId: string;
|
|
95
|
-
lastSyncAt: Date | null;
|
|
96
|
-
subscriptionId: string | null;
|
|
97
|
-
};
|
|
98
|
-
} & {
|
|
99
|
-
id: string;
|
|
100
|
-
type: string;
|
|
101
|
-
k_id: string;
|
|
102
|
-
value: Prisma.JsonValue;
|
|
103
|
-
scope: string[];
|
|
104
|
-
}>;
|
|
105
|
-
updateConnectionCredential({ k_id, token, }: {
|
|
106
|
-
k_id: string;
|
|
107
|
-
token: CredentialValue;
|
|
108
|
-
}): Promise<{
|
|
109
|
-
id: string;
|
|
110
|
-
type: string;
|
|
111
|
-
k_id: string;
|
|
112
|
-
value: Prisma.JsonValue;
|
|
113
|
-
scope: string[];
|
|
114
|
-
}>;
|
|
115
|
-
createEntity({ connectionId, type, k_id, }: {
|
|
116
|
-
k_id: string;
|
|
117
|
-
type: string;
|
|
118
|
-
connectionId: string;
|
|
119
|
-
}): Promise<{
|
|
120
|
-
id: string;
|
|
121
|
-
type: string;
|
|
122
|
-
createdAt: Date;
|
|
123
|
-
updatedAt: Date | null;
|
|
124
|
-
createdBy: string;
|
|
125
|
-
k_id: string;
|
|
126
|
-
lastSyncId: string | null;
|
|
127
|
-
}>;
|
|
128
|
-
getEntityById(entityId: string): Promise<{
|
|
129
|
-
id: string;
|
|
130
|
-
type: string;
|
|
131
|
-
createdAt: Date;
|
|
132
|
-
updatedAt: Date | null;
|
|
133
|
-
createdBy: string;
|
|
134
|
-
k_id: string;
|
|
135
|
-
lastSyncId: string | null;
|
|
136
|
-
}>;
|
|
137
|
-
addPropertiesToEntity({ entityId, properties, }: {
|
|
138
|
-
entityId: string;
|
|
139
|
-
properties: Prisma.PropertyCreateInput[];
|
|
140
|
-
}): Promise<{
|
|
141
|
-
id: string;
|
|
142
|
-
type: string;
|
|
143
|
-
createdAt: Date;
|
|
144
|
-
updatedAt: Date | null;
|
|
145
|
-
createdBy: string;
|
|
146
|
-
k_id: string;
|
|
147
|
-
lastSyncId: string | null;
|
|
148
|
-
}>;
|
|
149
|
-
getEntityRecordsByConnectionAndType({ k_id, type, }: {
|
|
150
|
-
k_id: string;
|
|
151
|
-
type: string;
|
|
152
|
-
}): Promise<({
|
|
153
|
-
properties: {
|
|
154
|
-
id: string;
|
|
155
|
-
name: string;
|
|
156
|
-
displayName: string;
|
|
157
|
-
visible: boolean;
|
|
158
|
-
config: Prisma.JsonValue | null;
|
|
159
|
-
description: string | null;
|
|
160
|
-
type: import("@prisma-app/client").$Enums.PropertyType;
|
|
161
|
-
order: number;
|
|
162
|
-
modifiable: boolean;
|
|
163
|
-
parentId: string | null;
|
|
164
|
-
entityId: string | null;
|
|
165
|
-
}[];
|
|
166
|
-
records: {
|
|
167
|
-
id: string;
|
|
168
|
-
entityId: string | null;
|
|
169
|
-
createdAt: Date;
|
|
170
|
-
updatedAt: Date | null;
|
|
171
|
-
entityType: string;
|
|
172
|
-
externalId: string | null;
|
|
173
|
-
data: Prisma.JsonValue;
|
|
174
|
-
source: string;
|
|
175
|
-
status: import("@prisma-app/client").$Enums.RecordStatus;
|
|
176
|
-
enrichmentStatus: import("@prisma-app/client").$Enums.RecordEnrichmentStatus;
|
|
177
|
-
deletedAt: Date | null;
|
|
178
|
-
}[];
|
|
179
|
-
} & {
|
|
180
|
-
id: string;
|
|
181
|
-
type: string;
|
|
182
|
-
createdAt: Date;
|
|
183
|
-
updatedAt: Date | null;
|
|
184
|
-
createdBy: string;
|
|
185
|
-
k_id: string;
|
|
186
|
-
lastSyncId: string | null;
|
|
187
|
-
}) | null>;
|
|
188
|
-
getEntityByConnectionAndType({ k_id, type, }: {
|
|
189
|
-
k_id: string;
|
|
190
|
-
type: string;
|
|
191
|
-
}): Promise<{
|
|
192
|
-
id: string;
|
|
193
|
-
type: string;
|
|
194
|
-
createdAt: Date;
|
|
195
|
-
updatedAt: Date | null;
|
|
196
|
-
createdBy: string;
|
|
197
|
-
k_id: string;
|
|
198
|
-
lastSyncId: string | null;
|
|
199
|
-
} | null>;
|
|
200
|
-
updateEntityLastSyncId({ entityId, syncId, }: {
|
|
201
|
-
entityId: string;
|
|
202
|
-
syncId: string;
|
|
203
|
-
}): Promise<{
|
|
204
|
-
id: string;
|
|
205
|
-
type: string;
|
|
206
|
-
createdAt: Date;
|
|
207
|
-
updatedAt: Date | null;
|
|
208
|
-
createdBy: string;
|
|
209
|
-
k_id: string;
|
|
210
|
-
lastSyncId: string | null;
|
|
211
|
-
}>;
|
|
212
|
-
deleteEntityById(entityId: string): Promise<{
|
|
213
|
-
id: string;
|
|
214
|
-
type: string;
|
|
215
|
-
createdAt: Date;
|
|
216
|
-
updatedAt: Date | null;
|
|
217
|
-
createdBy: string;
|
|
218
|
-
k_id: string;
|
|
219
|
-
lastSyncId: string | null;
|
|
220
|
-
}>;
|
|
221
|
-
/**
|
|
222
|
-
* Creates new records for a entity, or updates existing record 'data' if it already exists
|
|
223
|
-
* @param entityId
|
|
224
|
-
* @param records
|
|
225
|
-
*/
|
|
226
|
-
mergeExternalRecordsForEntity({ entityId, records, }: {
|
|
227
|
-
entityId: string;
|
|
228
|
-
records: {
|
|
229
|
-
externalId: string;
|
|
230
|
-
data: Record<string, any>;
|
|
231
|
-
entityType?: string;
|
|
232
|
-
}[];
|
|
233
|
-
}): Promise<[Prisma.BatchPayload | undefined, number | undefined] | undefined>;
|
|
234
|
-
updateConnectionCredentials({ k_id, ...update }: Prisma.CredentialUpdateInput & {
|
|
235
|
-
k_id: string;
|
|
236
|
-
}): Promise<{
|
|
237
|
-
id: string;
|
|
238
|
-
type: string;
|
|
239
|
-
k_id: string;
|
|
240
|
-
value: Prisma.JsonValue;
|
|
241
|
-
scope: string[];
|
|
242
|
-
}>;
|
|
243
|
-
getRecords<T extends string | number | symbol>({ entityType, k_id, filters, sort, }: {
|
|
244
|
-
entityType: string;
|
|
245
|
-
k_id: string;
|
|
246
|
-
filters?: FilterObject<T>;
|
|
247
|
-
sort?: string[];
|
|
248
|
-
}): Promise<any>;
|
|
249
|
-
getRecordByPropertyNameAndValues({ propertyName, propertValues, type, connectionId, }: {
|
|
250
|
-
propertyName: string;
|
|
251
|
-
propertValues: string[];
|
|
252
|
-
type?: string;
|
|
253
|
-
connectionId: string;
|
|
254
|
-
}): Promise<{
|
|
255
|
-
id: string;
|
|
256
|
-
entityId: string | null;
|
|
257
|
-
createdAt: Date;
|
|
258
|
-
updatedAt: Date | null;
|
|
259
|
-
entityType: string;
|
|
260
|
-
externalId: string | null;
|
|
261
|
-
data: Prisma.JsonValue;
|
|
262
|
-
source: string;
|
|
263
|
-
status: import("@prisma-app/client").$Enums.RecordStatus;
|
|
264
|
-
enrichmentStatus: import("@prisma-app/client").$Enums.RecordEnrichmentStatus;
|
|
265
|
-
deletedAt: Date | null;
|
|
266
|
-
}[]>;
|
|
267
|
-
getRecordByPropertyNameAndValue({ propertyName, propertyValue, type, connectionId, }: {
|
|
268
|
-
propertyName: string;
|
|
269
|
-
propertyValue: string;
|
|
270
|
-
type: string;
|
|
271
|
-
connectionId: string;
|
|
272
|
-
}): Promise<{
|
|
273
|
-
id: string;
|
|
274
|
-
entityId: string | null;
|
|
275
|
-
createdAt: Date;
|
|
276
|
-
updatedAt: Date | null;
|
|
277
|
-
entityType: string;
|
|
278
|
-
externalId: string | null;
|
|
279
|
-
data: Prisma.JsonValue;
|
|
280
|
-
source: string;
|
|
281
|
-
status: import("@prisma-app/client").$Enums.RecordStatus;
|
|
282
|
-
enrichmentStatus: import("@prisma-app/client").$Enums.RecordEnrichmentStatus;
|
|
283
|
-
deletedAt: Date | null;
|
|
284
|
-
} | null>;
|
|
285
|
-
getRecordsByPropertyName({ propertyName, connectionId, }: {
|
|
286
|
-
propertyName: string;
|
|
287
|
-
connectionId: string;
|
|
288
|
-
}): Promise<{
|
|
289
|
-
id: string;
|
|
290
|
-
entityId: string | null;
|
|
291
|
-
createdAt: Date;
|
|
292
|
-
updatedAt: Date | null;
|
|
293
|
-
entityType: string;
|
|
294
|
-
externalId: string | null;
|
|
295
|
-
data: Prisma.JsonValue;
|
|
296
|
-
source: string;
|
|
297
|
-
status: import("@prisma-app/client").$Enums.RecordStatus;
|
|
298
|
-
enrichmentStatus: import("@prisma-app/client").$Enums.RecordEnrichmentStatus;
|
|
299
|
-
deletedAt: Date | null;
|
|
300
|
-
}[]>;
|
|
301
|
-
setConnectionError({ k_id, error }: {
|
|
302
|
-
k_id: string;
|
|
303
|
-
error: string;
|
|
304
|
-
}): Promise<{
|
|
305
|
-
id: string;
|
|
306
|
-
name: string;
|
|
307
|
-
createdAt: Date;
|
|
308
|
-
updatedAt: Date | null;
|
|
309
|
-
issues: string[];
|
|
310
|
-
syncConfig: Prisma.JsonValue | null;
|
|
311
|
-
connectionId: string;
|
|
312
|
-
lastSyncAt: Date | null;
|
|
313
|
-
subscriptionId: string | null;
|
|
314
|
-
}>;
|
|
315
|
-
setConnectionSubscriptionId({ k_id, subscriptionId, }: {
|
|
316
|
-
k_id: string;
|
|
317
|
-
subscriptionId: string;
|
|
318
|
-
}): Promise<{
|
|
319
|
-
id: string;
|
|
320
|
-
name: string;
|
|
321
|
-
createdAt: Date;
|
|
322
|
-
updatedAt: Date | null;
|
|
323
|
-
issues: string[];
|
|
324
|
-
syncConfig: Prisma.JsonValue | null;
|
|
325
|
-
connectionId: string;
|
|
326
|
-
lastSyncAt: Date | null;
|
|
327
|
-
subscriptionId: string | null;
|
|
328
|
-
}>;
|
|
329
|
-
syncData({ connectionId, name, data, type, properties, lastSyncId, }: {
|
|
330
|
-
name: string;
|
|
331
|
-
properties: Prisma.PropertyCreateInput[];
|
|
332
|
-
connectionId: string;
|
|
333
|
-
data: any;
|
|
334
|
-
type: string;
|
|
335
|
-
lastSyncId?: string;
|
|
336
|
-
}): Promise<void>;
|
|
337
|
-
getConnectionsBySubscriptionId({ subscriptionId, }: {
|
|
338
|
-
subscriptionId: string;
|
|
339
|
-
}): Promise<{
|
|
340
|
-
id: string;
|
|
341
|
-
name: string;
|
|
342
|
-
createdAt: Date;
|
|
343
|
-
updatedAt: Date | null;
|
|
344
|
-
issues: string[];
|
|
345
|
-
syncConfig: Prisma.JsonValue | null;
|
|
346
|
-
connectionId: string;
|
|
347
|
-
lastSyncAt: Date | null;
|
|
348
|
-
subscriptionId: string | null;
|
|
349
|
-
}[]>;
|
|
350
|
-
}
|
|
351
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data-access/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,YAAY,EAEZ,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,qBAAa,SAAS;IACpB,EAAE,EAAE,YAAY,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC,OAAO,MAAM,CAAC,CAAC;gBAEhC,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;IAKh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AU,EACV,UAAU,GACX,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC,mBAAmB,EAAE,CAAC;QACzC,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG,CAAC;QACV,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;IAyCK,8BAA8B,CAAC,EACnC,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;KACxB;;;;;;oBAQw8zI,OAAQ,SAAS;;;;;CAD39zI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated-types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,MAAM,WAAW,cAAc;IAC7B,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAC1B"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { Redis } from '@upstash/redis';
|
|
2
|
-
export declare const RegisteredLogger: {
|
|
3
|
-
readonly AGENT: "AGENT";
|
|
4
|
-
readonly WORKFLOW: "WORKFLOW";
|
|
5
|
-
};
|
|
6
|
-
export type RegisteredLogger = (typeof RegisteredLogger)[keyof typeof RegisteredLogger];
|
|
7
|
-
export declare const LogProvider: {
|
|
8
|
-
readonly CONSOLE: "CONSOLE";
|
|
9
|
-
readonly FILE: "FILE";
|
|
10
|
-
readonly UPSTASH: "UPSTASH";
|
|
11
|
-
};
|
|
12
|
-
export type LogConfig = {
|
|
13
|
-
provider: typeof LogProvider.CONSOLE;
|
|
14
|
-
level?: LogLevel;
|
|
15
|
-
} | {
|
|
16
|
-
provider: typeof LogProvider.UPSTASH;
|
|
17
|
-
level?: LogLevel;
|
|
18
|
-
config: {
|
|
19
|
-
url: string;
|
|
20
|
-
token: string;
|
|
21
|
-
};
|
|
22
|
-
} | {
|
|
23
|
-
provider: typeof LogProvider.FILE;
|
|
24
|
-
level?: LogLevel;
|
|
25
|
-
};
|
|
26
|
-
export type LogProvider = (typeof LogProvider)[keyof typeof LogProvider];
|
|
27
|
-
export declare enum LogLevel {
|
|
28
|
-
DEBUG = 0,
|
|
29
|
-
INFO = 1,
|
|
30
|
-
WARN = 2,
|
|
31
|
-
ERROR = 3
|
|
32
|
-
}
|
|
33
|
-
interface BaseLogMessage {
|
|
34
|
-
message: string;
|
|
35
|
-
destinationPath: string;
|
|
36
|
-
type: RegisteredLogger;
|
|
37
|
-
}
|
|
38
|
-
export interface Logger<T extends BaseLogMessage = BaseLogMessage> {
|
|
39
|
-
debug(message: T | string, ...args: any[]): void;
|
|
40
|
-
info(message: T | string, ...args: any[]): void;
|
|
41
|
-
warn(message: T | string, ...args: any[]): void;
|
|
42
|
-
error(message: T | string, ...args: any[]): void;
|
|
43
|
-
}
|
|
44
|
-
interface ConsoleLoggerOptions {
|
|
45
|
-
level?: LogLevel;
|
|
46
|
-
}
|
|
47
|
-
interface FileLoggerOptions {
|
|
48
|
-
dirPath: string;
|
|
49
|
-
level?: LogLevel;
|
|
50
|
-
}
|
|
51
|
-
interface UpstashRedisLoggerOptions {
|
|
52
|
-
redisClient: Redis;
|
|
53
|
-
key: string;
|
|
54
|
-
level?: LogLevel;
|
|
55
|
-
}
|
|
56
|
-
interface LogProviderRegistry<T extends BaseLogMessage = BaseLogMessage> {
|
|
57
|
-
[LogProvider.CONSOLE]: {
|
|
58
|
-
logger: ConsoleLogger<T>;
|
|
59
|
-
options: ConsoleLoggerOptions;
|
|
60
|
-
};
|
|
61
|
-
[LogProvider.FILE]: {
|
|
62
|
-
logger: FileLogger<T>;
|
|
63
|
-
options: FileLoggerOptions;
|
|
64
|
-
};
|
|
65
|
-
[LogProvider.UPSTASH]: {
|
|
66
|
-
logger: UpstashRedisLogger<T>;
|
|
67
|
-
options: UpstashRedisLoggerOptions;
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
declare abstract class BaseLogger<T extends BaseLogMessage = BaseLogMessage> implements Logger<T> {
|
|
71
|
-
protected level: LogLevel;
|
|
72
|
-
constructor(level?: LogLevel);
|
|
73
|
-
abstract log(level: LogLevel, message: T | string, ...args: any[]): void;
|
|
74
|
-
debug(message: T | string, ...args: any[]): void;
|
|
75
|
-
info(message: T | string, ...args: any[]): void;
|
|
76
|
-
warn(message: T | string, ...args: any[]): void;
|
|
77
|
-
error(message: T | string, ...args: any[]): void;
|
|
78
|
-
protected formatMessage(message: T | string): string;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Logs to the console
|
|
82
|
-
*/
|
|
83
|
-
declare class ConsoleLogger<T extends BaseLogMessage = BaseLogMessage> extends BaseLogger<T> {
|
|
84
|
-
constructor({ level }: {
|
|
85
|
-
level?: LogLevel;
|
|
86
|
-
});
|
|
87
|
-
log(level: LogLevel, message: T | string, ...args: any[]): void;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Logs to a file
|
|
91
|
-
*/
|
|
92
|
-
declare class FileLogger<T extends BaseLogMessage = BaseLogMessage> extends BaseLogger<T> {
|
|
93
|
-
#private;
|
|
94
|
-
constructor({ dirPath, level }: {
|
|
95
|
-
dirPath: string;
|
|
96
|
-
level?: LogLevel;
|
|
97
|
-
});
|
|
98
|
-
log(level: LogLevel, message: T): void;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Logs to Upstash Redis
|
|
102
|
-
*/
|
|
103
|
-
declare class UpstashRedisLogger<T extends BaseLogMessage = BaseLogMessage> extends BaseLogger<T> {
|
|
104
|
-
#private;
|
|
105
|
-
constructor({ redisClient, level, key, }: {
|
|
106
|
-
redisClient: Redis;
|
|
107
|
-
level?: LogLevel;
|
|
108
|
-
key: string;
|
|
109
|
-
});
|
|
110
|
-
log(level: LogLevel, message: T): void;
|
|
111
|
-
getLogs(key: string): Promise<string[]>;
|
|
112
|
-
}
|
|
113
|
-
export declare function createLogger<T extends BaseLogMessage = BaseLogMessage, K extends keyof LogProviderRegistry<T> = keyof LogProviderRegistry<T>>({ provider, options, }: {
|
|
114
|
-
provider: K;
|
|
115
|
-
options?: LogProviderRegistry[K]['options'];
|
|
116
|
-
}): LogProviderRegistry<T>[K]['logger'];
|
|
117
|
-
export {};
|
|
118
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/logger-utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIvC,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,MAAM,MAAM,SAAS,GACjB;IACE,QAAQ,EAAE,OAAO,WAAW,CAAC,OAAO,CAAC;IACrC,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB,GACD;IACE,QAAQ,EAAE,OAAO,WAAW,CAAC,OAAO,CAAC;IACrC,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC,GACD;IACE,QAAQ,EAAE,OAAO,WAAW,CAAC,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEN,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE,oBAAY,QAAQ;IAClB,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;I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AK,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,QAAQ,CAAA;KAAE;IAQrE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI;CA2BvC;AAED;;GAEG;AACH,cAAM,kBAAkB,CACtB,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,UAAU,CAAC,CAAC,CAAC;;gBAIT,EACV,WAAW,EACX,KAAK,EACL,GAAG,GACJ,EAAE;QACD,WAAW,EAAE,KAAK,CAAC;QACnB,KAAK,CAAC,EAAE,QAAQ,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;KACb;IAYD,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI;IAOtC,OAAO,CAAC,GAAG,EAAE,MAAM;CAGpB;AAED,wBAAgB,YAAY,CAC1B,CAAC,SAAS,cAAc,GAAG,cAAc,EACzC,CAAC,SAAS,MAAM,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,mBAAmB,CAAC,CAAC,CAAC,EACrE,EACA,QAAQ,EACR,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,CAAC,CAAC;IACZ,OAAO,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;CAC7C,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAkBtC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PropertyType } from '@prisma-app/client';
|
|
2
|
-
import { FilterOperators } from './types';
|
|
3
|
-
export interface SortField {
|
|
4
|
-
type: string;
|
|
5
|
-
name: string;
|
|
6
|
-
displayName: string;
|
|
7
|
-
config?: Record<string, any>;
|
|
8
|
-
}
|
|
9
|
-
export interface SortLogic {
|
|
10
|
-
field: SortField;
|
|
11
|
-
mode: 'ascending' | 'descending';
|
|
12
|
-
}
|
|
13
|
-
export declare const fieldsWithCommaSeparatedValues: PropertyType[];
|
|
14
|
-
export declare const FieldTypePrimitiveMap: Record<PropertyType, string>;
|
|
15
|
-
export declare const SORT_MODE_TO_ABBR: Record<SortLogic['mode'], string>;
|
|
16
|
-
export declare const FilterOperatorToSQL: Record<FilterOperators, string>;
|
|
17
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/query-builder/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,WAAW,GAAG,YAAY,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B,EAAE,YAAY,EAMxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAsB9D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAG/D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAgB/D,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FilterClauseArgs } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get the SQL filter clause for the given filters.
|
|
4
|
-
* @param filters - Filters to apply.
|
|
5
|
-
* @param fields - Optional. JSON fields with associated types to apply filters on.
|
|
6
|
-
* @param parentTableRef - Parent table reference to apply filters on.
|
|
7
|
-
*/
|
|
8
|
-
export declare const getFilterClauseSQL: ({ filters, fields, parentTableRef, }: FilterClauseArgs<string>) => string;
|
|
9
|
-
//# sourceMappingURL=sql.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../../../src/lib/query-builder/filters/sql.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAI7D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,yCAI5B,gBAAgB,CAAC,MAAM,CAAC,WA6K1B,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { FilterOperators } from './types';
|
|
3
|
-
type ValueOf<T> = Required<T>[keyof T];
|
|
4
|
-
export declare const filterQuerySchema: z.ZodObject<Record<ValueOf<typeof FilterOperators>, any>, "strip", z.ZodTypeAny, {
|
|
5
|
-
is?: any;
|
|
6
|
-
eq?: any;
|
|
7
|
-
not_eq?: any;
|
|
8
|
-
contains?: any;
|
|
9
|
-
in?: any;
|
|
10
|
-
not_in?: any;
|
|
11
|
-
gt?: any;
|
|
12
|
-
lt?: any;
|
|
13
|
-
not_contains?: any;
|
|
14
|
-
gte?: any;
|
|
15
|
-
lte?: any;
|
|
16
|
-
op?: any;
|
|
17
|
-
set?: any;
|
|
18
|
-
not_set?: any;
|
|
19
|
-
}, {
|
|
20
|
-
is?: any;
|
|
21
|
-
eq?: any;
|
|
22
|
-
not_eq?: any;
|
|
23
|
-
contains?: any;
|
|
24
|
-
in?: any;
|
|
25
|
-
not_in?: any;
|
|
26
|
-
gt?: any;
|
|
27
|
-
lt?: any;
|
|
28
|
-
not_contains?: any;
|
|
29
|
-
gte?: any;
|
|
30
|
-
lte?: any;
|
|
31
|
-
op?: any;
|
|
32
|
-
set?: any;
|
|
33
|
-
not_set?: any;
|
|
34
|
-
}>;
|
|
35
|
-
export declare const sortQuerySchema: z.ZodEffects<z.ZodString, string[] | undefined, string>;
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/lib/query-builder/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM1C,KAAK,OAAO,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEvC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB5B,CAAC;AAEH,eAAO,MAAM,eAAe,yDAAkD,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SortClauseArgs } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get the SQL sort clause for the given sort fields.
|
|
4
|
-
* A sort clause is an array of strings where each string is a field to sort by.
|
|
5
|
-
* e.g. ["field1 ASC", "field2 DESC"] will sort by field1 in ascending order and field2 in descending order.
|
|
6
|
-
*/
|
|
7
|
-
export declare const getSortClauseSQL: ({ sort, parentTableRef, fields, }: SortClauseArgs) => string[];
|
|
8
|
-
//# sourceMappingURL=sql.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../../../src/lib/query-builder/sorts/sql.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sCAI1B,cAAc,KAAG,MAAM,EA2BzB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Property } from '@prisma-app/client';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { filterQuerySchema } from './schema';
|
|
4
|
-
export type FilterObject<T extends string | number | symbol> = Record<T, z.infer<typeof filterQuerySchema>>;
|
|
5
|
-
export interface FilterClauseArgs<T extends string | number | symbol> {
|
|
6
|
-
parentTableRef?: string;
|
|
7
|
-
filters: FilterObject<T>;
|
|
8
|
-
fields?: Pick<Property, 'name' | 'type'>[];
|
|
9
|
-
}
|
|
10
|
-
export interface SortClauseArgs {
|
|
11
|
-
parentTableRef?: string;
|
|
12
|
-
sort: string[];
|
|
13
|
-
fields?: Pick<Property, 'name' | 'type'>[];
|
|
14
|
-
}
|
|
15
|
-
export declare enum FilterOperators {
|
|
16
|
-
IS = "is",
|
|
17
|
-
EQUAL = "eq",
|
|
18
|
-
NOT_EQUAL = "not_eq",
|
|
19
|
-
CONTAINS = "contains",
|
|
20
|
-
IN = "in",
|
|
21
|
-
NOT_IN = "not_in",
|
|
22
|
-
GREATER_THAN = "gt",
|
|
23
|
-
LESS_THAN = "lt",
|
|
24
|
-
NOT_CONTAINS = "not_contains",
|
|
25
|
-
GREATER_THAN_OR_EQUAL = "gte",
|
|
26
|
-
LESS_THAN_OR_EQUAL = "lte",
|
|
27
|
-
OP = "op",
|
|
28
|
-
SET = "set",
|
|
29
|
-
NOT_SET = "not_set"
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/query-builder/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI,MAAM,CACnE,CAAC,EACD,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAClC,CAAC;AAEF,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC5C;AAED,oBAAY,eAAe;IACzB,EAAE,OAAO;IACT,KAAK,OAAO;IACZ,SAAS,WAAW;IACpB,QAAQ,aAAa;IACrB,EAAE,OAAO;IACT,MAAM,WAAW;IACjB,YAAY,OAAO;IACnB,SAAS,OAAO;IAChB,YAAY,iBAAiB;IAC7B,qBAAqB,QAAQ;IAC7B,kBAAkB,QAAQ;IAC1B,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,OAAO,YAAY;CACpB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { PropertyType } from '@prisma-app/client';
|
|
2
|
-
/**
|
|
3
|
-
* Split a string on commas and strip quotes from each part
|
|
4
|
-
* @param str input string
|
|
5
|
-
* @returns array of strings
|
|
6
|
-
*/
|
|
7
|
-
export declare const splitAndStripQuotes: (str: string) => string[];
|
|
8
|
-
export declare const transformFilterValueArray: (value: string | undefined) => string[] | undefined;
|
|
9
|
-
export declare const transformFilterValueBoolean: (value: string | undefined) => boolean | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* This returns the SQL field for a JSON field with appropriate casting.
|
|
12
|
-
* @param column - JSON field to cast.
|
|
13
|
-
* @param type - Type of the JSON field.
|
|
14
|
-
*/
|
|
15
|
-
export declare const getJSONField: (column: string, type: PropertyType) => string;
|
|
16
|
-
/**
|
|
17
|
-
* @description
|
|
18
|
-
* Builds a query string from filter and sort query strings
|
|
19
|
-
* @param filterQueryString Filter query string
|
|
20
|
-
* @param sortQueryString Sort query string
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
export declare function buildQueryString({ filterQueryString, sortQueryString, }: {
|
|
24
|
-
filterQueryString?: string;
|
|
25
|
-
sortQueryString?: string;
|
|
26
|
-
}): string;
|
|
27
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/query-builder/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,aAQ9C,CAAC;AAEF,eAAO,MAAM,yBAAyB,UAAW,MAAM,GAAG,SAAS,yBAGlE,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAAW,MAAM,GAAG,SAAS,wBAGpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,WAAY,MAAM,QAAQ,YAAY,WAoB9D,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,iBAAiB,EACjB,eAAe,GAChB,EAAE;IACD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,UAMA"}
|
package/dist/prisma/client.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/prisma/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAU,MAAM,oBAAoB,CAAC;AAY1D,eAAO,MAAM,MAAM,QAAS,MAAM,KAAG,YAkBpC,CAAC"}
|