shred-api-client 2.13.6 → 2.14.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 +524 -224
- package/dist/index.js +109 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
Email: () => email_exports,
|
|
37
37
|
Exceptions: () => exceptions_exports,
|
|
38
38
|
Goal: () => goal_exports,
|
|
39
|
+
Kpi: () => kpi_exports,
|
|
39
40
|
Note: () => note_exports,
|
|
40
41
|
Notification: () => notification_exports,
|
|
41
42
|
Project: () => project_exports,
|
|
@@ -6445,12 +6446,88 @@ var ScoreAPI = class {
|
|
|
6445
6446
|
};
|
|
6446
6447
|
var Score_api_default = ScoreAPI;
|
|
6447
6448
|
|
|
6449
|
+
// src/model/kpi/Kpi.api.ts
|
|
6450
|
+
var Endpoints11 = {
|
|
6451
|
+
ListBoards: { uri: "/kpis/boards/", method: "GET" },
|
|
6452
|
+
GetBoard: { uri: "/kpis/boards/:board/", method: "GET" }
|
|
6453
|
+
};
|
|
6454
|
+
|
|
6455
|
+
// src/model/kpi/Kpi.schema.ts
|
|
6456
|
+
var KpiBoardSchema = external_exports.object({
|
|
6457
|
+
id: external_exports.string(),
|
|
6458
|
+
kpiCount: external_exports.number()
|
|
6459
|
+
});
|
|
6460
|
+
var KpiEntrySchema = external_exports.object({
|
|
6461
|
+
kpiId: external_exports.string(),
|
|
6462
|
+
kpiName: external_exports.string(),
|
|
6463
|
+
category: external_exports.string(),
|
|
6464
|
+
/** `num`, `pct` (percentage points: 5.5 means 5.5%), `dec`, `score`, `stars` or `usd`. */
|
|
6465
|
+
unit: external_exports.string(),
|
|
6466
|
+
/** `up` or `down`. */
|
|
6467
|
+
better: external_exports.string(),
|
|
6468
|
+
/** `stock` (level at the end of the month), `flow` (volume in the month) or `rate`. */
|
|
6469
|
+
kpiType: external_exports.string(),
|
|
6470
|
+
sortOrder: external_exports.number().nullable(),
|
|
6471
|
+
/** YYYY-MM-DD, always the first day of the month. */
|
|
6472
|
+
periodStart: external_exports.string(),
|
|
6473
|
+
actualValue: external_exports.number().nullable(),
|
|
6474
|
+
targetValue: external_exports.number().nullable(),
|
|
6475
|
+
/** `typed` or `derived` (from the plan assumptions). */
|
|
6476
|
+
targetSource: external_exports.string().nullable(),
|
|
6477
|
+
/** Only alongside a typed target. */
|
|
6478
|
+
baseline: external_exports.number().nullable(),
|
|
6479
|
+
/** True for the month still being lived. */
|
|
6480
|
+
isPartial: external_exports.boolean(),
|
|
6481
|
+
/** `no_data`, `no_target`, `in_progress`, `met` or `missed`. */
|
|
6482
|
+
status: external_exports.string(),
|
|
6483
|
+
/** Against the previous month's value. */
|
|
6484
|
+
delta: external_exports.number().nullable(),
|
|
6485
|
+
/** Direction-aware: at or above 1 means the target was met, whichever way `better` points. */
|
|
6486
|
+
attainment: external_exports.number().nullable()
|
|
6487
|
+
});
|
|
6488
|
+
var KpiMonthSummarySchema = external_exports.object({
|
|
6489
|
+
periodStart: external_exports.string(),
|
|
6490
|
+
met: external_exports.number(),
|
|
6491
|
+
missed: external_exports.number(),
|
|
6492
|
+
judged: external_exports.number(),
|
|
6493
|
+
inProgress: external_exports.number(),
|
|
6494
|
+
noTarget: external_exports.number(),
|
|
6495
|
+
noData: external_exports.number(),
|
|
6496
|
+
/** Null when no KPI was judged in the month. */
|
|
6497
|
+
scoreOutOf10: external_exports.number().nullable()
|
|
6498
|
+
});
|
|
6499
|
+
var KpiBoardHistorySchema = external_exports.object({
|
|
6500
|
+
board: external_exports.string(),
|
|
6501
|
+
/** ISO timestamp of the last automatic calculation. */
|
|
6502
|
+
calculatedAt: external_exports.string().nullable(),
|
|
6503
|
+
entries: external_exports.array(KpiEntrySchema),
|
|
6504
|
+
summaries: external_exports.array(KpiMonthSummarySchema)
|
|
6505
|
+
});
|
|
6506
|
+
|
|
6507
|
+
// src/api/Kpi.api.ts
|
|
6508
|
+
var KpiAPI = class {
|
|
6509
|
+
constructor(env) {
|
|
6510
|
+
this.env = env;
|
|
6511
|
+
this.clientHTTP = new HTTPClient();
|
|
6512
|
+
}
|
|
6513
|
+
async listBoards(ctx) {
|
|
6514
|
+
const { uri, method } = Endpoints11.ListBoards;
|
|
6515
|
+
return this.clientHTTP.makeRequest(this.env, uri, method, null, ctx, external_exports.array(KpiBoardSchema));
|
|
6516
|
+
}
|
|
6517
|
+
async getBoard(ctx, board) {
|
|
6518
|
+
const { uri, method } = Endpoints11.GetBoard;
|
|
6519
|
+
const endpoint = uri.replace(":board", encodeURIComponent(board));
|
|
6520
|
+
return this.clientHTTP.makeRequest(this.env, endpoint, method, null, ctx, KpiBoardHistorySchema);
|
|
6521
|
+
}
|
|
6522
|
+
};
|
|
6523
|
+
var Kpi_api_default = KpiAPI;
|
|
6524
|
+
|
|
6448
6525
|
// src/model/rbac/index.ts
|
|
6449
6526
|
var rbac_exports = {};
|
|
6450
6527
|
__export(rbac_exports, {
|
|
6451
6528
|
ActionCatalog: () => ActionCatalog,
|
|
6452
6529
|
Actions: () => Actions,
|
|
6453
|
-
Endpoints: () =>
|
|
6530
|
+
Endpoints: () => Endpoints12,
|
|
6454
6531
|
PrincipalSchema: () => PrincipalSchema,
|
|
6455
6532
|
RoleAssignmentSchema: () => RoleAssignmentSchema,
|
|
6456
6533
|
RoleGrantSchema: () => RoleGrantSchema,
|
|
@@ -6700,7 +6777,7 @@ var PrincipalSchema = external_exports.object({
|
|
|
6700
6777
|
});
|
|
6701
6778
|
|
|
6702
6779
|
// src/model/rbac/RBAC.api.ts
|
|
6703
|
-
var
|
|
6780
|
+
var Endpoints12 = {
|
|
6704
6781
|
GetActions: { uri: "/rbac/actions", method: "GET" },
|
|
6705
6782
|
ListRoles: { uri: "/rbac/roles", method: "GET" },
|
|
6706
6783
|
CreateRole: { uri: "/rbac/roles", method: "POST" },
|
|
@@ -6719,29 +6796,29 @@ var RBACAPI = class {
|
|
|
6719
6796
|
this.clientHTTP = new HTTPClient();
|
|
6720
6797
|
}
|
|
6721
6798
|
async getActions(c) {
|
|
6722
|
-
const e =
|
|
6799
|
+
const e = Endpoints12.GetActions;
|
|
6723
6800
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, null, c);
|
|
6724
6801
|
}
|
|
6725
6802
|
async listRoles(c) {
|
|
6726
|
-
const e =
|
|
6803
|
+
const e = Endpoints12.ListRoles;
|
|
6727
6804
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, null, c, external_exports.array(RoleSchema));
|
|
6728
6805
|
}
|
|
6729
6806
|
async createRole(c, input) {
|
|
6730
|
-
const e =
|
|
6807
|
+
const e = Endpoints12.CreateRole;
|
|
6731
6808
|
return this.clientHTTP.makeRequest(this.env, e.uri, e.method, input, c, RoleSchema);
|
|
6732
6809
|
}
|
|
6733
6810
|
async updateRole(c, roleId, input) {
|
|
6734
|
-
const e =
|
|
6811
|
+
const e = Endpoints12.UpdateRole;
|
|
6735
6812
|
const uri = e.uri.replace(":roleId", roleId);
|
|
6736
6813
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleSchema);
|
|
6737
6814
|
}
|
|
6738
6815
|
async deleteRole(c, roleId) {
|
|
6739
|
-
const e =
|
|
6816
|
+
const e = Endpoints12.DeleteRole;
|
|
6740
6817
|
const uri = e.uri.replace(":roleId", roleId);
|
|
6741
6818
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.boolean());
|
|
6742
6819
|
}
|
|
6743
6820
|
async getAssignments(c, uid) {
|
|
6744
|
-
const e =
|
|
6821
|
+
const e = Endpoints12.GetAssignments;
|
|
6745
6822
|
const uri = e.uri.replace(":uid", uid);
|
|
6746
6823
|
return this.clientHTTP.makeRequest(
|
|
6747
6824
|
this.env,
|
|
@@ -6753,17 +6830,17 @@ var RBACAPI = class {
|
|
|
6753
6830
|
);
|
|
6754
6831
|
}
|
|
6755
6832
|
async assign(c, uid, input) {
|
|
6756
|
-
const e =
|
|
6833
|
+
const e = Endpoints12.Assign;
|
|
6757
6834
|
const uri = e.uri.replace(":uid", uid);
|
|
6758
6835
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
|
|
6759
6836
|
}
|
|
6760
6837
|
async unassign(c, uid, input) {
|
|
6761
|
-
const e =
|
|
6838
|
+
const e = Endpoints12.Unassign;
|
|
6762
6839
|
const uri = e.uri.replace(":uid", uid);
|
|
6763
6840
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
|
|
6764
6841
|
}
|
|
6765
6842
|
async searchPrincipals(c, term) {
|
|
6766
|
-
const e =
|
|
6843
|
+
const e = Endpoints12.SearchPrincipals;
|
|
6767
6844
|
const uri = `${e.uri}?q=${encodeURIComponent(term)}`;
|
|
6768
6845
|
return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.array(PrincipalSchema));
|
|
6769
6846
|
}
|
|
@@ -6788,6 +6865,7 @@ var ShredAPI = class {
|
|
|
6788
6865
|
this.specialOffer = new SpecialOffer_api_default(env);
|
|
6789
6866
|
this.shredu = new ShredU_api_default(env);
|
|
6790
6867
|
this.score = new Score_api_default(env);
|
|
6868
|
+
this.kpi = new Kpi_api_default(env);
|
|
6791
6869
|
this.rbac = new RBAC_api_default(env);
|
|
6792
6870
|
}
|
|
6793
6871
|
};
|
|
@@ -6807,7 +6885,7 @@ __export(exceptions_exports, {
|
|
|
6807
6885
|
var prompt_exports = {};
|
|
6808
6886
|
__export(prompt_exports, {
|
|
6809
6887
|
CategorySchema: () => CategorySchema,
|
|
6810
|
-
Endpoints: () =>
|
|
6888
|
+
Endpoints: () => Endpoints13,
|
|
6811
6889
|
PromptSchema: () => PromptSchema,
|
|
6812
6890
|
ScriptIARequestSchema: () => ScriptIARequestSchema,
|
|
6813
6891
|
ScriptSchema: () => ScriptSchema
|
|
@@ -6843,7 +6921,7 @@ var PromptSchema = external_exports.object({
|
|
|
6843
6921
|
});
|
|
6844
6922
|
|
|
6845
6923
|
// src/model/prompt/Prompt.api.ts
|
|
6846
|
-
var
|
|
6924
|
+
var Endpoints13 = {
|
|
6847
6925
|
GetPrompt: {
|
|
6848
6926
|
uri: "/prompts/getPrompt",
|
|
6849
6927
|
method: "GET"
|
|
@@ -6874,7 +6952,7 @@ var Endpoints12 = {
|
|
|
6874
6952
|
var tenant_exports = {};
|
|
6875
6953
|
__export(tenant_exports, {
|
|
6876
6954
|
Action: () => Action,
|
|
6877
|
-
Endpoints: () =>
|
|
6955
|
+
Endpoints: () => Endpoints14,
|
|
6878
6956
|
MemberSchema: () => MemberSchema,
|
|
6879
6957
|
MemberUpdateSchema: () => MemberUpdateSchema,
|
|
6880
6958
|
PreferencesSchema: () => PreferencesSchema,
|
|
@@ -7005,7 +7083,7 @@ var TenantUpdateSchema = TenantSchema.pick({
|
|
|
7005
7083
|
}).partial();
|
|
7006
7084
|
|
|
7007
7085
|
// src/model/tenant/Tenant.api.ts
|
|
7008
|
-
var
|
|
7086
|
+
var Endpoints14 = {
|
|
7009
7087
|
GetByInviteCode: {
|
|
7010
7088
|
uri: "/tenants/public/invitation/",
|
|
7011
7089
|
method: "GET"
|
|
@@ -7047,7 +7125,7 @@ var Endpoints13 = {
|
|
|
7047
7125
|
// src/model/user/index.ts
|
|
7048
7126
|
var user_exports = {};
|
|
7049
7127
|
__export(user_exports, {
|
|
7050
|
-
Endpoints: () =>
|
|
7128
|
+
Endpoints: () => Endpoints15,
|
|
7051
7129
|
PreferencesSchema: () => PreferencesSchema2,
|
|
7052
7130
|
Role: () => Role,
|
|
7053
7131
|
System: () => System,
|
|
@@ -7102,7 +7180,7 @@ var UserSchema = external_exports.object({
|
|
|
7102
7180
|
});
|
|
7103
7181
|
|
|
7104
7182
|
// src/model/user/User.api.ts
|
|
7105
|
-
var
|
|
7183
|
+
var Endpoints15 = {
|
|
7106
7184
|
ChangeEmail: { uri: "/accounts/user/changeEmail", method: "PUT" },
|
|
7107
7185
|
GetUserInfo: { uri: "/accounts/user/info", method: "GET" },
|
|
7108
7186
|
GetBindedUsers: { uri: "/accounts/binded/list", method: "GET" },
|
|
@@ -7125,7 +7203,7 @@ var Endpoints14 = {
|
|
|
7125
7203
|
var subscription_exports = {};
|
|
7126
7204
|
__export(subscription_exports, {
|
|
7127
7205
|
ChargeSchema: () => ChargeSchema,
|
|
7128
|
-
Endpoints: () =>
|
|
7206
|
+
Endpoints: () => Endpoints16,
|
|
7129
7207
|
PlanSchema: () => PlanSchema,
|
|
7130
7208
|
ProductSchema: () => ProductSchema,
|
|
7131
7209
|
SubscriptionSchema: () => SubscriptionSchema,
|
|
@@ -7134,7 +7212,7 @@ __export(subscription_exports, {
|
|
|
7134
7212
|
});
|
|
7135
7213
|
|
|
7136
7214
|
// src/model/subscription/Subscription.api.ts
|
|
7137
|
-
var
|
|
7215
|
+
var Endpoints16 = {
|
|
7138
7216
|
GetPortal: {
|
|
7139
7217
|
uri: "/subscriptions/portal/",
|
|
7140
7218
|
method: "GET"
|
|
@@ -7196,7 +7274,7 @@ var Endpoints15 = {
|
|
|
7196
7274
|
// src/model/track/index.ts
|
|
7197
7275
|
var track_exports = {};
|
|
7198
7276
|
__export(track_exports, {
|
|
7199
|
-
Endpoints: () =>
|
|
7277
|
+
Endpoints: () => Endpoints17,
|
|
7200
7278
|
TrackParamSchema: () => TrackParamSchema,
|
|
7201
7279
|
TrackSchema: () => TrackSchema
|
|
7202
7280
|
});
|
|
@@ -7214,7 +7292,7 @@ var TrackSchema = external_exports.object({
|
|
|
7214
7292
|
});
|
|
7215
7293
|
|
|
7216
7294
|
// src/model/track/Track.api.ts
|
|
7217
|
-
var
|
|
7295
|
+
var Endpoints17 = {
|
|
7218
7296
|
Track: {
|
|
7219
7297
|
uri: "/track/public/send/",
|
|
7220
7298
|
method: "POST"
|
|
@@ -7272,6 +7350,16 @@ __export(score_exports, {
|
|
|
7272
7350
|
ScoreSchema: () => ScoreSchema
|
|
7273
7351
|
});
|
|
7274
7352
|
|
|
7353
|
+
// src/model/kpi/index.ts
|
|
7354
|
+
var kpi_exports = {};
|
|
7355
|
+
__export(kpi_exports, {
|
|
7356
|
+
Endpoints: () => Endpoints11,
|
|
7357
|
+
KpiBoardHistorySchema: () => KpiBoardHistorySchema,
|
|
7358
|
+
KpiBoardSchema: () => KpiBoardSchema,
|
|
7359
|
+
KpiEntrySchema: () => KpiEntrySchema,
|
|
7360
|
+
KpiMonthSummarySchema: () => KpiMonthSummarySchema
|
|
7361
|
+
});
|
|
7362
|
+
|
|
7275
7363
|
// src/index.ts
|
|
7276
7364
|
var index_default = ShredAPI;
|
|
7277
7365
|
//# sourceMappingURL=index.js.map
|