@hailer/app-sdk 1.0.3 → 2.0.0-beta-1

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.
Files changed (48) hide show
  1. package/lib/app-sdk.js +2 -1
  2. package/lib/app-sdk.js.map +4 -4
  3. package/lib/constants.d.ts +0 -1
  4. package/lib/hailer-api.d.ts +4 -20
  5. package/lib/modules/activity.d.ts +6 -19
  6. package/lib/modules/app.d.ts +4 -2
  7. package/lib/modules/insight.d.ts +0 -1
  8. package/lib/modules/permission.d.ts +2 -1
  9. package/lib/modules/public/app.d.ts +2 -2
  10. package/lib/modules/team.d.ts +17 -0
  11. package/lib/modules/user.d.ts +1 -3
  12. package/lib/modules/workflow.d.ts +14 -2
  13. package/lib/tools/replace-private.d.ts +1 -0
  14. package/lib/tools/replace-private.js +33 -0
  15. package/lib/types.d.ts +131 -42
  16. package/package.json +1 -1
  17. package/lib/modules/product-installed.d.ts +0 -40
  18. package/lib/modules/product-version.d.ts +0 -38
  19. package/lib/modules/public/product-version.d.ts +0 -16
  20. package/lib/modules/public/version.d.ts +0 -16
  21. package/lib/modules/version.d.ts +0 -16
  22. package/lib/src/constants.d.ts +0 -7
  23. package/lib/src/hailer-api.d.ts +0 -92
  24. package/lib/src/index.d.ts +0 -2
  25. package/lib/src/modules/activity/kanban.d.ts +0 -36
  26. package/lib/src/modules/activity.d.ts +0 -83
  27. package/lib/src/modules/app.d.ts +0 -12
  28. package/lib/src/modules/insight.d.ts +0 -36
  29. package/lib/src/modules/network.d.ts +0 -14
  30. package/lib/src/modules/permission.d.ts +0 -9
  31. package/lib/src/modules/process.d.ts +0 -38
  32. package/lib/src/modules/product-installed.d.ts +0 -40
  33. package/lib/src/modules/product-version.d.ts +0 -16
  34. package/lib/src/modules/product.d.ts +0 -104
  35. package/lib/src/modules/public/app.d.ts +0 -17
  36. package/lib/src/modules/public/form.d.ts +0 -31
  37. package/lib/src/modules/public/insight.d.ts +0 -30
  38. package/lib/src/modules/public/product-version.d.ts +0 -16
  39. package/lib/src/modules/public/product.d.ts +0 -27
  40. package/lib/src/modules/public.d.ts +0 -22
  41. package/lib/src/modules/ui/activity.d.ts +0 -30
  42. package/lib/src/modules/ui/files.d.ts +0 -18
  43. package/lib/src/modules/ui/snackbar.d.ts +0 -18
  44. package/lib/src/modules/ui.d.ts +0 -17
  45. package/lib/src/modules/user.d.ts +0 -36
  46. package/lib/src/modules/workflow.d.ts +0 -24
  47. package/lib/src/types.d.ts +0 -381
  48. package/lib/version.d.ts +0 -0
@@ -1,30 +0,0 @@
1
- import { Client } from '@wishcore/wish-rpc';
2
- export type ActivityTabTypes = 'detail' | 'discussion' | 'files' | 'location' | 'linkedFrom' | 'options';
3
- export declare class Activity {
4
- private client;
5
- constructor(client: Client);
6
- /** Opens an activity in Hailer sidebar */
7
- open(
8
- /** Hailer Activity Id */
9
- activityId: string, options?: {
10
- /** Which tab to open in activity aside */
11
- tab?: ActivityTabTypes;
12
- }): Promise<void>;
13
- /** Opens activity creation view in Hailer sidebar */
14
- create(processId: string, options?: {
15
- /** Activity name/title */
16
- name?: string;
17
- /** Prepopulate fields */
18
- fields?: {
19
- [fieldId: string]: number | string | {
20
- start: number;
21
- end: number;
22
- };
23
- };
24
- }): Promise<{
25
- _id: string;
26
- name: string;
27
- } | null>;
28
- /** Opens multiple activity edit view in Hailer sidebar */
29
- editMultiple(activityIds: string[]): Promise<any>;
30
- }
@@ -1,18 +0,0 @@
1
- import { Client } from '@wishcore/wish-rpc';
2
- export declare class Files {
3
- private client;
4
- constructor(client: Client);
5
- /**
6
- * Uploads a file to Hailer
7
- *
8
- * @param file file to be uploaded
9
- * @param publicFile is the file accessible outside of Hailer
10
- * @param options if file is public
11
- *
12
- * @returns File ID in Hailer as string
13
- */
14
- uploadFile(file: File, filename: string, options: {
15
- isPublic?: boolean;
16
- }): Promise<string>;
17
- private toBase64;
18
- }
@@ -1,18 +0,0 @@
1
- import { Client } from '@wishcore/wish-rpc';
2
- export declare class Snackbar {
3
- private client;
4
- constructor(client: Client);
5
- /**
6
- * Opens a snackbar in Hailer
7
- * @param text the text displayed on the snackbar
8
- * @param buttonLabel the label for the button on the snackbar, for example 'OK'
9
- * @param duration the time the snackbar is visible in ms
10
- */
11
- open(
12
- /** The text displayed on the snackbar */
13
- text: string,
14
- /** The label for the button on the snackbar, for example 'OK' */
15
- buttonLabel: string,
16
- /** The time the snackbar is visible in ms */
17
- duration?: number): Promise<void>;
18
- }
@@ -1,17 +0,0 @@
1
- import { Client } from '@wishcore/wish-rpc';
2
- import { Activity } from './ui/activity';
3
- import { Snackbar } from './ui/snackbar';
4
- import { Files } from './ui/files';
5
- export declare class Ui {
6
- private client;
7
- activity: Activity;
8
- snackbar: Snackbar;
9
- files: Files;
10
- insight: {
11
- create: (workspaceId?: string) => Promise<void>;
12
- edit: (insightId: string) => Promise<void>;
13
- delete: (insightId: string) => Promise<void>;
14
- permission: (insightId: string) => Promise<void>;
15
- };
16
- constructor(client: Client);
17
- }
@@ -1,36 +0,0 @@
1
- import { Client } from '@wishcore/wish-rpc';
2
- import { User } from '../types';
3
- export declare class UserApi {
4
- private client;
5
- constructor(client: Client);
6
- /**
7
- * Returns the specified user
8
- *
9
- * @param userId id of the Hailer user
10
- *
11
- * @returns Hailer user information
12
- *
13
- * @throws {HailerError} if request is incorrect
14
- */
15
- get(userId: string): Promise<User>;
16
- /**
17
- * Returns the current user
18
- *
19
- *
20
- * @returns the current Hailer user information
21
- *
22
- * @throws {HailerError} if request is incorrect
23
- */
24
- current(): Promise<User>;
25
- /**
26
- * Lists all Hailer users from a workspace
27
- *
28
- *
29
- * @returns list of Hailer users in the workspace the app user is currently in
30
- *
31
- * @throws {HailerError} if request is incorrect
32
- */
33
- list(): Promise<{
34
- [key: string]: User;
35
- }>;
36
- }
@@ -1,24 +0,0 @@
1
- import { Client } from '@wishcore/wish-rpc';
2
- import { Workflow } from '../types';
3
- export declare class WorkflowApi {
4
- private client;
5
- constructor(client: Client);
6
- /**
7
- * Lists all processes from a workspace
8
- *
9
- * @returns all Hailer processes in the workspace the app user is currently in
10
- *
11
- * @throws {HailerError} if request is incorrect
12
- */
13
- list(): Promise<Workflow[]>;
14
- /**
15
- * Gets a single process from a workspace
16
- *
17
- * @param processId the id of the process in question
18
- *
19
- * @returns the specified Hailer process
20
- *
21
- * @throws {HailerError} if request is incorrect
22
- */
23
- get(processId: string): Promise<Workflow>;
24
- }
@@ -1,381 +0,0 @@
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/version.d.ts DELETED
File without changes