@puckeditor/cloud-client 0.7.0 → 0.7.1-canary.7dd7318f
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/{chunk-IZCHY6MH.mjs → chunk-BQWPP26F.mjs} +74 -24
- package/dist/{chunk-4OIQ53M4.mjs → chunk-JXZFCI6X.mjs} +5298 -2811
- package/dist/experimental.js +5304 -2817
- package/dist/experimental.mjs +1 -1
- package/dist/index.js +5300 -2813
- package/dist/index.mjs +1 -1
- package/dist/{token-D756XKFR.mjs → token-AZL45GQ7.mjs} +24 -17
- package/dist/{token-util-MZPHSGLW.mjs → token-util-C2WTQMRE.mjs} +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_token_error,
|
|
3
3
|
require_token_util
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BQWPP26F.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
init_react_import
|
|
8
8
|
} from "./chunk-O6DC5HI2.mjs";
|
|
9
9
|
|
|
10
|
-
// ../../node_modules/.pnpm/@vercel+oidc@3.
|
|
10
|
+
// ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
11
11
|
var require_token = __commonJS({
|
|
12
|
-
"../../node_modules/.pnpm/@vercel+oidc@3.
|
|
12
|
+
"../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
|
|
13
13
|
init_react_import();
|
|
14
14
|
var __defProp = Object.defineProperty;
|
|
15
15
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -35,21 +35,28 @@ var require_token = __commonJS({
|
|
|
35
35
|
module.exports = __toCommonJS(token_exports);
|
|
36
36
|
var import_token_error = require_token_error();
|
|
37
37
|
var import_token_util = require_token_util();
|
|
38
|
-
async function refreshToken() {
|
|
39
|
-
|
|
38
|
+
async function refreshToken(options) {
|
|
39
|
+
let projectId = options?.project;
|
|
40
|
+
let teamId = options?.team;
|
|
41
|
+
if (!projectId && !teamId) {
|
|
42
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
43
|
+
projectId = projectInfo.projectId;
|
|
44
|
+
teamId = projectInfo.teamId;
|
|
45
|
+
} else if (!projectId || !teamId) {
|
|
46
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
47
|
+
projectId = projectId ?? projectInfo.projectId;
|
|
48
|
+
teamId = teamId ?? projectInfo.teamId;
|
|
49
|
+
}
|
|
50
|
+
if (!projectId) {
|
|
51
|
+
throw new import_token_error.VercelOidcTokenError(
|
|
52
|
+
"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`"
|
|
53
|
+
);
|
|
54
|
+
}
|
|
40
55
|
let maybeToken = (0, import_token_util.loadToken)(projectId);
|
|
41
|
-
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
|
|
42
|
-
const authToken = await (0, import_token_util.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`"
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
if (!projectId) {
|
|
49
|
-
throw new import_token_error.VercelOidcTokenError(
|
|
50
|
-
"Failed to refresh OIDC token: Try re-linking your project with `vc link`"
|
|
51
|
-
);
|
|
52
|
-
}
|
|
56
|
+
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {
|
|
57
|
+
const authToken = await (0, import_token_util.getVercelToken)({
|
|
58
|
+
expirationBufferMs: options?.expirationBufferMs
|
|
59
|
+
});
|
|
53
60
|
maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
|
|
54
61
|
if (!maybeToken) {
|
|
55
62
|
throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/cloud-client",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1-canary.7dd7318f",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": "puckeditor/puck",
|
|
6
6
|
"bugs": "https://github.com/puckeditor/puck/issues",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"tsconfig": "workspace:*",
|
|
48
48
|
"tsup": "^8.2.4",
|
|
49
49
|
"tsup-config": "workspace:*",
|
|
50
|
-
"typescript": "
|
|
50
|
+
"typescript": "catalog:",
|
|
51
51
|
"vite-tsconfig-paths": "^5.1.4",
|
|
52
52
|
"vitest": "^3.2.4",
|
|
53
53
|
"zod": "^4.1.9"
|