FEATURE: add downloadCalendar to plugin api (#14603)

FEATURE: add downloadCalendar to plugin api (#14603)

New download calendar feature should be exposed via api

diff --git a/app/assets/javascripts/discourse/app/lib/plugin-api.js b/app/assets/javascripts/discourse/app/lib/plugin-api.js
index b11a07e..6ad1122 100644
--- a/app/assets/javascripts/discourse/app/lib/plugin-api.js
+++ b/app/assets/javascripts/discourse/app/lib/plugin-api.js
@@ -92,9 +92,10 @@ import {
 import { CUSTOM_USER_SEARCH_OPTIONS } from "select-kit/components/user-chooser";
 import { unsubscribeFromNotifications } from "discourse/initializers/subscribe-user-notifications";
 import { disableDefaultBadging } from "discourse/initializers/badging";
+import { downloadCalendar } from "discourse/lib/download-calendar";
 
 // If you add any methods to the API ensure you bump up this number
-const PLUGIN_API_VERSION = "0.12.6";
+const PLUGIN_API_VERSION = "0.13.6";
 
 // This helper prevents us from applying the same `modifyClass` over and over in test mode.
 function canModify(klass, type, resolverName, changes) {
@@ -1427,6 +1428,23 @@ class PluginApi {
   }
 
   /**
+   * Download calendar modal which allow to pick between ICS and Google Calendar
+   *
+   * `‍``
+   * api.downloadCalendar("title of the event", [
+   * {
+        startsAt: "2021-10-12T15:00:00.000Z",
+        endsAt: "2021-10-12T16:00:00.000Z",
+      },
+   * ]);
+   * `‍``
+   *
+   */
+  downloadCalendar(title, dates) {
+    downloadCalendar(title, dates);
+  }
+
+  /**
    * Add a quick search tip shown randomly when the search dropdown is invoked on desktop.
    *
    * Example usage:

GitHub sha: 2e09dc88856201c16f9e98dc2634c71243d42dab

This commit appears in #14603 which was approved by OsamaSayegh. It was merged by lis2.