@theholocron/holocron-plugin-posthog 5.0.0-alpha.115 → 5.0.0-alpha.116
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 +2 -11
- package/dist/index.mjs +2 -1
- package/package.json +5 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PostHogClient, PostHogClient as PostHogClient$1, PostHogClientOptions, PostHogProject, PostHogProjectsResponse, PostHogUser, createPostHogClient } from "@theholocron/posthog-client";
|
|
2
|
-
import { Analytics, AuthError, ResolveTokenInput } from "@theholocron/cli";
|
|
2
|
+
import { Analytics, AuthError, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
|
|
3
3
|
//#region src/auth.d.ts
|
|
4
4
|
declare const resolveToken: (input?: ResolveTokenInput) => string;
|
|
5
5
|
//#endregion
|
|
@@ -30,21 +30,12 @@ declare class PostHogAnalytics implements Analytics {
|
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/verify-token.d.ts
|
|
33
|
-
interface VerifyTokenSuccess {
|
|
34
|
-
ok: true;
|
|
35
|
-
subject: string;
|
|
36
|
-
}
|
|
37
|
-
interface VerifyTokenFailure {
|
|
38
|
-
ok: false;
|
|
39
|
-
message: string;
|
|
40
|
-
}
|
|
41
|
-
type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
|
|
42
33
|
interface VerifyTokenOptions {
|
|
43
34
|
host?: string;
|
|
44
35
|
baseUrl?: string;
|
|
45
36
|
fetch?: typeof fetch;
|
|
46
37
|
}
|
|
47
|
-
declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult>;
|
|
38
|
+
declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
|
|
48
39
|
//#endregion
|
|
49
40
|
//#region src/index.d.ts
|
|
50
41
|
interface PostHogPluginOptions extends ResolveTokenInput, PostHogAnalyticsOptions {
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createPostHogClient, createPostHogClient as createPostHogClient$1 } from "@theholocron/posthog-client";
|
|
2
2
|
import { AuthError, createResolveToken } from "@theholocron/cli";
|
|
3
|
+
import { errorMessage } from "@theholocron/misc-utils";
|
|
3
4
|
//#region src/auth.ts
|
|
4
5
|
const resolveToken = createResolveToken({
|
|
5
6
|
envName: "HOLOCRON_POSTHOG_TOKEN",
|
|
@@ -62,7 +63,7 @@ async function verifyToken(token, opts = {}) {
|
|
|
62
63
|
} catch (err) {
|
|
63
64
|
return {
|
|
64
65
|
ok: false,
|
|
65
|
-
message:
|
|
66
|
+
message: errorMessage(err)
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-posthog",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.116",
|
|
4
4
|
"description": "Holocron plugin for PostHog. Implements the analytics capability — project provisioning and tracking token retrieval.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analytics",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@theholocron/eslint-config": "^8.7.0",
|
|
37
37
|
"@theholocron/http-client": "^1.37.1",
|
|
38
|
+
"@theholocron/misc-utils": "^1.9.2",
|
|
38
39
|
"@theholocron/tsconfig": "^8.7.0",
|
|
39
40
|
"@theholocron/tsdown-config": "^8.7.0",
|
|
40
41
|
"@theholocron/vitest-config": "^8.7.0",
|
|
@@ -49,10 +50,11 @@
|
|
|
49
50
|
"tsx": "4.23.12",
|
|
50
51
|
"typescript": "^5.9.3",
|
|
51
52
|
"vitest": "^4.1.11",
|
|
52
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
53
|
+
"@theholocron/cli": "5.0.0-alpha.116"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
|
-
"@theholocron/
|
|
56
|
+
"@theholocron/misc-utils": "^1.9.2",
|
|
57
|
+
"@theholocron/cli": "5.0.0-alpha.116"
|
|
56
58
|
},
|
|
57
59
|
"engines": {
|
|
58
60
|
"node": ">=22"
|