init commit

This commit is contained in:
Carlos
2026-02-21 10:33:18 +01:00
parent c863a943ed
commit 9d955bf338
9512 changed files with 2015317 additions and 1305 deletions

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUsage = void 0;
const register_usage_event_1 = require("./register-usage-event");
const getUsage = async ({ since, ...apiOrLicenseKey }) => {
const apiKey = 'apiKey' in apiOrLicenseKey ? apiOrLicenseKey.apiKey : null;
const licenseKey = 'licenseKey' in apiOrLicenseKey ? apiOrLicenseKey.licenseKey : null;
const res = await fetch(`${register_usage_event_1.HOST}/api/track/get-usage`, {
method: 'POST',
body: JSON.stringify({
apiKey: licenseKey !== null && licenseKey !== void 0 ? licenseKey : apiKey,
since: since !== null && since !== void 0 ? since : null,
}),
headers: {
'Content-Type': 'application/json',
},
});
const json = (await res.json());
if (json.success) {
return {
cloudRenders: json.cloudRenders,
webcodecConversions: json.webcodecConversions,
};
}
throw new Error(json.error);
};
exports.getUsage = getUsage;