glitch-javascript-sdk 2.2.1 → 2.2.3

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/dist/index.d.ts CHANGED
@@ -3993,6 +3993,31 @@ declare class Titles {
3993
3993
  static translateLandingPage<T>(landing_page_id: string, data: {
3994
3994
  language_code: string;
3995
3995
  }, params?: Record<string, any>): AxiosPromise<Response<T>>;
3996
+ /**
3997
+ * Generate or regenerate AI-powered HTML content for a landing page.
3998
+ * @param landing_page_id The UUID of the landing page.
3999
+ * @param data An object containing the prompt, language_code, and privacy_mode.
4000
+ */
4001
+ static generateLandingPageAiContent<T>(landing_page_id: string, data: {
4002
+ prompt: string;
4003
+ language_code: string;
4004
+ privacy_mode: string;
4005
+ }, params?: Record<string, any>): AxiosPromise<Response<T>>;
4006
+ /**
4007
+ * Create or update a specific translation for a landing page.
4008
+ * @param landing_page_id The UUID of the landing page.
4009
+ * @param translationData The full translation object to be saved.
4010
+ */
4011
+ static saveLandingPageTranslation<T>(landing_page_id: string, translationData: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4012
+ /**
4013
+ * Get an aggregated report of ad conversion events for charting.
4014
+ */
4015
+ static getAdConversionEventsReport<T>(title_id: string, params: {
4016
+ start_date: string;
4017
+ end_date: string;
4018
+ group_by: 'platform' | 'status' | 'event_type';
4019
+ unique_clicks?: boolean;
4020
+ }): AxiosPromise<Response<T>>;
3996
4021
  }
3997
4022
 
3998
4023
  declare class Campaigns {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Titles.ts CHANGED
@@ -817,6 +817,43 @@ class Titles {
817
817
  return Requests.processRoute(TitlesRoute.routes.translateLandingPage, data, { landing_page_id }, params);
818
818
  }
819
819
 
820
+ /**
821
+ * Generate or regenerate AI-powered HTML content for a landing page.
822
+ * @param landing_page_id The UUID of the landing page.
823
+ * @param data An object containing the prompt, language_code, and privacy_mode.
824
+ */
825
+ public static generateLandingPageAiContent<T>(landing_page_id: string, data: { prompt: string, language_code: string, privacy_mode: string }, params?: Record<string, any>): AxiosPromise<Response<T>> {
826
+ return Requests.processRoute(TitlesRoute.routes.generateLandingPageAiContent, data, { landing_page_id }, params);
827
+ }
828
+
829
+ /**
830
+ * Create or update a specific translation for a landing page.
831
+ * @param landing_page_id The UUID of the landing page.
832
+ * @param translationData The full translation object to be saved.
833
+ */
834
+ public static saveLandingPageTranslation<T>(landing_page_id: string, translationData: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
835
+ return Requests.processRoute(TitlesRoute.routes.saveLandingPageTranslation, translationData, { landing_page_id }, params);
836
+ }
837
+
838
+ /**
839
+ * Get an aggregated report of ad conversion events for charting.
840
+ */
841
+ public static getAdConversionEventsReport<T>(
842
+ title_id: string,
843
+ params: {
844
+ start_date: string;
845
+ end_date: string;
846
+ group_by: 'platform' | 'status' | 'event_type';
847
+ unique_clicks?: boolean;
848
+ }
849
+ ): AxiosPromise<Response<T>> {
850
+ return Requests.processRoute(
851
+ TitlesRoute.routes.getAdConversionEventsReport,
852
+ {},
853
+ { title_id },
854
+ params
855
+ );
856
+ }
820
857
  }
821
858
 
822
859
  export default Titles;
@@ -93,6 +93,7 @@ class CommunitiesRoute {
93
93
 
94
94
  // Subscriber registration (open route)
95
95
  registerNewsletterSubscriber: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers', method: HTTP_METHODS.POST },
96
+
96
97
  };
97
98
 
98
99
 
@@ -148,6 +148,11 @@ class TitlesRoute {
148
148
  method: HTTP_METHODS.POST
149
149
  },
150
150
 
151
+ getAdConversionEventsReport: {
152
+ url: '/titles/{title_id}/ad-conversion-events/report',
153
+ method: HTTP_METHODS.GET
154
+ },
155
+
151
156
  listLandingPages: { url: '/titles/{title_id}/landing-pages', method: HTTP_METHODS.GET },
152
157
  createLandingPage: { url: '/titles/{title_id}/landing-pages', method: HTTP_METHODS.POST },
153
158
  viewLandingPage: { url: '/landing-pages/{landing_page_id}', method: HTTP_METHODS.GET },
@@ -155,6 +160,9 @@ class TitlesRoute {
155
160
  deleteLandingPage: { url: '/landing-pages/{landing_page_id}', method: HTTP_METHODS.DELETE },
156
161
  translateLandingPage: { url: '/landing-pages/{landing_page_id}/translate', method: HTTP_METHODS.POST },
157
162
 
163
+ generateLandingPageAiContent: { url: '/landing-pages/{landing_page_id}/generate-ai-content', method: HTTP_METHODS.POST },
164
+ saveLandingPageTranslation: { url: '/landing-pages/{landing_page_id}/translations', method: HTTP_METHODS.POST },
165
+
158
166
  };
159
167
 
160
168
  }