shred-api-client 2.10.5 → 2.11.0
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 +824 -187
- package/dist/index.js +124 -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,
|
|
@@ -6090,6 +6091,10 @@ var Endpoints9 = {
|
|
|
6090
6091
|
uri: "/shredu/sessions/:id",
|
|
6091
6092
|
method: "GET"
|
|
6092
6093
|
},
|
|
6094
|
+
Join: {
|
|
6095
|
+
uri: "/shredu/sessions/:id/join",
|
|
6096
|
+
method: "POST"
|
|
6097
|
+
},
|
|
6093
6098
|
Create: {
|
|
6094
6099
|
uri: "/shredu/sessions",
|
|
6095
6100
|
method: "POST"
|
|
@@ -6184,6 +6189,9 @@ var PreviewShredUEmailSchema = external_exports.object({
|
|
|
6184
6189
|
timezone: external_exports.string().min(1),
|
|
6185
6190
|
brief: CreateShredUBriefSchema.optional()
|
|
6186
6191
|
});
|
|
6192
|
+
var ShredUJoinSchema = external_exports.object({
|
|
6193
|
+
url: external_exports.string()
|
|
6194
|
+
});
|
|
6187
6195
|
var SetShredUSessionRecordingSchema = external_exports.object({
|
|
6188
6196
|
recordingUrl: external_exports.string().url(),
|
|
6189
6197
|
recordingThumbnailUrl: external_exports.string().url().optional(),
|
|
@@ -6212,6 +6220,10 @@ var ShredUAPI = class {
|
|
|
6212
6220
|
const { uri, method } = Endpoints9.Get;
|
|
6213
6221
|
return this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, null, ctx, ShredUSessionCustomerSchema);
|
|
6214
6222
|
}
|
|
6223
|
+
async join(ctx, id) {
|
|
6224
|
+
const { uri, method } = Endpoints9.Join;
|
|
6225
|
+
return this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, null, ctx, ShredUJoinSchema);
|
|
6226
|
+
}
|
|
6215
6227
|
async create(ctx, data) {
|
|
6216
6228
|
const { uri, method } = Endpoints9.Create;
|
|
6217
6229
|
return this.clientHTTP.makeRequest(this.env, uri, method, data, ctx, ShredUSessionSchema);
|
|
@@ -6235,12 +6247,89 @@ var ShredUAPI = class {
|
|
|
6235
6247
|
};
|
|
6236
6248
|
var ShredU_api_default = ShredUAPI;
|
|
6237
6249
|
|
|
6250
|
+
// src/model/score/Score.api.ts
|
|
6251
|
+
var Endpoints10 = {
|
|
6252
|
+
GetRecap: { uri: "/score/", method: "GET" }
|
|
6253
|
+
};
|
|
6254
|
+
|
|
6255
|
+
// src/model/score/Score.schema.ts
|
|
6256
|
+
var ScoreMetricKeySchema = external_exports.enum([
|
|
6257
|
+
"submissions",
|
|
6258
|
+
"interactions",
|
|
6259
|
+
"attendance"
|
|
6260
|
+
]);
|
|
6261
|
+
var ScoreBandSchema = external_exports.object({
|
|
6262
|
+
key: external_exports.string(),
|
|
6263
|
+
label: external_exports.string(),
|
|
6264
|
+
min: external_exports.number(),
|
|
6265
|
+
max: external_exports.number()
|
|
6266
|
+
});
|
|
6267
|
+
var ScoreMetricSchema = external_exports.object({
|
|
6268
|
+
/**
|
|
6269
|
+
* Deliberately not the enum: a metric added API-side must not break a client that
|
|
6270
|
+
* predates it. Render the array generically and switch on ScoreMetricKey only where
|
|
6271
|
+
* a known metric needs special treatment.
|
|
6272
|
+
*/
|
|
6273
|
+
key: external_exports.string(),
|
|
6274
|
+
/** The share this metric actually carried, after unavailable ones were left out. */
|
|
6275
|
+
weight: external_exports.number(),
|
|
6276
|
+
value: external_exports.number(),
|
|
6277
|
+
target: external_exports.number(),
|
|
6278
|
+
ratio: external_exports.number(),
|
|
6279
|
+
available: external_exports.boolean(),
|
|
6280
|
+
rating: ScoreBandSchema.optional()
|
|
6281
|
+
});
|
|
6282
|
+
var ScoreSchema = external_exports.object({
|
|
6283
|
+
value: external_exports.number(),
|
|
6284
|
+
hasData: external_exports.boolean(),
|
|
6285
|
+
period: external_exports.string(),
|
|
6286
|
+
periodLabel: external_exports.string(),
|
|
6287
|
+
band: ScoreBandSchema.optional(),
|
|
6288
|
+
nextBand: ScoreBandSchema.optional(),
|
|
6289
|
+
pointsToNextBand: external_exports.number().optional(),
|
|
6290
|
+
trend: external_exports.number().optional(),
|
|
6291
|
+
computedAt: external_exports.number(),
|
|
6292
|
+
metrics: external_exports.array(ScoreMetricSchema)
|
|
6293
|
+
});
|
|
6294
|
+
var ScoreHistoryEntrySchema = external_exports.object({
|
|
6295
|
+
period: external_exports.string(),
|
|
6296
|
+
label: external_exports.string(),
|
|
6297
|
+
value: external_exports.number(),
|
|
6298
|
+
band: ScoreBandSchema.optional()
|
|
6299
|
+
});
|
|
6300
|
+
var ScoreRecapSchema = external_exports.object({
|
|
6301
|
+
current: ScoreSchema,
|
|
6302
|
+
/** Oldest first. Months before the customer's first project are absent, not zero. */
|
|
6303
|
+
history: external_exports.array(ScoreHistoryEntrySchema)
|
|
6304
|
+
});
|
|
6305
|
+
|
|
6306
|
+
// src/api/Score.api.ts
|
|
6307
|
+
var ScoreAPI = class {
|
|
6308
|
+
constructor(env) {
|
|
6309
|
+
this.env = env;
|
|
6310
|
+
this.clientHTTP = new HTTPClient();
|
|
6311
|
+
}
|
|
6312
|
+
async getRecap(ctx, period) {
|
|
6313
|
+
const { uri, method } = Endpoints10.GetRecap;
|
|
6314
|
+
const endpoint = period ? `${uri}?period=${encodeURIComponent(period)}` : uri;
|
|
6315
|
+
return this.clientHTTP.makeRequest(
|
|
6316
|
+
this.env,
|
|
6317
|
+
endpoint,
|
|
6318
|
+
method,
|
|
6319
|
+
null,
|
|
6320
|
+
ctx,
|
|
6321
|
+
ScoreRecapSchema
|
|
6322
|
+
);
|
|
6323
|
+
}
|
|
6324
|
+
};
|
|
6325
|
+
var Score_api_default = ScoreAPI;
|
|
6326
|
+
|
|
6238
6327
|
// src/model/rbac/index.ts
|
|
6239
6328
|
var rbac_exports = {};
|
|
6240
6329
|
__export(rbac_exports, {
|
|
6241
6330
|
ActionCatalog: () => ActionCatalog,
|
|
6242
6331
|
Actions: () => Actions,
|
|
6243
|
-
Endpoints: () =>
|
|
6332
|
+
Endpoints: () => Endpoints11,
|
|
6244
6333
|
PrincipalSchema: () => PrincipalSchema,
|
|
6245
6334
|
RoleAssignmentSchema: () => RoleAssignmentSchema,
|
|
6246
6335
|
RoleGrantSchema: () => RoleGrantSchema,
|
|
@@ -6484,7 +6573,7 @@ var PrincipalSchema = external_exports.object({
|
|
|
6484
6573
|
});
|
|
6485
6574
|
|
|
6486
6575
|
// src/model/rbac/RBAC.api.ts
|
|
6487
|
-
var
|
|
6576
|
+
var Endpoints11 = {
|
|
6488
6577
|
GetActions: { uri: "/rbac/actions", method: "GET" },
|
|
6489
6578
|
ListRoles: { uri: "/rbac/roles", method: "GET" },
|
|
6490
6579
|
CreateRole: { uri: "/rbac/roles", method: "POST" },
|
|
@@ -6503,29 +6592,29 @@ var RBACAPI = class {
|
|
|
6503
6592
|
this.clientHTTP = new HTTPClient();
|
|
6504
6593
|
}
|
|
6505
6594
|
async getActions(c) {
|
|
6506
|
-
const e =
|
|
6595
|
+
const e = Endpoints11.GetActions;
|
|
6507
6596
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, null, c);
|
|
6508
6597
|
}
|
|
6509
6598
|
async listRoles(c) {
|
|
6510
|
-
const e =
|
|
6599
|
+
const e = Endpoints11.ListRoles;
|
|
6511
6600
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, null, c, external_exports.array(RoleSchema));
|
|
6512
6601
|
}
|
|
6513
6602
|
async createRole(c, input) {
|
|
6514
|
-
const e =
|
|
6603
|
+
const e = Endpoints11.CreateRole;
|
|
6515
6604
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, input, c, RoleSchema);
|
|
6516
6605
|
}
|
|
6517
6606
|
async updateRole(c, roleId, input) {
|
|
6518
|
-
const e =
|
|
6607
|
+
const e = Endpoints11.UpdateRole;
|
|
6519
6608
|
const uri = e.uri.replace(":roleId", roleId);
|
|
6520
6609
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleSchema);
|
|
6521
6610
|
}
|
|
6522
6611
|
async deleteRole(c, roleId) {
|
|
6523
|
-
const e =
|
|
6612
|
+
const e = Endpoints11.DeleteRole;
|
|
6524
6613
|
const uri = e.uri.replace(":roleId", roleId);
|
|
6525
6614
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.boolean());
|
|
6526
6615
|
}
|
|
6527
6616
|
async getAssignments(c, uid) {
|
|
6528
|
-
const e =
|
|
6617
|
+
const e = Endpoints11.GetAssignments;
|
|
6529
6618
|
const uri = e.uri.replace(":uid", uid);
|
|
6530
6619
|
return this.clientHTTP.makeRequest(
|
|
6531
6620
|
this.env,
|
|
@@ -6537,17 +6626,17 @@ var RBACAPI = class {
|
|
|
6537
6626
|
);
|
|
6538
6627
|
}
|
|
6539
6628
|
async assign(c, uid, input) {
|
|
6540
|
-
const e =
|
|
6629
|
+
const e = Endpoints11.Assign;
|
|
6541
6630
|
const uri = e.uri.replace(":uid", uid);
|
|
6542
6631
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
|
|
6543
6632
|
}
|
|
6544
6633
|
async unassign(c, uid, input) {
|
|
6545
|
-
const e =
|
|
6634
|
+
const e = Endpoints11.Unassign;
|
|
6546
6635
|
const uri = e.uri.replace(":uid", uid);
|
|
6547
6636
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
|
|
6548
6637
|
}
|
|
6549
6638
|
async searchPrincipals(c, term) {
|
|
6550
|
-
const e =
|
|
6639
|
+
const e = Endpoints11.SearchPrincipals;
|
|
6551
6640
|
const uri = `${e.uri}?q=${encodeURIComponent(term)}`;
|
|
6552
6641
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.array(PrincipalSchema));
|
|
6553
6642
|
}
|
|
@@ -6571,6 +6660,7 @@ var ShredAPI = class {
|
|
|
6571
6660
|
this.note = new Note_api_default(env);
|
|
6572
6661
|
this.specialOffer = new SpecialOffer_api_default(env);
|
|
6573
6662
|
this.shredu = new ShredU_api_default(env);
|
|
6663
|
+
this.score = new Score_api_default(env);
|
|
6574
6664
|
this.rbac = new RBAC_api_default(env);
|
|
6575
6665
|
}
|
|
6576
6666
|
};
|
|
@@ -6590,7 +6680,7 @@ __export(exceptions_exports, {
|
|
|
6590
6680
|
var prompt_exports = {};
|
|
6591
6681
|
__export(prompt_exports, {
|
|
6592
6682
|
CategorySchema: () => CategorySchema,
|
|
6593
|
-
Endpoints: () =>
|
|
6683
|
+
Endpoints: () => Endpoints12,
|
|
6594
6684
|
PromptSchema: () => PromptSchema,
|
|
6595
6685
|
ScriptIARequestSchema: () => ScriptIARequestSchema,
|
|
6596
6686
|
ScriptSchema: () => ScriptSchema
|
|
@@ -6626,7 +6716,7 @@ var PromptSchema = external_exports.object({
|
|
|
6626
6716
|
});
|
|
6627
6717
|
|
|
6628
6718
|
// src/model/prompt/Prompt.api.ts
|
|
6629
|
-
var
|
|
6719
|
+
var Endpoints12 = {
|
|
6630
6720
|
GetPrompt: {
|
|
6631
6721
|
uri: "/prompts/getPrompt",
|
|
6632
6722
|
method: "GET"
|
|
@@ -6657,7 +6747,7 @@ var Endpoints11 = {
|
|
|
6657
6747
|
var tenant_exports = {};
|
|
6658
6748
|
__export(tenant_exports, {
|
|
6659
6749
|
Action: () => Action,
|
|
6660
|
-
Endpoints: () =>
|
|
6750
|
+
Endpoints: () => Endpoints13,
|
|
6661
6751
|
MemberSchema: () => MemberSchema,
|
|
6662
6752
|
MemberUpdateSchema: () => MemberUpdateSchema,
|
|
6663
6753
|
PreferencesSchema: () => PreferencesSchema,
|
|
@@ -6788,7 +6878,7 @@ var TenantUpdateSchema = TenantSchema.pick({
|
|
|
6788
6878
|
}).partial();
|
|
6789
6879
|
|
|
6790
6880
|
// src/model/tenant/Tenant.api.ts
|
|
6791
|
-
var
|
|
6881
|
+
var Endpoints13 = {
|
|
6792
6882
|
GetByInviteCode: {
|
|
6793
6883
|
uri: "/tenants/public/invitation/",
|
|
6794
6884
|
method: "GET"
|
|
@@ -6826,7 +6916,7 @@ var Endpoints12 = {
|
|
|
6826
6916
|
// src/model/user/index.ts
|
|
6827
6917
|
var user_exports = {};
|
|
6828
6918
|
__export(user_exports, {
|
|
6829
|
-
Endpoints: () =>
|
|
6919
|
+
Endpoints: () => Endpoints14,
|
|
6830
6920
|
PreferencesSchema: () => PreferencesSchema2,
|
|
6831
6921
|
Role: () => Role,
|
|
6832
6922
|
System: () => System,
|
|
@@ -6881,7 +6971,7 @@ var UserSchema = external_exports.object({
|
|
|
6881
6971
|
});
|
|
6882
6972
|
|
|
6883
6973
|
// src/model/user/User.api.ts
|
|
6884
|
-
var
|
|
6974
|
+
var Endpoints14 = {
|
|
6885
6975
|
ChangeEmail: { uri: "/accounts/user/changeEmail", method: "PUT" },
|
|
6886
6976
|
GetUserInfo: { uri: "/accounts/user/info", method: "GET" },
|
|
6887
6977
|
GetBindedUsers: { uri: "/accounts/binded/list", method: "GET" },
|
|
@@ -6904,7 +6994,7 @@ var Endpoints13 = {
|
|
|
6904
6994
|
var subscription_exports = {};
|
|
6905
6995
|
__export(subscription_exports, {
|
|
6906
6996
|
ChargeSchema: () => ChargeSchema,
|
|
6907
|
-
Endpoints: () =>
|
|
6997
|
+
Endpoints: () => Endpoints15,
|
|
6908
6998
|
PlanSchema: () => PlanSchema,
|
|
6909
6999
|
ProductSchema: () => ProductSchema,
|
|
6910
7000
|
SubscriptionSchema: () => SubscriptionSchema,
|
|
@@ -6913,7 +7003,7 @@ __export(subscription_exports, {
|
|
|
6913
7003
|
});
|
|
6914
7004
|
|
|
6915
7005
|
// src/model/subscription/Subscription.api.ts
|
|
6916
|
-
var
|
|
7006
|
+
var Endpoints15 = {
|
|
6917
7007
|
GetPortal: {
|
|
6918
7008
|
uri: "/subscriptions/portal/",
|
|
6919
7009
|
method: "GET"
|
|
@@ -6975,7 +7065,7 @@ var Endpoints14 = {
|
|
|
6975
7065
|
// src/model/track/index.ts
|
|
6976
7066
|
var track_exports = {};
|
|
6977
7067
|
__export(track_exports, {
|
|
6978
|
-
Endpoints: () =>
|
|
7068
|
+
Endpoints: () => Endpoints16,
|
|
6979
7069
|
TrackParamSchema: () => TrackParamSchema,
|
|
6980
7070
|
TrackSchema: () => TrackSchema
|
|
6981
7071
|
});
|
|
@@ -6993,7 +7083,7 @@ var TrackSchema = external_exports.object({
|
|
|
6993
7083
|
});
|
|
6994
7084
|
|
|
6995
7085
|
// src/model/track/Track.api.ts
|
|
6996
|
-
var
|
|
7086
|
+
var Endpoints16 = {
|
|
6997
7087
|
Track: {
|
|
6998
7088
|
uri: "/track/public/send/",
|
|
6999
7089
|
method: "POST"
|
|
@@ -7023,12 +7113,25 @@ __export(shredu_exports, {
|
|
|
7023
7113
|
SessionAssetSchema: () => SessionAssetSchema,
|
|
7024
7114
|
SetShredUSessionRecordingSchema: () => SetShredUSessionRecordingSchema,
|
|
7025
7115
|
ShredUBriefSchema: () => ShredUBriefSchema,
|
|
7116
|
+
ShredUJoinSchema: () => ShredUJoinSchema,
|
|
7026
7117
|
ShredUSessionCustomerSchema: () => ShredUSessionCustomerSchema,
|
|
7027
7118
|
ShredUSessionSchema: () => ShredUSessionSchema,
|
|
7028
7119
|
ShredUSessionStatusSchema: () => ShredUSessionStatusSchema,
|
|
7029
7120
|
UpdateShredUSessionSchema: () => UpdateShredUSessionSchema
|
|
7030
7121
|
});
|
|
7031
7122
|
|
|
7123
|
+
// src/model/score/index.ts
|
|
7124
|
+
var score_exports = {};
|
|
7125
|
+
__export(score_exports, {
|
|
7126
|
+
Endpoints: () => Endpoints10,
|
|
7127
|
+
ScoreBandSchema: () => ScoreBandSchema,
|
|
7128
|
+
ScoreHistoryEntrySchema: () => ScoreHistoryEntrySchema,
|
|
7129
|
+
ScoreMetricKeySchema: () => ScoreMetricKeySchema,
|
|
7130
|
+
ScoreMetricSchema: () => ScoreMetricSchema,
|
|
7131
|
+
ScoreRecapSchema: () => ScoreRecapSchema,
|
|
7132
|
+
ScoreSchema: () => ScoreSchema
|
|
7133
|
+
});
|
|
7134
|
+
|
|
7032
7135
|
// src/index.ts
|
|
7033
7136
|
var index_default = ShredAPI;
|
|
7034
7137
|
//# sourceMappingURL=index.js.map
|