@smartico/public-api 0.0.106 → 0.0.108

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 (33) hide show
  1. package/dist/Inbox/GetInboxMessagesResponse.d.ts +2 -0
  2. package/dist/Inbox/InboxMessage.d.ts +15 -12
  3. package/dist/Inbox/MarkInboxMessageDeletedResponse.d.ts +1 -0
  4. package/dist/Inbox/MarkInboxMessageReadResponse.d.ts +1 -0
  5. package/dist/Inbox/MarkInboxMessageStarredResponse.d.ts +1 -0
  6. package/dist/SmarticoAPI.d.ts +14 -3
  7. package/dist/Store/BuyStoreItemErrorCode.d.ts +2 -1
  8. package/dist/Store/StoreItem.d.ts +1 -0
  9. package/dist/WSAPI/WSAPI.d.ts +31 -2
  10. package/dist/WSAPI/WSAPITypes.d.ts +41 -1
  11. package/dist/index.js +325 -40
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.modern.mjs +193 -17
  14. package/dist/index.modern.mjs.map +1 -1
  15. package/docs/README.md +3 -0
  16. package/docs/classes/WSAPI.md +118 -1
  17. package/docs/enums/BuyStoreItemErrorCode.md +6 -0
  18. package/docs/interfaces/InboxMarkMessageAction.md +17 -0
  19. package/docs/interfaces/TInboxMessage.md +33 -0
  20. package/docs/interfaces/TInboxMessageBody.md +52 -0
  21. package/docs/interfaces/TMissionOrBadge.md +1 -1
  22. package/docs/interfaces/TStoreItem.md +8 -0
  23. package/package.json +1 -1
  24. package/src/Inbox/GetInboxMessagesResponse.ts +14 -0
  25. package/src/Inbox/InboxMessage.ts +35 -9
  26. package/src/Inbox/MarkInboxMessageDeletedResponse.ts +1 -0
  27. package/src/Inbox/MarkInboxMessageReadResponse.ts +1 -0
  28. package/src/Inbox/MarkInboxMessageStarredResponse.ts +1 -0
  29. package/src/SmarticoAPI.ts +94 -3
  30. package/src/Store/BuyStoreItemErrorCode.ts +2 -1
  31. package/src/Store/StoreItem.ts +3 -1
  32. package/src/WSAPI/WSAPI.ts +82 -2
  33. package/src/WSAPI/WSAPITypes.ts +44 -1
@@ -366,6 +366,8 @@ export interface TStoreItem {
366
366
  can_buy: boolean;
367
367
  /** The list of IDs of the categories where the store item is assigned, information about categories can be retrievend with getStoreCategories method */
368
368
  category_ids: number[];
369
+ /** Number of items in the pool avaliable for the purchase.*/
370
+ pool?: number;
369
371
  }
370
372
 
371
373
  /**
@@ -404,7 +406,7 @@ export interface TMissionOrBadge {
404
406
  progress: number;
405
407
  /**
406
408
  * The action that should be performed when user clicks on the mission or badge
407
- * Can be URL or deep link, e.g. 'dp:deposit'. The most safe to execute CTA is to pass it to _smartico.do(cta_action);
409
+ * Can be URL or deep link, e.g. 'dp:deposit'. The most safe to execute CTA is to pass it to _smartico.dp(cta_action);
408
410
  * The 'dp' function will handle the CTA and will execute it in the most safe way
409
411
  */
410
412
  cta_action: string,
@@ -489,4 +491,45 @@ export interface TBuyStoreItemResult {
489
491
 
490
492
  export interface TGetTranslations {
491
493
  translations: {[key: string]: string};
494
+ }
495
+
496
+ export interface TInboxMessage {
497
+ /** Uniq identifier of the message. It is needed to request the message body, mark the message as read/deleted/favorite. */
498
+ message_guid: string;
499
+ /** Date when the message was sent */
500
+ sent_date: string;
501
+ /** Indicator if a message is read */
502
+ read: boolean;
503
+ /** Indicator if a message is added to favorites */
504
+ favorite: boolean;
505
+ }
506
+
507
+ export interface TInboxMessageBody {
508
+ /** Message title */
509
+ title: string
510
+ /** Short preview body of the message */
511
+ preview_body: string,
512
+ /** Message icon */
513
+ icon: string,
514
+ /** The action that should be performed when user clicks on the message.
515
+ * Can be URL or deep link, e.g. 'dp:deposit'. The most safe to execute CTA is to pass it to _smartico.dp(cta_action);
516
+ * The 'dp' function will handle the CTA and will execute it in the most safe way.
517
+ * If the message has a rich html body - the action will always be 'dp:inbox' which will open the inbox widget when triggered. */
518
+ action: string,
519
+ /** Rich HTML body of the message. */
520
+ html_body?: string,
521
+ /** Optional additional buttons to show in the message, available only if message has rich HTML body. Max count - 2. */
522
+ buttons?: {
523
+ /** The action that should be performed when user clicks on the button. The logic is the same as for message actions */
524
+ action: string,
525
+ /** Button text */
526
+ text: string
527
+ }[];
528
+ }
529
+
530
+ export interface InboxMarkMessageAction {
531
+ /** An error code representing the result of marking a message as deleted, favorite or read. Successful marking action if err_code is 0 */
532
+ err_code: number;
533
+ /** Optional error message */
534
+ err_message: string;
492
535
  }