@payloadcms/figma 0.0.1-alpha.73 → 0.0.1-alpha.74

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.
Files changed (299) hide show
  1. package/dist/api/control-plane.d.ts +0 -1
  2. package/dist/api/control-plane.js +0 -2
  3. package/dist/api/error-response.d.ts +0 -1
  4. package/dist/api/error-response.js +0 -2
  5. package/dist/api/figma-api.d.ts +0 -1
  6. package/dist/api/figma-api.js +0 -2
  7. package/dist/auth/browser.d.ts +0 -1
  8. package/dist/auth/browser.js +0 -2
  9. package/dist/auth/callback-server.d.ts +0 -1
  10. package/dist/auth/callback-server.js +0 -2
  11. package/dist/auth/credentials.d.ts +0 -1
  12. package/dist/auth/credentials.js +0 -2
  13. package/dist/auth/crypto-utils.d.ts +0 -1
  14. package/dist/auth/crypto-utils.js +0 -2
  15. package/dist/auth/jwt-validator.d.ts +12 -6
  16. package/dist/auth/jwt-validator.js +15 -7
  17. package/dist/auth/oauth-flow.d.ts +0 -1
  18. package/dist/auth/oauth-flow.js +0 -2
  19. package/dist/auth/paste-code.d.ts +0 -1
  20. package/dist/auth/paste-code.js +0 -2
  21. package/dist/auth/pkce.d.ts +0 -1
  22. package/dist/auth/pkce.js +0 -2
  23. package/dist/auth/project-token.d.ts +0 -1
  24. package/dist/auth/project-token.js +4 -3
  25. package/dist/auth/refresh.d.ts +0 -1
  26. package/dist/auth/refresh.js +0 -2
  27. package/dist/auth/token-store-migration.d.ts +0 -1
  28. package/dist/auth/token-store-migration.js +0 -2
  29. package/dist/auth/token-store.d.ts +0 -1
  30. package/dist/auth/token-store.js +0 -2
  31. package/dist/auth/types.d.ts +0 -1
  32. package/dist/auth/types.js +0 -2
  33. package/dist/cli.d.ts +0 -1
  34. package/dist/cli.js +0 -2
  35. package/dist/commands/bootstrap.d.ts +0 -1
  36. package/dist/commands/bootstrap.js +0 -2
  37. package/dist/commands/build-lambda-zip.d.ts +0 -1
  38. package/dist/commands/build-lambda-zip.js +0 -2
  39. package/dist/commands/debug.d.ts +0 -1
  40. package/dist/commands/debug.js +0 -2
  41. package/dist/commands/deploy.d.ts +0 -1
  42. package/dist/commands/deploy.js +0 -2
  43. package/dist/commands/dump-tokens.d.ts +0 -1
  44. package/dist/commands/dump-tokens.js +0 -2
  45. package/dist/commands/env.d.ts +0 -1
  46. package/dist/commands/env.js +0 -2
  47. package/dist/commands/init.d.ts +0 -1
  48. package/dist/commands/init.js +0 -2
  49. package/dist/commands/list-tokens.d.ts +0 -1
  50. package/dist/commands/list-tokens.js +0 -2
  51. package/dist/commands/login.d.ts +0 -1
  52. package/dist/commands/login.js +0 -2
  53. package/dist/commands/logout.d.ts +0 -1
  54. package/dist/commands/logout.js +0 -2
  55. package/dist/commands/upgrade.d.ts +0 -1
  56. package/dist/commands/upgrade.js +0 -2
  57. package/dist/config/oauth.d.ts +0 -1
  58. package/dist/config/oauth.js +0 -2
  59. package/dist/constants.d.ts +0 -1
  60. package/dist/constants.js +0 -2
  61. package/dist/db-content-api/generated/content-api-types.d.ts +0 -1
  62. package/dist/db-content-api/generated/content-api-types.js +0 -2
  63. package/dist/db-content-api/index.d.ts +0 -1
  64. package/dist/db-content-api/index.js +0 -2
  65. package/dist/db-content-api/temp-utilities/slug.d.ts +0 -1
  66. package/dist/db-content-api/temp-utilities/slug.js +0 -2
  67. package/dist/db-content-api/temp-utilities/sorting.d.ts +0 -1
  68. package/dist/db-content-api/temp-utilities/sorting.js +0 -2
  69. package/dist/db-content-api/temp-utilities/types.d.ts +0 -1
  70. package/dist/db-content-api/temp-utilities/types.js +0 -2
  71. package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts +0 -1
  72. package/dist/db-content-api/temp-utilities/unwrapDocument.js +0 -2
  73. package/dist/db-content-api/utilities/auth.d.ts +0 -1
  74. package/dist/db-content-api/utilities/auth.js +0 -2
  75. package/dist/db-content-api/utilities/data/applyDefaults.d.ts +0 -1
  76. package/dist/db-content-api/utilities/data/applyDefaults.js +0 -2
  77. package/dist/db-content-api/utilities/data/castFieldValue.d.ts +0 -1
  78. package/dist/db-content-api/utilities/data/castFieldValue.js +0 -2
  79. package/dist/db-content-api/utilities/data/index.d.ts +0 -1
  80. package/dist/db-content-api/utilities/data/index.js +0 -2
  81. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +0 -1
  82. package/dist/db-content-api/utilities/data/removeVirtualFields.js +0 -2
  83. package/dist/db-content-api/utilities/data/stripFields.d.ts +0 -1
  84. package/dist/db-content-api/utilities/data/stripFields.js +0 -2
  85. package/dist/db-content-api/utilities/data/transformPublishedLocale.d.ts +0 -1
  86. package/dist/db-content-api/utilities/data/transformPublishedLocale.js +0 -2
  87. package/dist/db-content-api/utilities/data/validateRelationships.d.ts +0 -1
  88. package/dist/db-content-api/utilities/data/validateRelationships.js +0 -2
  89. package/dist/db-content-api/utilities/joins.d.ts +0 -1
  90. package/dist/db-content-api/utilities/joins.js +0 -2
  91. package/dist/db-content-api/utilities/locale/index.d.ts +0 -1
  92. package/dist/db-content-api/utilities/locale/index.js +0 -2
  93. package/dist/db-content-api/utilities/meta/buildLocalizedPaths.d.ts +0 -1
  94. package/dist/db-content-api/utilities/meta/buildLocalizedPaths.js +0 -2
  95. package/dist/db-content-api/utilities/meta/buildMeta.d.ts +0 -1
  96. package/dist/db-content-api/utilities/meta/buildMeta.js +0 -2
  97. package/dist/db-content-api/utilities/meta/buildPathTypes.d.ts +0 -1
  98. package/dist/db-content-api/utilities/meta/buildPathTypes.js +0 -2
  99. package/dist/db-content-api/utilities/meta/buildUniquePaths.d.ts +0 -1
  100. package/dist/db-content-api/utilities/meta/buildUniquePaths.js +0 -2
  101. package/dist/db-content-api/utilities/meta/normalizeLocaleInWhere.d.ts +0 -1
  102. package/dist/db-content-api/utilities/meta/normalizeLocaleInWhere.js +0 -2
  103. package/dist/db-content-api/utilities/where.d.ts +0 -1
  104. package/dist/db-content-api/utilities/where.js +0 -2
  105. package/dist/deploy/schedule-extract-plugin.d.ts +0 -1
  106. package/dist/deploy/schedule-extract-plugin.js +0 -2
  107. package/dist/endpoints/health.d.ts +0 -1
  108. package/dist/endpoints/health.js +0 -2
  109. package/dist/endpoints/schema.d.ts +0 -1
  110. package/dist/endpoints/schema.js +0 -2
  111. package/dist/exports/client.d.ts +0 -1
  112. package/dist/exports/client.js +0 -2
  113. package/dist/index.d.ts +0 -1
  114. package/dist/index.js +0 -2
  115. package/dist/lib/download-skill.d.ts +0 -1
  116. package/dist/lib/download-skill.js +0 -2
  117. package/dist/oauth/components/FigmaAvatar/index.d.ts +0 -1
  118. package/dist/oauth/components/FigmaAvatar/index.js +0 -2
  119. package/dist/oauth/components/FigmaAvatarCell/index.d.ts +0 -1
  120. package/dist/oauth/components/FigmaAvatarCell/index.js +0 -2
  121. package/dist/oauth/components/FigmaAvatarPlaceholder/index.d.ts +0 -1
  122. package/dist/oauth/components/FigmaAvatarPlaceholder/index.js +0 -2
  123. package/dist/oauth/components/LoginButton/iframeAutoLogin.d.ts +0 -1
  124. package/dist/oauth/components/LoginButton/iframeAutoLogin.js +0 -2
  125. package/dist/oauth/components/LoginButton/index.d.ts +0 -1
  126. package/dist/oauth/components/LoginButton/index.js +3 -5
  127. package/dist/oauth/components/LogoutButton/index.d.ts +0 -1
  128. package/dist/oauth/components/LogoutButton/index.js +0 -2
  129. package/dist/oauth/defaults.d.ts +0 -1
  130. package/dist/oauth/defaults.js +0 -2
  131. package/dist/oauth/endpoints/getLoginEndpoint.d.ts +0 -1
  132. package/dist/oauth/endpoints/getLoginEndpoint.js +0 -2
  133. package/dist/oauth/endpoints/getLogoutEndpoint.d.ts +0 -1
  134. package/dist/oauth/endpoints/getLogoutEndpoint.js +0 -2
  135. package/dist/oauth/endpoints/getMetaEndpoint.d.ts +0 -1
  136. package/dist/oauth/endpoints/getMetaEndpoint.js +0 -2
  137. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.d.ts +0 -1
  138. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.js +0 -2
  139. package/dist/oauth/exports/client.d.ts +0 -1
  140. package/dist/oauth/exports/client.js +0 -2
  141. package/dist/oauth/hooks/afterLogout.d.ts +0 -1
  142. package/dist/oauth/hooks/afterLogout.js +0 -2
  143. package/dist/oauth/hooks/me.d.ts +0 -1
  144. package/dist/oauth/hooks/me.js +0 -2
  145. package/dist/oauth/hooks/refresh.d.ts +0 -1
  146. package/dist/oauth/hooks/refresh.js +0 -2
  147. package/dist/oauth/index.d.ts +0 -1
  148. package/dist/oauth/index.js +0 -2
  149. package/dist/oauth/strategy/index.d.ts +0 -1
  150. package/dist/oauth/strategy/index.js +9 -3
  151. package/dist/oauth/types.d.ts +0 -1
  152. package/dist/oauth/types.js +0 -2
  153. package/dist/oauth/utilities/clearCookie.d.ts +0 -1
  154. package/dist/oauth/utilities/clearCookie.js +0 -2
  155. package/dist/oauth/utilities/createCookieOptions.d.ts +0 -1
  156. package/dist/oauth/utilities/createCookieOptions.js +0 -2
  157. package/dist/oauth/utilities/createDebugLogger.d.ts +0 -1
  158. package/dist/oauth/utilities/createDebugLogger.js +0 -2
  159. package/dist/oauth/utilities/establishSession.d.ts +0 -1
  160. package/dist/oauth/utilities/establishSession.js +0 -2
  161. package/dist/oauth/utilities/exchangeCodeForAccessToken.d.ts +0 -1
  162. package/dist/oauth/utilities/exchangeCodeForAccessToken.js +0 -2
  163. package/dist/oauth/utilities/extractOrigin.d.ts +0 -1
  164. package/dist/oauth/utilities/extractOrigin.js +0 -2
  165. package/dist/oauth/utilities/figmaHostnames.d.ts +0 -1
  166. package/dist/oauth/utilities/figmaHostnames.js +0 -2
  167. package/dist/oauth/utilities/getAdminCollectionSlug.d.ts +0 -1
  168. package/dist/oauth/utilities/getAdminCollectionSlug.js +0 -2
  169. package/dist/oauth/utilities/getAuthorizeURL.d.ts +0 -1
  170. package/dist/oauth/utilities/getAuthorizeURL.js +0 -2
  171. package/dist/oauth/utilities/getCookieExpiration.d.ts +0 -1
  172. package/dist/oauth/utilities/getCookieExpiration.js +0 -2
  173. package/dist/oauth/utilities/getSecondsFromTokenExp.d.ts +0 -1
  174. package/dist/oauth/utilities/getSecondsFromTokenExp.js +0 -2
  175. package/dist/oauth/utilities/getTokenExp.d.ts +0 -1
  176. package/dist/oauth/utilities/getTokenExp.js +0 -2
  177. package/dist/oauth/utilities/getUsernameField.d.ts +0 -1
  178. package/dist/oauth/utilities/getUsernameField.js +0 -2
  179. package/dist/oauth/utilities/hasUserTokenPropsChanged.d.ts +0 -1
  180. package/dist/oauth/utilities/hasUserTokenPropsChanged.js +0 -2
  181. package/dist/oauth/utilities/isAbsoluteURL.d.ts +0 -1
  182. package/dist/oauth/utilities/isAbsoluteURL.js +0 -2
  183. package/dist/oauth/utilities/isDuplicateKeyError.d.ts +0 -1
  184. package/dist/oauth/utilities/isDuplicateKeyError.js +0 -2
  185. package/dist/oauth/utilities/mergeHeaders.d.ts +0 -1
  186. package/dist/oauth/utilities/mergeHeaders.js +0 -2
  187. package/dist/oauth/utilities/refreshTokens.d.ts +0 -1
  188. package/dist/oauth/utilities/refreshTokens.js +9 -3
  189. package/dist/oauth/utilities/withPartitionedCookie.d.ts +0 -1
  190. package/dist/oauth/utilities/withPartitionedCookie.js +0 -2
  191. package/dist/oauth/utils/getSearchParam.d.ts +27 -0
  192. package/dist/oauth/utils/getSearchParam.js +45 -0
  193. package/dist/plugin/adapter.d.ts +0 -1
  194. package/dist/plugin/adapter.js +0 -2
  195. package/dist/plugin/auth-preflight.d.ts +0 -1
  196. package/dist/plugin/auth-preflight.js +0 -2
  197. package/dist/plugin/bootstrap-preflight.d.ts +0 -1
  198. package/dist/plugin/bootstrap-preflight.js +0 -2
  199. package/dist/plugin/build-config.d.ts +0 -1
  200. package/dist/plugin/build-config.js +0 -2
  201. package/dist/plugin/dev-cookie-names.d.ts +0 -1
  202. package/dist/plugin/dev-cookie-names.js +0 -2
  203. package/dist/storage-content-api/api-types.d.ts +0 -1
  204. package/dist/storage-content-api/api-types.js +0 -2
  205. package/dist/storage-content-api/client-uploads/ClientUploadHandler.d.ts +0 -1
  206. package/dist/storage-content-api/client-uploads/ClientUploadHandler.js +0 -2
  207. package/dist/storage-content-api/client-uploads/generateSignedURL.d.ts +0 -1
  208. package/dist/storage-content-api/client-uploads/generateSignedURL.js +0 -2
  209. package/dist/storage-content-api/client.d.ts +0 -1
  210. package/dist/storage-content-api/client.js +0 -2
  211. package/dist/storage-content-api/generateURL.d.ts +0 -1
  212. package/dist/storage-content-api/generateURL.js +0 -2
  213. package/dist/storage-content-api/handleDelete.d.ts +0 -1
  214. package/dist/storage-content-api/handleDelete.js +0 -2
  215. package/dist/storage-content-api/handleUpload.d.ts +0 -1
  216. package/dist/storage-content-api/handleUpload.js +0 -2
  217. package/dist/storage-content-api/index.d.ts +0 -1
  218. package/dist/storage-content-api/index.js +0 -2
  219. package/dist/storage-content-api/staticHandler.d.ts +0 -1
  220. package/dist/storage-content-api/staticHandler.js +0 -2
  221. package/dist/storage-content-api/types.d.ts +0 -1
  222. package/dist/storage-content-api/types.js +0 -2
  223. package/dist/storage-content-api/utilities/getSafeFilename.d.ts +0 -1
  224. package/dist/storage-content-api/utilities/getSafeFilename.js +0 -2
  225. package/dist/storage-content-api/utilities/index.d.ts +0 -1
  226. package/dist/storage-content-api/utilities/index.js +0 -2
  227. package/dist/storage-content-api/utilities/parseClientUploadContext.d.ts +0 -1
  228. package/dist/storage-content-api/utilities/parseClientUploadContext.js +0 -2
  229. package/dist/types/config.d.ts +0 -1
  230. package/dist/types/config.js +0 -2
  231. package/dist/types.d.ts +0 -1
  232. package/dist/types.js +0 -2
  233. package/dist/utils/adapters/nextjs.d.ts +0 -1
  234. package/dist/utils/adapters/nextjs.js +0 -2
  235. package/dist/utils/adapters/nitro.d.ts +0 -1
  236. package/dist/utils/adapters/nitro.js +0 -2
  237. package/dist/utils/adapters/vite.d.ts +0 -1
  238. package/dist/utils/adapters/vite.js +0 -2
  239. package/dist/utils/asset-collection.d.ts +0 -1
  240. package/dist/utils/asset-collection.js +0 -2
  241. package/dist/utils/build-detection.d.ts +0 -1
  242. package/dist/utils/build-detection.js +0 -2
  243. package/dist/utils/build-lambda-zip.d.ts +0 -1
  244. package/dist/utils/build-lambda-zip.js +0 -2
  245. package/dist/utils/cache-bootstrap.d.ts +0 -1
  246. package/dist/utils/cache-bootstrap.js +0 -2
  247. package/dist/utils/config.d.ts +0 -1
  248. package/dist/utils/config.js +0 -2
  249. package/dist/utils/deploy-adapter.d.ts +0 -1
  250. package/dist/utils/deploy-adapter.js +0 -2
  251. package/dist/utils/download-template.d.ts +0 -1
  252. package/dist/utils/download-template.js +0 -2
  253. package/dist/utils/env-management.d.ts +0 -1
  254. package/dist/utils/env-management.js +0 -2
  255. package/dist/utils/format-env-suffix.d.ts +0 -1
  256. package/dist/utils/format-env-suffix.js +0 -2
  257. package/dist/utils/format.d.ts +0 -1
  258. package/dist/utils/format.js +0 -2
  259. package/dist/utils/formatter.d.ts +0 -1
  260. package/dist/utils/formatter.js +0 -2
  261. package/dist/utils/fs-utils.d.ts +0 -1
  262. package/dist/utils/fs-utils.js +0 -2
  263. package/dist/utils/git.d.ts +0 -1
  264. package/dist/utils/git.js +0 -2
  265. package/dist/utils/handle-upgrade.d.ts +0 -1
  266. package/dist/utils/handle-upgrade.js +0 -2
  267. package/dist/utils/is-debug.d.ts +0 -1
  268. package/dist/utils/is-debug.js +0 -2
  269. package/dist/utils/lambda-config.d.ts +0 -1
  270. package/dist/utils/lambda-config.js +0 -2
  271. package/dist/utils/log.d.ts +0 -1
  272. package/dist/utils/log.js +0 -2
  273. package/dist/utils/messages.d.ts +0 -1
  274. package/dist/utils/messages.js +0 -2
  275. package/dist/utils/package-manager.d.ts +0 -1
  276. package/dist/utils/package-manager.js +0 -2
  277. package/dist/utils/parse-template-spec.d.ts +0 -1
  278. package/dist/utils/parse-template-spec.js +0 -2
  279. package/dist/utils/payload-config-ast.d.ts +0 -1
  280. package/dist/utils/payload-config-ast.js +0 -2
  281. package/dist/utils/payload-config-finder.d.ts +0 -1
  282. package/dist/utils/payload-config-finder.js +0 -2
  283. package/dist/utils/payload-config-modifier.d.ts +0 -1
  284. package/dist/utils/payload-config-modifier.js +0 -2
  285. package/dist/utils/payload-package-check.d.ts +0 -1
  286. package/dist/utils/payload-package-check.js +0 -2
  287. package/dist/utils/project.d.ts +0 -1
  288. package/dist/utils/project.js +0 -2
  289. package/dist/utils/resolve-environment.d.ts +0 -1
  290. package/dist/utils/resolve-environment.js +0 -2
  291. package/dist/utils/s3-upload.d.ts +0 -1
  292. package/dist/utils/s3-upload.js +0 -2
  293. package/dist/utils/token-display.d.ts +0 -1
  294. package/dist/utils/token-display.js +0 -2
  295. package/dist/utils/typescript-validator.d.ts +0 -1
  296. package/dist/utils/typescript-validator.js +0 -2
  297. package/dist/utils/version-check.d.ts +0 -1
  298. package/dist/utils/version-check.js +0 -2
  299. package/package.json +1 -1
@@ -171,4 +171,3 @@ export declare function getBootstrapInfo(credential: AuthCredential, cmsResource
171
171
  * into the new FIGMA_PROJECT_ID (CMS Resource ID).
172
172
  */
173
173
  export declare function getCmsResourceId(credential: AuthCredential, datasetId: string): Promise<string>;
174
- //# sourceMappingURL=control-plane.d.ts.map
@@ -352,5 +352,3 @@ async function controlPlaneFetch(params) {
352
352
  }
353
353
  throw new ControlPlaneError(`Network error while ${context}: ${lastError?.message || 'Unknown error'}`, undefined, lastError);
354
354
  }
355
-
356
- //# sourceMappingURL=control-plane.js.map
@@ -34,4 +34,3 @@ export declare function parseS3Error(params: {
34
34
  context: string;
35
35
  response: Response;
36
36
  }): Promise<string>;
37
- //# sourceMappingURL=error-response.d.ts.map
@@ -64,5 +64,3 @@
64
64
  const value = match?.[1]?.trim();
65
65
  return value && value.length > 0 ? value : undefined;
66
66
  }
67
-
68
- //# sourceMappingURL=error-response.js.map
@@ -49,4 +49,3 @@ export declare function getProjectToken(credential: AuthCredential, tenantId: st
49
49
  * @throws {FigmaApiError} If the API call fails
50
50
  */
51
51
  export declare function getUserInfo(credential: AuthCredential): Promise<FigmaUserInfo>;
52
- //# sourceMappingURL=figma-api.d.ts.map
@@ -213,5 +213,3 @@ import { parseControlPlaneApiError } from './error-response.js';
213
213
  throw new FigmaApiError(`Failed to get user info: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined, error instanceof Error ? error : undefined);
214
214
  }
215
215
  }
216
-
217
- //# sourceMappingURL=figma-api.js.map
@@ -28,4 +28,3 @@ export declare function buildAuthorizationUrl(params: {
28
28
  scopes: string[];
29
29
  state: string;
30
30
  }): string;
31
- //# sourceMappingURL=browser.d.ts.map
@@ -37,5 +37,3 @@ import open from 'open';
37
37
  url.searchParams.set('code_challenge_method', params.codeChallengeMethod);
38
38
  return url.toString();
39
39
  }
40
-
41
- //# sourceMappingURL=browser.js.map
@@ -70,4 +70,3 @@ export declare class CallbackServer {
70
70
  */
71
71
  waitUntilReady(): Promise<number>;
72
72
  }
73
- //# sourceMappingURL=callback-server.d.ts.map
@@ -206,5 +206,3 @@ function uniquePorts(ports) {
206
206
  ...new Set(ports)
207
207
  ];
208
208
  }
209
-
210
- //# sourceMappingURL=callback-server.js.map
@@ -18,4 +18,3 @@ export type AuthCredential = {
18
18
  * Build the correct auth headers for a credential
19
19
  */
20
20
  export declare function getAuthHeaders(credential: AuthCredential): Record<string, string>;
21
- //# sourceMappingURL=credentials.d.ts.map
@@ -17,5 +17,3 @@
17
17
  Authorization: `Bearer ${credential.token}`
18
18
  };
19
19
  }
20
-
21
- //# sourceMappingURL=credentials.js.map
@@ -58,4 +58,3 @@ export declare function getEncryptionKeyHash(): string;
58
58
  * @returns Array of paths to decrypted files created
59
59
  */
60
60
  export declare function exportDecryptedStoreFiles(rootDir: string, encryptionKey: string): string[];
61
- //# sourceMappingURL=crypto-utils.d.ts.map
@@ -203,5 +203,3 @@ import path from 'path';
203
203
  processDirectory(rootDir);
204
204
  return decryptedFiles;
205
205
  }
206
-
207
- //# sourceMappingURL=crypto-utils.js.map
@@ -4,9 +4,9 @@ import type { JWTPayload } from './types.js';
4
4
  * JWT validation error with specific error codes
5
5
  */
6
6
  export declare class JWTValidationError extends Error {
7
- code: 'EXPIRED' | 'JWKS_FETCH_FAILED' | 'MISSING_KID' | 'SIGNATURE_INVALID';
7
+ code: 'AUDIENCE_INVALID' | 'EXPIRED' | 'JWKS_FETCH_FAILED' | 'MISSING_KID' | 'SIGNATURE_INVALID';
8
8
  cause?: Error | undefined;
9
- constructor(message: string, code: 'EXPIRED' | 'JWKS_FETCH_FAILED' | 'MISSING_KID' | 'SIGNATURE_INVALID', cause?: Error | undefined);
9
+ constructor(message: string, code: 'AUDIENCE_INVALID' | 'EXPIRED' | 'JWKS_FETCH_FAILED' | 'MISSING_KID' | 'SIGNATURE_INVALID', cause?: Error | undefined);
10
10
  }
11
11
  /**
12
12
  * Validate a project token JWT
@@ -23,12 +23,19 @@ export declare class JWTValidationError extends Error {
23
23
  * - Validates standard claims (exp, iat, nbf)
24
24
  * - Handles clock skew tolerance
25
25
  *
26
- * @param token - JWT token string
27
- * @param environment - Figma environment ('production' or 'staging')
26
+ * @param params.token - JWT token string
27
+ * @param params.environment - Figma environment ('production' or 'staging')
28
+ * @param params.audience - Expected `aud` claim (the tenant's contentSystemId);
29
+ * when provided, jose rejects tokens whose `aud` does not match
28
30
  * @returns Promise resolving to validated JWT payload
29
31
  * @throws {JWTValidationError} If validation fails
30
32
  */
31
- export declare function validateProjectToken(token: string, environment: Environment): Promise<JWTPayload>;
33
+ export declare function validateProjectToken(params: {
34
+ /** Expected `aud` claim — the tenant's contentSystemId. Enforced when provided. */
35
+ audience?: string;
36
+ environment: Environment;
37
+ token: string;
38
+ }): Promise<JWTPayload>;
32
39
  /**
33
40
  * Clear JWKS cache (useful for testing or forcing refresh)
34
41
  *
@@ -39,4 +46,3 @@ export declare function validateProjectToken(token: string, environment: Environ
39
46
  * - Clearing state between test runs
40
47
  */
41
48
  export declare function clearJWKSCache(): void;
42
- //# sourceMappingURL=jwt-validator.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { createRemoteJWKSet, jwtVerify } from 'jose';
2
- import { JWKSMultipleMatchingKeys, JWKSNoMatchingKey, JWSInvalid, JWSSignatureVerificationFailed, JWTExpired } from 'jose/errors';
2
+ import { JWKSMultipleMatchingKeys, JWKSNoMatchingKey, JWSInvalid, JWSSignatureVerificationFailed, JWTClaimValidationFailed, JWTExpired } from 'jose/errors';
3
3
  import { getEnvConfig } from '../constants.js';
4
4
  /**
5
5
  * JWT validation error with specific error codes
@@ -52,15 +52,21 @@ import { getEnvConfig } from '../constants.js';
52
52
  * - Validates standard claims (exp, iat, nbf)
53
53
  * - Handles clock skew tolerance
54
54
  *
55
- * @param token - JWT token string
56
- * @param environment - Figma environment ('production' or 'staging')
55
+ * @param params.token - JWT token string
56
+ * @param params.environment - Figma environment ('production' or 'staging')
57
+ * @param params.audience - Expected `aud` claim (the tenant's contentSystemId);
58
+ * when provided, jose rejects tokens whose `aud` does not match
57
59
  * @returns Promise resolving to validated JWT payload
58
60
  * @throws {JWTValidationError} If validation fails
59
- */ export async function validateProjectToken(token, environment) {
61
+ */ export async function validateProjectToken(params) {
62
+ const { audience, environment, token } = params;
60
63
  try {
61
64
  const JWKS = getJWKSResolver(environment);
62
65
  const { payload } = await jwtVerify(token, JWKS, {
63
- clockTolerance: 300
66
+ clockTolerance: 300,
67
+ ...audience ? {
68
+ audience
69
+ } : {}
64
70
  });
65
71
  return payload;
66
72
  } catch (error) {
@@ -86,6 +92,10 @@ import { getEnvConfig } from '../constants.js';
86
92
  if (error instanceof JWSInvalid) {
87
93
  throw new JWTValidationError('Invalid JWT structure - missing required header fields (kid or alg)', 'MISSING_KID', error);
88
94
  }
95
+ // Audience mismatch (or missing `aud` when an audience is required)
96
+ if (error instanceof JWTClaimValidationFailed && error.claim === 'aud') {
97
+ throw new JWTValidationError('Token audience does not match this tenant', 'AUDIENCE_INVALID', error);
98
+ }
89
99
  // Network or fetch errors (not jose errors, generic Error instances)
90
100
  if (error instanceof Error) {
91
101
  const message = error.message;
@@ -109,5 +119,3 @@ import { getEnvConfig } from '../constants.js';
109
119
  */ export function clearJWKSCache() {
110
120
  jwksResolvers.clear();
111
121
  }
112
-
113
- //# sourceMappingURL=jwt-validator.js.map
@@ -75,4 +75,3 @@ export declare function getValidCredential(tokenStore: TokenStore): Promise<Auth
75
75
  * Use in commands that want to fall through to a login prompt on failure.
76
76
  */
77
77
  export declare function tryGetCredential(tokenStore: TokenStore): Promise<AuthCredential | null>;
78
- //# sourceMappingURL=oauth-flow.d.ts.map
@@ -284,5 +284,3 @@ function replaceRedirectUriPort(redirectUri, port) {
284
284
  url.port = String(port);
285
285
  return url.toString();
286
286
  }
287
-
288
- //# sourceMappingURL=oauth-flow.js.map
@@ -31,4 +31,3 @@ export declare function parsePastedCode(input: string, expectedState: string): s
31
31
  * @returns Error message string, or undefined if structurally valid
32
32
  */
33
33
  export declare function validatePastedCode(input: string): string | undefined;
34
- //# sourceMappingURL=paste-code.d.ts.map
@@ -85,5 +85,3 @@ function parsePasteInput(input) {
85
85
  return undefined;
86
86
  }
87
87
  }
88
-
89
- //# sourceMappingURL=paste-code.js.map
@@ -48,4 +48,3 @@ export declare function generateCodeChallenge(verifier: string): string;
48
48
  * // Include codeChallenge and codeChallengeMethod in authorization URL
49
49
  */
50
50
  export declare function generatePKCEPair(): PKCEPair;
51
- //# sourceMappingURL=pkce.d.ts.map
package/dist/auth/pkce.js CHANGED
@@ -67,5 +67,3 @@ import crypto from 'crypto';
67
67
  */ function base64UrlEncode(buffer) {
68
68
  return buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
69
69
  }
70
-
71
- //# sourceMappingURL=pkce.js.map
@@ -60,4 +60,3 @@ export declare function refreshProjectToken(params: {
60
60
  tenantId?: string;
61
61
  tokenStore: TokenStore;
62
62
  }): Promise<null | string>;
63
- //# sourceMappingURL=project-token.d.ts.map
@@ -153,7 +153,10 @@ function isCachedTokenValid(entry) {
153
153
  validatedClaims = parseJWTClaims(fetchedToken.token);
154
154
  } else {
155
155
  try {
156
- validatedClaims = await validateProjectToken(fetchedToken.token, getInfraEnvironment());
156
+ validatedClaims = await validateProjectToken({
157
+ environment: getInfraEnvironment(),
158
+ token: fetchedToken.token
159
+ });
157
160
  } catch (validationError) {
158
161
  if (validationError instanceof JWTValidationError) {
159
162
  throw new ProjectTokenError(`Project token validation failed: ${validationError.message}`, validationError);
@@ -233,5 +236,3 @@ function isCachedTokenValid(entry) {
233
236
  });
234
237
  return getValidProjectToken(params);
235
238
  }
236
-
237
- //# sourceMappingURL=project-token.js.map
@@ -33,4 +33,3 @@ export declare function refreshAccessToken(refreshToken: string, clientId?: stri
33
33
  * @throws TokenRefreshError if exchange fails
34
34
  */
35
35
  export declare function exchangeCodeForTokens(code: string, codeVerifier: string, redirectUri?: string, clientId?: string): Promise<FigmaTokens>;
36
- //# sourceMappingURL=refresh.d.ts.map
@@ -149,5 +149,3 @@ import * as log from '../utils/log.js';
149
149
  throw new TokenRefreshError(`Failed to exchange code for tokens: ${error instanceof Error ? error.message : 'Unknown error'}`);
150
150
  }
151
151
  }
152
-
153
- //# sourceMappingURL=refresh.js.map
@@ -55,4 +55,3 @@ export type MigrateProjectDataParams = {
55
55
  * Target files that already exist are left alone.
56
56
  */
57
57
  export declare function migrateProjectData(params: MigrateProjectDataParams): void;
58
- //# sourceMappingURL=token-store-migration.d.ts.map
@@ -152,5 +152,3 @@ function safeGet(config, key) {
152
152
  return null;
153
153
  }
154
154
  }
155
-
156
- //# sourceMappingURL=token-store-migration.js.map
@@ -73,4 +73,3 @@ export declare class TokenStore {
73
73
  private tryMigrateLegacyKey;
74
74
  private safeGet;
75
75
  }
76
- //# sourceMappingURL=token-store.d.ts.map
@@ -467,5 +467,3 @@ const PROJECT_STORE_SCHEMA_VERSION = 1;
467
467
  }
468
468
  }
469
469
  }
470
-
471
- //# sourceMappingURL=token-store.js.map
@@ -225,4 +225,3 @@ export interface ProjectTokenResponse {
225
225
  token: string;
226
226
  };
227
227
  }
228
- //# sourceMappingURL=types.d.ts.map
@@ -2,5 +2,3 @@
2
2
  * Raw project token response from Figma API
3
3
  * Response from GET https://api.figma.com/v1/cms/:id/token/
4
4
  */ export { };
5
-
6
- //# sourceMappingURL=types.js.map
package/dist/cli.d.ts CHANGED
@@ -2,4 +2,3 @@
2
2
  * Entrypoint for bin/cli.js
3
3
  */
4
4
  export declare function main(): Promise<void>;
5
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js CHANGED
@@ -191,5 +191,3 @@ class Main {
191
191
  }
192
192
  }
193
193
  }
194
-
195
- //# sourceMappingURL=cli.js.map
@@ -15,4 +15,3 @@ export type BootstrapCommandOptions = {
15
15
  * to `init` a project.
16
16
  */
17
17
  export declare function bootstrapCommand(options?: BootstrapCommandOptions): Promise<void>;
18
- //# sourceMappingURL=bootstrap.d.ts.map
@@ -86,5 +86,3 @@ import { maskToken } from '../utils/token-display.js';
86
86
  }
87
87
  p.note(lines.join('\n'), 'Bootstrap Info');
88
88
  }
89
-
90
- //# sourceMappingURL=bootstrap.js.map
@@ -2,4 +2,3 @@
2
2
  * Build Lambda deployment zip from current directory
3
3
  */
4
4
  export declare function buildLambdaZipCommand(): Promise<void>;
5
- //# sourceMappingURL=build-lambda-zip.d.ts.map
@@ -15,5 +15,3 @@ import { buildLambdaZip } from '../utils/build-lambda-zip.js';
15
15
  throw error;
16
16
  }
17
17
  }
18
-
19
- //# sourceMappingURL=build-lambda-zip.js.map
@@ -5,4 +5,3 @@
5
5
  * All data is local — no network calls are made.
6
6
  */
7
7
  export declare function debugCommand(): Promise<void>;
8
- //# sourceMappingURL=debug.d.ts.map
@@ -176,5 +176,3 @@ function formatDuration(ms) {
176
176
  }
177
177
  return `${minutes}m`;
178
178
  }
179
-
180
- //# sourceMappingURL=debug.js.map
@@ -24,4 +24,3 @@ export interface DeployCommandOptions {
24
24
  * @param options - Command options
25
25
  */
26
26
  export declare function deployCommand(options: DeployCommandOptions): Promise<void>;
27
- //# sourceMappingURL=deploy.d.ts.map
@@ -342,5 +342,3 @@ import { loginCommand } from './login.js';
342
342
  process.exit(1);
343
343
  }
344
344
  }
345
-
346
- //# sourceMappingURL=deploy.js.map
@@ -9,4 +9,3 @@
9
9
  * Skips the `payloadcms-figma-crypto.json` salt file at the root.
10
10
  */
11
11
  export declare function dumpTokensCommand(): Promise<void>;
12
- //# sourceMappingURL=dump-tokens.d.ts.map
@@ -65,5 +65,3 @@ import { deriveEncryptionKey, exportDecryptedStoreFiles } from '../auth/crypto-u
65
65
  // eslint-disable-next-line no-console
66
66
  console.log('\nNote: These files contain sensitive tokens. Delete after use.');
67
67
  }
68
-
69
- //# sourceMappingURL=dump-tokens.js.map
@@ -10,4 +10,3 @@ export interface EnvCommandOptions {
10
10
  * Updates FIGMA_ENVIRONMENT_NAME in .env and caches all bootstrap data.
11
11
  */
12
12
  export declare function envCommand(options: EnvCommandOptions): Promise<void>;
13
- //# sourceMappingURL=env.d.ts.map
@@ -84,5 +84,3 @@ import * as log from '../utils/log.js';
84
84
  p.log.success(pc.green(`✓ Switched to ${pc.cyan(targetName)}`));
85
85
  p.log.message(pc.dim('Restart your dev server to apply the change.'));
86
86
  }
87
-
88
- //# sourceMappingURL=env.js.map
@@ -35,4 +35,3 @@ export interface InitCommandOptions {
35
35
  * @param options - Command options
36
36
  */
37
37
  export declare function initCommand(options: InitCommandOptions): Promise<void>;
38
- //# sourceMappingURL=init.d.ts.map
@@ -435,5 +435,3 @@ async function maybeInstallPayloadSkill(args) {
435
435
  p.outro(pc.green('✓ Done'));
436
436
  }
437
437
  }
438
-
439
- //# sourceMappingURL=init.js.map
@@ -13,4 +13,3 @@ export interface ListTokensCommandOptions {
13
13
  * Displays stored token information including OAuth and project tokens.
14
14
  */
15
15
  export declare function listTokensCommand(options?: ListTokensCommandOptions): void;
16
- //# sourceMappingURL=list-tokens.d.ts.map
@@ -56,5 +56,3 @@ function showTokenDetails(env) {
56
56
  // Show project tokens if any exist
57
57
  showProjectTokens(tokenStore);
58
58
  }
59
-
60
- //# sourceMappingURL=list-tokens.js.map
@@ -12,4 +12,3 @@ type LoginArgs = {
12
12
  */
13
13
  export declare function loginCommand(args?: LoginArgs): Promise<void>;
14
14
  export {};
15
- //# sourceMappingURL=login.d.ts.map
@@ -80,5 +80,3 @@ import * as log from '../utils/log.js';
80
80
  process.exit(1);
81
81
  }
82
82
  }
83
-
84
- //# sourceMappingURL=login.js.map
@@ -14,4 +14,3 @@ export interface LogoutCommandOptions {
14
14
  * By default clears only current environment. Use --all for all environments.
15
15
  */
16
16
  export declare function logoutCommand(options?: LogoutCommandOptions): Promise<void>;
17
- //# sourceMappingURL=logout.d.ts.map
@@ -101,5 +101,3 @@ function clearCurrentProjectToken(store, env) {
101
101
  projectInfo
102
102
  });
103
103
  }
104
-
105
- //# sourceMappingURL=logout.js.map
@@ -2,4 +2,3 @@ export type UpgradeCommandOptions = {
2
2
  isDryRun?: boolean;
3
3
  };
4
4
  export declare function upgradeCommand(options?: UpgradeCommandOptions): Promise<void>;
5
- //# sourceMappingURL=upgrade.d.ts.map
@@ -327,5 +327,3 @@ async function migrateLocalPackageVersion({ changes, cliDir, cwd, isDryRun }) {
327
327
  p.log.message(`${pc.green('●')} Package: Installed @payloadcms/figma from local build`);
328
328
  changes.push('Installed @payloadcms/figma from local build');
329
329
  }
330
-
331
- //# sourceMappingURL=upgrade.js.map
@@ -22,4 +22,3 @@ export declare const TOKEN_EXPIRY_BUFFER_SECONDS = 300;
22
22
  * round-trip time for the calls these tokens authorize.
23
23
  */
24
24
  export declare const PROJECT_TOKEN_EXPIRY_BUFFER_SECONDS = 30;
25
- //# sourceMappingURL=oauth.d.ts.map
@@ -40,5 +40,3 @@ export const TOKEN_EXPIRY_BUFFER_SECONDS = 300;
40
40
  * already-expired and bypass the cache entirely. 30 seconds is well above the
41
41
  * round-trip time for the calls these tokens authorize.
42
42
  */ export const PROJECT_TOKEN_EXPIRY_BUFFER_SECONDS = 30;
43
-
44
- //# sourceMappingURL=oauth.js.map
@@ -69,4 +69,3 @@ export declare function setInfraEnvironment(env: Environment | undefined): void;
69
69
  export declare function getEnvConfig(environment?: Environment): EnvironmentConfig;
70
70
  export declare function getInfraEnvironment(): Environment;
71
71
  export {};
72
- //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -163,5 +163,3 @@ export function getInfraEnvironment() {
163
163
  }
164
164
  return 'production';
165
165
  }
166
-
167
- //# sourceMappingURL=constants.js.map
@@ -3975,4 +3975,3 @@ export type components = {
3975
3975
  };
3976
3976
  export type $defs = Record<string, never>;
3977
3977
  export type operations = Record<string, never>;
3978
- //# sourceMappingURL=content-api-types.d.ts.map
@@ -3,5 +3,3 @@
3
3
  * Do not make direct changes to the file.
4
4
  */ /* eslint-disable */ // @ts-nocheck - Recursive types from OpenAPI cause TS2502 errors
5
5
  export { };
6
-
7
- //# sourceMappingURL=content-api-types.js.map
@@ -34,4 +34,3 @@ export type ContentAPIAdapter = {
34
34
  } & BaseDatabaseAdapter;
35
35
  export declare const contentAPIAdapter: (opts: ContentAPIOptions) => DatabaseAdapterObj;
36
36
  export {};
37
- //# sourceMappingURL=index.d.ts.map
@@ -919,5 +919,3 @@ export const contentAPIAdapter = (opts)=>({
919
919
  });
920
920
  }
921
921
  });
922
-
923
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export declare const getGlobalSlug: (slug: string) => string;
2
- //# sourceMappingURL=slug.d.ts.map
@@ -1,3 +1 @@
1
1
  export const getGlobalSlug = (slug)=>`_global-${slug}`;
2
-
3
- //# sourceMappingURL=slug.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Payload } from 'payload';
2
2
  export declare function addFallbackSort(sort: string | string[] | undefined, payload: Payload, collectionSlug: string | string[], defaultSort?: string | string[]): string | string[] | undefined;
3
- //# sourceMappingURL=sorting.d.ts.map
@@ -35,5 +35,3 @@ export function addFallbackSort(sort, payload, collectionSlug, defaultSort) {
35
35
  fallbackSort
36
36
  ];
37
37
  }
38
-
39
- //# sourceMappingURL=sorting.js.map
@@ -19,4 +19,3 @@ export type PathTypeValue = 'array' | {
19
19
  type: 'join' | 'relationship';
20
20
  };
21
21
  export type PathTypesRecord = Record<string, PathTypeValue>;
22
- //# sourceMappingURL=types.d.ts.map
@@ -11,5 +11,3 @@
11
11
  * TODO: This type is defined here temporarily so Content API can test the integration.
12
12
  * Once Content API implements support for this, the type should be generated from openapi.json.
13
13
  */ export { };
14
-
15
- //# sourceMappingURL=types.js.map
@@ -36,4 +36,3 @@ export declare const unwrapFindResponse: (payload: Payload, response: components
36
36
  docs: Record<string, unknown>[];
37
37
  };
38
38
  export {};
39
- //# sourceMappingURL=unwrapDocument.d.ts.map
@@ -60,5 +60,3 @@ export const unwrapFindResponse = (payload, response, collection, locale)=>{
60
60
  ...paginationFields
61
61
  };
62
62
  };
63
-
64
- //# sourceMappingURL=unwrapDocument.js.map
@@ -27,4 +27,3 @@ export declare function createErrorMiddleware(opts: {
27
27
  url: string;
28
28
  }): Middleware;
29
29
  export {};
30
- //# sourceMappingURL=auth.d.ts.map
@@ -80,5 +80,3 @@ export function createErrorMiddleware(opts) {
80
80
  }
81
81
  };
82
82
  }
83
-
84
- //# sourceMappingURL=auth.js.map
@@ -4,4 +4,3 @@ import type { Field } from 'payload';
4
4
  * This handles defaults for nested structures (arrays, groups) which traverseFields doesn't handle
5
5
  */
6
6
  export declare function applyDefaults(data: Record<string, unknown>, fields: Field[]): void;
7
- //# sourceMappingURL=applyDefaults.d.ts.map
@@ -71,5 +71,3 @@
71
71
  }
72
72
  }
73
73
  }
74
-
75
- //# sourceMappingURL=applyDefaults.js.map
@@ -8,4 +8,3 @@ import type { Field, TabAsField } from 'payload';
8
8
  *
9
9
  */
10
10
  export declare function castFieldValue(field: Field | TabAsField, value: unknown): unknown;
11
- //# sourceMappingURL=castFieldValue.d.ts.map
@@ -64,5 +64,3 @@
64
64
  }
65
65
  return value;
66
66
  }
67
-
68
- //# sourceMappingURL=castFieldValue.js.map
@@ -46,4 +46,3 @@ export declare function dataToContentAPI(payload: Payload, collectionSlug: strin
46
46
  export declare function resolveVersionContent(version: unknown, versionMeta: Record<string, unknown>): unknown;
47
47
  export declare function dataFromContentAPI(payload: Payload, collectionSlug: string, data: unknown, locale?: string): unknown;
48
48
  export {};
49
- //# sourceMappingURL=index.d.ts.map
@@ -297,5 +297,3 @@ export function dataFromContentAPI(payload, collectionSlug, data, locale) {
297
297
  }
298
298
  return transformed;
299
299
  }
300
-
301
- //# sourceMappingURL=index.js.map