@theholocron/holocron-plugin-postman 5.0.0-alpha.12 → 5.0.0-alpha.120

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 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({
@@ -77,7 +78,8 @@ var PostmanTooling = class {
77
78
  spec: specObj
78
79
  });
79
80
  for (const file of this.opts.envFiles ?? []) {
80
- const envText = await readFile(resolve(this.repoRoot, file), "utf8");
81
+ const envPath = resolve(this.repoRoot, file);
82
+ const envText = await readFile(envPath, "utf8");
81
83
  const envObj = JSON.parse(envText);
82
84
  if (!envObj.name) throw new Error(`Postman environment file ${file} is missing a "name" field`);
83
85
  const existing = await this.findEnvironmentByName({
@@ -109,7 +111,7 @@ var PostmanTooling = class {
109
111
  } catch (err) {
110
112
  return {
111
113
  ok: false,
112
- message: err instanceof Error ? err.message : String(err)
114
+ message: errorMessage(err)
113
115
  };
114
116
  }
115
117
  }
@@ -166,11 +168,6 @@ var PostmanTooling = class {
166
168
  };
167
169
  //#endregion
168
170
  //#region src/verify-token.ts
169
- /**
170
- * `verifyToken` — plugin-level export used by `holocron auth set` +
171
- * `holocron auth check`. Hits Postman's `/me` endpoint (returns the
172
- * authenticated user).
173
- */
174
171
  async function verifyToken(token, opts = {}) {
175
172
  const client = createPostmanClient({
176
173
  token,
@@ -186,7 +183,7 @@ async function verifyToken(token, opts = {}) {
186
183
  } catch (err) {
187
184
  return {
188
185
  ok: false,
189
- message: err instanceof Error ? err.message : String(err)
186
+ message: errorMessage(err)
190
187
  };
191
188
  }
192
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-postman",
3
- "version": "5.0.0-alpha.12",
3
+ "version": "5.0.0-alpha.120",
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",
@@ -30,11 +30,13 @@
30
30
  "dist"
31
31
  ],
32
32
  "devDependencies": {
33
- "@theholocron/eslint-config": "^8.0.0",
34
- "@theholocron/postman-client": "^1.14.2",
35
- "@theholocron/tsconfig": "^8.0.0",
36
- "@theholocron/tsdown-config": "^8.0.0",
37
- "@theholocron/vitest-config": "^8.0.0",
33
+ "@theholocron/eslint-config": "^8.7.0",
34
+ "@theholocron/http-client": "^1.38.0",
35
+ "@theholocron/misc-utils": "^1.9.2",
36
+ "@theholocron/postman-client": "^1.38.0",
37
+ "@theholocron/tsconfig": "^8.7.0",
38
+ "@theholocron/tsdown-config": "^8.7.0",
39
+ "@theholocron/vitest-config": "^8.7.0",
38
40
  "@types/node": "^26",
39
41
  "@vitest/coverage-v8": "^4.1.11",
40
42
  "@vitest/eslint-plugin": "^1.6.27",
@@ -45,11 +47,12 @@
45
47
  "tsx": "4.23.12",
46
48
  "typescript": "^5.9.3",
47
49
  "vitest": "^4.1.11",
48
- "@theholocron/cli": "5.0.0-alpha.12"
50
+ "@theholocron/cli": "5.0.0-alpha.120"
49
51
  },
50
52
  "peerDependencies": {
51
- "@theholocron/postman-client": "^1.14.2",
52
- "@theholocron/cli": "5.0.0-alpha.12"
53
+ "@theholocron/misc-utils": "^1.9.2",
54
+ "@theholocron/postman-client": "^1.38.0",
55
+ "@theholocron/cli": "5.0.0-alpha.120"
53
56
  },
54
57
  "peerDependenciesMeta": {
55
58
  "@theholocron/postman-client": {}