shred-api-client 2.10.6 → 2.11.1
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 +874 -189
- package/dist/index.js +133 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
Project: () => project_exports,
|
|
42
42
|
Prompt: () => prompt_exports,
|
|
43
43
|
RBAC: () => rbac_exports,
|
|
44
|
+
Score: () => score_exports,
|
|
44
45
|
ShredAPI: () => ShredAPI,
|
|
45
46
|
ShredU: () => shredu_exports,
|
|
46
47
|
SpecialOffer: () => special_offer_exports,
|
|
@@ -6113,6 +6114,10 @@ var Endpoints9 = {
|
|
|
6113
6114
|
PreviewEmail: {
|
|
6114
6115
|
uri: "/shredu/sessions/preview-email",
|
|
6115
6116
|
method: "POST"
|
|
6117
|
+
},
|
|
6118
|
+
GetDispatchRules: {
|
|
6119
|
+
uri: "/shredu/dispatch-rules",
|
|
6120
|
+
method: "GET"
|
|
6116
6121
|
}
|
|
6117
6122
|
};
|
|
6118
6123
|
|
|
@@ -6196,6 +6201,17 @@ var SetShredUSessionRecordingSchema = external_exports.object({
|
|
|
6196
6201
|
recordingThumbnailUrl: external_exports.string().url().optional(),
|
|
6197
6202
|
recordingDurationSeconds: external_exports.number().int().positive()
|
|
6198
6203
|
});
|
|
6204
|
+
var ShredUStageRuleSchema = external_exports.object({
|
|
6205
|
+
id: external_exports.string(),
|
|
6206
|
+
label: external_exports.string(),
|
|
6207
|
+
/** How long before the session starts this goes out. 0 means at start. */
|
|
6208
|
+
leadMs: external_exports.number(),
|
|
6209
|
+
transport: external_exports.nativeEnum(TransportType)
|
|
6210
|
+
});
|
|
6211
|
+
var ShredUDispatchRulesSchema = external_exports.object({
|
|
6212
|
+
/** Furthest ahead first, the order they fire in. */
|
|
6213
|
+
stages: external_exports.array(ShredUStageRuleSchema)
|
|
6214
|
+
});
|
|
6199
6215
|
|
|
6200
6216
|
// src/api/ShredU.api.ts
|
|
6201
6217
|
var ShredUAPI = class {
|
|
@@ -6243,15 +6259,96 @@ var ShredUAPI = class {
|
|
|
6243
6259
|
const { uri, method } = Endpoints9.PreviewEmail;
|
|
6244
6260
|
await this.clientHTTP.makeRequest(this.env, uri, method, data, ctx);
|
|
6245
6261
|
}
|
|
6262
|
+
async getDispatchRules(ctx) {
|
|
6263
|
+
const { uri, method } = Endpoints9.GetDispatchRules;
|
|
6264
|
+
return this.clientHTTP.makeRequest(this.env, uri, method, null, ctx, ShredUDispatchRulesSchema);
|
|
6265
|
+
}
|
|
6246
6266
|
};
|
|
6247
6267
|
var ShredU_api_default = ShredUAPI;
|
|
6248
6268
|
|
|
6269
|
+
// src/model/score/Score.api.ts
|
|
6270
|
+
var Endpoints10 = {
|
|
6271
|
+
GetRecap: { uri: "/score/", method: "GET" }
|
|
6272
|
+
};
|
|
6273
|
+
|
|
6274
|
+
// src/model/score/Score.schema.ts
|
|
6275
|
+
var ScoreMetricKeySchema = external_exports.enum([
|
|
6276
|
+
"submissions",
|
|
6277
|
+
"interactions",
|
|
6278
|
+
"attendance"
|
|
6279
|
+
]);
|
|
6280
|
+
var ScoreBandSchema = external_exports.object({
|
|
6281
|
+
key: external_exports.string(),
|
|
6282
|
+
label: external_exports.string(),
|
|
6283
|
+
min: external_exports.number(),
|
|
6284
|
+
max: external_exports.number()
|
|
6285
|
+
});
|
|
6286
|
+
var ScoreMetricSchema = external_exports.object({
|
|
6287
|
+
/**
|
|
6288
|
+
* Deliberately not the enum: a metric added API-side must not break a client that
|
|
6289
|
+
* predates it. Render the array generically and switch on ScoreMetricKey only where
|
|
6290
|
+
* a known metric needs special treatment.
|
|
6291
|
+
*/
|
|
6292
|
+
key: external_exports.string(),
|
|
6293
|
+
/** The share this metric actually carried, after unavailable ones were left out. */
|
|
6294
|
+
weight: external_exports.number(),
|
|
6295
|
+
value: external_exports.number(),
|
|
6296
|
+
target: external_exports.number(),
|
|
6297
|
+
ratio: external_exports.number(),
|
|
6298
|
+
available: external_exports.boolean(),
|
|
6299
|
+
rating: ScoreBandSchema.optional()
|
|
6300
|
+
});
|
|
6301
|
+
var ScoreSchema = external_exports.object({
|
|
6302
|
+
value: external_exports.number(),
|
|
6303
|
+
hasData: external_exports.boolean(),
|
|
6304
|
+
period: external_exports.string(),
|
|
6305
|
+
periodLabel: external_exports.string(),
|
|
6306
|
+
band: ScoreBandSchema.optional(),
|
|
6307
|
+
nextBand: ScoreBandSchema.optional(),
|
|
6308
|
+
pointsToNextBand: external_exports.number().optional(),
|
|
6309
|
+
trend: external_exports.number().optional(),
|
|
6310
|
+
computedAt: external_exports.number(),
|
|
6311
|
+
metrics: external_exports.array(ScoreMetricSchema)
|
|
6312
|
+
});
|
|
6313
|
+
var ScoreHistoryEntrySchema = external_exports.object({
|
|
6314
|
+
period: external_exports.string(),
|
|
6315
|
+
label: external_exports.string(),
|
|
6316
|
+
value: external_exports.number(),
|
|
6317
|
+
band: ScoreBandSchema.optional()
|
|
6318
|
+
});
|
|
6319
|
+
var ScoreRecapSchema = external_exports.object({
|
|
6320
|
+
current: ScoreSchema,
|
|
6321
|
+
/** Oldest first. Months before the customer's first project are absent, not zero. */
|
|
6322
|
+
history: external_exports.array(ScoreHistoryEntrySchema)
|
|
6323
|
+
});
|
|
6324
|
+
|
|
6325
|
+
// src/api/Score.api.ts
|
|
6326
|
+
var ScoreAPI = class {
|
|
6327
|
+
constructor(env) {
|
|
6328
|
+
this.env = env;
|
|
6329
|
+
this.clientHTTP = new HTTPClient();
|
|
6330
|
+
}
|
|
6331
|
+
async getRecap(ctx, period) {
|
|
6332
|
+
const { uri, method } = Endpoints10.GetRecap;
|
|
6333
|
+
const endpoint = period ? `${uri}?period=${encodeURIComponent(period)}` : uri;
|
|
6334
|
+
return this.clientHTTP.makeRequest(
|
|
6335
|
+
this.env,
|
|
6336
|
+
endpoint,
|
|
6337
|
+
method,
|
|
6338
|
+
null,
|
|
6339
|
+
ctx,
|
|
6340
|
+
ScoreRecapSchema
|
|
6341
|
+
);
|
|
6342
|
+
}
|
|
6343
|
+
};
|
|
6344
|
+
var Score_api_default = ScoreAPI;
|
|
6345
|
+
|
|
6249
6346
|
// src/model/rbac/index.ts
|
|
6250
6347
|
var rbac_exports = {};
|
|
6251
6348
|
__export(rbac_exports, {
|
|
6252
6349
|
ActionCatalog: () => ActionCatalog,
|
|
6253
6350
|
Actions: () => Actions,
|
|
6254
|
-
Endpoints: () =>
|
|
6351
|
+
Endpoints: () => Endpoints11,
|
|
6255
6352
|
PrincipalSchema: () => PrincipalSchema,
|
|
6256
6353
|
RoleAssignmentSchema: () => RoleAssignmentSchema,
|
|
6257
6354
|
RoleGrantSchema: () => RoleGrantSchema,
|
|
@@ -6495,7 +6592,7 @@ var PrincipalSchema = external_exports.object({
|
|
|
6495
6592
|
});
|
|
6496
6593
|
|
|
6497
6594
|
// src/model/rbac/RBAC.api.ts
|
|
6498
|
-
var
|
|
6595
|
+
var Endpoints11 = {
|
|
6499
6596
|
GetActions: { uri: "/rbac/actions", method: "GET" },
|
|
6500
6597
|
ListRoles: { uri: "/rbac/roles", method: "GET" },
|
|
6501
6598
|
CreateRole: { uri: "/rbac/roles", method: "POST" },
|
|
@@ -6514,29 +6611,29 @@ var RBACAPI = class {
|
|
|
6514
6611
|
this.clientHTTP = new HTTPClient();
|
|
6515
6612
|
}
|
|
6516
6613
|
async getActions(c) {
|
|
6517
|
-
const e =
|
|
6614
|
+
const e = Endpoints11.GetActions;
|
|
6518
6615
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, null, c);
|
|
6519
6616
|
}
|
|
6520
6617
|
async listRoles(c) {
|
|
6521
|
-
const e =
|
|
6618
|
+
const e = Endpoints11.ListRoles;
|
|
6522
6619
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, null, c, external_exports.array(RoleSchema));
|
|
6523
6620
|
}
|
|
6524
6621
|
async createRole(c, input) {
|
|
6525
|
-
const e =
|
|
6622
|
+
const e = Endpoints11.CreateRole;
|
|
6526
6623
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, input, c, RoleSchema);
|
|
6527
6624
|
}
|
|
6528
6625
|
async updateRole(c, roleId, input) {
|
|
6529
|
-
const e =
|
|
6626
|
+
const e = Endpoints11.UpdateRole;
|
|
6530
6627
|
const uri = e.uri.replace(":roleId", roleId);
|
|
6531
6628
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleSchema);
|
|
6532
6629
|
}
|
|
6533
6630
|
async deleteRole(c, roleId) {
|
|
6534
|
-
const e =
|
|
6631
|
+
const e = Endpoints11.DeleteRole;
|
|
6535
6632
|
const uri = e.uri.replace(":roleId", roleId);
|
|
6536
6633
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.boolean());
|
|
6537
6634
|
}
|
|
6538
6635
|
async getAssignments(c, uid) {
|
|
6539
|
-
const e =
|
|
6636
|
+
const e = Endpoints11.GetAssignments;
|
|
6540
6637
|
const uri = e.uri.replace(":uid", uid);
|
|
6541
6638
|
return this.clientHTTP.makeRequest(
|
|
6542
6639
|
this.env,
|
|
@@ -6548,17 +6645,17 @@ var RBACAPI = class {
|
|
|
6548
6645
|
);
|
|
6549
6646
|
}
|
|
6550
6647
|
async assign(c, uid, input) {
|
|
6551
|
-
const e =
|
|
6648
|
+
const e = Endpoints11.Assign;
|
|
6552
6649
|
const uri = e.uri.replace(":uid", uid);
|
|
6553
6650
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
|
|
6554
6651
|
}
|
|
6555
6652
|
async unassign(c, uid, input) {
|
|
6556
|
-
const e =
|
|
6653
|
+
const e = Endpoints11.Unassign;
|
|
6557
6654
|
const uri = e.uri.replace(":uid", uid);
|
|
6558
6655
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
|
|
6559
6656
|
}
|
|
6560
6657
|
async searchPrincipals(c, term) {
|
|
6561
|
-
const e =
|
|
6658
|
+
const e = Endpoints11.SearchPrincipals;
|
|
6562
6659
|
const uri = `${e.uri}?q=${encodeURIComponent(term)}`;
|
|
6563
6660
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.array(PrincipalSchema));
|
|
6564
6661
|
}
|
|
@@ -6582,6 +6679,7 @@ var ShredAPI = class {
|
|
|
6582
6679
|
this.note = new Note_api_default(env);
|
|
6583
6680
|
this.specialOffer = new SpecialOffer_api_default(env);
|
|
6584
6681
|
this.shredu = new ShredU_api_default(env);
|
|
6682
|
+
this.score = new Score_api_default(env);
|
|
6585
6683
|
this.rbac = new RBAC_api_default(env);
|
|
6586
6684
|
}
|
|
6587
6685
|
};
|
|
@@ -6601,7 +6699,7 @@ __export(exceptions_exports, {
|
|
|
6601
6699
|
var prompt_exports = {};
|
|
6602
6700
|
__export(prompt_exports, {
|
|
6603
6701
|
CategorySchema: () => CategorySchema,
|
|
6604
|
-
Endpoints: () =>
|
|
6702
|
+
Endpoints: () => Endpoints12,
|
|
6605
6703
|
PromptSchema: () => PromptSchema,
|
|
6606
6704
|
ScriptIARequestSchema: () => ScriptIARequestSchema,
|
|
6607
6705
|
ScriptSchema: () => ScriptSchema
|
|
@@ -6637,7 +6735,7 @@ var PromptSchema = external_exports.object({
|
|
|
6637
6735
|
});
|
|
6638
6736
|
|
|
6639
6737
|
// src/model/prompt/Prompt.api.ts
|
|
6640
|
-
var
|
|
6738
|
+
var Endpoints12 = {
|
|
6641
6739
|
GetPrompt: {
|
|
6642
6740
|
uri: "/prompts/getPrompt",
|
|
6643
6741
|
method: "GET"
|
|
@@ -6668,7 +6766,7 @@ var Endpoints11 = {
|
|
|
6668
6766
|
var tenant_exports = {};
|
|
6669
6767
|
__export(tenant_exports, {
|
|
6670
6768
|
Action: () => Action,
|
|
6671
|
-
Endpoints: () =>
|
|
6769
|
+
Endpoints: () => Endpoints13,
|
|
6672
6770
|
MemberSchema: () => MemberSchema,
|
|
6673
6771
|
MemberUpdateSchema: () => MemberUpdateSchema,
|
|
6674
6772
|
PreferencesSchema: () => PreferencesSchema,
|
|
@@ -6799,7 +6897,7 @@ var TenantUpdateSchema = TenantSchema.pick({
|
|
|
6799
6897
|
}).partial();
|
|
6800
6898
|
|
|
6801
6899
|
// src/model/tenant/Tenant.api.ts
|
|
6802
|
-
var
|
|
6900
|
+
var Endpoints13 = {
|
|
6803
6901
|
GetByInviteCode: {
|
|
6804
6902
|
uri: "/tenants/public/invitation/",
|
|
6805
6903
|
method: "GET"
|
|
@@ -6837,7 +6935,7 @@ var Endpoints12 = {
|
|
|
6837
6935
|
// src/model/user/index.ts
|
|
6838
6936
|
var user_exports = {};
|
|
6839
6937
|
__export(user_exports, {
|
|
6840
|
-
Endpoints: () =>
|
|
6938
|
+
Endpoints: () => Endpoints14,
|
|
6841
6939
|
PreferencesSchema: () => PreferencesSchema2,
|
|
6842
6940
|
Role: () => Role,
|
|
6843
6941
|
System: () => System,
|
|
@@ -6892,7 +6990,7 @@ var UserSchema = external_exports.object({
|
|
|
6892
6990
|
});
|
|
6893
6991
|
|
|
6894
6992
|
// src/model/user/User.api.ts
|
|
6895
|
-
var
|
|
6993
|
+
var Endpoints14 = {
|
|
6896
6994
|
ChangeEmail: { uri: "/accounts/user/changeEmail", method: "PUT" },
|
|
6897
6995
|
GetUserInfo: { uri: "/accounts/user/info", method: "GET" },
|
|
6898
6996
|
GetBindedUsers: { uri: "/accounts/binded/list", method: "GET" },
|
|
@@ -6915,7 +7013,7 @@ var Endpoints13 = {
|
|
|
6915
7013
|
var subscription_exports = {};
|
|
6916
7014
|
__export(subscription_exports, {
|
|
6917
7015
|
ChargeSchema: () => ChargeSchema,
|
|
6918
|
-
Endpoints: () =>
|
|
7016
|
+
Endpoints: () => Endpoints15,
|
|
6919
7017
|
PlanSchema: () => PlanSchema,
|
|
6920
7018
|
ProductSchema: () => ProductSchema,
|
|
6921
7019
|
SubscriptionSchema: () => SubscriptionSchema,
|
|
@@ -6924,7 +7022,7 @@ __export(subscription_exports, {
|
|
|
6924
7022
|
});
|
|
6925
7023
|
|
|
6926
7024
|
// src/model/subscription/Subscription.api.ts
|
|
6927
|
-
var
|
|
7025
|
+
var Endpoints15 = {
|
|
6928
7026
|
GetPortal: {
|
|
6929
7027
|
uri: "/subscriptions/portal/",
|
|
6930
7028
|
method: "GET"
|
|
@@ -6986,7 +7084,7 @@ var Endpoints14 = {
|
|
|
6986
7084
|
// src/model/track/index.ts
|
|
6987
7085
|
var track_exports = {};
|
|
6988
7086
|
__export(track_exports, {
|
|
6989
|
-
Endpoints: () =>
|
|
7087
|
+
Endpoints: () => Endpoints16,
|
|
6990
7088
|
TrackParamSchema: () => TrackParamSchema,
|
|
6991
7089
|
TrackSchema: () => TrackSchema
|
|
6992
7090
|
});
|
|
@@ -7004,7 +7102,7 @@ var TrackSchema = external_exports.object({
|
|
|
7004
7102
|
});
|
|
7005
7103
|
|
|
7006
7104
|
// src/model/track/Track.api.ts
|
|
7007
|
-
var
|
|
7105
|
+
var Endpoints16 = {
|
|
7008
7106
|
Track: {
|
|
7009
7107
|
uri: "/track/public/send/",
|
|
7010
7108
|
method: "POST"
|
|
@@ -7034,13 +7132,27 @@ __export(shredu_exports, {
|
|
|
7034
7132
|
SessionAssetSchema: () => SessionAssetSchema,
|
|
7035
7133
|
SetShredUSessionRecordingSchema: () => SetShredUSessionRecordingSchema,
|
|
7036
7134
|
ShredUBriefSchema: () => ShredUBriefSchema,
|
|
7135
|
+
ShredUDispatchRulesSchema: () => ShredUDispatchRulesSchema,
|
|
7037
7136
|
ShredUJoinSchema: () => ShredUJoinSchema,
|
|
7038
7137
|
ShredUSessionCustomerSchema: () => ShredUSessionCustomerSchema,
|
|
7039
7138
|
ShredUSessionSchema: () => ShredUSessionSchema,
|
|
7040
7139
|
ShredUSessionStatusSchema: () => ShredUSessionStatusSchema,
|
|
7140
|
+
ShredUStageRuleSchema: () => ShredUStageRuleSchema,
|
|
7041
7141
|
UpdateShredUSessionSchema: () => UpdateShredUSessionSchema
|
|
7042
7142
|
});
|
|
7043
7143
|
|
|
7144
|
+
// src/model/score/index.ts
|
|
7145
|
+
var score_exports = {};
|
|
7146
|
+
__export(score_exports, {
|
|
7147
|
+
Endpoints: () => Endpoints10,
|
|
7148
|
+
ScoreBandSchema: () => ScoreBandSchema,
|
|
7149
|
+
ScoreHistoryEntrySchema: () => ScoreHistoryEntrySchema,
|
|
7150
|
+
ScoreMetricKeySchema: () => ScoreMetricKeySchema,
|
|
7151
|
+
ScoreMetricSchema: () => ScoreMetricSchema,
|
|
7152
|
+
ScoreRecapSchema: () => ScoreRecapSchema,
|
|
7153
|
+
ScoreSchema: () => ScoreSchema
|
|
7154
|
+
});
|
|
7155
|
+
|
|
7044
7156
|
// src/index.ts
|
|
7045
7157
|
var index_default = ShredAPI;
|
|
7046
7158
|
//# sourceMappingURL=index.js.map
|