@crowdedkingdoms/crowdyjs 12.1.0 → 13.0.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.
@@ -1,12 +1,16 @@
1
- import { EnvironmentUsageSummaryDocument, OrgUsageByEnvironmentDocument, EnvironmentUsageByAppDocument, AppGraphqlOperationsDocument, AppUsageSummaryDocument, PlayerPulseDocument, } from '../generated/graphql.js';
1
+ import { AppGraphqlOperationsDocument, AppUsageSummaryDocument, PlayerPulseDocument, } from '../generated/graphql.js';
2
2
  /**
3
3
  * Replication + GraphQL usage reporting — exposed as `client.usage` (and
4
4
  * grouped under `client.admin`).
5
5
  *
6
- * Targets the **management-api**. All operations are read-only observability and
7
- * require the `view_usage` org permission. `since` args are ISO-8601 `DateTime`
8
- * strings; byte/message counters are returned as string counters because they
9
- * can exceed the 32-bit Int range. `BigInt` ids are decimal strings.
6
+ * All operations are read-only observability and require the `view_usage` org
7
+ * permission. `since` args are ISO-8601 `DateTime` strings; byte/message
8
+ * counters are returned as string counters because they can exceed the 32-bit
9
+ * Int range. `BigInt` ids are decimal strings.
10
+ *
11
+ * As of the unified galaxy API the per-environment rollups
12
+ * (environmentSummary/orgByEnvironment/environmentByApp) were retired with
13
+ * dedicated customer environments — usage is org/app-scoped.
10
14
  *
11
15
  * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING`
12
16
  * per the permission notes above.
@@ -15,49 +19,6 @@ export class UsageAPI {
15
19
  constructor(management) {
16
20
  this.management = management;
17
21
  }
18
- /**
19
- * Per-minute replication + GraphQL usage time series for one environment,
20
- * with rate peaks and live Buddy rates.
21
- *
22
- * @param orgId - Numeric org id.
23
- * @param environmentSlug - Environment slug to report on.
24
- * @param since - Start of the window (ISO-8601 DateTime) up to now.
25
- * @returns The {@link EnvironmentUsageSummary}.
26
- */
27
- async environmentSummary(orgId, environmentSlug, since) {
28
- const data = await this.management.request(EnvironmentUsageSummaryDocument, { orgId, environmentSlug, since });
29
- return data.environmentUsageSummary;
30
- }
31
- /**
32
- * Aggregate byte totals per environment across an org for a window.
33
- *
34
- * @param orgId - Numeric org id.
35
- * @param since - Start of the window (ISO-8601 DateTime) up to now.
36
- * @returns One rollup row per environment.
37
- */
38
- async orgByEnvironment(orgId, since) {
39
- const data = await this.management.request(OrgUsageByEnvironmentDocument, {
40
- orgId,
41
- since,
42
- });
43
- return data.orgUsageByEnvironment;
44
- }
45
- /**
46
- * Aggregate byte totals per app for the apps linked to an environment.
47
- *
48
- * @param orgId - Numeric org id.
49
- * @param environmentSlug - Environment slug whose apps to roll up.
50
- * @param since - Start of the window (ISO-8601 DateTime) up to now.
51
- * @returns One rollup row per app.
52
- */
53
- async environmentByApp(orgId, environmentSlug, since) {
54
- const data = await this.management.request(EnvironmentUsageByAppDocument, {
55
- orgId,
56
- environmentSlug,
57
- since,
58
- });
59
- return data.environmentUsageByApp;
60
- }
61
22
  /**
62
23
  * Top GraphQL operations for an app ranked by bytes.
63
24
  *