levelfour 1.7.0 → 1.8.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/api/resources/anthropic/client/Client.d.mts +150 -7
- package/dist/api/resources/anthropic/client/Client.d.ts +150 -7
- package/dist/api/resources/anthropic/client/Client.js +761 -85
- package/dist/api/resources/anthropic/client/Client.mjs +761 -85
- package/dist/api/resources/anthropic/client/requests/GetActivityBreakdownApiV1ProvidersAnthropicActivityBreakdownGetRequest.d.mts +19 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityBreakdownApiV1ProvidersAnthropicActivityBreakdownGetRequest.d.ts +19 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityBreakdownApiV1ProvidersAnthropicActivityBreakdownGetRequest.js +17 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityBreakdownApiV1ProvidersAnthropicActivityBreakdownGetRequest.mjs +1 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityFailuresApiV1ProvidersAnthropicActivityFailuresGetRequest.d.mts +13 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityFailuresApiV1ProvidersAnthropicActivityFailuresGetRequest.d.ts +13 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityFailuresApiV1ProvidersAnthropicActivityFailuresGetRequest.js +17 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityFailuresApiV1ProvidersAnthropicActivityFailuresGetRequest.mjs +1 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityMcpApiV1ProvidersAnthropicActivityMcpGetRequest.d.mts +13 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityMcpApiV1ProvidersAnthropicActivityMcpGetRequest.d.ts +13 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityMcpApiV1ProvidersAnthropicActivityMcpGetRequest.js +17 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityMcpApiV1ProvidersAnthropicActivityMcpGetRequest.mjs +1 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityPermissionModesApiV1ProvidersAnthropicActivityPermissionModesGetRequest.d.mts +13 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityPermissionModesApiV1ProvidersAnthropicActivityPermissionModesGetRequest.d.ts +13 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityPermissionModesApiV1ProvidersAnthropicActivityPermissionModesGetRequest.js +17 -0
- package/dist/api/resources/anthropic/client/requests/GetActivityPermissionModesApiV1ProvidersAnthropicActivityPermissionModesGetRequest.mjs +1 -0
- package/dist/api/resources/anthropic/client/requests/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequest.d.mts +2 -0
- package/dist/api/resources/anthropic/client/requests/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequest.d.ts +2 -0
- package/dist/api/resources/anthropic/client/requests/GetUsageDistributionApiV1ProvidersAnthropicUsageDistributionGetRequest.d.mts +3 -0
- package/dist/api/resources/anthropic/client/requests/GetUsageDistributionApiV1ProvidersAnthropicUsageDistributionGetRequest.d.ts +3 -0
- package/dist/api/resources/anthropic/client/requests/GetUsagePersonSessionApiV1ProvidersAnthropicUsagePeoplePersonSessionsSessionGetRequest.d.mts +11 -0
- package/dist/api/resources/anthropic/client/requests/GetUsagePersonSessionApiV1ProvidersAnthropicUsagePeoplePersonSessionsSessionGetRequest.d.ts +11 -0
- package/dist/api/resources/anthropic/client/requests/GetUsagePersonSessionApiV1ProvidersAnthropicUsagePeoplePersonSessionsSessionGetRequest.js +17 -0
- package/dist/api/resources/anthropic/client/requests/GetUsagePersonSessionApiV1ProvidersAnthropicUsagePeoplePersonSessionsSessionGetRequest.mjs +1 -0
- package/dist/api/resources/anthropic/client/requests/GetUsagePersonToolsApiV1ProvidersAnthropicUsagePeoplePersonToolsGetRequest.d.mts +15 -0
- package/dist/api/resources/anthropic/client/requests/GetUsagePersonToolsApiV1ProvidersAnthropicUsagePeoplePersonToolsGetRequest.d.ts +15 -0
- package/dist/api/resources/anthropic/client/requests/GetUsagePersonToolsApiV1ProvidersAnthropicUsagePeoplePersonToolsGetRequest.js +17 -0
- package/dist/api/resources/anthropic/client/requests/GetUsagePersonToolsApiV1ProvidersAnthropicUsagePeoplePersonToolsGetRequest.mjs +1 -0
- package/dist/api/resources/anthropic/client/requests/index.d.mts +6 -0
- package/dist/api/resources/anthropic/client/requests/index.d.ts +6 -0
- package/dist/api/resources/anthropic/types/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequestSort.d.mts +1 -0
- package/dist/api/resources/anthropic/types/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequestSort.d.ts +1 -0
- package/dist/api/resources/anthropic/types/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequestSort.js +2 -1
- package/dist/api/resources/anthropic/types/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequestSort.mjs +2 -1
- package/dist/api/resources/anthropic/types/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequestState.d.mts +10 -0
- package/dist/api/resources/anthropic/types/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequestState.d.ts +10 -0
- package/dist/api/resources/anthropic/types/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequestState.js +37 -0
- package/dist/api/resources/anthropic/types/GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequestState.mjs +13 -0
- package/dist/api/resources/anthropic/types/GetUsageDistributionApiV1ProvidersAnthropicUsageDistributionGetRequestBasis.d.mts +6 -0
- package/dist/api/resources/anthropic/types/GetUsageDistributionApiV1ProvidersAnthropicUsageDistributionGetRequestBasis.d.ts +6 -0
- package/dist/api/resources/anthropic/types/GetUsageDistributionApiV1ProvidersAnthropicUsageDistributionGetRequestBasis.js +32 -0
- package/dist/api/resources/anthropic/types/GetUsageDistributionApiV1ProvidersAnthropicUsageDistributionGetRequestBasis.mjs +8 -0
- package/dist/api/resources/anthropic/types/index.d.mts +2 -0
- package/dist/api/resources/anthropic/types/index.d.ts +2 -0
- package/dist/api/resources/anthropic/types/index.js +5 -1
- package/dist/api/resources/anthropic/types/index.mjs +2 -0
- package/dist/api/types/AiBreakdownData.d.mts +28 -0
- package/dist/api/types/AiBreakdownData.d.ts +28 -0
- package/dist/api/types/AiBreakdownData.js +44 -0
- package/dist/api/types/AiBreakdownData.mjs +20 -0
- package/dist/api/types/AiBreakdownDay.d.mts +5 -0
- package/dist/api/types/AiBreakdownDay.d.ts +5 -0
- package/dist/api/types/{AnthropicUsageMeasures.js → AiBreakdownDay.js} +3 -3
- package/dist/api/types/AiBreakdownDay.mjs +1 -0
- package/dist/api/types/AiBreakdownItem.d.mts +12 -0
- package/dist/api/types/AiBreakdownItem.d.ts +12 -0
- package/dist/api/types/AiBreakdownItem.js +17 -0
- package/dist/api/types/AiBreakdownItem.mjs +1 -0
- package/dist/api/types/AiBreakdownResponse.d.mts +6 -0
- package/dist/api/types/AiBreakdownResponse.d.ts +6 -0
- package/dist/api/types/AiBreakdownResponse.js +17 -0
- package/dist/api/types/AiBreakdownResponse.mjs +1 -0
- package/dist/api/types/AiFailureKind.d.mts +14 -0
- package/dist/api/types/AiFailureKind.d.ts +14 -0
- package/dist/api/types/AiFailureKind.js +38 -0
- package/dist/api/types/AiFailureKind.mjs +14 -0
- package/dist/api/types/AiFailuresData.d.mts +9 -0
- package/dist/api/types/AiFailuresData.d.ts +9 -0
- package/dist/api/types/AiFailuresData.js +17 -0
- package/dist/api/types/AiFailuresData.mjs +1 -0
- package/dist/api/types/AiFailuresResponse.d.mts +6 -0
- package/dist/api/types/AiFailuresResponse.d.ts +6 -0
- package/dist/api/types/AiFailuresResponse.js +17 -0
- package/dist/api/types/AiFailuresResponse.mjs +1 -0
- package/dist/api/types/AiMcpConnections.d.mts +8 -0
- package/dist/api/types/AiMcpConnections.d.ts +8 -0
- package/dist/api/types/AiMcpConnections.js +17 -0
- package/dist/api/types/AiMcpConnections.mjs +1 -0
- package/dist/api/types/AiMcpServer.d.mts +12 -0
- package/dist/api/types/AiMcpServer.d.ts +12 -0
- package/dist/api/types/AiMcpServer.js +17 -0
- package/dist/api/types/AiMcpServer.mjs +1 -0
- package/dist/api/types/AiMcpServersData.d.mts +5 -0
- package/dist/api/types/AiMcpServersData.d.ts +5 -0
- package/dist/api/types/AiMcpServersData.js +17 -0
- package/dist/api/types/AiMcpServersData.mjs +1 -0
- package/dist/api/types/AiMcpServersResponse.d.mts +6 -0
- package/dist/api/types/AiMcpServersResponse.d.ts +6 -0
- package/dist/api/types/AiMcpServersResponse.js +17 -0
- package/dist/api/types/AiMcpServersResponse.mjs +1 -0
- package/dist/api/types/AiPermissionMode.d.mts +5 -0
- package/dist/api/types/AiPermissionMode.d.ts +5 -0
- package/dist/api/types/AiPermissionMode.js +17 -0
- package/dist/api/types/AiPermissionMode.mjs +1 -0
- package/dist/api/types/AiPermissionModesData.d.mts +5 -0
- package/dist/api/types/AiPermissionModesData.d.ts +5 -0
- package/dist/api/types/AiPermissionModesData.js +17 -0
- package/dist/api/types/AiPermissionModesData.mjs +1 -0
- package/dist/api/types/AiPermissionModesResponse.d.mts +6 -0
- package/dist/api/types/AiPermissionModesResponse.d.ts +6 -0
- package/dist/api/types/AiPermissionModesResponse.js +17 -0
- package/dist/api/types/AiPermissionModesResponse.mjs +1 -0
- package/dist/api/types/AiPersonData.d.mts +20 -0
- package/dist/api/types/AiPersonData.d.ts +20 -0
- package/dist/api/types/AiPersonData.js +5 -0
- package/dist/api/types/AiPersonData.mjs +5 -0
- package/dist/api/types/AiPersonFailing.d.mts +17 -0
- package/dist/api/types/AiPersonFailing.d.ts +17 -0
- package/dist/api/types/AiPersonFailing.js +38 -0
- package/dist/api/types/AiPersonFailing.mjs +14 -0
- package/dist/api/types/AiPersonFailures.d.mts +17 -0
- package/dist/api/types/AiPersonFailures.d.ts +17 -0
- package/dist/api/types/AiPersonFailures.js +38 -0
- package/dist/api/types/AiPersonFailures.mjs +14 -0
- package/dist/api/types/AiPersonModel.d.mts +9 -0
- package/dist/api/types/AiPersonModel.d.ts +9 -0
- package/dist/api/types/AiPersonModel.js +17 -0
- package/dist/api/types/AiPersonModel.mjs +1 -0
- package/dist/api/types/AiPersonToolUse.d.mts +10 -0
- package/dist/api/types/AiPersonToolUse.d.ts +10 -0
- package/dist/api/types/AiPersonToolUse.js +17 -0
- package/dist/api/types/AiPersonToolUse.mjs +1 -0
- package/dist/api/types/AiPersonToolsData.d.mts +7 -0
- package/dist/api/types/AiPersonToolsData.d.ts +7 -0
- package/dist/api/types/AiPersonToolsData.js +17 -0
- package/dist/api/types/AiPersonToolsData.mjs +1 -0
- package/dist/api/types/AiPersonToolsResponse.d.mts +6 -0
- package/dist/api/types/AiPersonToolsResponse.d.ts +6 -0
- package/dist/api/types/AiPersonToolsResponse.js +17 -0
- package/dist/api/types/AiPersonToolsResponse.mjs +1 -0
- package/dist/api/types/AiSession.d.mts +23 -2
- package/dist/api/types/AiSession.d.ts +23 -2
- package/dist/api/types/AiSession.js +20 -0
- package/dist/api/types/AiSession.mjs +12 -0
- package/dist/api/types/AiSessionBucket.d.mts +8 -0
- package/dist/api/types/AiSessionBucket.d.ts +8 -0
- package/dist/api/types/AiSessionBucket.js +17 -0
- package/dist/api/types/AiSessionBucket.mjs +1 -0
- package/dist/api/types/AiSessionDetail.d.mts +45 -0
- package/dist/api/types/AiSessionDetail.d.ts +45 -0
- package/dist/api/types/AiSessionDetail.js +37 -0
- package/dist/api/types/AiSessionDetail.mjs +13 -0
- package/dist/api/types/AiSessionDetailResponse.d.mts +6 -0
- package/dist/api/types/AiSessionDetailResponse.d.ts +6 -0
- package/dist/api/types/AiSessionDetailResponse.js +17 -0
- package/dist/api/types/AiSessionDetailResponse.mjs +1 -0
- package/dist/api/types/AiSessionFailing.d.mts +28 -0
- package/dist/api/types/AiSessionFailing.d.ts +28 -0
- package/dist/api/types/AiSessionFailing.js +44 -0
- package/dist/api/types/AiSessionFailing.mjs +20 -0
- package/dist/api/types/AiSessionTool.d.mts +8 -0
- package/dist/api/types/AiSessionTool.d.ts +8 -0
- package/dist/api/types/AiSessionTool.js +17 -0
- package/dist/api/types/AiSessionTool.mjs +1 -0
- package/dist/api/types/AiTokensByType.d.mts +9 -0
- package/dist/api/types/AiTokensByType.d.ts +9 -0
- package/dist/api/types/AiTokensByType.js +17 -0
- package/dist/api/types/AiTokensByType.mjs +1 -0
- package/dist/api/types/AnthropicActivityData.d.mts +2 -0
- package/dist/api/types/AnthropicActivityData.d.ts +2 -0
- package/dist/api/types/AnthropicOverallResponseTimes.d.mts +10 -0
- package/dist/api/types/AnthropicOverallResponseTimes.d.ts +10 -0
- package/dist/api/types/AnthropicOverallResponseTimes.js +17 -0
- package/dist/api/types/AnthropicOverallResponseTimes.mjs +1 -0
- package/dist/api/types/AnthropicUsageBand.d.mts +8 -4
- package/dist/api/types/AnthropicUsageBand.d.ts +8 -4
- package/dist/api/types/AnthropicUsageData.d.mts +1 -1
- package/dist/api/types/AnthropicUsageData.d.ts +1 -1
- package/dist/api/types/AnthropicUsageDistributionData.d.mts +1 -1
- package/dist/api/types/AnthropicUsageDistributionData.d.ts +1 -1
- package/dist/api/types/AnthropicUsageTotals.d.mts +15 -0
- package/dist/api/types/AnthropicUsageTotals.d.ts +15 -0
- package/dist/api/types/AnthropicUsageTotals.js +17 -0
- package/dist/api/types/AnthropicUsageTotals.mjs +1 -0
- package/dist/api/types/BreakdownAsked.d.mts +36 -0
- package/dist/api/types/BreakdownAsked.d.ts +36 -0
- package/dist/api/types/BreakdownAsked.js +48 -0
- package/dist/api/types/BreakdownAsked.mjs +24 -0
- package/dist/api/types/ClaudeTeamAdoption.d.mts +11 -0
- package/dist/api/types/ClaudeTeamAdoption.d.ts +11 -0
- package/dist/api/types/ClaudeTeamAdoption.js +17 -0
- package/dist/api/types/ClaudeTeamAdoption.mjs +1 -0
- package/dist/api/types/ClaudeTeamAdoptionDay.d.mts +9 -0
- package/dist/api/types/ClaudeTeamAdoptionDay.d.ts +9 -0
- package/dist/api/types/ClaudeTeamAdoptionDay.js +17 -0
- package/dist/api/types/ClaudeTeamAdoptionDay.mjs +1 -0
- package/dist/api/types/ClaudeTeamPeopleData.d.mts +4 -0
- package/dist/api/types/ClaudeTeamPeopleData.d.ts +4 -0
- package/dist/api/types/ClaudeTeamPerson.d.mts +31 -0
- package/dist/api/types/ClaudeTeamPerson.d.ts +31 -0
- package/dist/api/types/ClaudeTeamPerson.js +17 -0
- package/dist/api/types/ClaudeTeamPerson.mjs +17 -0
- package/dist/api/types/ClaudeTeamStates.d.mts +11 -0
- package/dist/api/types/ClaudeTeamStates.d.ts +11 -0
- package/dist/api/types/ClaudeTeamStates.js +17 -0
- package/dist/api/types/ClaudeTeamStates.mjs +1 -0
- package/dist/api/types/ClaudeTeamSummaryData.d.mts +10 -0
- package/dist/api/types/ClaudeTeamSummaryData.d.ts +10 -0
- package/dist/api/types/SessionsAsked.d.mts +4 -0
- package/dist/api/types/SessionsAsked.d.ts +4 -0
- package/dist/api/types/index.d.mts +32 -1
- package/dist/api/types/index.d.ts +32 -1
- package/dist/api/types/index.js +64 -2
- package/dist/api/types/index.mjs +32 -1
- package/dist/version.d.mts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/dist/api/types/AnthropicUsageMeasures.d.mts +0 -9
- package/dist/api/types/AnthropicUsageMeasures.d.ts +0 -9
- package/dist/api/types/AnthropicUsageMeasures.mjs +0 -1
|
@@ -147,7 +147,7 @@ class AnthropicClient {
|
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
|
-
* Usage is what Claude Code and Cowork reported about themselves, valued at API list price. It is not what the organization is billed, and it includes the current day. totals covers the range, with each person counted once. daily has one entry per day of the range, at zero on a day nobody used Claude.
|
|
150
|
+
* Usage is what Claude Code and Cowork reported about themselves, valued at API list price. It is not what the organization is billed, and it includes the current day. totals covers the range, with each person counted once, and says how much input was read from the prompt cache, what that saved against sending it as input and what writing to the cache cost, at each model's list rates on the range's last day. daily has one entry per day of the range, at zero on a day nobody used Claude.
|
|
151
151
|
*
|
|
152
152
|
* @param {LevelFour.GetUsageApiV1ProvidersAnthropicUsageGetRequest} request
|
|
153
153
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -374,7 +374,7 @@ class AnthropicClient {
|
|
|
374
374
|
);
|
|
375
375
|
}
|
|
376
376
|
/**
|
|
377
|
-
* Usage is what Claude Code and Cowork reported about themselves, valued at API list price. It is not what the organization is billed, and it includes the current day. Each person is counted in the band their usage value over the range falls in, and every band is answered, including one with nobody in it. top_decile and rest set the tenth of the people who used the most beside everyone else.
|
|
377
|
+
* Usage is what Claude Code and Cowork reported about themselves, valued at API list price. It is not what the organization is billed, and it includes the current day. Each person is counted in the band their usage value over the range falls in, and every band is answered, including one with nobody in it. basis=tokens bands people by their tokens a week over the range, cache reads left out: over 5M, 1M to 5M, 200K to 1M and under 200K, then no use for the people seen in the 400 days before the range ends who used nothing in it. top_decile and rest set the tenth of the people who used the most beside everyone else, by usage value whatever the basis.
|
|
378
378
|
*
|
|
379
379
|
* @param {LevelFour.GetUsageDistributionApiV1ProvidersAnthropicUsageDistributionGetRequest} request
|
|
380
380
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -398,8 +398,9 @@ class AnthropicClient {
|
|
|
398
398
|
return core.HttpResponsePromise.fromPromise(this.__getUsageDistribution(request, requestOptions));
|
|
399
399
|
}
|
|
400
400
|
async __getUsageDistribution(request, requestOptions) {
|
|
401
|
-
const { start, end } = request;
|
|
401
|
+
const { basis, start, end } = request;
|
|
402
402
|
const _queryParams = {
|
|
403
|
+
basis: basis != null ? basis : void 0,
|
|
403
404
|
start,
|
|
404
405
|
end
|
|
405
406
|
};
|
|
@@ -597,7 +598,7 @@ class AnthropicClient {
|
|
|
597
598
|
);
|
|
598
599
|
}
|
|
599
600
|
/**
|
|
600
|
-
* Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. sections has one entry per kind of activity over the range, with its largest rows. response_times estimates, per model, how long a request took and how long its first token took: the times are kept in buckets, so each figure can be off by the width of one. people says how many people each kind of activity reached, and names nobody.
|
|
601
|
+
* Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. sections has one entry per kind of activity over the range, with its largest rows. response_times estimates, per model, how long a request took and how long its first token took, and overall the same over every model: the times are kept in buckets, so each figure can be off by the width of one. people says how many people each kind of activity reached, and names nobody.
|
|
601
602
|
*
|
|
602
603
|
* @param {LevelFour.GetActivityApiV1ProvidersAnthropicActivityGetRequest} request
|
|
603
604
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -930,9 +931,9 @@ class AnthropicClient {
|
|
|
930
931
|
);
|
|
931
932
|
}
|
|
932
933
|
/**
|
|
933
|
-
* Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. Each
|
|
934
|
+
* Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. Each MCP server a tool was called through or connected to in the range: the people who did either, the connections that opened and the ones that failed. failing is true once a connection failed, and those servers come first, then the most connections. A server is named only when the install sends server names; the connections of one that does not are under a server of null. Read from the session detail kept since migration 198. Names nobody.
|
|
934
935
|
*
|
|
935
|
-
* @param {LevelFour.
|
|
936
|
+
* @param {LevelFour.GetActivityMcpApiV1ProvidersAnthropicActivityMcpGetRequest} request
|
|
936
937
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
937
938
|
*
|
|
938
939
|
* @throws {@link LevelFour.BadRequestError}
|
|
@@ -945,15 +946,15 @@ class AnthropicClient {
|
|
|
945
946
|
* @throws {@link LevelFour.InternalServerError}
|
|
946
947
|
*
|
|
947
948
|
* @example
|
|
948
|
-
* await client.anthropic.
|
|
949
|
+
* await client.anthropic.getActivityMcp({
|
|
949
950
|
* start: "start",
|
|
950
951
|
* end: "end"
|
|
951
952
|
* })
|
|
952
953
|
*/
|
|
953
|
-
|
|
954
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
954
|
+
getActivityMcp(request, requestOptions) {
|
|
955
|
+
return core.HttpResponsePromise.fromPromise(this.__getActivityMcp(request, requestOptions));
|
|
955
956
|
}
|
|
956
|
-
async
|
|
957
|
+
async __getActivityMcp(request, requestOptions) {
|
|
957
958
|
const { start, end } = request;
|
|
958
959
|
const _queryParams = {
|
|
959
960
|
start,
|
|
@@ -968,7 +969,7 @@ class AnthropicClient {
|
|
|
968
969
|
const _response = await core.fetcher({
|
|
969
970
|
url: core.url.join(
|
|
970
971
|
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
971
|
-
"api/v1/providers/anthropic/activity/
|
|
972
|
+
"api/v1/providers/anthropic/activity/mcp"
|
|
972
973
|
),
|
|
973
974
|
method: "GET",
|
|
974
975
|
headers: _headers,
|
|
@@ -980,10 +981,7 @@ class AnthropicClient {
|
|
|
980
981
|
logging: this._options.logging
|
|
981
982
|
});
|
|
982
983
|
if (_response.ok) {
|
|
983
|
-
return {
|
|
984
|
-
data: _response.body,
|
|
985
|
-
rawResponse: _response.rawResponse
|
|
986
|
-
};
|
|
984
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
987
985
|
}
|
|
988
986
|
if (_response.error.reason === "status-code") {
|
|
989
987
|
switch (_response.error.statusCode) {
|
|
@@ -1039,12 +1037,13 @@ class AnthropicClient {
|
|
|
1039
1037
|
_response.error,
|
|
1040
1038
|
_response.rawResponse,
|
|
1041
1039
|
"GET",
|
|
1042
|
-
"/api/v1/providers/anthropic/activity/
|
|
1040
|
+
"/api/v1/providers/anthropic/activity/mcp"
|
|
1043
1041
|
);
|
|
1044
1042
|
}
|
|
1045
1043
|
/**
|
|
1046
|
-
*
|
|
1044
|
+
* Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. Each session with a request or a failure in the range, under the mode its latest change switched it to, whenever that was, or default for one that never switched. The range is 92 days at most, and 422 range_too_long past it. Read from the session detail kept since migration 198. Names nobody.
|
|
1047
1045
|
*
|
|
1046
|
+
* @param {LevelFour.GetActivityPermissionModesApiV1ProvidersAnthropicActivityPermissionModesGetRequest} request
|
|
1048
1047
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1049
1048
|
*
|
|
1050
1049
|
* @throws {@link LevelFour.BadRequestError}
|
|
@@ -1057,12 +1056,20 @@ class AnthropicClient {
|
|
|
1057
1056
|
* @throws {@link LevelFour.InternalServerError}
|
|
1058
1057
|
*
|
|
1059
1058
|
* @example
|
|
1060
|
-
* await client.anthropic.
|
|
1059
|
+
* await client.anthropic.getActivityPermissionModes({
|
|
1060
|
+
* start: "start",
|
|
1061
|
+
* end: "end"
|
|
1062
|
+
* })
|
|
1061
1063
|
*/
|
|
1062
|
-
|
|
1063
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1064
|
+
getActivityPermissionModes(request, requestOptions) {
|
|
1065
|
+
return core.HttpResponsePromise.fromPromise(this.__getActivityPermissionModes(request, requestOptions));
|
|
1064
1066
|
}
|
|
1065
|
-
async
|
|
1067
|
+
async __getActivityPermissionModes(request, requestOptions) {
|
|
1068
|
+
const { start, end } = request;
|
|
1069
|
+
const _queryParams = {
|
|
1070
|
+
start,
|
|
1071
|
+
end
|
|
1072
|
+
};
|
|
1066
1073
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
1067
1074
|
const _headers = (0, import_headers.mergeHeaders)(
|
|
1068
1075
|
_authRequest.headers,
|
|
@@ -1072,11 +1079,11 @@ class AnthropicClient {
|
|
|
1072
1079
|
const _response = await core.fetcher({
|
|
1073
1080
|
url: core.url.join(
|
|
1074
1081
|
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1075
|
-
"api/v1/providers/anthropic/
|
|
1082
|
+
"api/v1/providers/anthropic/activity/permission-modes"
|
|
1076
1083
|
),
|
|
1077
1084
|
method: "GET",
|
|
1078
1085
|
headers: _headers,
|
|
1079
|
-
queryParameters: requestOptions?.queryParams,
|
|
1086
|
+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
|
1080
1087
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
1081
1088
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
1082
1089
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -1140,13 +1147,13 @@ class AnthropicClient {
|
|
|
1140
1147
|
_response.error,
|
|
1141
1148
|
_response.rawResponse,
|
|
1142
1149
|
"GET",
|
|
1143
|
-
"/api/v1/providers/anthropic/
|
|
1150
|
+
"/api/v1/providers/anthropic/activity/permission-modes"
|
|
1144
1151
|
);
|
|
1145
1152
|
}
|
|
1146
1153
|
/**
|
|
1147
|
-
*
|
|
1154
|
+
* Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. Each list names at most three people, the largest figure first, and nobody whose figure is zero. behind_on_version and without_managed_settings count everyone they apply to among the people who reported usage in the range, and name three. The answer names people, so it is sent with Cache-Control: no-store.
|
|
1148
1155
|
*
|
|
1149
|
-
* @param {LevelFour.
|
|
1156
|
+
* @param {LevelFour.GetActivityPeopleApiV1ProvidersAnthropicActivityPeopleGetRequest} request
|
|
1150
1157
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1151
1158
|
*
|
|
1152
1159
|
* @throws {@link LevelFour.BadRequestError}
|
|
@@ -1159,15 +1166,15 @@ class AnthropicClient {
|
|
|
1159
1166
|
* @throws {@link LevelFour.InternalServerError}
|
|
1160
1167
|
*
|
|
1161
1168
|
* @example
|
|
1162
|
-
* await client.anthropic.
|
|
1169
|
+
* await client.anthropic.getActivityPeople({
|
|
1163
1170
|
* start: "start",
|
|
1164
1171
|
* end: "end"
|
|
1165
1172
|
* })
|
|
1166
1173
|
*/
|
|
1167
|
-
|
|
1168
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1174
|
+
getActivityPeople(request, requestOptions) {
|
|
1175
|
+
return core.HttpResponsePromise.fromPromise(this.__getActivityPeople(request, requestOptions));
|
|
1169
1176
|
}
|
|
1170
|
-
async
|
|
1177
|
+
async __getActivityPeople(request, requestOptions) {
|
|
1171
1178
|
const { start, end } = request;
|
|
1172
1179
|
const _queryParams = {
|
|
1173
1180
|
start,
|
|
@@ -1182,7 +1189,7 @@ class AnthropicClient {
|
|
|
1182
1189
|
const _response = await core.fetcher({
|
|
1183
1190
|
url: core.url.join(
|
|
1184
1191
|
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1185
|
-
"api/v1/providers/anthropic/
|
|
1192
|
+
"api/v1/providers/anthropic/activity/people"
|
|
1186
1193
|
),
|
|
1187
1194
|
method: "GET",
|
|
1188
1195
|
headers: _headers,
|
|
@@ -1194,7 +1201,10 @@ class AnthropicClient {
|
|
|
1194
1201
|
logging: this._options.logging
|
|
1195
1202
|
});
|
|
1196
1203
|
if (_response.ok) {
|
|
1197
|
-
return {
|
|
1204
|
+
return {
|
|
1205
|
+
data: _response.body,
|
|
1206
|
+
rawResponse: _response.rawResponse
|
|
1207
|
+
};
|
|
1198
1208
|
}
|
|
1199
1209
|
if (_response.error.reason === "status-code") {
|
|
1200
1210
|
switch (_response.error.statusCode) {
|
|
@@ -1250,13 +1260,13 @@ class AnthropicClient {
|
|
|
1250
1260
|
_response.error,
|
|
1251
1261
|
_response.rawResponse,
|
|
1252
1262
|
"GET",
|
|
1253
|
-
"/api/v1/providers/anthropic/
|
|
1263
|
+
"/api/v1/providers/anthropic/activity/people"
|
|
1254
1264
|
);
|
|
1255
1265
|
}
|
|
1256
1266
|
/**
|
|
1257
|
-
*
|
|
1267
|
+
* Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. The measure over the range for each person, each area of the AI area's spreadsheet or each repository, the 50 largest first, with previous over the range of the same length just before it and the people behind each. An area or repository of null is none, which is also what the area and repository filters take for it. By repository, or with a repository filter, the measure comes from what the sessions' metrics said, kept since migration 198, so it is one of pull_requests, commits, lines_added and lines_removed, and 422 measure_not_by_repository otherwise. granularity=daily adds each day of the range with a value for every key listed. The answer can name people, so it is sent with Cache-Control: no-store.
|
|
1258
1268
|
*
|
|
1259
|
-
* @param {LevelFour.
|
|
1269
|
+
* @param {LevelFour.GetActivityBreakdownApiV1ProvidersAnthropicActivityBreakdownGetRequest} request
|
|
1260
1270
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1261
1271
|
*
|
|
1262
1272
|
* @throws {@link LevelFour.BadRequestError}
|
|
@@ -1269,16 +1279,19 @@ class AnthropicClient {
|
|
|
1269
1279
|
* @throws {@link LevelFour.InternalServerError}
|
|
1270
1280
|
*
|
|
1271
1281
|
* @example
|
|
1272
|
-
* await client.anthropic.
|
|
1273
|
-
* asked: {
|
|
1282
|
+
* await client.anthropic.getActivityBreakdown({
|
|
1283
|
+
* asked: {
|
|
1284
|
+
* measure: "pull_requests",
|
|
1285
|
+
* group_by: "person"
|
|
1286
|
+
* },
|
|
1274
1287
|
* start: "start",
|
|
1275
1288
|
* end: "end"
|
|
1276
1289
|
* })
|
|
1277
1290
|
*/
|
|
1278
|
-
|
|
1279
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1291
|
+
getActivityBreakdown(request, requestOptions) {
|
|
1292
|
+
return core.HttpResponsePromise.fromPromise(this.__getActivityBreakdown(request, requestOptions));
|
|
1280
1293
|
}
|
|
1281
|
-
async
|
|
1294
|
+
async __getActivityBreakdown(request, requestOptions) {
|
|
1282
1295
|
const { asked, start, end } = request;
|
|
1283
1296
|
const _queryParams = {
|
|
1284
1297
|
asked,
|
|
@@ -1294,7 +1307,7 @@ class AnthropicClient {
|
|
|
1294
1307
|
const _response = await core.fetcher({
|
|
1295
1308
|
url: core.url.join(
|
|
1296
1309
|
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1297
|
-
"api/v1/providers/anthropic/
|
|
1310
|
+
"api/v1/providers/anthropic/activity/breakdown"
|
|
1298
1311
|
),
|
|
1299
1312
|
method: "GET",
|
|
1300
1313
|
headers: _headers,
|
|
@@ -1306,10 +1319,7 @@ class AnthropicClient {
|
|
|
1306
1319
|
logging: this._options.logging
|
|
1307
1320
|
});
|
|
1308
1321
|
if (_response.ok) {
|
|
1309
|
-
return {
|
|
1310
|
-
data: _response.body,
|
|
1311
|
-
rawResponse: _response.rawResponse
|
|
1312
|
-
};
|
|
1322
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1313
1323
|
}
|
|
1314
1324
|
if (_response.error.reason === "status-code") {
|
|
1315
1325
|
switch (_response.error.statusCode) {
|
|
@@ -1365,13 +1375,13 @@ class AnthropicClient {
|
|
|
1365
1375
|
_response.error,
|
|
1366
1376
|
_response.rawResponse,
|
|
1367
1377
|
"GET",
|
|
1368
|
-
"/api/v1/providers/anthropic/
|
|
1378
|
+
"/api/v1/providers/anthropic/activity/breakdown"
|
|
1369
1379
|
);
|
|
1370
1380
|
}
|
|
1371
1381
|
/**
|
|
1372
|
-
*
|
|
1382
|
+
* Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. Pass one day as start and end to drill into it. kinds adds up the failed requests by what the API answered: 400 invalid request, 429 rate limited, 529 overloaded, connection when no answer came, other for the rest. people and sessions name the 100 with the most, each with the kind most of theirs were, and a session says whether it recovered, a request succeeding after its last failure, or stopped, over every day it ran. The range is 31 days at most, and 422 range_too_long past it. Read from the session detail kept since migration 198, so a failure that named no session is not here. The answer names people, so it is sent with Cache-Control: no-store.
|
|
1373
1383
|
*
|
|
1374
|
-
* @param {LevelFour.
|
|
1384
|
+
* @param {LevelFour.GetActivityFailuresApiV1ProvidersAnthropicActivityFailuresGetRequest} request
|
|
1375
1385
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1376
1386
|
*
|
|
1377
1387
|
* @throws {@link LevelFour.BadRequestError}
|
|
@@ -1384,15 +1394,20 @@ class AnthropicClient {
|
|
|
1384
1394
|
* @throws {@link LevelFour.InternalServerError}
|
|
1385
1395
|
*
|
|
1386
1396
|
* @example
|
|
1387
|
-
* await client.anthropic.
|
|
1388
|
-
*
|
|
1397
|
+
* await client.anthropic.getActivityFailures({
|
|
1398
|
+
* start: "start",
|
|
1399
|
+
* end: "end"
|
|
1389
1400
|
* })
|
|
1390
1401
|
*/
|
|
1391
|
-
|
|
1392
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1402
|
+
getActivityFailures(request, requestOptions) {
|
|
1403
|
+
return core.HttpResponsePromise.fromPromise(this.__getActivityFailures(request, requestOptions));
|
|
1393
1404
|
}
|
|
1394
|
-
async
|
|
1395
|
-
const {
|
|
1405
|
+
async __getActivityFailures(request, requestOptions) {
|
|
1406
|
+
const { start, end } = request;
|
|
1407
|
+
const _queryParams = {
|
|
1408
|
+
start,
|
|
1409
|
+
end
|
|
1410
|
+
};
|
|
1396
1411
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
1397
1412
|
const _headers = (0, import_headers.mergeHeaders)(
|
|
1398
1413
|
_authRequest.headers,
|
|
@@ -1402,7 +1417,108 @@ class AnthropicClient {
|
|
|
1402
1417
|
const _response = await core.fetcher({
|
|
1403
1418
|
url: core.url.join(
|
|
1404
1419
|
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1405
|
-
|
|
1420
|
+
"api/v1/providers/anthropic/activity/failures"
|
|
1421
|
+
),
|
|
1422
|
+
method: "GET",
|
|
1423
|
+
headers: _headers,
|
|
1424
|
+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
|
1425
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
1426
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
1427
|
+
abortSignal: requestOptions?.abortSignal,
|
|
1428
|
+
fetchFn: this._options?.fetch,
|
|
1429
|
+
logging: this._options.logging
|
|
1430
|
+
});
|
|
1431
|
+
if (_response.ok) {
|
|
1432
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1433
|
+
}
|
|
1434
|
+
if (_response.error.reason === "status-code") {
|
|
1435
|
+
switch (_response.error.statusCode) {
|
|
1436
|
+
case 400:
|
|
1437
|
+
throw new LevelFour.BadRequestError(
|
|
1438
|
+
_response.error.body,
|
|
1439
|
+
_response.rawResponse
|
|
1440
|
+
);
|
|
1441
|
+
case 401:
|
|
1442
|
+
throw new LevelFour.UnauthorizedError(
|
|
1443
|
+
_response.error.body,
|
|
1444
|
+
_response.rawResponse
|
|
1445
|
+
);
|
|
1446
|
+
case 403:
|
|
1447
|
+
throw new LevelFour.ForbiddenError(
|
|
1448
|
+
_response.error.body,
|
|
1449
|
+
_response.rawResponse
|
|
1450
|
+
);
|
|
1451
|
+
case 404:
|
|
1452
|
+
throw new LevelFour.NotFoundError(
|
|
1453
|
+
_response.error.body,
|
|
1454
|
+
_response.rawResponse
|
|
1455
|
+
);
|
|
1456
|
+
case 409:
|
|
1457
|
+
throw new LevelFour.ConflictError(
|
|
1458
|
+
_response.error.body,
|
|
1459
|
+
_response.rawResponse
|
|
1460
|
+
);
|
|
1461
|
+
case 422:
|
|
1462
|
+
throw new LevelFour.UnprocessableEntityError(
|
|
1463
|
+
_response.error.body,
|
|
1464
|
+
_response.rawResponse
|
|
1465
|
+
);
|
|
1466
|
+
case 429:
|
|
1467
|
+
throw new LevelFour.TooManyRequestsError(
|
|
1468
|
+
_response.error.body,
|
|
1469
|
+
_response.rawResponse
|
|
1470
|
+
);
|
|
1471
|
+
case 500:
|
|
1472
|
+
throw new LevelFour.InternalServerError(
|
|
1473
|
+
_response.error.body,
|
|
1474
|
+
_response.rawResponse
|
|
1475
|
+
);
|
|
1476
|
+
default:
|
|
1477
|
+
throw new errors.LevelFourError({
|
|
1478
|
+
statusCode: _response.error.statusCode,
|
|
1479
|
+
body: _response.error.body,
|
|
1480
|
+
rawResponse: _response.rawResponse
|
|
1481
|
+
});
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
return (0, import_handleNonStatusCodeError.handleNonStatusCodeError)(
|
|
1485
|
+
_response.error,
|
|
1486
|
+
_response.rawResponse,
|
|
1487
|
+
"GET",
|
|
1488
|
+
"/api/v1/providers/anthropic/activity/failures"
|
|
1489
|
+
);
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Measured from today in UTC, with no range: how many people had nothing reported for them in the last 14 days and in the last 30, and the ten away the longest. Someone is last seen on the latest day any of their usage or activity was reported, and someone last seen more than 400 days ago is not counted. The answer names people, so it is sent with Cache-Control: no-store.
|
|
1493
|
+
*
|
|
1494
|
+
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1495
|
+
*
|
|
1496
|
+
* @throws {@link LevelFour.BadRequestError}
|
|
1497
|
+
* @throws {@link LevelFour.UnauthorizedError}
|
|
1498
|
+
* @throws {@link LevelFour.ForbiddenError}
|
|
1499
|
+
* @throws {@link LevelFour.NotFoundError}
|
|
1500
|
+
* @throws {@link LevelFour.ConflictError}
|
|
1501
|
+
* @throws {@link LevelFour.UnprocessableEntityError}
|
|
1502
|
+
* @throws {@link LevelFour.TooManyRequestsError}
|
|
1503
|
+
* @throws {@link LevelFour.InternalServerError}
|
|
1504
|
+
*
|
|
1505
|
+
* @example
|
|
1506
|
+
* await client.anthropic.getUsageInactive()
|
|
1507
|
+
*/
|
|
1508
|
+
getUsageInactive(requestOptions) {
|
|
1509
|
+
return core.HttpResponsePromise.fromPromise(this.__getUsageInactive(requestOptions));
|
|
1510
|
+
}
|
|
1511
|
+
async __getUsageInactive(requestOptions) {
|
|
1512
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
1513
|
+
const _headers = (0, import_headers.mergeHeaders)(
|
|
1514
|
+
_authRequest.headers,
|
|
1515
|
+
this._options?.headers,
|
|
1516
|
+
requestOptions?.headers
|
|
1517
|
+
);
|
|
1518
|
+
const _response = await core.fetcher({
|
|
1519
|
+
url: core.url.join(
|
|
1520
|
+
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1521
|
+
"api/v1/providers/anthropic/usage/inactive"
|
|
1406
1522
|
),
|
|
1407
1523
|
method: "GET",
|
|
1408
1524
|
headers: _headers,
|
|
@@ -1470,13 +1586,13 @@ class AnthropicClient {
|
|
|
1470
1586
|
_response.error,
|
|
1471
1587
|
_response.rawResponse,
|
|
1472
1588
|
"GET",
|
|
1473
|
-
"/api/v1/providers/anthropic/usage/
|
|
1589
|
+
"/api/v1/providers/anthropic/usage/inactive"
|
|
1474
1590
|
);
|
|
1475
1591
|
}
|
|
1476
1592
|
/**
|
|
1477
|
-
*
|
|
1593
|
+
* Everyone who reported usage in the range is one of three: new when they were first seen inside it, continuing when they also reported usage in the range of the same length just before, and returning otherwise. At most five are named: up to three of the new and up to two of the returning, each kind taking the places the other leaves empty. The answer names people, so it is sent with Cache-Control: no-store.
|
|
1478
1594
|
*
|
|
1479
|
-
* @param {LevelFour.
|
|
1595
|
+
* @param {LevelFour.GetUsageAdoptionApiV1ProvidersAnthropicUsageAdoptionGetRequest} request
|
|
1480
1596
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1481
1597
|
*
|
|
1482
1598
|
* @throws {@link LevelFour.BadRequestError}
|
|
@@ -1489,20 +1605,17 @@ class AnthropicClient {
|
|
|
1489
1605
|
* @throws {@link LevelFour.InternalServerError}
|
|
1490
1606
|
*
|
|
1491
1607
|
* @example
|
|
1492
|
-
* await client.anthropic.
|
|
1493
|
-
* person: "person",
|
|
1494
|
-
* asked: {},
|
|
1608
|
+
* await client.anthropic.getUsageAdoption({
|
|
1495
1609
|
* start: "start",
|
|
1496
1610
|
* end: "end"
|
|
1497
1611
|
* })
|
|
1498
1612
|
*/
|
|
1499
|
-
|
|
1500
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1613
|
+
getUsageAdoption(request, requestOptions) {
|
|
1614
|
+
return core.HttpResponsePromise.fromPromise(this.__getUsageAdoption(request, requestOptions));
|
|
1501
1615
|
}
|
|
1502
|
-
async
|
|
1503
|
-
const {
|
|
1616
|
+
async __getUsageAdoption(request, requestOptions) {
|
|
1617
|
+
const { start, end } = request;
|
|
1504
1618
|
const _queryParams = {
|
|
1505
|
-
asked,
|
|
1506
1619
|
start,
|
|
1507
1620
|
end
|
|
1508
1621
|
};
|
|
@@ -1515,7 +1628,7 @@ class AnthropicClient {
|
|
|
1515
1628
|
const _response = await core.fetcher({
|
|
1516
1629
|
url: core.url.join(
|
|
1517
1630
|
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1518
|
-
|
|
1631
|
+
"api/v1/providers/anthropic/usage/adoption"
|
|
1519
1632
|
),
|
|
1520
1633
|
method: "GET",
|
|
1521
1634
|
headers: _headers,
|
|
@@ -1583,13 +1696,13 @@ class AnthropicClient {
|
|
|
1583
1696
|
_response.error,
|
|
1584
1697
|
_response.rawResponse,
|
|
1585
1698
|
"GET",
|
|
1586
|
-
"/api/v1/providers/anthropic/usage/
|
|
1699
|
+
"/api/v1/providers/anthropic/usage/adoption"
|
|
1587
1700
|
);
|
|
1588
1701
|
}
|
|
1589
1702
|
/**
|
|
1590
|
-
*
|
|
1703
|
+
* One row per person usage or activity was reported for in the range, however many products they report through: the largest usage value first, then the most requests, then the name. summary covers the whole range whatever search, group and page narrow the rows to, and its group keys, with anonymous for installs that reported neither an email nor an account, are what group takes. first_seen and last_seen are the first and last day anything was reported for the person, inside the range or not. format=csv answers every row search and group keep, as a spreadsheet. The answer names people, so it is sent with Cache-Control: no-store.
|
|
1591
1704
|
*
|
|
1592
|
-
* @param {LevelFour.
|
|
1705
|
+
* @param {LevelFour.GetUsagePeopleApiV1ProvidersAnthropicUsagePeopleGetRequest} request
|
|
1593
1706
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1594
1707
|
*
|
|
1595
1708
|
* @throws {@link LevelFour.BadRequestError}
|
|
@@ -1602,17 +1715,19 @@ class AnthropicClient {
|
|
|
1602
1715
|
* @throws {@link LevelFour.InternalServerError}
|
|
1603
1716
|
*
|
|
1604
1717
|
* @example
|
|
1605
|
-
* await client.anthropic.
|
|
1718
|
+
* await client.anthropic.getUsagePeople({
|
|
1719
|
+
* asked: {},
|
|
1606
1720
|
* start: "start",
|
|
1607
1721
|
* end: "end"
|
|
1608
1722
|
* })
|
|
1609
1723
|
*/
|
|
1610
|
-
|
|
1611
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1724
|
+
getUsagePeople(request, requestOptions) {
|
|
1725
|
+
return core.HttpResponsePromise.fromPromise(this.__getUsagePeople(request, requestOptions));
|
|
1612
1726
|
}
|
|
1613
|
-
async
|
|
1614
|
-
const { start, end } = request;
|
|
1727
|
+
async __getUsagePeople(request, requestOptions) {
|
|
1728
|
+
const { asked, start, end } = request;
|
|
1615
1729
|
const _queryParams = {
|
|
1730
|
+
asked,
|
|
1616
1731
|
start,
|
|
1617
1732
|
end
|
|
1618
1733
|
};
|
|
@@ -1625,7 +1740,7 @@ class AnthropicClient {
|
|
|
1625
1740
|
const _response = await core.fetcher({
|
|
1626
1741
|
url: core.url.join(
|
|
1627
1742
|
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1628
|
-
"api/v1/providers/anthropic/
|
|
1743
|
+
"api/v1/providers/anthropic/usage/people"
|
|
1629
1744
|
),
|
|
1630
1745
|
method: "GET",
|
|
1631
1746
|
headers: _headers,
|
|
@@ -1637,7 +1752,10 @@ class AnthropicClient {
|
|
|
1637
1752
|
logging: this._options.logging
|
|
1638
1753
|
});
|
|
1639
1754
|
if (_response.ok) {
|
|
1640
|
-
return {
|
|
1755
|
+
return {
|
|
1756
|
+
data: _response.body,
|
|
1757
|
+
rawResponse: _response.rawResponse
|
|
1758
|
+
};
|
|
1641
1759
|
}
|
|
1642
1760
|
if (_response.error.reason === "status-code") {
|
|
1643
1761
|
switch (_response.error.statusCode) {
|
|
@@ -1693,13 +1811,13 @@ class AnthropicClient {
|
|
|
1693
1811
|
_response.error,
|
|
1694
1812
|
_response.rawResponse,
|
|
1695
1813
|
"GET",
|
|
1696
|
-
"/api/v1/providers/anthropic/
|
|
1814
|
+
"/api/v1/providers/anthropic/usage/people"
|
|
1697
1815
|
);
|
|
1698
1816
|
}
|
|
1699
1817
|
/**
|
|
1700
|
-
*
|
|
1818
|
+
* Usage is what Claude Code and Cowork reported about themselves, valued at API list price. It is not what the organization is billed, and it includes the current day. The last twelve weeks of tokens by product, and the person's tokens in 7 and 30 days, usage value, last use and idle weeks. Over the 30 days, their tokens by kind, each model they used and their failed requests in all and by day and kind. What their install last said of its version, against the newest one an install seen in 30 days is on, and of managed settings. A Claude Team plan adds the person's seat and its price, their area, extra usage and the seat change their use calls for, as /team/people reads them. 404 person_not_found for someone the tenant never heard of. The answer names a person, so it is sent with Cache-Control: no-store.
|
|
1701
1819
|
*
|
|
1702
|
-
* @param {LevelFour.
|
|
1820
|
+
* @param {LevelFour.GetUsagePersonApiV1ProvidersAnthropicUsagePeoplePersonGetRequest} request
|
|
1703
1821
|
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1704
1822
|
*
|
|
1705
1823
|
* @throws {@link LevelFour.BadRequestError}
|
|
@@ -1712,13 +1830,570 @@ class AnthropicClient {
|
|
|
1712
1830
|
* @throws {@link LevelFour.InternalServerError}
|
|
1713
1831
|
*
|
|
1714
1832
|
* @example
|
|
1715
|
-
* await client.anthropic.
|
|
1833
|
+
* await client.anthropic.getUsagePerson({
|
|
1834
|
+
* person: "person"
|
|
1835
|
+
* })
|
|
1716
1836
|
*/
|
|
1717
|
-
|
|
1718
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
1837
|
+
getUsagePerson(request, requestOptions) {
|
|
1838
|
+
return core.HttpResponsePromise.fromPromise(this.__getUsagePerson(request, requestOptions));
|
|
1719
1839
|
}
|
|
1720
|
-
async
|
|
1721
|
-
const {
|
|
1840
|
+
async __getUsagePerson(request, requestOptions) {
|
|
1841
|
+
const { person } = request;
|
|
1842
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
1843
|
+
const _headers = (0, import_headers.mergeHeaders)(
|
|
1844
|
+
_authRequest.headers,
|
|
1845
|
+
this._options?.headers,
|
|
1846
|
+
requestOptions?.headers
|
|
1847
|
+
);
|
|
1848
|
+
const _response = await core.fetcher({
|
|
1849
|
+
url: core.url.join(
|
|
1850
|
+
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1851
|
+
`api/v1/providers/anthropic/usage/people/${core.url.encodePathParam(person)}`
|
|
1852
|
+
),
|
|
1853
|
+
method: "GET",
|
|
1854
|
+
headers: _headers,
|
|
1855
|
+
queryParameters: requestOptions?.queryParams,
|
|
1856
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
1857
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
1858
|
+
abortSignal: requestOptions?.abortSignal,
|
|
1859
|
+
fetchFn: this._options?.fetch,
|
|
1860
|
+
logging: this._options.logging
|
|
1861
|
+
});
|
|
1862
|
+
if (_response.ok) {
|
|
1863
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1864
|
+
}
|
|
1865
|
+
if (_response.error.reason === "status-code") {
|
|
1866
|
+
switch (_response.error.statusCode) {
|
|
1867
|
+
case 400:
|
|
1868
|
+
throw new LevelFour.BadRequestError(
|
|
1869
|
+
_response.error.body,
|
|
1870
|
+
_response.rawResponse
|
|
1871
|
+
);
|
|
1872
|
+
case 401:
|
|
1873
|
+
throw new LevelFour.UnauthorizedError(
|
|
1874
|
+
_response.error.body,
|
|
1875
|
+
_response.rawResponse
|
|
1876
|
+
);
|
|
1877
|
+
case 403:
|
|
1878
|
+
throw new LevelFour.ForbiddenError(
|
|
1879
|
+
_response.error.body,
|
|
1880
|
+
_response.rawResponse
|
|
1881
|
+
);
|
|
1882
|
+
case 404:
|
|
1883
|
+
throw new LevelFour.NotFoundError(
|
|
1884
|
+
_response.error.body,
|
|
1885
|
+
_response.rawResponse
|
|
1886
|
+
);
|
|
1887
|
+
case 409:
|
|
1888
|
+
throw new LevelFour.ConflictError(
|
|
1889
|
+
_response.error.body,
|
|
1890
|
+
_response.rawResponse
|
|
1891
|
+
);
|
|
1892
|
+
case 422:
|
|
1893
|
+
throw new LevelFour.UnprocessableEntityError(
|
|
1894
|
+
_response.error.body,
|
|
1895
|
+
_response.rawResponse
|
|
1896
|
+
);
|
|
1897
|
+
case 429:
|
|
1898
|
+
throw new LevelFour.TooManyRequestsError(
|
|
1899
|
+
_response.error.body,
|
|
1900
|
+
_response.rawResponse
|
|
1901
|
+
);
|
|
1902
|
+
case 500:
|
|
1903
|
+
throw new LevelFour.InternalServerError(
|
|
1904
|
+
_response.error.body,
|
|
1905
|
+
_response.rawResponse
|
|
1906
|
+
);
|
|
1907
|
+
default:
|
|
1908
|
+
throw new errors.LevelFourError({
|
|
1909
|
+
statusCode: _response.error.statusCode,
|
|
1910
|
+
body: _response.error.body,
|
|
1911
|
+
rawResponse: _response.rawResponse
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
return (0, import_handleNonStatusCodeError.handleNonStatusCodeError)(
|
|
1916
|
+
_response.error,
|
|
1917
|
+
_response.rawResponse,
|
|
1918
|
+
"GET",
|
|
1919
|
+
"/api/v1/providers/anthropic/usage/people/{person}"
|
|
1920
|
+
);
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* Each session or conversation the person's tool named in the range, the latest first: when it started, its product, model and repository, its requests, tokens by kind and usage value, how long it ran from the first request to the last, its active time, its failed requests and how it ended, read from every day it ran. A session whose detail was kept before migration 198 has null failed requests and an unknown outcome. day keeps the sessions with a request that day and failed=true the ones with a failed request. What was said in it is never kept. Empty until the tool reports sessions. The answer names a person, so it is sent with Cache-Control: no-store.
|
|
1924
|
+
*
|
|
1925
|
+
* @param {LevelFour.GetUsagePersonSessionsApiV1ProvidersAnthropicUsagePeoplePersonSessionsGetRequest} request
|
|
1926
|
+
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1927
|
+
*
|
|
1928
|
+
* @throws {@link LevelFour.BadRequestError}
|
|
1929
|
+
* @throws {@link LevelFour.UnauthorizedError}
|
|
1930
|
+
* @throws {@link LevelFour.ForbiddenError}
|
|
1931
|
+
* @throws {@link LevelFour.NotFoundError}
|
|
1932
|
+
* @throws {@link LevelFour.ConflictError}
|
|
1933
|
+
* @throws {@link LevelFour.UnprocessableEntityError}
|
|
1934
|
+
* @throws {@link LevelFour.TooManyRequestsError}
|
|
1935
|
+
* @throws {@link LevelFour.InternalServerError}
|
|
1936
|
+
*
|
|
1937
|
+
* @example
|
|
1938
|
+
* await client.anthropic.getUsagePersonSessions({
|
|
1939
|
+
* person: "person",
|
|
1940
|
+
* asked: {},
|
|
1941
|
+
* start: "start",
|
|
1942
|
+
* end: "end"
|
|
1943
|
+
* })
|
|
1944
|
+
*/
|
|
1945
|
+
getUsagePersonSessions(request, requestOptions) {
|
|
1946
|
+
return core.HttpResponsePromise.fromPromise(this.__getUsagePersonSessions(request, requestOptions));
|
|
1947
|
+
}
|
|
1948
|
+
async __getUsagePersonSessions(request, requestOptions) {
|
|
1949
|
+
const { person, asked, start, end } = request;
|
|
1950
|
+
const _queryParams = {
|
|
1951
|
+
asked,
|
|
1952
|
+
start,
|
|
1953
|
+
end
|
|
1954
|
+
};
|
|
1955
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
1956
|
+
const _headers = (0, import_headers.mergeHeaders)(
|
|
1957
|
+
_authRequest.headers,
|
|
1958
|
+
this._options?.headers,
|
|
1959
|
+
requestOptions?.headers
|
|
1960
|
+
);
|
|
1961
|
+
const _response = await core.fetcher({
|
|
1962
|
+
url: core.url.join(
|
|
1963
|
+
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
1964
|
+
`api/v1/providers/anthropic/usage/people/${core.url.encodePathParam(person)}/sessions`
|
|
1965
|
+
),
|
|
1966
|
+
method: "GET",
|
|
1967
|
+
headers: _headers,
|
|
1968
|
+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
|
1969
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
1970
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
1971
|
+
abortSignal: requestOptions?.abortSignal,
|
|
1972
|
+
fetchFn: this._options?.fetch,
|
|
1973
|
+
logging: this._options.logging
|
|
1974
|
+
});
|
|
1975
|
+
if (_response.ok) {
|
|
1976
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1977
|
+
}
|
|
1978
|
+
if (_response.error.reason === "status-code") {
|
|
1979
|
+
switch (_response.error.statusCode) {
|
|
1980
|
+
case 400:
|
|
1981
|
+
throw new LevelFour.BadRequestError(
|
|
1982
|
+
_response.error.body,
|
|
1983
|
+
_response.rawResponse
|
|
1984
|
+
);
|
|
1985
|
+
case 401:
|
|
1986
|
+
throw new LevelFour.UnauthorizedError(
|
|
1987
|
+
_response.error.body,
|
|
1988
|
+
_response.rawResponse
|
|
1989
|
+
);
|
|
1990
|
+
case 403:
|
|
1991
|
+
throw new LevelFour.ForbiddenError(
|
|
1992
|
+
_response.error.body,
|
|
1993
|
+
_response.rawResponse
|
|
1994
|
+
);
|
|
1995
|
+
case 404:
|
|
1996
|
+
throw new LevelFour.NotFoundError(
|
|
1997
|
+
_response.error.body,
|
|
1998
|
+
_response.rawResponse
|
|
1999
|
+
);
|
|
2000
|
+
case 409:
|
|
2001
|
+
throw new LevelFour.ConflictError(
|
|
2002
|
+
_response.error.body,
|
|
2003
|
+
_response.rawResponse
|
|
2004
|
+
);
|
|
2005
|
+
case 422:
|
|
2006
|
+
throw new LevelFour.UnprocessableEntityError(
|
|
2007
|
+
_response.error.body,
|
|
2008
|
+
_response.rawResponse
|
|
2009
|
+
);
|
|
2010
|
+
case 429:
|
|
2011
|
+
throw new LevelFour.TooManyRequestsError(
|
|
2012
|
+
_response.error.body,
|
|
2013
|
+
_response.rawResponse
|
|
2014
|
+
);
|
|
2015
|
+
case 500:
|
|
2016
|
+
throw new LevelFour.InternalServerError(
|
|
2017
|
+
_response.error.body,
|
|
2018
|
+
_response.rawResponse
|
|
2019
|
+
);
|
|
2020
|
+
default:
|
|
2021
|
+
throw new errors.LevelFourError({
|
|
2022
|
+
statusCode: _response.error.statusCode,
|
|
2023
|
+
body: _response.error.body,
|
|
2024
|
+
rawResponse: _response.rawResponse
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
return (0, import_handleNonStatusCodeError.handleNonStatusCodeError)(
|
|
2029
|
+
_response.error,
|
|
2030
|
+
_response.rawResponse,
|
|
2031
|
+
"GET",
|
|
2032
|
+
"/api/v1/providers/anthropic/usage/people/{person}/sessions"
|
|
2033
|
+
);
|
|
2034
|
+
}
|
|
2035
|
+
/**
|
|
2036
|
+
* The session's figures as the list has them, with when its last request was sent, the mode it last switched to, its ten-minute timeline of requests and failures by kind, and its tools and MCP servers. collected is false for a session from before migration 198, whose timeline and tools are empty. 404 session_not_found when the person has no such session. The answer names a person, so it is sent with Cache-Control: no-store.
|
|
2037
|
+
*
|
|
2038
|
+
* @param {LevelFour.GetUsagePersonSessionApiV1ProvidersAnthropicUsagePeoplePersonSessionsSessionGetRequest} request
|
|
2039
|
+
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2040
|
+
*
|
|
2041
|
+
* @throws {@link LevelFour.BadRequestError}
|
|
2042
|
+
* @throws {@link LevelFour.UnauthorizedError}
|
|
2043
|
+
* @throws {@link LevelFour.ForbiddenError}
|
|
2044
|
+
* @throws {@link LevelFour.NotFoundError}
|
|
2045
|
+
* @throws {@link LevelFour.ConflictError}
|
|
2046
|
+
* @throws {@link LevelFour.UnprocessableEntityError}
|
|
2047
|
+
* @throws {@link LevelFour.TooManyRequestsError}
|
|
2048
|
+
* @throws {@link LevelFour.InternalServerError}
|
|
2049
|
+
*
|
|
2050
|
+
* @example
|
|
2051
|
+
* await client.anthropic.getUsagePersonSession({
|
|
2052
|
+
* person: "person",
|
|
2053
|
+
* session: "session"
|
|
2054
|
+
* })
|
|
2055
|
+
*/
|
|
2056
|
+
getUsagePersonSession(request, requestOptions) {
|
|
2057
|
+
return core.HttpResponsePromise.fromPromise(this.__getUsagePersonSession(request, requestOptions));
|
|
2058
|
+
}
|
|
2059
|
+
async __getUsagePersonSession(request, requestOptions) {
|
|
2060
|
+
const { person, session } = request;
|
|
2061
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2062
|
+
const _headers = (0, import_headers.mergeHeaders)(
|
|
2063
|
+
_authRequest.headers,
|
|
2064
|
+
this._options?.headers,
|
|
2065
|
+
requestOptions?.headers
|
|
2066
|
+
);
|
|
2067
|
+
const _response = await core.fetcher({
|
|
2068
|
+
url: core.url.join(
|
|
2069
|
+
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
2070
|
+
`api/v1/providers/anthropic/usage/people/${core.url.encodePathParam(person)}/sessions/${core.url.encodePathParam(session)}`
|
|
2071
|
+
),
|
|
2072
|
+
method: "GET",
|
|
2073
|
+
headers: _headers,
|
|
2074
|
+
queryParameters: requestOptions?.queryParams,
|
|
2075
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2076
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2077
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2078
|
+
fetchFn: this._options?.fetch,
|
|
2079
|
+
logging: this._options.logging
|
|
2080
|
+
});
|
|
2081
|
+
if (_response.ok) {
|
|
2082
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2083
|
+
}
|
|
2084
|
+
if (_response.error.reason === "status-code") {
|
|
2085
|
+
switch (_response.error.statusCode) {
|
|
2086
|
+
case 400:
|
|
2087
|
+
throw new LevelFour.BadRequestError(
|
|
2088
|
+
_response.error.body,
|
|
2089
|
+
_response.rawResponse
|
|
2090
|
+
);
|
|
2091
|
+
case 401:
|
|
2092
|
+
throw new LevelFour.UnauthorizedError(
|
|
2093
|
+
_response.error.body,
|
|
2094
|
+
_response.rawResponse
|
|
2095
|
+
);
|
|
2096
|
+
case 403:
|
|
2097
|
+
throw new LevelFour.ForbiddenError(
|
|
2098
|
+
_response.error.body,
|
|
2099
|
+
_response.rawResponse
|
|
2100
|
+
);
|
|
2101
|
+
case 404:
|
|
2102
|
+
throw new LevelFour.NotFoundError(
|
|
2103
|
+
_response.error.body,
|
|
2104
|
+
_response.rawResponse
|
|
2105
|
+
);
|
|
2106
|
+
case 409:
|
|
2107
|
+
throw new LevelFour.ConflictError(
|
|
2108
|
+
_response.error.body,
|
|
2109
|
+
_response.rawResponse
|
|
2110
|
+
);
|
|
2111
|
+
case 422:
|
|
2112
|
+
throw new LevelFour.UnprocessableEntityError(
|
|
2113
|
+
_response.error.body,
|
|
2114
|
+
_response.rawResponse
|
|
2115
|
+
);
|
|
2116
|
+
case 429:
|
|
2117
|
+
throw new LevelFour.TooManyRequestsError(
|
|
2118
|
+
_response.error.body,
|
|
2119
|
+
_response.rawResponse
|
|
2120
|
+
);
|
|
2121
|
+
case 500:
|
|
2122
|
+
throw new LevelFour.InternalServerError(
|
|
2123
|
+
_response.error.body,
|
|
2124
|
+
_response.rawResponse
|
|
2125
|
+
);
|
|
2126
|
+
default:
|
|
2127
|
+
throw new errors.LevelFourError({
|
|
2128
|
+
statusCode: _response.error.statusCode,
|
|
2129
|
+
body: _response.error.body,
|
|
2130
|
+
rawResponse: _response.rawResponse
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
return (0, import_handleNonStatusCodeError.handleNonStatusCodeError)(
|
|
2135
|
+
_response.error,
|
|
2136
|
+
_response.rawResponse,
|
|
2137
|
+
"GET",
|
|
2138
|
+
"/api/v1/providers/anthropic/usage/people/{person}/sessions/{session}"
|
|
2139
|
+
);
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* Each tool the person's sessions called in the range, the most calls first, with the MCP server an MCP tool was called through, its failed calls and its success rate, and apart from them the MCP servers they connected to. Read from the session detail kept since migration 198. The answer names a person, so it is sent with Cache-Control: no-store.
|
|
2143
|
+
*
|
|
2144
|
+
* @param {LevelFour.GetUsagePersonToolsApiV1ProvidersAnthropicUsagePeoplePersonToolsGetRequest} request
|
|
2145
|
+
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2146
|
+
*
|
|
2147
|
+
* @throws {@link LevelFour.BadRequestError}
|
|
2148
|
+
* @throws {@link LevelFour.UnauthorizedError}
|
|
2149
|
+
* @throws {@link LevelFour.ForbiddenError}
|
|
2150
|
+
* @throws {@link LevelFour.NotFoundError}
|
|
2151
|
+
* @throws {@link LevelFour.ConflictError}
|
|
2152
|
+
* @throws {@link LevelFour.UnprocessableEntityError}
|
|
2153
|
+
* @throws {@link LevelFour.TooManyRequestsError}
|
|
2154
|
+
* @throws {@link LevelFour.InternalServerError}
|
|
2155
|
+
*
|
|
2156
|
+
* @example
|
|
2157
|
+
* await client.anthropic.getUsagePersonTools({
|
|
2158
|
+
* person: "person",
|
|
2159
|
+
* start: "start",
|
|
2160
|
+
* end: "end"
|
|
2161
|
+
* })
|
|
2162
|
+
*/
|
|
2163
|
+
getUsagePersonTools(request, requestOptions) {
|
|
2164
|
+
return core.HttpResponsePromise.fromPromise(this.__getUsagePersonTools(request, requestOptions));
|
|
2165
|
+
}
|
|
2166
|
+
async __getUsagePersonTools(request, requestOptions) {
|
|
2167
|
+
const { person, start, end } = request;
|
|
2168
|
+
const _queryParams = {
|
|
2169
|
+
start,
|
|
2170
|
+
end
|
|
2171
|
+
};
|
|
2172
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2173
|
+
const _headers = (0, import_headers.mergeHeaders)(
|
|
2174
|
+
_authRequest.headers,
|
|
2175
|
+
this._options?.headers,
|
|
2176
|
+
requestOptions?.headers
|
|
2177
|
+
);
|
|
2178
|
+
const _response = await core.fetcher({
|
|
2179
|
+
url: core.url.join(
|
|
2180
|
+
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
2181
|
+
`api/v1/providers/anthropic/usage/people/${core.url.encodePathParam(person)}/tools`
|
|
2182
|
+
),
|
|
2183
|
+
method: "GET",
|
|
2184
|
+
headers: _headers,
|
|
2185
|
+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
|
2186
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2187
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2188
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2189
|
+
fetchFn: this._options?.fetch,
|
|
2190
|
+
logging: this._options.logging
|
|
2191
|
+
});
|
|
2192
|
+
if (_response.ok) {
|
|
2193
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2194
|
+
}
|
|
2195
|
+
if (_response.error.reason === "status-code") {
|
|
2196
|
+
switch (_response.error.statusCode) {
|
|
2197
|
+
case 400:
|
|
2198
|
+
throw new LevelFour.BadRequestError(
|
|
2199
|
+
_response.error.body,
|
|
2200
|
+
_response.rawResponse
|
|
2201
|
+
);
|
|
2202
|
+
case 401:
|
|
2203
|
+
throw new LevelFour.UnauthorizedError(
|
|
2204
|
+
_response.error.body,
|
|
2205
|
+
_response.rawResponse
|
|
2206
|
+
);
|
|
2207
|
+
case 403:
|
|
2208
|
+
throw new LevelFour.ForbiddenError(
|
|
2209
|
+
_response.error.body,
|
|
2210
|
+
_response.rawResponse
|
|
2211
|
+
);
|
|
2212
|
+
case 404:
|
|
2213
|
+
throw new LevelFour.NotFoundError(
|
|
2214
|
+
_response.error.body,
|
|
2215
|
+
_response.rawResponse
|
|
2216
|
+
);
|
|
2217
|
+
case 409:
|
|
2218
|
+
throw new LevelFour.ConflictError(
|
|
2219
|
+
_response.error.body,
|
|
2220
|
+
_response.rawResponse
|
|
2221
|
+
);
|
|
2222
|
+
case 422:
|
|
2223
|
+
throw new LevelFour.UnprocessableEntityError(
|
|
2224
|
+
_response.error.body,
|
|
2225
|
+
_response.rawResponse
|
|
2226
|
+
);
|
|
2227
|
+
case 429:
|
|
2228
|
+
throw new LevelFour.TooManyRequestsError(
|
|
2229
|
+
_response.error.body,
|
|
2230
|
+
_response.rawResponse
|
|
2231
|
+
);
|
|
2232
|
+
case 500:
|
|
2233
|
+
throw new LevelFour.InternalServerError(
|
|
2234
|
+
_response.error.body,
|
|
2235
|
+
_response.rawResponse
|
|
2236
|
+
);
|
|
2237
|
+
default:
|
|
2238
|
+
throw new errors.LevelFourError({
|
|
2239
|
+
statusCode: _response.error.statusCode,
|
|
2240
|
+
body: _response.error.body,
|
|
2241
|
+
rawResponse: _response.rawResponse
|
|
2242
|
+
});
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
return (0, import_handleNonStatusCodeError.handleNonStatusCodeError)(
|
|
2246
|
+
_response.error,
|
|
2247
|
+
_response.rawResponse,
|
|
2248
|
+
"GET",
|
|
2249
|
+
"/api/v1/providers/anthropic/usage/people/{person}/tools"
|
|
2250
|
+
);
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* What a Claude Team plan cost in the range, seats and extra usage apart, from the Members lists and spend reports uploaded for it, and how that moved against the range of the same length before. seats is the latest Members list. savings_found adds up what the seat changes /team/people recommends save a month. monthly is the last six months through the end of the range. month_to_date is the bill of the month the range ends in, estimate that plus the daily average of the range's last 7 days for each day left in it, and last_month the month before. adoption counts the people who sent a request in the 7 days that end each day of the range, and the engaged among them, active on 3 or more of those days, beside the seats. Before the first upload, has_members and has_spend are false and every figure is zero.
|
|
2254
|
+
*
|
|
2255
|
+
* @param {LevelFour.GetTeamSummaryApiV1ProvidersAnthropicTeamSummaryGetRequest} request
|
|
2256
|
+
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2257
|
+
*
|
|
2258
|
+
* @throws {@link LevelFour.BadRequestError}
|
|
2259
|
+
* @throws {@link LevelFour.UnauthorizedError}
|
|
2260
|
+
* @throws {@link LevelFour.ForbiddenError}
|
|
2261
|
+
* @throws {@link LevelFour.NotFoundError}
|
|
2262
|
+
* @throws {@link LevelFour.ConflictError}
|
|
2263
|
+
* @throws {@link LevelFour.UnprocessableEntityError}
|
|
2264
|
+
* @throws {@link LevelFour.TooManyRequestsError}
|
|
2265
|
+
* @throws {@link LevelFour.InternalServerError}
|
|
2266
|
+
*
|
|
2267
|
+
* @example
|
|
2268
|
+
* await client.anthropic.getTeamSummary({
|
|
2269
|
+
* start: "start",
|
|
2270
|
+
* end: "end"
|
|
2271
|
+
* })
|
|
2272
|
+
*/
|
|
2273
|
+
getTeamSummary(request, requestOptions) {
|
|
2274
|
+
return core.HttpResponsePromise.fromPromise(this.__getTeamSummary(request, requestOptions));
|
|
2275
|
+
}
|
|
2276
|
+
async __getTeamSummary(request, requestOptions) {
|
|
2277
|
+
const { start, end } = request;
|
|
2278
|
+
const _queryParams = {
|
|
2279
|
+
start,
|
|
2280
|
+
end
|
|
2281
|
+
};
|
|
2282
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2283
|
+
const _headers = (0, import_headers.mergeHeaders)(
|
|
2284
|
+
_authRequest.headers,
|
|
2285
|
+
this._options?.headers,
|
|
2286
|
+
requestOptions?.headers
|
|
2287
|
+
);
|
|
2288
|
+
const _response = await core.fetcher({
|
|
2289
|
+
url: core.url.join(
|
|
2290
|
+
await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment),
|
|
2291
|
+
"api/v1/providers/anthropic/team/summary"
|
|
2292
|
+
),
|
|
2293
|
+
method: "GET",
|
|
2294
|
+
headers: _headers,
|
|
2295
|
+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
|
2296
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2297
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2298
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2299
|
+
fetchFn: this._options?.fetch,
|
|
2300
|
+
logging: this._options.logging
|
|
2301
|
+
});
|
|
2302
|
+
if (_response.ok) {
|
|
2303
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2304
|
+
}
|
|
2305
|
+
if (_response.error.reason === "status-code") {
|
|
2306
|
+
switch (_response.error.statusCode) {
|
|
2307
|
+
case 400:
|
|
2308
|
+
throw new LevelFour.BadRequestError(
|
|
2309
|
+
_response.error.body,
|
|
2310
|
+
_response.rawResponse
|
|
2311
|
+
);
|
|
2312
|
+
case 401:
|
|
2313
|
+
throw new LevelFour.UnauthorizedError(
|
|
2314
|
+
_response.error.body,
|
|
2315
|
+
_response.rawResponse
|
|
2316
|
+
);
|
|
2317
|
+
case 403:
|
|
2318
|
+
throw new LevelFour.ForbiddenError(
|
|
2319
|
+
_response.error.body,
|
|
2320
|
+
_response.rawResponse
|
|
2321
|
+
);
|
|
2322
|
+
case 404:
|
|
2323
|
+
throw new LevelFour.NotFoundError(
|
|
2324
|
+
_response.error.body,
|
|
2325
|
+
_response.rawResponse
|
|
2326
|
+
);
|
|
2327
|
+
case 409:
|
|
2328
|
+
throw new LevelFour.ConflictError(
|
|
2329
|
+
_response.error.body,
|
|
2330
|
+
_response.rawResponse
|
|
2331
|
+
);
|
|
2332
|
+
case 422:
|
|
2333
|
+
throw new LevelFour.UnprocessableEntityError(
|
|
2334
|
+
_response.error.body,
|
|
2335
|
+
_response.rawResponse
|
|
2336
|
+
);
|
|
2337
|
+
case 429:
|
|
2338
|
+
throw new LevelFour.TooManyRequestsError(
|
|
2339
|
+
_response.error.body,
|
|
2340
|
+
_response.rawResponse
|
|
2341
|
+
);
|
|
2342
|
+
case 500:
|
|
2343
|
+
throw new LevelFour.InternalServerError(
|
|
2344
|
+
_response.error.body,
|
|
2345
|
+
_response.rawResponse
|
|
2346
|
+
);
|
|
2347
|
+
default:
|
|
2348
|
+
throw new errors.LevelFourError({
|
|
2349
|
+
statusCode: _response.error.statusCode,
|
|
2350
|
+
body: _response.error.body,
|
|
2351
|
+
rawResponse: _response.rawResponse
|
|
2352
|
+
});
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
return (0, import_handleNonStatusCodeError.handleNonStatusCodeError)(
|
|
2356
|
+
_response.error,
|
|
2357
|
+
_response.rawResponse,
|
|
2358
|
+
"GET",
|
|
2359
|
+
"/api/v1/providers/anthropic/team/summary"
|
|
2360
|
+
);
|
|
2361
|
+
}
|
|
2362
|
+
/**
|
|
2363
|
+
* One row per person the latest Members list names, the spend reports count or Claude Code reported, over the 7 and 30 days that end on the last day the spend reports cover. Tokens count every product the spend report names, and a product telemetry also counts is taken at whichever counted more. recommendation is the one rule a seat meets: remove for a seat unused for more than two weeks in a row, upgrade for a Standard seat whose extra usage in 30 days passed what Premium costs above it, downgrade for a Premium seat used less than the weekly token threshold in /team/settings. rules counts each rule over everyone, whatever the filters keep. A spend report that holds overage alone hides Chat inside the allowance: on one, downgrade reads Claude Code and Cowork telemetry for the people who report it, and remove is not available. Each row adds the requests that failed the person and the rate limits among them in the 30 days, the version their install reported last against latest_version, the newest an install seen in 30 days is on, whether its settings are managed, and states. state keeps the people in one state, and states counts each over the people the other filters keep. The largest saving comes first. format=csv answers every row the filters keep. The answer names people, so it is sent with Cache-Control: no-store.
|
|
2364
|
+
*
|
|
2365
|
+
* @param {LevelFour.GetTeamPeopleApiV1ProvidersAnthropicTeamPeopleGetRequest} request
|
|
2366
|
+
* @param {AnthropicClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2367
|
+
*
|
|
2368
|
+
* @throws {@link LevelFour.BadRequestError}
|
|
2369
|
+
* @throws {@link LevelFour.UnauthorizedError}
|
|
2370
|
+
* @throws {@link LevelFour.ForbiddenError}
|
|
2371
|
+
* @throws {@link LevelFour.NotFoundError}
|
|
2372
|
+
* @throws {@link LevelFour.ConflictError}
|
|
2373
|
+
* @throws {@link LevelFour.UnprocessableEntityError}
|
|
2374
|
+
* @throws {@link LevelFour.TooManyRequestsError}
|
|
2375
|
+
* @throws {@link LevelFour.InternalServerError}
|
|
2376
|
+
*
|
|
2377
|
+
* @example
|
|
2378
|
+
* await client.anthropic.getTeamPeople()
|
|
2379
|
+
*/
|
|
2380
|
+
getTeamPeople(request = {}, requestOptions) {
|
|
2381
|
+
return core.HttpResponsePromise.fromPromise(this.__getTeamPeople(request, requestOptions));
|
|
2382
|
+
}
|
|
2383
|
+
async __getTeamPeople(request = {}, requestOptions) {
|
|
2384
|
+
const {
|
|
2385
|
+
page,
|
|
2386
|
+
page_size: pageSize,
|
|
2387
|
+
search,
|
|
2388
|
+
area,
|
|
2389
|
+
seat,
|
|
2390
|
+
product,
|
|
2391
|
+
recommendation,
|
|
2392
|
+
state,
|
|
2393
|
+
sort,
|
|
2394
|
+
order,
|
|
2395
|
+
format
|
|
2396
|
+
} = request;
|
|
1722
2397
|
const _queryParams = {
|
|
1723
2398
|
page,
|
|
1724
2399
|
page_size: pageSize,
|
|
@@ -1727,6 +2402,7 @@ class AnthropicClient {
|
|
|
1727
2402
|
seat: seat !== void 0 ? seat : void 0,
|
|
1728
2403
|
product,
|
|
1729
2404
|
recommendation: recommendation !== void 0 ? recommendation : void 0,
|
|
2405
|
+
state: state !== void 0 ? state : void 0,
|
|
1730
2406
|
sort: sort != null ? sort : void 0,
|
|
1731
2407
|
order: order != null ? order : void 0,
|
|
1732
2408
|
format: format != null ? format : void 0
|