@suprsend/node-sdk 1.10.0 → 1.11.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.
@@ -0,0 +1,593 @@
1
+ import {
2
+ is_object,
3
+ has_special_char,
4
+ epoch_milliseconds,
5
+ uuid,
6
+ is_empty,
7
+ is_string,
8
+ } from "./utils";
9
+ import ALL_LANG_CODES from "./language_codes";
10
+
11
+ // ---------- Identity keys
12
+ const IDENT_KEY_EMAIL = "$email";
13
+ const IDENT_KEY_SMS = "$sms";
14
+ const IDENT_KEY_ANDROIDPUSH = "$androidpush";
15
+ const IDENT_KEY_IOSPUSH = "$iospush";
16
+ const IDENT_KEY_WHATSAPP = "$whatsapp";
17
+ const IDENT_KEY_WEBPUSH = "$webpush";
18
+ const IDENT_KEY_SLACK = "$slack";
19
+ const IDENT_KEY_MS_TEAMS = "$ms_teams";
20
+
21
+ const IDENT_KEYS_ALL = [
22
+ IDENT_KEY_EMAIL,
23
+ IDENT_KEY_SMS,
24
+ IDENT_KEY_ANDROIDPUSH,
25
+ IDENT_KEY_IOSPUSH,
26
+ IDENT_KEY_WHATSAPP,
27
+ IDENT_KEY_WEBPUSH,
28
+ IDENT_KEY_SLACK,
29
+ IDENT_KEY_MS_TEAMS,
30
+ ];
31
+
32
+ const KEY_PUSHVENDOR = "$pushvendor";
33
+ const KEY_PREFERRED_LANGUAGE = "$preferred_language";
34
+ const KEY_TIMEZONE = "$timezone";
35
+
36
+ const OTHER_RESERVED_KEYS = [
37
+ "$messenger",
38
+ "$inbox",
39
+ KEY_PUSHVENDOR,
40
+ "$device_id",
41
+ "$insert_id",
42
+ "$time",
43
+ "$set",
44
+ "$set_once",
45
+ "$add",
46
+ "$append",
47
+ "$remove",
48
+ "$unset",
49
+ "$identify",
50
+ "$anon_id",
51
+ "$identified_id",
52
+ KEY_PREFERRED_LANGUAGE,
53
+ KEY_TIMEZONE,
54
+ "$notification_delivered",
55
+ "$notification_dismiss",
56
+ "$notification_clicked",
57
+ ];
58
+
59
+ const SUPER_PROPERTY_KEYS = [
60
+ "$app_version_string",
61
+ "$app_build_number",
62
+ "$brand",
63
+ "$carrier",
64
+ "$manufacturer",
65
+ "$model",
66
+ "$os",
67
+ "$ss_sdk_version",
68
+ "$insert_id",
69
+ "$time",
70
+ ];
71
+
72
+ const ALL_RESERVED_KEYS = [
73
+ ...SUPER_PROPERTY_KEYS,
74
+ ...OTHER_RESERVED_KEYS,
75
+ ...IDENT_KEYS_ALL,
76
+ ];
77
+
78
+ export default class _ObjectInternalHelper {
79
+ constructor(object_type, object_id, workspace_key) {
80
+ this.object_type = object_type;
81
+ this.object_id = object_id;
82
+ this.workspace_key = workspace_key;
83
+
84
+ this.__dict_set = {};
85
+
86
+ this.__dict_set_once = {};
87
+
88
+ this.__dict_increment = {};
89
+
90
+ this.__dict_append = {};
91
+
92
+ this.__dict_remove = {};
93
+
94
+ this.__list_unset = [];
95
+
96
+ this.__errors = [];
97
+ this.__info = [];
98
+ }
99
+
100
+ reset() {
101
+ this.__dict_set = {};
102
+ this.__dict_set_once = {};
103
+ this.__dict_increment = {};
104
+ this.__dict_append = {};
105
+ this.__dict_remove = {};
106
+ this.__list_unset = [];
107
+ this.__errors = [];
108
+ this.__info = [];
109
+ }
110
+
111
+ get_identity_events() {
112
+ const payload = this.__form_payload();
113
+ const ret_val = {
114
+ errors: this.__errors,
115
+ info: this.__info,
116
+ payload: payload,
117
+ };
118
+ this.reset();
119
+ return ret_val;
120
+ }
121
+
122
+ __form_payload() {
123
+ const payload = {};
124
+ if (!is_empty(this.__dict_set)) {
125
+ payload["$set"] = this.__dict_set;
126
+ }
127
+ if (!is_empty(this.__dict_set_once)) {
128
+ payload["$set_once"] = this.__dict_set_once;
129
+ }
130
+ if (!is_empty(this.__dict_increment)) {
131
+ payload["$add"] = this.__dict_increment;
132
+ }
133
+ if (!is_empty(this.__dict_append)) {
134
+ payload["$append"] = this.__dict_append;
135
+ }
136
+ if (!is_empty(this.__dict_remove)) {
137
+ payload["$remove"] = this.__dict_remove;
138
+ }
139
+ if (!is_empty(this.__list_unset)) {
140
+ payload["$unset"] = this.__list_unset;
141
+ }
142
+ return payload;
143
+ }
144
+
145
+ __validate_key_basic(key, caller) {
146
+ if (!is_string(key)) {
147
+ this.__info.push(
148
+ `[${caller}] skipping key: ${key}. key must be a string`
149
+ );
150
+ return [key, false];
151
+ }
152
+ key = key.trim();
153
+ if (!key) {
154
+ this.__info.push(`[${caller}] skipping key: empty string`);
155
+ return [key, false];
156
+ }
157
+ return [key, true];
158
+ }
159
+
160
+ __validate_key_prefix(key, caller) {
161
+ if (!ALL_RESERVED_KEYS.includes(key)) {
162
+ if (has_special_char(key)) {
163
+ this.__info.push(
164
+ `[${caller}] skipping key: ${key}. key starting with [$,ss_] are reserved`
165
+ );
166
+ return false;
167
+ }
168
+ }
169
+ return true;
170
+ }
171
+
172
+ __is_identity_key(key) {
173
+ return IDENT_KEYS_ALL.includes(key);
174
+ }
175
+
176
+ _append_kv(key, value, args = {}, caller = "append") {
177
+ const [validated_key, is_k_valid] = this.__validate_key_basic(key, caller);
178
+ if (!is_k_valid) {
179
+ return;
180
+ }
181
+ if (this.__is_identity_key(validated_key)) {
182
+ this.__add_identity(validated_key, value, args, caller);
183
+ } else {
184
+ const is_k_valid = this.__validate_key_prefix(validated_key, caller);
185
+ if (is_k_valid) {
186
+ this.__dict_append[validated_key] = value;
187
+ }
188
+ }
189
+ }
190
+
191
+ _set_kv(key, value, args = {}, caller = "set") {
192
+ const [validated_key, is_k_valid] = this.__validate_key_basic(key, caller);
193
+ if (!is_k_valid) {
194
+ return;
195
+ } else {
196
+ const is_k_valid = this.__validate_key_prefix(validated_key, caller);
197
+ if (is_k_valid) {
198
+ this.__dict_set[validated_key] = value;
199
+ }
200
+ }
201
+ }
202
+
203
+ _set_once_kv(key, value, args = {}, caller = "set_once") {
204
+ const [validated_key, is_k_valid] = this.__validate_key_basic(key, caller);
205
+ if (!is_k_valid) {
206
+ return;
207
+ } else {
208
+ const is_k_valid = this.__validate_key_prefix(validated_key, caller);
209
+ if (is_k_valid) {
210
+ this.__dict_set_once[validated_key] = value;
211
+ }
212
+ }
213
+ }
214
+
215
+ _increment_kv(key, value, args = {}, caller = "increment") {
216
+ const [validated_key, is_k_valid] = this.__validate_key_basic(key, caller);
217
+ if (!is_k_valid) {
218
+ return;
219
+ } else {
220
+ const is_k_valid = this.__validate_key_prefix(validated_key, caller);
221
+ if (is_k_valid) {
222
+ this.__dict_increment[validated_key] = value;
223
+ }
224
+ }
225
+ }
226
+
227
+ _remove_kv(key, value, args = {}, caller = "remove") {
228
+ const [validated_key, is_k_valid] = this.__validate_key_basic(key, caller);
229
+ if (!is_k_valid) {
230
+ return;
231
+ }
232
+ if (this.__is_identity_key(validated_key)) {
233
+ this.__remove_identity(validated_key, value, args, caller);
234
+ } else {
235
+ const is_k_valid = this.__validate_key_prefix(validated_key, caller);
236
+ if (is_k_valid) {
237
+ this.__dict_remove[validated_key] = value;
238
+ }
239
+ }
240
+ }
241
+
242
+ _unset_k(key, caller = "unset") {
243
+ const [validated_key, is_k_valid] = this.__validate_key_basic(key, caller);
244
+ if (!is_k_valid) {
245
+ return;
246
+ }
247
+ this.__list_unset.push(validated_key);
248
+ }
249
+
250
+ _set_preferred_language(lang_code, caller) {
251
+ if (!ALL_LANG_CODES.includes(lang_code)) {
252
+ this.__info.push(`[${caller}] invalid value ${lang_code}`);
253
+ return;
254
+ }
255
+ this.__dict_set[KEY_PREFERRED_LANGUAGE] = lang_code;
256
+ }
257
+
258
+ _set_timezone(timezone, caller) {
259
+ this.__dict_set[KEY_TIMEZONE] = timezone;
260
+ }
261
+
262
+ __add_identity(key, value, args, caller) {
263
+ const new_caller = `${caller}:${key}`;
264
+ switch (key) {
265
+ case IDENT_KEY_EMAIL:
266
+ this._add_email(value, new_caller);
267
+ break;
268
+ case IDENT_KEY_SMS:
269
+ this._add_sms(value, new_caller);
270
+ break;
271
+ case IDENT_KEY_WHATSAPP:
272
+ this._add_whatsapp(value, new_caller);
273
+ break;
274
+ case IDENT_KEY_ANDROIDPUSH:
275
+ this._add_androidpush(value, args[KEY_PUSHVENDOR], new_caller);
276
+ break;
277
+ case IDENT_KEY_IOSPUSH:
278
+ this._add_iospush(value, args[KEY_PUSHVENDOR], new_caller);
279
+ break;
280
+ case IDENT_KEY_WEBPUSH:
281
+ this._add_webpush(value, args[KEY_PUSHVENDOR], new_caller);
282
+ break;
283
+ case IDENT_KEY_SLACK:
284
+ this._add_slack(value, caller);
285
+ break;
286
+ case IDENT_KEY_MS_TEAMS:
287
+ this._add_ms_teams(value, caller);
288
+ break;
289
+ default:
290
+ break;
291
+ }
292
+ }
293
+
294
+ __remove_identity(key, value, args, caller) {
295
+ const new_caller = `${caller}:${key}`;
296
+ switch (key) {
297
+ case IDENT_KEY_EMAIL:
298
+ this._remove_email(value, new_caller);
299
+ break;
300
+ case IDENT_KEY_SMS:
301
+ this._remove_sms(value, new_caller);
302
+ break;
303
+ case IDENT_KEY_WHATSAPP:
304
+ this._remove_whatsapp(value, new_caller);
305
+ break;
306
+ case IDENT_KEY_ANDROIDPUSH:
307
+ this._remove_androidpush(value, args[KEY_PUSHVENDOR], new_caller);
308
+ break;
309
+ case IDENT_KEY_IOSPUSH:
310
+ this._remove_iospush(value, args[KEY_PUSHVENDOR], new_caller);
311
+ break;
312
+ case IDENT_KEY_WEBPUSH:
313
+ this._remove_webpush(value, args[KEY_PUSHVENDOR], new_caller);
314
+ break;
315
+ case IDENT_KEY_SLACK:
316
+ this._remove_slack(val, caller);
317
+ break;
318
+ case IDENT_KEY_MS_TEAMS:
319
+ this._remove_ms_teams(val, caller);
320
+ break;
321
+ default:
322
+ break;
323
+ }
324
+ }
325
+
326
+ __check_ident_val_string(value, caller) {
327
+ const message = "value must be a string with proper value";
328
+ if (!is_string(value)) {
329
+ this.__errors.push(`[${caller}] ${message}`);
330
+ return [value, false];
331
+ }
332
+ value = value.trim();
333
+ if (!value) {
334
+ this.__errors.push(`[${caller}] ${message}`);
335
+ return [value, false];
336
+ }
337
+ return [value, true];
338
+ }
339
+
340
+ // email methods
341
+ __validate_email(value, caller) {
342
+ const [email, is_valid] = this.__check_ident_val_string(value, caller);
343
+ if (!is_valid) {
344
+ return [email, false];
345
+ }
346
+ return [email, true];
347
+ }
348
+
349
+ _add_email(email, caller) {
350
+ const [value, is_valid] = this.__validate_email(email, caller);
351
+ if (!is_valid) {
352
+ return;
353
+ }
354
+ this.__dict_append[IDENT_KEY_EMAIL] = value;
355
+ }
356
+
357
+ _remove_email(email, caller) {
358
+ const [value, is_valid] = this.__validate_email(email, caller);
359
+ if (!is_valid) {
360
+ return;
361
+ }
362
+ this.__dict_remove[IDENT_KEY_EMAIL] = value;
363
+ }
364
+
365
+ // mobile methods
366
+ __validate_mobile_no(value, caller) {
367
+ const [mobile, is_valid] = this.__check_ident_val_string(value, caller);
368
+ if (!is_valid) {
369
+ return [mobile, false];
370
+ }
371
+ return [mobile, true];
372
+ }
373
+
374
+ _add_sms(mobile_no, caller) {
375
+ const [value, is_valid] = this.__validate_mobile_no(mobile_no, caller);
376
+ if (!is_valid) {
377
+ return;
378
+ }
379
+ this.__dict_append[IDENT_KEY_SMS] = value;
380
+ }
381
+
382
+ _remove_sms(mobile_no, caller) {
383
+ const [value, is_valid] = this.__validate_mobile_no(mobile_no, caller);
384
+ if (!is_valid) {
385
+ return;
386
+ }
387
+ this.__dict_remove[IDENT_KEY_SMS] = value;
388
+ }
389
+
390
+ _add_whatsapp(mobile_no, caller) {
391
+ const [value, is_valid] = this.__validate_mobile_no(mobile_no, caller);
392
+ if (!is_valid) {
393
+ return;
394
+ }
395
+ this.__dict_append[IDENT_KEY_WHATSAPP] = value;
396
+ }
397
+
398
+ _remove_whatsapp(mobile_no, caller) {
399
+ const [value, is_valid] = this.__validate_mobile_no(mobile_no, caller);
400
+ if (!is_valid) {
401
+ return;
402
+ }
403
+ this.__dict_remove[IDENT_KEY_WHATSAPP] = value;
404
+ }
405
+
406
+ // android push methods
407
+ __check_androidpush_value(value, provider, caller) {
408
+ let [push_token, is_valid] = this.__check_ident_val_string(value, caller);
409
+ if (!is_valid) {
410
+ return [push_token, provider, false];
411
+ }
412
+
413
+ let [validated_provider, is_provider_valid] = this.__check_ident_val_string(value, caller);
414
+ if (!is_provider_valid) {
415
+ return [push_token, provider, false];
416
+ }
417
+ provider = validated_provider.toLocaleLowerCase();
418
+
419
+ return [push_token, provider, true];
420
+ }
421
+
422
+
423
+ _add_androidpush(push_token, provider = "fcm", caller) {
424
+ const [value, vendor, is_valid] = this.__check_androidpush_value(
425
+ push_token,
426
+ provider,
427
+ caller
428
+ );
429
+ if (!is_valid) {
430
+ return;
431
+ }
432
+ this.__dict_append[IDENT_KEY_ANDROIDPUSH] = value;
433
+ this.__dict_append[KEY_PUSHVENDOR] = vendor;
434
+ }
435
+
436
+ _remove_androidpush(push_token, provider = "fcm") {
437
+ const caller = "remove_androidpush";
438
+ const [value, vendor, is_valid] = this.__check_androidpush_value(
439
+ push_token,
440
+ provider,
441
+ caller
442
+ );
443
+ if (!is_valid) {
444
+ return;
445
+ }
446
+ this.__dict_remove[IDENT_KEY_ANDROIDPUSH] = value;
447
+ this.__dict_remove[KEY_PUSHVENDOR] = vendor;
448
+ }
449
+
450
+ // ios push methods
451
+ __check_iospush_value(value, provider, caller) {
452
+ let [push_token, is_valid] = this.__check_ident_val_string(value, caller);
453
+ if (!is_valid) {
454
+ return [push_token, provider, false];
455
+ }
456
+
457
+ let [validated_provider, is_provider_valid] = this.__check_ident_val_string(value, caller);
458
+ if (!is_provider_valid) {
459
+ return [push_token, provider, false];
460
+ }
461
+ provider = validated_provider.toLocaleLowerCase();
462
+
463
+ return [push_token, provider, true];
464
+ }
465
+
466
+ _add_iospush(push_token, provider = "apns", caller) {
467
+ const [value, vendor, is_valid] = this.__check_iospush_value(
468
+ push_token,
469
+ provider,
470
+ caller
471
+ );
472
+ if (!is_valid) {
473
+ return;
474
+ }
475
+ this.__dict_append[IDENT_KEY_IOSPUSH] = value;
476
+ this.__dict_append[KEY_PUSHVENDOR] = vendor;
477
+ }
478
+
479
+ _remove_iospush(push_token, provider = "apns", caller) {
480
+ const [value, vendor, is_valid] = this.__check_iospush_value(
481
+ push_token,
482
+ provider,
483
+ caller
484
+ );
485
+ if (!is_valid) {
486
+ return;
487
+ }
488
+ this.__dict_remove[IDENT_KEY_IOSPUSH] = value;
489
+ this.__dict_remove[KEY_PUSHVENDOR] = vendor;
490
+ }
491
+
492
+ // web push methods
493
+ __check_webpush_dict(value, provider, caller) {
494
+ if (!is_object(value)) {
495
+ this.__errors.push(
496
+ `[${caller}] value must be a valid dict representing webpush-token`
497
+ );
498
+ return [value, provider, false];
499
+ }
500
+
501
+ let [validated_provider, is_provider_valid] = this.__check_ident_val_string(value, caller);
502
+ if (!is_provider_valid) {
503
+ return [value, provider, false];
504
+ }
505
+ provider = validated_provider.toLocaleLowerCase();
506
+
507
+ return [value, provider, true];
508
+ }
509
+
510
+ _add_webpush(push_token, provider = "vapid", caller) {
511
+ const [value, vendor, is_valid] = this.__check_webpush_dict(
512
+ push_token,
513
+ provider,
514
+ caller
515
+ );
516
+ if (!is_valid) {
517
+ return;
518
+ }
519
+ this.__dict_append[IDENT_KEY_WEBPUSH] = value;
520
+ this.__dict_append[KEY_PUSHVENDOR] = vendor;
521
+ }
522
+
523
+ _remove_webpush(push_token, provider = "vapid", caller) {
524
+ const [value, vendor, is_valid] = this.__check_webpush_dict(
525
+ push_token,
526
+ provider,
527
+ caller
528
+ );
529
+ if (!is_valid) {
530
+ return;
531
+ }
532
+ this.__dict_remove[IDENT_KEY_WEBPUSH] = value;
533
+ this.__dict_remove[KEY_PUSHVENDOR] = vendor;
534
+ }
535
+
536
+ __check_slack_dict(value, caller) {
537
+ const msg = "value must be a valid dict/json with proper keys";
538
+ if (!(value && value instanceof Object)) {
539
+ this.__errors.push(`[${caller}] ${msg}`);
540
+ return [value, false];
541
+ } else {
542
+ return [value, true];
543
+ }
544
+ }
545
+
546
+ _add_slack(value, caller) {
547
+ const [validated_value, is_valid] = this.__check_slack_dict(value, caller);
548
+ if (!is_valid) {
549
+ return;
550
+ }
551
+ this.__dict_append[IDENT_KEY_SLACK] = validated_value;
552
+ }
553
+
554
+ _remove_slack(value, caller) {
555
+ const [validated_value, is_valid] = this.__check_slack_dict(value, caller);
556
+ if (!is_valid) {
557
+ return;
558
+ }
559
+ this.__dict_remove[IDENT_KEY_SLACK] = validated_value;
560
+ }
561
+
562
+ __check_ms_teams_dict(value, caller) {
563
+ const msg = "value must be a valid dict/json with proper keys";
564
+ if (!(value && value instanceof Object)) {
565
+ this.__errors.push(`[${caller}] ${msg}`);
566
+ return [value, false];
567
+ } else {
568
+ return [value, true];
569
+ }
570
+ }
571
+
572
+ _add_ms_teams(value, caller) {
573
+ const [validated_value, is_valid] = this.__check_ms_teams_dict(
574
+ value,
575
+ caller
576
+ );
577
+ if (!is_valid) {
578
+ return;
579
+ }
580
+ this.__dict_append[IDENT_KEY_MS_TEAMS] = validated_value;
581
+ }
582
+
583
+ _remove_ms_teams(value, caller) {
584
+ const [validated_value, is_valid] = this.__check_ms_teams_dict(
585
+ value,
586
+ caller
587
+ );
588
+ if (!is_valid) {
589
+ return;
590
+ }
591
+ this.__dict_remove[IDENT_KEY_MS_TEAMS] = validated_value;
592
+ }
593
+ }
@@ -326,7 +326,7 @@ export default class _SubscriberInternalHelper {
326
326
  }
327
327
 
328
328
  __check_ident_val_string(value, caller) {
329
- const message = "value must a string with proper value";
329
+ const message = "value must be a string with proper value";
330
330
  if (!is_string(value)) {
331
331
  this.__errors.push(`[${caller}] ${message}`);
332
332
  return [value, false];
package/types/index.d.ts CHANGED
@@ -236,6 +236,68 @@ declare namespace suprsend {
236
236
  trigger(): Promise<SBulkResponse>;
237
237
  }
238
238
 
239
+ // objects
240
+ interface ObjectsApi {
241
+ list(object_type: string, options?: {}): Promise<Dictionary>;
242
+
243
+ get(object_type: string, object_id: string): Promise<Dictionary>;
244
+
245
+ upsert(object_type: string, object_id: string, object_payload?: Dictionary): Promise<Dictionary>;
246
+
247
+ edit(object_type: string, object_id: string, edit_payload?: Dictionary): Promise<Dictionary>;
248
+
249
+ delete(object_type: string, object_id: string): Promise<Dictionary>;
250
+
251
+ bulk_delete(object_type: string, payload?: Dictionary): Promise<Dictionary>;
252
+
253
+ get_subscriptions(object_type: string, object_id: string, options?: {}): Promise<Dictionary>;
254
+
255
+ create_subscriptions(object_type: string, object_id: string, subscriptions?: Dictionary): Promise<Dictionary>;
256
+
257
+ delete_subscriptions(object_type: string, object_id: string, subscriptions?: Dictionary): Promise<Dictionary>;
258
+
259
+ get_instance(object_type: string, object_id: string): Object;
260
+ }
261
+
262
+ // subscribers
263
+ interface Object {
264
+ save(): Promise<SResponse>;
265
+
266
+ append(key: string | Dictionary, value?: any): void;
267
+ set(key: string | Dictionary, value?: any): void;
268
+ set_once(key: string | Dictionary, value?: any): void;
269
+ increment(key: string | Dictionary, value?: number): void;
270
+ remove(key: string | Dictionary, value?: any): void;
271
+ unset(keys: string | string[]): void;
272
+
273
+ set_preferred_language(lang_code: string): void;
274
+ set_timezone(timezone: string): void;
275
+
276
+ add_email(email: string): void;
277
+ remove_email(email: string): void;
278
+
279
+ add_sms(mobile_no: string): void;
280
+ remove_sms(mobile_no: string): void;
281
+
282
+ add_whatsapp(mobile_no: string): void;
283
+ remove_whatsapp(mobile_no: string): void;
284
+
285
+ add_androidpush(push_token: string, provider?: string): void;
286
+ remove_androidpush(push_token: string, provider?: string): void;
287
+
288
+ add_iospush(push_token: string, provider?: string): void;
289
+ remove_iospush(push_token: string, provider?: string): void;
290
+
291
+ add_webpush(push_token: Dictionary, provider?: string): void;
292
+ remove_webpush(push_token: Dictionary, provider?: string): void;
293
+
294
+ add_slack(value: Dictionary): void;
295
+ remove_slack(value: Dictionary): void;
296
+
297
+ add_ms_teams(value: Dictionary): void;
298
+ remove_ms_teams(value: Dictionary): void;
299
+ }
300
+
239
301
  interface Suprsend {
240
302
  new (
241
303
  workspace_env: string,
@@ -259,6 +321,8 @@ declare namespace suprsend {
259
321
 
260
322
  workflows: WorkflowsApi;
261
323
 
324
+ objects: ObjectsApi;
325
+
262
326
  add_attachment(
263
327
  body: Dictionary,
264
328
  file_path: string,