glitch-javascript-sdk 2.2.0 → 2.2.2

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
@@ -3957,6 +3957,58 @@ declare class Titles {
3957
3957
  * Retry a failed or pending ad conversion event
3958
3958
  */
3959
3959
  static retryAdConversionEvent<T>(title_id: string, event_id: string): AxiosPromise<Response<T>>;
3960
+ /**
3961
+ * List all landing pages for a specific title.
3962
+ * @param title_id The UUID of the title.
3963
+ * @param params Optional query parameters for pagination.
3964
+ */
3965
+ static listLandingPages<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3966
+ /**
3967
+ * Create a new landing page for a title.
3968
+ * @param title_id The UUID of the title.
3969
+ * @param data The data for the new landing page.
3970
+ */
3971
+ static createLandingPage<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
3972
+ /**
3973
+ * View a specific landing page by its ID.
3974
+ * @param landing_page_id The UUID of the landing page.
3975
+ */
3976
+ static viewLandingPage<T>(landing_page_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3977
+ /**
3978
+ * Update an existing landing page.
3979
+ * @param landing_page_id The UUID of the landing page to update.
3980
+ * @param data The new data for the landing page.
3981
+ */
3982
+ static updateLandingPage<T>(landing_page_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
3983
+ /**
3984
+ * Delete a landing page.
3985
+ * @param landing_page_id The UUID of the landing page to delete.
3986
+ */
3987
+ static deleteLandingPage<T>(landing_page_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3988
+ /**
3989
+ * Trigger an AI translation for a landing page.
3990
+ * @param landing_page_id The UUID of the landing page.
3991
+ * @param data An object containing the target language code, e.g., { language_code: 'es' }.
3992
+ */
3993
+ static translateLandingPage<T>(landing_page_id: string, data: {
3994
+ language_code: string;
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>>;
3960
4012
  }
3961
4013
 
3962
4014
  declare class Campaigns {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
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
@@ -765,6 +765,75 @@ class Titles {
765
765
  );
766
766
  }
767
767
 
768
+ /**
769
+ * List all landing pages for a specific title.
770
+ * @param title_id The UUID of the title.
771
+ * @param params Optional query parameters for pagination.
772
+ */
773
+ public static listLandingPages<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
774
+ return Requests.processRoute(TitlesRoute.routes.listLandingPages, {}, { title_id }, params);
775
+ }
776
+
777
+ /**
778
+ * Create a new landing page for a title.
779
+ * @param title_id The UUID of the title.
780
+ * @param data The data for the new landing page.
781
+ */
782
+ public static createLandingPage<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
783
+ return Requests.processRoute(TitlesRoute.routes.createLandingPage, data, { title_id }, params);
784
+ }
785
+
786
+ /**
787
+ * View a specific landing page by its ID.
788
+ * @param landing_page_id The UUID of the landing page.
789
+ */
790
+ public static viewLandingPage<T>(landing_page_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
791
+ return Requests.processRoute(TitlesRoute.routes.viewLandingPage, {}, { landing_page_id }, params);
792
+ }
793
+
794
+ /**
795
+ * Update an existing landing page.
796
+ * @param landing_page_id The UUID of the landing page to update.
797
+ * @param data The new data for the landing page.
798
+ */
799
+ public static updateLandingPage<T>(landing_page_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
800
+ return Requests.processRoute(TitlesRoute.routes.updateLandingPage, data, { landing_page_id }, params);
801
+ }
802
+
803
+ /**
804
+ * Delete a landing page.
805
+ * @param landing_page_id The UUID of the landing page to delete.
806
+ */
807
+ public static deleteLandingPage<T>(landing_page_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
808
+ return Requests.processRoute(TitlesRoute.routes.deleteLandingPage, {}, { landing_page_id }, params);
809
+ }
810
+
811
+ /**
812
+ * Trigger an AI translation for a landing page.
813
+ * @param landing_page_id The UUID of the landing page.
814
+ * @param data An object containing the target language code, e.g., { language_code: 'es' }.
815
+ */
816
+ public static translateLandingPage<T>(landing_page_id: string, data: { language_code: string }, params?: Record<string, any>): AxiosPromise<Response<T>> {
817
+ return Requests.processRoute(TitlesRoute.routes.translateLandingPage, data, { landing_page_id }, params);
818
+ }
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
+ }
768
837
  }
769
838
 
770
839
  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
 
@@ -146,8 +146,17 @@ class TitlesRoute {
146
146
  retryAdConversionEvent: {
147
147
  url: '/titles/{title_id}/ad-conversion-events/{event_id}/retry',
148
148
  method: HTTP_METHODS.POST
149
- }
149
+ },
150
+
151
+ listLandingPages: { url: '/titles/{title_id}/landing-pages', method: HTTP_METHODS.GET },
152
+ createLandingPage: { url: '/titles/{title_id}/landing-pages', method: HTTP_METHODS.POST },
153
+ viewLandingPage: { url: '/landing-pages/{landing_page_id}', method: HTTP_METHODS.GET },
154
+ updateLandingPage: { url: '/landing-pages/{landing_page_id}', method: HTTP_METHODS.PUT },
155
+ deleteLandingPage: { url: '/landing-pages/{landing_page_id}', method: HTTP_METHODS.DELETE },
156
+ translateLandingPage: { url: '/landing-pages/{landing_page_id}/translate', method: HTTP_METHODS.POST },
150
157
 
158
+ generateLandingPageAiContent: { url: '/landing-pages/{landing_page_id}/generate-ai-content', method: HTTP_METHODS.POST },
159
+ saveLandingPageTranslation: { url: '/landing-pages/{landing_page_id}/translations', method: HTTP_METHODS.POST },
151
160
 
152
161
  };
153
162