@remotion/licensing 4.0.414 → 4.0.415
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.
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const HOST = "https://www.remotion.pro";
|
|
2
|
+
export type RegisterUsageEventResponse = {
|
|
3
|
+
billable: boolean;
|
|
4
|
+
classification: UsageEventClassification;
|
|
5
|
+
};
|
|
6
|
+
type UsageEventType = 'webcodec-conversion' | 'cloud-render';
|
|
7
|
+
export type UsageEventClassification = 'billable' | 'development' | 'failed';
|
|
8
|
+
export declare const registerUsageEvent: ({ apiKey, host, succeeded, event, }: {
|
|
9
|
+
apiKey: string | null;
|
|
10
|
+
host: string | null;
|
|
11
|
+
succeeded: boolean;
|
|
12
|
+
event: UsageEventType;
|
|
13
|
+
}) => Promise<RegisterUsageEventResponse>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerUsageEvent = exports.HOST = void 0;
|
|
4
|
+
exports.HOST = 'https://www.remotion.pro';
|
|
5
|
+
const registerUsageEvent = async ({ apiKey, host, succeeded, event, }) => {
|
|
6
|
+
const abortController = new AbortController();
|
|
7
|
+
const timeout = setTimeout(() => {
|
|
8
|
+
abortController.abort();
|
|
9
|
+
}, 10000);
|
|
10
|
+
try {
|
|
11
|
+
const res = await fetch(`${exports.HOST}/api/track/register-usage-point`, {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
body: JSON.stringify({
|
|
14
|
+
event,
|
|
15
|
+
apiKey,
|
|
16
|
+
host,
|
|
17
|
+
succeeded,
|
|
18
|
+
}),
|
|
19
|
+
headers: {
|
|
20
|
+
'Content-Type': 'application/json',
|
|
21
|
+
},
|
|
22
|
+
signal: abortController.signal,
|
|
23
|
+
});
|
|
24
|
+
clearTimeout(timeout);
|
|
25
|
+
const json = (await res.json());
|
|
26
|
+
if (json.success) {
|
|
27
|
+
return {
|
|
28
|
+
billable: json.billable,
|
|
29
|
+
classification: json.classification,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (!res.ok) {
|
|
33
|
+
throw new Error(json.error);
|
|
34
|
+
}
|
|
35
|
+
const read = await res.json();
|
|
36
|
+
return read;
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
clearTimeout(timeout);
|
|
40
|
+
if (err instanceof Error && err.name === 'AbortError') {
|
|
41
|
+
throw new Error('Request timed out after 10 seconds');
|
|
42
|
+
}
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.registerUsageEvent = registerUsageEvent;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/licensing"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/licensing",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.415",
|
|
7
7
|
"description": "Manage your Remotion.pro license",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
27
|
+
"@remotion/eslint-config-internal": "4.0.415",
|
|
28
28
|
"eslint": "9.19.0",
|
|
29
29
|
"msw": "^2.7.1",
|
|
30
|
-
"remotion": "4.0.
|
|
30
|
+
"remotion": "4.0.415"
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://www.remotion.dev/docs/licensing",
|
|
33
33
|
"exports": {
|