@alpic-ai/api 0.0.0-staging.g43a888b → 0.0.0-staging.g44dcfdd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -47,6 +47,26 @@ declare const contract: {
47
47
  BAD_REQUEST: {};
48
48
  }>, Record<never, never>>;
49
49
  };
50
+ getUsage: {
51
+ v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
52
+ teamId: z.ZodString;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ teamId: z.ZodString;
55
+ plan: z.ZodNullable<z.ZodEnum<{
56
+ pro: "pro";
57
+ business: "business";
58
+ enterprise: "enterprise";
59
+ }>>;
60
+ periodStart: z.ZodCoercedDate<unknown>;
61
+ periodEnd: z.ZodCoercedDate<unknown>;
62
+ requestCount: z.ZodNumber;
63
+ includedRequests: z.ZodNullable<z.ZodNumber>;
64
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
65
+ BAD_REQUEST: {};
66
+ }>, {
67
+ NOT_FOUND: {};
68
+ }>, Record<never, never>>;
69
+ };
50
70
  };
51
71
  analytics: {
52
72
  get: {
@@ -1079,6 +1099,26 @@ declare const contractForDocs: {
1079
1099
  BAD_REQUEST: {};
1080
1100
  }>, Record<never, never>>;
1081
1101
  };
1102
+ getUsage: {
1103
+ v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
1104
+ teamId: z.ZodString;
1105
+ }, z.core.$strip>, z.ZodObject<{
1106
+ teamId: z.ZodString;
1107
+ plan: z.ZodNullable<z.ZodEnum<{
1108
+ pro: "pro";
1109
+ business: "business";
1110
+ enterprise: "enterprise";
1111
+ }>>;
1112
+ periodStart: z.ZodCoercedDate<unknown>;
1113
+ periodEnd: z.ZodCoercedDate<unknown>;
1114
+ requestCount: z.ZodNumber;
1115
+ includedRequests: z.ZodNullable<z.ZodNumber>;
1116
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
1117
+ BAD_REQUEST: {};
1118
+ }>, {
1119
+ NOT_FOUND: {};
1120
+ }>, Record<never, never>>;
1121
+ };
1082
1122
  };
1083
1123
  analytics: {
1084
1124
  get: {
package/dist/index.mjs CHANGED
@@ -1398,6 +1398,12 @@ const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
1398
1398
  });
1399
1399
  z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
1400
1400
  z.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
1401
+ ({
1402
+ free: 1e4,
1403
+ pro: 2e5,
1404
+ business: 2e6,
1405
+ enterprise: null
1406
+ }).free;
1401
1407
  const subscriptionPlanSchema = z.enum([
1402
1408
  "pro",
1403
1409
  "business",
@@ -1415,6 +1421,7 @@ const customerUsageSchema = z.object({
1415
1421
  periodEnd: z.number()
1416
1422
  });
1417
1423
  const partnerDiscountSchema = z.object({ endsAt: z.number() });
1424
+ z.object({ balanceInNanoUSD: z.number() });
1418
1425
  z.object({
1419
1426
  customerCredits: customerCreditsSchema.nullable(),
1420
1427
  customerUsage: customerUsageSchema.nullable(),
@@ -1922,6 +1929,21 @@ const listTeamsContractV1 = base.route({
1922
1929
  createdAt: z.coerce.date(),
1923
1930
  hasStripeAccount: z.boolean()
1924
1931
  })));
1932
+ const getTeamUsageContractV1 = base.route({
1933
+ path: "/v1/teams/{teamId}/usage",
1934
+ method: "GET",
1935
+ summary: "Get team usage",
1936
+ description: "Get the MCP request usage of a team for its current billing window. A team that has made no request in the window reports zero.",
1937
+ tags: ["teams"],
1938
+ successDescription: "The current billing window usage"
1939
+ }).errors({ NOT_FOUND: {} }).input(z.object({ teamId: z.string().describe("The ID of the team") })).output(z.object({
1940
+ teamId: z.string(),
1941
+ plan: subscriptionPlanSchema.nullable().describe("The plan in force for the window, null on the Free plan"),
1942
+ periodStart: z.coerce.date().describe("Start of the current billing window"),
1943
+ periodEnd: z.coerce.date().describe("End of the current billing window"),
1944
+ requestCount: z.number().int().describe("MCP requests settled during the current billing window"),
1945
+ includedRequests: z.number().int().nullable().describe("Requests included in the plan for one window, null when the allowance is contract-specific")
1946
+ }));
1925
1947
  const getTunnelTicketContractV1 = base.route({
1926
1948
  path: "/v1/tunnels/ticket",
1927
1949
  method: "GET",
@@ -2030,7 +2052,10 @@ const getBeaconContractV1 = base.route({
2030
2052
  report: auditReportWithScreenshotsSchema.nullable()
2031
2053
  }));
2032
2054
  const contract = {
2033
- teams: { list: { v1: listTeamsContractV1 } },
2055
+ teams: {
2056
+ list: { v1: listTeamsContractV1 },
2057
+ getUsage: { v1: getTeamUsageContractV1 }
2058
+ },
2034
2059
  analytics: { get: { v1: getProjectAnalyticsContractV1 } },
2035
2060
  deployments: {
2036
2061
  list: { v1: listDeploymentsContractV1 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/api",
3
- "version": "0.0.0-staging.g43a888b",
3
+ "version": "0.0.0-staging.g44dcfdd",
4
4
  "description": "Contract for the Alpic API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",