shred-api-client 2.3.9 → 2.4.0

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
@@ -2,6 +2,22 @@ import { z } from 'zod/v3';
2
2
 
3
3
  type Environment = "prod" | "staging" | "local";
4
4
 
5
+ declare const ScriptIARequestSchema: z.ZodObject<{
6
+ prompt: z.ZodString;
7
+ keywords: z.ZodString;
8
+ tone: z.ZodString;
9
+ length: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ length: string;
12
+ prompt: string;
13
+ keywords: string;
14
+ tone: string;
15
+ }, {
16
+ length: string;
17
+ prompt: string;
18
+ keywords: string;
19
+ tone: string;
20
+ }>;
5
21
  declare const ScriptSchema: z.ZodObject<{
6
22
  id: z.ZodString;
7
23
  title: z.ZodString;
@@ -174,6 +190,7 @@ declare const PromptSchema: z.ZodObject<{
174
190
  type Script = z.infer<typeof ScriptSchema>;
175
191
  type Category = z.infer<typeof CategorySchema>;
176
192
  type Prompt = z.infer<typeof PromptSchema>;
193
+ type ScriptIARequest = z.infer<typeof ScriptIARequestSchema>;
177
194
 
178
195
  type Context = {
179
196
  token: string;
@@ -185,6 +202,7 @@ interface IAPI$a {
185
202
  addScript: (c: Context, script: Partial<Script>) => Promise<Script>;
186
203
  deleteScript: (c: Context, id: string) => Promise<boolean>;
187
204
  getScripts: (c: Context) => Promise<Script[]>;
205
+ generateScript: (c: Context, data: ScriptIARequest) => Promise<string>;
188
206
  updateScript: (c: Context, id: string, script: Partial<Script>) => Promise<boolean>;
189
207
  }
190
208
  declare const Endpoints$9: {
@@ -204,6 +222,10 @@ declare const Endpoints$9: {
204
222
  uri: string;
205
223
  method: string;
206
224
  };
225
+ GenerateScript: {
226
+ uri: string;
227
+ method: string;
228
+ };
207
229
  UpdateScript: {
208
230
  uri: string;
209
231
  method: string;
@@ -214,9 +236,11 @@ type index$c_Category = Category;
214
236
  declare const index$c_CategorySchema: typeof CategorySchema;
215
237
  declare const index$c_PromptSchema: typeof PromptSchema;
216
238
  type index$c_Script = Script;
239
+ type index$c_ScriptIARequest = ScriptIARequest;
240
+ declare const index$c_ScriptIARequestSchema: typeof ScriptIARequestSchema;
217
241
  declare const index$c_ScriptSchema: typeof ScriptSchema;
218
242
  declare namespace index$c {
219
- export { type index$c_Category as Category, index$c_CategorySchema as CategorySchema, Endpoints$9 as Endpoints, type Prompt as Entity, type IAPI$a as IAPI, index$c_PromptSchema as PromptSchema, type index$c_Script as Script, index$c_ScriptSchema as ScriptSchema };
243
+ export { type index$c_Category as Category, index$c_CategorySchema as CategorySchema, Endpoints$9 as Endpoints, type Prompt as Entity, type IAPI$a as IAPI, index$c_PromptSchema as PromptSchema, type index$c_Script as Script, type index$c_ScriptIARequest as ScriptIARequest, index$c_ScriptIARequestSchema as ScriptIARequestSchema, index$c_ScriptSchema as ScriptSchema };
220
244
  }
221
245
 
222
246
  declare enum Type {
package/dist/index.js CHANGED
@@ -4405,6 +4405,17 @@ var PromptAPI = class {
4405
4405
  this.env = env;
4406
4406
  this.clientHTTP = new HTTPClient();
4407
4407
  }
4408
+ async generateScript(ctx, body) {
4409
+ const endpointInfo = prompt_exports.Endpoints.GenerateScript;
4410
+ const data = await this.clientHTTP.makeRequest(
4411
+ this.env,
4412
+ endpointInfo.uri,
4413
+ endpointInfo.method,
4414
+ body,
4415
+ ctx
4416
+ );
4417
+ return data.result;
4418
+ }
4408
4419
  async getPrompt(context) {
4409
4420
  const endpointInfo = prompt_exports.Endpoints.GetPrompt;
4410
4421
  const data = await this.clientHTTP.makeRequest(
@@ -5753,10 +5764,17 @@ __export(prompt_exports, {
5753
5764
  CategorySchema: () => CategorySchema,
5754
5765
  Endpoints: () => Endpoints7,
5755
5766
  PromptSchema: () => PromptSchema,
5767
+ ScriptIARequestSchema: () => ScriptIARequestSchema,
5756
5768
  ScriptSchema: () => ScriptSchema
5757
5769
  });
5758
5770
 
5759
5771
  // src/model/prompt/Prompt.schema.ts
5772
+ var ScriptIARequestSchema = external_exports.object({
5773
+ prompt: external_exports.string(),
5774
+ keywords: external_exports.string(),
5775
+ tone: external_exports.string(),
5776
+ length: external_exports.string()
5777
+ });
5760
5778
  var ScriptSchema = external_exports.object({
5761
5779
  id: external_exports.string(),
5762
5780
  title: external_exports.string(),
@@ -5797,6 +5815,10 @@ var Endpoints7 = {
5797
5815
  uri: "/prompts/script/list/",
5798
5816
  method: "GET"
5799
5817
  },
5818
+ GenerateScript: {
5819
+ uri: "/prompts/script/generate/",
5820
+ method: "POST"
5821
+ },
5800
5822
  UpdateScript: {
5801
5823
  uri: "/prompts/script/:id/update/",
5802
5824
  method: "PUT"