@theholocron/holocron-plugin-postman 5.0.0-alpha.115 → 5.0.0-alpha.117
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 -16
- package/dist/index.mjs +3 -7
- package/package.json +8 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthError, ResolveTokenInput, Tooling, ToolingDoctorReport } from "@theholocron/cli";
|
|
1
|
+
import { AuthError, ResolveTokenInput, Tooling, ToolingDoctorReport, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
|
|
2
2
|
import { PostmanClient, PostmanClient as PostmanClient$1, PostmanClientOptions, PostmanCollection, PostmanEnvironment, PostmanPlanLimitError, PostmanSpec, PostmanUser, PostmanWorkspace, createPostmanClient, detectPlanLimit } from "@theholocron/postman-client";
|
|
3
3
|
//#region src/auth.d.ts
|
|
4
4
|
declare const resolveToken: (input?: ResolveTokenInput) => string;
|
|
@@ -71,25 +71,11 @@ declare class PostmanTooling implements Tooling {
|
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/verify-token.d.ts
|
|
74
|
-
/**
|
|
75
|
-
* `verifyToken` — plugin-level export used by `holocron auth set` +
|
|
76
|
-
* `holocron auth check`. Hits Postman's `/me` endpoint (returns the
|
|
77
|
-
* authenticated user).
|
|
78
|
-
*/
|
|
79
|
-
interface VerifyTokenSuccess {
|
|
80
|
-
ok: true;
|
|
81
|
-
subject: string;
|
|
82
|
-
}
|
|
83
|
-
interface VerifyTokenFailure {
|
|
84
|
-
ok: false;
|
|
85
|
-
message: string;
|
|
86
|
-
}
|
|
87
|
-
type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
|
|
88
74
|
interface VerifyTokenOptions {
|
|
89
75
|
baseUrl?: string;
|
|
90
76
|
fetch?: typeof fetch;
|
|
91
77
|
}
|
|
92
|
-
declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult>;
|
|
78
|
+
declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
|
|
93
79
|
//#endregion
|
|
94
80
|
//#region src/index.d.ts
|
|
95
81
|
interface PostmanPluginOptions extends ResolveTokenInput, PostmanToolingOptions {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AuthError, ProviderApiError, createResolveToken } from "@theholocron/cli";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { basename, resolve } from "node:path";
|
|
4
|
+
import { errorMessage } from "@theholocron/misc-utils";
|
|
4
5
|
import { PostmanPlanLimitError, createPostmanClient, detectPlanLimit } from "@theholocron/postman-client";
|
|
5
6
|
//#region src/auth.ts
|
|
6
7
|
const resolveToken = createResolveToken({
|
|
@@ -110,7 +111,7 @@ var PostmanTooling = class {
|
|
|
110
111
|
} catch (err) {
|
|
111
112
|
return {
|
|
112
113
|
ok: false,
|
|
113
|
-
message:
|
|
114
|
+
message: errorMessage(err)
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
}
|
|
@@ -167,11 +168,6 @@ var PostmanTooling = class {
|
|
|
167
168
|
};
|
|
168
169
|
//#endregion
|
|
169
170
|
//#region src/verify-token.ts
|
|
170
|
-
/**
|
|
171
|
-
* `verifyToken` — plugin-level export used by `holocron auth set` +
|
|
172
|
-
* `holocron auth check`. Hits Postman's `/me` endpoint (returns the
|
|
173
|
-
* authenticated user).
|
|
174
|
-
*/
|
|
175
171
|
async function verifyToken(token, opts = {}) {
|
|
176
172
|
const client = createPostmanClient({
|
|
177
173
|
token,
|
|
@@ -187,7 +183,7 @@ async function verifyToken(token, opts = {}) {
|
|
|
187
183
|
} catch (err) {
|
|
188
184
|
return {
|
|
189
185
|
ok: false,
|
|
190
|
-
message:
|
|
186
|
+
message: errorMessage(err)
|
|
191
187
|
};
|
|
192
188
|
}
|
|
193
189
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-postman",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.117",
|
|
4
4
|
"description": "Holocron plugin for Postman. Implements the tooling capability against Postman's REST API — workspace + collection + spec + environment sync.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"holocron",
|
|
@@ -31,8 +31,9 @@
|
|
|
31
31
|
],
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@theholocron/eslint-config": "^8.7.0",
|
|
34
|
-
"@theholocron/http-client": "^1.
|
|
35
|
-
"@theholocron/
|
|
34
|
+
"@theholocron/http-client": "^1.38.0",
|
|
35
|
+
"@theholocron/misc-utils": "^1.9.2",
|
|
36
|
+
"@theholocron/postman-client": "^1.38.0",
|
|
36
37
|
"@theholocron/tsconfig": "^8.7.0",
|
|
37
38
|
"@theholocron/tsdown-config": "^8.7.0",
|
|
38
39
|
"@theholocron/vitest-config": "^8.7.0",
|
|
@@ -46,11 +47,12 @@
|
|
|
46
47
|
"tsx": "4.23.12",
|
|
47
48
|
"typescript": "^5.9.3",
|
|
48
49
|
"vitest": "^4.1.11",
|
|
49
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
50
|
+
"@theholocron/cli": "5.0.0-alpha.117"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"@theholocron/
|
|
53
|
-
"@theholocron/
|
|
53
|
+
"@theholocron/misc-utils": "^1.9.2",
|
|
54
|
+
"@theholocron/postman-client": "^1.38.0",
|
|
55
|
+
"@theholocron/cli": "5.0.0-alpha.117"
|
|
54
56
|
},
|
|
55
57
|
"peerDependenciesMeta": {
|
|
56
58
|
"@theholocron/postman-client": {}
|