@proteos/sdk 0.94.1 → 0.95.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/index.cjs +39 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -1
- package/dist/index.d.ts +100 -1
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/auth/platform-entities.ts +3 -0
- package/src/index.ts +13 -0
- package/src/usage/index.ts +49 -0
- package/src/usage/types.ts +93 -0
package/dist/index.cjs
CHANGED
|
@@ -1124,7 +1124,10 @@ var PLATFORM_ENTITIES = [
|
|
|
1124
1124
|
{ slug: "enrichment-mappings", name: "Enrichment Mappings" },
|
|
1125
1125
|
// Usage (usage-service): the metering ledger. Read-only and org-level —
|
|
1126
1126
|
// whoever reads usage reads all of the org's usage.
|
|
1127
|
-
{ slug: "usage-records", name: "Usage Records" }
|
|
1127
|
+
{ slug: "usage-records", name: "Usage Records" },
|
|
1128
|
+
// The org's usage limits per meter and period (stacking contributions).
|
|
1129
|
+
// Org-level; org roles read, only platform admins write.
|
|
1130
|
+
{ slug: "usage-limits", name: "Usage Limits" }
|
|
1128
1131
|
];
|
|
1129
1132
|
var PLATFORM_ENTITY_SLUGS = PLATFORM_ENTITIES.map(
|
|
1130
1133
|
(entity) => entity.slug
|
|
@@ -5040,6 +5043,40 @@ var StorageClient = class {
|
|
|
5040
5043
|
}
|
|
5041
5044
|
};
|
|
5042
5045
|
|
|
5046
|
+
// src/usage/index.ts
|
|
5047
|
+
var USAGE_BASE_PATH = "/usage/v1";
|
|
5048
|
+
var UsageClient = class {
|
|
5049
|
+
constructor(client) {
|
|
5050
|
+
this.client = client;
|
|
5051
|
+
}
|
|
5052
|
+
client;
|
|
5053
|
+
/** The meter catalogue. */
|
|
5054
|
+
async meters() {
|
|
5055
|
+
const response = await this.client.request(
|
|
5056
|
+
"GET",
|
|
5057
|
+
`${USAGE_BASE_PATH}/meters`
|
|
5058
|
+
);
|
|
5059
|
+
return response.data;
|
|
5060
|
+
}
|
|
5061
|
+
/** Totals per meter over a period: sum meters from the ledger, latest meters from snapshots. */
|
|
5062
|
+
async summary(query) {
|
|
5063
|
+
const response = await this.client.requestWithQuery(
|
|
5064
|
+
"GET",
|
|
5065
|
+
`${USAGE_BASE_PATH}/summary`,
|
|
5066
|
+
query
|
|
5067
|
+
);
|
|
5068
|
+
return response.data;
|
|
5069
|
+
}
|
|
5070
|
+
/** The org's limits active now, with their usage in the current window. */
|
|
5071
|
+
async limits() {
|
|
5072
|
+
const response = await this.client.request(
|
|
5073
|
+
"GET",
|
|
5074
|
+
`${USAGE_BASE_PATH}/limits`
|
|
5075
|
+
);
|
|
5076
|
+
return response.data;
|
|
5077
|
+
}
|
|
5078
|
+
};
|
|
5079
|
+
|
|
5043
5080
|
// src/workflow/executions.ts
|
|
5044
5081
|
var EXECUTIONS_BASE_PATH = "/workflows/v1/executions";
|
|
5045
5082
|
var WORKFLOWS_BASE_PATH = "/workflows/v1/workflows";
|
|
@@ -5538,6 +5575,7 @@ exports.SchedulingClient = SchedulingClient;
|
|
|
5538
5575
|
exports.StorageClient = StorageClient;
|
|
5539
5576
|
exports.UNASSIGNED_SPACE_SLUG = UNASSIGNED_SPACE_SLUG;
|
|
5540
5577
|
exports.UNSUBSCRIBE_URL_PLACEHOLDER = UNSUBSCRIBE_URL_PLACEHOLDER;
|
|
5578
|
+
exports.UsageClient = UsageClient;
|
|
5541
5579
|
exports.UserProfileAssignmentSchema = UserProfileAssignmentSchema;
|
|
5542
5580
|
exports.UserRoleAssignmentSchema = UserRoleAssignmentSchema;
|
|
5543
5581
|
exports.UserSchema = UserSchema;
|