@to11ai/sdk 3.0.0-rc.24 → 3.0.0-rc.26
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/generated/index.d.ts +1 -1
- package/dist/generated/types.gen.d.ts +897 -195
- package/dist/generated/zod.gen.d.ts +325 -3
- package/dist/usage/resource.cjs +3 -7
- package/dist/usage/resource.d.ts +1 -1
- package/dist/usage/resource.js +3 -7
- package/dist/usage/types.d.ts +1 -4
- package/package.json +1 -1
- package/src/generated/index.ts +1 -1
- package/src/generated/types.gen.ts +923 -186
- package/src/generated/zod.gen.ts +325 -5
- package/src/usage/resource.ts +8 -14
- package/src/usage/types.ts +5 -4
package/src/generated/zod.gen.ts
CHANGED
|
@@ -183,6 +183,11 @@ export const zPrincipalApiKeyContextInvariant = z.object({
|
|
|
183
183
|
workspaceId: z.string().nullable()
|
|
184
184
|
}).nullish(),
|
|
185
185
|
audience: z.array(z.string()),
|
|
186
|
+
delegation: z.object({
|
|
187
|
+
actor: z.enum(['assistant:slack']),
|
|
188
|
+
organizationId: z.string(),
|
|
189
|
+
scopes: z.array(z.string())
|
|
190
|
+
}).nullish(),
|
|
186
191
|
email: z.string().nullable(),
|
|
187
192
|
emailVerified: z.boolean(),
|
|
188
193
|
externalId: z.string(),
|
|
@@ -1039,7 +1044,6 @@ export const zSlackIntegrationLookupSlackInstallationBody = z.object({
|
|
|
1039
1044
|
export const zSlackIntegrationLookupSlackInstallationResponse = z.object({
|
|
1040
1045
|
code: z.number(),
|
|
1041
1046
|
data: z.object({
|
|
1042
|
-
apiKey: z.string(),
|
|
1043
1047
|
botToken: z.string(),
|
|
1044
1048
|
botUserId: z.string(),
|
|
1045
1049
|
organizationId: z.string()
|
|
@@ -1067,6 +1071,118 @@ export const zSlackIntegrationLookupSlackInstallationResponse = z.object({
|
|
|
1067
1071
|
success: z.boolean()
|
|
1068
1072
|
});
|
|
1069
1073
|
|
|
1074
|
+
export const zSlackIntegrationRecordRefusedSlackRunBody = z.object({
|
|
1075
|
+
run: z.object({
|
|
1076
|
+
finishedAt: z.string().min(1).max(64),
|
|
1077
|
+
model: z.string().min(1).max(64),
|
|
1078
|
+
outcome: z.enum([
|
|
1079
|
+
'answered',
|
|
1080
|
+
'limit_tool_rounds',
|
|
1081
|
+
'limit_wall_clock',
|
|
1082
|
+
'limit_output_tokens',
|
|
1083
|
+
'refused',
|
|
1084
|
+
'credential_expired',
|
|
1085
|
+
'model_error',
|
|
1086
|
+
'disabled',
|
|
1087
|
+
'superseded',
|
|
1088
|
+
'credential_unavailable'
|
|
1089
|
+
]),
|
|
1090
|
+
reason: z.enum([
|
|
1091
|
+
'asker_external',
|
|
1092
|
+
'asker_guest',
|
|
1093
|
+
'shared_channel',
|
|
1094
|
+
'guest_in_channel',
|
|
1095
|
+
'unverified',
|
|
1096
|
+
'not_linked',
|
|
1097
|
+
'credential_unavailable'
|
|
1098
|
+
]).nullish(),
|
|
1099
|
+
reportedAsker: z.object({
|
|
1100
|
+
slackTeamId: z.string().min(1).max(32).regex(/^[A-Z0-9]+$/),
|
|
1101
|
+
slackUserId: z.string().min(1).max(32).regex(/^[A-Z0-9]+$/)
|
|
1102
|
+
}).nullish(),
|
|
1103
|
+
runId: z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/),
|
|
1104
|
+
runType: z.enum(['data_question', 'skill_run']),
|
|
1105
|
+
startedAt: z.string().min(1).max(64),
|
|
1106
|
+
surface: z.enum([
|
|
1107
|
+
'slack',
|
|
1108
|
+
'web_chat',
|
|
1109
|
+
'mcp'
|
|
1110
|
+
]),
|
|
1111
|
+
toolsCalled: z.array(z.string().min(1).max(64).regex(/^[a-z0-9_]+$/)).max(64)
|
|
1112
|
+
}),
|
|
1113
|
+
slackTeamId: z.string().min(1).max(32)
|
|
1114
|
+
});
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Success
|
|
1118
|
+
*/
|
|
1119
|
+
export const zSlackIntegrationRecordRefusedSlackRunResponse = z.object({
|
|
1120
|
+
code: z.number(),
|
|
1121
|
+
data: z.object({
|
|
1122
|
+
id: z.string()
|
|
1123
|
+
}).nullable(),
|
|
1124
|
+
error: z.object({
|
|
1125
|
+
code: z.string(),
|
|
1126
|
+
details: z.unknown().nullish(),
|
|
1127
|
+
message: z.string(),
|
|
1128
|
+
rowErrors: z.array(z.object({
|
|
1129
|
+
code: z.string(),
|
|
1130
|
+
message: z.string(),
|
|
1131
|
+
path: z.array(z.union([z.string(), z.number()]))
|
|
1132
|
+
})).nullish()
|
|
1133
|
+
}).nullable(),
|
|
1134
|
+
pagination: z.object({
|
|
1135
|
+
limit: z.int().gte(1).lte(100),
|
|
1136
|
+
page: z.int().gte(1).lte(9007199254740991),
|
|
1137
|
+
total: z.int().gte(0).lte(9007199254740991),
|
|
1138
|
+
totalPages: z.int().gte(0).lte(9007199254740991)
|
|
1139
|
+
}).nullable(),
|
|
1140
|
+
sdkBehavior: z.object({
|
|
1141
|
+
flags: z.record(z.string(), z.unknown()),
|
|
1142
|
+
v: z.int().gte(1).lte(9007199254740991)
|
|
1143
|
+
}).nullish(),
|
|
1144
|
+
success: z.boolean()
|
|
1145
|
+
});
|
|
1146
|
+
|
|
1147
|
+
export const zSlackIntegrationIssueSlackUserCredentialBody = z.object({
|
|
1148
|
+
slackTeamId: z.string().min(1).max(32),
|
|
1149
|
+
slackUserId: z.string().min(1).max(32)
|
|
1150
|
+
});
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Success
|
|
1154
|
+
*/
|
|
1155
|
+
export const zSlackIntegrationIssueSlackUserCredentialResponse = z.object({
|
|
1156
|
+
code: z.number(),
|
|
1157
|
+
data: z.object({
|
|
1158
|
+
credential: z.string(),
|
|
1159
|
+
displayName: z.string().nullable(),
|
|
1160
|
+
expiresAt: z.string(),
|
|
1161
|
+
principalId: z.string()
|
|
1162
|
+
}).nullable(),
|
|
1163
|
+
error: z.object({
|
|
1164
|
+
code: z.string(),
|
|
1165
|
+
details: z.unknown().nullish(),
|
|
1166
|
+
message: z.string(),
|
|
1167
|
+
rowErrors: z.array(z.object({
|
|
1168
|
+
code: z.string(),
|
|
1169
|
+
message: z.string(),
|
|
1170
|
+
path: z.array(z.union([z.string(), z.number()]))
|
|
1171
|
+
})).nullish()
|
|
1172
|
+
}).nullable(),
|
|
1173
|
+
pagination: z.object({
|
|
1174
|
+
limit: z.int().gte(1).lte(100),
|
|
1175
|
+
page: z.int().gte(1).lte(9007199254740991),
|
|
1176
|
+
total: z.int().gte(0).lte(9007199254740991),
|
|
1177
|
+
totalPages: z.int().gte(0).lte(9007199254740991)
|
|
1178
|
+
}).nullable(),
|
|
1179
|
+
sdkBehavior: z.object({
|
|
1180
|
+
flags: z.record(z.string(), z.unknown()),
|
|
1181
|
+
v: z.int().gte(1).lte(9007199254740991)
|
|
1182
|
+
}).nullish(),
|
|
1183
|
+
success: z.boolean()
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1070
1186
|
/**
|
|
1071
1187
|
* Success
|
|
1072
1188
|
*/
|
|
@@ -2311,6 +2427,81 @@ export const zIngestTokenExchangeIngestTokenResponse = z.object({
|
|
|
2311
2427
|
success: z.boolean()
|
|
2312
2428
|
});
|
|
2313
2429
|
|
|
2430
|
+
export const zSlackIntegrationCompleteSlackUserLinkBody = z.object({
|
|
2431
|
+
code: z.string().min(1).max(512),
|
|
2432
|
+
state: z.string().min(1).max(128)
|
|
2433
|
+
});
|
|
2434
|
+
|
|
2435
|
+
/**
|
|
2436
|
+
* Success
|
|
2437
|
+
*/
|
|
2438
|
+
export const zSlackIntegrationCompleteSlackUserLinkResponse = z.object({
|
|
2439
|
+
code: z.number(),
|
|
2440
|
+
data: z.object({
|
|
2441
|
+
organizationId: z.string(),
|
|
2442
|
+
organizationName: z.string(),
|
|
2443
|
+
replaced: z.array(z.object({
|
|
2444
|
+
platformPrincipalId: z.string(),
|
|
2445
|
+
slackTeamId: z.string(),
|
|
2446
|
+
slackUserId: z.string()
|
|
2447
|
+
})),
|
|
2448
|
+
slackUserName: z.string().nullable(),
|
|
2449
|
+
workspaceName: z.string()
|
|
2450
|
+
}).nullable(),
|
|
2451
|
+
error: z.object({
|
|
2452
|
+
code: z.string(),
|
|
2453
|
+
details: z.unknown().nullish(),
|
|
2454
|
+
message: z.string(),
|
|
2455
|
+
rowErrors: z.array(z.object({
|
|
2456
|
+
code: z.string(),
|
|
2457
|
+
message: z.string(),
|
|
2458
|
+
path: z.array(z.union([z.string(), z.number()]))
|
|
2459
|
+
})).nullish()
|
|
2460
|
+
}).nullable(),
|
|
2461
|
+
pagination: z.object({
|
|
2462
|
+
limit: z.int().gte(1).lte(100),
|
|
2463
|
+
page: z.int().gte(1).lte(9007199254740991),
|
|
2464
|
+
total: z.int().gte(0).lte(9007199254740991),
|
|
2465
|
+
totalPages: z.int().gte(0).lte(9007199254740991)
|
|
2466
|
+
}).nullable(),
|
|
2467
|
+
sdkBehavior: z.object({
|
|
2468
|
+
flags: z.record(z.string(), z.unknown()),
|
|
2469
|
+
v: z.int().gte(1).lte(9007199254740991)
|
|
2470
|
+
}).nullish(),
|
|
2471
|
+
success: z.boolean()
|
|
2472
|
+
});
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* Success
|
|
2476
|
+
*/
|
|
2477
|
+
export const zSlackIntegrationStartSlackUserLinkResponse = z.object({
|
|
2478
|
+
code: z.number(),
|
|
2479
|
+
data: z.object({
|
|
2480
|
+
authorizeUrl: z.string()
|
|
2481
|
+
}).nullable(),
|
|
2482
|
+
error: z.object({
|
|
2483
|
+
code: z.string(),
|
|
2484
|
+
details: z.unknown().nullish(),
|
|
2485
|
+
message: z.string(),
|
|
2486
|
+
rowErrors: z.array(z.object({
|
|
2487
|
+
code: z.string(),
|
|
2488
|
+
message: z.string(),
|
|
2489
|
+
path: z.array(z.union([z.string(), z.number()]))
|
|
2490
|
+
})).nullish()
|
|
2491
|
+
}).nullable(),
|
|
2492
|
+
pagination: z.object({
|
|
2493
|
+
limit: z.int().gte(1).lte(100),
|
|
2494
|
+
page: z.int().gte(1).lte(9007199254740991),
|
|
2495
|
+
total: z.int().gte(0).lte(9007199254740991),
|
|
2496
|
+
totalPages: z.int().gte(0).lte(9007199254740991)
|
|
2497
|
+
}).nullable(),
|
|
2498
|
+
sdkBehavior: z.object({
|
|
2499
|
+
flags: z.record(z.string(), z.unknown()),
|
|
2500
|
+
v: z.int().gte(1).lte(9007199254740991)
|
|
2501
|
+
}).nullish(),
|
|
2502
|
+
success: z.boolean()
|
|
2503
|
+
});
|
|
2504
|
+
|
|
2314
2505
|
export const zOrganizationsAcceptOrganizationInvitationBody = z.object({
|
|
2315
2506
|
token: z.string().min(1).max(2048)
|
|
2316
2507
|
});
|
|
@@ -2842,8 +3033,18 @@ export const zAssistantRunsRecordAssistantRunBody = z.object({
|
|
|
2842
3033
|
'credential_expired',
|
|
2843
3034
|
'model_error',
|
|
2844
3035
|
'disabled',
|
|
2845
|
-
'superseded'
|
|
3036
|
+
'superseded',
|
|
3037
|
+
'credential_unavailable'
|
|
2846
3038
|
]),
|
|
3039
|
+
reason: z.enum([
|
|
3040
|
+
'asker_external',
|
|
3041
|
+
'asker_guest',
|
|
3042
|
+
'shared_channel',
|
|
3043
|
+
'guest_in_channel',
|
|
3044
|
+
'unverified',
|
|
3045
|
+
'not_linked',
|
|
3046
|
+
'credential_unavailable'
|
|
3047
|
+
]).nullish(),
|
|
2847
3048
|
reportedAsker: z.object({
|
|
2848
3049
|
slackTeamId: z.string().min(1).max(32).regex(/^[A-Z0-9]+$/),
|
|
2849
3050
|
slackUserId: z.string().min(1).max(32).regex(/^[A-Z0-9]+$/)
|
|
@@ -2938,7 +3139,8 @@ export const zOrgAuditListOrgAuditEventsResponse = z.object({
|
|
|
2938
3139
|
'platform_setting',
|
|
2939
3140
|
'api_key',
|
|
2940
3141
|
'assistant_run',
|
|
2941
|
-
'slack_installation'
|
|
3142
|
+
'slack_installation',
|
|
3143
|
+
'slack_user_link'
|
|
2942
3144
|
]),
|
|
2943
3145
|
scope: z.enum(['organization', 'system']),
|
|
2944
3146
|
workspaceId: z.string().nullable()
|
|
@@ -3611,6 +3813,120 @@ export const zSlackIntegrationCreateSlackInstallUrlResponse = z.object({
|
|
|
3611
3813
|
success: z.boolean()
|
|
3612
3814
|
});
|
|
3613
3815
|
|
|
3816
|
+
export const zSlackIntegrationListSlackUserLinksPath = z.object({
|
|
3817
|
+
orgId: z.string()
|
|
3818
|
+
});
|
|
3819
|
+
|
|
3820
|
+
/**
|
|
3821
|
+
* Success
|
|
3822
|
+
*/
|
|
3823
|
+
export const zSlackIntegrationListSlackUserLinksResponse = z.object({
|
|
3824
|
+
code: z.number(),
|
|
3825
|
+
data: z.array(z.object({
|
|
3826
|
+
createdAt: z.string(),
|
|
3827
|
+
id: z.string(),
|
|
3828
|
+
platformPrincipalId: z.string(),
|
|
3829
|
+
slackTeamId: z.string(),
|
|
3830
|
+
slackUserId: z.string()
|
|
3831
|
+
})).nullable(),
|
|
3832
|
+
error: z.object({
|
|
3833
|
+
code: z.string(),
|
|
3834
|
+
details: z.unknown().nullish(),
|
|
3835
|
+
message: z.string(),
|
|
3836
|
+
rowErrors: z.array(z.object({
|
|
3837
|
+
code: z.string(),
|
|
3838
|
+
message: z.string(),
|
|
3839
|
+
path: z.array(z.union([z.string(), z.number()]))
|
|
3840
|
+
})).nullish()
|
|
3841
|
+
}).nullable(),
|
|
3842
|
+
pagination: z.object({
|
|
3843
|
+
limit: z.int().gte(1).lte(100),
|
|
3844
|
+
page: z.int().gte(1).lte(9007199254740991),
|
|
3845
|
+
total: z.int().gte(0).lte(9007199254740991),
|
|
3846
|
+
totalPages: z.int().gte(0).lte(9007199254740991)
|
|
3847
|
+
}).nullable(),
|
|
3848
|
+
sdkBehavior: z.object({
|
|
3849
|
+
flags: z.record(z.string(), z.unknown()),
|
|
3850
|
+
v: z.int().gte(1).lte(9007199254740991)
|
|
3851
|
+
}).nullish(),
|
|
3852
|
+
success: z.boolean()
|
|
3853
|
+
});
|
|
3854
|
+
|
|
3855
|
+
export const zSlackIntegrationGetMySlackUserLinkPath = z.object({
|
|
3856
|
+
orgId: z.string()
|
|
3857
|
+
});
|
|
3858
|
+
|
|
3859
|
+
/**
|
|
3860
|
+
* Success
|
|
3861
|
+
*/
|
|
3862
|
+
export const zSlackIntegrationGetMySlackUserLinkResponse = z.object({
|
|
3863
|
+
code: z.number(),
|
|
3864
|
+
data: z.object({
|
|
3865
|
+
createdAt: z.string(),
|
|
3866
|
+
id: z.string(),
|
|
3867
|
+
platformPrincipalId: z.string(),
|
|
3868
|
+
slackTeamId: z.string(),
|
|
3869
|
+
slackUserId: z.string()
|
|
3870
|
+
}).nullable(),
|
|
3871
|
+
error: z.object({
|
|
3872
|
+
code: z.string(),
|
|
3873
|
+
details: z.unknown().nullish(),
|
|
3874
|
+
message: z.string(),
|
|
3875
|
+
rowErrors: z.array(z.object({
|
|
3876
|
+
code: z.string(),
|
|
3877
|
+
message: z.string(),
|
|
3878
|
+
path: z.array(z.union([z.string(), z.number()]))
|
|
3879
|
+
})).nullish()
|
|
3880
|
+
}).nullable(),
|
|
3881
|
+
pagination: z.object({
|
|
3882
|
+
limit: z.int().gte(1).lte(100),
|
|
3883
|
+
page: z.int().gte(1).lte(9007199254740991),
|
|
3884
|
+
total: z.int().gte(0).lte(9007199254740991),
|
|
3885
|
+
totalPages: z.int().gte(0).lte(9007199254740991)
|
|
3886
|
+
}).nullable(),
|
|
3887
|
+
sdkBehavior: z.object({
|
|
3888
|
+
flags: z.record(z.string(), z.unknown()),
|
|
3889
|
+
v: z.int().gte(1).lte(9007199254740991)
|
|
3890
|
+
}).nullish(),
|
|
3891
|
+
success: z.boolean()
|
|
3892
|
+
});
|
|
3893
|
+
|
|
3894
|
+
export const zSlackIntegrationRemoveSlackUserLinkPath = z.object({
|
|
3895
|
+
orgId: z.string(),
|
|
3896
|
+
linkId: z.uuid().regex(/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/)
|
|
3897
|
+
});
|
|
3898
|
+
|
|
3899
|
+
/**
|
|
3900
|
+
* Success
|
|
3901
|
+
*/
|
|
3902
|
+
export const zSlackIntegrationRemoveSlackUserLinkResponse = z.object({
|
|
3903
|
+
code: z.number(),
|
|
3904
|
+
data: z.object({
|
|
3905
|
+
deleted: z.boolean()
|
|
3906
|
+
}).nullable(),
|
|
3907
|
+
error: z.object({
|
|
3908
|
+
code: z.string(),
|
|
3909
|
+
details: z.unknown().nullish(),
|
|
3910
|
+
message: z.string(),
|
|
3911
|
+
rowErrors: z.array(z.object({
|
|
3912
|
+
code: z.string(),
|
|
3913
|
+
message: z.string(),
|
|
3914
|
+
path: z.array(z.union([z.string(), z.number()]))
|
|
3915
|
+
})).nullish()
|
|
3916
|
+
}).nullable(),
|
|
3917
|
+
pagination: z.object({
|
|
3918
|
+
limit: z.int().gte(1).lte(100),
|
|
3919
|
+
page: z.int().gte(1).lte(9007199254740991),
|
|
3920
|
+
total: z.int().gte(0).lte(9007199254740991),
|
|
3921
|
+
totalPages: z.int().gte(0).lte(9007199254740991)
|
|
3922
|
+
}).nullable(),
|
|
3923
|
+
sdkBehavior: z.object({
|
|
3924
|
+
flags: z.record(z.string(), z.unknown()),
|
|
3925
|
+
v: z.int().gte(1).lte(9007199254740991)
|
|
3926
|
+
}).nullish(),
|
|
3927
|
+
success: z.boolean()
|
|
3928
|
+
});
|
|
3929
|
+
|
|
3614
3930
|
export const zOrganizationsListOrganizationInvitationsPath = z.object({
|
|
3615
3931
|
orgId: z.string()
|
|
3616
3932
|
});
|
|
@@ -5289,8 +5605,7 @@ export const zUsageListUsagePrincipalsPath = z.object({
|
|
|
5289
5605
|
});
|
|
5290
5606
|
|
|
5291
5607
|
export const zUsageListUsagePrincipalsQuery = z.object({
|
|
5292
|
-
query: z.string().min(1).max(100)
|
|
5293
|
-
email: z.string().min(2).max(320).nullish()
|
|
5608
|
+
query: z.string().min(1).max(100)
|
|
5294
5609
|
});
|
|
5295
5610
|
|
|
5296
5611
|
/**
|
|
@@ -13510,6 +13825,7 @@ export const zSessionsListSessionsResponse = z.object({
|
|
|
13510
13825
|
code: z.number(),
|
|
13511
13826
|
data: z.object({
|
|
13512
13827
|
items: z.array(z.object({
|
|
13828
|
+
agentTitle: z.string().nullish(),
|
|
13513
13829
|
apiPriceEquivalentUsd: z.number().nullable(),
|
|
13514
13830
|
billedCostUsd: z.number().nullable(),
|
|
13515
13831
|
billingMode: z.enum([
|
|
@@ -13702,6 +14018,7 @@ export const zSessionsGetSessionResponse = z.object({
|
|
|
13702
14018
|
code: z.number(),
|
|
13703
14019
|
data: z.object({
|
|
13704
14020
|
session: z.object({
|
|
14021
|
+
agentTitle: z.string().nullish(),
|
|
13705
14022
|
apiPriceEquivalentUsd: z.number().nullable(),
|
|
13706
14023
|
billedCostUsd: z.number().nullable(),
|
|
13707
14024
|
billingMode: z.enum([
|
|
@@ -13870,9 +14187,11 @@ export const zSessionsGetSessionResponse = z.object({
|
|
|
13870
14187
|
}))
|
|
13871
14188
|
}),
|
|
13872
14189
|
timeline: z.array(z.object({
|
|
14190
|
+
agentCall: z.enum(['quota-probe', 'session-title']).nullish(),
|
|
13873
14191
|
durationMs: z.number(),
|
|
13874
14192
|
firstUserMessage: z.string().nullable(),
|
|
13875
14193
|
inputTokens: z.int().gte(-9007199254740991).lte(9007199254740991),
|
|
14194
|
+
lastUserMessage: z.string().nullish(),
|
|
13876
14195
|
model: z.string().nullable(),
|
|
13877
14196
|
name: z.string(),
|
|
13878
14197
|
outputTokens: z.int().gte(-9007199254740991).lte(9007199254740991),
|
|
@@ -13922,6 +14241,7 @@ export const zSessionsExportSessionPath = z.object({
|
|
|
13922
14241
|
*/
|
|
13923
14242
|
export const zSessionsExportSessionResponse = z.object({
|
|
13924
14243
|
session: z.object({
|
|
14244
|
+
agentTitle: z.string().nullish(),
|
|
13925
14245
|
apiPriceEquivalentUsd: z.number().nullable(),
|
|
13926
14246
|
billedCostUsd: z.number().nullable(),
|
|
13927
14247
|
billingMode: z.enum([
|
package/src/usage/resource.ts
CHANGED
|
@@ -83,23 +83,17 @@ function windowQuery(window: UsageWindow): Query {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* The lookup's one query param
|
|
87
|
-
*
|
|
88
|
-
*
|
|
86
|
+
* The lookup's one query param, `query` (a name or part of one). The API
|
|
87
|
+
* dropped the `email` form (TO11-3860); a missing query is refused before
|
|
88
|
+
* any request.
|
|
89
89
|
*/
|
|
90
90
|
function principalsQuery(input: FindPrincipalsInput): Query {
|
|
91
|
-
const {
|
|
92
|
-
|
|
93
|
-
readonly query?: string | null;
|
|
94
|
-
};
|
|
95
|
-
const hasEmail = typeof email === "string";
|
|
96
|
-
const hasQuery = typeof query === "string";
|
|
97
|
-
if (hasEmail && !hasQuery) return { email };
|
|
98
|
-
if (hasQuery && !hasEmail) return { query };
|
|
91
|
+
const { query } = input as { readonly query?: string | null };
|
|
92
|
+
if (typeof query === "string") return { query };
|
|
99
93
|
throw new To11aiValidationError(
|
|
100
|
-
"[to11ai/sdk] findPrincipals() needs
|
|
94
|
+
"[to11ai/sdk] findPrincipals() needs `query`",
|
|
101
95
|
"invalid_principal_lookup",
|
|
102
|
-
{ query:
|
|
96
|
+
{ query: false },
|
|
103
97
|
);
|
|
104
98
|
}
|
|
105
99
|
|
|
@@ -115,7 +109,7 @@ export class UsageResource {
|
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
/**
|
|
118
|
-
* Members of the organization by name (`query`)
|
|
112
|
+
* Members of the organization by name (`query`), as
|
|
119
113
|
* `{ principalId, displayName }`. Pass a `principalId` to the other reads.
|
|
120
114
|
*/
|
|
121
115
|
async findPrincipals(
|
package/src/usage/types.ts
CHANGED
|
@@ -70,10 +70,11 @@ export type UsageExcludedProject =
|
|
|
70
70
|
|
|
71
71
|
// ─── Inputs ────────────────────────────────────────────────────────────────
|
|
72
72
|
|
|
73
|
-
/** Look a member up by name (`query`, matched in the API)
|
|
74
|
-
export type FindPrincipalsInput =
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
/** Look a member up by name (`query`, matched in the API). */
|
|
74
|
+
export type FindPrincipalsInput = {
|
|
75
|
+
readonly orgId: string;
|
|
76
|
+
readonly query: string;
|
|
77
|
+
};
|
|
77
78
|
|
|
78
79
|
export interface ListSessionsInput {
|
|
79
80
|
readonly orgId: string;
|