shred-api-client 2.6.2 → 2.6.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 +43 -1
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1715,6 +1715,20 @@ 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
|
+
}
|
|
1722
|
+
declare const InteractionSchema: z.ZodObject<{
|
|
1723
|
+
type: z.ZodNativeEnum<typeof InteractionType>;
|
|
1724
|
+
timestamp: z.ZodNumber;
|
|
1725
|
+
}, "strip", z.ZodTypeAny, {
|
|
1726
|
+
type: InteractionType;
|
|
1727
|
+
timestamp: number;
|
|
1728
|
+
}, {
|
|
1729
|
+
type: InteractionType;
|
|
1730
|
+
timestamp: number;
|
|
1731
|
+
}>;
|
|
1718
1732
|
declare const TimelineItemSchema: z.ZodObject<{
|
|
1719
1733
|
status: z.ZodNativeEnum<typeof Status$1>;
|
|
1720
1734
|
title: z.ZodString;
|
|
@@ -1877,6 +1891,16 @@ declare const ProjectSchema: z.ZodObject<{
|
|
|
1877
1891
|
description: string;
|
|
1878
1892
|
timestamp: number;
|
|
1879
1893
|
}>, "many">;
|
|
1894
|
+
interactions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1895
|
+
type: z.ZodNativeEnum<typeof InteractionType>;
|
|
1896
|
+
timestamp: z.ZodNumber;
|
|
1897
|
+
}, "strip", z.ZodTypeAny, {
|
|
1898
|
+
type: InteractionType;
|
|
1899
|
+
timestamp: number;
|
|
1900
|
+
}, {
|
|
1901
|
+
type: InteractionType;
|
|
1902
|
+
timestamp: number;
|
|
1903
|
+
}>, "many">>;
|
|
1880
1904
|
submitTimestamp: z.ZodNumber;
|
|
1881
1905
|
tenantId: z.ZodOptional<z.ZodString>;
|
|
1882
1906
|
status: z.ZodNativeEnum<typeof Status$1>;
|
|
@@ -1927,6 +1951,10 @@ declare const ProjectSchema: z.ZodObject<{
|
|
|
1927
1951
|
} | null | undefined;
|
|
1928
1952
|
captionSuggestion?: string | undefined;
|
|
1929
1953
|
isFree?: boolean | undefined;
|
|
1954
|
+
interactions?: {
|
|
1955
|
+
type: InteractionType;
|
|
1956
|
+
timestamp: number;
|
|
1957
|
+
}[] | undefined;
|
|
1930
1958
|
}, {
|
|
1931
1959
|
id: string;
|
|
1932
1960
|
userId: string;
|
|
@@ -1974,6 +2002,10 @@ declare const ProjectSchema: z.ZodObject<{
|
|
|
1974
2002
|
} | null | undefined;
|
|
1975
2003
|
captionSuggestion?: string | undefined;
|
|
1976
2004
|
isFree?: boolean | undefined;
|
|
2005
|
+
interactions?: {
|
|
2006
|
+
type: InteractionType;
|
|
2007
|
+
timestamp: number;
|
|
2008
|
+
}[] | undefined;
|
|
1977
2009
|
}>;
|
|
1978
2010
|
type ProjectCreation = Pick<Project, "title" | "instructions" | "captionStyle" | "assets">;
|
|
1979
2011
|
type SendToApproval = {
|
|
@@ -1988,6 +2020,7 @@ type Approve = {
|
|
|
1988
2020
|
};
|
|
1989
2021
|
type Project = z.infer<typeof ProjectSchema>;
|
|
1990
2022
|
type TimelineItem = z.infer<typeof TimelineItemSchema>;
|
|
2023
|
+
type Interaction = z.infer<typeof InteractionSchema>;
|
|
1991
2024
|
type Feedback = z.infer<typeof FeedbackSchema>;
|
|
1992
2025
|
|
|
1993
2026
|
interface IAPI$6 {
|
|
@@ -2006,6 +2039,7 @@ interface IAPI$6 {
|
|
|
2006
2039
|
rollback: (context: Context, projectId: string) => Promise<boolean>;
|
|
2007
2040
|
getNext: (context: Context, userId: string) => Promise<Project | null>;
|
|
2008
2041
|
getUserHistory: (context: Context, userId: string) => Promise<APIResponse<Project>>;
|
|
2042
|
+
interact: (context: Context, projectId: string, type: InteractionType) => Promise<boolean>;
|
|
2009
2043
|
getPoolSize(context: Context): Promise<number>;
|
|
2010
2044
|
permissions: {
|
|
2011
2045
|
isEligibleForFreeProject(context: Context): Promise<boolean>;
|
|
@@ -2084,6 +2118,10 @@ declare const Endpoints$5: {
|
|
|
2084
2118
|
uri: string;
|
|
2085
2119
|
method: string;
|
|
2086
2120
|
};
|
|
2121
|
+
Interact: {
|
|
2122
|
+
uri: string;
|
|
2123
|
+
method: string;
|
|
2124
|
+
};
|
|
2087
2125
|
};
|
|
2088
2126
|
|
|
2089
2127
|
type StatusConfigType = {
|
|
@@ -2123,6 +2161,10 @@ type index$7_CaptionStyle = CaptionStyle;
|
|
|
2123
2161
|
declare const index$7_CaptionStyle: typeof CaptionStyle;
|
|
2124
2162
|
type index$7_Feedback = Feedback;
|
|
2125
2163
|
declare const index$7_FeedbackSchema: typeof FeedbackSchema;
|
|
2164
|
+
type index$7_Interaction = Interaction;
|
|
2165
|
+
declare const index$7_InteractionSchema: typeof InteractionSchema;
|
|
2166
|
+
type index$7_InteractionType = InteractionType;
|
|
2167
|
+
declare const index$7_InteractionType: typeof InteractionType;
|
|
2126
2168
|
type index$7_ProjectCreation = ProjectCreation;
|
|
2127
2169
|
declare const index$7_ProjectSchema: typeof ProjectSchema;
|
|
2128
2170
|
type index$7_SendToApproval = SendToApproval;
|
|
@@ -2133,7 +2175,7 @@ declare const index$7_Styles: typeof Styles;
|
|
|
2133
2175
|
type index$7_TimelineItem = TimelineItem;
|
|
2134
2176
|
declare const index$7_TimelineItemSchema: typeof TimelineItemSchema;
|
|
2135
2177
|
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 };
|
|
2178
|
+
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
2179
|
}
|
|
2138
2180
|
|
|
2139
2181
|
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,15 @@ 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
|
+
return InteractionType2;
|
|
5119
|
+
})(InteractionType || {});
|
|
5120
|
+
var InteractionSchema = external_exports.object({
|
|
5121
|
+
type: external_exports.nativeEnum(InteractionType),
|
|
5122
|
+
timestamp: external_exports.number()
|
|
5123
|
+
});
|
|
5113
5124
|
var TimelineItemSchema = external_exports.object({
|
|
5114
5125
|
status: external_exports.nativeEnum(Status2),
|
|
5115
5126
|
title: external_exports.string(),
|
|
@@ -5145,6 +5156,7 @@ var ProjectSchema = external_exports.object({
|
|
|
5145
5156
|
expirationTimestamp: external_exports.number(),
|
|
5146
5157
|
isFree: external_exports.boolean().optional(),
|
|
5147
5158
|
timeline: external_exports.array(TimelineItemSchema),
|
|
5159
|
+
interactions: external_exports.array(InteractionSchema).optional(),
|
|
5148
5160
|
submitTimestamp: external_exports.number(),
|
|
5149
5161
|
tenantId: external_exports.string().optional(),
|
|
5150
5162
|
status: external_exports.nativeEnum(Status2)
|
|
@@ -5175,7 +5187,8 @@ var Endpoints3 = {
|
|
|
5175
5187
|
Deny: { uri: "/projects/:projectId/deny/", method: "POST" },
|
|
5176
5188
|
Assign: { uri: "/projects/:projectId/assign/", method: "POST" },
|
|
5177
5189
|
GetUserHistory: { uri: "/projects/user/:userId/history/", method: "GET" },
|
|
5178
|
-
GetPoolSize: { uri: "/projects/pool/size/", method: "GET" }
|
|
5190
|
+
GetPoolSize: { uri: "/projects/pool/size/", method: "GET" },
|
|
5191
|
+
Interact: { uri: "/projects/:projectId/interactions/", method: "POST" }
|
|
5179
5192
|
};
|
|
5180
5193
|
|
|
5181
5194
|
// src/model/project/StatusConfig.ts
|
|
@@ -5570,6 +5583,18 @@ var ProjectAPI = class {
|
|
|
5570
5583
|
);
|
|
5571
5584
|
return data.success;
|
|
5572
5585
|
}
|
|
5586
|
+
async interact(ctx, projectId, type) {
|
|
5587
|
+
const endpointData = Endpoints3.Interact;
|
|
5588
|
+
const endpoint = endpointData.uri.replace(":projectId", projectId);
|
|
5589
|
+
const data = await this.clientHTTP.makeRequest(
|
|
5590
|
+
this.env,
|
|
5591
|
+
endpoint,
|
|
5592
|
+
endpointData.method,
|
|
5593
|
+
{ type },
|
|
5594
|
+
ctx
|
|
5595
|
+
);
|
|
5596
|
+
return data.success;
|
|
5597
|
+
}
|
|
5573
5598
|
async start(context) {
|
|
5574
5599
|
const endpointData = Endpoints3.StartEdition;
|
|
5575
5600
|
const data = await this.clientHTTP.makeRequest(
|