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

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 (309) 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 +2 -2
  6. package/dist/api/figma-api.js +33 -5
  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 +22 -6
  16. package/dist/auth/jwt-validator.js +33 -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 +6 -4
  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 +5 -2
  32. package/dist/auth/types.js +1 -3
  33. package/dist/cli.d.ts +0 -1
  34. package/dist/cli.js +7 -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/commands/upload-schema.d.ts +8 -0
  58. package/dist/commands/upload-schema.js +91 -0
  59. package/dist/config/oauth.d.ts +0 -1
  60. package/dist/config/oauth.js +0 -2
  61. package/dist/constants.d.ts +0 -1
  62. package/dist/constants.js +0 -2
  63. package/dist/db-content-api/generated/content-api-types.d.ts +4188 -592
  64. package/dist/db-content-api/generated/content-api-types.js +0 -2
  65. package/dist/db-content-api/index.d.ts +0 -1
  66. package/dist/db-content-api/index.js +0 -2
  67. package/dist/db-content-api/temp-utilities/slug.d.ts +0 -1
  68. package/dist/db-content-api/temp-utilities/slug.js +0 -2
  69. package/dist/db-content-api/temp-utilities/sorting.d.ts +0 -1
  70. package/dist/db-content-api/temp-utilities/sorting.js +0 -2
  71. package/dist/db-content-api/temp-utilities/types.d.ts +0 -1
  72. package/dist/db-content-api/temp-utilities/types.js +0 -2
  73. package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts +0 -1
  74. package/dist/db-content-api/temp-utilities/unwrapDocument.js +0 -2
  75. package/dist/db-content-api/utilities/auth.d.ts +0 -1
  76. package/dist/db-content-api/utilities/auth.js +0 -2
  77. package/dist/db-content-api/utilities/data/applyDefaults.d.ts +0 -1
  78. package/dist/db-content-api/utilities/data/applyDefaults.js +0 -2
  79. package/dist/db-content-api/utilities/data/castFieldValue.d.ts +0 -1
  80. package/dist/db-content-api/utilities/data/castFieldValue.js +0 -2
  81. package/dist/db-content-api/utilities/data/index.d.ts +0 -1
  82. package/dist/db-content-api/utilities/data/index.js +0 -2
  83. package/dist/db-content-api/utilities/data/pointShape.d.ts +3 -0
  84. package/dist/db-content-api/utilities/data/pointShape.js +43 -0
  85. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +0 -1
  86. package/dist/db-content-api/utilities/data/removeVirtualFields.js +0 -2
  87. package/dist/db-content-api/utilities/data/richTextShape.d.ts +3 -0
  88. package/dist/db-content-api/utilities/data/richTextShape.js +56 -0
  89. package/dist/db-content-api/utilities/data/stripFields.d.ts +0 -1
  90. package/dist/db-content-api/utilities/data/stripFields.js +0 -2
  91. package/dist/db-content-api/utilities/data/transformPublishedLocale.d.ts +0 -1
  92. package/dist/db-content-api/utilities/data/transformPublishedLocale.js +0 -2
  93. package/dist/db-content-api/utilities/data/validateRelationships.d.ts +0 -1
  94. package/dist/db-content-api/utilities/data/validateRelationships.js +0 -2
  95. package/dist/db-content-api/utilities/joins.d.ts +0 -1
  96. package/dist/db-content-api/utilities/joins.js +0 -2
  97. package/dist/db-content-api/utilities/locale/index.d.ts +0 -1
  98. package/dist/db-content-api/utilities/locale/index.js +0 -2
  99. package/dist/db-content-api/utilities/meta/buildLocalizedPaths.d.ts +0 -1
  100. package/dist/db-content-api/utilities/meta/buildLocalizedPaths.js +0 -2
  101. package/dist/db-content-api/utilities/meta/buildMeta.d.ts +0 -1
  102. package/dist/db-content-api/utilities/meta/buildMeta.js +0 -2
  103. package/dist/db-content-api/utilities/meta/buildPathTypes.d.ts +0 -1
  104. package/dist/db-content-api/utilities/meta/buildPathTypes.js +0 -2
  105. package/dist/db-content-api/utilities/meta/buildUniquePaths.d.ts +0 -1
  106. package/dist/db-content-api/utilities/meta/buildUniquePaths.js +0 -2
  107. package/dist/db-content-api/utilities/meta/normalizeLocaleInWhere.d.ts +0 -1
  108. package/dist/db-content-api/utilities/meta/normalizeLocaleInWhere.js +0 -2
  109. package/dist/db-content-api/utilities/schema/buildDocumentSchema.d.ts +56 -0
  110. package/dist/db-content-api/utilities/schema/buildDocumentSchema.js +183 -0
  111. package/dist/db-content-api/utilities/where.d.ts +0 -1
  112. package/dist/db-content-api/utilities/where.js +0 -2
  113. package/dist/deploy/schedule-extract-plugin.d.ts +0 -1
  114. package/dist/deploy/schedule-extract-plugin.js +0 -2
  115. package/dist/endpoints/health.d.ts +0 -1
  116. package/dist/endpoints/health.js +0 -2
  117. package/dist/endpoints/schema.d.ts +0 -1
  118. package/dist/endpoints/schema.js +0 -2
  119. package/dist/exports/client.d.ts +0 -1
  120. package/dist/exports/client.js +0 -2
  121. package/dist/index.d.ts +0 -1
  122. package/dist/index.js +0 -2
  123. package/dist/lib/download-skill.d.ts +0 -1
  124. package/dist/lib/download-skill.js +0 -2
  125. package/dist/oauth/components/FigmaAvatar/index.d.ts +0 -1
  126. package/dist/oauth/components/FigmaAvatar/index.js +0 -2
  127. package/dist/oauth/components/FigmaAvatarCell/index.d.ts +0 -1
  128. package/dist/oauth/components/FigmaAvatarCell/index.js +0 -2
  129. package/dist/oauth/components/FigmaAvatarPlaceholder/index.d.ts +0 -1
  130. package/dist/oauth/components/FigmaAvatarPlaceholder/index.js +0 -2
  131. package/dist/oauth/components/LoginButton/iframeAutoLogin.d.ts +0 -1
  132. package/dist/oauth/components/LoginButton/iframeAutoLogin.js +0 -2
  133. package/dist/oauth/components/LoginButton/index.d.ts +0 -1
  134. package/dist/oauth/components/LoginButton/index.js +3 -5
  135. package/dist/oauth/components/LogoutButton/index.d.ts +0 -1
  136. package/dist/oauth/components/LogoutButton/index.js +0 -2
  137. package/dist/oauth/defaults.d.ts +0 -1
  138. package/dist/oauth/defaults.js +8 -2
  139. package/dist/oauth/endpoints/getLoginEndpoint.d.ts +0 -1
  140. package/dist/oauth/endpoints/getLoginEndpoint.js +4 -8
  141. package/dist/oauth/endpoints/getLogoutEndpoint.d.ts +0 -1
  142. package/dist/oauth/endpoints/getLogoutEndpoint.js +0 -2
  143. package/dist/oauth/endpoints/getMetaEndpoint.d.ts +0 -1
  144. package/dist/oauth/endpoints/getMetaEndpoint.js +0 -2
  145. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.d.ts +0 -1
  146. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.js +0 -2
  147. package/dist/oauth/exports/client.d.ts +0 -1
  148. package/dist/oauth/exports/client.js +0 -2
  149. package/dist/oauth/hooks/afterLogout.d.ts +0 -1
  150. package/dist/oauth/hooks/afterLogout.js +0 -2
  151. package/dist/oauth/hooks/me.d.ts +0 -1
  152. package/dist/oauth/hooks/me.js +0 -2
  153. package/dist/oauth/hooks/refresh.d.ts +0 -1
  154. package/dist/oauth/hooks/refresh.js +0 -2
  155. package/dist/oauth/index.d.ts +0 -1
  156. package/dist/oauth/index.js +0 -2
  157. package/dist/oauth/strategy/index.d.ts +0 -1
  158. package/dist/oauth/strategy/index.js +17 -19
  159. package/dist/oauth/types.d.ts +0 -1
  160. package/dist/oauth/types.js +0 -2
  161. package/dist/oauth/utilities/clearCookie.d.ts +0 -1
  162. package/dist/oauth/utilities/clearCookie.js +0 -2
  163. package/dist/oauth/utilities/createCookieOptions.d.ts +0 -1
  164. package/dist/oauth/utilities/createCookieOptions.js +0 -2
  165. package/dist/oauth/utilities/createDebugLogger.d.ts +0 -1
  166. package/dist/oauth/utilities/createDebugLogger.js +0 -2
  167. package/dist/oauth/utilities/establishSession.d.ts +4 -5
  168. package/dist/oauth/utilities/establishSession.js +9 -12
  169. package/dist/oauth/utilities/exchangeCodeForAccessToken.d.ts +0 -1
  170. package/dist/oauth/utilities/exchangeCodeForAccessToken.js +0 -2
  171. package/dist/oauth/utilities/extractOrigin.d.ts +0 -1
  172. package/dist/oauth/utilities/extractOrigin.js +0 -2
  173. package/dist/oauth/utilities/figmaHostnames.d.ts +0 -1
  174. package/dist/oauth/utilities/figmaHostnames.js +0 -2
  175. package/dist/oauth/utilities/getAdminCollectionSlug.d.ts +0 -1
  176. package/dist/oauth/utilities/getAdminCollectionSlug.js +0 -2
  177. package/dist/oauth/utilities/getAuthorizeURL.d.ts +0 -1
  178. package/dist/oauth/utilities/getAuthorizeURL.js +0 -2
  179. package/dist/oauth/utilities/getCookieExpiration.d.ts +0 -1
  180. package/dist/oauth/utilities/getCookieExpiration.js +0 -2
  181. package/dist/oauth/utilities/getSecondsFromTokenExp.d.ts +0 -1
  182. package/dist/oauth/utilities/getSecondsFromTokenExp.js +0 -2
  183. package/dist/oauth/utilities/getTokenExp.d.ts +0 -1
  184. package/dist/oauth/utilities/getTokenExp.js +0 -2
  185. package/dist/oauth/utilities/getUsernameField.d.ts +0 -1
  186. package/dist/oauth/utilities/getUsernameField.js +0 -2
  187. package/dist/oauth/utilities/hasUserTokenPropsChanged.d.ts +0 -1
  188. package/dist/oauth/utilities/hasUserTokenPropsChanged.js +0 -2
  189. package/dist/oauth/utilities/isAbsoluteURL.d.ts +0 -1
  190. package/dist/oauth/utilities/isAbsoluteURL.js +0 -2
  191. package/dist/oauth/utilities/isDuplicateKeyError.d.ts +0 -1
  192. package/dist/oauth/utilities/isDuplicateKeyError.js +0 -2
  193. package/dist/oauth/utilities/mergeHeaders.d.ts +0 -1
  194. package/dist/oauth/utilities/mergeHeaders.js +0 -2
  195. package/dist/oauth/utilities/refreshTokens.d.ts +0 -1
  196. package/dist/oauth/utilities/refreshTokens.js +16 -12
  197. package/dist/oauth/utilities/withPartitionedCookie.d.ts +0 -1
  198. package/dist/oauth/utilities/withPartitionedCookie.js +0 -2
  199. package/dist/oauth/utils/getSearchParam.d.ts +27 -0
  200. package/dist/oauth/utils/getSearchParam.js +45 -0
  201. package/dist/plugin/adapter.d.ts +0 -1
  202. package/dist/plugin/adapter.js +0 -2
  203. package/dist/plugin/auth-preflight.d.ts +0 -1
  204. package/dist/plugin/auth-preflight.js +0 -2
  205. package/dist/plugin/bootstrap-preflight.d.ts +0 -1
  206. package/dist/plugin/bootstrap-preflight.js +0 -2
  207. package/dist/plugin/build-config.d.ts +1 -1
  208. package/dist/plugin/build-config.js +66 -3
  209. package/dist/plugin/dev-cookie-names.d.ts +0 -1
  210. package/dist/plugin/dev-cookie-names.js +0 -2
  211. package/dist/storage-content-api/api-types.d.ts +0 -1
  212. package/dist/storage-content-api/api-types.js +0 -2
  213. package/dist/storage-content-api/client-uploads/ClientUploadHandler.d.ts +0 -1
  214. package/dist/storage-content-api/client-uploads/ClientUploadHandler.js +0 -2
  215. package/dist/storage-content-api/client-uploads/generateSignedURL.d.ts +0 -1
  216. package/dist/storage-content-api/client-uploads/generateSignedURL.js +0 -2
  217. package/dist/storage-content-api/client.d.ts +0 -1
  218. package/dist/storage-content-api/client.js +0 -2
  219. package/dist/storage-content-api/generateURL.d.ts +0 -1
  220. package/dist/storage-content-api/generateURL.js +0 -2
  221. package/dist/storage-content-api/handleDelete.d.ts +0 -1
  222. package/dist/storage-content-api/handleDelete.js +0 -2
  223. package/dist/storage-content-api/handleUpload.d.ts +0 -1
  224. package/dist/storage-content-api/handleUpload.js +0 -2
  225. package/dist/storage-content-api/index.d.ts +0 -1
  226. package/dist/storage-content-api/index.js +0 -2
  227. package/dist/storage-content-api/staticHandler.d.ts +0 -1
  228. package/dist/storage-content-api/staticHandler.js +0 -2
  229. package/dist/storage-content-api/types.d.ts +0 -1
  230. package/dist/storage-content-api/types.js +0 -2
  231. package/dist/storage-content-api/utilities/getSafeFilename.d.ts +0 -1
  232. package/dist/storage-content-api/utilities/getSafeFilename.js +0 -2
  233. package/dist/storage-content-api/utilities/index.d.ts +0 -1
  234. package/dist/storage-content-api/utilities/index.js +0 -2
  235. package/dist/storage-content-api/utilities/parseClientUploadContext.d.ts +0 -1
  236. package/dist/storage-content-api/utilities/parseClientUploadContext.js +0 -2
  237. package/dist/types/config.d.ts +0 -1
  238. package/dist/types/config.js +0 -2
  239. package/dist/types.d.ts +0 -1
  240. package/dist/types.js +0 -2
  241. package/dist/utils/adapters/nextjs.d.ts +0 -1
  242. package/dist/utils/adapters/nextjs.js +0 -2
  243. package/dist/utils/adapters/nitro.d.ts +0 -1
  244. package/dist/utils/adapters/nitro.js +0 -2
  245. package/dist/utils/adapters/vite.d.ts +0 -1
  246. package/dist/utils/adapters/vite.js +0 -2
  247. package/dist/utils/asset-collection.d.ts +0 -1
  248. package/dist/utils/asset-collection.js +0 -2
  249. package/dist/utils/build-detection.d.ts +0 -1
  250. package/dist/utils/build-detection.js +0 -2
  251. package/dist/utils/build-lambda-zip.d.ts +0 -1
  252. package/dist/utils/build-lambda-zip.js +0 -2
  253. package/dist/utils/cache-bootstrap.d.ts +0 -1
  254. package/dist/utils/cache-bootstrap.js +0 -2
  255. package/dist/utils/config.d.ts +0 -1
  256. package/dist/utils/config.js +0 -2
  257. package/dist/utils/deploy-adapter.d.ts +0 -1
  258. package/dist/utils/deploy-adapter.js +0 -2
  259. package/dist/utils/download-template.d.ts +0 -1
  260. package/dist/utils/download-template.js +0 -2
  261. package/dist/utils/env-management.d.ts +0 -1
  262. package/dist/utils/env-management.js +0 -2
  263. package/dist/utils/format-env-suffix.d.ts +0 -1
  264. package/dist/utils/format-env-suffix.js +0 -2
  265. package/dist/utils/format.d.ts +0 -1
  266. package/dist/utils/format.js +0 -2
  267. package/dist/utils/formatter.d.ts +0 -1
  268. package/dist/utils/formatter.js +0 -2
  269. package/dist/utils/fs-utils.d.ts +0 -1
  270. package/dist/utils/fs-utils.js +0 -2
  271. package/dist/utils/git.d.ts +0 -1
  272. package/dist/utils/git.js +0 -2
  273. package/dist/utils/handle-upgrade.d.ts +0 -1
  274. package/dist/utils/handle-upgrade.js +0 -2
  275. package/dist/utils/is-debug.d.ts +0 -1
  276. package/dist/utils/is-debug.js +0 -2
  277. package/dist/utils/lambda-config.d.ts +0 -1
  278. package/dist/utils/lambda-config.js +0 -2
  279. package/dist/utils/load-payload-config.d.ts +9 -0
  280. package/dist/utils/load-payload-config.js +27 -0
  281. package/dist/utils/log.d.ts +0 -1
  282. package/dist/utils/log.js +0 -2
  283. package/dist/utils/messages.d.ts +0 -1
  284. package/dist/utils/messages.js +7 -2
  285. package/dist/utils/package-manager.d.ts +0 -1
  286. package/dist/utils/package-manager.js +0 -2
  287. package/dist/utils/parse-template-spec.d.ts +0 -1
  288. package/dist/utils/parse-template-spec.js +0 -2
  289. package/dist/utils/payload-config-ast.d.ts +0 -1
  290. package/dist/utils/payload-config-ast.js +0 -2
  291. package/dist/utils/payload-config-finder.d.ts +0 -1
  292. package/dist/utils/payload-config-finder.js +0 -2
  293. package/dist/utils/payload-config-modifier.d.ts +0 -1
  294. package/dist/utils/payload-config-modifier.js +0 -2
  295. package/dist/utils/payload-package-check.d.ts +0 -1
  296. package/dist/utils/payload-package-check.js +0 -2
  297. package/dist/utils/project.d.ts +0 -1
  298. package/dist/utils/project.js +0 -2
  299. package/dist/utils/resolve-environment.d.ts +0 -1
  300. package/dist/utils/resolve-environment.js +0 -2
  301. package/dist/utils/s3-upload.d.ts +0 -1
  302. package/dist/utils/s3-upload.js +0 -2
  303. package/dist/utils/token-display.d.ts +0 -1
  304. package/dist/utils/token-display.js +0 -2
  305. package/dist/utils/typescript-validator.d.ts +0 -1
  306. package/dist/utils/typescript-validator.js +0 -2
  307. package/dist/utils/version-check.d.ts +0 -1
  308. package/dist/utils/version-check.js +0 -2
  309. package/package.json +1 -1
@@ -96,5 +96,3 @@ export const getAuthorizeURL = async ({ collection, collectionOptions, endpointS
96
96
  'Path=/',
97
97
  'Max-Age=0'
98
98
  ].join('; ');
99
-
100
- //# sourceMappingURL=getAuthorizeURL.js.map
@@ -1,4 +1,3 @@
1
1
  type CookieExpires = Date | number | string | undefined;
2
2
  export declare const getCookieExpiration: (expires?: CookieExpires) => Date;
3
3
  export {};
4
- //# sourceMappingURL=getCookieExpiration.d.ts.map
@@ -7,5 +7,3 @@ export const getCookieExpiration = (expires)=>{
7
7
  currentTime.setSeconds(currentTime.getSeconds() + seconds);
8
8
  return currentTime;
9
9
  };
10
-
11
- //# sourceMappingURL=getCookieExpiration.js.map
@@ -1,2 +1 @@
1
1
  export declare function getSecondsFromTokenExp(futureUnixTimestamp: number): number;
2
- //# sourceMappingURL=getSecondsFromTokenExp.d.ts.map
@@ -3,5 +3,3 @@ export function getSecondsFromTokenExp(futureUnixTimestamp) {
3
3
  ;
4
4
  return futureUnixTimestamp - now;
5
5
  }
6
-
7
- //# sourceMappingURL=getSecondsFromTokenExp.js.map
@@ -3,4 +3,3 @@ export declare const getTokenExp: ({ debugLogger, token, }: {
3
3
  debugLogger: DebugLogger;
4
4
  token: string;
5
5
  }) => number | undefined;
6
- //# sourceMappingURL=getTokenExp.d.ts.map
@@ -16,5 +16,3 @@ export const getTokenExp = ({ debugLogger, token })=>{
16
16
  }
17
17
  return undefined;
18
18
  };
19
-
20
- //# sourceMappingURL=getTokenExp.js.map
@@ -6,4 +6,3 @@ interface Args {
6
6
  }
7
7
  export declare const getUsernameField: ({ collection, collectionOptions, }: Args) => EmailField | TextField;
8
8
  export {};
9
- //# sourceMappingURL=getUsernameField.d.ts.map
@@ -16,5 +16,3 @@ export const getUsernameField = ({ collection, collectionOptions })=>{
16
16
  }
17
17
  return collectionOptions.usernameField;
18
18
  };
19
-
20
- //# sourceMappingURL=getUsernameField.js.map
@@ -5,4 +5,3 @@ type User = Record<string, unknown>;
5
5
  */
6
6
  export declare const hasUserTokenPropsChanged: (user: User, token: Record<string, unknown>) => boolean;
7
7
  export {};
8
- //# sourceMappingURL=hasUserTokenPropsChanged.d.ts.map
@@ -21,5 +21,3 @@ function compareValues(userVal, tokenVal) {
21
21
  }
22
22
  return userVal !== tokenVal;
23
23
  }
24
-
25
- //# sourceMappingURL=hasUserTokenPropsChanged.js.map
@@ -1,2 +1 @@
1
1
  export declare const isAbsoluteURL: (url: string) => boolean;
2
- //# sourceMappingURL=isAbsoluteURL.d.ts.map
@@ -1,3 +1 @@
1
1
  export const isAbsoluteURL = (url)=>/^[a-z][a-z\d+.-]*:/.test(url);
2
-
3
- //# sourceMappingURL=isAbsoluteURL.js.map
@@ -4,4 +4,3 @@
4
4
  * Content API returns HTTP 409 with "conflict" or "already exists" in the message.
5
5
  */
6
6
  export declare function isDuplicateKeyError(error: unknown): boolean;
7
- //# sourceMappingURL=isDuplicateKeyError.d.ts.map
@@ -10,5 +10,3 @@
10
10
  const message = typeof err.message === 'string' ? err.message : '';
11
11
  return message.includes('409') || message.toLowerCase().includes('conflict') || message.toLowerCase().includes('already exists');
12
12
  }
13
-
14
- //# sourceMappingURL=isDuplicateKeyError.js.map
@@ -1,2 +1 @@
1
1
  export declare function mergeHeaders(sourceHeaders: Headers, destinationHeaders: Headers): void;
2
- //# sourceMappingURL=mergeHeaders.d.ts.map
@@ -33,5 +33,3 @@ export function mergeHeaders(sourceHeaders, destinationHeaders) {
33
33
  destinationHeaders.append(key, value);
34
34
  });
35
35
  }
36
-
37
- //# sourceMappingURL=mergeHeaders.js.map
@@ -13,4 +13,3 @@ type Result = {
13
13
  } | false;
14
14
  export declare const refreshTokens: ({ payload, refreshToken, strategy }: Args) => Promise<Result>;
15
15
  export {};
16
- //# sourceMappingURL=refreshTokens.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { generateCookie } from 'payload';
2
- import { getProjectToken } from '../../api/figma-api.js';
3
- import { validateProjectToken } from '../../auth/jwt-validator.js';
2
+ import { getPayloadAdminToken } from '../../api/figma-api.js';
3
+ import { validatePayloadAdminToken } from '../../auth/jwt-validator.js';
4
4
  import { getInfraEnvironment } from '../../constants.js';
5
5
  import { createCookieOptions } from './createCookieOptions.js';
6
6
  import { createDebugLogger } from './createDebugLogger.js';
@@ -16,15 +16,18 @@ export const refreshTokens = async ({ payload, refreshToken, strategy })=>{
16
16
  // but refresh token is still valid
17
17
  // so we will refresh both tokens
18
18
  try {
19
- // Get another project token
20
- const { expiresAt, token } = await getProjectToken({
19
+ // Get another Payload Admin token.
20
+ const environmentId = payload.config.custom.figma.environmentId;
21
+ if (!environmentId) {
22
+ throw new Error('Cannot refresh Payload Admin token: environmentId is not configured');
23
+ }
24
+ const { expiresAt, token } = await getPayloadAdminToken({
21
25
  type: 'oauth',
22
26
  token: refreshToken
23
- }, payload.config.custom.figma.contentSystemId);
27
+ }, environmentId);
24
28
  debugLogger.info({
25
29
  expiresAt,
26
- msg: 'Received new tokens from Figma API',
27
- token
30
+ msg: 'Received new Payload Admin token from Figma API'
28
31
  });
29
32
  // On error, no user
30
33
  if (!token) {
@@ -35,8 +38,7 @@ export const refreshTokens = async ({ payload, refreshToken, strategy })=>{
35
38
  }
36
39
  if (token) {
37
40
  debugLogger.info({
38
- msg: 'Successfully refreshed project token',
39
- token
41
+ msg: 'Successfully refreshed Payload Admin token'
40
42
  });
41
43
  const expires_in = new Date(expiresAt);
42
44
  const cookieOptions = createCookieOptions({
@@ -52,7 +54,11 @@ export const refreshTokens = async ({ payload, refreshToken, strategy })=>{
52
54
  value: token
53
55
  });
54
56
  headers.append('Set-Cookie', withPartitionedCookie(tokenCookie));
55
- const decodedOauthToken = await validateProjectToken(token, getInfraEnvironment());
57
+ const decodedOauthToken = await validatePayloadAdminToken({
58
+ audience: environmentId,
59
+ environment: getInfraEnvironment(),
60
+ token
61
+ });
56
62
  return {
57
63
  decodedOauthToken,
58
64
  headers,
@@ -67,5 +73,3 @@ export const refreshTokens = async ({ payload, refreshToken, strategy })=>{
67
73
  }
68
74
  return false;
69
75
  };
70
-
71
- //# sourceMappingURL=refreshTokens.js.map
@@ -17,4 +17,3 @@
17
17
  * future/hand-built `Secure=false` can't get `Partitioned` (which requires Secure).
18
18
  */
19
19
  export declare const withPartitionedCookie: (cookie: string) => string;
20
- //# sourceMappingURL=withPartitionedCookie.d.ts.map
@@ -24,5 +24,3 @@
24
24
  }
25
25
  return `${cookie}; Partitioned`;
26
26
  };
27
-
28
- //# sourceMappingURL=withPartitionedCookie.js.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Retrieves a single search-parameter value from the return type of
3
+ * `@payloadcms/ui`'s `useSearchParams` hook in a version-agnostic way.
4
+ *
5
+ * The hook's return shape changed between Payload v3 and v4:
6
+ *
7
+ * **v3** — returns a context object; params are accessed via `searchParams[key]` (`ParsedQs`):
8
+ * ```ts
9
+ * import { useSearchParams } from '@payloadcms/ui'
10
+ * const { searchParams } = useSearchParams()
11
+ * const value = searchParams['redirect'] // string | string[] | ParsedQs | …
12
+ * ```
13
+ *
14
+ * **v4** — returns a `URLSearchParams`-like object directly; params are accessed via `.get(key)`:
15
+ * ```ts
16
+ * import { useSearchParams } from '@payloadcms/ui'
17
+ * const searchParams = useSearchParams()
18
+ * const value = searchParams.get('redirect') // string | null
19
+ * ```
20
+ *
21
+ * Pass the raw hook return value here and it handles both shapes transparently.
22
+ *
23
+ * @param searchParamsHookResult - Raw return value of `useSearchParams()` from `@payloadcms/ui`.
24
+ * @param key - The query-string parameter name to read.
25
+ * @returns The first string value for `key`, or `undefined` if absent.
26
+ */
27
+ export declare const getSearchParam: (searchParamsHookResult: unknown, key: string) => string | undefined;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Retrieves a single search-parameter value from the return type of
3
+ * `@payloadcms/ui`'s `useSearchParams` hook in a version-agnostic way.
4
+ *
5
+ * The hook's return shape changed between Payload v3 and v4:
6
+ *
7
+ * **v3** — returns a context object; params are accessed via `searchParams[key]` (`ParsedQs`):
8
+ * ```ts
9
+ * import { useSearchParams } from '@payloadcms/ui'
10
+ * const { searchParams } = useSearchParams()
11
+ * const value = searchParams['redirect'] // string | string[] | ParsedQs | …
12
+ * ```
13
+ *
14
+ * **v4** — returns a `URLSearchParams`-like object directly; params are accessed via `.get(key)`:
15
+ * ```ts
16
+ * import { useSearchParams } from '@payloadcms/ui'
17
+ * const searchParams = useSearchParams()
18
+ * const value = searchParams.get('redirect') // string | null
19
+ * ```
20
+ *
21
+ * Pass the raw hook return value here and it handles both shapes transparently.
22
+ *
23
+ * @param searchParamsHookResult - Raw return value of `useSearchParams()` from `@payloadcms/ui`.
24
+ * @param key - The query-string parameter name to read.
25
+ * @returns The first string value for `key`, or `undefined` if absent.
26
+ */ export const getSearchParam = (searchParamsHookResult, key)=>{
27
+ // v4 / next/navigation: result is URLSearchParams-like, access via .get()
28
+ if (searchParamsHookResult && typeof searchParamsHookResult === 'object' && 'get' in searchParamsHookResult && typeof searchParamsHookResult.get === 'function') {
29
+ const value = searchParamsHookResult.get(key);
30
+ return typeof value === 'string' ? value : undefined;
31
+ }
32
+ // v3: result is { searchParams: ParsedQs; … }, access via .searchParams[key]
33
+ if (searchParamsHookResult && typeof searchParamsHookResult === 'object' && 'searchParams' in searchParamsHookResult) {
34
+ const legacySearchParams = searchParamsHookResult.searchParams;
35
+ const value = legacySearchParams?.[key];
36
+ if (typeof value === 'string') {
37
+ return value;
38
+ }
39
+ // ParsedQs may parse repeated params as an array — take the first entry
40
+ if (Array.isArray(value) && typeof value[0] === 'string') {
41
+ return value[0];
42
+ }
43
+ }
44
+ return undefined;
45
+ };
@@ -2,4 +2,3 @@ import type { DatabaseAdapterObj } from 'payload';
2
2
  export interface FigmaContentSystemOptions {
3
3
  }
4
4
  export declare function figmaContentSystem(options?: FigmaContentSystemOptions): DatabaseAdapterObj;
5
- //# sourceMappingURL=adapter.d.ts.map
@@ -135,5 +135,3 @@ export function figmaContentSystem(options = {}) {
135
135
  init: adapter
136
136
  };
137
137
  }
138
-
139
- //# sourceMappingURL=adapter.js.map
@@ -5,4 +5,3 @@ import type { TokenStore } from '../auth/token-store.js';
5
5
  * actionable instead of relying on per-request middleware errors.
6
6
  */
7
7
  export declare function logMissingCliAuth(tokenStore: TokenStore): void;
8
- //# sourceMappingURL=auth-preflight.d.ts.map
@@ -16,5 +16,3 @@ import pc from 'picocolors';
16
16
  ];
17
17
  p.note(lines.join('\n'), pc.yellow('Figma authentication required'));
18
18
  }
19
-
20
- //# sourceMappingURL=auth-preflight.js.map
@@ -20,4 +20,3 @@ export type MissingContentSystemIdReason = {
20
20
  * actionable step is visible above the stack trace.
21
21
  */
22
22
  export declare function logMissingContentSystemId(reason: MissingContentSystemIdReason): void;
23
- //# sourceMappingURL=bootstrap-preflight.d.ts.map
@@ -41,5 +41,3 @@ function buildBody(reason) {
41
41
  `Run ${initForceCmd} to reconfigure, or set FIGMA_ENVIRONMENT_NAME to a valid environment.`
42
42
  ];
43
43
  }
44
-
45
- //# sourceMappingURL=bootstrap-preflight.js.map
@@ -47,9 +47,9 @@ export type FigmaConfig = {
47
47
  } & {
48
48
  figma: {
49
49
  contentSystemId?: string;
50
+ environmentId?: string;
50
51
  storage?: boolean;
51
52
  useContentSystem?: boolean;
52
53
  };
53
54
  } & Omit<Config, 'db' | 'editor' | 'secret'> & Partial<Pick<Config, 'db'>>;
54
55
  export declare function buildFigmaConfig(config: FigmaConfig): Promise<SanitizedConfig>;
55
- //# sourceMappingURL=build-config.d.ts.map
@@ -51,6 +51,57 @@ import { getDevCookieNames } from './dev-cookie-names.js';
51
51
  readOnly: true
52
52
  },
53
53
  label: 'Profile Picture'
54
+ },
55
+ // Virtual (never persisted): populated per-request from the session JWT. The
56
+ // afterRead hook surfaces the claim on the requester's OWN user record only —
57
+ // a JWT describes its bearer, so these are meaningful for req.user, not for
58
+ // reads of other users. See defaults.ts (defaultVerify) which attaches the
59
+ // live claim to req.user.
60
+ {
61
+ name: 'userGroups',
62
+ type: 'text',
63
+ access: {
64
+ read: ({ id, req })=>req.user?.id === id
65
+ },
66
+ admin: {
67
+ readOnly: true
68
+ },
69
+ hasMany: true,
70
+ hooks: {
71
+ afterRead: [
72
+ ({ data, req })=>data?.id !== undefined && req.user?.id === data.id ? req.user.userGroups : undefined
73
+ ]
74
+ },
75
+ label: 'User Groups',
76
+ virtual: true
77
+ },
78
+ // KEEP_IN_SYNC(sinatra/controllers/api/api_payload_control_plane.rb) — resolve_make_permission
79
+ {
80
+ name: 'makePermission',
81
+ type: 'select',
82
+ access: {
83
+ read: ({ id, req })=>req.user?.id === id
84
+ },
85
+ admin: {
86
+ readOnly: true
87
+ },
88
+ hooks: {
89
+ afterRead: [
90
+ ({ data, req })=>data?.id !== undefined && req.user?.id === data.id ? req.user.makePermission : undefined
91
+ ]
92
+ },
93
+ label: 'Make Permission',
94
+ options: [
95
+ {
96
+ label: 'View',
97
+ value: 'view'
98
+ },
99
+ {
100
+ label: 'Edit',
101
+ value: 'edit'
102
+ }
103
+ ],
104
+ virtual: true
54
105
  }
55
106
  ];
56
107
  function missingOAuthCredential(name) {
@@ -176,6 +227,7 @@ export async function buildFigmaConfig(config) {
176
227
  const envConfig = getEnvConfig();
177
228
  // Resolve contentSystemId: config first, env var, then local store fallback (dev)
178
229
  let { contentSystemId } = config.figma;
230
+ let environmentId = config.figma.environmentId ?? process.env.FIGMA_EID;
179
231
  contentSystemId ??= process.env.FIGMA_CONTENT_API_CONTENT_SYSTEM_ID;
180
232
  let bootstrapData = null;
181
233
  let bootstrapReason = null;
@@ -202,9 +254,21 @@ export async function buildFigmaConfig(config) {
202
254
  }
203
255
  if (bootstrapData) {
204
256
  contentSystemId = bootstrapData.contentSystemId;
257
+ environmentId ??= bootstrapData.tenantInstanceId;
205
258
  }
206
259
  }
207
260
  }
261
+ if (!environmentId) {
262
+ const projectId = process.env.FIGMA_PROJECT_ID ?? getEnvVarSync(process.cwd(), 'FIGMA_PROJECT_ID');
263
+ const environmentName = process.env.FIGMA_ENVIRONMENT_NAME ?? getEnvVarSync(process.cwd(), 'FIGMA_ENVIRONMENT_NAME');
264
+ if (projectId && environmentName) {
265
+ bootstrapData ??= getTokenStore().getBootstrapData(projectId, environmentName);
266
+ environmentId = bootstrapData?.tenantInstanceId;
267
+ }
268
+ }
269
+ if (!environmentId) {
270
+ throw new Error('Environment ID could not be resolved. Set FIGMA_EID or initialize the project.');
271
+ }
208
272
  if (!contentSystemId) {
209
273
  logMissingContentSystemId(bootstrapReason ?? {
210
274
  kind: 'no-config'
@@ -273,7 +337,8 @@ export async function buildFigmaConfig(config) {
273
337
  custom: {
274
338
  figma: {
275
339
  ...config.figma,
276
- contentSystemId
340
+ contentSystemId,
341
+ environmentId
277
342
  }
278
343
  },
279
344
  db,
@@ -359,5 +424,3 @@ export async function buildFigmaConfig(config) {
359
424
  // Delegate to Payload's buildConfig
360
425
  return await payloadBuildConfig(configWithFigmaDefaults);
361
426
  }
362
-
363
- //# sourceMappingURL=build-config.js.map
@@ -11,4 +11,3 @@ export declare function getDevCookieNames(contentSystemId: string): {
11
11
  cookieName: string;
12
12
  userInfoCookieName: string;
13
13
  };
14
- //# sourceMappingURL=dev-cookie-names.d.ts.map
@@ -15,5 +15,3 @@ import { getEnvVarSync } from '../utils/env-management.js';
15
15
  userInfoCookieName: `figma-${suffix}-user-info`
16
16
  };
17
17
  }
18
-
19
- //# sourceMappingURL=dev-cookie-names.js.map
@@ -165,4 +165,3 @@ export type UploadPaths = {
165
165
  };
166
166
  };
167
167
  };
168
- //# sourceMappingURL=api-types.d.ts.map
@@ -2,5 +2,3 @@
2
2
  * Upload API types extracted from Content API OpenAPI spec.
3
3
  * These are kept separate to avoid breaking changes when the main spec is regenerated.
4
4
  */ export { };
5
-
6
- //# sourceMappingURL=api-types.js.map
@@ -6,4 +6,3 @@ export declare const ContentApiClientUploadHandler: ({ children, collectionSlug,
6
6
  prefix?: string;
7
7
  serverHandlerPath: `/${string}`;
8
8
  }) => import("react").JSX.Element;
9
- //# sourceMappingURL=ClientUploadHandler.d.ts.map
@@ -39,5 +39,3 @@ export const ContentApiClientUploadHandler = createClientUploadHandler({
39
39
  };
40
40
  }
41
41
  });
42
-
43
- //# sourceMappingURL=ClientUploadHandler.js.map
@@ -10,4 +10,3 @@ type Args = {
10
10
  };
11
11
  export declare const getGenerateSignedURLHandler: ({ access, client, }: Args) => PayloadHandler;
12
12
  export {};
13
- //# sourceMappingURL=generateSignedURL.d.ts.map
@@ -35,5 +35,3 @@ export const getGenerateSignedURLHandler = ({ access = defaultAccess, client })=
35
35
  });
36
36
  };
37
37
  };
38
-
39
- //# sourceMappingURL=generateSignedURL.js.map
@@ -3,4 +3,3 @@ import type { UploadPaths } from './api-types.js';
3
3
  import type { StorageClientConfig } from './types.js';
4
4
  export type StorageClient = ReturnType<typeof createClient<UploadPaths>>;
5
5
  export declare function createStorageClient(config: StorageClientConfig): StorageClient;
6
- //# sourceMappingURL=client.d.ts.map
@@ -35,5 +35,3 @@ function createStorageAuthMiddleware(config) {
35
35
  }
36
36
  };
37
37
  }
38
-
39
- //# sourceMappingURL=client.js.map
@@ -4,4 +4,3 @@ type Args = {
4
4
  };
5
5
  export declare const getGenerateURL: ({ baseUrl }: Args) => GenerateURL;
6
6
  export {};
7
- //# sourceMappingURL=generateURL.d.ts.map
@@ -4,5 +4,3 @@ export const getGenerateURL = ({ baseUrl })=>({ collection, filename, prefix = '
4
4
  const fileKey = path.posix.join(prefix, filename);
5
5
  return `${baseUrl}/api/v0/uploads/download/${collectionId}/${encodeURIComponent(fileKey)}`;
6
6
  };
7
-
8
- //# sourceMappingURL=generateURL.js.map
@@ -5,4 +5,3 @@ type Args = {
5
5
  };
6
6
  export declare const getHandleDelete: ({ client }: Args) => HandleDelete;
7
7
  export {};
8
- //# sourceMappingURL=handleDelete.d.ts.map
@@ -13,5 +13,3 @@ export const getHandleDelete = ({ client })=>{
13
13
  });
14
14
  };
15
15
  };
16
-
17
- //# sourceMappingURL=handleDelete.js.map
@@ -8,4 +8,3 @@ type Args = {
8
8
  };
9
9
  export declare const getHandleUpload: ({ client, collection, prefix }: Args) => HandleUpload;
10
10
  export {};
11
- //# sourceMappingURL=handleUpload.d.ts.map
@@ -140,5 +140,3 @@ async function uploadMultipart({ client, collectionId, fileData, fileKey, mimeTy
140
140
  throw error;
141
141
  }
142
142
  }
143
-
144
- //# sourceMappingURL=handleUpload.js.map
@@ -2,4 +2,3 @@ import type { Adapter } from '@payloadcms/plugin-cloud-storage/types';
2
2
  import type { StorageClientConfig } from './types.js';
3
3
  export type { StorageClientConfig } from './types.js';
4
4
  export declare function contentApiStorageAdapter(config: StorageClientConfig): Adapter;
5
- //# sourceMappingURL=index.d.ts.map
@@ -27,5 +27,3 @@ export function contentApiStorageAdapter(config) {
27
27
  };
28
28
  };
29
29
  }
30
-
31
- //# sourceMappingURL=index.js.map
@@ -7,4 +7,3 @@ type Args = {
7
7
  };
8
8
  export declare const getHandler: ({ client, collection }: Args) => StaticHandler;
9
9
  export {};
10
- //# sourceMappingURL=staticHandler.d.ts.map
@@ -59,5 +59,3 @@ export const getHandler = ({ client, collection })=>{
59
59
  }
60
60
  };
61
61
  };
62
-
63
- //# sourceMappingURL=staticHandler.js.map
@@ -7,4 +7,3 @@ export type StorageClientConfig = {
7
7
  baseUrl: string;
8
8
  contentApiKey: string;
9
9
  };
10
- //# sourceMappingURL=types.d.ts.map
@@ -1,3 +1 @@
1
1
  export { };
2
-
3
- //# sourceMappingURL=types.js.map
@@ -9,4 +9,3 @@ export declare function getSafeFilename({ collectionSlug, desiredFilename, prefi
9
9
  prefix?: string;
10
10
  req: PayloadRequest;
11
11
  }): Promise<string>;
12
- //# sourceMappingURL=getSafeFilename.d.ts.map
@@ -57,5 +57,3 @@ import sanitize from 'sanitize-filename';
57
57
  }
58
58
  return modifiedFilename;
59
59
  }
60
-
61
- //# sourceMappingURL=getSafeFilename.js.map
@@ -1,3 +1,2 @@
1
1
  export { getSafeFilename } from './getSafeFilename.js';
2
2
  export { type ContentApiClientUploadContext, parseClientUploadContext, } from './parseClientUploadContext.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,2 @@
1
1
  export { getSafeFilename } from './getSafeFilename.js';
2
2
  export { parseClientUploadContext } from './parseClientUploadContext.js';
3
-
4
- //# sourceMappingURL=index.js.map
@@ -16,4 +16,3 @@ export type ContentApiClientUploadContext = {
16
16
  * an empty object for any non-object input.
17
17
  */
18
18
  export declare const parseClientUploadContext: (context: unknown) => ContentApiClientUploadContext;
19
- //# sourceMappingURL=parseClientUploadContext.d.ts.map
@@ -26,5 +26,3 @@
26
26
  }
27
27
  return result;
28
28
  };
29
-
30
- //# sourceMappingURL=parseClientUploadContext.js.map
@@ -32,4 +32,3 @@ export interface ProjectInfo {
32
32
  /** Payload version if installed */
33
33
  payloadVersion?: string;
34
34
  }
35
- //# sourceMappingURL=config.d.ts.map
@@ -3,5 +3,3 @@
3
3
  */ /**
4
4
  * Project information from detection
5
5
  */ export { };
6
-
7
- //# sourceMappingURL=config.js.map
package/dist/types.d.ts CHANGED
@@ -66,4 +66,3 @@ export type NextAppDetails = {
66
66
  export type NextConfigType = 'cjs' | 'esm' | 'ts';
67
67
  export type StorageAdapterType = 'localDisk' | 'r2Storage' | 'vercelBlobStorage';
68
68
  export {};
69
- //# sourceMappingURL=types.d.ts.map
package/dist/types.js CHANGED
@@ -1,3 +1 @@
1
1
  export { };
2
-
3
- //# sourceMappingURL=types.js.map
@@ -6,4 +6,3 @@ export declare class NextjsAdapter implements DeployAdapter {
6
6
  prepareLambdaBundle(projectPath: string): Promise<LambdaBundle>;
7
7
  }
8
8
  export declare const nextjsAdapter: NextjsAdapter;
9
- //# sourceMappingURL=nextjs.d.ts.map