@getmodus/sdk 0.2.2 → 0.3.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/CHANGELOG.md +58 -1
- package/dist/{chunk-OUFN2O5C.js → chunk-D3NU2M6B.js} +82 -37
- package/dist/chunk-D3NU2M6B.js.map +1 -0
- package/dist/{conversations-BP2sI3Q5.d.cts → conversations-GNBMPpyr.d.cts} +1242 -3878
- package/dist/{conversations-BP2sI3Q5.d.ts → conversations-GNBMPpyr.d.ts} +1242 -3878
- package/dist/index.cjs +117 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -25
- package/dist/index.d.ts +12 -25
- package/dist/index.js +35 -44
- package/dist/index.js.map +1 -1
- package/dist/management/index.cjs +102 -58
- package/dist/management/index.cjs.map +1 -1
- package/dist/management/index.d.cts +54 -40
- package/dist/management/index.d.ts +54 -40
- package/dist/management/index.js +22 -23
- package/dist/management/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-OUFN2O5C.js.map +0 -1
|
@@ -203,7 +203,7 @@ function formatConfigForLog(config) {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
// src/_http.ts
|
|
206
|
-
var USER_AGENT = `modus-typescript/${"0.
|
|
206
|
+
var USER_AGENT = `modus-typescript/${"0.3.0"} (node/${process.version}; ${process.platform})`;
|
|
207
207
|
function buildUrl(baseUrl, path, params) {
|
|
208
208
|
const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
|
|
209
209
|
if (params) {
|
|
@@ -298,6 +298,26 @@ function wrapNetworkError(error, baseUrl) {
|
|
|
298
298
|
async function readBody(response) {
|
|
299
299
|
return response.text();
|
|
300
300
|
}
|
|
301
|
+
async function readBodyPreview(response, maxChars = 200) {
|
|
302
|
+
if (!response.body) return "";
|
|
303
|
+
const reader = response.body.getReader();
|
|
304
|
+
const decoder = new TextDecoder();
|
|
305
|
+
let out = "";
|
|
306
|
+
try {
|
|
307
|
+
while (out.length < maxChars) {
|
|
308
|
+
const { done, value } = await reader.read();
|
|
309
|
+
if (done) break;
|
|
310
|
+
out += decoder.decode(value, { stream: true });
|
|
311
|
+
if (out.length >= maxChars) {
|
|
312
|
+
out = out.slice(0, maxChars);
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
} finally {
|
|
317
|
+
await reader.cancel().catch(() => void 0);
|
|
318
|
+
}
|
|
319
|
+
return out;
|
|
320
|
+
}
|
|
301
321
|
var HttpClient = class {
|
|
302
322
|
constructor(config) {
|
|
303
323
|
this.config = config;
|
|
@@ -353,7 +373,13 @@ var HttpClient = class {
|
|
|
353
373
|
try {
|
|
354
374
|
const response = await this.config.fetch(url, {
|
|
355
375
|
method,
|
|
356
|
-
|
|
376
|
+
// Agent-service negotiates SSE vs JSON polling on Accept; JSON-only
|
|
377
|
+
// Accept returns {"runId","status":"pending"} instead of token SSE.
|
|
378
|
+
headers: {
|
|
379
|
+
...this.defaultHeaders(),
|
|
380
|
+
...options.headers,
|
|
381
|
+
Accept: "text/event-stream"
|
|
382
|
+
},
|
|
357
383
|
body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
|
|
358
384
|
signal: AbortSignal.timeout(this.config.timeoutMs)
|
|
359
385
|
});
|
|
@@ -362,6 +388,14 @@ var HttpClient = class {
|
|
|
362
388
|
raiseForStatus(response, body);
|
|
363
389
|
return;
|
|
364
390
|
}
|
|
391
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
392
|
+
if (!contentType.toLowerCase().includes("text/event-stream")) {
|
|
393
|
+
const preview = await readBodyPreview(response);
|
|
394
|
+
throw new ModusError(
|
|
395
|
+
`Unexpected stream response: expected Content-Type text/event-stream, got ${JSON.stringify(contentType) || "(missing)"}. Body preview: ${preview}`,
|
|
396
|
+
{ statusCode: response.status, body: preview }
|
|
397
|
+
);
|
|
398
|
+
}
|
|
365
399
|
if (!response.body) return;
|
|
366
400
|
const reader = response.body.getReader();
|
|
367
401
|
const decoder = new TextDecoder();
|
|
@@ -703,7 +737,7 @@ var OPERATIONS = {
|
|
|
703
737
|
service: "modus-api",
|
|
704
738
|
serverUrl: "https://api.getmodus.com",
|
|
705
739
|
pathParams: [],
|
|
706
|
-
queryParams: [
|
|
740
|
+
queryParams: [],
|
|
707
741
|
requestSchema: null,
|
|
708
742
|
responseSchema: "ListMemberGroupsResponseDto"
|
|
709
743
|
},
|
|
@@ -773,19 +807,9 @@ var OPERATIONS = {
|
|
|
773
807
|
service: "modus-api",
|
|
774
808
|
serverUrl: "https://api.getmodus.com",
|
|
775
809
|
pathParams: [],
|
|
776
|
-
queryParams: ["pageSize", "pageToken"],
|
|
777
|
-
requestSchema: null,
|
|
778
|
-
responseSchema: "ListOrgMembersResponseDto"
|
|
779
|
-
},
|
|
780
|
-
"OrganizationController_deleteOrganization": {
|
|
781
|
-
method: "DELETE",
|
|
782
|
-
path: "/api/v1/users/organization",
|
|
783
|
-
service: "modus-api",
|
|
784
|
-
serverUrl: "https://api.getmodus.com",
|
|
785
|
-
pathParams: [],
|
|
786
810
|
queryParams: [],
|
|
787
811
|
requestSchema: null,
|
|
788
|
-
responseSchema:
|
|
812
|
+
responseSchema: "ListOrgMembersResponseDto"
|
|
789
813
|
},
|
|
790
814
|
"ResumeRunsController_create": {
|
|
791
815
|
method: "POST",
|
|
@@ -1005,7 +1029,7 @@ var OPERATIONS = {
|
|
|
1005
1029
|
pathParams: ["id"],
|
|
1006
1030
|
queryParams: [],
|
|
1007
1031
|
requestSchema: null,
|
|
1008
|
-
responseSchema: "
|
|
1032
|
+
responseSchema: "ScopeDto"
|
|
1009
1033
|
},
|
|
1010
1034
|
"ScopesController_cancelOwnershipTransfer": {
|
|
1011
1035
|
method: "DELETE",
|
|
@@ -1015,7 +1039,7 @@ var OPERATIONS = {
|
|
|
1015
1039
|
pathParams: ["id"],
|
|
1016
1040
|
queryParams: [],
|
|
1017
1041
|
requestSchema: null,
|
|
1018
|
-
responseSchema: "
|
|
1042
|
+
responseSchema: "ScopeDto"
|
|
1019
1043
|
},
|
|
1020
1044
|
"ScopesController_create": {
|
|
1021
1045
|
method: "POST",
|
|
@@ -1025,7 +1049,7 @@ var OPERATIONS = {
|
|
|
1025
1049
|
pathParams: [],
|
|
1026
1050
|
queryParams: [],
|
|
1027
1051
|
requestSchema: "CreateSkillDto",
|
|
1028
|
-
responseSchema: "
|
|
1052
|
+
responseSchema: "ScopeDto"
|
|
1029
1053
|
},
|
|
1030
1054
|
"ScopesController_delete": {
|
|
1031
1055
|
method: "DELETE",
|
|
@@ -1055,7 +1079,7 @@ var OPERATIONS = {
|
|
|
1055
1079
|
pathParams: ["id"],
|
|
1056
1080
|
queryParams: ["view"],
|
|
1057
1081
|
requestSchema: null,
|
|
1058
|
-
responseSchema: "
|
|
1082
|
+
responseSchema: "ScopeDto"
|
|
1059
1083
|
},
|
|
1060
1084
|
"ScopesController_getVariation": {
|
|
1061
1085
|
method: "GET",
|
|
@@ -1065,7 +1089,7 @@ var OPERATIONS = {
|
|
|
1065
1089
|
pathParams: ["id", "variationUid"],
|
|
1066
1090
|
queryParams: [],
|
|
1067
1091
|
requestSchema: null,
|
|
1068
|
-
responseSchema: "
|
|
1092
|
+
responseSchema: "ScopeDto"
|
|
1069
1093
|
},
|
|
1070
1094
|
"ScopesController_list": {
|
|
1071
1095
|
method: "GET",
|
|
@@ -1095,7 +1119,7 @@ var OPERATIONS = {
|
|
|
1095
1119
|
pathParams: ["id"],
|
|
1096
1120
|
queryParams: [],
|
|
1097
1121
|
requestSchema: "TransferOwnershipDto",
|
|
1098
|
-
responseSchema: "
|
|
1122
|
+
responseSchema: "ScopeDto"
|
|
1099
1123
|
},
|
|
1100
1124
|
"ScopesController_restore": {
|
|
1101
1125
|
method: "POST",
|
|
@@ -1105,7 +1129,7 @@ var OPERATIONS = {
|
|
|
1105
1129
|
pathParams: ["id"],
|
|
1106
1130
|
queryParams: [],
|
|
1107
1131
|
requestSchema: null,
|
|
1108
|
-
responseSchema: "
|
|
1132
|
+
responseSchema: "ScopeDto"
|
|
1109
1133
|
},
|
|
1110
1134
|
"ScopesController_update": {
|
|
1111
1135
|
method: "PATCH",
|
|
@@ -1115,7 +1139,7 @@ var OPERATIONS = {
|
|
|
1115
1139
|
pathParams: ["id"],
|
|
1116
1140
|
queryParams: ["updateMask"],
|
|
1117
1141
|
requestSchema: "UpdateSkillDto",
|
|
1118
|
-
responseSchema: "
|
|
1142
|
+
responseSchema: "ScopeDto"
|
|
1119
1143
|
},
|
|
1120
1144
|
"SuggestionsController_listApproved": {
|
|
1121
1145
|
method: "GET",
|
|
@@ -1123,7 +1147,7 @@ var OPERATIONS = {
|
|
|
1123
1147
|
service: "modus-api",
|
|
1124
1148
|
serverUrl: "https://api.getmodus.com",
|
|
1125
1149
|
pathParams: [],
|
|
1126
|
-
queryParams: ["pageToken", "pageSize", "
|
|
1150
|
+
queryParams: ["pageToken", "pageSize", "scopeId", "scopeIds"],
|
|
1127
1151
|
requestSchema: null,
|
|
1128
1152
|
responseSchema: "ListSuggestionQuestionsResponseDto"
|
|
1129
1153
|
},
|
|
@@ -1143,10 +1167,20 @@ var OPERATIONS = {
|
|
|
1143
1167
|
service: "modus-api",
|
|
1144
1168
|
serverUrl: "https://api.getmodus.com",
|
|
1145
1169
|
pathParams: [],
|
|
1146
|
-
queryParams: ["since", "until", "rollup", "model", "group_by", "skill_id", "agent_id", "user_id", "interface"],
|
|
1170
|
+
queryParams: ["since", "until", "rollup", "model", "group_by", "skill_id", "agent_id", "user_id", "interface", "user_email"],
|
|
1147
1171
|
requestSchema: null,
|
|
1148
1172
|
responseSchema: "ListUsageResponseDto"
|
|
1149
1173
|
},
|
|
1174
|
+
"UsageController_listUsers": {
|
|
1175
|
+
method: "GET",
|
|
1176
|
+
path: "/api/v1/usage/users",
|
|
1177
|
+
service: "modus-api",
|
|
1178
|
+
serverUrl: "https://api.getmodus.com",
|
|
1179
|
+
pathParams: [],
|
|
1180
|
+
queryParams: ["since", "until"],
|
|
1181
|
+
requestSchema: null,
|
|
1182
|
+
responseSchema: "ListUsageUsersResponseDto"
|
|
1183
|
+
},
|
|
1150
1184
|
"WorkflowActionsController_cancel": {
|
|
1151
1185
|
method: "POST",
|
|
1152
1186
|
path: "/agent/v1/workflow-actions/{runId}/cancel",
|
|
@@ -1203,7 +1237,7 @@ var OPERATIONS = {
|
|
|
1203
1237
|
service: "modus-api",
|
|
1204
1238
|
serverUrl: "https://api.getmodus.com",
|
|
1205
1239
|
pathParams: ["id"],
|
|
1206
|
-
queryParams: [
|
|
1240
|
+
queryParams: [],
|
|
1207
1241
|
requestSchema: null,
|
|
1208
1242
|
responseSchema: "ListAgentInterfacesResponseDto"
|
|
1209
1243
|
},
|
|
@@ -1255,7 +1289,7 @@ var OPERATIONS = {
|
|
|
1255
1289
|
pathParams: ["id"],
|
|
1256
1290
|
queryParams: [],
|
|
1257
1291
|
requestSchema: null,
|
|
1258
|
-
responseSchema: "
|
|
1292
|
+
responseSchema: "WorkflowDto"
|
|
1259
1293
|
},
|
|
1260
1294
|
"WorkflowsController_cancelOwnershipTransfer": {
|
|
1261
1295
|
method: "DELETE",
|
|
@@ -1265,7 +1299,7 @@ var OPERATIONS = {
|
|
|
1265
1299
|
pathParams: ["id"],
|
|
1266
1300
|
queryParams: [],
|
|
1267
1301
|
requestSchema: null,
|
|
1268
|
-
responseSchema: "
|
|
1302
|
+
responseSchema: "WorkflowDto"
|
|
1269
1303
|
},
|
|
1270
1304
|
"WorkflowsController_create": {
|
|
1271
1305
|
method: "POST",
|
|
@@ -1275,7 +1309,7 @@ var OPERATIONS = {
|
|
|
1275
1309
|
pathParams: [],
|
|
1276
1310
|
queryParams: [],
|
|
1277
1311
|
requestSchema: "CreateAgentDto",
|
|
1278
|
-
responseSchema: "
|
|
1312
|
+
responseSchema: "WorkflowDto"
|
|
1279
1313
|
},
|
|
1280
1314
|
"WorkflowsController_delete": {
|
|
1281
1315
|
method: "DELETE",
|
|
@@ -1305,7 +1339,7 @@ var OPERATIONS = {
|
|
|
1305
1339
|
pathParams: ["id"],
|
|
1306
1340
|
queryParams: ["view"],
|
|
1307
1341
|
requestSchema: null,
|
|
1308
|
-
responseSchema: "
|
|
1342
|
+
responseSchema: "WorkflowDto"
|
|
1309
1343
|
},
|
|
1310
1344
|
"WorkflowsController_list": {
|
|
1311
1345
|
method: "GET",
|
|
@@ -1325,7 +1359,7 @@ var OPERATIONS = {
|
|
|
1325
1359
|
pathParams: ["id"],
|
|
1326
1360
|
queryParams: [],
|
|
1327
1361
|
requestSchema: "TransferOwnershipDto",
|
|
1328
|
-
responseSchema: "
|
|
1362
|
+
responseSchema: "WorkflowDto"
|
|
1329
1363
|
},
|
|
1330
1364
|
"WorkflowsController_restore": {
|
|
1331
1365
|
method: "POST",
|
|
@@ -1335,7 +1369,7 @@ var OPERATIONS = {
|
|
|
1335
1369
|
pathParams: ["id"],
|
|
1336
1370
|
queryParams: [],
|
|
1337
1371
|
requestSchema: null,
|
|
1338
|
-
responseSchema: "
|
|
1372
|
+
responseSchema: "WorkflowDto"
|
|
1339
1373
|
},
|
|
1340
1374
|
"WorkflowsController_toggle": {
|
|
1341
1375
|
method: "POST",
|
|
@@ -1345,7 +1379,7 @@ var OPERATIONS = {
|
|
|
1345
1379
|
pathParams: ["id"],
|
|
1346
1380
|
queryParams: [],
|
|
1347
1381
|
requestSchema: "ToggleAgentDto",
|
|
1348
|
-
responseSchema: "
|
|
1382
|
+
responseSchema: "WorkflowDto"
|
|
1349
1383
|
},
|
|
1350
1384
|
"WorkflowsController_update": {
|
|
1351
1385
|
method: "PATCH",
|
|
@@ -1355,7 +1389,7 @@ var OPERATIONS = {
|
|
|
1355
1389
|
pathParams: ["id"],
|
|
1356
1390
|
queryParams: ["updateMask"],
|
|
1357
1391
|
requestSchema: "UpdateAgentDto",
|
|
1358
|
-
responseSchema: "
|
|
1392
|
+
responseSchema: "WorkflowDto"
|
|
1359
1393
|
}
|
|
1360
1394
|
};
|
|
1361
1395
|
|
|
@@ -1474,7 +1508,7 @@ var WRITE_BODY_ALLOWED_KEYS = {
|
|
|
1474
1508
|
ScopesController_update: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "interfaces", "accessConfig", "managerId", "evaluations", "supervisionSubordinateDescriptions"],
|
|
1475
1509
|
ScopeSupervisionController_set: ["subordinateAgentIds"],
|
|
1476
1510
|
ScopeSupervisionController_setActive: ["subordinateAgentIds"],
|
|
1477
|
-
SuggestionsController_recordEvent: ["
|
|
1511
|
+
SuggestionsController_recordEvent: ["eventType", "source", "skillId", "threadId", "metadata"],
|
|
1478
1512
|
WorkflowActionsController_cancel: [],
|
|
1479
1513
|
WorkflowActionsController_execute: ["organizationId", "sessionId", "fileThreadId", "workflowAction", "previousOutputs", "userTimezone", "runId", "automationId", "source"],
|
|
1480
1514
|
WorkflowInterfacesController_add: ["type", "name", "config"],
|
|
@@ -1573,7 +1607,7 @@ async function accessConfigBodyForUpdate(guardrails, loadResource) {
|
|
|
1573
1607
|
return accessConfigWireForUpdate(existing, guardrails);
|
|
1574
1608
|
}
|
|
1575
1609
|
|
|
1576
|
-
// src/management/
|
|
1610
|
+
// src/management/workflows/interfaces.ts
|
|
1577
1611
|
var WorkflowInterfacesResource = class {
|
|
1578
1612
|
constructor(http, config, workflowId) {
|
|
1579
1613
|
this.http = http;
|
|
@@ -1618,7 +1652,7 @@ var WorkflowInterfacesResource = class {
|
|
|
1618
1652
|
}
|
|
1619
1653
|
};
|
|
1620
1654
|
|
|
1621
|
-
// src/management/
|
|
1655
|
+
// src/management/workflows/agents.ts
|
|
1622
1656
|
var MANAGEMENT_WORKFLOW_OPERATIONS = {
|
|
1623
1657
|
list: "WorkflowsController_list",
|
|
1624
1658
|
get: "WorkflowsController_get",
|
|
@@ -1669,7 +1703,7 @@ var ManagementWorkflowsResource = class {
|
|
|
1669
1703
|
);
|
|
1670
1704
|
return buildAipPage(
|
|
1671
1705
|
data,
|
|
1672
|
-
"
|
|
1706
|
+
"workflows",
|
|
1673
1707
|
parseWorkflow,
|
|
1674
1708
|
(token) => this.listPage(pageSize, token, search, type, view, includeVariation)
|
|
1675
1709
|
);
|
|
@@ -1736,7 +1770,7 @@ var ManagementWorkflowsResource = class {
|
|
|
1736
1770
|
jsonBody: {}
|
|
1737
1771
|
})
|
|
1738
1772
|
);
|
|
1739
|
-
return parseWorkflow(data.
|
|
1773
|
+
return parseWorkflow(data.workflow);
|
|
1740
1774
|
}
|
|
1741
1775
|
async toggle(workflowId, options) {
|
|
1742
1776
|
validateId(workflowId, "workflow_id");
|
|
@@ -1805,7 +1839,18 @@ function parseContextItem(raw) {
|
|
|
1805
1839
|
return raw;
|
|
1806
1840
|
}
|
|
1807
1841
|
function parseCreatedCustomContextItem(raw) {
|
|
1808
|
-
|
|
1842
|
+
const data = asRecord(raw);
|
|
1843
|
+
const contextItemId = data.contextItemId;
|
|
1844
|
+
if (typeof contextItemId !== "string" || !contextItemId) {
|
|
1845
|
+
throw new ValidationError(
|
|
1846
|
+
"Custom context create response missing non-empty string contextItemId"
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1849
|
+
return {
|
|
1850
|
+
...data,
|
|
1851
|
+
contextItemId,
|
|
1852
|
+
uid: contextItemId
|
|
1853
|
+
};
|
|
1809
1854
|
}
|
|
1810
1855
|
function parseDeletion(raw) {
|
|
1811
1856
|
return raw;
|
|
@@ -2079,18 +2124,7 @@ var ManagementContextResource = class {
|
|
|
2079
2124
|
}
|
|
2080
2125
|
};
|
|
2081
2126
|
|
|
2082
|
-
// src/
|
|
2083
|
-
var ManagementOrganizationResource = class {
|
|
2084
|
-
constructor(http, config) {
|
|
2085
|
-
this.http = http;
|
|
2086
|
-
this.config = config;
|
|
2087
|
-
}
|
|
2088
|
-
async delete() {
|
|
2089
|
-
await invokeWithRetry(this.config, this.http, "OrganizationController_deleteOrganization");
|
|
2090
|
-
}
|
|
2091
|
-
};
|
|
2092
|
-
|
|
2093
|
-
// src/resources/skills/conversations.ts
|
|
2127
|
+
// src/resources/scopes/conversations.ts
|
|
2094
2128
|
function parseListItem(raw) {
|
|
2095
2129
|
return raw;
|
|
2096
2130
|
}
|
|
@@ -2140,7 +2174,7 @@ var ScopeConversationsResource = class {
|
|
|
2140
2174
|
}
|
|
2141
2175
|
};
|
|
2142
2176
|
|
|
2143
|
-
// src/management/
|
|
2177
|
+
// src/management/scopes/memories.ts
|
|
2144
2178
|
function parseMemory(raw) {
|
|
2145
2179
|
return raw;
|
|
2146
2180
|
}
|
|
@@ -2199,7 +2233,7 @@ var ScopeMemoriesResource = class {
|
|
|
2199
2233
|
}
|
|
2200
2234
|
};
|
|
2201
2235
|
|
|
2202
|
-
// src/management/
|
|
2236
|
+
// src/management/scopes/evaluations.ts
|
|
2203
2237
|
function parseConfig(raw) {
|
|
2204
2238
|
return raw;
|
|
2205
2239
|
}
|
|
@@ -2259,7 +2293,7 @@ var ScopeEvaluationsResource = class {
|
|
|
2259
2293
|
}
|
|
2260
2294
|
};
|
|
2261
2295
|
|
|
2262
|
-
// src/management/
|
|
2296
|
+
// src/management/scopes/supervision.ts
|
|
2263
2297
|
var ScopeSupervisionResource = class {
|
|
2264
2298
|
constructor(http, config, scopeId) {
|
|
2265
2299
|
this.http = http;
|
|
@@ -2288,7 +2322,7 @@ var ScopeSupervisionResource = class {
|
|
|
2288
2322
|
}
|
|
2289
2323
|
};
|
|
2290
2324
|
|
|
2291
|
-
// src/management/
|
|
2325
|
+
// src/management/scopes/skills.ts
|
|
2292
2326
|
var MANAGEMENT_SCOPE_OPERATIONS = {
|
|
2293
2327
|
list: "ScopesController_list",
|
|
2294
2328
|
get: "ScopesController_get",
|
|
@@ -2350,7 +2384,7 @@ var ManagementScopesResource = class {
|
|
|
2350
2384
|
);
|
|
2351
2385
|
return buildAipPage(
|
|
2352
2386
|
data,
|
|
2353
|
-
"
|
|
2387
|
+
"scopes",
|
|
2354
2388
|
parseScope,
|
|
2355
2389
|
(token) => this.listPage(pageSize, token, search, view, managerId)
|
|
2356
2390
|
);
|
|
@@ -2423,7 +2457,7 @@ var ManagementScopesResource = class {
|
|
|
2423
2457
|
jsonBody: {}
|
|
2424
2458
|
})
|
|
2425
2459
|
);
|
|
2426
|
-
return parseScope(data.
|
|
2460
|
+
return parseScope(data.scope);
|
|
2427
2461
|
}
|
|
2428
2462
|
async delete(scopeId) {
|
|
2429
2463
|
validateId(scopeId, "scope_id");
|
|
@@ -2502,9 +2536,20 @@ var ManagementUsageResource = class {
|
|
|
2502
2536
|
rollup: options.rollup
|
|
2503
2537
|
};
|
|
2504
2538
|
if (options.model !== void 0) query.model = options.model;
|
|
2539
|
+
if (options.userEmail !== void 0) query.user_email = [...options.userEmail];
|
|
2505
2540
|
const data = await invokeWithRetry(this.config, this.http, "UsageController_list", { query });
|
|
2506
2541
|
return data;
|
|
2507
2542
|
}
|
|
2543
|
+
async listUsers(options) {
|
|
2544
|
+
const query = {
|
|
2545
|
+
since: options.since,
|
|
2546
|
+
until: options.until
|
|
2547
|
+
};
|
|
2548
|
+
const data = await invokeWithRetry(this.config, this.http, "UsageController_listUsers", {
|
|
2549
|
+
query
|
|
2550
|
+
});
|
|
2551
|
+
return data;
|
|
2552
|
+
}
|
|
2508
2553
|
};
|
|
2509
2554
|
|
|
2510
2555
|
// src/management/users.ts
|
|
@@ -2539,7 +2584,6 @@ var ModusManagement = class extends ModusClientBase {
|
|
|
2539
2584
|
this.workflows = new ManagementWorkflowsResource(this.http, this.config);
|
|
2540
2585
|
this.context = new ManagementContextResource(this.http, this.config);
|
|
2541
2586
|
this.usage = new ManagementUsageResource(this.http, this.config);
|
|
2542
|
-
this.organization = new ManagementOrganizationResource(this.http, this.config);
|
|
2543
2587
|
this.users = new ManagementUsersResource(this.http, this.config);
|
|
2544
2588
|
}
|
|
2545
2589
|
};
|