@hailer/app-sdk 2.0.0-beta-15 → 2.0.0-beta-17
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/lib/app-sdk.js +2 -2
- package/lib/app-sdk.js.map +4 -4
- package/lib/hailer-api.d.ts +4 -0
- package/lib/modules/activity.d.ts +18 -1
- package/lib/modules/admin.d.ts +21 -1
- package/lib/modules/file.d.ts +38 -0
- package/lib/modules/network.d.ts +14 -0
- package/lib/modules/process.d.ts +38 -0
- package/lib/modules/product-installed.d.ts +40 -0
- package/lib/modules/product-version.d.ts +38 -0
- package/lib/modules/public/product-version.d.ts +16 -0
- package/lib/modules/public/version.d.ts +16 -0
- package/lib/modules/team.d.ts +18 -0
- package/lib/modules/ui/activity.d.ts +4 -0
- package/lib/modules/ui/files.d.ts +20 -8
- package/lib/modules/version.d.ts +16 -0
- package/lib/src/constants.d.ts +7 -0
- package/lib/src/hailer-api.d.ts +92 -0
- package/lib/src/index.d.ts +2 -0
- package/lib/src/modules/activity/kanban.d.ts +36 -0
- package/lib/src/modules/activity.d.ts +83 -0
- package/lib/src/modules/app.d.ts +12 -0
- package/lib/src/modules/insight.d.ts +36 -0
- package/lib/src/modules/network.d.ts +14 -0
- package/lib/src/modules/permission.d.ts +9 -0
- package/lib/src/modules/process.d.ts +38 -0
- package/lib/src/modules/product-installed.d.ts +40 -0
- package/lib/src/modules/product-version.d.ts +16 -0
- package/lib/src/modules/product.d.ts +104 -0
- package/lib/src/modules/public/app.d.ts +17 -0
- package/lib/src/modules/public/form.d.ts +31 -0
- package/lib/src/modules/public/insight.d.ts +30 -0
- package/lib/src/modules/public/product-version.d.ts +16 -0
- package/lib/src/modules/public/product.d.ts +27 -0
- package/lib/src/modules/public.d.ts +22 -0
- package/lib/src/modules/ui/activity.d.ts +30 -0
- package/lib/src/modules/ui/files.d.ts +18 -0
- package/lib/src/modules/ui/snackbar.d.ts +18 -0
- package/lib/src/modules/ui.d.ts +17 -0
- package/lib/src/modules/user.d.ts +36 -0
- package/lib/src/modules/workflow.d.ts +24 -0
- package/lib/src/types.d.ts +381 -0
- package/lib/types.d.ts +101 -0
- package/lib/version.d.ts +0 -0
- package/package.json +1 -1
- package/lib/tools/minimal-password-prompt.d.ts +0 -1
- package/lib/tools/minimal-password-prompt.js +0 -50
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
export interface User {
|
|
2
|
+
_id: string;
|
|
3
|
+
firstname: string;
|
|
4
|
+
lastname: string;
|
|
5
|
+
email: string;
|
|
6
|
+
lastSeen: number;
|
|
7
|
+
status?: string;
|
|
8
|
+
managedUser?: boolean;
|
|
9
|
+
removed?: number;
|
|
10
|
+
defaultProfilepic: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Workspace {
|
|
13
|
+
_id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
members: string[];
|
|
16
|
+
settings: {
|
|
17
|
+
isolatedTeams?: boolean;
|
|
18
|
+
defaultView: string;
|
|
19
|
+
functionFieldVersion?: 1 | 2;
|
|
20
|
+
color?: string;
|
|
21
|
+
allowPublicCopy?: boolean;
|
|
22
|
+
};
|
|
23
|
+
license: object;
|
|
24
|
+
invoicing?: any;
|
|
25
|
+
propertyFields?: {
|
|
26
|
+
[section: string]: {
|
|
27
|
+
[field: string]: any;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface Activity {
|
|
32
|
+
_id: string;
|
|
33
|
+
process: string;
|
|
34
|
+
teamAccount: TeamAccount;
|
|
35
|
+
created: number;
|
|
36
|
+
uid: string;
|
|
37
|
+
cid: string;
|
|
38
|
+
discussion: string;
|
|
39
|
+
currentPhase: string;
|
|
40
|
+
active?: boolean;
|
|
41
|
+
history?: any[];
|
|
42
|
+
name?: string;
|
|
43
|
+
followers?: string[];
|
|
44
|
+
completePhases?: string[];
|
|
45
|
+
location?: {
|
|
46
|
+
type: 'point' | 'area' | 'polyline';
|
|
47
|
+
label: string | null;
|
|
48
|
+
data: {
|
|
49
|
+
lat: number;
|
|
50
|
+
lng: number;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
fields?: any;
|
|
54
|
+
files?: any[];
|
|
55
|
+
updated?: number;
|
|
56
|
+
updatedBy?: string;
|
|
57
|
+
priority?: number;
|
|
58
|
+
sequence?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface TeamAccount {
|
|
61
|
+
account: string;
|
|
62
|
+
team: string;
|
|
63
|
+
}
|
|
64
|
+
export interface FormsData {
|
|
65
|
+
files: string[];
|
|
66
|
+
history: {
|
|
67
|
+
0: {
|
|
68
|
+
[fieldId: string]: {
|
|
69
|
+
value: any;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
name: string;
|
|
74
|
+
location?: boolean;
|
|
75
|
+
uid?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface FormsResponse {
|
|
78
|
+
name: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
enableUnlinkedMode: boolean;
|
|
81
|
+
enableAttachments: boolean;
|
|
82
|
+
enableMapLocation: boolean;
|
|
83
|
+
locationRequired: 1;
|
|
84
|
+
phases: {
|
|
85
|
+
_id: string;
|
|
86
|
+
followers: [];
|
|
87
|
+
name: string;
|
|
88
|
+
description: string;
|
|
89
|
+
uid: string;
|
|
90
|
+
created: number;
|
|
91
|
+
fields: string[];
|
|
92
|
+
announcementFields: [];
|
|
93
|
+
announcementRecipients: [];
|
|
94
|
+
announcementFieldsOrder: [];
|
|
95
|
+
isEndpoint: boolean;
|
|
96
|
+
}[];
|
|
97
|
+
phasesOrder: string[];
|
|
98
|
+
fields: {
|
|
99
|
+
[id: string]: {
|
|
100
|
+
data: [];
|
|
101
|
+
label: string;
|
|
102
|
+
required: boolean;
|
|
103
|
+
type: string;
|
|
104
|
+
inviteToDiscussionOnChange: boolean;
|
|
105
|
+
_id: string;
|
|
106
|
+
created: number;
|
|
107
|
+
updated: number;
|
|
108
|
+
uid: string;
|
|
109
|
+
functionEnabled: boolean;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
enableMessenger: boolean;
|
|
113
|
+
publicForm: {
|
|
114
|
+
enableMessaging: boolean;
|
|
115
|
+
};
|
|
116
|
+
fieldsOrder: [];
|
|
117
|
+
}
|
|
118
|
+
export interface FormCreateResponse {
|
|
119
|
+
key: string;
|
|
120
|
+
creator: string;
|
|
121
|
+
followers: string;
|
|
122
|
+
active: boolean;
|
|
123
|
+
enableMessaging: boolean;
|
|
124
|
+
allowRead: boolean;
|
|
125
|
+
}
|
|
126
|
+
export interface InsightResponse {
|
|
127
|
+
insight: {
|
|
128
|
+
name: string;
|
|
129
|
+
};
|
|
130
|
+
data: InsightResponseData;
|
|
131
|
+
}
|
|
132
|
+
export interface InsightResponseData {
|
|
133
|
+
headers: string[];
|
|
134
|
+
rows: [];
|
|
135
|
+
time: number;
|
|
136
|
+
}
|
|
137
|
+
export interface HailerAppConfig {
|
|
138
|
+
fields?: {
|
|
139
|
+
[fieldName: string]: {
|
|
140
|
+
type: string;
|
|
141
|
+
value?: string | number | boolean;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export type HailerProcess = Workflow;
|
|
146
|
+
export interface Workflow {
|
|
147
|
+
_id: string;
|
|
148
|
+
cid: string;
|
|
149
|
+
name: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
fields: {
|
|
152
|
+
[fieldId: string]: any;
|
|
153
|
+
};
|
|
154
|
+
phases: {
|
|
155
|
+
[phase_id: string]: WorkflowPhase;
|
|
156
|
+
};
|
|
157
|
+
phasesOrder: string[];
|
|
158
|
+
enablePredefinedName?: boolean;
|
|
159
|
+
nameFunctionEnabled?: boolean;
|
|
160
|
+
nameEditable?: boolean;
|
|
161
|
+
productInstalledId: string;
|
|
162
|
+
}
|
|
163
|
+
export interface WorkflowPhase {
|
|
164
|
+
_id: string;
|
|
165
|
+
name: string;
|
|
166
|
+
description?: string;
|
|
167
|
+
fields?: string[];
|
|
168
|
+
}
|
|
169
|
+
export type PermissionType = 'admin' | 'own' | 'ownteam' | 'any' | 'edit';
|
|
170
|
+
export interface Member {
|
|
171
|
+
id: string;
|
|
172
|
+
info: {
|
|
173
|
+
[key: string]: string | number | boolean | null;
|
|
174
|
+
};
|
|
175
|
+
permissions: PermissionType[];
|
|
176
|
+
}
|
|
177
|
+
export interface InsightWorkflowSource {
|
|
178
|
+
name: string;
|
|
179
|
+
workflowId: string;
|
|
180
|
+
fields: {
|
|
181
|
+
name: string;
|
|
182
|
+
fieldId?: string;
|
|
183
|
+
/** Used for phaseLastMove meta */
|
|
184
|
+
phaseId?: string;
|
|
185
|
+
/** Activity information, like _id, created, phaseId etc. */
|
|
186
|
+
meta?: string;
|
|
187
|
+
}[];
|
|
188
|
+
}
|
|
189
|
+
export interface InsightDoc {
|
|
190
|
+
_id: string;
|
|
191
|
+
name: string;
|
|
192
|
+
sources: InsightWorkflowSource[];
|
|
193
|
+
cid: string;
|
|
194
|
+
/** User id of creator */
|
|
195
|
+
uid: string;
|
|
196
|
+
members: Member[];
|
|
197
|
+
updated: number;
|
|
198
|
+
public: boolean;
|
|
199
|
+
/** Key for accessing Insight when set to public */
|
|
200
|
+
publicKey?: string;
|
|
201
|
+
/** sandboxed javascript with access to all activities in given workflows */
|
|
202
|
+
function?: string;
|
|
203
|
+
/** To be used with SQLite if we want to.... */
|
|
204
|
+
query?: string;
|
|
205
|
+
presets: {
|
|
206
|
+
version: 1;
|
|
207
|
+
name: string | 'default';
|
|
208
|
+
options: any;
|
|
209
|
+
}[];
|
|
210
|
+
}
|
|
211
|
+
export type InsightPublic = Omit<InsightDoc, '_id'>;
|
|
212
|
+
export interface InsightData {
|
|
213
|
+
headers: string[];
|
|
214
|
+
rows: (string | number | null)[][];
|
|
215
|
+
time: number;
|
|
216
|
+
}
|
|
217
|
+
export interface InsightResponseAsObjectItem {
|
|
218
|
+
[key: string]: any;
|
|
219
|
+
}
|
|
220
|
+
export type InsightResponseAsObjects = InsightResponseAsObjectItem[];
|
|
221
|
+
export interface KanbanListResponse {
|
|
222
|
+
map: {
|
|
223
|
+
[phaseId: string]: {
|
|
224
|
+
activities: {
|
|
225
|
+
_id: string;
|
|
226
|
+
followers: string[];
|
|
227
|
+
name: string;
|
|
228
|
+
fields: {
|
|
229
|
+
[key: string]: any;
|
|
230
|
+
};
|
|
231
|
+
files: string[];
|
|
232
|
+
primaryDateField: number;
|
|
233
|
+
priority: number;
|
|
234
|
+
}[];
|
|
235
|
+
meta: {
|
|
236
|
+
count: number;
|
|
237
|
+
totalPrimaryNumericValue: number;
|
|
238
|
+
primaryNumericFieldUnit: string | null;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
export interface KanbanLoadResponse {
|
|
244
|
+
activity: {
|
|
245
|
+
_id: string;
|
|
246
|
+
followers: string[];
|
|
247
|
+
name: string;
|
|
248
|
+
fields: {
|
|
249
|
+
[key: string]: any;
|
|
250
|
+
};
|
|
251
|
+
files: string[];
|
|
252
|
+
primaryDateField: number | null;
|
|
253
|
+
priority: number;
|
|
254
|
+
linkedFromCount: number;
|
|
255
|
+
};
|
|
256
|
+
process: string;
|
|
257
|
+
phase: string;
|
|
258
|
+
}
|
|
259
|
+
export interface ActivityListOptions {
|
|
260
|
+
sortBy?: 'name' | 'created' | 'updated' | 'following' | 'owner' | 'team' | 'completedOn' | 'priority';
|
|
261
|
+
sortOrder?: 'asc' | 'desc';
|
|
262
|
+
limit?: number;
|
|
263
|
+
skip?: number;
|
|
264
|
+
includeUsers?: boolean;
|
|
265
|
+
includeTeams?: boolean;
|
|
266
|
+
includeHistory?: boolean;
|
|
267
|
+
filters?: any;
|
|
268
|
+
}
|
|
269
|
+
export interface ActivityCreateOptions {
|
|
270
|
+
teamId?: string;
|
|
271
|
+
fileIds?: string[];
|
|
272
|
+
followerIds?: string[];
|
|
273
|
+
location?: {
|
|
274
|
+
label?: string;
|
|
275
|
+
type: 'area' | 'point' | 'polyline';
|
|
276
|
+
data: [{
|
|
277
|
+
lat: number;
|
|
278
|
+
lng: number;
|
|
279
|
+
}];
|
|
280
|
+
};
|
|
281
|
+
discussionId?: string;
|
|
282
|
+
phaseId?: string;
|
|
283
|
+
returnDocument?: boolean;
|
|
284
|
+
}
|
|
285
|
+
export interface ActivityKanbanListOptions {
|
|
286
|
+
filter: {
|
|
287
|
+
user?: {
|
|
288
|
+
uid: string;
|
|
289
|
+
field: string;
|
|
290
|
+
};
|
|
291
|
+
account?: string;
|
|
292
|
+
team?: string;
|
|
293
|
+
dates?: {
|
|
294
|
+
field: string;
|
|
295
|
+
start: number;
|
|
296
|
+
end: number;
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
search?: string;
|
|
300
|
+
limit?: number;
|
|
301
|
+
skip?: number;
|
|
302
|
+
phase?: string;
|
|
303
|
+
includeUsers?: boolean;
|
|
304
|
+
includeTeams?: boolean;
|
|
305
|
+
}
|
|
306
|
+
export interface HailerSettings {
|
|
307
|
+
theme: 'light' | 'dark';
|
|
308
|
+
preferredLanguages: string[];
|
|
309
|
+
}
|
|
310
|
+
export interface HailerError {
|
|
311
|
+
code: number;
|
|
312
|
+
msg: string;
|
|
313
|
+
debug: object;
|
|
314
|
+
}
|
|
315
|
+
export interface HailerApiInfo {
|
|
316
|
+
/** Url of the Hailer instance hosting the API */
|
|
317
|
+
hostUrl?: string;
|
|
318
|
+
config?: HailerAppConfig;
|
|
319
|
+
outside: boolean | null;
|
|
320
|
+
workspaceId?: string;
|
|
321
|
+
}
|
|
322
|
+
export declare class HailerError extends Error {
|
|
323
|
+
code: number;
|
|
324
|
+
msg: string;
|
|
325
|
+
debug: object;
|
|
326
|
+
constructor(error: {
|
|
327
|
+
code: number;
|
|
328
|
+
msg: string;
|
|
329
|
+
debug: object;
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
export interface HailerSignal {
|
|
333
|
+
sig: string;
|
|
334
|
+
meta: any;
|
|
335
|
+
}
|
|
336
|
+
export interface Product extends ProductType {
|
|
337
|
+
_id: string;
|
|
338
|
+
versionId: string;
|
|
339
|
+
name: string;
|
|
340
|
+
header?: string;
|
|
341
|
+
description?: string;
|
|
342
|
+
icon?: string;
|
|
343
|
+
images?: string[];
|
|
344
|
+
externalUrl?: string;
|
|
345
|
+
publisher?: string;
|
|
346
|
+
/** Available or not in app store */
|
|
347
|
+
public?: boolean;
|
|
348
|
+
cid?: string;
|
|
349
|
+
}
|
|
350
|
+
export interface ProductSearchOption {
|
|
351
|
+
limit?: number;
|
|
352
|
+
skip?: number;
|
|
353
|
+
search?: string;
|
|
354
|
+
reverse?: boolean;
|
|
355
|
+
sortBy?: 'name' | 'created' | 'updated' | 'type';
|
|
356
|
+
sortOrder?: 'asc' | 'desc';
|
|
357
|
+
}
|
|
358
|
+
export interface ProductSearchFilter extends ProductType {
|
|
359
|
+
public?: boolean;
|
|
360
|
+
cid?: string;
|
|
361
|
+
uid?: string;
|
|
362
|
+
}
|
|
363
|
+
export interface ProductType {
|
|
364
|
+
type?: 'app' | 'template' | 'document-template';
|
|
365
|
+
}
|
|
366
|
+
export interface ProductVersion {
|
|
367
|
+
_id: string;
|
|
368
|
+
name: string;
|
|
369
|
+
versions?: {
|
|
370
|
+
version: string;
|
|
371
|
+
description: string;
|
|
372
|
+
packageHash: string;
|
|
373
|
+
}[];
|
|
374
|
+
cid?: string;
|
|
375
|
+
}
|
|
376
|
+
export interface ProductInstalled {
|
|
377
|
+
_id: string;
|
|
378
|
+
productId: string;
|
|
379
|
+
versionId: string;
|
|
380
|
+
version: string;
|
|
381
|
+
}
|
package/lib/types.d.ts
CHANGED
|
@@ -7,6 +7,13 @@ export interface Workspace {
|
|
|
7
7
|
_id: string;
|
|
8
8
|
name: string;
|
|
9
9
|
}
|
|
10
|
+
export interface Team {
|
|
11
|
+
_id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TeamsByWorkspace {
|
|
15
|
+
[workspaceId: string]: Team[];
|
|
16
|
+
}
|
|
10
17
|
export interface ActivityFieldRange {
|
|
11
18
|
start: number;
|
|
12
19
|
end: number;
|
|
@@ -151,6 +158,11 @@ export interface WorkflowField {
|
|
|
151
158
|
[key: string]: any;
|
|
152
159
|
};
|
|
153
160
|
}
|
|
161
|
+
export interface DocumentTemplate {
|
|
162
|
+
templateId?: string;
|
|
163
|
+
name: string;
|
|
164
|
+
order?: number;
|
|
165
|
+
}
|
|
154
166
|
export interface Workflow {
|
|
155
167
|
_id: string;
|
|
156
168
|
name: string;
|
|
@@ -168,6 +180,7 @@ export interface Workflow {
|
|
|
168
180
|
nameEditable?: boolean;
|
|
169
181
|
productInstalledId: string;
|
|
170
182
|
workspaceId: string;
|
|
183
|
+
documentTemplates?: DocumentTemplate[];
|
|
171
184
|
}
|
|
172
185
|
export interface WorkflowPhase {
|
|
173
186
|
_id: string;
|
|
@@ -373,6 +386,21 @@ export interface ActivityKanbanListOptions {
|
|
|
373
386
|
includeUsers?: boolean;
|
|
374
387
|
includeTeams?: boolean;
|
|
375
388
|
}
|
|
389
|
+
export interface PrintRequest {
|
|
390
|
+
activityId: string;
|
|
391
|
+
/** Template ID for regular templates */
|
|
392
|
+
templateId?: string;
|
|
393
|
+
/** Template name for multi-pdf templates (when templateId is empty) */
|
|
394
|
+
templateName?: string;
|
|
395
|
+
/** Whether to save the PDF to the file system */
|
|
396
|
+
savePdf?: boolean;
|
|
397
|
+
}
|
|
398
|
+
export interface PrintResponse {
|
|
399
|
+
filename: string;
|
|
400
|
+
/** Base64-encoded document data */
|
|
401
|
+
data: string;
|
|
402
|
+
mimeType: string;
|
|
403
|
+
}
|
|
376
404
|
export interface Settings {
|
|
377
405
|
theme: 'light' | 'dark';
|
|
378
406
|
preferredLanguages: string[];
|
|
@@ -1035,4 +1063,77 @@ export interface StripeTaxCalculationResponse {
|
|
|
1035
1063
|
currency: string;
|
|
1036
1064
|
lineItems: StripeTaxLineItemResult[];
|
|
1037
1065
|
}
|
|
1066
|
+
export interface AdminReferralCode {
|
|
1067
|
+
_id: string;
|
|
1068
|
+
code: string;
|
|
1069
|
+
uid: string;
|
|
1070
|
+
cid: string;
|
|
1071
|
+
ownerEmail?: string;
|
|
1072
|
+
workspaceName?: string;
|
|
1073
|
+
bonusTokens: number;
|
|
1074
|
+
isActive: boolean;
|
|
1075
|
+
totalReferrals: number;
|
|
1076
|
+
totalTokensAwarded: number;
|
|
1077
|
+
created: number;
|
|
1078
|
+
}
|
|
1079
|
+
export interface AdminReferralCodeListRequest {
|
|
1080
|
+
filter?: {
|
|
1081
|
+
isActive?: boolean;
|
|
1082
|
+
cid?: string;
|
|
1083
|
+
};
|
|
1084
|
+
options?: {
|
|
1085
|
+
search?: string;
|
|
1086
|
+
limit?: number;
|
|
1087
|
+
skip?: number;
|
|
1088
|
+
sortBy?: string;
|
|
1089
|
+
sortOrder?: 'asc' | 'desc';
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
export interface AdminReferralCodeListResponse {
|
|
1093
|
+
codes: AdminReferralCode[];
|
|
1094
|
+
totalCount: number;
|
|
1095
|
+
stats: {
|
|
1096
|
+
activeCount: number;
|
|
1097
|
+
totalReferrals: number;
|
|
1098
|
+
totalTokensAwarded: number;
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
export interface AdminReferralEvent {
|
|
1102
|
+
_id: string;
|
|
1103
|
+
referralCodeId: string;
|
|
1104
|
+
referralCode: string;
|
|
1105
|
+
referrerUid: string;
|
|
1106
|
+
referrerCid: string;
|
|
1107
|
+
refereeUid: string;
|
|
1108
|
+
refereeCid: string;
|
|
1109
|
+
refereeEmail?: string;
|
|
1110
|
+
refereeWorkspaceName?: string;
|
|
1111
|
+
status: 'pending' | 'completed' | 'failed';
|
|
1112
|
+
bonusTokensAwarded: number;
|
|
1113
|
+
failureReason?: string;
|
|
1114
|
+
created: number;
|
|
1115
|
+
completedAt?: number;
|
|
1116
|
+
}
|
|
1117
|
+
export interface AdminReferralEventListRequest {
|
|
1118
|
+
filter?: {
|
|
1119
|
+
referralCodeId?: string;
|
|
1120
|
+
referrerCid?: string;
|
|
1121
|
+
status?: 'pending' | 'completed' | 'failed';
|
|
1122
|
+
};
|
|
1123
|
+
options?: {
|
|
1124
|
+
limit?: number;
|
|
1125
|
+
skip?: number;
|
|
1126
|
+
sortBy?: string;
|
|
1127
|
+
sortOrder?: 'asc' | 'desc';
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
export interface AdminReferralEventListResponse {
|
|
1131
|
+
events: AdminReferralEvent[];
|
|
1132
|
+
totalCount: number;
|
|
1133
|
+
stats: {
|
|
1134
|
+
completedCount: number;
|
|
1135
|
+
pendingCount: number;
|
|
1136
|
+
totalTokensAwarded: number;
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1038
1139
|
export {};
|
package/lib/version.d.ts
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const prompt: (question: string, ctrlcExits?: boolean) => Promise<string>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Re-written to TypeScript to fix typing issue, see: https://www.npmjs.com/package/minimal-password-prompt/v/1.1.0
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.prompt = void 0;
|
|
5
|
-
const stdin = process.stdin;
|
|
6
|
-
const stdout = process.stdout;
|
|
7
|
-
const captureStdin = (onData) => {
|
|
8
|
-
stdin.setEncoding('utf-8');
|
|
9
|
-
stdin.setRawMode(true);
|
|
10
|
-
stdin.on('data', onData);
|
|
11
|
-
stdin.resume();
|
|
12
|
-
};
|
|
13
|
-
const releaseStdin = (onData) => {
|
|
14
|
-
stdin.pause();
|
|
15
|
-
stdin.removeListener('data', onData);
|
|
16
|
-
stdin.setRawMode(false);
|
|
17
|
-
stdout.write('\n');
|
|
18
|
-
};
|
|
19
|
-
const prompt = (question, ctrlcExits = true) => (new Promise((resolve, reject) => {
|
|
20
|
-
let input = '';
|
|
21
|
-
const onData = (data) => {
|
|
22
|
-
switch (data) {
|
|
23
|
-
case '\u000A': // \n
|
|
24
|
-
case '\u000D': // \r
|
|
25
|
-
case '\u0004': // Ctrl+D
|
|
26
|
-
releaseStdin(onData);
|
|
27
|
-
resolve(input);
|
|
28
|
-
break;
|
|
29
|
-
case '\u0003': // Ctrl+C
|
|
30
|
-
releaseStdin(onData);
|
|
31
|
-
if (ctrlcExits) { // exit or raise error
|
|
32
|
-
process.exit();
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
reject(new Error('Ctrl+C'));
|
|
36
|
-
}
|
|
37
|
-
break;
|
|
38
|
-
case '\u0008': // Backspace
|
|
39
|
-
case '\u007F': // Delete
|
|
40
|
-
input = input.slice(0, -1);
|
|
41
|
-
break;
|
|
42
|
-
default: // any other
|
|
43
|
-
input += data;
|
|
44
|
-
}
|
|
45
|
-
;
|
|
46
|
-
};
|
|
47
|
-
captureStdin(onData);
|
|
48
|
-
stdout.write(question);
|
|
49
|
-
}));
|
|
50
|
-
exports.prompt = prompt;
|