@builderbot/provider-evolution-api 1.2.7
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/README.md +21 -0
- package/dist/evolution/core.d.ts +47 -0
- package/dist/evolution/core.d.ts.map +1 -0
- package/dist/evolution/provider.d.ts +35 -0
- package/dist/evolution/provider.d.ts.map +1 -0
- package/dist/index.cjs +20507 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/interface/evolution.d.ts +11 -0
- package/dist/interface/evolution.d.ts.map +1 -0
- package/dist/types.d.ts +207 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/downloadFile.d.ts +16 -0
- package/dist/utils/downloadFile.d.ts.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/mediaUrl.d.ts +3 -0
- package/dist/utils/mediaUrl.d.ts.map +1 -0
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.d.ts.map +1 -0
- package/dist/utils/processIncomingMsg.d.ts +3 -0
- package/dist/utils/processIncomingMsg.d.ts.map +1 -0
- package/dist/utils/profile.d.ts +4 -0
- package/dist/utils/profile.d.ts.map +1 -0
- package/package.json +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MetaList } from '~/types';
|
|
2
|
+
export interface EvolutionInterface {
|
|
3
|
+
sendText: (to: string, message: string, context: string | null) => Promise<any>;
|
|
4
|
+
sendImage: (to: string, mediaInput: string | null, caption: string, context: string | null) => Promise<any>;
|
|
5
|
+
sendImageUrl: (to: string, url: string, caption: string, context: string | null) => Promise<void>;
|
|
6
|
+
sendVideo: (to: string, pathVideo: string | null, caption: string, context: string | null) => Promise<any>;
|
|
7
|
+
sendVideoUrl: (to: string, url: string, caption: string, context: string | null) => Promise<void>;
|
|
8
|
+
sendMedia: (to: string, text: string, mediaInput: string, context: string | null) => Promise<any>;
|
|
9
|
+
sendList: (to: string, list: MetaList) => Promise<any>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=evolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evolution.d.ts","sourceRoot":"","sources":["../../src/interface/evolution.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE1G,MAAM,WAAW,kBAAkB;IAG/B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC/E,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC3G,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjG,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC1G,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjG,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IACjG,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAyCzD"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { GlobalVendorArgs } from '@builderbot/bot/dist/types';
|
|
2
|
+
export declare class File {
|
|
3
|
+
mime_type?: string;
|
|
4
|
+
sha256?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
voice?: boolean;
|
|
7
|
+
animated?: boolean;
|
|
8
|
+
filename?: string;
|
|
9
|
+
caption?: string;
|
|
10
|
+
link?: string;
|
|
11
|
+
}
|
|
12
|
+
interface TemplateMessage {
|
|
13
|
+
name: string;
|
|
14
|
+
language: {
|
|
15
|
+
code: string;
|
|
16
|
+
};
|
|
17
|
+
components: TemplateComponent[];
|
|
18
|
+
}
|
|
19
|
+
interface TemplateComponent {
|
|
20
|
+
type: 'header' | 'body' | 'button';
|
|
21
|
+
parameters?: TemplateParameter[];
|
|
22
|
+
}
|
|
23
|
+
interface Section {
|
|
24
|
+
title: string;
|
|
25
|
+
rows: Row[];
|
|
26
|
+
}
|
|
27
|
+
interface Row {
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
description: string;
|
|
31
|
+
}
|
|
32
|
+
interface TemplateParameter {
|
|
33
|
+
type: string;
|
|
34
|
+
}
|
|
35
|
+
export interface MediaResponse {
|
|
36
|
+
url?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface MetaList {
|
|
39
|
+
header: {
|
|
40
|
+
type: string;
|
|
41
|
+
text: string;
|
|
42
|
+
};
|
|
43
|
+
body: {
|
|
44
|
+
text: string;
|
|
45
|
+
};
|
|
46
|
+
footer: {
|
|
47
|
+
text: string;
|
|
48
|
+
};
|
|
49
|
+
action: {
|
|
50
|
+
button: string;
|
|
51
|
+
sections: Section[];
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface EvolutionGlobalVendorArgs extends GlobalVendorArgs {
|
|
55
|
+
name: string;
|
|
56
|
+
apiKey: string;
|
|
57
|
+
baseURL: string;
|
|
58
|
+
instanceName: string;
|
|
59
|
+
}
|
|
60
|
+
export interface Order {
|
|
61
|
+
catalog_id: string;
|
|
62
|
+
product_items: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface Contact {
|
|
65
|
+
profile: Profile;
|
|
66
|
+
wa_id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
phones: string[];
|
|
69
|
+
}
|
|
70
|
+
export interface Message {
|
|
71
|
+
message_id?: string;
|
|
72
|
+
timestamp?: any;
|
|
73
|
+
type: string;
|
|
74
|
+
from: string;
|
|
75
|
+
to: string;
|
|
76
|
+
body: string;
|
|
77
|
+
pushName: string;
|
|
78
|
+
name: string;
|
|
79
|
+
url?: string;
|
|
80
|
+
fileData?: File | null;
|
|
81
|
+
payload?: string;
|
|
82
|
+
title_button_reply?: string;
|
|
83
|
+
title_list_reply?: string;
|
|
84
|
+
latitude?: number;
|
|
85
|
+
longitude?: number;
|
|
86
|
+
contacts?: Contact[];
|
|
87
|
+
nfm_reply?: string;
|
|
88
|
+
order?: Order;
|
|
89
|
+
id?: string;
|
|
90
|
+
caption?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface ParamsIncomingMessage {
|
|
93
|
+
messageId?: string;
|
|
94
|
+
messageTimestamp?: any;
|
|
95
|
+
pushName: string;
|
|
96
|
+
to: string;
|
|
97
|
+
jwtToken: string;
|
|
98
|
+
numberId: string;
|
|
99
|
+
version: string;
|
|
100
|
+
message: any;
|
|
101
|
+
fileData?: File | null;
|
|
102
|
+
}
|
|
103
|
+
export type TextGenericParams = {
|
|
104
|
+
messaging_product: 'whatsapp';
|
|
105
|
+
recipient_type: string;
|
|
106
|
+
to: string;
|
|
107
|
+
type: string;
|
|
108
|
+
[key: string]: any;
|
|
109
|
+
};
|
|
110
|
+
export interface ParsedContact {
|
|
111
|
+
name: {
|
|
112
|
+
formatted_name: string;
|
|
113
|
+
first_name: string;
|
|
114
|
+
[key: string]: any;
|
|
115
|
+
};
|
|
116
|
+
phones: {
|
|
117
|
+
phone: string;
|
|
118
|
+
type: string;
|
|
119
|
+
[key: string]: any;
|
|
120
|
+
}[];
|
|
121
|
+
[key: string]: any;
|
|
122
|
+
}
|
|
123
|
+
export interface TextMessageBody {
|
|
124
|
+
messaging_product: string;
|
|
125
|
+
to: string;
|
|
126
|
+
type: string;
|
|
127
|
+
recipient_type?: string;
|
|
128
|
+
text?: {
|
|
129
|
+
preview_url: boolean;
|
|
130
|
+
body: string;
|
|
131
|
+
};
|
|
132
|
+
image?: File;
|
|
133
|
+
video?: File;
|
|
134
|
+
audio?: File;
|
|
135
|
+
document?: File;
|
|
136
|
+
interactive?: any;
|
|
137
|
+
contacts?: any[];
|
|
138
|
+
context?: string;
|
|
139
|
+
template?: TemplateMessage;
|
|
140
|
+
}
|
|
141
|
+
export interface Reaction {
|
|
142
|
+
message_id: string;
|
|
143
|
+
emoji: string;
|
|
144
|
+
}
|
|
145
|
+
export interface Localization {
|
|
146
|
+
long_number: string;
|
|
147
|
+
lat_number: string;
|
|
148
|
+
name: string;
|
|
149
|
+
address: string;
|
|
150
|
+
}
|
|
151
|
+
export interface SaveFileOptions {
|
|
152
|
+
path?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface WhatsAppProfile {
|
|
155
|
+
verified_name: string;
|
|
156
|
+
code_verification_status: string;
|
|
157
|
+
display_phone_number: string;
|
|
158
|
+
quality_rating: string;
|
|
159
|
+
platform_type: string;
|
|
160
|
+
throughput: {
|
|
161
|
+
level: string;
|
|
162
|
+
};
|
|
163
|
+
id: string;
|
|
164
|
+
}
|
|
165
|
+
export interface IncomingMessage {
|
|
166
|
+
object: string;
|
|
167
|
+
entry: Entry[];
|
|
168
|
+
}
|
|
169
|
+
export interface Entry {
|
|
170
|
+
id: string;
|
|
171
|
+
changes: Change[];
|
|
172
|
+
}
|
|
173
|
+
export interface Change {
|
|
174
|
+
value: Value;
|
|
175
|
+
field: string;
|
|
176
|
+
}
|
|
177
|
+
export interface Value {
|
|
178
|
+
messaging_product: string;
|
|
179
|
+
metadata: Metadata;
|
|
180
|
+
contacts: ContactMeta[];
|
|
181
|
+
messages: MessageFromMeta[];
|
|
182
|
+
}
|
|
183
|
+
export interface Metadata {
|
|
184
|
+
display_phone_number: string;
|
|
185
|
+
phone_number_id: string;
|
|
186
|
+
}
|
|
187
|
+
export interface ContactMeta {
|
|
188
|
+
profile: Profile;
|
|
189
|
+
wa_id: string;
|
|
190
|
+
name: string;
|
|
191
|
+
phones: string[];
|
|
192
|
+
}
|
|
193
|
+
export interface Profile {
|
|
194
|
+
name: string;
|
|
195
|
+
}
|
|
196
|
+
export interface MessageFromMeta {
|
|
197
|
+
from: string;
|
|
198
|
+
id: string;
|
|
199
|
+
timestamp: string;
|
|
200
|
+
text: Text;
|
|
201
|
+
type: string;
|
|
202
|
+
}
|
|
203
|
+
export interface Text {
|
|
204
|
+
body: string;
|
|
205
|
+
}
|
|
206
|
+
export {};
|
|
207
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAclE,qBAAa,IAAI;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAA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AAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAA;CACf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AxiosResponse } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* Extraer el mimetype from buffer
|
|
4
|
+
* @param response - La respuesta HTTP
|
|
5
|
+
* @returns Un objeto con el tipo y la extensión del archivo
|
|
6
|
+
*/
|
|
7
|
+
declare const fileTypeFromFile: (response: AxiosResponse) => Promise<{
|
|
8
|
+
type: string | null;
|
|
9
|
+
ext: string | false;
|
|
10
|
+
}>;
|
|
11
|
+
declare function downloadFile(url: string, Token: string): Promise<{
|
|
12
|
+
buffer: Buffer;
|
|
13
|
+
extension: string;
|
|
14
|
+
}>;
|
|
15
|
+
export { downloadFile, fileTypeFromFile };
|
|
16
|
+
//# sourceMappingURL=downloadFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadFile.d.ts","sourceRoot":"","sources":["../../src/utils/downloadFile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAG1C;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,GAAU,UAAU,aAAa,KAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,CAO7G,CAAA;AAED,iBAAe,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBtG;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getMediaUrl } from './mediaUrl';
|
|
2
|
+
export { downloadFile, fileTypeFromFile } from './downloadFile';
|
|
3
|
+
export { processIncomingMessage } from './processIncomingMsg';
|
|
4
|
+
export { getProfile } from './profile';
|
|
5
|
+
export { parseMetaNumber } from './number';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaUrl.d.ts","sourceRoot":"","sources":["../../src/utils/mediaUrl.ts"],"names":[],"mappings":"AAKA,iBAAe,WAAW,CACtB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAe7B;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/utils/number.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,MAMhD,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Message, ParamsIncomingMessage as ParamsIncomingMessage } from '../types';
|
|
2
|
+
export declare const processIncomingMessage: ({ messageId, messageTimestamp, pushName, message, to, jwtToken, version, numberId, fileData, }: ParamsIncomingMessage) => Promise<Message>;
|
|
3
|
+
//# sourceMappingURL=processIncomingMsg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processIncomingMsg.d.ts","sourceRoot":"","sources":["../../src/utils/processIncomingMsg.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEvF,eAAO,MAAM,sBAAsB,GAAU,gGAU1C,qBAAqB,KAAG,OAAO,CAAC,OAAO,CA2KzC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,iBAAe,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAUpG;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@builderbot/provider-evolution-api",
|
|
3
|
+
"version": "1.2.7",
|
|
4
|
+
"description": "> TODO: description",
|
|
5
|
+
"author": "aurik3 <aurik3@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/aurik3/bot-whatsapp#readme",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "dist/index.cjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"directories": {
|
|
18
|
+
"src": "src",
|
|
19
|
+
"test": "__tests__"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"./dist/"
|
|
23
|
+
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/aurik3/bot-whatsapp.git"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "rimraf dist && rollup --config",
|
|
30
|
+
"test": "jest",
|
|
31
|
+
"test:coverage": "jest --coverage",
|
|
32
|
+
"test:watch": "jest --watchAll --coverage"
|
|
33
|
+
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/aurik3/bot-whatsapp/issues"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"axios": "^1.6.8",
|
|
39
|
+
"body-parser": "^1.20.2",
|
|
40
|
+
"file-type": "^19.0.0",
|
|
41
|
+
"form-data": "^4.0.0",
|
|
42
|
+
"mime-types": "^2.1.35",
|
|
43
|
+
"polka": "^0.5.2",
|
|
44
|
+
"queue-promise": "^2.2.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@builderbot/bot": "workspace:^",
|
|
48
|
+
"@jest/globals": "^29.7.0",
|
|
49
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
50
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
51
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
52
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
53
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
54
|
+
"@rollup/pluginutils": "^5.1.4",
|
|
55
|
+
"@types/cors": "^2.8.17",
|
|
56
|
+
"@types/jest": "^29.5.12",
|
|
57
|
+
"@types/node": "^20.11.0",
|
|
58
|
+
"@types/polka": "^0.5.7",
|
|
59
|
+
"@types/sinon": "^17.0.3",
|
|
60
|
+
"cors": "^2.8.5",
|
|
61
|
+
"jest": "^29.7.0",
|
|
62
|
+
"kleur": "^4.1.5",
|
|
63
|
+
"proxyquire": "^2.1.3",
|
|
64
|
+
"rimraf": "^3.0.2",
|
|
65
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
66
|
+
"sinon": "^17.0.1",
|
|
67
|
+
"supertest": "^6.3.4",
|
|
68
|
+
"ts-jest": "^29.1.2",
|
|
69
|
+
"tslib": "^2.6.2",
|
|
70
|
+
"tsm": "^2.3.0"
|
|
71
|
+
},
|
|
72
|
+
"gitHead": "f21e49621dffad2a1226aecea535668016f07b14"
|
|
73
|
+
}
|