Skip to content

Commit

Permalink
feat: add UsageSummary type (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
braaar authored Feb 14, 2024
1 parent 59795e2 commit 2b145be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/abax-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import {
type GetUsageSummaryInput,
type GetUsageSummaryResponse,
getUsageSummaryResponseSchema,
usageSummarySchema,
} from './calls/get-usage-summary.js';
import {
type ListCapabilitiesResponse,
Expand Down Expand Up @@ -134,7 +134,7 @@ export class AbaxClient {
queryParams.append('to', format(input.date_to, 'yyyy-MM-dd'));
return queryParams;
})
.parseJson(withZod(getUsageSummaryResponseSchema))
.parseJson(withZod(usageSummarySchema))
.build();

return this.performRequest(apiKey => call({ input, apiKey }));
Expand Down
8 changes: 4 additions & 4 deletions src/calls/get-usage-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ const usage = z.object({

export type Usage = z.infer<typeof usage>;

export const getUsageSummaryResponseSchema = z.object({
export const usageSummarySchema = z.object({
private_usage_summary: usage,
corporate_usage_summary: usage,
});

export type GetUsageSummaryResponse = z.infer<
typeof getUsageSummaryResponseSchema
>;
export type UsageSummary = z.infer<typeof usageSummarySchema>;

export type GetUsageSummaryResponse = UsageSummary;

0 comments on commit 2b145be

Please sign in to comment.