glitch-javascript-sdk 1.9.2 → 1.9.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
@@ -4760,6 +4760,19 @@ declare class Scheduler {
4760
4760
  * @returns promise
4761
4761
  */
4762
4762
  static getSchedulePosts<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4763
+ /**
4764
+ * Rewrite / generate content for a promotion schedule.
4765
+ *
4766
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/generateTitleContent
4767
+ *
4768
+ * @param scheduler_id UUID of the promotion schedule.
4769
+ * @param data Body payload. At minimum you must supply
4770
+ * `{ platform: 'twitter' }` plus either `content`
4771
+ * **or** a `media` array containing at least one
4772
+ * `{ id: '<media-uuid>' }`.
4773
+ * @returns Axios promise with `{ content, title? }`
4774
+ */
4775
+ static generateTitleContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4763
4776
  /**
4764
4777
  * List title updates for a promotion schedule.
4765
4778
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -95,6 +95,32 @@ class Scheduler {
95
95
  return Requests.processRoute(SchedulerRoute.routes.getSchedulePosts, {}, { scheduler_id }, params);
96
96
  }
97
97
 
98
+ /**
99
+ * Rewrite / generate content for a promotion schedule.
100
+ *
101
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/generateTitleContent
102
+ *
103
+ * @param scheduler_id UUID of the promotion schedule.
104
+ * @param data Body payload. At minimum you must supply
105
+ * `{ platform: 'twitter' }` plus either `content`
106
+ * **or** a `media` array containing at least one
107
+ * `{ id: '<media-uuid>' }`.
108
+ * @returns Axios promise with `{ content, title? }`
109
+ */
110
+ public static generateTitleContent<T>(
111
+ scheduler_id: string,
112
+ data: object,
113
+ params?: Record<string, any>
114
+ ): AxiosPromise<Response<T>> {
115
+ return Requests.processRoute(
116
+ SchedulerRoute.routes.generateContent,
117
+ data, // request body
118
+ { scheduler_id }, // path params
119
+ params // query params
120
+ );
121
+ }
122
+
123
+
98
124
  /**
99
125
  * List title updates for a promotion schedule.
100
126
  *
@@ -103,6 +103,10 @@ class SchedulerRoute {
103
103
  url: "/schedulers/{scheduler_id}/funding_instruments",
104
104
  method: HTTP_METHODS.GET,
105
105
  },
106
+ generateContent: {
107
+ url: '/schedulers/{scheduler_id}/generateContent',
108
+ method: HTTP_METHODS.POST
109
+ },
106
110
 
107
111
 
108
112