shred-api-client 2.9.6 → 2.9.8

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
@@ -1539,25 +1539,15 @@ declare enum Action$1 {
1539
1539
  ADD = "ADD",
1540
1540
  REMOVE = "REMOVE"
1541
1541
  }
1542
- declare const ReportViewerUpdateSchema: z.ZodObject<{
1543
- userId: z.ZodString;
1544
- action: z.ZodNativeEnum<typeof Action$1>;
1545
- }, "strip", z.ZodTypeAny, {
1546
- userId: string;
1547
- action: Action$1;
1548
- }, {
1549
- userId: string;
1550
- action: Action$1;
1551
- }>;
1552
1542
  declare const MemberUpdateSchema: z.ZodObject<{
1553
1543
  userIds: z.ZodArray<z.ZodString, "many">;
1554
1544
  action: z.ZodNativeEnum<typeof Action$1>;
1555
1545
  }, "strip", z.ZodTypeAny, {
1556
- action: Action$1;
1557
1546
  userIds: string[];
1558
- }, {
1559
1547
  action: Action$1;
1548
+ }, {
1560
1549
  userIds: string[];
1550
+ action: Action$1;
1561
1551
  }>;
1562
1552
  declare const TenantUpdateSchema: z.ZodObject<{
1563
1553
  preferences: z.ZodOptional<z.ZodObject<{
@@ -1705,7 +1695,6 @@ declare const TenantUpdateSchema: z.ZodObject<{
1705
1695
  } | undefined;
1706
1696
  reportUrl?: string | undefined;
1707
1697
  }>;
1708
- type ReportViewerUpdate = z.infer<typeof ReportViewerUpdateSchema>;
1709
1698
  type MemberUpdate = z.infer<typeof MemberUpdateSchema>;
1710
1699
  type TenantUpdate = z.infer<typeof TenantUpdateSchema>;
1711
1700
  type Tenant = z.infer<typeof TenantSchema>;
@@ -1719,7 +1708,6 @@ interface IAPI$a {
1719
1708
  getTenant: (context: Context, tenantId?: string) => Promise<Tenant | null>;
1720
1709
  getMembers: (context: Context, tenantId: string) => Promise<Member[]>;
1721
1710
  update: (tenantId: string, data: TenantUpdate, context: Context) => Promise<boolean>;
1722
- updateReportViewers: (tenantId: string, reportViewerUpdate: ReportViewerUpdate, context: Context) => Promise<boolean>;
1723
1711
  updateMembers: (tenantId: string, memberUpdate: MemberUpdate, context: Context) => Promise<boolean>;
1724
1712
  }
1725
1713
  declare const Endpoints$9: {
@@ -1751,10 +1739,6 @@ declare const Endpoints$9: {
1751
1739
  uri: string;
1752
1740
  method: string;
1753
1741
  };
1754
- UpdateReportViewers: {
1755
- uri: string;
1756
- method: string;
1757
- };
1758
1742
  UpdateMembers: {
1759
1743
  uri: string;
1760
1744
  method: string;
@@ -1767,13 +1751,11 @@ type index$b_MemberUpdate = MemberUpdate;
1767
1751
  declare const index$b_MemberUpdateSchema: typeof MemberUpdateSchema;
1768
1752
  type index$b_Preferences = Preferences;
1769
1753
  declare const index$b_PreferencesSchema: typeof PreferencesSchema;
1770
- type index$b_ReportViewerUpdate = ReportViewerUpdate;
1771
- declare const index$b_ReportViewerUpdateSchema: typeof ReportViewerUpdateSchema;
1772
1754
  declare const index$b_TenantSchema: typeof TenantSchema;
1773
1755
  type index$b_TenantUpdate = TenantUpdate;
1774
1756
  declare const index$b_TenantUpdateSchema: typeof TenantUpdateSchema;
1775
1757
  declare namespace index$b {
1776
- export { Action$1 as Action, Endpoints$9 as Endpoints, type Tenant as Entity, type IAPI$a as IAPI, type index$b_Member as Member, index$b_MemberSchema as MemberSchema, type index$b_MemberUpdate as MemberUpdate, index$b_MemberUpdateSchema as MemberUpdateSchema, type index$b_Preferences as Preferences, index$b_PreferencesSchema as PreferencesSchema, type index$b_ReportViewerUpdate as ReportViewerUpdate, index$b_ReportViewerUpdateSchema as ReportViewerUpdateSchema, index$b_TenantSchema as TenantSchema, type index$b_TenantUpdate as TenantUpdate, index$b_TenantUpdateSchema as TenantUpdateSchema };
1758
+ export { Action$1 as Action, Endpoints$9 as Endpoints, type Tenant as Entity, type IAPI$a as IAPI, type index$b_Member as Member, index$b_MemberSchema as MemberSchema, type index$b_MemberUpdate as MemberUpdate, index$b_MemberUpdateSchema as MemberUpdateSchema, type index$b_Preferences as Preferences, index$b_PreferencesSchema as PreferencesSchema, index$b_TenantSchema as TenantSchema, type index$b_TenantUpdate as TenantUpdate, index$b_TenantUpdateSchema as TenantUpdateSchema };
1777
1759
  }
1778
1760
 
1779
1761
  declare const TrackParamSchema: z.ZodObject<{
@@ -1958,6 +1940,22 @@ declare const FeedbackSchema: z.ZodObject<{
1958
1940
  }[];
1959
1941
  comment?: string | undefined;
1960
1942
  }>;
1943
+ declare const RatingSchema: z.ZodObject<{
1944
+ score: z.ZodNumber;
1945
+ comment: z.ZodOptional<z.ZodString>;
1946
+ timestamp: z.ZodNumber;
1947
+ deliveryIndex: z.ZodNumber;
1948
+ }, "strip", z.ZodTypeAny, {
1949
+ timestamp: number;
1950
+ score: number;
1951
+ deliveryIndex: number;
1952
+ comment?: string | undefined;
1953
+ }, {
1954
+ timestamp: number;
1955
+ score: number;
1956
+ deliveryIndex: number;
1957
+ comment?: string | undefined;
1958
+ }>;
1961
1959
  declare const ProjectSchema: z.ZodObject<{
1962
1960
  id: z.ZodString;
1963
1961
  title: z.ZodString;
@@ -2076,6 +2074,22 @@ declare const ProjectSchema: z.ZodObject<{
2076
2074
  type: InteractionType;
2077
2075
  timestamp: number;
2078
2076
  }>, "many">>;
2077
+ ratings: z.ZodOptional<z.ZodArray<z.ZodObject<{
2078
+ score: z.ZodNumber;
2079
+ comment: z.ZodOptional<z.ZodString>;
2080
+ timestamp: z.ZodNumber;
2081
+ deliveryIndex: z.ZodNumber;
2082
+ }, "strip", z.ZodTypeAny, {
2083
+ timestamp: number;
2084
+ score: number;
2085
+ deliveryIndex: number;
2086
+ comment?: string | undefined;
2087
+ }, {
2088
+ timestamp: number;
2089
+ score: number;
2090
+ deliveryIndex: number;
2091
+ comment?: string | undefined;
2092
+ }>, "many">>;
2079
2093
  submitTimestamp: z.ZodNumber;
2080
2094
  tenantId: z.ZodOptional<z.ZodString>;
2081
2095
  status: z.ZodNativeEnum<typeof Status$1>;
@@ -2130,6 +2144,12 @@ declare const ProjectSchema: z.ZodObject<{
2130
2144
  type: InteractionType;
2131
2145
  timestamp: number;
2132
2146
  }[] | undefined;
2147
+ ratings?: {
2148
+ timestamp: number;
2149
+ score: number;
2150
+ deliveryIndex: number;
2151
+ comment?: string | undefined;
2152
+ }[] | undefined;
2133
2153
  }, {
2134
2154
  id: string;
2135
2155
  userId: string;
@@ -2181,6 +2201,12 @@ declare const ProjectSchema: z.ZodObject<{
2181
2201
  type: InteractionType;
2182
2202
  timestamp: number;
2183
2203
  }[] | undefined;
2204
+ ratings?: {
2205
+ timestamp: number;
2206
+ score: number;
2207
+ deliveryIndex: number;
2208
+ comment?: string | undefined;
2209
+ }[] | undefined;
2184
2210
  }>;
2185
2211
  type ProjectCreation = Pick<Project, "title" | "instructions" | "captionStyle" | "assets">;
2186
2212
  type SendToApproval = {
@@ -2197,6 +2223,8 @@ type Project = z.infer<typeof ProjectSchema>;
2197
2223
  type TimelineItem = z.infer<typeof TimelineItemSchema>;
2198
2224
  type Interaction = z.infer<typeof InteractionSchema>;
2199
2225
  type Feedback = z.infer<typeof FeedbackSchema>;
2226
+ type Rating = z.infer<typeof RatingSchema>;
2227
+ type RatingInput = Pick<Rating, "score" | "comment">;
2200
2228
 
2201
2229
  interface IAPI$7 {
2202
2230
  reorder: (context: Context, projectId: string, position: number) => Promise<boolean>;
@@ -2218,6 +2246,7 @@ interface IAPI$7 {
2218
2246
  getNext: (context: Context, userId: string) => Promise<Project | null>;
2219
2247
  getUserHistory: (context: Context, userId: string) => Promise<APIResponse<Project>>;
2220
2248
  interact: (context: Context, projectId: string, type: InteractionType) => Promise<boolean>;
2249
+ rate: (context: Context, projectId: string, data: RatingInput) => Promise<boolean>;
2221
2250
  getPoolSize(context: Context): Promise<number>;
2222
2251
  permissions: {
2223
2252
  isEligibleForFreeProject(context: Context): Promise<boolean>;
@@ -2312,6 +2341,10 @@ declare const Endpoints$6: {
2312
2341
  uri: string;
2313
2342
  method: string;
2314
2343
  };
2344
+ Rate: {
2345
+ uri: string;
2346
+ method: string;
2347
+ };
2315
2348
  };
2316
2349
 
2317
2350
  type StatusConfigType = {
@@ -2357,6 +2390,9 @@ type index$8_InteractionType = InteractionType;
2357
2390
  declare const index$8_InteractionType: typeof InteractionType;
2358
2391
  type index$8_ProjectCreation = ProjectCreation;
2359
2392
  declare const index$8_ProjectSchema: typeof ProjectSchema;
2393
+ type index$8_Rating = Rating;
2394
+ type index$8_RatingInput = RatingInput;
2395
+ declare const index$8_RatingSchema: typeof RatingSchema;
2360
2396
  type index$8_SendToApproval = SendToApproval;
2361
2397
  declare const index$8_StatusConfig: typeof StatusConfig;
2362
2398
  type index$8_StatusConfigType = StatusConfigType;
@@ -2365,7 +2401,7 @@ declare const index$8_Styles: typeof Styles;
2365
2401
  type index$8_TimelineItem = TimelineItem;
2366
2402
  declare const index$8_TimelineItemSchema: typeof TimelineItemSchema;
2367
2403
  declare namespace index$8 {
2368
- export { type index$8_Approve as Approve, index$8_CaptionStyle as CaptionStyle, Endpoints$6 as Endpoints, type Project as Entity, type index$8_Feedback as Feedback, index$8_FeedbackSchema as FeedbackSchema, type IAPI$7 as IAPI, type index$8_Interaction as Interaction, index$8_InteractionSchema as InteractionSchema, index$8_InteractionType as InteractionType, type index$8_ProjectCreation as ProjectCreation, index$8_ProjectSchema as ProjectSchema, type index$8_SendToApproval as SendToApproval, Status$1 as Status, index$8_StatusConfig as StatusConfig, type index$8_StatusConfigType as StatusConfigType, type index$8_Style as Style, index$8_Styles as Styles, type index$8_TimelineItem as TimelineItem, index$8_TimelineItemSchema as TimelineItemSchema };
2404
+ export { type index$8_Approve as Approve, index$8_CaptionStyle as CaptionStyle, Endpoints$6 as Endpoints, type Project as Entity, type index$8_Feedback as Feedback, index$8_FeedbackSchema as FeedbackSchema, type IAPI$7 as IAPI, type index$8_Interaction as Interaction, index$8_InteractionSchema as InteractionSchema, index$8_InteractionType as InteractionType, type index$8_ProjectCreation as ProjectCreation, index$8_ProjectSchema as ProjectSchema, type index$8_Rating as Rating, type index$8_RatingInput as RatingInput, index$8_RatingSchema as RatingSchema, type index$8_SendToApproval as SendToApproval, Status$1 as Status, index$8_StatusConfig as StatusConfig, type index$8_StatusConfigType as StatusConfigType, type index$8_Style as Style, index$8_Styles as Styles, type index$8_TimelineItem as TimelineItem, index$8_TimelineItemSchema as TimelineItemSchema };
2369
2405
  }
2370
2406
 
2371
2407
  declare const DailyMilestoneSchema: z.ZodObject<{
@@ -3446,6 +3482,7 @@ declare const Actions: {
3446
3482
  readonly PROJECT_REORDER: "project.reorder";
3447
3483
  readonly PROJECT_REQUEST_REVIEW: "project.request_review";
3448
3484
  readonly PROJECT_RECORD_INTERACTION: "project.record_interaction";
3485
+ readonly PROJECT_RATE: "project.rate";
3449
3486
  readonly PROJECT_CHECK_FREE_QUOTA: "project.check_free_quota";
3450
3487
  readonly EDITOR_LIST: "editor.list";
3451
3488
  readonly EDITOR_GET: "editor.get";
@@ -3468,7 +3505,6 @@ declare const Actions: {
3468
3505
  readonly TENANT_UPDATE: "tenant.update";
3469
3506
  readonly TENANT_VIEW_MEMBERS: "tenant.view_members";
3470
3507
  readonly TENANT_UPDATE_MEMBERS: "tenant.update_members";
3471
- readonly TENANT_UPDATE_REPORT_VIEWERS: "tenant.update_report_viewers";
3472
3508
  readonly TENANT_VIEW_REPORT: "tenant.view_report";
3473
3509
  readonly TENANT_VIEW_MINE: "tenant.view_mine";
3474
3510
  readonly OFFER_LIST: "offer.list";
package/dist/index.js CHANGED
@@ -4774,18 +4774,6 @@ var TenantAPI = class {
4774
4774
  );
4775
4775
  return data;
4776
4776
  }
4777
- async updateReportViewers(tenantId, reportViewerUpdate, context) {
4778
- const endpointInfo = tenant_exports.Endpoints.UpdateReportViewers;
4779
- const endpoint = endpointInfo.uri.replace(":tenantId", tenantId);
4780
- const data = await this.clientHTTP.makeRequest(
4781
- this.env,
4782
- `${endpoint}`,
4783
- endpointInfo.method,
4784
- reportViewerUpdate,
4785
- context
4786
- );
4787
- return data;
4788
- }
4789
4777
  async updateMembers(tenantId, memberUpdate, context) {
4790
4778
  const endpointInfo = tenant_exports.Endpoints.UpdateMembers;
4791
4779
  const endpoint = endpointInfo.uri.replace(":tenantId", tenantId);
@@ -5067,6 +5055,7 @@ __export(project_exports, {
5067
5055
  InteractionSchema: () => InteractionSchema,
5068
5056
  InteractionType: () => InteractionType,
5069
5057
  ProjectSchema: () => ProjectSchema,
5058
+ RatingSchema: () => RatingSchema,
5070
5059
  Status: () => Status2,
5071
5060
  StatusConfig: () => StatusConfig,
5072
5061
  Styles: () => Styles,
@@ -5152,6 +5141,12 @@ var FeedbackSchema = external_exports.object({
5152
5141
  ),
5153
5142
  comment: external_exports.string().optional()
5154
5143
  });
5144
+ var RatingSchema = external_exports.object({
5145
+ score: external_exports.number().int().min(1).max(5),
5146
+ comment: external_exports.string().max(500).optional(),
5147
+ timestamp: external_exports.number(),
5148
+ deliveryIndex: external_exports.number().int().min(0)
5149
+ });
5155
5150
  var ProjectSchema = external_exports.object({
5156
5151
  id: external_exports.string(),
5157
5152
  title: external_exports.string(),
@@ -5170,6 +5165,7 @@ var ProjectSchema = external_exports.object({
5170
5165
  isFree: external_exports.boolean().optional(),
5171
5166
  timeline: external_exports.array(TimelineItemSchema),
5172
5167
  interactions: external_exports.array(InteractionSchema).optional(),
5168
+ ratings: external_exports.array(RatingSchema).optional(),
5173
5169
  submitTimestamp: external_exports.number(),
5174
5170
  tenantId: external_exports.string().optional(),
5175
5171
  status: external_exports.nativeEnum(Status2)
@@ -5204,7 +5200,8 @@ var Endpoints3 = {
5204
5200
  Assign: { uri: "/projects/:projectId/assign/", method: "POST" },
5205
5201
  GetUserHistory: { uri: "/projects/user/:userId/history/", method: "GET" },
5206
5202
  GetPoolSize: { uri: "/projects/pool/size/", method: "GET" },
5207
- Interact: { uri: "/projects/:projectId/interactions/", method: "POST" }
5203
+ Interact: { uri: "/projects/:projectId/interactions/", method: "POST" },
5204
+ Rate: { uri: "/projects/:projectId/rating/", method: "POST" }
5208
5205
  };
5209
5206
 
5210
5207
  // src/model/project/StatusConfig.ts
@@ -5630,6 +5627,18 @@ var ProjectAPI = class {
5630
5627
  );
5631
5628
  return data.success;
5632
5629
  }
5630
+ async rate(ctx, projectId, data) {
5631
+ const endpointData = Endpoints3.Rate;
5632
+ const endpoint = endpointData.uri.replace(":projectId", projectId);
5633
+ const result = await this.clientHTTP.makeRequest(
5634
+ this.env,
5635
+ endpoint,
5636
+ endpointData.method,
5637
+ data,
5638
+ ctx
5639
+ );
5640
+ return result.success;
5641
+ }
5633
5642
  async start(context) {
5634
5643
  const endpointData = Endpoints3.StartEdition;
5635
5644
  const data = await this.clientHTTP.makeRequest(
@@ -6068,6 +6077,7 @@ var Actions = {
6068
6077
  PROJECT_REORDER: "project.reorder",
6069
6078
  PROJECT_REQUEST_REVIEW: "project.request_review",
6070
6079
  PROJECT_RECORD_INTERACTION: "project.record_interaction",
6080
+ PROJECT_RATE: "project.rate",
6071
6081
  PROJECT_CHECK_FREE_QUOTA: "project.check_free_quota",
6072
6082
  // — Editors —
6073
6083
  EDITOR_LIST: "editor.list",
@@ -6095,7 +6105,6 @@ var Actions = {
6095
6105
  TENANT_UPDATE: "tenant.update",
6096
6106
  TENANT_VIEW_MEMBERS: "tenant.view_members",
6097
6107
  TENANT_UPDATE_MEMBERS: "tenant.update_members",
6098
- TENANT_UPDATE_REPORT_VIEWERS: "tenant.update_report_viewers",
6099
6108
  TENANT_VIEW_REPORT: "tenant.view_report",
6100
6109
  TENANT_VIEW_MINE: "tenant.view_mine",
6101
6110
  // — Offers —
@@ -6156,6 +6165,7 @@ var ActionCatalog = {
6156
6165
  [Actions.PROJECT_REORDER]: { label: "Reorder your own projects", group: "Projects" },
6157
6166
  [Actions.PROJECT_REQUEST_REVIEW]: { label: "Request a review on your own project", group: "Projects" },
6158
6167
  [Actions.PROJECT_RECORD_INTERACTION]: { label: "Record an interaction on your own project", group: "Projects" },
6168
+ [Actions.PROJECT_RATE]: { label: "Rate a delivered video on your own project", group: "Projects" },
6159
6169
  [Actions.PROJECT_CHECK_FREE_QUOTA]: { label: "Check your own free-project quota", group: "Projects" },
6160
6170
  // Editors (staff)
6161
6171
  [Actions.EDITOR_LIST]: { label: "List all editors", group: "Editors" },
@@ -6183,7 +6193,6 @@ var ActionCatalog = {
6183
6193
  [Actions.TENANT_UPDATE]: { label: "Update any tenant", group: "Tenants" },
6184
6194
  [Actions.TENANT_VIEW_MEMBERS]: { label: "View a tenant's members", group: "Tenants" },
6185
6195
  [Actions.TENANT_UPDATE_MEMBERS]: { label: "Manage a tenant's members", group: "Tenants" },
6186
- [Actions.TENANT_UPDATE_REPORT_VIEWERS]: { label: "Manage a tenant's report viewers", group: "Tenants" },
6187
6196
  [Actions.TENANT_VIEW_REPORT]: { label: "View a tenant's report", group: "Tenants", scopeable: true },
6188
6197
  [Actions.TENANT_VIEW_MINE]: { label: "View your own tenant", group: "Tenants" },
6189
6198
  // Offers
@@ -6440,7 +6449,6 @@ __export(tenant_exports, {
6440
6449
  MemberSchema: () => MemberSchema,
6441
6450
  MemberUpdateSchema: () => MemberUpdateSchema,
6442
6451
  PreferencesSchema: () => PreferencesSchema,
6443
- ReportViewerUpdateSchema: () => ReportViewerUpdateSchema,
6444
6452
  TenantSchema: () => TenantSchema,
6445
6453
  TenantUpdateSchema: () => TenantUpdateSchema
6446
6454
  });
@@ -6555,10 +6563,6 @@ var Action = /* @__PURE__ */ ((Action2) => {
6555
6563
  Action2["REMOVE"] = "REMOVE";
6556
6564
  return Action2;
6557
6565
  })(Action || {});
6558
- var ReportViewerUpdateSchema = external_exports.object({
6559
- userId: external_exports.string(),
6560
- action: external_exports.nativeEnum(Action)
6561
- });
6562
6566
  var MemberUpdateSchema = external_exports.object({
6563
6567
  userIds: external_exports.array(external_exports.string()),
6564
6568
  action: external_exports.nativeEnum(Action)
@@ -6598,10 +6602,6 @@ var Endpoints11 = {
6598
6602
  uri: "/tenants/:tenantId/members",
6599
6603
  method: "GET"
6600
6604
  },
6601
- UpdateReportViewers: {
6602
- uri: "/tenants/:tenantId/report-viewers",
6603
- method: "PUT"
6604
- },
6605
6605
  UpdateMembers: {
6606
6606
  uri: "/tenants/:tenantId/members",
6607
6607
  method: "PUT"