@alwaysmeticulous/client 2.283.1 → 2.284.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/api/agent.api.d.ts +5 -1
- package/dist/api/agent.api.js +6 -4
- package/dist/api/agent.api.js.map +1 -1
- package/dist/api/oauth.api.d.ts +23 -4
- package/dist/api/oauth.api.js +8 -3
- package/dist/api/oauth.api.js.map +1 -1
- package/dist/api/project-deployments.api.d.ts +22 -13
- package/dist/api/project-deployments.api.js +22 -16
- package/dist/api/project-deployments.api.js.map +1 -1
- package/dist/api/project.api.d.ts +1 -1
- package/dist/api/project.api.js +4 -4
- package/dist/api/project.api.js.map +1 -1
- package/dist/api/registry.api.d.ts +2 -1
- package/dist/api/registry.api.js +4 -4
- package/dist/api/registry.api.js.map +1 -1
- package/dist/api/session.api.d.ts +2 -2
- package/dist/api/session.api.js +6 -6
- package/dist/api/session.api.js.map +1 -1
- package/dist/client.d.ts +12 -0
- package/dist/client.js +46 -5
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/oauth/__tests__/oauth-utils.spec.d.ts +1 -0
- package/dist/oauth/__tests__/oauth-utils.spec.js +80 -0
- package/dist/oauth/__tests__/oauth-utils.spec.js.map +1 -0
- package/dist/oauth/oauth-constants.d.ts +1 -1
- package/dist/oauth/oauth-constants.js +3 -3
- package/dist/oauth/oauth-constants.js.map +1 -1
- package/dist/oauth/oauth-refresh.js +5 -4
- package/dist/oauth/oauth-refresh.js.map +1 -1
- package/dist/oauth/oauth-token-store.d.ts +7 -0
- package/dist/oauth/oauth-token-store.js +42 -3
- package/dist/oauth/oauth-token-store.js.map +1 -1
- package/dist/oauth/oauth-utils.d.ts +21 -0
- package/dist/oauth/oauth-utils.js +60 -0
- package/dist/oauth/oauth-utils.js.map +1 -0
- package/package.json +1 -1
package/dist/api/agent.api.d.ts
CHANGED
|
@@ -165,7 +165,11 @@ export interface StructuredSessionDataResponse {
|
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
export type AgentFeature = "debug-replay-diff" | "debug-replay";
|
|
168
|
-
export declare const trackAgentFeatureUsage: (client
|
|
168
|
+
export declare const trackAgentFeatureUsage: ({ client, feature, projectId, }: {
|
|
169
|
+
client: MeticulousClient;
|
|
170
|
+
feature: AgentFeature;
|
|
171
|
+
projectId: string | undefined;
|
|
172
|
+
}) => Promise<void>;
|
|
169
173
|
export declare const getTestRunDiffsSummary: (client: MeticulousClient, testRunId: string, options?: DiffsSummaryOptions) => Promise<DiffsSummaryResponse>;
|
|
170
174
|
export declare const getScreenshotDomDiff: (client: MeticulousClient, replayDiffId: string, screenshotName: string, index?: number, context?: string) => Promise<ScreenshotDomDiffResponse>;
|
|
171
175
|
export declare const getScreenshotUrls: (client: MeticulousClient, replayDiffId: string, screenshotName: string) => Promise<ScreenshotUrlsResponse>;
|
package/dist/api/agent.api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2d13753d-945c-582b-a070-e08d10805e24")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.getStructuredSessionData = exports.getTimelineDiff = exports.getScreenshotUrls = exports.getScreenshotDomDiff = exports.getTestRunDiffsSummary = exports.trackAgentFeatureUsage = void 0;
|
|
@@ -7,8 +7,10 @@ const errors_1 = require("../errors");
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
// API methods
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
|
-
const trackAgentFeatureUsage = async (client, feature) => {
|
|
11
|
-
await client
|
|
10
|
+
const trackAgentFeatureUsage = async ({ client, feature, projectId, }) => {
|
|
11
|
+
await client
|
|
12
|
+
.post("agent/telemetry", { feature }, projectId ? { params: { projectId } } : undefined)
|
|
13
|
+
.catch(() => {
|
|
12
14
|
// Telemetry is best-effort — never fail the command
|
|
13
15
|
});
|
|
14
16
|
};
|
|
@@ -73,4 +75,4 @@ const getStructuredSessionData = async (client, sessionId) => {
|
|
|
73
75
|
};
|
|
74
76
|
exports.getStructuredSessionData = getStructuredSessionData;
|
|
75
77
|
//# sourceMappingURL=agent.api.js.map
|
|
76
|
-
//# debugId=
|
|
78
|
+
//# debugId=2d13753d-945c-582b-a070-e08d10805e24
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.api.js","sources":["../../src/api/agent.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,sCAAkD;AAoLlD,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAEvE,MAAM,sBAAsB,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"agent.api.js","sources":["../../src/api/agent.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,sCAAkD;AAoLlD,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAEvE,MAAM,sBAAsB,GAAG,KAAK,EAAE,EAC3C,MAAM,EACN,OAAO,EACP,SAAS,GAKV,EAAiB,EAAE;IAClB,MAAM,MAAM;SACT,IAAI,CACH,iBAAiB,EACjB,EAAE,OAAO,EAAE,EACX,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAClD;SACA,KAAK,CAAC,GAAG,EAAE;QACV,oDAAoD;IACtD,CAAC,CAAC,CAAC;AACP,C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13753d-945c-582b-a070-e08d10805e24"}
|
package/dist/api/oauth.api.d.ts
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
import { MeticulousClient } from "../types/client.types";
|
|
2
|
+
export interface WhoamiOrganization {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
/**
|
|
6
|
+
* The caller's `OrganizationMembership.role` for this organization (one of
|
|
7
|
+
* `owner` | `member` | `reader`). Optional for forward-compatibility with
|
|
8
|
+
* older backends that do not yet populate it.
|
|
9
|
+
*/
|
|
10
|
+
role?: string;
|
|
11
|
+
}
|
|
2
12
|
export interface WhoamiResponse {
|
|
3
13
|
email: string;
|
|
4
14
|
firstName: string;
|
|
5
15
|
lastName: string;
|
|
6
16
|
isAdmin?: boolean;
|
|
7
|
-
organizations:
|
|
8
|
-
name: string;
|
|
9
|
-
id: string;
|
|
10
|
-
}[];
|
|
17
|
+
organizations: WhoamiOrganization[];
|
|
11
18
|
}
|
|
12
19
|
export declare const getWhoami: (client: MeticulousClient) => Promise<WhoamiResponse>;
|
|
20
|
+
export interface OAuthProject {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
organization: {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface OAuthProjectsResponse {
|
|
29
|
+
projects: OAuthProject[];
|
|
30
|
+
}
|
|
31
|
+
export declare const getOAuthProjects: (client: MeticulousClient) => Promise<OAuthProject[]>;
|
package/dist/api/oauth.api.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fac625ff-cf0d-58c8-bf8d-3460d25dfc78")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getWhoami = void 0;
|
|
5
|
+
exports.getOAuthProjects = exports.getWhoami = void 0;
|
|
6
6
|
const getWhoami = async (client) => {
|
|
7
7
|
const { data } = await client.get("oauth/whoami");
|
|
8
8
|
return data;
|
|
9
9
|
};
|
|
10
10
|
exports.getWhoami = getWhoami;
|
|
11
|
+
const getOAuthProjects = async (client) => {
|
|
12
|
+
const { data } = await client.get("oauth/projects");
|
|
13
|
+
return data.projects;
|
|
14
|
+
};
|
|
15
|
+
exports.getOAuthProjects = getOAuthProjects;
|
|
11
16
|
//# sourceMappingURL=oauth.api.js.map
|
|
12
|
-
//# debugId=
|
|
17
|
+
//# debugId=fac625ff-cf0d-58c8-bf8d-3460d25dfc78
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.api.js","sources":["../../src/api/oauth.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"oauth.api.js","sources":["../../src/api/oauth.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAqBO,MAAM,SAAS,GAAG,KAAK,EAC5B,MAAwB,EACC,EAAE;IAC3B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAiB,cAAc,CAAC,CAAC;IAClE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AALW,QAAA,SAAS,aAKpB;AAYK,MAAM,gBAAgB,GAAG,KAAK,EACnC,MAAwB,EACC,EAAE;IAC3B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAwB,gBAAgB,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC,QAAQ,CAAC;AACvB,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B","debugId":"fac625ff-cf0d-58c8-bf8d-3460d25dfc78"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { AssetUploadMetadata, DeploymentArchiveType, type TestRun } from "@alwaysmeticulous/api";
|
|
2
2
|
import { MeticulousClient } from "../types/client.types";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Identifies a project for OAuth callers, whose token does not by itself
|
|
5
|
+
* pin a project. The id is the one returned by `oauth/projects` and
|
|
6
|
+
* persisted via `meticulous auth set-project`. Omitted when authenticating
|
|
7
|
+
* with a project-scoped API token (the token already pins the project).
|
|
8
|
+
*/
|
|
9
|
+
export interface ProjectIdentifier {
|
|
10
|
+
projectId?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface RequestAssetUploadParams extends ProjectIdentifier {
|
|
4
13
|
size: number;
|
|
5
14
|
}
|
|
6
15
|
export interface RequestAssetUploadResponse {
|
|
7
16
|
uploadId: string;
|
|
8
17
|
uploadUrl: string;
|
|
9
18
|
}
|
|
10
|
-
export interface RequestMultipartAssetUploadParams {
|
|
19
|
+
export interface RequestMultipartAssetUploadParams extends ProjectIdentifier {
|
|
11
20
|
archiveType: DeploymentArchiveType;
|
|
12
21
|
}
|
|
13
22
|
export interface RequestMultipartAssetUploadResponse {
|
|
@@ -16,7 +25,7 @@ export interface RequestMultipartAssetUploadResponse {
|
|
|
16
25
|
uploadPartUrls: string[];
|
|
17
26
|
uploadChunkSize: number;
|
|
18
27
|
}
|
|
19
|
-
export interface RequestUploadPartParams {
|
|
28
|
+
export interface RequestUploadPartParams extends ProjectIdentifier {
|
|
20
29
|
uploadId: string;
|
|
21
30
|
awsUploadId: string;
|
|
22
31
|
size: number;
|
|
@@ -30,14 +39,14 @@ export interface MultiPartUploadInfo {
|
|
|
30
39
|
awsUploadId: string;
|
|
31
40
|
eTags: string[];
|
|
32
41
|
}
|
|
33
|
-
export interface RequestGitDiffUploadParams {
|
|
42
|
+
export interface RequestGitDiffUploadParams extends ProjectIdentifier {
|
|
34
43
|
uploadId: string;
|
|
35
44
|
size: number;
|
|
36
45
|
}
|
|
37
46
|
export interface RequestGitDiffUploadResponse {
|
|
38
47
|
uploadUrl: string;
|
|
39
48
|
}
|
|
40
|
-
export interface CompleteAssetUploadParams {
|
|
49
|
+
export interface CompleteAssetUploadParams extends ProjectIdentifier {
|
|
41
50
|
uploadId: string;
|
|
42
51
|
commitSha: string;
|
|
43
52
|
baseSha?: string | undefined;
|
|
@@ -53,7 +62,7 @@ export interface CompleteAssetUploadResponse {
|
|
|
53
62
|
baseNotFound?: boolean;
|
|
54
63
|
message?: string;
|
|
55
64
|
}
|
|
56
|
-
export interface CompleteContainerUploadParams {
|
|
65
|
+
export interface CompleteContainerUploadParams extends ProjectIdentifier {
|
|
57
66
|
uploadId: string;
|
|
58
67
|
commitSha: string;
|
|
59
68
|
baseSha?: string | undefined;
|
|
@@ -88,25 +97,25 @@ export interface DownloadDeploymentResponse {
|
|
|
88
97
|
metadataUrl: string;
|
|
89
98
|
archiveType: DeploymentArchiveType;
|
|
90
99
|
}
|
|
91
|
-
export declare const requestAssetUpload: ({ client, ...
|
|
100
|
+
export declare const requestAssetUpload: ({ client, projectId, ...body }: RequestAssetUploadParams & {
|
|
92
101
|
client: MeticulousClient;
|
|
93
102
|
}) => Promise<RequestAssetUploadResponse>;
|
|
94
|
-
export declare const requestMultipartAssetUpload: ({ client, ...
|
|
103
|
+
export declare const requestMultipartAssetUpload: ({ client, projectId, ...body }: RequestMultipartAssetUploadParams & {
|
|
95
104
|
client: MeticulousClient;
|
|
96
105
|
}) => Promise<RequestMultipartAssetUploadResponse>;
|
|
97
|
-
export declare const requestUploadPart: ({ client, ...
|
|
106
|
+
export declare const requestUploadPart: ({ client, projectId, ...body }: RequestUploadPartParams & {
|
|
98
107
|
client: MeticulousClient;
|
|
99
108
|
}) => Promise<RequestUploadPartResponse>;
|
|
100
|
-
export declare const requestGitDiffUpload: ({ client, ...
|
|
109
|
+
export declare const requestGitDiffUpload: ({ client, projectId, ...body }: RequestGitDiffUploadParams & {
|
|
101
110
|
client: MeticulousClient;
|
|
102
111
|
}) => Promise<RequestGitDiffUploadResponse>;
|
|
103
|
-
export declare const triggerRunOnDeployment: ({ client, ...
|
|
112
|
+
export declare const triggerRunOnDeployment: ({ client, projectId, ...body }: CompleteAssetUploadParams & {
|
|
104
113
|
client: MeticulousClient;
|
|
105
114
|
}) => Promise<CompleteAssetUploadResponse>;
|
|
106
|
-
export declare const completeAssetUpload: ({ client, ...
|
|
115
|
+
export declare const completeAssetUpload: ({ client, projectId, ...body }: CompleteAssetUploadParams & {
|
|
107
116
|
client: MeticulousClient;
|
|
108
117
|
}) => Promise<CompleteAssetUploadResponse>;
|
|
109
|
-
export declare const completeContainerUpload: ({ client, ...
|
|
118
|
+
export declare const completeContainerUpload: ({ client, projectId, ...body }: CompleteContainerUploadParams & {
|
|
110
119
|
client: MeticulousClient;
|
|
111
120
|
}) => Promise<CompleteContainerUploadResponse>;
|
|
112
121
|
export declare const downloadProjectDeployment: ({ client, deploymentUploadId, }: {
|
|
@@ -1,40 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c357c753-b913-5d21-b6b9-fd931f908c99")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.getContainerDeployment = exports.downloadProjectDeployment = exports.completeContainerUpload = exports.completeAssetUpload = exports.triggerRunOnDeployment = exports.requestGitDiffUpload = exports.requestUploadPart = exports.requestMultipartAssetUpload = exports.requestAssetUpload = void 0;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Builds a `RequestConfig` that puts `projectId` (if present) into the query
|
|
8
|
+
* string. Every project-deployment endpoint reads `projectId` from
|
|
9
|
+
* `@Query("projectId")` on the backend, not from the body.
|
|
10
|
+
*/
|
|
11
|
+
const projectIdQuery = (projectId) => projectId ? { params: { projectId } } : undefined;
|
|
12
|
+
const requestAssetUpload = async ({ client, projectId, ...body }) => {
|
|
13
|
+
const { data } = await client.post("project-deployments/request-asset-upload", body, projectIdQuery(projectId));
|
|
8
14
|
return data;
|
|
9
15
|
};
|
|
10
16
|
exports.requestAssetUpload = requestAssetUpload;
|
|
11
|
-
const requestMultipartAssetUpload = async ({ client, ...
|
|
12
|
-
const { data } = await client.post("project-deployments/request-multipart-asset-upload",
|
|
17
|
+
const requestMultipartAssetUpload = async ({ client, projectId, ...body }) => {
|
|
18
|
+
const { data } = await client.post("project-deployments/request-multipart-asset-upload", body, projectIdQuery(projectId));
|
|
13
19
|
return data;
|
|
14
20
|
};
|
|
15
21
|
exports.requestMultipartAssetUpload = requestMultipartAssetUpload;
|
|
16
|
-
const requestUploadPart = async ({ client, ...
|
|
17
|
-
const { data } = await client.post("project-deployments/request-upload-part",
|
|
22
|
+
const requestUploadPart = async ({ client, projectId, ...body }) => {
|
|
23
|
+
const { data } = await client.post("project-deployments/request-upload-part", body, projectIdQuery(projectId));
|
|
18
24
|
return data;
|
|
19
25
|
};
|
|
20
26
|
exports.requestUploadPart = requestUploadPart;
|
|
21
|
-
const requestGitDiffUpload = async ({ client, ...
|
|
22
|
-
const { data } = await client.post("project-deployments/request-git-diff-upload",
|
|
27
|
+
const requestGitDiffUpload = async ({ client, projectId, ...body }) => {
|
|
28
|
+
const { data } = await client.post("project-deployments/request-git-diff-upload", body, projectIdQuery(projectId));
|
|
23
29
|
return data;
|
|
24
30
|
};
|
|
25
31
|
exports.requestGitDiffUpload = requestGitDiffUpload;
|
|
26
|
-
const triggerRunOnDeployment = async ({ client, ...
|
|
27
|
-
const { data } = await client.post("project-deployments/trigger-run",
|
|
32
|
+
const triggerRunOnDeployment = async ({ client, projectId, ...body }) => {
|
|
33
|
+
const { data } = await client.post("project-deployments/trigger-run", body, projectIdQuery(projectId));
|
|
28
34
|
return data;
|
|
29
35
|
};
|
|
30
36
|
exports.triggerRunOnDeployment = triggerRunOnDeployment;
|
|
31
|
-
const completeAssetUpload = async ({ client, ...
|
|
32
|
-
const { data } = await client.post("project-deployments/complete-asset-upload-and-maybe-trigger-run",
|
|
37
|
+
const completeAssetUpload = async ({ client, projectId, ...body }) => {
|
|
38
|
+
const { data } = await client.post("project-deployments/complete-asset-upload-and-maybe-trigger-run", body, projectIdQuery(projectId));
|
|
33
39
|
return data;
|
|
34
40
|
};
|
|
35
41
|
exports.completeAssetUpload = completeAssetUpload;
|
|
36
|
-
const completeContainerUpload = async ({ client, ...
|
|
37
|
-
const { data } = await client.post("project-deployments/complete-container-upload",
|
|
42
|
+
const completeContainerUpload = async ({ client, projectId, ...body }) => {
|
|
43
|
+
const { data } = await client.post("project-deployments/complete-container-upload", body, projectIdQuery(projectId));
|
|
38
44
|
return data;
|
|
39
45
|
};
|
|
40
46
|
exports.completeContainerUpload = completeContainerUpload;
|
|
@@ -49,4 +55,4 @@ const getContainerDeployment = async ({ client, deploymentUploadId, }) => {
|
|
|
49
55
|
};
|
|
50
56
|
exports.getContainerDeployment = getContainerDeployment;
|
|
51
57
|
//# sourceMappingURL=project-deployments.api.js.map
|
|
52
|
-
//# debugId=
|
|
58
|
+
//# debugId=c357c753-b913-5d21-b6b9-fd931f908c99
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-deployments.api.js","sources":["../../src/api/project-deployments.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"project-deployments.api.js","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,GAAG,CAG/B,uBAAuB,kBAAkB,EAAE,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAZW,QAAA,yBAAyB,6BAYpC;AAEK,MAAM,sBAAsB,GAAG,KAAK,EAAE,EAC3C,MAAM,EACN,kBAAkB,GAInB,EAA2C,EAAE;IAC5C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAG/B,iCAAiC,kBAAkB,EAAE,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAZW,QAAA,sBAAsB,0BAYjC","debugId":"c357c753-b913-5d21-b6b9-fd931f908c99"}
|
|
@@ -7,7 +7,7 @@ export interface RepoUrlResponse {
|
|
|
7
7
|
repoUrl: string;
|
|
8
8
|
caCertificate?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const getProject: (client: MeticulousClient) => Promise<Project | null>;
|
|
10
|
+
export declare const getProject: (client: MeticulousClient, projectId?: string) => Promise<Project | null>;
|
|
11
11
|
export declare const getRepoUrl: ({ client, }: GetRepoUrlOptions) => Promise<RepoUrlResponse>;
|
|
12
12
|
/**
|
|
13
13
|
* Response of `GET /api/projects/source-archive-url`. Only returned for
|
package/dist/api/project.api.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="739e8cc3-c5e4-5ec1-b35c-7eb0fc12cd31")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.requestSourceCodeUploadUrl = exports.getSourceArchiveUrl = exports.getRepoUrl = exports.getProject = void 0;
|
|
6
6
|
const errors_1 = require("../errors");
|
|
7
|
-
const getProject = async (client) => {
|
|
7
|
+
const getProject = async (client, projectId) => {
|
|
8
8
|
const { data } = await client
|
|
9
|
-
.get("projects/token-info")
|
|
9
|
+
.get("projects/token-info", projectId ? { params: { projectId } } : undefined)
|
|
10
10
|
.catch((error) => {
|
|
11
11
|
if ((0, errors_1.isFetchError)(error) && error.response?.status === 404) {
|
|
12
12
|
return { data: null };
|
|
@@ -71,4 +71,4 @@ const requestSourceCodeUploadUrl = async ({ client, commitSha, size, }) => {
|
|
|
71
71
|
};
|
|
72
72
|
exports.requestSourceCodeUploadUrl = requestSourceCodeUploadUrl;
|
|
73
73
|
//# sourceMappingURL=project.api.js.map
|
|
74
|
-
//# debugId=
|
|
74
|
+
//# debugId=739e8cc3-c5e4-5ec1-b35c-7eb0fc12cd31
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.api.js","sources":["../../src/api/project.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,sCAAgE;AAYzD,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"project.api.js","sources":["../../src/api/project.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,sCAAgE;AAYzD,MAAM,UAAU,GAAG,KAAK,EAC7B,MAAwB,EACxB,SAAkB,EACO,EAAE;IAC3B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM;SAC1B,GAAG,CACF,qBAAqB,EACrB,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAClD;SACA,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,IAAA,qBAAY,EAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KA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,CAAC;IAEL,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAfW,QAAA,mBAAmB,uBAe9B;AAaF;;;;;;;GAOG;AACI,MAAM,0BAA0B,GAAG,KAAK,EAAE,EAC/C,MAAM,EACN,SAAS,EACT,IAAI,GAC6B,EAA+C,EAAE;IAClF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM;SAC1B,IAAI,CACH,iCAAiC,EACjC,EAAE,SAAS,EAAE,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CACjD;SACA,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,IAAA,8BAAqB,EAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEL,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAfW,QAAA,0BAA0B,8BAerC","debugId":"739e8cc3-c5e4-5ec1-b35c-7eb0fc12cd31"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MeticulousClient } from "../types/client.types";
|
|
2
|
+
import { ProjectIdentifier } from "./project-deployments.api";
|
|
2
3
|
export interface GetRegistryAuthResponse {
|
|
3
4
|
registryUrl: string;
|
|
4
5
|
projectName: string;
|
|
@@ -8,6 +9,6 @@ export interface GetRegistryAuthResponse {
|
|
|
8
9
|
uploadId: string;
|
|
9
10
|
imageReference: string;
|
|
10
11
|
}
|
|
11
|
-
export declare const getRegistryAuth: ({ client, }: {
|
|
12
|
+
export declare const getRegistryAuth: ({ client, projectId, }: ProjectIdentifier & {
|
|
12
13
|
client: MeticulousClient;
|
|
13
14
|
}) => Promise<GetRegistryAuthResponse>;
|
package/dist/api/registry.api.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8adf4573-b125-5494-8c23-be48bf8db732")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.getRegistryAuth = void 0;
|
|
6
|
-
const getRegistryAuth = async ({ client, }) => {
|
|
7
|
-
const { data } = await client.get("registry/auth");
|
|
6
|
+
const getRegistryAuth = async ({ client, projectId, }) => {
|
|
7
|
+
const { data } = await client.get("registry/auth", projectId ? { params: { projectId } } : undefined);
|
|
8
8
|
return data;
|
|
9
9
|
};
|
|
10
10
|
exports.getRegistryAuth = getRegistryAuth;
|
|
11
11
|
//# sourceMappingURL=registry.api.js.map
|
|
12
|
-
//# debugId=
|
|
12
|
+
//# debugId=8adf4573-b125-5494-8c23-be48bf8db732
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.api.js","sources":["../../src/api/registry.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"registry.api.js","sources":["../../src/api/registry.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAaO,MAAM,eAAe,GAAG,KAAK,EAAE,EACpC,MAAM,EACN,SAAS,GAGV,EAAoC,EAAE;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAC/B,eAAe,EACf,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAClD,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAXW,QAAA,eAAe,mBAW1B","debugId":"8adf4573-b125-5494-8c23-be48bf8db732"}
|
|
@@ -2,5 +2,5 @@ import { SessionData } from "@alwaysmeticulous/api";
|
|
|
2
2
|
import { MeticulousClient } from "../types/client.types";
|
|
3
3
|
export declare const getRecordedSession: (client: MeticulousClient, sessionId: string) => Promise<any>;
|
|
4
4
|
export declare const getRecordedSessionData: (client: MeticulousClient, sessionId: string) => Promise<SessionData>;
|
|
5
|
-
export declare const getRecordingCommandId: (client: MeticulousClient) => Promise<string>;
|
|
6
|
-
export declare const postSessionIdNotification: (client: MeticulousClient, sessionId: string, recordingCommandId: string) => Promise<void>;
|
|
5
|
+
export declare const getRecordingCommandId: (client: MeticulousClient, projectId?: string) => Promise<string>;
|
|
6
|
+
export declare const postSessionIdNotification: (client: MeticulousClient, sessionId: string, recordingCommandId: string, projectId?: string) => Promise<void>;
|
package/dist/api/session.api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0a219974-f9cd-56a4-a7c1-48f19445f702")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.postSessionIdNotification = exports.getRecordingCommandId = exports.getRecordedSessionData = exports.getRecordedSession = void 0;
|
|
@@ -26,15 +26,15 @@ const getRecordedSessionData = async (client, sessionId) => {
|
|
|
26
26
|
return data;
|
|
27
27
|
};
|
|
28
28
|
exports.getRecordedSessionData = getRecordedSessionData;
|
|
29
|
-
const getRecordingCommandId = async (client) => {
|
|
30
|
-
const { data } = await client.post("sessions/start");
|
|
29
|
+
const getRecordingCommandId = async (client, projectId) => {
|
|
30
|
+
const { data } = await client.post("sessions/start", undefined, projectId ? { params: { projectId } } : undefined);
|
|
31
31
|
const { recordingCommandId } = data;
|
|
32
32
|
return recordingCommandId;
|
|
33
33
|
};
|
|
34
34
|
exports.getRecordingCommandId = getRecordingCommandId;
|
|
35
|
-
const postSessionIdNotification = async (client, sessionId, recordingCommandId) => {
|
|
36
|
-
await client.post(`sessions/${sessionId}/notify`, { recordingCommandId });
|
|
35
|
+
const postSessionIdNotification = async (client, sessionId, recordingCommandId, projectId) => {
|
|
36
|
+
await client.post(`sessions/${sessionId}/notify`, { recordingCommandId }, projectId ? { params: { projectId } } : undefined);
|
|
37
37
|
};
|
|
38
38
|
exports.postSessionIdNotification = postSessionIdNotification;
|
|
39
39
|
//# sourceMappingURL=session.api.js.map
|
|
40
|
-
//# debugId=
|
|
40
|
+
//# debugId=0a219974-f9cd-56a4-a7c1-48f19445f702
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.api.js","sources":["../../src/api/session.api.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,sCAAgE;AAGzD,MAAM,kBAAkB,GAAG,KAAK,EACrC,MAAwB,EACxB,SAAiB,EACH,EAAE;IAChB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,YAAY,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACzE,IAAI,IAAA,qBAAY,EAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACxB,CAAC;QAED,MAAM,IAAA,8BAAqB,EAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;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
|
@@ -14,6 +14,18 @@ export interface MakeRequestOptions {
|
|
|
14
14
|
export declare const makeRequest: <T>(requestOptions: MakeRequestOptions) => Promise<Response<T>>;
|
|
15
15
|
export declare const createClient: (options: ClientOptions) => MeticulousClient;
|
|
16
16
|
export declare const isInteractiveContext: () => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves an API token using the full auth chain (explicit token → env var →
|
|
19
|
+
* stored OAuth → legacy config file), and falls back to an interactive browser
|
|
20
|
+
* OAuth login when nothing is stored and the process is attached to a TTY.
|
|
21
|
+
*
|
|
22
|
+
* Exits the process with code 1 if no token can be obtained. Use this anywhere
|
|
23
|
+
* a CLI command needs an API token — either to build a client (see
|
|
24
|
+
* `createClientWithOAuth`) or to pass directly to a launcher.
|
|
25
|
+
*/
|
|
26
|
+
export declare const resolveApiTokenWithOAuth: (options: ClientOptions & {
|
|
27
|
+
enableOAuthLogin?: boolean;
|
|
28
|
+
}) => Promise<string>;
|
|
17
29
|
export declare const createClientWithOAuth: (options: ClientOptions & {
|
|
18
30
|
enableOAuthLogin?: boolean;
|
|
19
31
|
}) => Promise<MeticulousClient>;
|
package/dist/client.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="786c0eb9-d89d-5da6-834f-7133ebbda259")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.createClientWithOAuth = exports.isInteractiveContext = exports.createClient = exports.makeRequest = void 0;
|
|
5
|
+
exports.createClientWithOAuth = exports.resolveApiTokenWithOAuth = exports.isInteractiveContext = exports.createClient = exports.makeRequest = void 0;
|
|
6
6
|
const common_1 = require("@alwaysmeticulous/common");
|
|
7
|
+
const oauth_api_1 = require("./api/oauth.api");
|
|
7
8
|
const api_token_utils_1 = require("./api-token.utils");
|
|
8
9
|
const oauth_login_1 = require("./oauth/oauth-login");
|
|
10
|
+
const oauth_token_store_1 = require("./oauth/oauth-token-store");
|
|
9
11
|
const DEFAULT_TIMEOUT = 60_000;
|
|
10
12
|
const BASE_API_URL = "https://app.meticulous.ai/api/";
|
|
11
13
|
const makeSingleRequest = async (url, options, timeout) => {
|
|
@@ -128,13 +130,23 @@ const createClient = ({ apiToken: apiToken_, }) => {
|
|
|
128
130
|
exports.createClient = createClient;
|
|
129
131
|
const isInteractiveContext = () => process.stdin.isTTY === true && !process.env["CI"];
|
|
130
132
|
exports.isInteractiveContext = isInteractiveContext;
|
|
131
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Resolves an API token using the full auth chain (explicit token → env var →
|
|
135
|
+
* stored OAuth → legacy config file), and falls back to an interactive browser
|
|
136
|
+
* OAuth login when nothing is stored and the process is attached to a TTY.
|
|
137
|
+
*
|
|
138
|
+
* Exits the process with code 1 if no token can be obtained. Use this anywhere
|
|
139
|
+
* a CLI command needs an API token — either to build a client (see
|
|
140
|
+
* `createClientWithOAuth`) or to pass directly to a launcher.
|
|
141
|
+
*/
|
|
142
|
+
const resolveApiTokenWithOAuth = async (options) => {
|
|
132
143
|
const logger = (0, common_1.initLogger)();
|
|
133
144
|
let apiToken = await (0, api_token_utils_1.getAuthToken)(options.apiToken);
|
|
134
145
|
const isInteractive = options.enableOAuthLogin && (0, exports.isInteractiveContext)();
|
|
135
146
|
if (!apiToken && isInteractive) {
|
|
136
147
|
const tokens = await (0, oauth_login_1.performOAuthLogin)();
|
|
137
148
|
apiToken = tokens.accessToken;
|
|
149
|
+
await maybeAutoSelectProject(apiToken, logger);
|
|
138
150
|
}
|
|
139
151
|
if (!apiToken) {
|
|
140
152
|
const message = isInteractive
|
|
@@ -143,7 +155,36 @@ const createClientWithOAuth = async (options) => {
|
|
|
143
155
|
logger.error(message);
|
|
144
156
|
return process.exit(1);
|
|
145
157
|
}
|
|
146
|
-
return
|
|
158
|
+
return apiToken;
|
|
159
|
+
};
|
|
160
|
+
exports.resolveApiTokenWithOAuth = resolveApiTokenWithOAuth;
|
|
161
|
+
/**
|
|
162
|
+
* After a fresh OAuth login, if the user has access to exactly one project
|
|
163
|
+
* and none has been stored yet, picks it automatically. Best-effort: any
|
|
164
|
+
* failure (network, missing backend endpoint, etc.) is logged at debug and
|
|
165
|
+
* swallowed — the user can always run `meticulous auth set-project` later.
|
|
166
|
+
*/
|
|
167
|
+
const maybeAutoSelectProject = async (apiToken, logger) => {
|
|
168
|
+
if ((0, oauth_token_store_1.getStoredProjectId)()) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
const client = buildClient(apiToken, logger);
|
|
173
|
+
const projects = await (0, oauth_api_1.getOAuthProjects)(client);
|
|
174
|
+
if (projects.length === 1) {
|
|
175
|
+
const only = projects[0];
|
|
176
|
+
const projectSlug = `${only.organization.name}/${only.name}`;
|
|
177
|
+
(0, oauth_token_store_1.setStoredProject)({ project: projectSlug, projectId: only.id });
|
|
178
|
+
logger.info(`Selected project: ${projectSlug}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
logger.debug(`Skipping auto-project selection after login: ${error}`);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const createClientWithOAuth = async (options) => {
|
|
186
|
+
const apiToken = await (0, exports.resolveApiTokenWithOAuth)(options);
|
|
187
|
+
return buildClient(apiToken, (0, common_1.initLogger)());
|
|
147
188
|
};
|
|
148
189
|
exports.createClientWithOAuth = createClientWithOAuth;
|
|
149
190
|
const getApiUrl = () => {
|
|
@@ -153,4 +194,4 @@ const getApiUrl = () => {
|
|
|
153
194
|
return BASE_API_URL;
|
|
154
195
|
};
|
|
155
196
|
//# sourceMappingURL=client.js.map
|
|
156
|
-
//# debugId=
|
|
197
|
+
//# debugId=786c0eb9-d89d-5da6-834f-7133ebbda259
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../src/client.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAKkC;AAGlC,uDAA8D;AAC9D,qDAAwD;
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../src/client.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAKkC;AAGlC,+CAAmD;AACnD,uDAA8D;AAC9D,qDAAwD;AACxD,iEAGmC;AAOnC,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,YAAY,GAAG,gCAAgC,CAAC;AActD,MAAM,iBAAiB,GAAG,KAAK,EAC7B,GAAW,EACX,OAAoB,EACpB,OAAgB,EACM,EAAE;IACxB,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;QAChC,UAAU,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC,EAAE,OAAO,IAAI,eAAe,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAC,GAAG,EAAE;QAC1C,GAAG,OAAO;QACV,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC,CAAC;IACH,YAAY,CAAC,SAAS,CAAC,CAAC;IAExB,MAAM,eAAe,GAA2B,EAAE,CAAC;IACnD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,GAAW,EAAE,EAAE;QACtD,eAAe,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,IAAI,IAAO,CAAC;IACZ,MAAM,WAAW,G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AG,KAAK,EACxC,OAAuD,EAC5B,EAAE;IAC7B,MAAM,QAAQ,GAAG,MAAM,IAAA,gCAAwB,EAAC,OAAO,CAAC,CAAC;IACzD,OAAO,WAAW,CAAC,QAAQ,EAAE,IAAA,mBAAU,GAAE,CAAC,CAAC;AAC7C,CAAC,CAAC;AALW,QAAA,qBAAqB,yBAKhC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACtC,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC","debugId":"786c0eb9-d89d-5da6-834f-7133ebbda259"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { AgentFeature, StructuredSessionDataResponse, StructuredSessionSummary, DiffsSummaryOptions, DiffsSummaryScreenshot, DiffsSummaryReplayDiff, DiffsSummaryResponse, ScreenshotDomDiffResponse, ScreenshotUrlsResponse, TimelineDiffEntry, TimelineDiffResponse, getStructuredSessionData, getTestRunDiffsSummary, getScreenshotDomDiff, getScreenshotUrls, getTimelineDiff, trackAgentFeatureUsage, } from "./api/agent.api";
|
|
2
2
|
export * from "./api/github-cloud-replay.api";
|
|
3
|
-
export { WhoamiResponse, getWhoami } from "./api/oauth.api";
|
|
3
|
+
export { WhoamiOrganization, WhoamiResponse, getWhoami, OAuthProject, OAuthProjectsResponse, getOAuthProjects, } from "./api/oauth.api";
|
|
4
4
|
export { GetRepoUrlOptions, RepoUrlResponse, getProject, getRepoUrl, GetSourceArchiveUrlOptions, SourceArchiveUrlResponse, getSourceArchiveUrl, RequestSourceCodeUploadUrlParams, RequestSourceCodeUploadUrlResponse, requestSourceCodeUploadUrl, } from "./api/project.api";
|
|
5
5
|
export { ReplayV3UploadLocations, getReplay, getReplayDownloadUrl, getReplayV3DownloadUrls, } from "./api/replay.api";
|
|
6
6
|
export { getRecordedSession, getRecordedSessionData, getRecordingCommandId, postSessionIdNotification, } from "./api/session.api";
|
|
@@ -10,15 +10,16 @@ export { ExecuteSecureTunnelTestRunOptions, executeSecureTunnelTestRun, getTestR
|
|
|
10
10
|
export { GetIsLockedOptions, getIsLocked } from "./api/deployment-lock.api";
|
|
11
11
|
export { IN_PROGRESS_TEST_RUN_STATUS } from "./api/test-run.constants";
|
|
12
12
|
export { getApiToken, getAuthToken } from "./api-token.utils";
|
|
13
|
-
export { ClientOptions, createClient, createClientWithOAuth, isInteractiveContext, makeRequest, } from "./client";
|
|
13
|
+
export { ClientOptions, createClient, createClientWithOAuth, isInteractiveContext, makeRequest, resolveApiTokenWithOAuth, } from "./client";
|
|
14
14
|
export { performOAuthLogin } from "./oauth/oauth-login";
|
|
15
15
|
export { getValidAccessToken } from "./oauth/oauth-refresh";
|
|
16
|
-
export { clearOAuthTokens } from "./oauth/oauth-token-store";
|
|
16
|
+
export { clearOAuthTokens, clearStoredProject, getStoredOAuthTokens, getStoredProject, getStoredProjectId, setStoredProject, } from "./oauth/oauth-token-store";
|
|
17
|
+
export { getJwtClaims, isJwtExpired, isOAuthJwt } from "./oauth/oauth-utils";
|
|
17
18
|
export type { MeticulousClient } from "./types/client.types";
|
|
18
19
|
export { getProxyAgent } from "./utils/get-proxy-agent";
|
|
19
20
|
export { PutFileToSignedUrlOptions, putFileToSignedUrl, } from "./utils/put-file-to-signed-url";
|
|
20
21
|
export { UploadError, isTransientUploadError, retryTransientUploadErrors, RetryTransientUploadErrorsOptions, } from "./utils/retry-transient-upload-errors";
|
|
21
|
-
export { RequestAssetUploadParams, RequestAssetUploadResponse, requestAssetUpload, requestMultipartAssetUpload, RequestMultipartAssetUploadResponse, RequestUploadPartParams, RequestUploadPartResponse, requestUploadPart, RequestGitDiffUploadParams, RequestGitDiffUploadResponse, requestGitDiffUpload, CompleteAssetUploadParams, CompleteAssetUploadResponse, completeAssetUpload, CompleteContainerUploadParams, CompleteContainerUploadResponse, completeContainerUpload, MultiPartUploadInfo, DownloadDeploymentResponse, downloadProjectDeployment, GetContainerDeploymentResponse, getContainerDeployment, ContainerEnvVariable, } from "./api/project-deployments.api";
|
|
22
|
+
export { ProjectIdentifier, RequestAssetUploadParams, RequestAssetUploadResponse, requestAssetUpload, requestMultipartAssetUpload, RequestMultipartAssetUploadResponse, RequestUploadPartParams, RequestUploadPartResponse, requestUploadPart, RequestGitDiffUploadParams, RequestGitDiffUploadResponse, requestGitDiffUpload, CompleteAssetUploadParams, CompleteAssetUploadResponse, completeAssetUpload, CompleteContainerUploadParams, CompleteContainerUploadResponse, completeContainerUpload, MultiPartUploadInfo, DownloadDeploymentResponse, downloadProjectDeployment, GetContainerDeploymentResponse, getContainerDeployment, ContainerEnvVariable, } from "./api/project-deployments.api";
|
|
22
23
|
export { GetRegistryAuthResponse, getRegistryAuth } from "./api/registry.api";
|
|
23
24
|
export { isFetchError } from "./errors";
|
|
24
25
|
export { EditedFileWithLines, GetRelevantSessionsParams, GetRelevantSessionsResponse, RelevantSession, getRelevantSessions, } from "./api/local-changes.api";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="92bb1422-bc02-5f43-b5df-648a3559646e")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
5
|
if (k2 === undefined) k2 = k;
|
|
@@ -16,8 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
20
|
-
exports.getRelevantSessions = exports.isFetchError = exports.getRegistryAuth = exports.getContainerDeployment = exports.downloadProjectDeployment = void 0;
|
|
19
|
+
exports.getProxyAgent = exports.isOAuthJwt = exports.isJwtExpired = exports.getJwtClaims = exports.setStoredProject = exports.getStoredProjectId = exports.getStoredProject = exports.getStoredOAuthTokens = exports.clearStoredProject = exports.clearOAuthTokens = exports.getValidAccessToken = exports.performOAuthLogin = exports.resolveApiTokenWithOAuth = exports.makeRequest = exports.isInteractiveContext = exports.createClientWithOAuth = exports.createClient = exports.getAuthToken = exports.getApiToken = exports.IN_PROGRESS_TEST_RUN_STATUS = exports.getIsLocked = exports.emitTelemetry = exports.getLatestTestRunResults = exports.getTestRunReplayDiffs = exports.getTestRunData = exports.getTestRun = exports.executeSecureTunnelTestRun = exports.getPrDiffForTestRun = exports.getPrDiff = exports.getPrDescriptionForTestRun = exports.getReplayDiff = exports.postSessionIdNotification = exports.getRecordingCommandId = exports.getRecordedSessionData = exports.getRecordedSession = exports.getReplayV3DownloadUrls = exports.getReplayDownloadUrl = exports.getReplay = exports.requestSourceCodeUploadUrl = exports.getSourceArchiveUrl = exports.getRepoUrl = exports.getProject = exports.getOAuthProjects = exports.getWhoami = exports.trackAgentFeatureUsage = exports.getTimelineDiff = exports.getScreenshotUrls = exports.getScreenshotDomDiff = exports.getTestRunDiffsSummary = exports.getStructuredSessionData = void 0;
|
|
20
|
+
exports.getRelevantSessions = exports.isFetchError = exports.getRegistryAuth = exports.getContainerDeployment = exports.downloadProjectDeployment = exports.completeContainerUpload = exports.completeAssetUpload = exports.requestGitDiffUpload = exports.requestUploadPart = exports.requestMultipartAssetUpload = exports.requestAssetUpload = exports.retryTransientUploadErrors = exports.isTransientUploadError = exports.UploadError = exports.putFileToSignedUrl = void 0;
|
|
21
21
|
var agent_api_1 = require("./api/agent.api");
|
|
22
22
|
Object.defineProperty(exports, "getStructuredSessionData", { enumerable: true, get: function () { return agent_api_1.getStructuredSessionData; } });
|
|
23
23
|
Object.defineProperty(exports, "getTestRunDiffsSummary", { enumerable: true, get: function () { return agent_api_1.getTestRunDiffsSummary; } });
|
|
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "trackAgentFeatureUsage", { enumerable: true, get
|
|
|
28
28
|
__exportStar(require("./api/github-cloud-replay.api"), exports);
|
|
29
29
|
var oauth_api_1 = require("./api/oauth.api");
|
|
30
30
|
Object.defineProperty(exports, "getWhoami", { enumerable: true, get: function () { return oauth_api_1.getWhoami; } });
|
|
31
|
+
Object.defineProperty(exports, "getOAuthProjects", { enumerable: true, get: function () { return oauth_api_1.getOAuthProjects; } });
|
|
31
32
|
var project_api_1 = require("./api/project.api");
|
|
32
33
|
Object.defineProperty(exports, "getProject", { enumerable: true, get: function () { return project_api_1.getProject; } });
|
|
33
34
|
Object.defineProperty(exports, "getRepoUrl", { enumerable: true, get: function () { return project_api_1.getRepoUrl; } });
|
|
@@ -67,12 +68,22 @@ Object.defineProperty(exports, "createClient", { enumerable: true, get: function
|
|
|
67
68
|
Object.defineProperty(exports, "createClientWithOAuth", { enumerable: true, get: function () { return client_1.createClientWithOAuth; } });
|
|
68
69
|
Object.defineProperty(exports, "isInteractiveContext", { enumerable: true, get: function () { return client_1.isInteractiveContext; } });
|
|
69
70
|
Object.defineProperty(exports, "makeRequest", { enumerable: true, get: function () { return client_1.makeRequest; } });
|
|
71
|
+
Object.defineProperty(exports, "resolveApiTokenWithOAuth", { enumerable: true, get: function () { return client_1.resolveApiTokenWithOAuth; } });
|
|
70
72
|
var oauth_login_1 = require("./oauth/oauth-login");
|
|
71
73
|
Object.defineProperty(exports, "performOAuthLogin", { enumerable: true, get: function () { return oauth_login_1.performOAuthLogin; } });
|
|
72
74
|
var oauth_refresh_1 = require("./oauth/oauth-refresh");
|
|
73
75
|
Object.defineProperty(exports, "getValidAccessToken", { enumerable: true, get: function () { return oauth_refresh_1.getValidAccessToken; } });
|
|
74
76
|
var oauth_token_store_1 = require("./oauth/oauth-token-store");
|
|
75
77
|
Object.defineProperty(exports, "clearOAuthTokens", { enumerable: true, get: function () { return oauth_token_store_1.clearOAuthTokens; } });
|
|
78
|
+
Object.defineProperty(exports, "clearStoredProject", { enumerable: true, get: function () { return oauth_token_store_1.clearStoredProject; } });
|
|
79
|
+
Object.defineProperty(exports, "getStoredOAuthTokens", { enumerable: true, get: function () { return oauth_token_store_1.getStoredOAuthTokens; } });
|
|
80
|
+
Object.defineProperty(exports, "getStoredProject", { enumerable: true, get: function () { return oauth_token_store_1.getStoredProject; } });
|
|
81
|
+
Object.defineProperty(exports, "getStoredProjectId", { enumerable: true, get: function () { return oauth_token_store_1.getStoredProjectId; } });
|
|
82
|
+
Object.defineProperty(exports, "setStoredProject", { enumerable: true, get: function () { return oauth_token_store_1.setStoredProject; } });
|
|
83
|
+
var oauth_utils_1 = require("./oauth/oauth-utils");
|
|
84
|
+
Object.defineProperty(exports, "getJwtClaims", { enumerable: true, get: function () { return oauth_utils_1.getJwtClaims; } });
|
|
85
|
+
Object.defineProperty(exports, "isJwtExpired", { enumerable: true, get: function () { return oauth_utils_1.isJwtExpired; } });
|
|
86
|
+
Object.defineProperty(exports, "isOAuthJwt", { enumerable: true, get: function () { return oauth_utils_1.isOAuthJwt; } });
|
|
76
87
|
var get_proxy_agent_1 = require("./utils/get-proxy-agent");
|
|
77
88
|
Object.defineProperty(exports, "getProxyAgent", { enumerable: true, get: function () { return get_proxy_agent_1.getProxyAgent; } });
|
|
78
89
|
var put_file_to_signed_url_1 = require("./utils/put-file-to-signed-url");
|
|
@@ -97,4 +108,4 @@ Object.defineProperty(exports, "isFetchError", { enumerable: true, get: function
|
|
|
97
108
|
var local_changes_api_1 = require("./api/local-changes.api");
|
|
98
109
|
Object.defineProperty(exports, "getRelevantSessions", { enumerable: true, get: function () { return local_changes_api_1.getRelevantSessions; } });
|
|
99
110
|
//# sourceMappingURL=index.js.map
|
|
100
|
-
//# debugId=
|
|
111
|
+
//# debugId=92bb1422-bc02-5f43-b5df-648a3559646e
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6CAkByB;AANvB,qHAAA,wBAAwB,OAAA;AACxB,mHAAA,sBAAsB,OAAA;AACtB,iHAAA,oBAAoB,OAAA;AACpB,8GAAA,iBAAiB,OAAA;AACjB,4GAAA,eAAe,OAAA;AACf,mHAAA,sBAAsB,OAAA;AAExB,gEAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6CAkByB;AANvB,qHAAA,wBAAwB,OAAA;AACxB,mHAAA,sBAAsB,OAAA;AACtB,iHAAA,oBAAoB,OAAA;AACpB,8GAAA,iBAAiB,OAAA;AACjB,4GAAA,eAAe,OAAA;AACf,mHAAA,sBAAsB,OAAA;AAExB,gEAA8C;AAC9C,6CAOyB;AAJvB,sGAAA,SAAS,OAAA;AAGT,6GAAA,gBAAgB,OAAA;AAElB,iDAW2B;AARzB,yGAAA,UAAU,OAAA;AACV,yGAAA,UAAU,OAAA;AAGV,kHAAA,mBAAmB,OAAA;AAGnB,yHAAA,0BAA0B,OAAA;AAE5B,+CAK0B;AAHxB,uGAAA,SAAS,OAAA;AACT,kHAAA,oBAAoB,OAAA;AACpB,qHAAA,uBAAuB,OAAA;AAEzB,iDAK2B;AAJzB,iHAAA,kBAAkB,OAAA;AAClB,qHAAA,sBAAsB,OAAA;AACtB,oHAAA,qBAAqB,OAAA;AACrB,wHAAA,yBAAyB,OAAA;AAE3B,yDAA0E;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,OAAA;AAGjB,+HAAA,oBAAoB,OAAA;AAGpB,8HAAA,mBAAmB,OAAA;AAGnB,kIAAA,uBAAuB,OAAA;AAGvB,oIAAA,yBAAyB,OAAA;AAEzB,iIAAA,sBAAsB,OAAA;AAGxB,mDAA8E;AAA5C,+GAAA,eAAe,OAAA;AACjD,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AACrB,6DAMiC;AAD/B,wHAAA,mBAAmB,OAAA","debugId":"92bb1422-bc02-5f43-b5df-648a3559646e"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6e0c6a67-ab9a-5144-9ba3-2e15a0a00201")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const vitest_1 = require("vitest");
|
|
6
|
+
const oauth_utils_1 = require("../oauth-utils");
|
|
7
|
+
const makeJwt = (payload) => {
|
|
8
|
+
const header = Buffer.from(JSON.stringify({ alg: "HS256", typ: "JWT" }))
|
|
9
|
+
.toString("base64url");
|
|
10
|
+
const body = Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
11
|
+
// Signature segment is opaque to client-side utilities; any non-empty
|
|
12
|
+
// string is fine here.
|
|
13
|
+
return `${header}.${body}.sig`;
|
|
14
|
+
};
|
|
15
|
+
(0, vitest_1.describe)("isOAuthJwt", () => {
|
|
16
|
+
(0, vitest_1.it)("returns true for a well-formed 3-segment JWT", () => {
|
|
17
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)(makeJwt({ sub: "abc" }))).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
(0, vitest_1.it)("returns false for an empty token", () => {
|
|
20
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("")).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
(0, vitest_1.it)("returns false for a project-scoped API token (prat- prefix)", () => {
|
|
23
|
+
// Even with a JWT-like shape, the prefix must short-circuit.
|
|
24
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("prat-abc.def.ghi")).toBe(false);
|
|
25
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("prat-opaque-token")).toBe(false);
|
|
26
|
+
});
|
|
27
|
+
(0, vitest_1.it)("returns false for a test-run API token (trat prefix)", () => {
|
|
28
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("trat-abc.def.ghi")).toBe(false);
|
|
29
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("trat_opaque")).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
(0, vitest_1.it)("returns false when there are not exactly 3 segments", () => {
|
|
32
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("a.b")).toBe(false);
|
|
33
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("a.b.c.d")).toBe(false);
|
|
34
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("nodots")).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
(0, vitest_1.it)("returns false when any segment is empty", () => {
|
|
37
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("a..c")).toBe(false);
|
|
38
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)(".b.c")).toBe(false);
|
|
39
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isOAuthJwt)("a.b.")).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.describe)("getJwtClaims", () => {
|
|
43
|
+
(0, vitest_1.it)("decodes the payload of a well-formed JWT", () => {
|
|
44
|
+
const claims = (0, oauth_utils_1.getJwtClaims)(makeJwt({ sub: "user-1", role: "owner" }));
|
|
45
|
+
(0, vitest_1.expect)(claims).toEqual({ sub: "user-1", role: "owner" });
|
|
46
|
+
});
|
|
47
|
+
(0, vitest_1.it)("returns null for a token with the wrong number of segments", () => {
|
|
48
|
+
(0, vitest_1.expect)((0, oauth_utils_1.getJwtClaims)("a.b")).toBeNull();
|
|
49
|
+
(0, vitest_1.expect)((0, oauth_utils_1.getJwtClaims)("no-dots")).toBeNull();
|
|
50
|
+
});
|
|
51
|
+
(0, vitest_1.it)("returns null when the payload is not valid JSON", () => {
|
|
52
|
+
const garbledPayload = Buffer.from("not-json").toString("base64url");
|
|
53
|
+
(0, vitest_1.expect)((0, oauth_utils_1.getJwtClaims)(`h.${garbledPayload}.s`)).toBeNull();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
(0, vitest_1.describe)("isJwtExpired", () => {
|
|
57
|
+
(0, vitest_1.afterEach)(() => {
|
|
58
|
+
vitest_1.vi.useRealTimers();
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.it)("returns true when exp is in the past", () => {
|
|
61
|
+
vitest_1.vi.useFakeTimers();
|
|
62
|
+
vitest_1.vi.setSystemTime(new Date("2026-01-01T00:00:00Z"));
|
|
63
|
+
const expSecondsAgo = Math.floor(Date.now() / 1000) - 60;
|
|
64
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isJwtExpired)(makeJwt({ exp: expSecondsAgo }))).toBe(true);
|
|
65
|
+
});
|
|
66
|
+
(0, vitest_1.it)("returns false when exp is in the future", () => {
|
|
67
|
+
vitest_1.vi.useFakeTimers();
|
|
68
|
+
vitest_1.vi.setSystemTime(new Date("2026-01-01T00:00:00Z"));
|
|
69
|
+
const expInFuture = Math.floor(Date.now() / 1000) + 60;
|
|
70
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isJwtExpired)(makeJwt({ exp: expInFuture }))).toBe(false);
|
|
71
|
+
});
|
|
72
|
+
(0, vitest_1.it)("returns false when the token has no exp claim", () => {
|
|
73
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isJwtExpired)(makeJwt({ sub: "x" }))).toBe(false);
|
|
74
|
+
});
|
|
75
|
+
(0, vitest_1.it)("returns false when the token is malformed (no evidence of expiry)", () => {
|
|
76
|
+
(0, vitest_1.expect)((0, oauth_utils_1.isJwtExpired)("not-a-jwt")).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=oauth-utils.spec.js.map
|
|
80
|
+
//# debugId=6e0c6a67-ab9a-5144-9ba3-2e15a0a00201
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-utils.spec.js","sources":["../../../src/oauth/__tests__/oauth-utils.spec.ts"],"sourceRoot":"","names":[],"mappings":";;;;AAAA,mCAA6D;AAC7D,gDAAwE;AAExE,MAAM,OAAO,GAAG,CAAC,OAAgC,EAAU,EAAE;IAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;SACrE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACzB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACxE,sEAAsE;IACtE,uBAAuB;IACvB,OAAO,GAAG,MAAM,IAAI,IAAI,MAAM,CAAC;AACjC,CAAC,CAAC;AAEF,IAAA,iBAAQ,EAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAA,WAAE,EAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,IAAA,eAAM,EAAC,IAAA,wBAAU,EAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC,CA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G,EAAE;QAC3E,IAAA,eAAM,EAAC,IAAA,0BAAY,EAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","debugId":"6e0c6a67-ab9a-5144-9ba3-2e15a0a00201"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const KEYCLOAK_ISSUER_URL: string;
|
|
2
2
|
export declare const CLI_CLIENT_ID = "meticulous-cli";
|
|
3
|
-
export declare const OAUTH_SCOPES = "openid email profile";
|
|
3
|
+
export declare const OAUTH_SCOPES = "openid email profile offline_access";
|
|
4
4
|
export declare const getTokenEndpoint: () => Promise<string>;
|
|
5
5
|
export declare const getWebappBaseUrl: () => string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="595a4784-6348-5e96-ade9-5fb210f688f6")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.getWebappBaseUrl = exports.getTokenEndpoint = exports.OAUTH_SCOPES = exports.CLI_CLIENT_ID = exports.KEYCLOAK_ISSUER_URL = void 0;
|
|
6
6
|
exports.KEYCLOAK_ISSUER_URL = process.env["METICULOUS_OAUTH_ISSUER_URL"] ||
|
|
7
7
|
"https://app.meticulous.ai/auth/realms/meticulous";
|
|
8
8
|
exports.CLI_CLIENT_ID = "meticulous-cli";
|
|
9
|
-
exports.OAUTH_SCOPES = "openid email profile";
|
|
9
|
+
exports.OAUTH_SCOPES = "openid email profile offline_access";
|
|
10
10
|
const WELL_KNOWN_PATH = "/.well-known/openid-configuration";
|
|
11
11
|
let cachedTokenEndpoint = null;
|
|
12
12
|
const getTokenEndpoint = async () => {
|
|
@@ -35,4 +35,4 @@ const getWebappBaseUrl = () => {
|
|
|
35
35
|
};
|
|
36
36
|
exports.getWebappBaseUrl = getWebappBaseUrl;
|
|
37
37
|
//# sourceMappingURL=oauth-constants.js.map
|
|
38
|
-
//# debugId=
|
|
38
|
+
//# debugId=595a4784-6348-5e96-ade9-5fb210f688f6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-constants.js","sources":["../../src/oauth/oauth-constants.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAa,QAAA,mBAAmB,GAC9B,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;IAC1C,kDAAkD,CAAC;AAExC,QAAA,aAAa,GAAG,gBAAgB,CAAC;AAEjC,QAAA,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"oauth-constants.js","sources":["../../src/oauth/oauth-constants.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAa,QAAA,mBAAmB,GAC9B,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;IAC1C,kDAAkD,CAAC;AAExC,QAAA,aAAa,GAAG,gBAAgB,CAAC;AAEjC,QAAA,YAAY,GAAG,qCAAqC,CAAC;AAElE,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAE5D,IAAI,mBAAmB,GAAkB,IAAI,CAAC;AAEvC,MAAM,gBAAgB,GAAG,KAAK,IAAqB,EAAE;IAC1D,IAAI,mBAAmB,EAAE,CAAC;QACxB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,2BAAmB,GAAG,eAAe,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,yCAAyC,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAClF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA+B,CAAC;IACrE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,mBAAmB,GAAG,MAAM,CAAC,cAAc,CAAC;IAC5C,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC;AAnBW,QAAA,gBAAgB,oBAmB3B;AAEF,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;AAErD,MAAM,gBAAgB,GAAG,GAAW,EAAE;IAC3C,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAExD,IAAI,aAAa,IAAI,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACzD,OAAO,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B","debugId":"595a4784-6348-5e96-ade9-5fb210f688f6"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5f487ff7-9872-562a-9ebc-1bcc9b263301")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.getValidAccessToken = void 0;
|
|
@@ -37,10 +37,11 @@ const getValidAccessToken = async () => {
|
|
|
37
37
|
}
|
|
38
38
|
const data = (await response.json());
|
|
39
39
|
const updatedTokens = {
|
|
40
|
+
...tokens,
|
|
40
41
|
accessToken: data.access_token,
|
|
41
|
-
refreshToken: data.refresh_token,
|
|
42
|
+
refreshToken: data.refresh_token ?? tokens.refreshToken,
|
|
42
43
|
expiresAt: Math.floor(Date.now() / 1000) + data.expires_in,
|
|
43
|
-
idToken: data.id_token,
|
|
44
|
+
...(data.id_token !== undefined ? { idToken: data.id_token } : {}),
|
|
44
45
|
};
|
|
45
46
|
(0, oauth_token_store_1.storeOAuthTokens)(updatedTokens);
|
|
46
47
|
return updatedTokens.accessToken;
|
|
@@ -52,4 +53,4 @@ const getValidAccessToken = async () => {
|
|
|
52
53
|
};
|
|
53
54
|
exports.getValidAccessToken = getValidAccessToken;
|
|
54
55
|
//# sourceMappingURL=oauth-refresh.js.map
|
|
55
|
-
//# debugId=
|
|
56
|
+
//# debugId=5f487ff7-9872-562a-9ebc-1bcc9b263301
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-refresh.js","sources":["../../src/oauth/oauth-refresh.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,uDAAoE;AACpE,2DAI6B;AAE7B,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAEhC,MAAM,mBAAmB,GAAG,KAAK,IAA4B,EAAE;IACpE,MAAM,MAAM,GAAG,IAAA,wCAAoB,GAAE,CAAC;IACtC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAA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CAAC,UAAU;YAC1D,GAAG,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnE,CAAC;QAEF,IAAA,oCAAgB,EAAC,aAAa,CAAC,CAAC;QAChC,OAAO,aAAa,CAAC,WAAW,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,IAAA,oCAAgB,GAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAxDW,QAAA,mBAAmB,uBAwD9B","debugId":"5f487ff7-9872-562a-9ebc-1bcc9b263301"}
|
|
@@ -7,3 +7,10 @@ export interface StoredOAuthTokens {
|
|
|
7
7
|
export declare const getStoredOAuthTokens: () => StoredOAuthTokens | null;
|
|
8
8
|
export declare const storeOAuthTokens: (tokens: StoredOAuthTokens) => void;
|
|
9
9
|
export declare const clearOAuthTokens: () => void;
|
|
10
|
+
export declare const getStoredProjectId: () => string | null;
|
|
11
|
+
export declare const getStoredProject: () => string | null;
|
|
12
|
+
export declare const setStoredProject: ({ project, projectId, }: {
|
|
13
|
+
project: string;
|
|
14
|
+
projectId: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
export declare const clearStoredProject: () => void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e20d44b6-0602-519d-b1ed-198e373925f6")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.clearOAuthTokens = exports.storeOAuthTokens = exports.getStoredOAuthTokens = void 0;
|
|
5
|
+
exports.clearStoredProject = exports.setStoredProject = exports.getStoredProject = exports.getStoredProjectId = exports.clearOAuthTokens = exports.storeOAuthTokens = exports.getStoredOAuthTokens = void 0;
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const os_1 = require("os");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const METICULOUS_DIR = (0, path_1.join)((0, os_1.homedir)(), ".meticulous");
|
|
10
10
|
const TOKEN_FILE_PATH = (0, path_1.join)(METICULOUS_DIR, "oauth-tokens.json");
|
|
11
|
+
const SELECTED_PROJECT_FILE_PATH = (0, path_1.join)(METICULOUS_DIR, "selected-project.json");
|
|
11
12
|
const getStoredOAuthTokens = () => {
|
|
12
13
|
try {
|
|
13
14
|
if (!(0, fs_1.existsSync)(TOKEN_FILE_PATH)) {
|
|
@@ -41,5 +42,43 @@ const clearOAuthTokens = () => {
|
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
exports.clearOAuthTokens = clearOAuthTokens;
|
|
45
|
+
const getStoredSelectedProject = () => {
|
|
46
|
+
try {
|
|
47
|
+
if (!(0, fs_1.existsSync)(SELECTED_PROJECT_FILE_PATH)) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const data = (0, fs_1.readFileSync)(SELECTED_PROJECT_FILE_PATH, "utf-8");
|
|
51
|
+
return JSON.parse(data);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const getStoredProjectId = () => {
|
|
58
|
+
return getStoredSelectedProject()?.projectId ?? null;
|
|
59
|
+
};
|
|
60
|
+
exports.getStoredProjectId = getStoredProjectId;
|
|
61
|
+
const getStoredProject = () => {
|
|
62
|
+
return getStoredSelectedProject()?.project ?? null;
|
|
63
|
+
};
|
|
64
|
+
exports.getStoredProject = getStoredProject;
|
|
65
|
+
const setStoredProject = ({ project, projectId, }) => {
|
|
66
|
+
if (!(0, fs_1.existsSync)(METICULOUS_DIR)) {
|
|
67
|
+
(0, fs_1.mkdirSync)(METICULOUS_DIR, { recursive: true });
|
|
68
|
+
}
|
|
69
|
+
(0, fs_1.writeFileSync)(SELECTED_PROJECT_FILE_PATH, JSON.stringify({ project, projectId }, null, 2), { mode: 0o600 });
|
|
70
|
+
};
|
|
71
|
+
exports.setStoredProject = setStoredProject;
|
|
72
|
+
const clearStoredProject = () => {
|
|
73
|
+
try {
|
|
74
|
+
if ((0, fs_1.existsSync)(SELECTED_PROJECT_FILE_PATH)) {
|
|
75
|
+
(0, fs_1.unlinkSync)(SELECTED_PROJECT_FILE_PATH);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Ignore errors during cleanup
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.clearStoredProject = clearStoredProject;
|
|
44
83
|
//# sourceMappingURL=oauth-token-store.js.map
|
|
45
|
-
//# debugId=
|
|
84
|
+
//# debugId=e20d44b6-0602-519d-b1ed-198e373925f6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-token-store.js","sources":["../../src/oauth/oauth-token-store.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,2BAMY;AACZ,2BAA6B;AAC7B,+BAA4B;
|
|
1
|
+
{"version":3,"file":"oauth-token-store.js","sources":["../../src/oauth/oauth-token-store.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,2BAMY;AACZ,2BAA6B;AAC7B,+BAA4B;AAwB5B,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,aAAa,CAAC,CAAC;AACtD,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;AAClE,MAAM,0BAA0B,G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AQ7B","debugId":"e20d44b6-0602-519d-b1ed-198e373925f6"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects whether a token string is an OAuth JWT.
|
|
3
|
+
*
|
|
4
|
+
* JWTs have exactly 3 dot-separated non-empty segments and are not
|
|
5
|
+
* project or test-run API tokens. Mirrors the backend's `isOAuthJwt`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const isOAuthJwt: (token: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Decodes a JWT's payload claims without verifying the signature. Returns
|
|
10
|
+
* `null` if the token is not a well-formed JWT.
|
|
11
|
+
*
|
|
12
|
+
* Intended for client-side hints (e.g. "is this token expired?"). Never
|
|
13
|
+
* use the result for authorization decisions.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getJwtClaims: (token: string) => Record<string, unknown> | null;
|
|
16
|
+
/**
|
|
17
|
+
* Returns true if the JWT's `exp` claim has already passed. Returns false
|
|
18
|
+
* if the token is malformed or has no `exp` claim — callers should treat
|
|
19
|
+
* "false" as "no evidence of expiry", not "definitely still valid".
|
|
20
|
+
*/
|
|
21
|
+
export declare const isJwtExpired: (token: string) => boolean;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ed20803a-47be-594d-9cd5-c73622e4649e")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.isJwtExpired = exports.getJwtClaims = exports.isOAuthJwt = void 0;
|
|
6
|
+
const PROJECT_API_TOKEN_PREFIX = "prat-";
|
|
7
|
+
const TEST_RUN_API_TOKEN_PREFIX = "trat";
|
|
8
|
+
/**
|
|
9
|
+
* Detects whether a token string is an OAuth JWT.
|
|
10
|
+
*
|
|
11
|
+
* JWTs have exactly 3 dot-separated non-empty segments and are not
|
|
12
|
+
* project or test-run API tokens. Mirrors the backend's `isOAuthJwt`.
|
|
13
|
+
*/
|
|
14
|
+
const isOAuthJwt = (token) => {
|
|
15
|
+
if (!token ||
|
|
16
|
+
token.startsWith(PROJECT_API_TOKEN_PREFIX) ||
|
|
17
|
+
token.startsWith(TEST_RUN_API_TOKEN_PREFIX)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const parts = token.split(".");
|
|
21
|
+
return parts.length === 3 && parts.every((part) => part.length > 0);
|
|
22
|
+
};
|
|
23
|
+
exports.isOAuthJwt = isOAuthJwt;
|
|
24
|
+
/**
|
|
25
|
+
* Decodes a JWT's payload claims without verifying the signature. Returns
|
|
26
|
+
* `null` if the token is not a well-formed JWT.
|
|
27
|
+
*
|
|
28
|
+
* Intended for client-side hints (e.g. "is this token expired?"). Never
|
|
29
|
+
* use the result for authorization decisions.
|
|
30
|
+
*/
|
|
31
|
+
const getJwtClaims = (token) => {
|
|
32
|
+
try {
|
|
33
|
+
const parts = token.split(".");
|
|
34
|
+
if (parts.length !== 3) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const payload = Buffer.from(parts[1], "base64url").toString("utf-8");
|
|
38
|
+
return JSON.parse(payload);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.getJwtClaims = getJwtClaims;
|
|
45
|
+
/**
|
|
46
|
+
* Returns true if the JWT's `exp` claim has already passed. Returns false
|
|
47
|
+
* if the token is malformed or has no `exp` claim — callers should treat
|
|
48
|
+
* "false" as "no evidence of expiry", not "definitely still valid".
|
|
49
|
+
*/
|
|
50
|
+
const isJwtExpired = (token) => {
|
|
51
|
+
const claims = (0, exports.getJwtClaims)(token);
|
|
52
|
+
const exp = claims?.["exp"];
|
|
53
|
+
if (typeof exp !== "number") {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return exp * 1000 < Date.now();
|
|
57
|
+
};
|
|
58
|
+
exports.isJwtExpired = isJwtExpired;
|
|
59
|
+
//# sourceMappingURL=oauth-utils.js.map
|
|
60
|
+
//# debugId=ed20803a-47be-594d-9cd5-c73622e4649e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-utils.js","sources":["../../src/oauth/oauth-utils.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,MAAM,wBAAwB,GAAG,OAAO,CAAC;AACzC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAEzC;;;;;GAKG;AACI,MAAM,UAAU,GAAG,CAAC,KAAa,EAAW,EAAE;IACnD,IACE,CAAC,KAAK;QACN,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC;QAC1C,KAAK,CAAC,UAAU,CAAC,yBAAyB,CAAC,EAC3C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACtE,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB;AAEF;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAC1B,KAAa,EACmB,EAAE;IAClC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,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