shred-api-client 2.6.2 → 2.6.4

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
@@ -1715,6 +1715,21 @@ type Style = {
1715
1715
  value: CaptionStyle;
1716
1716
  label: string;
1717
1717
  };
1718
+ declare enum InteractionType {
1719
+ VIDEO_PLAYED = "video_played",
1720
+ DOWNLOADED = "downloaded",
1721
+ SHARED = "shared"
1722
+ }
1723
+ declare const InteractionSchema: z.ZodObject<{
1724
+ type: z.ZodNativeEnum<typeof InteractionType>;
1725
+ timestamp: z.ZodNumber;
1726
+ }, "strip", z.ZodTypeAny, {
1727
+ type: InteractionType;
1728
+ timestamp: number;
1729
+ }, {
1730
+ type: InteractionType;
1731
+ timestamp: number;
1732
+ }>;
1718
1733
  declare const TimelineItemSchema: z.ZodObject<{
1719
1734
  status: z.ZodNativeEnum<typeof Status$1>;
1720
1735
  title: z.ZodString;
@@ -1877,6 +1892,16 @@ declare const ProjectSchema: z.ZodObject<{
1877
1892
  description: string;
1878
1893
  timestamp: number;
1879
1894
  }>, "many">;
1895
+ interactions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1896
+ type: z.ZodNativeEnum<typeof InteractionType>;
1897
+ timestamp: z.ZodNumber;
1898
+ }, "strip", z.ZodTypeAny, {
1899
+ type: InteractionType;
1900
+ timestamp: number;
1901
+ }, {
1902
+ type: InteractionType;
1903
+ timestamp: number;
1904
+ }>, "many">>;
1880
1905
  submitTimestamp: z.ZodNumber;
1881
1906
  tenantId: z.ZodOptional<z.ZodString>;
1882
1907
  status: z.ZodNativeEnum<typeof Status$1>;
@@ -1927,6 +1952,10 @@ declare const ProjectSchema: z.ZodObject<{
1927
1952
  } | null | undefined;
1928
1953
  captionSuggestion?: string | undefined;
1929
1954
  isFree?: boolean | undefined;
1955
+ interactions?: {
1956
+ type: InteractionType;
1957
+ timestamp: number;
1958
+ }[] | undefined;
1930
1959
  }, {
1931
1960
  id: string;
1932
1961
  userId: string;
@@ -1974,6 +2003,10 @@ declare const ProjectSchema: z.ZodObject<{
1974
2003
  } | null | undefined;
1975
2004
  captionSuggestion?: string | undefined;
1976
2005
  isFree?: boolean | undefined;
2006
+ interactions?: {
2007
+ type: InteractionType;
2008
+ timestamp: number;
2009
+ }[] | undefined;
1977
2010
  }>;
1978
2011
  type ProjectCreation = Pick<Project, "title" | "instructions" | "captionStyle" | "assets">;
1979
2012
  type SendToApproval = {
@@ -1988,6 +2021,7 @@ type Approve = {
1988
2021
  };
1989
2022
  type Project = z.infer<typeof ProjectSchema>;
1990
2023
  type TimelineItem = z.infer<typeof TimelineItemSchema>;
2024
+ type Interaction = z.infer<typeof InteractionSchema>;
1991
2025
  type Feedback = z.infer<typeof FeedbackSchema>;
1992
2026
 
1993
2027
  interface IAPI$6 {
@@ -2006,6 +2040,7 @@ interface IAPI$6 {
2006
2040
  rollback: (context: Context, projectId: string) => Promise<boolean>;
2007
2041
  getNext: (context: Context, userId: string) => Promise<Project | null>;
2008
2042
  getUserHistory: (context: Context, userId: string) => Promise<APIResponse<Project>>;
2043
+ interact: (context: Context, projectId: string, type: InteractionType) => Promise<boolean>;
2009
2044
  getPoolSize(context: Context): Promise<number>;
2010
2045
  permissions: {
2011
2046
  isEligibleForFreeProject(context: Context): Promise<boolean>;
@@ -2084,6 +2119,10 @@ declare const Endpoints$5: {
2084
2119
  uri: string;
2085
2120
  method: string;
2086
2121
  };
2122
+ Interact: {
2123
+ uri: string;
2124
+ method: string;
2125
+ };
2087
2126
  };
2088
2127
 
2089
2128
  type StatusConfigType = {
@@ -2123,6 +2162,10 @@ type index$7_CaptionStyle = CaptionStyle;
2123
2162
  declare const index$7_CaptionStyle: typeof CaptionStyle;
2124
2163
  type index$7_Feedback = Feedback;
2125
2164
  declare const index$7_FeedbackSchema: typeof FeedbackSchema;
2165
+ type index$7_Interaction = Interaction;
2166
+ declare const index$7_InteractionSchema: typeof InteractionSchema;
2167
+ type index$7_InteractionType = InteractionType;
2168
+ declare const index$7_InteractionType: typeof InteractionType;
2126
2169
  type index$7_ProjectCreation = ProjectCreation;
2127
2170
  declare const index$7_ProjectSchema: typeof ProjectSchema;
2128
2171
  type index$7_SendToApproval = SendToApproval;
@@ -2133,7 +2176,7 @@ declare const index$7_Styles: typeof Styles;
2133
2176
  type index$7_TimelineItem = TimelineItem;
2134
2177
  declare const index$7_TimelineItemSchema: typeof TimelineItemSchema;
2135
2178
  declare namespace index$7 {
2136
- export { type index$7_Approve as Approve, index$7_CaptionStyle as CaptionStyle, Endpoints$5 as Endpoints, type Project as Entity, type index$7_Feedback as Feedback, index$7_FeedbackSchema as FeedbackSchema, type IAPI$6 as IAPI, type index$7_ProjectCreation as ProjectCreation, index$7_ProjectSchema as ProjectSchema, type index$7_SendToApproval as SendToApproval, Status$1 as Status, index$7_StatusConfig as StatusConfig, type index$7_StatusConfigType as StatusConfigType, type index$7_Style as Style, index$7_Styles as Styles, type index$7_TimelineItem as TimelineItem, index$7_TimelineItemSchema as TimelineItemSchema };
2179
+ export { type index$7_Approve as Approve, index$7_CaptionStyle as CaptionStyle, Endpoints$5 as Endpoints, type Project as Entity, type index$7_Feedback as Feedback, index$7_FeedbackSchema as FeedbackSchema, type IAPI$6 as IAPI, type index$7_Interaction as Interaction, index$7_InteractionSchema as InteractionSchema, index$7_InteractionType as InteractionType, type index$7_ProjectCreation as ProjectCreation, index$7_ProjectSchema as ProjectSchema, type index$7_SendToApproval as SendToApproval, Status$1 as Status, index$7_StatusConfig as StatusConfig, type index$7_StatusConfigType as StatusConfigType, type index$7_Style as Style, index$7_Styles as Styles, type index$7_TimelineItem as TimelineItem, index$7_TimelineItemSchema as TimelineItemSchema };
2137
2180
  }
2138
2181
 
2139
2182
  declare const DailyMilestoneSchema: z.ZodObject<{
package/dist/index.js CHANGED
@@ -5052,6 +5052,8 @@ __export(project_exports, {
5052
5052
  CaptionStyle: () => CaptionStyle,
5053
5053
  Endpoints: () => Endpoints3,
5054
5054
  FeedbackSchema: () => FeedbackSchema,
5055
+ InteractionSchema: () => InteractionSchema,
5056
+ InteractionType: () => InteractionType,
5055
5057
  ProjectSchema: () => ProjectSchema,
5056
5058
  Status: () => Status2,
5057
5059
  StatusConfig: () => StatusConfig,
@@ -5110,6 +5112,16 @@ var Styles = [
5110
5112
  { value: 3 /* TWO_LINES_EMOJIS */, label: "Two Lines + Emojis" },
5111
5113
  { value: 4 /* HOME_HIGHLIGHT */, label: "Home Tour" }
5112
5114
  ];
5115
+ var InteractionType = /* @__PURE__ */ ((InteractionType2) => {
5116
+ InteractionType2["VIDEO_PLAYED"] = "video_played";
5117
+ InteractionType2["DOWNLOADED"] = "downloaded";
5118
+ InteractionType2["SHARED"] = "shared";
5119
+ return InteractionType2;
5120
+ })(InteractionType || {});
5121
+ var InteractionSchema = external_exports.object({
5122
+ type: external_exports.nativeEnum(InteractionType),
5123
+ timestamp: external_exports.number()
5124
+ });
5113
5125
  var TimelineItemSchema = external_exports.object({
5114
5126
  status: external_exports.nativeEnum(Status2),
5115
5127
  title: external_exports.string(),
@@ -5145,6 +5157,7 @@ var ProjectSchema = external_exports.object({
5145
5157
  expirationTimestamp: external_exports.number(),
5146
5158
  isFree: external_exports.boolean().optional(),
5147
5159
  timeline: external_exports.array(TimelineItemSchema),
5160
+ interactions: external_exports.array(InteractionSchema).optional(),
5148
5161
  submitTimestamp: external_exports.number(),
5149
5162
  tenantId: external_exports.string().optional(),
5150
5163
  status: external_exports.nativeEnum(Status2)
@@ -5175,7 +5188,8 @@ var Endpoints3 = {
5175
5188
  Deny: { uri: "/projects/:projectId/deny/", method: "POST" },
5176
5189
  Assign: { uri: "/projects/:projectId/assign/", method: "POST" },
5177
5190
  GetUserHistory: { uri: "/projects/user/:userId/history/", method: "GET" },
5178
- GetPoolSize: { uri: "/projects/pool/size/", method: "GET" }
5191
+ GetPoolSize: { uri: "/projects/pool/size/", method: "GET" },
5192
+ Interact: { uri: "/projects/:projectId/interactions/", method: "POST" }
5179
5193
  };
5180
5194
 
5181
5195
  // src/model/project/StatusConfig.ts
@@ -5570,6 +5584,18 @@ var ProjectAPI = class {
5570
5584
  );
5571
5585
  return data.success;
5572
5586
  }
5587
+ async interact(ctx, projectId, type) {
5588
+ const endpointData = Endpoints3.Interact;
5589
+ const endpoint = endpointData.uri.replace(":projectId", projectId);
5590
+ const data = await this.clientHTTP.makeRequest(
5591
+ this.env,
5592
+ endpoint,
5593
+ endpointData.method,
5594
+ { type },
5595
+ ctx
5596
+ );
5597
+ return data.success;
5598
+ }
5573
5599
  async start(context) {
5574
5600
  const endpointData = Endpoints3.StartEdition;
5575
5601
  const data = await this.clientHTTP.makeRequest(