shred-api-client 2.3.8 → 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 {
@@ -880,18 +904,92 @@ declare const PreferencesSchema: z.ZodObject<{
880
904
  primaryColor: z.ZodString;
881
905
  secondaryColor: z.ZodString;
882
906
  guidelinesUrl: z.ZodOptional<z.ZodString>;
907
+ description: z.ZodOptional<z.ZodString>;
908
+ industry: z.ZodOptional<z.ZodString>;
909
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
910
+ assetId: z.ZodString;
911
+ fileName: z.ZodString;
912
+ extension: z.ZodString;
913
+ fileSize: z.ZodNumber;
914
+ assetUrl: z.ZodString;
915
+ thumbnailUrl: z.ZodString;
916
+ type: z.ZodString;
917
+ duration: z.ZodOptional<z.ZodNumber>;
918
+ progress: z.ZodOptional<z.ZodNumber>;
919
+ error: z.ZodOptional<z.ZodString>;
920
+ authorId: z.ZodString;
921
+ uploadedAt: z.ZodNumber;
922
+ }, "strip", z.ZodTypeAny, {
923
+ type: string;
924
+ assetId: string;
925
+ fileName: string;
926
+ extension: string;
927
+ fileSize: number;
928
+ assetUrl: string;
929
+ thumbnailUrl: string;
930
+ authorId: string;
931
+ uploadedAt: number;
932
+ error?: string | undefined;
933
+ duration?: number | undefined;
934
+ progress?: number | undefined;
935
+ }, {
936
+ type: string;
937
+ assetId: string;
938
+ fileName: string;
939
+ extension: string;
940
+ fileSize: number;
941
+ assetUrl: string;
942
+ thumbnailUrl: string;
943
+ authorId: string;
944
+ uploadedAt: number;
945
+ error?: string | undefined;
946
+ duration?: number | undefined;
947
+ progress?: number | undefined;
948
+ }>, "many">>;
883
949
  }, "strip", z.ZodTypeAny, {
884
950
  iconUrl: string;
885
951
  logoUrl: string;
886
952
  primaryColor: string;
887
953
  secondaryColor: string;
954
+ description?: string | undefined;
888
955
  guidelinesUrl?: string | undefined;
956
+ industry?: string | undefined;
957
+ assets?: {
958
+ type: string;
959
+ assetId: string;
960
+ fileName: string;
961
+ extension: string;
962
+ fileSize: number;
963
+ assetUrl: string;
964
+ thumbnailUrl: string;
965
+ authorId: string;
966
+ uploadedAt: number;
967
+ error?: string | undefined;
968
+ duration?: number | undefined;
969
+ progress?: number | undefined;
970
+ }[] | undefined;
889
971
  }, {
890
972
  iconUrl: string;
891
973
  logoUrl: string;
892
974
  primaryColor: string;
893
975
  secondaryColor: string;
976
+ description?: string | undefined;
894
977
  guidelinesUrl?: string | undefined;
978
+ industry?: string | undefined;
979
+ assets?: {
980
+ type: string;
981
+ assetId: string;
982
+ fileName: string;
983
+ extension: string;
984
+ fileSize: number;
985
+ assetUrl: string;
986
+ thumbnailUrl: string;
987
+ authorId: string;
988
+ uploadedAt: number;
989
+ error?: string | undefined;
990
+ duration?: number | undefined;
991
+ progress?: number | undefined;
992
+ }[] | undefined;
895
993
  }>;
896
994
  declare const TenantSchema: z.ZodObject<{
897
995
  id: z.ZodString;
@@ -904,18 +1002,92 @@ declare const TenantSchema: z.ZodObject<{
904
1002
  primaryColor: z.ZodString;
905
1003
  secondaryColor: z.ZodString;
906
1004
  guidelinesUrl: z.ZodOptional<z.ZodString>;
1005
+ description: z.ZodOptional<z.ZodString>;
1006
+ industry: z.ZodOptional<z.ZodString>;
1007
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
1008
+ assetId: z.ZodString;
1009
+ fileName: z.ZodString;
1010
+ extension: z.ZodString;
1011
+ fileSize: z.ZodNumber;
1012
+ assetUrl: z.ZodString;
1013
+ thumbnailUrl: z.ZodString;
1014
+ type: z.ZodString;
1015
+ duration: z.ZodOptional<z.ZodNumber>;
1016
+ progress: z.ZodOptional<z.ZodNumber>;
1017
+ error: z.ZodOptional<z.ZodString>;
1018
+ authorId: z.ZodString;
1019
+ uploadedAt: z.ZodNumber;
1020
+ }, "strip", z.ZodTypeAny, {
1021
+ type: string;
1022
+ assetId: string;
1023
+ fileName: string;
1024
+ extension: string;
1025
+ fileSize: number;
1026
+ assetUrl: string;
1027
+ thumbnailUrl: string;
1028
+ authorId: string;
1029
+ uploadedAt: number;
1030
+ error?: string | undefined;
1031
+ duration?: number | undefined;
1032
+ progress?: number | undefined;
1033
+ }, {
1034
+ type: string;
1035
+ assetId: string;
1036
+ fileName: string;
1037
+ extension: string;
1038
+ fileSize: number;
1039
+ assetUrl: string;
1040
+ thumbnailUrl: string;
1041
+ authorId: string;
1042
+ uploadedAt: number;
1043
+ error?: string | undefined;
1044
+ duration?: number | undefined;
1045
+ progress?: number | undefined;
1046
+ }>, "many">>;
907
1047
  }, "strip", z.ZodTypeAny, {
908
1048
  iconUrl: string;
909
1049
  logoUrl: string;
910
1050
  primaryColor: string;
911
1051
  secondaryColor: string;
1052
+ description?: string | undefined;
912
1053
  guidelinesUrl?: string | undefined;
1054
+ industry?: string | undefined;
1055
+ assets?: {
1056
+ type: string;
1057
+ assetId: string;
1058
+ fileName: string;
1059
+ extension: string;
1060
+ fileSize: number;
1061
+ assetUrl: string;
1062
+ thumbnailUrl: string;
1063
+ authorId: string;
1064
+ uploadedAt: number;
1065
+ error?: string | undefined;
1066
+ duration?: number | undefined;
1067
+ progress?: number | undefined;
1068
+ }[] | undefined;
913
1069
  }, {
914
1070
  iconUrl: string;
915
1071
  logoUrl: string;
916
1072
  primaryColor: string;
917
1073
  secondaryColor: string;
1074
+ description?: string | undefined;
918
1075
  guidelinesUrl?: string | undefined;
1076
+ industry?: string | undefined;
1077
+ assets?: {
1078
+ type: string;
1079
+ assetId: string;
1080
+ fileName: string;
1081
+ extension: string;
1082
+ fileSize: number;
1083
+ assetUrl: string;
1084
+ thumbnailUrl: string;
1085
+ authorId: string;
1086
+ uploadedAt: number;
1087
+ error?: string | undefined;
1088
+ duration?: number | undefined;
1089
+ progress?: number | undefined;
1090
+ }[] | undefined;
919
1091
  }>;
920
1092
  inviteCode: z.ZodString;
921
1093
  totalUsersAllowed: z.ZodNumber;
@@ -1115,7 +1287,23 @@ declare const TenantSchema: z.ZodObject<{
1115
1287
  logoUrl: string;
1116
1288
  primaryColor: string;
1117
1289
  secondaryColor: string;
1290
+ description?: string | undefined;
1118
1291
  guidelinesUrl?: string | undefined;
1292
+ industry?: string | undefined;
1293
+ assets?: {
1294
+ type: string;
1295
+ assetId: string;
1296
+ fileName: string;
1297
+ extension: string;
1298
+ fileSize: number;
1299
+ assetUrl: string;
1300
+ thumbnailUrl: string;
1301
+ authorId: string;
1302
+ uploadedAt: number;
1303
+ error?: string | undefined;
1304
+ duration?: number | undefined;
1305
+ progress?: number | undefined;
1306
+ }[] | undefined;
1119
1307
  };
1120
1308
  inviteCode: string;
1121
1309
  totalUsersAllowed: number;
@@ -1175,7 +1363,23 @@ declare const TenantSchema: z.ZodObject<{
1175
1363
  logoUrl: string;
1176
1364
  primaryColor: string;
1177
1365
  secondaryColor: string;
1366
+ description?: string | undefined;
1178
1367
  guidelinesUrl?: string | undefined;
1368
+ industry?: string | undefined;
1369
+ assets?: {
1370
+ type: string;
1371
+ assetId: string;
1372
+ fileName: string;
1373
+ extension: string;
1374
+ fileSize: number;
1375
+ assetUrl: string;
1376
+ thumbnailUrl: string;
1377
+ authorId: string;
1378
+ uploadedAt: number;
1379
+ error?: string | undefined;
1380
+ duration?: number | undefined;
1381
+ progress?: number | undefined;
1382
+ }[] | undefined;
1179
1383
  };
1180
1384
  inviteCode: string;
1181
1385
  totalUsersAllowed: number;
@@ -1591,19 +1795,7 @@ declare const ProjectSchema: z.ZodObject<{
1591
1795
  }[];
1592
1796
  submitTimestamp: number;
1593
1797
  tenantId?: string | undefined;
1594
- editorId?: string | undefined;
1595
1798
  thumbnailUrl?: string | undefined;
1596
- finalVideoId?: string | undefined;
1597
- feedback?: {
1598
- criteria: {
1599
- id: string;
1600
- label: string;
1601
- score: number;
1602
- comment?: string | undefined;
1603
- }[];
1604
- comment?: string | undefined;
1605
- } | undefined;
1606
- captionSuggestion?: string | undefined;
1607
1799
  assets?: {
1608
1800
  type: string;
1609
1801
  assetId: string;
@@ -1618,6 +1810,18 @@ declare const ProjectSchema: z.ZodObject<{
1618
1810
  duration?: number | undefined;
1619
1811
  progress?: number | undefined;
1620
1812
  }[] | undefined;
1813
+ editorId?: string | undefined;
1814
+ finalVideoId?: string | undefined;
1815
+ feedback?: {
1816
+ criteria: {
1817
+ id: string;
1818
+ label: string;
1819
+ score: number;
1820
+ comment?: string | undefined;
1821
+ }[];
1822
+ comment?: string | undefined;
1823
+ } | undefined;
1824
+ captionSuggestion?: string | undefined;
1621
1825
  isFree?: boolean | undefined;
1622
1826
  }, {
1623
1827
  id: string;
@@ -1638,19 +1842,7 @@ declare const ProjectSchema: z.ZodObject<{
1638
1842
  }[];
1639
1843
  submitTimestamp: number;
1640
1844
  tenantId?: string | undefined;
1641
- editorId?: string | undefined;
1642
1845
  thumbnailUrl?: string | undefined;
1643
- finalVideoId?: string | undefined;
1644
- feedback?: {
1645
- criteria: {
1646
- id: string;
1647
- label: string;
1648
- score: number;
1649
- comment?: string | undefined;
1650
- }[];
1651
- comment?: string | undefined;
1652
- } | undefined;
1653
- captionSuggestion?: string | undefined;
1654
1846
  assets?: {
1655
1847
  type: string;
1656
1848
  assetId: string;
@@ -1665,6 +1857,18 @@ declare const ProjectSchema: z.ZodObject<{
1665
1857
  duration?: number | undefined;
1666
1858
  progress?: number | undefined;
1667
1859
  }[] | undefined;
1860
+ editorId?: string | undefined;
1861
+ finalVideoId?: string | undefined;
1862
+ feedback?: {
1863
+ criteria: {
1864
+ id: string;
1865
+ label: string;
1866
+ score: number;
1867
+ comment?: string | undefined;
1868
+ }[];
1869
+ comment?: string | undefined;
1870
+ } | undefined;
1871
+ captionSuggestion?: string | undefined;
1668
1872
  isFree?: boolean | undefined;
1669
1873
  }>;
1670
1874
  type ProjectCreation = Pick<Project, "title" | "instructions" | "captionStyle" | "assets">;
@@ -1865,8 +2069,8 @@ declare const GoalSchema: z.ZodObject<{
1865
2069
  }, "strip", z.ZodTypeAny, {
1866
2070
  id: string;
1867
2071
  createdAt: number;
1868
- editorId: string;
1869
2072
  progress: number;
2073
+ editorId: string;
1870
2074
  target: number;
1871
2075
  isoWeek: string;
1872
2076
  dailyMilestones: {
@@ -1878,8 +2082,8 @@ declare const GoalSchema: z.ZodObject<{
1878
2082
  }, {
1879
2083
  id: string;
1880
2084
  createdAt: number;
1881
- editorId: string;
1882
2085
  progress: number;
2086
+ editorId: string;
1883
2087
  target: number;
1884
2088
  isoWeek: string;
1885
2089
  dailyMilestones: {
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"
@@ -5870,7 +5892,10 @@ var PreferencesSchema = external_exports.object({
5870
5892
  logoUrl: external_exports.string().url(),
5871
5893
  primaryColor: external_exports.string(),
5872
5894
  secondaryColor: external_exports.string(),
5873
- guidelinesUrl: external_exports.string().url().optional()
5895
+ guidelinesUrl: external_exports.string().url().optional(),
5896
+ description: external_exports.string().optional(),
5897
+ industry: external_exports.string().optional(),
5898
+ assets: external_exports.array(AssetSchema).optional()
5874
5899
  });
5875
5900
  var TenantSchema = external_exports.object({
5876
5901
  id: external_exports.string(),