shred-api-client 2.10.3 → 2.10.5
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 +74 -2
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2246,7 +2246,15 @@ type Approve = {
|
|
|
2246
2246
|
captionSuggestion: string;
|
|
2247
2247
|
feedback?: Feedback | null;
|
|
2248
2248
|
};
|
|
2249
|
+
declare const StreamTicketSchema: z.ZodObject<{
|
|
2250
|
+
ticket: z.ZodString;
|
|
2251
|
+
}, "strip", z.ZodTypeAny, {
|
|
2252
|
+
ticket: string;
|
|
2253
|
+
}, {
|
|
2254
|
+
ticket: string;
|
|
2255
|
+
}>;
|
|
2249
2256
|
type Project = z.infer<typeof ProjectSchema>;
|
|
2257
|
+
type StreamTicket = z.infer<typeof StreamTicketSchema>;
|
|
2250
2258
|
type TimelineItem = z.infer<typeof TimelineItemSchema>;
|
|
2251
2259
|
type Interaction = z.infer<typeof InteractionSchema>;
|
|
2252
2260
|
type Feedback = z.infer<typeof FeedbackSchema>;
|
|
@@ -2254,6 +2262,8 @@ type Rating = z.infer<typeof RatingSchema>;
|
|
|
2254
2262
|
type RatingInput = Pick<Rating, "score" | "tags" | "comment">;
|
|
2255
2263
|
|
|
2256
2264
|
interface IAPI$8 {
|
|
2265
|
+
/** Single-use credential for the SSE stream, which cannot carry a header. */
|
|
2266
|
+
streamTicket: (context: Context) => Promise<string>;
|
|
2257
2267
|
reorder: (context: Context, projectId: string, position: number) => Promise<boolean>;
|
|
2258
2268
|
find: (context: Context, projectId: string) => Promise<Project>;
|
|
2259
2269
|
create: (context: Context, data: ProjectCreation) => Promise<Project>;
|
|
@@ -2284,6 +2294,10 @@ declare const Endpoints$7: {
|
|
|
2284
2294
|
uri: string;
|
|
2285
2295
|
method: string;
|
|
2286
2296
|
};
|
|
2297
|
+
StreamTicket: {
|
|
2298
|
+
uri: string;
|
|
2299
|
+
method: string;
|
|
2300
|
+
};
|
|
2287
2301
|
List: {
|
|
2288
2302
|
uri: string;
|
|
2289
2303
|
method: string;
|
|
@@ -2425,12 +2439,14 @@ declare const index$9_RatingTag: typeof RatingTag;
|
|
|
2425
2439
|
type index$9_SendToApproval = SendToApproval;
|
|
2426
2440
|
declare const index$9_StatusConfig: typeof StatusConfig;
|
|
2427
2441
|
type index$9_StatusConfigType = StatusConfigType;
|
|
2442
|
+
type index$9_StreamTicket = StreamTicket;
|
|
2443
|
+
declare const index$9_StreamTicketSchema: typeof StreamTicketSchema;
|
|
2428
2444
|
type index$9_Style = Style;
|
|
2429
2445
|
declare const index$9_Styles: typeof Styles;
|
|
2430
2446
|
type index$9_TimelineItem = TimelineItem;
|
|
2431
2447
|
declare const index$9_TimelineItemSchema: typeof TimelineItemSchema;
|
|
2432
2448
|
declare namespace index$9 {
|
|
2433
|
-
export { type index$9_Approve as Approve, index$9_CaptionStyle as CaptionStyle, Endpoints$7 as Endpoints, type Project as Entity, type index$9_Feedback as Feedback, index$9_FeedbackSchema as FeedbackSchema, type IAPI$8 as IAPI, type index$9_Interaction as Interaction, index$9_InteractionSchema as InteractionSchema, index$9_InteractionType as InteractionType, type index$9_ProjectCreation as ProjectCreation, index$9_ProjectSchema as ProjectSchema, type index$9_Rating as Rating, type index$9_RatingInput as RatingInput, index$9_RatingSchema as RatingSchema, index$9_RatingTag as RatingTag, type index$9_SendToApproval as SendToApproval, Status$1 as Status, index$9_StatusConfig as StatusConfig, type index$9_StatusConfigType as StatusConfigType, type index$9_Style as Style, index$9_Styles as Styles, type index$9_TimelineItem as TimelineItem, index$9_TimelineItemSchema as TimelineItemSchema };
|
|
2449
|
+
export { type index$9_Approve as Approve, index$9_CaptionStyle as CaptionStyle, Endpoints$7 as Endpoints, type Project as Entity, type index$9_Feedback as Feedback, index$9_FeedbackSchema as FeedbackSchema, type IAPI$8 as IAPI, type index$9_Interaction as Interaction, index$9_InteractionSchema as InteractionSchema, index$9_InteractionType as InteractionType, type index$9_ProjectCreation as ProjectCreation, index$9_ProjectSchema as ProjectSchema, type index$9_Rating as Rating, type index$9_RatingInput as RatingInput, index$9_RatingSchema as RatingSchema, index$9_RatingTag as RatingTag, type index$9_SendToApproval as SendToApproval, Status$1 as Status, index$9_StatusConfig as StatusConfig, type index$9_StatusConfigType as StatusConfigType, type index$9_StreamTicket as StreamTicket, index$9_StreamTicketSchema as StreamTicketSchema, type index$9_Style as Style, index$9_Styles as Styles, type index$9_TimelineItem as TimelineItem, index$9_TimelineItemSchema as TimelineItemSchema };
|
|
2434
2450
|
}
|
|
2435
2451
|
|
|
2436
2452
|
declare const DailyMilestoneSchema: z.ZodObject<{
|
|
@@ -4082,6 +4098,53 @@ declare const UpdateShredUSessionSchema: z.ZodObject<{
|
|
|
4082
4098
|
durationMin?: number | undefined;
|
|
4083
4099
|
zoomUrl?: string | undefined;
|
|
4084
4100
|
}>;
|
|
4101
|
+
declare const PreviewShredUEmailSchema: z.ZodObject<{
|
|
4102
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
4103
|
+
topic: z.ZodString;
|
|
4104
|
+
startsAt: z.ZodNumber;
|
|
4105
|
+
durationMin: z.ZodNumber;
|
|
4106
|
+
timezone: z.ZodString;
|
|
4107
|
+
brief: z.ZodOptional<z.ZodObject<{
|
|
4108
|
+
hook: z.ZodString;
|
|
4109
|
+
intro: z.ZodArray<z.ZodString, "many">;
|
|
4110
|
+
topics: z.ZodArray<z.ZodString, "many">;
|
|
4111
|
+
signoff: z.ZodOptional<z.ZodString>;
|
|
4112
|
+
}, "strip", z.ZodTypeAny, {
|
|
4113
|
+
hook: string;
|
|
4114
|
+
intro: string[];
|
|
4115
|
+
topics: string[];
|
|
4116
|
+
signoff?: string | undefined;
|
|
4117
|
+
}, {
|
|
4118
|
+
hook: string;
|
|
4119
|
+
intro: string[];
|
|
4120
|
+
topics: string[];
|
|
4121
|
+
signoff?: string | undefined;
|
|
4122
|
+
}>>;
|
|
4123
|
+
}, "strip", z.ZodTypeAny, {
|
|
4124
|
+
timezone: string;
|
|
4125
|
+
topic: string;
|
|
4126
|
+
startsAt: number;
|
|
4127
|
+
durationMin: number;
|
|
4128
|
+
brief?: {
|
|
4129
|
+
hook: string;
|
|
4130
|
+
intro: string[];
|
|
4131
|
+
topics: string[];
|
|
4132
|
+
signoff?: string | undefined;
|
|
4133
|
+
} | undefined;
|
|
4134
|
+
sessionId?: string | undefined;
|
|
4135
|
+
}, {
|
|
4136
|
+
timezone: string;
|
|
4137
|
+
topic: string;
|
|
4138
|
+
startsAt: number;
|
|
4139
|
+
durationMin: number;
|
|
4140
|
+
brief?: {
|
|
4141
|
+
hook: string;
|
|
4142
|
+
intro: string[];
|
|
4143
|
+
topics: string[];
|
|
4144
|
+
signoff?: string | undefined;
|
|
4145
|
+
} | undefined;
|
|
4146
|
+
sessionId?: string | undefined;
|
|
4147
|
+
}>;
|
|
4085
4148
|
declare const SetShredUSessionRecordingSchema: z.ZodObject<{
|
|
4086
4149
|
recordingUrl: z.ZodString;
|
|
4087
4150
|
recordingThumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -4103,6 +4166,7 @@ type ShredUSessionCustomer = z.infer<typeof ShredUSessionCustomerSchema>;
|
|
|
4103
4166
|
type Create = z.infer<typeof CreateShredUSessionSchema>;
|
|
4104
4167
|
type Update = z.infer<typeof UpdateShredUSessionSchema>;
|
|
4105
4168
|
type SetRecording = z.infer<typeof SetShredUSessionRecordingSchema>;
|
|
4169
|
+
type PreviewEmail = z.infer<typeof PreviewShredUEmailSchema>;
|
|
4106
4170
|
|
|
4107
4171
|
interface IAPI$1 {
|
|
4108
4172
|
list: (ctx: Context) => Promise<ShredUSession[]>;
|
|
@@ -4113,6 +4177,7 @@ interface IAPI$1 {
|
|
|
4113
4177
|
update: (ctx: Context, id: string, data: Update) => Promise<void>;
|
|
4114
4178
|
cancel: (ctx: Context, id: string) => Promise<void>;
|
|
4115
4179
|
setRecording: (ctx: Context, id: string, data: SetRecording) => Promise<void>;
|
|
4180
|
+
previewEmail: (ctx: Context, data: PreviewEmail) => Promise<void>;
|
|
4116
4181
|
}
|
|
4117
4182
|
declare const Endpoints$1: {
|
|
4118
4183
|
List: {
|
|
@@ -4147,12 +4212,18 @@ declare const Endpoints$1: {
|
|
|
4147
4212
|
uri: string;
|
|
4148
4213
|
method: string;
|
|
4149
4214
|
};
|
|
4215
|
+
PreviewEmail: {
|
|
4216
|
+
uri: string;
|
|
4217
|
+
method: string;
|
|
4218
|
+
};
|
|
4150
4219
|
};
|
|
4151
4220
|
|
|
4152
4221
|
type index$3_Brief = Brief;
|
|
4153
4222
|
type index$3_Create = Create;
|
|
4154
4223
|
declare const index$3_CreateShredUBriefSchema: typeof CreateShredUBriefSchema;
|
|
4155
4224
|
declare const index$3_CreateShredUSessionSchema: typeof CreateShredUSessionSchema;
|
|
4225
|
+
type index$3_PreviewEmail = PreviewEmail;
|
|
4226
|
+
declare const index$3_PreviewShredUEmailSchema: typeof PreviewShredUEmailSchema;
|
|
4156
4227
|
type index$3_SessionAsset = SessionAsset;
|
|
4157
4228
|
declare const index$3_SessionAssetSchema: typeof SessionAssetSchema;
|
|
4158
4229
|
type index$3_SetRecording = SetRecording;
|
|
@@ -4166,7 +4237,7 @@ declare const index$3_ShredUSessionStatusSchema: typeof ShredUSessionStatusSchem
|
|
|
4166
4237
|
type index$3_Update = Update;
|
|
4167
4238
|
declare const index$3_UpdateShredUSessionSchema: typeof UpdateShredUSessionSchema;
|
|
4168
4239
|
declare namespace index$3 {
|
|
4169
|
-
export { type index$3_Brief as Brief, type index$3_Create as Create, index$3_CreateShredUBriefSchema as CreateShredUBriefSchema, index$3_CreateShredUSessionSchema as CreateShredUSessionSchema, Endpoints$1 as Endpoints, type ShredUSession as Entity, type IAPI$1 as IAPI, type index$3_SessionAsset as SessionAsset, index$3_SessionAssetSchema as SessionAssetSchema, type index$3_SetRecording as SetRecording, index$3_SetShredUSessionRecordingSchema as SetShredUSessionRecordingSchema, index$3_ShredUBriefSchema as ShredUBriefSchema, type index$3_ShredUSessionCustomer as ShredUSessionCustomer, index$3_ShredUSessionCustomerSchema as ShredUSessionCustomerSchema, index$3_ShredUSessionSchema as ShredUSessionSchema, type index$3_ShredUSessionStatus as ShredUSessionStatus, index$3_ShredUSessionStatusSchema as ShredUSessionStatusSchema, type index$3_Update as Update, index$3_UpdateShredUSessionSchema as UpdateShredUSessionSchema };
|
|
4240
|
+
export { type index$3_Brief as Brief, type index$3_Create as Create, index$3_CreateShredUBriefSchema as CreateShredUBriefSchema, index$3_CreateShredUSessionSchema as CreateShredUSessionSchema, Endpoints$1 as Endpoints, type ShredUSession as Entity, type IAPI$1 as IAPI, type index$3_PreviewEmail as PreviewEmail, index$3_PreviewShredUEmailSchema as PreviewShredUEmailSchema, type index$3_SessionAsset as SessionAsset, index$3_SessionAssetSchema as SessionAssetSchema, type index$3_SetRecording as SetRecording, index$3_SetShredUSessionRecordingSchema as SetShredUSessionRecordingSchema, index$3_ShredUBriefSchema as ShredUBriefSchema, type index$3_ShredUSessionCustomer as ShredUSessionCustomer, index$3_ShredUSessionCustomerSchema as ShredUSessionCustomerSchema, index$3_ShredUSessionSchema as ShredUSessionSchema, type index$3_ShredUSessionStatus as ShredUSessionStatus, index$3_ShredUSessionStatusSchema as ShredUSessionStatusSchema, type index$3_Update as Update, index$3_UpdateShredUSessionSchema as UpdateShredUSessionSchema };
|
|
4170
4241
|
}
|
|
4171
4242
|
|
|
4172
4243
|
/**
|
|
@@ -4236,6 +4307,7 @@ declare const Actions: {
|
|
|
4236
4307
|
readonly SHREDU_SESSION_UPDATE: "shredu.session.update";
|
|
4237
4308
|
readonly SHREDU_SESSION_CANCEL: "shredu.session.cancel";
|
|
4238
4309
|
readonly SHREDU_SESSION_SET_RECORDING: "shredu.session.set_recording";
|
|
4310
|
+
readonly SHREDU_SESSION_PREVIEW_EMAIL: "shredu.session.preview_email";
|
|
4239
4311
|
readonly SUBSCRIPTION_VIEW_USER: "subscription.view_user";
|
|
4240
4312
|
readonly SUBSCRIPTION_VIEW_SUMMARY: "subscription.view_summary";
|
|
4241
4313
|
readonly SUBSCRIPTION_LIST_PROMO_CODES: "subscription.list_promo_codes";
|
package/dist/index.js
CHANGED
|
@@ -5060,6 +5060,7 @@ __export(project_exports, {
|
|
|
5060
5060
|
RatingTag: () => RatingTag,
|
|
5061
5061
|
Status: () => Status2,
|
|
5062
5062
|
StatusConfig: () => StatusConfig,
|
|
5063
|
+
StreamTicketSchema: () => StreamTicketSchema,
|
|
5063
5064
|
Styles: () => Styles,
|
|
5064
5065
|
TimelineItemSchema: () => TimelineItemSchema
|
|
5065
5066
|
});
|
|
@@ -5184,10 +5185,12 @@ var ProjectSchema = external_exports.object({
|
|
|
5184
5185
|
tenantId: external_exports.string().optional(),
|
|
5185
5186
|
status: external_exports.nativeEnum(Status2)
|
|
5186
5187
|
});
|
|
5188
|
+
var StreamTicketSchema = external_exports.object({ ticket: external_exports.string().min(1) });
|
|
5187
5189
|
|
|
5188
5190
|
// src/model/project/Project.api.ts
|
|
5189
5191
|
var Endpoints3 = {
|
|
5190
5192
|
Reorder: { uri: "/projects/reorder/", method: "POST" },
|
|
5193
|
+
StreamTicket: { uri: "/projects/stream/ticket/", method: "POST" },
|
|
5191
5194
|
List: { uri: "/projects/list", method: "GET" },
|
|
5192
5195
|
Mine: { uri: "/projects/mine", method: "GET" },
|
|
5193
5196
|
Assigned: { uri: "/projects/assigned", method: "GET" },
|
|
@@ -5550,6 +5553,18 @@ var ProjectAPI = class {
|
|
|
5550
5553
|
);
|
|
5551
5554
|
return data.success;
|
|
5552
5555
|
}
|
|
5556
|
+
async streamTicket(ctx) {
|
|
5557
|
+
const endpointData = Endpoints3.StreamTicket;
|
|
5558
|
+
const data = await this.clientHTTP.makeRequest(
|
|
5559
|
+
this.env,
|
|
5560
|
+
endpointData.uri,
|
|
5561
|
+
endpointData.method,
|
|
5562
|
+
null,
|
|
5563
|
+
ctx,
|
|
5564
|
+
StreamTicketSchema
|
|
5565
|
+
);
|
|
5566
|
+
return data.ticket;
|
|
5567
|
+
}
|
|
5553
5568
|
async cancel(ctx, projectId) {
|
|
5554
5569
|
const endpointData = Endpoints3.Cancel;
|
|
5555
5570
|
const endpoint = endpointData.uri.replace(":projectId", projectId);
|
|
@@ -6090,6 +6105,10 @@ var Endpoints9 = {
|
|
|
6090
6105
|
SetRecording: {
|
|
6091
6106
|
uri: "/shredu/sessions/:id/recording",
|
|
6092
6107
|
method: "PUT"
|
|
6108
|
+
},
|
|
6109
|
+
PreviewEmail: {
|
|
6110
|
+
uri: "/shredu/sessions/preview-email",
|
|
6111
|
+
method: "POST"
|
|
6093
6112
|
}
|
|
6094
6113
|
};
|
|
6095
6114
|
|
|
@@ -6157,6 +6176,14 @@ var UpdateShredUSessionSchema = external_exports.object({
|
|
|
6157
6176
|
tenantIds: external_exports.array(external_exports.string().min(1)).optional(),
|
|
6158
6177
|
timezone: external_exports.string().min(1).optional()
|
|
6159
6178
|
});
|
|
6179
|
+
var PreviewShredUEmailSchema = external_exports.object({
|
|
6180
|
+
sessionId: external_exports.string().min(1).optional(),
|
|
6181
|
+
topic: external_exports.string().min(1),
|
|
6182
|
+
startsAt: external_exports.number().int().positive(),
|
|
6183
|
+
durationMin: external_exports.number().int().positive(),
|
|
6184
|
+
timezone: external_exports.string().min(1),
|
|
6185
|
+
brief: CreateShredUBriefSchema.optional()
|
|
6186
|
+
});
|
|
6160
6187
|
var SetShredUSessionRecordingSchema = external_exports.object({
|
|
6161
6188
|
recordingUrl: external_exports.string().url(),
|
|
6162
6189
|
recordingThumbnailUrl: external_exports.string().url().optional(),
|
|
@@ -6201,6 +6228,10 @@ var ShredUAPI = class {
|
|
|
6201
6228
|
const { uri, method } = Endpoints9.SetRecording;
|
|
6202
6229
|
await this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, data, ctx);
|
|
6203
6230
|
}
|
|
6231
|
+
async previewEmail(ctx, data) {
|
|
6232
|
+
const { uri, method } = Endpoints9.PreviewEmail;
|
|
6233
|
+
await this.clientHTTP.makeRequest(this.env, uri, method, data, ctx);
|
|
6234
|
+
}
|
|
6204
6235
|
};
|
|
6205
6236
|
var ShredU_api_default = ShredUAPI;
|
|
6206
6237
|
|
|
@@ -6286,6 +6317,7 @@ var Actions = {
|
|
|
6286
6317
|
SHREDU_SESSION_UPDATE: "shredu.session.update",
|
|
6287
6318
|
SHREDU_SESSION_CANCEL: "shredu.session.cancel",
|
|
6288
6319
|
SHREDU_SESSION_SET_RECORDING: "shredu.session.set_recording",
|
|
6320
|
+
SHREDU_SESSION_PREVIEW_EMAIL: "shredu.session.preview_email",
|
|
6289
6321
|
// — Subscriptions —
|
|
6290
6322
|
SUBSCRIPTION_VIEW_USER: "subscription.view_user",
|
|
6291
6323
|
SUBSCRIPTION_VIEW_SUMMARY: "subscription.view_summary",
|
|
@@ -6381,6 +6413,7 @@ var ActionCatalog = {
|
|
|
6381
6413
|
[Actions.SHREDU_SESSION_UPDATE]: { label: "Update a ShredU session", group: "ShredU" },
|
|
6382
6414
|
[Actions.SHREDU_SESSION_CANCEL]: { label: "Cancel a ShredU session", group: "ShredU" },
|
|
6383
6415
|
[Actions.SHREDU_SESSION_SET_RECORDING]: { label: "Attach a recording to a ShredU session", group: "ShredU" },
|
|
6416
|
+
[Actions.SHREDU_SESSION_PREVIEW_EMAIL]: { label: "Send themselves a preview of the ShredU reminder email", group: "ShredU" },
|
|
6384
6417
|
// Subscriptions
|
|
6385
6418
|
[Actions.SUBSCRIPTION_VIEW_USER]: { label: "View a user's subscription", group: "Subscriptions" },
|
|
6386
6419
|
[Actions.SUBSCRIPTION_VIEW_SUMMARY]: { label: "View a user's subscription summary", group: "Subscriptions" },
|
|
@@ -6986,6 +7019,7 @@ __export(shredu_exports, {
|
|
|
6986
7019
|
CreateShredUBriefSchema: () => CreateShredUBriefSchema,
|
|
6987
7020
|
CreateShredUSessionSchema: () => CreateShredUSessionSchema,
|
|
6988
7021
|
Endpoints: () => Endpoints9,
|
|
7022
|
+
PreviewShredUEmailSchema: () => PreviewShredUEmailSchema,
|
|
6989
7023
|
SessionAssetSchema: () => SessionAssetSchema,
|
|
6990
7024
|
SetShredUSessionRecordingSchema: () => SetShredUSessionRecordingSchema,
|
|
6991
7025
|
ShredUBriefSchema: () => ShredUBriefSchema,
|