@payloadcms/figma 0.0.1-alpha.7 → 0.0.1-alpha.71

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 (390) hide show
  1. package/dist/api/control-plane.d.ts +56 -6
  2. package/dist/api/control-plane.js +181 -72
  3. package/dist/api/figma-api.d.ts +22 -1
  4. package/dist/api/figma-api.js +78 -25
  5. package/dist/auth/callback-server.d.ts +19 -7
  6. package/dist/auth/callback-server.js +72 -30
  7. package/dist/auth/credentials.d.ts +21 -0
  8. package/dist/auth/credentials.js +21 -0
  9. package/dist/auth/crypto-utils.d.ts +28 -0
  10. package/dist/auth/crypto-utils.js +132 -21
  11. package/dist/auth/jwt-validator.d.ts +2 -1
  12. package/dist/auth/jwt-validator.js +2 -2
  13. package/dist/auth/oauth-flow.d.ts +19 -3
  14. package/dist/auth/oauth-flow.js +77 -22
  15. package/dist/auth/project-token.d.ts +32 -16
  16. package/dist/auth/project-token.js +171 -65
  17. package/dist/auth/refresh.d.ts +2 -1
  18. package/dist/auth/refresh.js +25 -12
  19. package/dist/auth/token-store-migration.d.ts +58 -0
  20. package/dist/auth/token-store-migration.js +156 -0
  21. package/dist/auth/token-store.d.ts +63 -97
  22. package/dist/auth/token-store.js +405 -122
  23. package/dist/auth/types.d.ts +35 -4
  24. package/dist/cli.js +93 -6
  25. package/dist/commands/bootstrap.d.ts +18 -0
  26. package/dist/commands/bootstrap.js +90 -0
  27. package/dist/commands/build-lambda-zip.d.ts +5 -0
  28. package/dist/commands/build-lambda-zip.js +19 -0
  29. package/dist/commands/debug.d.ts +8 -0
  30. package/dist/commands/debug.js +180 -0
  31. package/dist/commands/deploy.d.ts +9 -0
  32. package/dist/commands/deploy.js +180 -151
  33. package/dist/commands/dump-tokens.d.ts +12 -0
  34. package/dist/commands/dump-tokens.js +69 -0
  35. package/dist/commands/env.d.ts +13 -0
  36. package/dist/commands/env.js +88 -0
  37. package/dist/commands/init.d.ts +9 -5
  38. package/dist/commands/init.js +241 -148
  39. package/dist/commands/list-tokens.d.ts +3 -3
  40. package/dist/commands/list-tokens.js +24 -9
  41. package/dist/commands/login.d.ts +8 -1
  42. package/dist/commands/login.js +34 -16
  43. package/dist/commands/logout.d.ts +5 -4
  44. package/dist/commands/logout.js +77 -15
  45. package/dist/commands/upgrade.d.ts +5 -0
  46. package/dist/commands/upgrade.js +331 -0
  47. package/dist/config/oauth.d.ts +17 -11
  48. package/dist/config/oauth.js +38 -37
  49. package/dist/constants.d.ts +63 -18
  50. package/dist/constants.js +158 -18
  51. package/dist/db-content-api/generated/content-api-types.d.ts +3978 -0
  52. package/dist/db-content-api/generated/content-api-types.js +7 -0
  53. package/dist/db-content-api/index.d.ts +37 -0
  54. package/dist/db-content-api/index.js +923 -0
  55. package/dist/db-content-api/temp-utilities/slug.d.ts +2 -0
  56. package/dist/db-content-api/temp-utilities/slug.js +3 -0
  57. package/dist/db-content-api/temp-utilities/sorting.d.ts +3 -0
  58. package/dist/db-content-api/temp-utilities/sorting.js +39 -0
  59. package/dist/db-content-api/temp-utilities/types.d.ts +22 -0
  60. package/dist/db-content-api/temp-utilities/types.js +15 -0
  61. package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts +39 -0
  62. package/dist/db-content-api/temp-utilities/unwrapDocument.js +64 -0
  63. package/dist/db-content-api/utilities/auth.d.ts +30 -0
  64. package/dist/db-content-api/utilities/auth.js +84 -0
  65. package/dist/db-content-api/utilities/data/applyDefaults.d.ts +7 -0
  66. package/dist/db-content-api/utilities/data/applyDefaults.js +75 -0
  67. package/dist/db-content-api/utilities/data/castFieldValue.d.ts +11 -0
  68. package/dist/db-content-api/utilities/data/castFieldValue.js +68 -0
  69. package/dist/db-content-api/utilities/data/index.d.ts +49 -0
  70. package/dist/db-content-api/utilities/data/index.js +301 -0
  71. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +12 -0
  72. package/dist/db-content-api/utilities/data/removeVirtualFields.js +54 -0
  73. package/dist/db-content-api/utilities/data/stripFields.d.ts +48 -0
  74. package/dist/db-content-api/utilities/data/stripFields.js +195 -0
  75. package/dist/db-content-api/utilities/data/transformPublishedLocale.d.ts +23 -0
  76. package/dist/db-content-api/utilities/data/transformPublishedLocale.js +42 -0
  77. package/dist/db-content-api/utilities/data/validateRelationships.d.ts +7 -0
  78. package/dist/db-content-api/utilities/data/validateRelationships.js +102 -0
  79. package/dist/db-content-api/utilities/joins.d.ts +53 -0
  80. package/dist/db-content-api/utilities/joins.js +139 -0
  81. package/dist/db-content-api/utilities/locale/index.d.ts +10 -0
  82. package/dist/db-content-api/utilities/locale/index.js +21 -0
  83. package/dist/db-content-api/utilities/meta/buildLocalizedPaths.d.ts +11 -0
  84. package/dist/db-content-api/utilities/meta/buildLocalizedPaths.js +74 -0
  85. package/dist/db-content-api/utilities/meta/buildMeta.d.ts +42 -0
  86. package/dist/db-content-api/utilities/meta/buildMeta.js +41 -0
  87. package/dist/db-content-api/utilities/meta/buildPathTypes.d.ts +17 -0
  88. package/dist/db-content-api/utilities/meta/buildPathTypes.js +244 -0
  89. package/dist/db-content-api/utilities/meta/buildUniquePaths.d.ts +13 -0
  90. package/dist/db-content-api/utilities/meta/buildUniquePaths.js +62 -0
  91. package/dist/db-content-api/utilities/meta/normalizeLocaleInWhere.d.ts +10 -0
  92. package/dist/db-content-api/utilities/meta/normalizeLocaleInWhere.js +102 -0
  93. package/dist/db-content-api/utilities/where.d.ts +20 -0
  94. package/dist/db-content-api/utilities/where.js +108 -0
  95. package/dist/deploy/schedule-extract-plugin.d.ts +11 -0
  96. package/dist/deploy/schedule-extract-plugin.js +34 -0
  97. package/dist/endpoints/health.d.ts +3 -0
  98. package/dist/endpoints/health.js +11 -0
  99. package/dist/endpoints/schema.d.ts +3 -0
  100. package/dist/endpoints/schema.js +29 -0
  101. package/dist/exports/client.d.ts +3 -0
  102. package/dist/exports/client.js +3 -0
  103. package/dist/index.d.ts +2 -1
  104. package/dist/index.js +3 -1
  105. package/dist/lib/download-skill.d.ts +13 -0
  106. package/dist/lib/download-skill.js +79 -0
  107. package/dist/oauth/components/FigmaAvatar/index.d.ts +4 -0
  108. package/dist/oauth/components/FigmaAvatar/index.js +27 -0
  109. package/dist/oauth/components/FigmaAvatar/index.scss +12 -0
  110. package/dist/oauth/components/FigmaAvatarCell/index.d.ts +5 -0
  111. package/dist/oauth/components/FigmaAvatarCell/index.js +25 -0
  112. package/dist/oauth/components/FigmaAvatarCell/index.scss +5 -0
  113. package/dist/oauth/components/FigmaAvatarPlaceholder/index.d.ts +9 -0
  114. package/dist/oauth/components/FigmaAvatarPlaceholder/index.js +37 -0
  115. package/dist/oauth/components/FigmaAvatarPlaceholder/index.scss +28 -0
  116. package/dist/oauth/components/LoginButton/iframeAutoLogin.d.ts +82 -0
  117. package/dist/oauth/components/LoginButton/iframeAutoLogin.js +170 -0
  118. package/dist/oauth/components/LoginButton/index.js +150 -12
  119. package/dist/oauth/components/LoginButton/index.scss +75 -3
  120. package/dist/oauth/components/LogoutButton/index.js +20 -7
  121. package/dist/oauth/defaults.d.ts +3 -1
  122. package/dist/oauth/defaults.js +68 -10
  123. package/dist/oauth/endpoints/getLoginEndpoint.js +72 -77
  124. package/dist/oauth/endpoints/getLogoutEndpoint.js +7 -4
  125. package/dist/oauth/endpoints/getMetaEndpoint.js +18 -3
  126. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.js +11 -2
  127. package/dist/oauth/index.js +27 -5
  128. package/dist/oauth/strategy/index.d.ts +0 -2
  129. package/dist/oauth/strategy/index.js +40 -17
  130. package/dist/oauth/types.d.ts +23 -6
  131. package/dist/oauth/utilities/establishSession.d.ts +23 -0
  132. package/dist/oauth/utilities/establishSession.js +82 -0
  133. package/dist/oauth/utilities/exchangeCodeForAccessToken.d.ts +24 -0
  134. package/dist/oauth/utilities/exchangeCodeForAccessToken.js +28 -0
  135. package/dist/oauth/utilities/figmaHostnames.d.ts +3 -0
  136. package/dist/oauth/utilities/figmaHostnames.js +26 -0
  137. package/dist/oauth/utilities/getAuthorizeURL.d.ts +65 -1
  138. package/dist/oauth/utilities/getAuthorizeURL.js +57 -2
  139. package/dist/oauth/utilities/isAbsoluteURL.d.ts +2 -0
  140. package/dist/oauth/utilities/isAbsoluteURL.js +3 -0
  141. package/dist/oauth/utilities/isDuplicateKeyError.d.ts +7 -0
  142. package/dist/oauth/utilities/isDuplicateKeyError.js +14 -0
  143. package/dist/oauth/utilities/refreshTokens.js +6 -3
  144. package/dist/plugin/auth-preflight.d.ts +8 -0
  145. package/dist/plugin/auth-preflight.js +20 -0
  146. package/dist/plugin/bootstrap-preflight.d.ts +23 -0
  147. package/dist/plugin/bootstrap-preflight.js +45 -0
  148. package/dist/plugin/build-config.d.ts +27 -15
  149. package/dist/plugin/build-config.js +327 -17
  150. package/dist/plugin/dev-cookie-names.d.ts +14 -0
  151. package/dist/plugin/dev-cookie-names.js +19 -0
  152. package/dist/storage-content-api/api-types.d.ts +168 -0
  153. package/dist/storage-content-api/api-types.js +6 -0
  154. package/dist/storage-content-api/client-uploads/ClientUploadHandler.d.ts +9 -0
  155. package/dist/storage-content-api/client-uploads/ClientUploadHandler.js +43 -0
  156. package/dist/storage-content-api/client-uploads/generateSignedURL.d.ts +13 -0
  157. package/dist/storage-content-api/client-uploads/generateSignedURL.js +39 -0
  158. package/dist/storage-content-api/client.d.ts +6 -0
  159. package/dist/storage-content-api/client.js +39 -0
  160. package/dist/storage-content-api/generateURL.d.ts +7 -0
  161. package/dist/storage-content-api/generateURL.js +8 -0
  162. package/dist/storage-content-api/handleDelete.d.ts +8 -0
  163. package/dist/storage-content-api/handleDelete.js +17 -0
  164. package/dist/storage-content-api/handleUpload.d.ts +11 -0
  165. package/dist/storage-content-api/handleUpload.js +144 -0
  166. package/dist/storage-content-api/index.d.ts +5 -0
  167. package/dist/storage-content-api/index.js +31 -0
  168. package/dist/storage-content-api/staticHandler.d.ts +10 -0
  169. package/dist/storage-content-api/staticHandler.js +63 -0
  170. package/dist/storage-content-api/types.d.ts +10 -0
  171. package/dist/storage-content-api/types.js +3 -0
  172. package/dist/storage-content-api/utilities/getSafeFilename.d.ts +12 -0
  173. package/dist/storage-content-api/utilities/getSafeFilename.js +61 -0
  174. package/dist/storage-content-api/utilities/index.d.ts +3 -0
  175. package/dist/storage-content-api/utilities/index.js +4 -0
  176. package/dist/storage-content-api/utilities/parseClientUploadContext.d.ts +19 -0
  177. package/dist/storage-content-api/utilities/parseClientUploadContext.js +30 -0
  178. package/dist/templates/.env.example +5 -0
  179. package/dist/templates/README.md +19 -0
  180. package/dist/types/config.d.ts +2 -1
  181. package/dist/types/config.js +0 -2
  182. package/dist/types.d.ts +10 -1
  183. package/dist/utils/adapters/nextjs.d.ts +9 -0
  184. package/dist/utils/adapters/nextjs.js +64 -0
  185. package/dist/utils/adapters/nitro.d.ts +9 -0
  186. package/dist/utils/adapters/nitro.js +169 -0
  187. package/dist/utils/adapters/vite.d.ts +10 -0
  188. package/dist/utils/adapters/vite.js +33 -0
  189. package/dist/utils/asset-collection.d.ts +27 -6
  190. package/dist/utils/asset-collection.js +59 -30
  191. package/dist/utils/build-detection.d.ts +5 -11
  192. package/dist/utils/build-detection.js +74 -11
  193. package/dist/utils/build-lambda-zip.d.ts +16 -0
  194. package/dist/utils/build-lambda-zip.js +78 -0
  195. package/dist/utils/cache-bootstrap.d.ts +8 -0
  196. package/dist/utils/cache-bootstrap.js +18 -0
  197. package/dist/utils/config.js +1 -1
  198. package/dist/utils/deploy-adapter.d.ts +40 -0
  199. package/dist/utils/deploy-adapter.js +58 -0
  200. package/dist/utils/download-template.d.ts +9 -1
  201. package/dist/utils/download-template.js +24 -18
  202. package/dist/utils/env-management.d.ts +24 -7
  203. package/dist/utils/env-management.js +119 -64
  204. package/dist/utils/format-env-suffix.d.ts +12 -0
  205. package/dist/utils/format-env-suffix.js +13 -0
  206. package/dist/utils/formatter.js +23 -11
  207. package/dist/utils/fs-utils.d.ts +6 -0
  208. package/dist/utils/fs-utils.js +27 -0
  209. package/dist/utils/handle-upgrade.d.ts +9 -0
  210. package/dist/utils/handle-upgrade.js +41 -0
  211. package/dist/utils/lambda-config.d.ts +3 -1
  212. package/dist/utils/lambda-config.js +75 -78
  213. package/dist/utils/messages.d.ts +1 -2
  214. package/dist/utils/messages.js +39 -11
  215. package/dist/utils/package-manager.d.ts +24 -0
  216. package/dist/utils/package-manager.js +53 -0
  217. package/dist/utils/parse-template-spec.d.ts +12 -0
  218. package/dist/utils/parse-template-spec.js +62 -0
  219. package/dist/utils/payload-config-ast.d.ts +27 -6
  220. package/dist/utils/payload-config-ast.js +106 -58
  221. package/dist/utils/payload-config-finder.d.ts +2 -2
  222. package/dist/utils/payload-config-finder.js +48 -9
  223. package/dist/utils/payload-config-modifier.d.ts +1 -1
  224. package/dist/utils/payload-config-modifier.js +114 -66
  225. package/dist/utils/payload-package-check.d.ts +33 -2
  226. package/dist/utils/payload-package-check.js +129 -28
  227. package/dist/utils/project.d.ts +7 -2
  228. package/dist/utils/project.js +60 -32
  229. package/dist/utils/resolve-environment.d.ts +14 -0
  230. package/dist/utils/resolve-environment.js +31 -0
  231. package/dist/utils/s3-upload.d.ts +7 -2
  232. package/dist/utils/s3-upload.js +39 -6
  233. package/dist/utils/token-display.d.ts +5 -1
  234. package/dist/utils/token-display.js +49 -22
  235. package/dist/utils/typescript-validator.js +4 -6
  236. package/dist/utils/version-check.d.ts +3 -0
  237. package/dist/utils/version-check.js +38 -0
  238. package/package.json +44 -15
  239. package/dist/api/control-plane.d.ts.map +0 -1
  240. package/dist/api/control-plane.js.map +0 -1
  241. package/dist/api/figma-api.d.ts.map +0 -1
  242. package/dist/api/figma-api.js.map +0 -1
  243. package/dist/auth/browser.d.ts.map +0 -1
  244. package/dist/auth/browser.js.map +0 -1
  245. package/dist/auth/callback-server.d.ts.map +0 -1
  246. package/dist/auth/callback-server.js.map +0 -1
  247. package/dist/auth/crypto-utils.d.ts.map +0 -1
  248. package/dist/auth/crypto-utils.js.map +0 -1
  249. package/dist/auth/jwt-validator.d.ts.map +0 -1
  250. package/dist/auth/jwt-validator.js.map +0 -1
  251. package/dist/auth/oauth-flow.d.ts.map +0 -1
  252. package/dist/auth/oauth-flow.js.map +0 -1
  253. package/dist/auth/pkce.d.ts.map +0 -1
  254. package/dist/auth/pkce.js.map +0 -1
  255. package/dist/auth/project-token.d.ts.map +0 -1
  256. package/dist/auth/project-token.js.map +0 -1
  257. package/dist/auth/refresh.d.ts.map +0 -1
  258. package/dist/auth/refresh.js.map +0 -1
  259. package/dist/auth/token-store.d.ts.map +0 -1
  260. package/dist/auth/token-store.js.map +0 -1
  261. package/dist/auth/types.d.ts.map +0 -1
  262. package/dist/auth/types.js.map +0 -1
  263. package/dist/cli.d.ts.map +0 -1
  264. package/dist/cli.js.map +0 -1
  265. package/dist/commands/deploy.d.ts.map +0 -1
  266. package/dist/commands/deploy.js.map +0 -1
  267. package/dist/commands/init.d.ts.map +0 -1
  268. package/dist/commands/init.js.map +0 -1
  269. package/dist/commands/list-tokens.d.ts.map +0 -1
  270. package/dist/commands/list-tokens.js.map +0 -1
  271. package/dist/commands/login.d.ts.map +0 -1
  272. package/dist/commands/login.js.map +0 -1
  273. package/dist/commands/logout.d.ts.map +0 -1
  274. package/dist/commands/logout.js.map +0 -1
  275. package/dist/config/oauth.d.ts.map +0 -1
  276. package/dist/config/oauth.js.map +0 -1
  277. package/dist/constants.d.ts.map +0 -1
  278. package/dist/constants.js.map +0 -1
  279. package/dist/exports/client.d.ts.map +0 -1
  280. package/dist/exports/client.js.map +0 -1
  281. package/dist/index.d.ts.map +0 -1
  282. package/dist/index.js.map +0 -1
  283. package/dist/oauth/components/LoginButton/index.d.ts.map +0 -1
  284. package/dist/oauth/components/LoginButton/index.js.map +0 -1
  285. package/dist/oauth/components/LogoutButton/index.d.ts.map +0 -1
  286. package/dist/oauth/components/LogoutButton/index.js.map +0 -1
  287. package/dist/oauth/defaults.d.ts.map +0 -1
  288. package/dist/oauth/defaults.js.map +0 -1
  289. package/dist/oauth/endpoints/getLoginEndpoint.d.ts.map +0 -1
  290. package/dist/oauth/endpoints/getLoginEndpoint.js.map +0 -1
  291. package/dist/oauth/endpoints/getLogoutEndpoint.d.ts.map +0 -1
  292. package/dist/oauth/endpoints/getLogoutEndpoint.js.map +0 -1
  293. package/dist/oauth/endpoints/getMetaEndpoint.d.ts.map +0 -1
  294. package/dist/oauth/endpoints/getMetaEndpoint.js.map +0 -1
  295. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.d.ts.map +0 -1
  296. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.js.map +0 -1
  297. package/dist/oauth/exports/client.d.ts.map +0 -1
  298. package/dist/oauth/exports/client.js.map +0 -1
  299. package/dist/oauth/hooks/afterLogout.d.ts.map +0 -1
  300. package/dist/oauth/hooks/afterLogout.js.map +0 -1
  301. package/dist/oauth/hooks/me.d.ts.map +0 -1
  302. package/dist/oauth/hooks/me.js.map +0 -1
  303. package/dist/oauth/hooks/refresh.d.ts.map +0 -1
  304. package/dist/oauth/hooks/refresh.js.map +0 -1
  305. package/dist/oauth/index.d.ts.map +0 -1
  306. package/dist/oauth/index.js.map +0 -1
  307. package/dist/oauth/strategy/index.d.ts.map +0 -1
  308. package/dist/oauth/strategy/index.js.map +0 -1
  309. package/dist/oauth/types.d.ts.map +0 -1
  310. package/dist/oauth/types.js.map +0 -1
  311. package/dist/oauth/utilities/clearCookie.d.ts.map +0 -1
  312. package/dist/oauth/utilities/clearCookie.js.map +0 -1
  313. package/dist/oauth/utilities/createCookieOptions.d.ts.map +0 -1
  314. package/dist/oauth/utilities/createCookieOptions.js.map +0 -1
  315. package/dist/oauth/utilities/createDebugLogger.d.ts.map +0 -1
  316. package/dist/oauth/utilities/createDebugLogger.js.map +0 -1
  317. package/dist/oauth/utilities/extractOrigin.d.ts.map +0 -1
  318. package/dist/oauth/utilities/extractOrigin.js.map +0 -1
  319. package/dist/oauth/utilities/getAdminCollectionSlug.d.ts.map +0 -1
  320. package/dist/oauth/utilities/getAdminCollectionSlug.js.map +0 -1
  321. package/dist/oauth/utilities/getAdminPath.d.ts +0 -8
  322. package/dist/oauth/utilities/getAdminPath.d.ts.map +0 -1
  323. package/dist/oauth/utilities/getAdminPath.js +0 -9
  324. package/dist/oauth/utilities/getAdminPath.js.map +0 -1
  325. package/dist/oauth/utilities/getAuthorizeURL.d.ts.map +0 -1
  326. package/dist/oauth/utilities/getAuthorizeURL.js.map +0 -1
  327. package/dist/oauth/utilities/getCookieExpiration.d.ts.map +0 -1
  328. package/dist/oauth/utilities/getCookieExpiration.js.map +0 -1
  329. package/dist/oauth/utilities/getSecondsFromTokenExp.d.ts.map +0 -1
  330. package/dist/oauth/utilities/getSecondsFromTokenExp.js.map +0 -1
  331. package/dist/oauth/utilities/getTokenExp.d.ts.map +0 -1
  332. package/dist/oauth/utilities/getTokenExp.js.map +0 -1
  333. package/dist/oauth/utilities/getUsernameField.d.ts.map +0 -1
  334. package/dist/oauth/utilities/getUsernameField.js.map +0 -1
  335. package/dist/oauth/utilities/hasUserTokenPropsChanged.d.ts.map +0 -1
  336. package/dist/oauth/utilities/hasUserTokenPropsChanged.js.map +0 -1
  337. package/dist/oauth/utilities/mergeHeaders.d.ts.map +0 -1
  338. package/dist/oauth/utilities/mergeHeaders.js.map +0 -1
  339. package/dist/oauth/utilities/refreshTokens.d.ts.map +0 -1
  340. package/dist/oauth/utilities/refreshTokens.js.map +0 -1
  341. package/dist/plugin/adapter.d.ts.map +0 -1
  342. package/dist/plugin/adapter.js.map +0 -1
  343. package/dist/plugin/build-config.d.ts.map +0 -1
  344. package/dist/plugin/build-config.js.map +0 -1
  345. package/dist/types/config.d.ts.map +0 -1
  346. package/dist/types/config.js.map +0 -1
  347. package/dist/types.d.ts.map +0 -1
  348. package/dist/types.js.map +0 -1
  349. package/dist/utils/asset-collection.d.ts.map +0 -1
  350. package/dist/utils/asset-collection.js.map +0 -1
  351. package/dist/utils/build-detection.d.ts.map +0 -1
  352. package/dist/utils/build-detection.js.map +0 -1
  353. package/dist/utils/config.d.ts.map +0 -1
  354. package/dist/utils/config.js.map +0 -1
  355. package/dist/utils/download-template.d.ts.map +0 -1
  356. package/dist/utils/download-template.js.map +0 -1
  357. package/dist/utils/env-management.d.ts.map +0 -1
  358. package/dist/utils/env-management.js.map +0 -1
  359. package/dist/utils/format.d.ts.map +0 -1
  360. package/dist/utils/format.js.map +0 -1
  361. package/dist/utils/formatter.d.ts.map +0 -1
  362. package/dist/utils/formatter.js.map +0 -1
  363. package/dist/utils/git.d.ts.map +0 -1
  364. package/dist/utils/git.js.map +0 -1
  365. package/dist/utils/is-debug.d.ts.map +0 -1
  366. package/dist/utils/is-debug.js.map +0 -1
  367. package/dist/utils/lambda-config.d.ts.map +0 -1
  368. package/dist/utils/lambda-config.js.map +0 -1
  369. package/dist/utils/log.d.ts.map +0 -1
  370. package/dist/utils/log.js.map +0 -1
  371. package/dist/utils/messages.d.ts.map +0 -1
  372. package/dist/utils/messages.js.map +0 -1
  373. package/dist/utils/package-manager.d.ts.map +0 -1
  374. package/dist/utils/package-manager.js.map +0 -1
  375. package/dist/utils/payload-config-ast.d.ts.map +0 -1
  376. package/dist/utils/payload-config-ast.js.map +0 -1
  377. package/dist/utils/payload-config-finder.d.ts.map +0 -1
  378. package/dist/utils/payload-config-finder.js.map +0 -1
  379. package/dist/utils/payload-config-modifier.d.ts.map +0 -1
  380. package/dist/utils/payload-config-modifier.js.map +0 -1
  381. package/dist/utils/payload-package-check.d.ts.map +0 -1
  382. package/dist/utils/payload-package-check.js.map +0 -1
  383. package/dist/utils/project.d.ts.map +0 -1
  384. package/dist/utils/project.js.map +0 -1
  385. package/dist/utils/s3-upload.d.ts.map +0 -1
  386. package/dist/utils/s3-upload.js.map +0 -1
  387. package/dist/utils/token-display.d.ts.map +0 -1
  388. package/dist/utils/token-display.js.map +0 -1
  389. package/dist/utils/typescript-validator.d.ts.map +0 -1
  390. package/dist/utils/typescript-validator.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../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AM,CAAA;KAC1B,CAAA;IACD,mBAAmB,CAAC,EAAE,IAAI,CAAA;IAE1B,WAAW,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,cAAc,CAAA;gBAEV,OAAO,EAAE,OAAO;IAiBtB,YAAY,CAAC,EACjB,aAAa,EACb,OAAO,EACP,OAAO,GACR,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAyJnD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAe3B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAkD1B,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA6C1D,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC;CAmB3F;AAED,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/strategy/index.ts"],"sourcesContent":["import type jwt from 'jsonwebtoken'\n/* eslint-disable @typescript-eslint/restrict-template-expressions */\nimport type {\n AuthStrategyFunctionArgs,\n AuthStrategyResult,\n CollectionConfig,\n Payload,\n} from 'payload'\n\nimport * as jose from 'jose'\nimport { APIError, parseCookies } from 'payload'\n\nimport type { CollectionOptions, PluginOptions, VerifyFunction } from '../types.js'\n\nimport { JWTValidationError, validateProjectToken } from '../../auth/jwt-validator.js'\nimport { ProjectTokenError } from '../../auth/project-token.js'\nimport { getEnvironment } from '../../constants.js'\nimport { createDebugLogger } from '../utilities/createDebugLogger.js'\nimport { getTokenExp } from '../utilities/getTokenExp.js'\nimport { mergeHeaders } from '../utilities/mergeHeaders.js'\nimport { refreshTokens } from '../utilities/refreshTokens.js'\n\nexport interface Options {\n clientID: string\n clientSecret?: string\n collection: CollectionConfig\n collectionOptions: CollectionOptions\n cookieName: string\n debug?: boolean\n identityMetadata: string\n pluginOptions: PluginOptions\n strategyName: string\n verify: VerifyFunction\n}\n\nexport class Strategy {\n clientID: string\n clientSecret?: string\n collection: CollectionConfig\n collectionOptions: CollectionOptions\n cookieName: string\n\n debug: boolean\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n debugLog: (...args: any[]) => void\n\n identityMetadataURL: string\n jwks?: {\n keys: jose.JWK[]\n }\n meta?: {\n authorization_endpoint: string\n end_session_endpoint: string\n jwks_uri: string\n token_endpoint: string\n userinfo_endpoint: string\n }\n metaLastFetchedTime?: Date\n\n metaPromise?: Promise<void>\n metaPromiseResolve?: () => void\n name: string\n pluginOptions: PluginOptions\n verify: VerifyFunction\n\n constructor(options: Options) {\n this.verify = options.verify\n this.cookieName = options.cookieName\n this.clientID = options.clientID\n this.clientSecret = options.clientSecret\n this.identityMetadataURL = options.identityMetadata\n this.name = options.strategyName\n this.collection = options.collection\n this.collectionOptions = options.collectionOptions\n this.pluginOptions = options.pluginOptions\n this.debug = options.debug || false\n // eslint-disable-next-line no-console, @typescript-eslint/no-explicit-any\n this.debugLog = options.debug ? (...args: any[]) => console.log(...args) : () => null\n // Prevent wokiness with `this`\n this.ensureMeta = this.ensureMeta.bind(this)\n }\n\n async authenticate({\n canSetHeaders,\n headers,\n payload,\n }: AuthStrategyFunctionArgs): Promise<AuthStrategyResult> {\n const debugLogger = createDebugLogger(payload, this.debug)\n await this.ensureMeta()\n\n const cookies = parseCookies(headers)\n\n let oauthToken = cookies.get(this.cookieName)\n const refreshToken = cookies.get(`${this.cookieName}-refresh`)\n\n debugLogger.info({\n msg: 'Retrieved tokens from cookies',\n oauthToken,\n refreshToken,\n })\n\n if (!this.collectionOptions.disableJWTFromHeader) {\n // Parse Authorization header if exists\n const jwtFromHeader = headers.get('authorization')\n if (typeof jwtFromHeader === 'string' && jwtFromHeader.startsWith('Bearer ')) {\n debugLogger.info({\n jwtFromHeader,\n msg: 'Found bearer token in authorization header',\n })\n oauthToken = jwtFromHeader.replace('Bearer ', '')\n }\n }\n\n if (!oauthToken) {\n if (refreshToken && canSetHeaders) {\n debugLogger.info({\n msg: 'No access token found, but refresh token exists. Attempting to refresh...',\n refreshToken,\n })\n const refreshed = await refreshTokens({ payload, refreshToken, strategy: this })\n if (refreshed) {\n const verifyResult = await this.verify({\n headers,\n payload,\n token: refreshed.decodedOauthToken,\n })\n\n debugLogger.info({\n msg: 'Token refreshed. Verifying...',\n verifyResult,\n })\n\n if (verifyResult.responseHeaders) {\n mergeHeaders(verifyResult.responseHeaders, refreshed.headers)\n }\n\n return {\n responseHeaders: refreshed.headers,\n user: verifyResult.user,\n }\n } else {\n debugLogger.info({\n msg: 'Token refresh failed',\n refreshed,\n refreshToken,\n })\n }\n } else {\n return {\n user: null,\n }\n }\n }\n\n let oauthTokenVerifyResult: Error | jwt.JwtPayload | null = null\n\n // First, try to verify token\n if (oauthToken) {\n oauthTokenVerifyResult = await this.jwtVerify({ payload, token: oauthToken })\n\n // If verify comes back null, there is no user\n if (oauthTokenVerifyResult === null) {\n return {\n user: null,\n }\n }\n\n // If verify comes back truthy, use it\n // but first set exp from refresh token\n // because access exp is likely very short lived\n if (\n typeof oauthTokenVerifyResult === 'object' &&\n !(oauthTokenVerifyResult instanceof Error)\n ) {\n if (refreshToken) {\n const refreshTokenExp = getTokenExp({ debugLogger, token: refreshToken })\n\n if (refreshTokenExp) {\n oauthTokenVerifyResult.exp = refreshTokenExp\n }\n }\n\n return this.verify({\n headers,\n payload,\n token: oauthTokenVerifyResult,\n })\n }\n }\n\n if (\n oauthTokenVerifyResult instanceof Error &&\n oauthTokenVerifyResult.name === 'TokenExpiredError' &&\n refreshToken &&\n !this.collectionOptions.usePayloadJWT &&\n canSetHeaders\n ) {\n const refreshed = await refreshTokens({ payload, refreshToken, strategy: this })\n\n debugLogger.info({\n msg: 'Token expired. Refreshing...',\n refreshed,\n refreshToken,\n })\n\n if (refreshed) {\n const verifyResult = await this.verify({\n headers,\n payload,\n token: refreshed.decodedOauthToken,\n })\n\n debugLogger.info({\n msg: 'Token refreshed. Verifying...',\n verifyResult,\n })\n\n if (verifyResult.responseHeaders) {\n mergeHeaders(verifyResult.responseHeaders, refreshed.headers)\n }\n\n return {\n responseHeaders: refreshed.headers,\n user: verifyResult.user,\n }\n } else {\n debugLogger.info({\n msg: 'Token refresh failed',\n refreshed,\n refreshToken,\n })\n }\n }\n\n return {\n user: null,\n }\n }\n\n async ensureMeta(): Promise<void> {\n if (this.metaPromise) {\n this.debugLog('strategy - metaPromise exists. Waiting for it to resolve...')\n await this.metaPromise\n }\n\n // If no meta or this.metaLastFetchedTime is more than 24 hours old, fetch meta\n if (!this.metaLastFetchedTime || Date.now() - this.metaLastFetchedTime.getTime() > 86_400_000) {\n this.debugLog(\n `Meta is stale. Fetching... Last fetched: ${this.metaLastFetchedTime || 'never'}`,\n )\n await this.fetchMeta()\n }\n }\n\n async fetchMeta(): Promise<void> {\n // If already in-flight, return the existing promise\n if (this.metaPromise) {\n this.debugLog('fetchMeta - returning existing metaPromise')\n return this.metaPromise\n }\n\n this.debugLog('fetchMeta - creating new metaPromise...')\n\n // Build the shared promise\n this.metaPromise = (async () => {\n let lastError: unknown\n\n for (let attempt = 1; attempt <= 5; attempt++) {\n try {\n this.meta = await fetch(this.identityMetadataURL).then((res) => res.json())\n this.debugLog(`fetchMeta - success on attempt ${attempt}`)\n\n if (this.meta?.jwks_uri) {\n this.jwks = await fetch(this.meta.jwks_uri).then((res) => res.json())\n }\n\n this.metaLastFetchedTime = new Date()\n this.debugLog(`fetchMeta - finished at ${this.metaLastFetchedTime.toISOString()}`)\n return\n } catch (error: unknown) {\n lastError = error\n this.debugLog(`fetchMeta - FAILED attempt ${attempt}/5: ${(error as Error)?.message}`)\n\n if (attempt < 5) {\n // Exponential backoff (up to 1s)\n await new Promise((resolve) => setTimeout(resolve, Math.min(attempt * 200, 1000)))\n }\n }\n }\n\n throw new APIError(\n `Failed to fetch identity metadata from \"${this.identityMetadataURL}\". Last error: ${\n (lastError as Error)?.message ?? 'unknown'\n }`,\n )\n })()\n\n try {\n await this.metaPromise\n } finally {\n this.metaPromise = undefined\n }\n }\n\n async generateOidcPEM(kid: string, alg: string): Promise<string> {\n const keys = this && this.jwks && Array.isArray(this.jwks.keys) ? this.jwks.keys : null\n\n let pubKey: null | string = null\n let foundKey = false\n\n if (!kid) {\n throw new Error('kid is missing')\n }\n\n if (!alg) {\n throw new Error('alg is missing')\n }\n\n if (!keys) {\n throw new Error('keys is missing')\n }\n\n for (const key of keys) {\n if (!('kid' in key) || key.kid !== kid) {\n continue\n }\n\n const cryptoKey = await jose.importJWK(key, alg)\n if (!(cryptoKey instanceof CryptoKey)) {\n throw new Error('importJWK did not return a CryptoKey')\n }\n\n pubKey = await jose.exportSPKI(cryptoKey)\n foundKey = true\n\n break\n }\n\n if (!foundKey) {\n throw new Error('a key with the specific kid cannot be found')\n }\n\n if (!pubKey) {\n throw new Error('generating public key pem failed')\n }\n\n return pubKey\n }\n\n async jwtVerify({ payload, token }: JwtVerifyArgs): Promise<Error | jwt.JwtPayload | null> {\n try {\n const verified = await validateProjectToken(token, getEnvironment())\n if (typeof verified !== 'string') {\n return verified\n }\n } catch (err: unknown) {\n payload.logger.error({\n err,\n msg: 'Error verifying jwt token',\n })\n\n if (err instanceof Error) {\n return err\n }\n return null\n }\n return null\n }\n}\n\ntype JwtVerifyArgs = {\n payload: Payload\n token: string\n}\n"],"names":["jose","APIError","parseCookies","validateProjectToken","getEnvironment","createDebugLogger","getTokenExp","mergeHeaders","refreshTokens","Strategy","clientID","clientSecret","collection","collectionOptions","cookieName","debug","debugLog","identityMetadataURL","jwks","meta","metaLastFetchedTime","metaPromise","metaPromiseResolve","name","pluginOptions","verify","options","identityMetadata","strategyName","args","console","log","ensureMeta","bind","authenticate","canSetHeaders","headers","payload","debugLogger","cookies","oauthToken","get","refreshToken","info","msg","disableJWTFromHeader","jwtFromHeader","startsWith","replace","refreshed","strategy","verifyResult","token","decodedOauthToken","responseHeaders","user","oauthTokenVerifyResult","jwtVerify","Error","refreshTokenExp","exp","usePayloadJWT","Date","now","getTime","fetchMeta","lastError","attempt","fetch","then","res","json","jwks_uri","toISOString","error","message","Promise","resolve","setTimeout","Math","min","undefined","generateOidcPEM","kid","alg","keys","Array","isArray","pubKey","foundKey","key","cryptoKey","importJWK","CryptoKey","exportSPKI","verified","err","logger"],"mappings":"AASA,YAAYA,UAAU,OAAM;AAC5B,SAASC,QAAQ,EAAEC,YAAY,QAAQ,UAAS;AAIhD,SAA6BC,oBAAoB,QAAQ,8BAA6B;AAEtF,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,iBAAiB,QAAQ,oCAAmC;AACrE,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,SAASC,aAAa,QAAQ,gCAA+B;AAe7D,OAAO,MAAMC;IACXC,SAAgB;IAChBC,aAAqB;IACrBC,WAA4B;IAC5BC,kBAAoC;IACpCC,WAAkB;IAElBC,MAAc;IAEd,8DAA8D;IAC9DC,SAAkC;IAElCC,oBAA2B;IAC3BC,KAEC;IACDC,KAMC;IACDC,oBAA0B;IAE1BC,YAA2B;IAC3BC,mBAA+B;IAC/BC,KAAY;IACZC,cAA4B;IAC5BC,OAAsB;IAEtB,YAAYC,OAAgB,CAAE;QAC5B,IAAI,CAACD,MAAM,GAAGC,QAAQD,MAAM;QAC5B,IAAI,CAACX,UAAU,GAAGY,QAAQZ,UAAU;QACpC,IAAI,CAACJ,QAAQ,GAAGgB,QAAQhB,QAAQ;QAChC,IAAI,CAACC,YAAY,GAAGe,QAAQf,YAAY;QACxC,IAAI,CAACM,mBAAmB,GAAGS,QAAQC,gBAAgB;QACn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AAM,CAAA;IACb,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;IACpC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IACnC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IAClD,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;CAC/D,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,KAAK,CAAA;CACZ,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/oauth/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type jwt from 'jsonwebtoken'\nimport type {\n AuthStrategyResult,\n CollectionConfig,\n CustomComponent,\n EmailField,\n IncomingAuthType,\n Payload,\n PayloadRequest,\n TextField,\n} from 'payload'\n\nexport type Done = (error: any, user?: any, info?: unknown) => void\n\nexport type VerifyFunction = (args: {\n headers: Headers\n payload: Payload\n token: jwt.JwtPayload\n}) => Promise<AuthStrategyResult>\n\nexport type AfterOAuthLoginHookResult = {\n redirect?: string\n} | void\n\nexport type AfterOAuthLoginHook = (args: {\n access_token?: string\n id_token?: string\n refresh_token?: string\n req: PayloadRequest\n}) => AfterOAuthLoginHookResult | Promise<AfterOAuthLoginHookResult>\n\nexport interface CollectionOptions {\n authorizationURLParams?: Record<string, string>\n\n clientID: string\n clientSecret?: string\n\n /**\n * Whether to disable the local strategy for this collection.\n *\n * @default true\n */\n\n /**\n * By default, accept a JWT from the authorization header\n *\n * Set to false to only accept the JWT from cookies\n */\n disableJWTFromHeader?: boolean\n\n disableLocalStrategy?: boolean | IncomingAuthType['disableLocalStrategy']\n /**\n * The logout button will either redirect to the IDP logout screen or\n * automatically log the user out of the IDP depending on provider.\n *\n * @default false\n */\n endOAuthSessionOnLogout?: boolean\n hooks?: {\n afterLogin?: AfterOAuthLoginHook[]\n }\n /**\n * The OpenID metadata endpoint for the identity provider.\n *\n * @example http://localhost:8080/realms/master/.well-known/openid-configuration\n * @example https://myapp.auth0.com/.well-known/openid-configuration\n */\n identityMetadata: string\n /**\n * Custom React component to use as the login button on the login page.\n */\n LoginButton?: CustomComponent | false\n /**\n * The OAuth2.0 scope to request from the identity provider.\n *\n * @default ['openid', 'profile', 'email']\n */\n scope?: string[]\n /**\n * The Payload collection slug to apply the OAuth2.0 strategy to.\n */\n slug: string\n /**\n * Property to use as the token to decode from the OAuth2.0 response.\n *\n * This is passed to the default or custom `verify` function.\n *\n * @default 'access_token'\n */\n token?: 'access_token' | 'id_token'\n\n /**\n * Have Payload maintain the JWT cookie.\n *\n * This is for when the IDP does not support silently refreshing tokens in the background.\n */\n usePayloadJWT?: boolean\n\n /**\n * The Payload field to use as the username field for the user\n * When a text is used, the plugin will find the collection field with the name provided\n * Alternatively define the entire field to use\n * @default\n *\n * ```ts\n * {\n * type: 'text',\n * name: 'preferredUsername',\n * unique: true,\n * admin: {\n * position: 'sidebar',\n * readOnly: true,\n * },\n * }\n * ```\n */\n usernameField?: EmailField | string | TextField\n\n /**\n * Custom verify function that receives the token and performs any logic.\n * By default, the defaultVerify function is used.\n */\n verify?: VerifyFunction\n}\n\nexport interface PluginOptions {\n /**\n * The collections to apply the OAuth2.0 strategy to.\n */\n collections: CollectionOptions[]\n /**\n * The name of the cookie to use for storing the user's token.\n *\n * @default 'payload-oauth-token'\n */\n cookieName?: string\n /**\n * Debug mode will log additional information to the console.\n *\n * NOTE: This will log sensitive information to the console.\n */\n\n /**\n * Accepts incoming request and allows for modification of cookie options\n */\n createCookieOptions?: (args: {\n collection: CollectionConfig\n cookieOptions: CookieOptions\n headers: Headers\n }) => CookieOptions\n\n debug?: boolean\n /**\n * Disables the plugin functionality while leaving in types, fields and component modifications.\n * @default false\n */\n disabled?: boolean\n /**\n * OAuth2.0 requires a URL to redirect the user to.\n * If you do not have a `config.serverURL` defined in your Payload config, you must define this string to be set as where the identity provider should redirect users once logged in.\n */\n redirectServerURL?: string\n /**\n * Override the strategy name used for this plugin.\n *\n * This should only be overridden to accomodate multiple plugin\n * invocations against a single user collection.\n *\n * If you have a custom basePath defined in your Next config,\n * this value should not contain that path.\n *\n * @default 'oauth'\n */\n strategyName?: string\n}\n\nexport type CookieOptions = {\n domain?: string\n expires?: Date | number\n httpOnly?: boolean\n maxAge?: number\n path?: string\n sameSite?: 'Lax' | 'None' | 'Strict'\n secure?: boolean\n}\n\nexport type StateObj = {\n /**\n * Redirect to use if the login fails\n */\n failedRedirect?: string\n /**\n * Redirect to use after the login is successful\n */\n redirect?: string\n /**\n * The URL that will be used for Payload to redirect to\n */\n serverURL?: string\n /**\n * Encrypted signature to be verified\n */\n sig: string\n /**\n * Code verifier used for PKCE\n */\n verifier: string\n}\n\nexport type LogFn = {\n (msg: string, ...args: any[]): void\n (obj: unknown, msg?: string, ...args: any[]): void\n <T extends object>(obj: T, msg?: string, ...args: any[]): void\n}\n\nexport type DebugLogger = {\n error: LogFn\n info: LogFn\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GAwNrD,WAGC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"clearCookie.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/clearCookie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhD,eAAO,MAAM,WAAW,SAAU;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,aAAa,CAAA;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAClC,GAAG,EAAE,cAAc,CAAA;CACpB,SAmBA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/clearCookie.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\n\nimport { generateCookie } from 'payload'\n\nimport type { CookieOptions } from '../types.js'\n\nimport { getCookieExpiration } from './getCookieExpiration.js'\n\nexport const clearCookie = (args: {\n cookieName: string\n cookieOptions: CookieOptions\n overrides?: Partial<CookieOptions>\n req: PayloadRequest\n}) => {\n const options = {\n ...args.cookieOptions,\n ...(args.overrides || {}),\n }\n\n const clearedCookie = generateCookie({\n ...options,\n name: args.cookieName,\n expires: getCookieExpiration(options?.expires) ?? new Date(),\n returnCookieAsObject: false,\n value: '',\n }) as string\n\n if (!args.req.responseHeaders) {\n args.req.responseHeaders = new Headers()\n }\n\n args.req.responseHeaders.append('Set-Cookie', clearedCookie)\n}\n"],"names":["generateCookie","getCookieExpiration","clearCookie","args","options","cookieOptions","overrides","clearedCookie","name","cookieName","expires","Date","returnCookieAsObject","value","req","responseHeaders","Headers","append"],"mappings":"AAEA,SAASA,cAAc,QAAQ,UAAS;AAIxC,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,OAAO,MAAMC,cAAc,CAACC;IAM1B,MAAMC,UAAU;QACd,GAAGD,KAAKE,aAAa;QACrB,GAAIF,KAAKG,SAAS,IAAI,CAAC,CAAC;IAC1B;IAEA,MAAMC,gBAAgBP,eAAe;QACnC,GAAGI,OAAO;QACVI,MAAML,KAAKM,UAAU;QACrBC,SAAST,oBAAoBG,SAASM,YAAY,IAAIC;QACtDC,sBAAsB;QACtBC,OAAO;IACT;IAEA,IAAI,CAACV,KAAKW,GAAG,CAACC,eAAe,EAAE;QAC7BZ,KAAKW,GAAG,CAACC,eAAe,GAAG,IAAIC;IACjC;IAEAb,KAAKW,GAAG,CAACC,eAAe,CAACE,MAAM,CAAC,cAAcV;AAChD,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createCookieOptions.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/createCookieOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,SAAS,CAAA;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE/D,UAAU,IAAI;IACZ,UAAU,EAAE,gBAAgB,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED,eAAO,MAAM,mBAAmB,4CAI7B,IAAI,KAAG,aA8CT,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/createCookieOptions.ts"],"sourcesContent":["import type { CollectionConfig, PayloadRequest } from 'payload'\n\nimport type { CookieOptions, PluginOptions } from '../types.js'\n\ninterface Args {\n collection: CollectionConfig\n headers: Headers\n pluginOptions: PluginOptions\n}\n\nexport const createCookieOptions = ({\n collection,\n headers,\n pluginOptions,\n}: Args): CookieOptions => {\n let cookieOptions: CookieOptions = {\n domain: undefined,\n httpOnly: true,\n path: '/',\n sameSite: undefined,\n secure: false,\n }\n\n if (typeof collection.auth === 'object' && typeof collection.auth.cookies === 'object') {\n const { domain, sameSite, secure } = collection.auth.cookies\n if (typeof secure === 'boolean') {\n cookieOptions.secure = secure\n }\n if (typeof sameSite === 'string') {\n cookieOptions.sameSite = sameSite as 'Lax'\n }\n if (typeof domain === 'string') {\n cookieOptions.domain = domain\n }\n }\n\n if (typeof collection.auth === 'object' && typeof collection.auth.cookies === 'object') {\n if (collection.auth.cookies.secure) {\n cookieOptions.secure = true\n }\n if (collection.auth.cookies.sameSite) {\n cookieOptions.sameSite =\n typeof collection.auth.cookies.sameSite === 'string'\n ? collection.auth.cookies.sameSite\n : 'Lax'\n }\n if (collection.auth.cookies.domain) {\n cookieOptions.domain = collection.auth.cookies.domain\n }\n }\n\n if (typeof pluginOptions.createCookieOptions === 'function') {\n cookieOptions = pluginOptions.createCookieOptions({\n collection,\n cookieOptions,\n headers,\n })\n }\n\n return cookieOptions\n}\n"],"names":["createCookieOptions","collection","headers","pluginOptions","cookieOptions","domain","undefined","httpOnly","path","sameSite","secure","auth","cookies"],"mappings":"AAUA,OAAO,MAAMA,sBAAsB,CAAC,EAClCC,UAAU,EACVC,OAAO,EACPC,aAAa,EACR;IACL,IAAIC,gBAA+B;QACjCC,QAAQC;QACRC,UAAU;QACVC,MAAM;QACNC,UAAUH;QACVI,QAAQ;IACV;IAEA,IAAI,OAAOT,WAAWU,IAAI,KAAK,YAAY,OAAOV,WAAWU,IAAI,CAACC,OAAO,KAAK,UAAU;QACtF,MAAM,EAAEP,MAAM,EAAEI,QAAQ,EAAEC,MAAM,EAAE,GAAGT,WAAWU,IAAI,CAACC,OAAO;QAC5D,IAAI,OAAOF,WAAW,WAAW;YAC/BN,cAAcM,MAAM,GAAGA;QACzB;QACA,IAAI,OAAOD,aAAa,UAAU;YAChCL,cAAcK,QAAQ,GAAGA;QAC3B;QACA,IAAI,OAAOJ,WAAW,UAAU;YAC9BD,cAAcC,MAAM,GAAGA;QACzB;IACF;IAEA,IAAI,OAAOJ,WAAWU,IAAI,KAAK,YAAY,OAAOV,WAAWU,IAAI,CAACC,OAAO,KAAK,UAAU;QACtF,IAAIX,WAAWU,IAAI,CAACC,OAAO,CAACF,MAAM,EAAE;YAClCN,cAAcM,MAAM,GAAG;QACzB;QACA,IAAIT,WAAWU,IAAI,CAACC,OAAO,CAACH,QAAQ,EAAE;YACpCL,cAAcK,QAAQ,GACpB,OAAOR,WAAWU,IAAI,CAACC,OAAO,CAACH,QAAQ,KAAK,WACxCR,WAAWU,IAAI,CAACC,OAAO,CAACH,QAAQ,GAChC;QACR;QACA,IAAIR,WAAWU,IAAI,CAACC,OAAO,CAACP,MAAM,EAAE;YAClCD,cAAcC,MAAM,GAAGJ,WAAWU,IAAI,CAACC,OAAO,CAACP,MAAM;QACvD;IACF;IAEA,IAAI,OAAOF,cAAcH,mBAAmB,KAAK,YAAY;QAC3DI,gBAAgBD,cAAcH,mBAAmB,CAAC;YAChDC;YACAG;YACAF;QACF;IACF;IAEA,OAAOE;AACT,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDebugLogger.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/createDebugLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,eAAO,MAAM,iBAAiB,YAAa,OAAO,cAAc,OAAO,KAAG,WAazE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/createDebugLogger.ts"],"sourcesContent":["import type { Payload } from 'payload'\n\nimport type { DebugLogger } from '../types.js'\n\nexport const createDebugLogger = (payload: Payload, condition?: boolean): DebugLogger => {\n return {\n error: (args: unknown) => {\n if (condition) {\n payload.logger.error(args)\n }\n },\n info: (args: unknown) => {\n if (condition) {\n payload.logger.info(args)\n }\n },\n }\n}\n"],"names":["createDebugLogger","payload","condition","error","args","logger","info"],"mappings":"AAIA,OAAO,MAAMA,oBAAoB,CAACC,SAAkBC;IAClD,OAAO;QACLC,OAAO,CAACC;YACN,IAAIF,WAAW;gBACbD,QAAQI,MAAM,CAACF,KAAK,CAACC;YACvB;QACF;QACAE,MAAM,CAACF;YACL,IAAIF,WAAW;gBACbD,QAAQI,MAAM,CAACC,IAAI,CAACF;YACtB;QACF;IACF;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"extractOrigin.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/extractOrigin.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,IAAI,GAAG,MAOlD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/extractOrigin.ts"],"sourcesContent":["export const extractOrigin = (url: string): null | string => {\n try {\n const parsed = new URL(url)\n return parsed.origin // includes protocol, hostname, and port if present\n } catch {\n return null // invalid URL\n }\n}\n"],"names":["extractOrigin","url","parsed","URL","origin"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,CAACC;IAC5B,IAAI;QACF,MAAMC,SAAS,IAAIC,IAAIF;QACvB,OAAOC,OAAOE,MAAM,CAAC,mDAAmD;;IAC1E,EAAE,OAAM;QACN,OAAO,KAAK,cAAc;;IAC5B;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAdminCollectionSlug.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/getAdminCollectionSlug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,eAAO,MAAM,sBAAsB,WAAY,MAAM,KAAG,MAmBvD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/getAdminCollectionSlug.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nexport const getAdminCollectionSlug = (config: Config): string => {\n // if config specifies admin user collection, find and use it\n if (config.admin?.user) {\n const matchedAdminCollection = config.collections?.find(\n (collection) => config.admin?.user === collection.slug,\n )\n if (matchedAdminCollection) {\n return matchedAdminCollection.slug\n }\n }\n\n // if config does not specify admin user collection, find first collection with auth\n const firstCollectionWithAuth = config.collections?.find(({ auth }) => Boolean(auth))\n if (firstCollectionWithAuth) {\n return firstCollectionWithAuth.slug\n }\n\n // Otherwise, assume that it'll be the built-in auth\n return 'users'\n}\n"],"names":["getAdminCollectionSlug","config","admin","user","matchedAdminCollection","collections","find","collection","slug","firstCollectionWithAuth","auth","Boolean"],"mappings":"AAEA,OAAO,MAAMA,yBAAyB,CAACC;IACrC,6DAA6D;IAC7D,IAAIA,OAAOC,KAAK,EAAEC,MAAM;QACtB,MAAMC,yBAAyBH,OAAOI,WAAW,EAAEC,KACjD,CAACC,aAAeN,OAAOC,KAAK,EAAEC,SAASI,WAAWC,IAAI;QAExD,IAAIJ,wBAAwB;YAC1B,OAAOA,uBAAuBI,IAAI;QACpC;IACF;IAEA,oFAAoF;IACpF,MAAMC,0BAA0BR,OAAOI,WAAW,EAAEC,KAAK,CAAC,EAAEI,IAAI,EAAE,GAAKC,QAAQD;IAC/E,IAAID,yBAAyB;QAC3B,OAAOA,wBAAwBD,IAAI;IACrC;IAEA,oDAAoD;IACpD,OAAO;AACT,EAAC"}
@@ -1,8 +0,0 @@
1
- import type { ClientConfig, SanitizedConfig } from 'payload';
2
- /**
3
- * This is the path to the admin panel WITHOUT domain.
4
- *
5
- * This respects the `basePath` property in the Next config.
6
- */
7
- export declare const getAdminPath: (config: ClientConfig | SanitizedConfig) => string;
8
- //# sourceMappingURL=getAdminPath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAdminPath.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/getAdminPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE5D;;;;GAIG;AACH,eAAO,MAAM,YAAY,WAAY,YAAY,GAAG,eAAe,WAElE,CAAA"}
@@ -1,9 +0,0 @@
1
- /**
2
- * This is the path to the admin panel WITHOUT domain.
3
- *
4
- * This respects the `basePath` property in the Next config.
5
- */ export const getAdminPath = (config)=>{
6
- return `${process.env.NEXT_BASE_PATH ?? ''}${config.routes?.admin || '/admin'}`;
7
- };
8
-
9
- //# sourceMappingURL=getAdminPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/getAdminPath.ts"],"sourcesContent":["import type { ClientConfig, SanitizedConfig } from 'payload'\n\n/**\n * This is the path to the admin panel WITHOUT domain.\n *\n * This respects the `basePath` property in the Next config.\n */\nexport const getAdminPath = (config: ClientConfig | SanitizedConfig) => {\n return `${process.env.NEXT_BASE_PATH ?? ''}${config.routes?.admin || '/admin'}`\n}\n"],"names":["getAdminPath","config","process","env","NEXT_BASE_PATH","routes","admin"],"mappings":"AAEA;;;;CAIC,GACD,OAAO,MAAMA,eAAe,CAACC;IAC3B,OAAO,GAAGC,QAAQC,GAAG,CAACC,cAAc,IAAI,KAAKH,OAAOI,MAAM,EAAEC,SAAS,UAAU;AACjF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAuthorizeURL.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/getAuthorizeURL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAMxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAY,MAAM,aAAa,CAAA;AAI7E,UAAU,IAAI;IACZ,UAAU,EAAE,gBAAgB,CAAA;IAC5B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,aAAa,CAAA;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,EAAE,QAAQ,CAAA;CACnB;AAED,eAAO,MAAM,eAAe,oIAUzB,IAAI,KAAG,OAAO,CAAC,MAAM,CAoDvB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/getAuthorizeURL.ts"],"sourcesContent":["import type { CollectionConfig, Payload } from 'payload'\n\nimport crypto from 'crypto'\nimport * as QueryString from 'qs-esm'\nimport { v4 as uuid } from 'uuid'\n\nimport type { Strategy } from '../strategy/index.js'\nimport type { CollectionOptions, PluginOptions, StateObj } from '../types.js'\n\nimport { defaultScope } from '../defaults.js'\n\ninterface Args {\n collection: CollectionConfig\n collectionOptions: CollectionOptions\n endpointSlug: string\n failedRedirect?: unknown\n payload: Payload\n pluginOptions: PluginOptions\n redirect?: unknown\n serverURLOverride?: unknown\n strategy: Strategy\n}\n\nexport const getAuthorizeURL = async ({\n collection,\n collectionOptions,\n endpointSlug,\n failedRedirect,\n payload,\n pluginOptions,\n redirect,\n serverURLOverride,\n strategy,\n}: Args): Promise<string> => {\n const { redirectServerURL } = pluginOptions\n\n await strategy.ensureMeta()\n\n // Generate a random code verifier\n const codeVerifier = crypto.randomBytes(32).toString('base64url')\n\n // Create a code challenge by hashing the code verifier\n const code_challenge = crypto.createHash('sha256').update(codeVerifier).digest('base64url')\n\n const state: StateObj = {\n sig: payload.encrypt(strategy.name),\n verifier: payload.encrypt(codeVerifier),\n }\n\n if (typeof serverURLOverride === 'string') {\n state.serverURL = serverURLOverride\n }\n\n if (typeof redirect === 'string') {\n state.redirect = redirect\n }\n\n if (typeof failedRedirect === 'string') {\n state.failedRedirect = failedRedirect\n }\n\n const baseRedirectURL = redirectServerURL || payload.config.serverURL || state.serverURL\n\n const loginRedirectURL = encodeURI(\n `${baseRedirectURL}${payload.config.routes?.api || '/api'}/${collection.slug}/${endpointSlug}/login`,\n )\n\n const params = {\n client_id: collectionOptions.clientID,\n code_challenge,\n code_challenge_method: 'S256',\n nonce: uuid(),\n redirect_uri: loginRedirectURL,\n response_mode: 'form_post',\n response_type: 'id_token%20token%20code',\n scope: (collectionOptions.scope ?? defaultScope).join('+'),\n state: Buffer.from(JSON.stringify(state)).toString('base64'),\n ...(collectionOptions.authorizationURLParams || {}),\n }\n\n const authorizeURL = `${strategy.meta?.authorization_endpoint}?${QueryString.stringify(params, {\n encode: false,\n })}`\n\n return authorizeURL\n}\n"],"names":["crypto","QueryString","v4","uuid","defaultScope","getAuthorizeURL","collection","collectionOptions","endpointSlug","failedRedirect","payload","pluginOptions","redirect","serverURLOverride","strategy","redirectServerURL","ensureMeta","codeVerifier","randomBytes","toString","code_challenge","createHash","update","digest","state","sig","encrypt","name","verifier","serverURL","baseRedirectURL","config","loginRedirectURL","encodeURI","routes","api","slug","params","client_id","clientID","code_challenge_method","nonce","redirect_uri","response_mode","response_type","scope","join","Buffer","from","JSON","stringify","authorizationURLParams","authorizeURL","meta","authorization_endpoint","encode"],"mappings":"AAEA,OAAOA,YAAY,SAAQ;AAC3B,YAAYC,iBAAiB,SAAQ;AACrC,SAASC,MAAMC,IAAI,QAAQ,OAAM;AAKjC,SAASC,YAAY,QAAQ,iBAAgB;AAc7C,OAAO,MAAMC,kBAAkB,OAAO,EACpCC,UAAU,EACVC,iBAAiB,EACjBC,YAAY,EACZC,cAAc,EACdC,OAAO,EACPC,aAAa,EACbC,QAAQ,EACRC,iBAAiB,EACjBC,QAAQ,EACH;IACL,MAAM,EAAEC,iBAAiB,EAAE,GAAGJ;IAE9B,MAAMG,SAASE,UAAU;IAEzB,kCAAkC;IAClC,MAAMC,eAAejB,OAAOkB,WAAW,CAAC,IAAIC,QAAQ,CAAC;IAErD,uDAAuD;IACvD,MAAMC,iBAAiBpB,OAAOqB,UAAU,CAAC,UAAUC,MAAM,CAACL,cAAcM,MAAM,CAAC;IAE/E,MAAMC,QAAkB;QACtBC,KAAKf,QAAQgB,OAAO,CAACZ,SAASa,IAAI;QAClCC,UAAUlB,QAAQgB,OAAO,CAACT;IAC5B;IAEA,IAAI,OAAOJ,sBAAsB,UAAU;QACzCW,MAAMK,SAAS,GAAGhB;IACpB;IAEA,IAAI,OAAOD,aAAa,UAAU;QAChCY,MAAMZ,QAAQ,GAAGA;IACnB;IAEA,IAAI,OAAOH,mBAAmB,UAAU;QACtCe,MAAMf,cAAc,GAAGA;IACzB;IAEA,MAAMqB,kBAAkBf,qBAAqBL,QAAQqB,MAAM,CAACF,SAAS,IAAIL,MAAMK,SAAS;IAExF,MAAMG,mBAAmBC,UACvB,GAAGH,kBAAkBpB,QAAQqB,MAAM,CAACG,MAAM,EAAEC,OAAO,OAAO,CAAC,EAAE7B,WAAW8B,IAAI,CAAC,CAAC,EAAE5B,aAAa,MAAM,CAAC;IAGtG,MAAM6B,SAAS;QACbC,WAAW/B,kBAAkBgC,QAAQ;QACrCnB;QACAoB,uBAAuB;QACvBC,OAAOtC;QACPuC,cAAcV;QACdW,eAAe;QACfC,eAAe;QACfC,OAAO,AAACtC,CAAAA,kBAAkBsC,KAAK,IAAIzC,YAAW,EAAG0C,IAAI,CAAC;QACtDtB,OAAOuB,OAAOC,IAAI,CAACC,KAAKC,SAAS,CAAC1B,QAAQL,QAAQ,CAAC;QACnD,GAAIZ,kBAAkB4C,sBAAsB,IAAI,CAAC,CAAC;IACpD;IAEA,MAAMC,eAAe,GAAGtC,SAASuC,IAAI,EAAEC,uBAAuB,CAAC,EAAErD,YAAYiD,SAAS,CAACb,QAAQ;QAC7FkB,QAAQ;IACV,IAAI;IAEJ,OAAOH;AACT,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCookieExpiration.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/getCookieExpiration.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AAEvD,eAAO,MAAM,mBAAmB,aAAc,aAAa,KAAG,IAS7D,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/getCookieExpiration.ts"],"sourcesContent":["type CookieExpires = Date | number | string | undefined\n\nexport const getCookieExpiration = (expires?: CookieExpires): Date => {\n if (expires instanceof Date) {\n return expires\n }\n\n const seconds = typeof expires === 'number' ? expires : 7200\n const currentTime = new Date()\n currentTime.setSeconds(currentTime.getSeconds() + seconds)\n return currentTime\n}\n"],"names":["getCookieExpiration","expires","Date","seconds","currentTime","setSeconds","getSeconds"],"mappings":"AAEA,OAAO,MAAMA,sBAAsB,CAACC;IAClC,IAAIA,mBAAmBC,MAAM;QAC3B,OAAOD;IACT;IAEA,MAAME,UAAU,OAAOF,YAAY,WAAWA,UAAU;IACxD,MAAMG,cAAc,IAAIF;IACxBE,YAAYC,UAAU,CAACD,YAAYE,UAAU,KAAKH;IAClD,OAAOC;AACT,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSecondsFromTokenExp.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/getSecondsFromTokenExp.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAG1E"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/getSecondsFromTokenExp.ts"],"sourcesContent":["export function getSecondsFromTokenExp(futureUnixTimestamp: number): number {\n const now = Math.floor(Date.now() / 1000) // current time in seconds\n return futureUnixTimestamp - now\n}\n"],"names":["getSecondsFromTokenExp","futureUnixTimestamp","now","Math","floor","Date"],"mappings":"AAAA,OAAO,SAASA,uBAAuBC,mBAA2B;IAChE,MAAMC,MAAMC,KAAKC,KAAK,CAACC,KAAKH,GAAG,KAAK,MAAM,0BAA0B;;IACpE,OAAOD,sBAAsBC;AAC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTokenExp.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/getTokenExp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,eAAO,MAAM,WAAW,4BAGrB;IACD,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,MAAM,GAAG,SAwBZ,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/getTokenExp.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type { DebugLogger } from '../types.js'\n\nexport const getTokenExp = ({\n debugLogger,\n token,\n}: {\n debugLogger: DebugLogger\n token: string\n}): number | undefined => {\n if (!token) {\n return undefined\n }\n\n try {\n const decoded = jwt.decode(token)\n\n if (\n decoded &&\n typeof decoded === 'object' &&\n 'exp' in decoded &&\n typeof decoded.exp === 'number'\n ) {\n return decoded.exp\n }\n } catch (err: unknown) {\n debugLogger.error({\n err,\n msg: 'Error decoding token in getTokenExp',\n })\n }\n\n return undefined\n}\n"],"names":["jwt","getTokenExp","debugLogger","token","undefined","decoded","decode","exp","err","error","msg"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAI9B,OAAO,MAAMC,cAAc,CAAC,EAC1BC,WAAW,EACXC,KAAK,EAIN;IACC,IAAI,CAACA,OAAO;QACV,OAAOC;IACT;IAEA,IAAI;QACF,MAAMC,UAAUL,IAAIM,MAAM,CAACH;QAE3B,IACEE,WACA,OAAOA,YAAY,YACnB,SAASA,WACT,OAAOA,QAAQE,GAAG,KAAK,UACvB;YACA,OAAOF,QAAQE,GAAG;QACpB;IACF,EAAE,OAAOC,KAAc;QACrBN,YAAYO,KAAK,CAAC;YAChBD;YACAE,KAAK;QACP;IACF;IAEA,OAAON;AACT,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getUsernameField.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/getUsernameField.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAItE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAIpD,UAAU,IAAI;IACZ,UAAU,EAAE,gBAAgB,CAAA;IAC5B,iBAAiB,EAAE,iBAAiB,CAAA;CACrC;AACD,eAAO,MAAM,gBAAgB,uCAG1B,IAAI,KAAG,UAAU,GAAG,SA0BtB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/getUsernameField.ts"],"sourcesContent":["import type { CollectionConfig, EmailField, TextField } from 'payload'\n\nimport { flattenTopLevelFields } from 'payload'\n\nimport type { CollectionOptions } from '../types.js'\n\nimport { defaultUsernameField } from '../defaults.js'\n\ninterface Args {\n collection: CollectionConfig\n collectionOptions: CollectionOptions\n}\nexport const getUsernameField = ({\n collection,\n collectionOptions,\n}: Args): EmailField | TextField => {\n if (!collectionOptions.usernameField) {\n return defaultUsernameField\n }\n\n if (typeof collectionOptions.usernameField === 'string') {\n const matchedField = flattenTopLevelFields(collection.fields).find(\n (field) => field.name === collectionOptions.usernameField,\n )\n\n if (!matchedField) {\n throw new Error(\n `Username field \"${collectionOptions.usernameField}\" not found in collection \"${collection.slug}\"`,\n )\n }\n\n if (matchedField.type !== 'text' && matchedField.type !== 'email') {\n throw new Error(\n `Username field \"${collectionOptions.usernameField}\" must be of type \"text\" or \"email\"`,\n )\n }\n\n return matchedField\n }\n\n return collectionOptions.usernameField\n}\n"],"names":["flattenTopLevelFields","defaultUsernameField","getUsernameField","collection","collectionOptions","usernameField","matchedField","fields","find","field","name","Error","slug","type"],"mappings":"AAEA,SAASA,qBAAqB,QAAQ,UAAS;AAI/C,SAASC,oBAAoB,QAAQ,iBAAgB;AAMrD,OAAO,MAAMC,mBAAmB,CAAC,EAC/BC,UAAU,EACVC,iBAAiB,EACZ;IACL,IAAI,CAACA,kBAAkBC,aAAa,EAAE;QACpC,OAAOJ;IACT;IAEA,IAAI,OAAOG,kBAAkBC,aAAa,KAAK,UAAU;QACvD,MAAMC,eAAeN,sBAAsBG,WAAWI,MAAM,EAAEC,IAAI,CAChE,CAACC,QAAUA,MAAMC,IAAI,KAAKN,kBAAkBC,aAAa;QAG3D,IAAI,CAACC,cAAc;YACjB,MAAM,IAAIK,MACR,CAAC,gBAAgB,EAAEP,kBAAkBC,aAAa,CAAC,2BAA2B,EAAEF,WAAWS,IAAI,CAAC,CAAC,CAAC;QAEtG;QAEA,IAAIN,aAAaO,IAAI,KAAK,UAAUP,aAAaO,IAAI,KAAK,SAAS;YACjE,MAAM,IAAIF,MACR,CAAC,gBAAgB,EAAEP,kBAAkBC,aAAa,CAAC,mCAAmC,CAAC;QAE3F;QAEA,OAAOC;IACT;IAEA,OAAOF,kBAAkBC,aAAa;AACxC,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasUserTokenPropsChanged.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/hasUserTokenPropsChanged.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,wBAAwB,SAAU,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,OAerF,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/hasUserTokenPropsChanged.ts"],"sourcesContent":["type User = Record<string, unknown>\n\n/**\n * Iterate over the user's properties and compare them to the token's properties.\n * If a property has changed, return true.\n */\nexport const hasUserTokenPropsChanged = (user: User, token: Record<string, unknown>): boolean => {\n // For each property in token:\n // - if so, are the values different?\n // - if so, return true\n\n // Iterate over the user's properties\n for (const key in user) {\n if (user[key] && token[key]) {\n if (compareValues(user[key], token[key])) {\n return true\n }\n }\n }\n\n return false\n}\n\nfunction compareValues(userVal: unknown, tokenVal: unknown): boolean {\n if (Array.isArray(userVal) && Array.isArray(tokenVal)) {\n return (\n userVal.some((val) => !tokenVal.includes(val)) ||\n tokenVal.some((val) => !userVal.includes(val))\n )\n }\n return userVal !== tokenVal\n}\n"],"names":["hasUserTokenPropsChanged","user","token","key","compareValues","userVal","tokenVal","Array","isArray","some","val","includes"],"mappings":"AAEA;;;CAGC,GACD,OAAO,MAAMA,2BAA2B,CAACC,MAAYC;IACnD,8BAA8B;IAC9B,qCAAqC;IACrC,uBAAuB;IAEvB,qCAAqC;IACrC,IAAK,MAAMC,OAAOF,KAAM;QACtB,IAAIA,IAAI,CAACE,IAAI,IAAID,KAAK,CAACC,IAAI,EAAE;YAC3B,IAAIC,cAAcH,IAAI,CAACE,IAAI,EAAED,KAAK,CAACC,IAAI,GAAG;gBACxC,OAAO;YACT;QACF;IACF;IAEA,OAAO;AACT,EAAC;AAED,SAASC,cAAcC,OAAgB,EAAEC,QAAiB;IACxD,IAAIC,MAAMC,OAAO,CAACH,YAAYE,MAAMC,OAAO,CAACF,WAAW;QACrD,OACED,QAAQI,IAAI,CAAC,CAACC,MAAQ,CAACJ,SAASK,QAAQ,CAACD,SACzCJ,SAASG,IAAI,CAAC,CAACC,MAAQ,CAACL,QAAQM,QAAQ,CAACD;IAE7C;IACA,OAAOL,YAAYC;AACrB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergeHeaders.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/mergeHeaders.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,aAAa,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,GAAG,IAAI,CA8BtF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/mergeHeaders.ts"],"sourcesContent":["const headersToJoin = ['set-cookie', 'warning', 'www-authenticate', 'proxy-authenticate', 'vary']\n\nexport function mergeHeaders(sourceHeaders: Headers, destinationHeaders: Headers): void {\n // Create a map to store combined headers\n const combinedHeaders = new Headers()\n\n // Add existing destination headers to the combined map\n destinationHeaders.forEach((value, key) => {\n combinedHeaders.set(key, value)\n })\n\n // Add source headers to the combined map, joining specific headers\n sourceHeaders.forEach((value, key) => {\n const lowerKey = key.toLowerCase()\n if (headersToJoin.includes(lowerKey)) {\n if (combinedHeaders.has(key)) {\n combinedHeaders.set(key, `${combinedHeaders.get(key)}, ${value}`)\n } else {\n combinedHeaders.set(key, value)\n }\n } else {\n combinedHeaders.set(key, value)\n }\n })\n\n // Clear the destination headers and set the combined headers\n destinationHeaders.forEach((_, key) => {\n destinationHeaders.delete(key)\n })\n combinedHeaders.forEach((value, key) => {\n destinationHeaders.append(key, value)\n })\n}\n"],"names":["headersToJoin","mergeHeaders","sourceHeaders","destinationHeaders","combinedHeaders","Headers","forEach","value","key","set","lowerKey","toLowerCase","includes","has","get","_","delete","append"],"mappings":"AAAA,MAAMA,gBAAgB;IAAC;IAAc;IAAW;IAAoB;IAAsB;CAAO;AAEjG,OAAO,SAASC,aAAaC,aAAsB,EAAEC,kBAA2B;IAC9E,yCAAyC;IACzC,MAAMC,kBAAkB,IAAIC;IAE5B,uDAAuD;IACvDF,mBAAmBG,OAAO,CAAC,CAACC,OAAOC;QACjCJ,gBAAgBK,GAAG,CAACD,KAAKD;IAC3B;IAEA,mEAAmE;IACnEL,cAAcI,OAAO,CAAC,CAACC,OAAOC;QAC5B,MAAME,WAAWF,IAAIG,WAAW;QAChC,IAAIX,cAAcY,QAAQ,CAACF,WAAW;YACpC,IAAIN,gBAAgBS,GAAG,CAACL,MAAM;gBAC5BJ,gBAAgBK,GAAG,CAACD,KAAK,GAAGJ,gBAAgBU,GAAG,CAACN,KAAK,EAAE,EAAED,OAAO;YAClE,OAAO;gBACLH,gBAAgBK,GAAG,CAACD,KAAKD;YAC3B;QACF,OAAO;YACLH,gBAAgBK,GAAG,CAACD,KAAKD;QAC3B;IACF;IAEA,6DAA6D;IAC7DJ,mBAAmBG,OAAO,CAAC,CAACS,GAAGP;QAC7BL,mBAAmBa,MAAM,CAACR;IAC5B;IACAJ,gBAAgBE,OAAO,CAAC,CAACC,OAAOC;QAC9BL,mBAAmBc,MAAM,CAACT,KAAKD;IACjC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"refreshTokens.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/refreshTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAItC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAUpD,UAAU,IAAI;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,QAAQ,CAAA;CACnB;AAED,KAAK,MAAM,GACP;IACE,iBAAiB,EAAE,GAAG,CAAC,UAAU,CAAA;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,GACD,KAAK,CAAA;AAET,eAAO,MAAM,aAAa,wCAA+C,IAAI,KAAG,OAAO,CAAC,MAAM,CAmE7F,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/refreshTokens.ts"],"sourcesContent":["import type jwt from 'jsonwebtoken'\nimport type { Payload } from 'payload'\n\nimport { generateCookie } from 'payload'\n\nimport type { Strategy } from '../strategy/index.js'\n\nimport { getProjectToken } from '../../api/figma-api.js'\nimport { validateProjectToken } from '../../auth/jwt-validator.js'\nimport { getEnvironment } from '../../constants.js'\nimport { createCookieOptions } from './createCookieOptions.js'\nimport { createDebugLogger } from './createDebugLogger.js'\nimport { getCookieExpiration } from './getCookieExpiration.js'\nimport { getTokenExp } from './getTokenExp.js'\n\ninterface Args {\n payload: Payload\n refreshToken: string\n strategy: Strategy\n}\n\ntype Result =\n | {\n decodedOauthToken: jwt.JwtPayload\n headers: Headers\n token: string\n }\n | false\n\nexport const refreshTokens = async ({ payload, refreshToken, strategy }: Args): Promise<Result> => {\n const debugLogger = createDebugLogger(payload, strategy.debug)\n\n debugLogger.info({\n msg: 'Refreshing tokens',\n })\n\n const headers = new Headers()\n\n // At this point, access token is expired\n // but refresh token is still valid\n // so we will refresh both tokens\n\n try {\n // Get another project token\n const { expiresAt, token } = await getProjectToken(refreshToken, 'someproject')\n\n debugLogger.info({\n expiresAt,\n msg: 'Received new tokens from Figma API',\n token,\n })\n\n // On error, no user\n if (!token) {\n debugLogger.error({\n msg: 'Error refreshing tokens',\n })\n return false\n }\n\n if (token) {\n debugLogger.info({\n msg: 'Successfully refreshed project token',\n token,\n })\n\n const expires_in = new Date(expiresAt)\n\n const cookieOptions = createCookieOptions({\n collection: strategy.collection,\n headers,\n pluginOptions: strategy.pluginOptions,\n })\n\n const tokenCookie = generateCookie({\n ...cookieOptions,\n name: strategy.cookieName,\n expires: getCookieExpiration(expires_in),\n returnCookieAsObject: false,\n value: token,\n }) as string\n\n headers.append('Set-Cookie', tokenCookie)\n\n const decodedOauthToken = await validateProjectToken(token, getEnvironment())\n\n return { decodedOauthToken, headers, token }\n }\n } catch (error) {\n debugLogger.error({\n err: error,\n msg: 'Error refreshing tokens',\n })\n }\n\n return false\n}\n"],"names":["generateCookie","getProjectToken","validateProjectToken","getEnvironment","createCookieOptions","createDebugLogger","getCookieExpiration","refreshTokens","payload","refreshToken","strategy","debugLogger","debug","info","msg","headers","Headers","expiresAt","token","error","expires_in","Date","cookieOptions","collection","pluginOptions","tokenCookie","name","cookieName","expires","returnCookieAsObject","value","append","decodedOauthToken","err"],"mappings":"AAGA,SAASA,cAAc,QAAQ,UAAS;AAIxC,SAASC,eAAe,QAAQ,yBAAwB;AACxD,SAASC,oBAAoB,QAAQ,8BAA6B;AAClE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,mBAAmB,QAAQ,2BAA0B;AAiB9D,OAAO,MAAMC,gBAAgB,OAAO,EAAEC,OAAO,EAAEC,YAAY,EAAEC,QAAQ,EAAQ;IAC3E,MAAMC,cAAcN,kBAAkBG,SAASE,SAASE,KAAK;IAE7DD,YAAYE,IAAI,CAAC;QACfC,KAAK;IACP;IAEA,MAAMC,UAAU,IAAIC;IAEpB,yCAAyC;IACzC,mCAAmC;IACnC,iCAAiC;IAEjC,IAAI;QACF,4BAA4B;QAC5B,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAG,MAAMjB,gBAAgBQ,cAAc;QAEjEE,YAAYE,IAAI,CAAC;YACfI;YACAH,KAAK;YACLI;QACF;QAEA,oBAAoB;QACpB,IAAI,CAACA,OAAO;YACVP,YAAYQ,KAAK,CAAC;gBAChBL,KAAK;YACP;YACA,OAAO;QACT;QAEA,IAAII,OAAO;YACTP,YAAYE,IAAI,CAAC;gBACfC,KAAK;gBACLI;YACF;YAEA,MAAME,aAAa,IAAIC,KAAKJ;YAE5B,MAAMK,gBAAgBlB,oBAAoB;gBACxCmB,YAAYb,SAASa,UAAU;gBAC/BR;gBACAS,eAAed,SAASc,aAAa;YACvC;YAEA,MAAMC,cAAczB,eAAe;gBACjC,GAAGsB,aAAa;gBAChBI,MAAMhB,SAASiB,UAAU;gBACzBC,SAAStB,oBAAoBc;gBAC7BS,sBAAsB;gBACtBC,OAAOZ;YACT;YAEAH,QAAQgB,MAAM,CAAC,cAAcN;YAE7B,MAAMO,oBAAoB,MAAM9B,qBAAqBgB,OAAOf;YAE5D,OAAO;gBAAE6B;gBAAmBjB;gBAASG;YAAM;QAC7C;IACF,EAAE,OAAOC,OAAO;QACdR,YAAYQ,KAAK,CAAC;YAChBc,KAAKd;YACLL,KAAK;QACP;IACF;IAEA,OAAO;AACT,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/plugin/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAIjD,MAAM,WAAW,yBAAyB;CAEzC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,yBAA8B,GAAG,kBAAkB,CAiJ9F"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugin/adapter.ts"],"sourcesContent":["/* eslint-disable */\n\nimport type { DatabaseAdapterObj } from 'payload'\n\nimport { createDatabaseAdapter } from 'payload'\n\nexport interface FigmaContentSystemOptions {\n // Add Figma-specific configuration options here\n}\n\nexport function figmaContentSystem(options: FigmaContentSystemOptions = {}): DatabaseAdapterObj {\n function adapter({ payload }: { payload: any }) {\n return createDatabaseAdapter({\n name: 'figma-content-system',\n defaultIDType: 'text' as const,\n packageName: '@payloadcms/plugin-figma',\n payload,\n\n // Connection lifecycle\n connect: async () => {\n throw new Error('figmaContentSystem.connect() not implemented')\n },\n destroy: async () => {\n throw new Error('figmaContentSystem.destroy() not implemented')\n },\n init: async () => {\n throw new Error('figmaContentSystem.init() not implemented')\n },\n\n // Transactions\n beginTransaction: async () => {\n throw new Error('figmaContentSystem.beginTransaction() not implemented')\n },\n commitTransaction: async () => {\n throw new Error('figmaContentSystem.commitTransaction() not implemented')\n },\n rollbackTransaction: async () => {\n throw new Error('figmaContentSystem.rollbackTransaction() not implemented')\n },\n\n // Collection operations\n count: async () => {\n throw new Error('figmaContentSystem.count() not implemented')\n },\n create: async () => {\n throw new Error('figmaContentSystem.create() not implemented')\n },\n deleteMany: async () => {\n throw new Error('figmaContentSystem.deleteMany() not implemented')\n },\n deleteOne: async () => {\n throw new Error('figmaContentSystem.deleteOne() not implemented')\n },\n find: async () => {\n throw new Error('figmaContentSystem.find() not implemented')\n },\n findDistinct: async () => {\n throw new Error('figmaContentSystem.findDistinct() not implemented')\n },\n findOne: async () => {\n throw new Error('figmaContentSystem.findOne() not implemented')\n },\n updateMany: async () => {\n throw new Error('figmaContentSystem.updateMany() not implemented')\n },\n updateOne: async () => {\n throw new Error('figmaContentSystem.updateOne() not implemented')\n },\n upsert: async () => {\n throw new Error('figmaContentSystem.upsert() not implemented')\n },\n\n // Global operations\n createGlobal: async () => {\n throw new Error('figmaContentSystem.createGlobal() not implemented')\n },\n findGlobal: async () => {\n throw new Error('figmaContentSystem.findGlobal() not implemented')\n },\n updateGlobal: async () => {\n throw new Error('figmaContentSystem.updateGlobal() not implemented')\n },\n\n // Version operations\n countVersions: async () => {\n throw new Error('figmaContentSystem.countVersions() not implemented')\n },\n createVersion: async () => {\n throw new Error('figmaContentSystem.createVersion() not implemented')\n },\n deleteVersions: async () => {\n throw new Error('figmaContentSystem.deleteVersions() not implemented')\n },\n findVersions: async () => {\n throw new Error('figmaContentSystem.findVersions() not implemented')\n },\n updateVersion: async () => {\n throw new Error('figmaContentSystem.updateVersion() not implemented')\n },\n\n // Global version operations\n countGlobalVersions: async () => {\n throw new Error('figmaContentSystem.countGlobalVersions() not implemented')\n },\n createGlobalVersion: async () => {\n throw new Error('figmaContentSystem.createGlobalVersion() not implemented')\n },\n findGlobalVersions: async () => {\n throw new Error('figmaContentSystem.findGlobalVersions() not implemented')\n },\n updateGlobalVersion: async () => {\n throw new Error('figmaContentSystem.updateGlobalVersion() not implemented')\n },\n\n // Draft operations\n queryDrafts: async () => {\n throw new Error('figmaContentSystem.queryDrafts() not implemented')\n },\n\n // Job operations\n updateJobs: async () => {\n throw new Error('figmaContentSystem.updateJobs() not implemented')\n },\n\n // Migration operations\n createMigration: async () => {\n throw new Error('figmaContentSystem.createMigration() not implemented')\n },\n migrate: async () => {\n throw new Error('figmaContentSystem.migrate() not implemented')\n },\n migrateDown: async () => {\n throw new Error('figmaContentSystem.migrateDown() not implemented')\n },\n migrateFresh: async () => {\n throw new Error('figmaContentSystem.migrateFresh() not implemented')\n },\n migrateRefresh: async () => {\n throw new Error('figmaContentSystem.migrateRefresh() not implemented')\n },\n migrateReset: async () => {\n throw new Error('figmaContentSystem.migrateReset() not implemented')\n },\n migrateStatus: async () => {\n throw new Error('figmaContentSystem.migrateStatus() not implemented')\n },\n migrationDir: './migrations',\n })\n }\n\n return {\n name: 'figma-content-system',\n defaultIDType: 'text' as const,\n init: adapter,\n }\n}\n"],"names":["createDatabaseAdapter","figmaContentSystem","options","adapter","payload","name","defaultIDType","packageName","connect","Error","destroy","init","beginTransaction","commitTransaction","rollbackTransaction","count","create","deleteMany","deleteOne","find","findDistinct","findOne","updateMany","updateOne","upsert","createGlobal","findGlobal","updateGlobal","countVersions","createVersion","deleteVersions","findVersions","updateVersion","countGlobalVersions","createGlobalVersion","findGlobalVersions","updateGlobalVersion","queryDrafts","updateJobs","createMigration","migrate","migrateDown","migrateFresh","migrateRefresh","migrateReset","migrateStatus","migrationDir"],"mappings":"AAAA,kBAAkB,GAIlB,SAASA,qBAAqB,QAAQ,UAAS;AAM/C,OAAO,SAASC,mBAAmBC,UAAqC,CAAC,CAAC;IACxE,SAASC,QAAQ,EAAEC,OAAO,EAAoB;QAC5C,OAAOJ,sBAAsB;YAC3BK,MAAM;YACNC,eAAe;YACfC,aAAa;YACbH;YAEA,uBAAuB;YACvBI,SAAS;gBACP,MAAM,IAAIC,MAAM;YAClB;YACAC,SAAS;gBACP,MAAM,IAAID,MAAM;YAClB;YACAE,MAAM;gBACJ,MAAM,IAAIF,MAAM;YAClB;YAEA,eAAe;YACfG,kBAAkB;gBAChB,MAAM,IAAIH,MAAM;YAClB;YACAI,mBAAmB;gBACjB,MAAM,IAAIJ,MAAM;YAClB;YACAK,qBAAqB;gBACnB,MAAM,IAAIL,MAAM;YAClB;YAEA,wBAAwB;YACxBM,OAAO;gBACL,MAAM,IAAIN,MAAM;YAClB;YACAO,QAAQ;gBACN,MAAM,IAAIP,MAAM;YAClB;YACAQ,YAAY;gBACV,MAAM,IAAIR,MAAM;YAClB;YACAS,WAAW;gBACT,MAAM,IAAIT,MAAM;YAClB;YACAU,MAAM;gBACJ,MAAM,IAAIV,MAAM;YAClB;YACAW,cAAc;gBACZ,MAAM,IAAIX,MAAM;YAClB;YACAY,SAAS;gBACP,MAAM,IAAIZ,MAAM;YAClB;YACAa,YAAY;gBACV,MAAM,IAAIb,MAAM;YAClB;YACAc,WAAW;gBACT,MAAM,IAAId,MAAM;YAClB;YACAe,QAAQ;gBACN,MAAM,IAAIf,MAAM;YAClB;YAEA,oBAAoB;YACpBgB,cAAc;gBACZ,MAAM,IAAIhB,MAAM;YAClB;YACAiB,YAAY;gBACV,MAAM,IAAIjB,MAAM;YAClB;YACAkB,cAAc;gBACZ,MAAM,IAAIlB,MAAM;YAClB;YAEA,qBAAqB;YACrBmB,eAAe;gBACb,MAAM,IAAInB,MAAM;YAClB;YACAoB,eAAe;gBACb,MAAM,IAAIpB,MAAM;YAClB;YACAqB,gBAAgB;gBACd,MAAM,IAAIrB,MAAM;YAClB;YACAsB,cAAc;gBACZ,MAAM,IAAItB,MAAM;YAClB;YACAuB,eAAe;gBACb,MAAM,IAAIvB,MAAM;YAClB;YAEA,4BAA4B;YAC5BwB,qBAAqB;gBACnB,MAAM,IAAIxB,MAAM;YAClB;YACAyB,qBAAqB;gBACnB,MAAM,IAAIzB,MAAM;YAClB;YACA0B,oBAAoB;gBAClB,MAAM,IAAI1B,MAAM;YAClB;YACA2B,qBAAqB;gBACnB,MAAM,IAAI3B,MAAM;YAClB;YAEA,mBAAmB;YACnB4B,aAAa;gBACX,MAAM,IAAI5B,MAAM;YAClB;YAEA,iBAAiB;YACjB6B,YAAY;gBACV,MAAM,IAAI7B,MAAM;YAClB;YAEA,uBAAuB;YACvB8B,iBAAiB;gBACf,MAAM,IAAI9B,MAAM;YAClB;YACA+B,SAAS;gBACP,MAAM,IAAI/B,MAAM;YAClB;YACAgC,aAAa;gBACX,MAAM,IAAIhC,MAAM;YAClB;YACAiC,cAAc;gBACZ,MAAM,IAAIjC,MAAM;YAClB;YACAkC,gBAAgB;gBACd,MAAM,IAAIlC,MAAM;YAClB;YACAmC,cAAc;gBACZ,MAAM,IAAInC,MAAM;YAClB;YACAoC,eAAe;gBACb,MAAM,IAAIpC,MAAM;YAClB;YACAqC,cAAc;QAChB;IACF;IAEA,OAAO;QACLzC,MAAM;QACNC,eAAe;QACfK,MAAMR;IACR;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-config.d.ts","sourceRoot":"","sources":["../../src/plugin/build-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAQtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA;CAC1B,GAAG;IACF,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,CAAA;QAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAC3B,CAAA;CACF,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;AAE7B;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAoC/E"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugin/build-config.ts"],"sourcesContent":["import type { Config, SanitizedConfig } from 'payload'\n\nimport { lexicalEditor } from '@payloadcms/richtext-lexical'\nimport { buildConfig as payloadBuildConfig } from 'payload'\n\nimport { oAuth2Plugin } from '../oauth/index.js'\nimport { figmaContentSystem } from './adapter.js'\n\n/**\n * Configuration type for Payload projects on the Figma platform.\n *\n * Differences from standard Payload Config:\n * - `db`: Omitted (auto-injected by Figma platform)\n * - `secret`: Omitted (auto-injected by Figma platform)\n * - `editor`: Optional (defaults to lexicalEditor() if not provided)\n *\n * @example\n * // Minimal config\n * const config: FigmaConfig = {\n * collections: [...]\n * }\n *\n * @example\n * // With custom editor\n * const config: FigmaConfig = {\n * collections: [...],\n * editor: lexicalEditor({ features: [...] })\n * }\n */\nexport type FigmaConfig = {\n editor?: Config['editor']\n} & {\n figma: {\n region: string\n tenantId: string\n useContentSystem?: boolean\n }\n} & Omit<Config, 'editor' | 'secret' | 'db'> &\n Partial<Pick<Config, 'db'>>\n\n/**\n * Figma platform wrapper for Payload's buildConfig.\n * Automatically injects:\n * - Figma database adapter\n * - Secret (platform-provided)\n * - Default lexicalEditor (if no custom editor specified)\n *\n * @param config - Payload configuration (db and secret omitted, editor optional)\n * @returns Promise<SanitizedConfig> - Built Payload configuration\n */\nexport async function buildConfig(config: FigmaConfig): Promise<SanitizedConfig> {\n // Build complete config with Figma platform defaults\n const configWithFigmaDefaults: Config = {\n ...config,\n db: config.figma.useContentSystem ? figmaContentSystem() : config.db!,\n editor: config.editor ?? lexicalEditor(),\n secret: 'MY_SECRET',\n // Add oauth to plugins if not already present\n plugins: [\n ...(config.plugins ?? []),\n oAuth2Plugin({\n collections: [\n {\n slug: 'users',\n // Use adapter because Figma app doesn't support OIDC scopes\n authorizationURLParams: {\n response_mode: 'query',\n response_type: 'code',\n },\n clientID: process.env.FIGMA_OAUTH_CLIENT_ID!,\n clientSecret: process.env.FIGMA_OAUTH_CLIENT_SECRET,\n identityMetadata: 'https://staging.figma.com/.well-known/openid-configuration',\n scope: ['current_user:read'],\n token: 'id_token', // Adapter creates JWT id_token from Figma user info\n usernameField: 'email',\n },\n ],\n debug: true,\n disabled: false,\n redirectServerURL: 'http://localhost:3000',\n }),\n ],\n }\n\n // Delegate to Payload's buildConfig\n return await payloadBuildConfig(configWithFigmaDefaults)\n}\n"],"names":["lexicalEditor","buildConfig","payloadBuildConfig","oAuth2Plugin","figmaContentSystem","config","configWithFigmaDefaults","db","figma","useContentSystem","editor","secret","plugins","collections","slug","authorizationURLParams","response_mode","response_type","clientID","process","env","FIGMA_OAUTH_CLIENT_ID","clientSecret","FIGMA_OAUTH_CLIENT_SECRET","identityMetadata","scope","token","usernameField","debug","disabled","redirectServerURL"],"mappings":"AAEA,SAASA,aAAa,QAAQ,+BAA8B;AAC5D,SAASC,eAAeC,kBAAkB,QAAQ,UAAS;AAE3D,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,kBAAkB,QAAQ,eAAc;AAkCjD;;;;;;;;;CASC,GACD,OAAO,eAAeH,YAAYI,MAAmB;IACnD,qDAAqD;IACrD,MAAMC,0BAAkC;QACtC,GAAGD,MAAM;QACTE,IAAIF,OAAOG,KAAK,CAACC,gBAAgB,GAAGL,uBAAuBC,OAAOE,EAAE;QACpEG,QAAQL,OAAOK,MAAM,IAAIV;QACzBW,QAAQ;QACR,8CAA8C;QAC9CC,SAAS;eACHP,OAAOO,OAAO,IAAI,EAAE;YACxBT,aAAa;gBACXU,aAAa;oBACX;wBACEC,MAAM;wBACN,4DAA4D;wBAC5DC,wBAAwB;4BACtBC,eAAe;4BACfC,eAAe;wBACjB;wBACAC,UAAUC,QAAQC,GAAG,CAACC,qBAAqB;wBAC3CC,cAAcH,QAAQC,GAAG,CAACG,yBAAyB;wBACnDC,kBAAkB;wBAClBC,OAAO;4BAAC;yBAAoB;wBAC5BC,OAAO;wBACPC,eAAe;oBACjB;iBACD;gBACDC,OAAO;gBACPC,UAAU;gBACVC,mBAAmB;YACrB;SACD;IACH;IAEA,oCAAoC;IACpC,OAAO,MAAM5B,mBAAmBI;AAClC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,yCAAyC;IACzC,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,WAAW,CAAA;IACxC,oBAAoB;IACpB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,cAAc,CAAA;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,UAAU,EAAE,OAAO,CAAA;IACnB,iDAAiD;IACjD,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;IACxC,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types/config.ts"],"sourcesContent":["/**\n * Figma CMS Configuration Types\n */\n\n/**\n * Tenant instance from Control Plane API\n */\nexport interface Tenant {\n /** Creation timestamp */\n createdAt?: string\n /** Domain name (e.g., my-cms.figmacms.com) */\n domain: string\n /** Unique tenant ID */\n id: string\n /** Parent ID */\n parentId: string\n /** Parent type (team, org, workspace) */\n parentType: 'org' | 'team' | 'workspace'\n /** Tenant status */\n status: 'active' | 'inactive' | 'provisioning'\n}\n\n/**\n * Project information from detection\n */\nexport interface ProjectInfo {\n /** Whether Payload is installed */\n hasPayload: boolean\n /** Package manager detected (npm, pnpm, yarn) */\n packageManager?: 'npm' | 'pnpm' | 'yarn'\n /** Project root path */\n path: string\n /** Payload version if installed */\n payloadVersion?: string\n}\n"],"names":[],"mappings":"AAAA;;CAEC,GAED;;CAEC,GAgBD;;CAEC,GACD,WASC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAE1B,MAAM,WAAW,IAAK,SAAQ,GAAG,CAAC,IAAI;IACpC,SAAS,EAAE,kBAAkB,CAAA;IAC7B,SAAS,EAAE,kBAAkB,CAAA;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,UAAU,EAAE,kBAAkB,CAAA;IAC9B,OAAO,EAAE,kBAAkB,CAAA;IAI3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAEtC,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,cAAc,CAAA;AAE1D,MAAM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WAAW,GAAG,WAAW,GAAG,mBAAmB,CAAA"}
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type arg from 'arg'\n\nexport interface Args extends arg.Spec {\n '--debug': BooleanConstructor\n '--force': BooleanConstructor\n '--help': BooleanConstructor\n '--list': BooleanConstructor\n '--logout': BooleanConstructor\n '--yes': BooleanConstructor\n\n // Aliases\n\n '-f': string\n '-h': string\n '-y': string\n}\n\nexport type CliArgs = arg.Result<Args>\n\nexport type ProjectTemplate = GitTemplate | PluginTemplate\n\nexport type ProjectExample = {\n name: string\n url: string\n}\n\n/**\n * Template that is cloned verbatim from a git repo\n * Performs .env manipulation based upon input\n */\nexport interface GitTemplate extends Template {\n type: 'starter'\n url: string\n}\n\n/**\n * Type specifically for the plugin template\n * No .env manipulation is done\n */\nexport interface PluginTemplate extends Template {\n type: 'plugin'\n url: string\n}\n\ninterface Template {\n description?: string\n name: string\n type: ProjectTemplate['type']\n}\n\nexport type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn'\n\nexport type DbType = 'd1-sqlite' | 'mongodb' | 'postgres' | 'sqlite' | 'vercel-postgres'\n\nexport type DbDetails = {\n dbUri?: string\n type: DbType\n}\n\nexport type EditorType = 'lexical' | 'slate'\n\nexport type NextAppDetails = {\n hasTopLevelLayout: boolean\n isPayloadInstalled?: boolean\n isSrcDir: boolean\n isSupportedNextVersion: boolean\n nextAppDir?: string\n nextConfigPath?: string\n nextConfigType?: NextConfigType\n nextVersion: null | string\n}\n\nexport type NextConfigType = 'cjs' | 'esm' | 'ts'\n\nexport type StorageAdapterType = 'localDisk' | 'r2Storage' | 'vercelBlobStorage'\n"],"names":[],"mappings":"AA0EA,WAAgF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"asset-collection.d.ts","sourceRoot":"","sources":["../../src/utils/asset-collection.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnE;AAgDD;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAchF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBxE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/asset-collection.ts"],"sourcesContent":["import { exec } from 'child_process'\nimport fs from 'fs/promises'\nimport path from 'path'\nimport { promisify } from 'util'\n\nimport * as log from './log.js'\n\nconst execAsync = promisify(exec)\n\n// Maximum file size for static assets (S3 limitation)\nconst MAX_ASSET_SIZE = 50 * 1024 * 1024 // 50MB\n\n/**\n * Get file size in bytes\n *\n * @param filePath - Absolute path to file\n * @returns File size in bytes\n */\nexport async function getFileSize(filePath: string): Promise<number> {\n const stats = await fs.stat(filePath)\n return stats.size\n}\n\n/**\n * Recursively collect files from a directory\n *\n * Excludes files larger than 50MB (S3 limitation).\n * Warns user when files are excluded due to size.\n *\n * @param dir - Directory to scan\n * @param baseDir - Base directory for relative paths\n * @returns Array of relative file paths\n */\nasync function collectFiles(dir: string, baseDir: string): Promise<string[]> {\n const files: string[] = []\n\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n // Recursively collect from subdirectories\n const subFiles = await collectFiles(fullPath, baseDir)\n files.push(...subFiles)\n } else if (entry.isFile()) {\n // Check file size before adding\n const stats = await fs.stat(fullPath)\n if (stats.size <= MAX_ASSET_SIZE) {\n // Add relative path from base directory\n const relativePath = path.relative(baseDir, fullPath)\n files.push(relativePath)\n } else {\n // Warn user about skipped files\n const sizeMB = (stats.size / (1024 * 1024)).toFixed(2)\n const relativePath = path.relative(baseDir, fullPath)\n log.warning(`Skipping large asset: ${relativePath} (${sizeMB}MB exceeds 50MB limit)`)\n }\n }\n }\n } catch {\n // Directory doesn't exist or not accessible\n return []\n }\n\n return files\n}\n\n/**\n * Collect all static asset paths from .next/static\n *\n * Returns paths relative to project root, formatted for S3:\n * - `.next/static/chunks/main.js` → `_next/static/chunks/main.js`\n *\n * @param projectPath - Path to project root\n * @returns Array of static asset paths (using _next prefix)\n */\nexport async function collectStaticAssets(projectPath: string): Promise<string[]> {\n const staticDir = path.join(projectPath, '.next', 'static')\n\n try {\n await fs.stat(staticDir)\n } catch {\n // No static directory\n return []\n }\n\n const files = await collectFiles(staticDir, projectPath)\n\n // Convert .next/static to _next/static (Next.js convention)\n return files.map((file) => file.replace(/^\\.next\\//, '_next/'))\n}\n\n/**\n * Create Lambda deployment zip using build_for_lambda.sh\n *\n * This script:\n * - Copies static files to standalone build\n * - Creates lambda.zip from .next/standalone/\n * - Places zip at project root\n *\n * @param projectPath - Path to project root\n * @throws Error if script missing or execution fails\n */\nexport async function createLambdaZip(projectPath: string): Promise<void> {\n const scriptPath = path.join(projectPath, 'build_for_lambda.sh')\n\n // Check if script exists\n try {\n await fs.stat(scriptPath)\n } catch {\n throw new Error('build_for_lambda.sh not found. Run init command to set up project.')\n }\n\n // Execute script\n try {\n await execAsync('./build_for_lambda.sh', { cwd: projectPath })\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Unknown error'\n throw new Error(`Failed to create Lambda zip: ${message}`)\n }\n\n // Verify zip was created\n const zipPath = path.join(projectPath, 'lambda.zip')\n try {\n await fs.stat(zipPath)\n } catch {\n throw new Error('lambda.zip was not created by build_for_lambda.sh')\n }\n}\n"],"names":["exec","fs","path","promisify","log","execAsync","MAX_ASSET_SIZE","getFileSize","filePath","stats","stat","size","collectFiles","dir","baseDir","files","entries","readdir","withFileTypes","entry","fullPath","join","name","isDirectory","subFiles","push","isFile","relativePath","relative","sizeMB","toFixed","warning","collectStaticAssets","projectPath","staticDir","map","file","replace","createLambdaZip","scriptPath","Error","cwd","error","message","zipPath"],"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Aa,EAAE,EAAEE,OAAO,sBAAsB,CAAC;gBACtF;YACF;QACF;IACF,EAAE,OAAM;QACN,4CAA4C;QAC5C,OAAO,EAAE;IACX;IAEA,OAAOd;AACT;AAEA;;;;;;;;CAQC,GACD,OAAO,eAAeiB,oBAAoBC,WAAmB;IAC3D,MAAMC,YAAYhC,KAAKmB,IAAI,CAACY,aAAa,SAAS;IAElD,IAAI;QACF,MAAMhC,GAAGS,IAAI,CAACwB;IAChB,EAAE,OAAM;QACN,sBAAsB;QACtB,OAAO,EAAE;IACX;IAEA,MAAMnB,QAAQ,MAAMH,aAAasB,WAAWD;IAE5C,4DAA4D;IAC5D,OAAOlB,MAAMoB,GAAG,CAAC,CAACC,OAASA,KAAKC,OAAO,CAAC,aAAa;AACvD;AAEA;;;;;;;;;;CAUC,GACD,OAAO,eAAeC,gBAAgBL,WAAmB;IACvD,MAAMM,aAAarC,KAAKmB,IAAI,CAACY,aAAa;IAE1C,yBAAyB;IACzB,IAAI;QACF,MAAMhC,GAAGS,IAAI,CAAC6B;IAChB,EAAE,OAAM;QACN,MAAM,IAAIC,MAAM;IAClB;IAEA,iBAAiB;IACjB,IAAI;QACF,MAAMnC,UAAU,yBAAyB;YAAEoC,KAAKR;QAAY;IAC9D,EAAE,OAAOS,OAAO;QACd,MAAMC,UAAUD,iBAAiBF,QAAQE,MAAMC,OAAO,GAAG;QACzD,MAAM,IAAIH,MAAM,CAAC,6BAA6B,EAAEG,SAAS;IAC3D;IAEA,yBAAyB;IACzB,MAAMC,UAAU1C,KAAKmB,IAAI,CAACY,aAAa;IACvC,IAAI;QACF,MAAMhC,GAAGS,IAAI,CAACkC;IAChB,EAAE,OAAM;QACN,MAAM,IAAIJ,MAAM;IAClB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-detection.d.ts","sourceRoot":"","sources":["../../src/utils/build-detection.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,YAAY,EAAE,OAAO,CAAA;IACrB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,2CAA2C;IAC3C,SAAS,EAAE,IAAI,CAAA;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CA6BhF;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAUjF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/build-detection.ts"],"sourcesContent":["import fs from 'fs/promises'\nimport path from 'path'\n\n/**\n * Information about a detected build\n */\nexport interface BuildInfo {\n /** Build ID from .next/BUILD_ID */\n buildId: string\n /** Whether lambda.zip already exists */\n hasLambdaZip: boolean\n /** Path to .next/standalone */\n path: string\n /** Build timestamp from server.js mtime */\n timestamp: Date\n}\n\n/**\n * Detect if a valid Lambda-ready build exists\n *\n * Checks for:\n * - .next/standalone/server.js (required for Lambda)\n * - .next/BUILD_ID (Next.js build identifier)\n *\n * @param projectPath - Path to project root\n * @returns Build info if valid build found, null otherwise\n */\nexport async function detectBuild(projectPath: string): Promise<BuildInfo | null> {\n try {\n // Check for .next/standalone/server.js\n const serverPath = path.join(projectPath, '.next', 'standalone', 'server.js')\n const serverStat = await fs.stat(serverPath)\n\n // Check for .next/BUILD_ID\n const buildIdPath = path.join(projectPath, '.next', 'BUILD_ID')\n const buildId = (await fs.readFile(buildIdPath, 'utf-8')).trim()\n\n // Check for lambda.zip\n const lambdaZipPath = path.join(projectPath, 'lambda.zip')\n let hasLambdaZip = false\n try {\n await fs.stat(lambdaZipPath)\n hasLambdaZip = true\n } catch {\n hasLambdaZip = false\n }\n\n return {\n buildId,\n hasLambdaZip,\n path: '.next/standalone',\n timestamp: serverStat.mtime,\n }\n } catch {\n return null\n }\n}\n\n/**\n * Get the build command from package.json\n *\n * @param projectPath - Path to project root\n * @returns Build command string if found, null otherwise\n */\nexport async function getBuildCommand(projectPath: string): Promise<null | string> {\n try {\n const packageJsonPath = path.join(projectPath, 'package.json')\n const content = await fs.readFile(packageJsonPath, 'utf-8')\n const packageJson = JSON.parse(content)\n\n return packageJson.scripts?.build || null\n } catch {\n return null\n }\n}\n"],"names":["fs","path","detectBuild","projectPath","serverPath","join","serverStat","stat","buildIdPath","buildId","readFile","trim","lambdaZipPath","hasLambdaZip","timestamp","mtime","getBuildCommand","packageJsonPath","content","packageJson","JSON","parse","scripts","build"],"mappings":"AAAA,OAAOA,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAgBvB;;;;;;;;;CASC,GACD,OAAO,eAAeC,YAAYC,WAAmB;IACnD,IAAI;QACF,uCAAuC;QACvC,MAAMC,aAAaH,KAAKI,IAAI,CAACF,aAAa,SAAS,cAAc;QACjE,MAAMG,aAAa,MAAMN,GAAGO,IAAI,CAACH;QAEjC,2BAA2B;QAC3B,MAAMI,cAAcP,KAAKI,IAAI,CAACF,aAAa,SAAS;QACpD,MAAMM,UAAU,AAAC,CAAA,MAAMT,GAAGU,QAAQ,CAACF,aAAa,QAAO,EAAGG,IAAI;QAE9D,uBAAuB;QACvB,MAAMC,gBAAgBX,KAAKI,IAAI,CAACF,aAAa;QAC7C,IAAIU,eAAe;QACnB,IAAI;YACF,MAAMb,GAAGO,IAAI,CAACK;YACdC,eAAe;QACjB,EAAE,OAAM;YACNA,eAAe;QACjB;QAEA,OAAO;YACLJ;YACAI;YACAZ,MAAM;YACNa,WAAWR,WAAWS,KAAK;QAC7B;IACF,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA;;;;;CAKC,GACD,OAAO,eAAeC,gBAAgBb,WAAmB;IACvD,IAAI;QACF,MAAMc,kBAAkBhB,KAAKI,IAAI,CAACF,aAAa;QAC/C,MAAMe,UAAU,MAAMlB,GAAGU,QAAQ,CAACO,iBAAiB;QACnD,MAAME,cAAcC,KAAKC,KAAK,CAACH;QAE/B,OAAOC,YAAYG,OAAO,EAAEC,SAAS;IACvC,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhG"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/config.ts"],"sourcesContent":["/**\n * Configuration file management utilities\n */\n\nimport fs from 'fs/promises'\nimport path from 'path'\n\nconst GITIGNORE_FILENAME = '.gitignore'\n\n/**\n * Ensure .gitignore exists and optionally add entries\n *\n * @param projectPath - Path to project directory\n * @param entries - Optional entries to add to .gitignore\n */\nexport async function ensureGitignore(projectPath: string, entries: string[] = []): Promise<void> {\n const gitignorePath = path.join(projectPath, GITIGNORE_FILENAME)\n\n let existingContent = ''\n try {\n existingContent = await fs.readFile(gitignorePath, 'utf-8')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n throw new Error(`Failed to read ${GITIGNORE_FILENAME}: ${(error as Error).message}`)\n }\n }\n\n // Parse existing entries\n const existingLines = existingContent.split('\\n').filter((line) => line.trim())\n const existingSet = new Set(existingLines)\n\n // Add new entries that don't exist\n const newEntries = entries.filter((entry) => !existingSet.has(entry))\n\n if (newEntries.length > 0) {\n const newContent = existingContent\n ? `${existingContent.trimEnd()}\\n\\n# Figma CMS\\n${newEntries.join('\\n')}\\n`\n : `# Figma CMS\\n${newEntries.join('\\n')}\\n`\n\n await fs.writeFile(gitignorePath, newContent, 'utf-8')\n }\n}\n"],"names":["fs","path","GITIGNORE_FILENAME","ensureGitignore","projectPath","entries","gitignorePath","join","existingContent","readFile","error","code","Error","message","existingLines","split","filter","line","trim","existingSet","Set","newEntries","entry","has","length","newContent","trimEnd","writeFile"],"mappings":"AAAA;;CAEC,GAED,OAAOA,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB,MAAMC,qBAAqB;AAE3B;;;;;CAKC,GACD,OAAO,eAAeC,gBAAgBC,WAAmB,EAAEC,UAAoB,EAAE;IAC/E,MAAMC,gBAAgBL,KAAKM,IAAI,CAACH,aAAaF;IAE7C,IAAIM,kBAAkB;IACtB,IAAI;QACFA,kBAAkB,MAAMR,GAAGS,QAAQ,CAACH,eAAe;IACrD,EAAE,OAAOI,OAAO;QACd,IAAI,AAACA,MAAgCC,IAAI,KAAK,UAAU;YACtD,MAAM,IAAIC,MAAM,CAAC,eAAe,EAAEV,mBAAmB,EAAE,EAAE,AAACQ,MAAgBG,OAAO,EAAE;QACrF;IACF;IAEA,yBAAyB;IACzB,MAAMC,gBAAgBN,gBAAgBO,KAAK,CAAC,MAAMC,MAAM,CAAC,CAACC,OAASA,KAAKC,IAAI;IAC5E,MAAMC,cAAc,IAAIC,IAAIN;IAE5B,mCAAmC;IACnC,MAAMO,aAAahB,QAAQW,MAAM,CAAC,CAACM,QAAU,CAACH,YAAYI,GAAG,CAACD;IAE9D,IAAID,WAAWG,MAAM,GAAG,GAAG;QACzB,MAAMC,aAAajB,kBACf,GAAGA,gBAAgBkB,OAAO,GAAG,iBAAiB,EAAEL,WAAWd,IAAI,CAAC,MAAM,EAAE,CAAC,GACzE,CAAC,aAAa,EAAEc,WAAWd,IAAI,CAAC,MAAM,EAAE,CAAC;QAE7C,MAAMP,GAAG2B,SAAS,CAACrB,eAAemB,YAAY;IAChD;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"download-template.d.ts","sourceRoot":"","sources":["../../src/utils/download-template.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAGrC,KAAK,CAAC,EAAE,KAAK;gBADpB,OAAO,EAAE,MAAM,EACR,KAAK,CAAC,EAAE,KAAK,YAAA;CAKvB;AAOD;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBlF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/download-template.ts"],"sourcesContent":["import fs from 'node:fs/promises'\nimport { Readable } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport { x } from 'tar'\n\n/**\n * Error thrown when template download fails\n */\nexport class TemplateDownloadError extends Error {\n constructor(\n message: string,\n public cause?: Error,\n ) {\n super(message)\n this.name = 'TemplateDownloadError'\n }\n}\n\nconst BRANCH_OR_TAG = 'main'\nconst TEMPLATE_NAME = 'blank'\nconst MAX_RETRIES = 3\nconst INITIAL_RETRY_DELAY = 1000 // 1 second\n\n/**\n * Download Payload template from GitHub with retry logic\n *\n * @param projectDir - Directory to extract template into\n * @throws TemplateDownloadError if download fails\n */\nexport async function downloadTemplateFromGitHub(projectDir: string): Promise<void> {\n let lastError: Error | undefined\n\n for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {\n try {\n await downloadTemplateAttempt(projectDir)\n return // Success\n } catch (error) {\n lastError = error instanceof Error ? error : new Error('Unknown error')\n\n if (attempt < MAX_RETRIES) {\n // Exponential backoff: 1s, 2s, 4s\n const delay = INITIAL_RETRY_DELAY * Math.pow(2, attempt - 1)\n await new Promise((resolve) => setTimeout(resolve, delay))\n }\n }\n }\n\n // All retries failed\n throw new TemplateDownloadError(\n `Failed to download template after ${MAX_RETRIES} attempts`,\n lastError,\n )\n}\n\n/**\n * Single attempt to download template (extracted for retry logic)\n */\nasync function downloadTemplateAttempt(projectDir: string): Promise<void> {\n const url = `https://codeload.github.com/payloadcms/payload/tar.gz/${BRANCH_OR_TAG}`\n const filter = `payload-${BRANCH_OR_TAG}/templates/${TEMPLATE_NAME}/`\n\n try {\n // Ensure target directory exists\n await fs.mkdir(projectDir, { recursive: true })\n\n await pipeline(\n await downloadTarStream(url),\n x({\n cwd: projectDir,\n filter: (p) => p.includes(filter),\n strip: 2 + TEMPLATE_NAME.split('/').length,\n }),\n )\n } catch (error) {\n throw new TemplateDownloadError(\n 'Failed to download template from GitHub',\n error instanceof Error ? error : undefined,\n )\n }\n}\n\n/**\n * Download tar stream from URL\n */\nasync function downloadTarStream(url: string): Promise<Readable> {\n const res = await fetch(url)\n\n if (!res.ok) {\n throw new Error(`HTTP ${res.status}: ${res.statusText}`)\n }\n\n if (!res.body) {\n throw new Error(`Failed to download: ${url}`)\n }\n\n return Readable.from(res.body as unknown as NodeJS.ReadableStream)\n}\n"],"names":["fs","Readable","pipeline","x","TemplateDownloadError","Error","message","cause","name","BRANCH_OR_TAG","TEMPLATE_NAME","MAX_RETRIES","INITIAL_RETRY_DELAY","downloadTemplateFromGitHub","projectDir","lastError","attempt","downloadTemplateAttempt","error","delay","Math","pow","Promise","resolve","setTimeout","url","filter","mkdir","recursive","downloadTarStream","cwd","p","includes","strip","split","length","undefined","res","fetch","ok","status","statusText","body","from"],"mappings":"AAAA,OAAOA,QAAQ,mBAAkB;AACjC,SAASC,QAAQ,QAAQ,cAAa;AACtC,SAASC,QAAQ,QAAQ,uBAAsB;AAC/C,SAASC,CAAC,QAAQ,MAAK;AAEvB;;CAEC,GACD,OAAO,MAAMC,8BAA8BC;;IACzC,YACEC,OAAe,EACf,AAAOC,KAAa,CACpB;QACA,KAAK,CAACD,eAFCC,QAAAA;QAGP,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,MAAMC,gBAAgB;AACtB,MAAMC,gBAAgB;AACtB,MAAMC,cAAc;AACpB,MAAMC,sBAAsB,KAAK,WAAW;;AAE5C;;;;;CAKC,GACD,OAAO,eAAeC,2BAA2BC,UAAkB;IACjE,IAAIC;IAEJ,IAAK,IAAIC,UAAU,GAAGA,WAAWL,aAAaK,UAAW;QACvD,IAAI;YACF,MAAMC,wBAAwBH;YAC9B,QAAO,UAAU;QACnB,EAAE,OAAOI,OAAO;YACdH,YAAYG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@@
1
- {"version":3,"file":"env-management.d.ts","sourceRoot":"","sources":["../../src/utils/env-management.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAoDD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8CzE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/env-management.ts"],"sourcesContent":["import { randomBytes } from 'crypto'\nimport fs from 'fs/promises'\nimport path from 'path'\n\n/**\n * Generate a cryptographically secure secret for PAYLOAD_SECRET\n *\n * @returns 24-character hexadecimal string\n */\nexport function generateSecret(): string {\n return randomBytes(32).toString('hex').slice(0, 24)\n}\n\n/**\n * Sanitize and process environment file contents\n *\n * @param contents - Raw .env file contents\n * @param payloadSecret - Secret to use for PAYLOAD_SECRET\n * @returns Processed .env contents\n */\nfunction sanitizeEnv(contents: string, payloadSecret: string): string {\n const lines = contents.split('\\n')\n const seenKeys = new Set<string>()\n const processedLines: string[] = []\n\n for (const line of lines) {\n // Skip empty lines and comments\n if (!line.trim() || line.trim().startsWith('#')) {\n processedLines.push(line)\n continue\n }\n\n // Skip lines without =\n if (!line.includes('=')) {\n processedLines.push(line)\n continue\n }\n\n const [key] = line.split('=')\n const trimmedKey = key.trim()\n\n // Skip duplicate keys\n if (seenKeys.has(trimmedKey)) {\n continue\n }\n seenKeys.add(trimmedKey)\n\n // Replace PAYLOAD_SECRET with actual value\n if (trimmedKey === 'PAYLOAD_SECRET' || trimmedKey === 'PAYLOAD_SECRET_KEY') {\n processedLines.push(`PAYLOAD_SECRET=${payloadSecret}`)\n } else {\n processedLines.push(line)\n }\n }\n\n // Add PAYLOAD_SECRET if not present\n if (!seenKeys.has('PAYLOAD_SECRET') && !seenKeys.has('PAYLOAD_SECRET_KEY')) {\n processedLines.push(`PAYLOAD_SECRET=${payloadSecret}`)\n }\n\n return processedLines.join('\\n')\n}\n\n/**\n * Manage environment files for a new project\n *\n * Creates .env from .env.example (if exists) and populates PAYLOAD_SECRET\n *\n * @param projectPath - Path to project directory\n * @returns The generated payload secret\n */\nexport async function manageEnvFiles(projectPath: string): Promise<string> {\n const payloadSecret = generateSecret()\n const envExamplePath = path.join(projectPath, '.env.example')\n const envPath = path.join(projectPath, '.env')\n\n try {\n // Check if .env.example exists\n let envExampleContents = ''\n try {\n envExampleContents = await fs.readFile(envExamplePath, 'utf-8')\n } catch {\n // No .env.example, create minimal .env\n envExampleContents = ''\n }\n\n // Check if .env already exists\n let envExists = false\n try {\n await fs.access(envPath)\n envExists = true\n } catch {\n // .env doesn't exist\n }\n\n if (!envExists) {\n // Create .env from .env.example\n const sanitized = sanitizeEnv(envExampleContents, payloadSecret)\n await fs.writeFile(envPath, sanitized, 'utf-8')\n } else {\n // Update existing .env if it doesn't have PAYLOAD_SECRET\n const existingContents = await fs.readFile(envPath, 'utf-8')\n if (\n !existingContents.includes('PAYLOAD_SECRET=') &&\n !existingContents.includes('PAYLOAD_SECRET_KEY=')\n ) {\n const sanitized = sanitizeEnv(existingContents, payloadSecret)\n await fs.writeFile(envPath, sanitized, 'utf-8')\n }\n }\n\n return payloadSecret\n } catch (error) {\n throw new Error(\n `Failed to manage environment files: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n }\n}\n"],"names":["randomBytes","fs","path","generateSecret","toString","slice","sanitizeEnv","contents","payloadSecret","lines","split","seenKeys","Set","processedLines","line","trim","startsWith","push","includes","key","trimmedKey","has","add","join","manageEnvFiles","projectPath","envExamplePath","envPath","envExampleContents","readFile","envExists","access","sanitized","writeFile","existingContents","error","Error","message"],"mappings":"AAAA,SAASA,WAAW,QAAQ,SAAQ;AACpC,OAAOC,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB;;;;CAIC,GACD,OAAO,SAASC;IACd,OAAOH,YAAY,IAAII,QAAQ,CAAC,OAAOC,KAAK,CAAC,GAAG;AAClD;AAEA;;;;;;CAMC,GACD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AuC;YACvCE,qBAAqB;QACvB;QAEA,+BAA+B;QAC/B,IAAIE,YAAY;QAChB,IAAI;YACF,MAAM7B,GAAG8B,MAAM,CAACJ;YAChBG,YAAY;QACd,EAAE,OAAM;QACN,qBAAqB;QACvB;QAEA,IAAI,CAACA,WAAW;YACd,gCAAgC;YAChC,MAAME,YAAY1B,YAAYsB,oBAAoBpB;YAClD,MAAMP,GAAGgC,SAAS,CAACN,SAASK,WAAW;QACzC,OAAO;YACL,yDAAyD;YACzD,MAAME,mBAAmB,MAAMjC,GAAG4B,QAAQ,CAACF,SAAS;YACpD,IACE,CAACO,iBAAiBhB,QAAQ,CAAC,sBAC3B,CAACgB,iBAAiBhB,QAAQ,CAAC,wBAC3B;gBACA,MAAMc,YAAY1B,YAAY4B,kBAAkB1B;gBAChD,MAAMP,GAAGgC,SAAS,CAACN,SAASK,WAAW;YACzC;QACF;QAEA,OAAOxB;IACT,EAAE,OAAO2B,OAAO;QACd,MAAM,IAAIC,MACR,CAAC,oCAAoC,EAAED,iBAAiBC,QAAQD,MAAME,OAAO,GAAG,iBAAiB;IAErG;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA0B5D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK/C"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/format.ts"],"sourcesContent":["/**\n * Shared formatting utilities for CLI output\n */\n\n/**\n * Format a timestamp (in milliseconds) to a localized string\n * @param ms - Timestamp in milliseconds since epoch\n * @returns Localized date/time string\n */\nexport function formatTime(ms: number): string {\n const date = new Date(ms)\n return date.toLocaleString()\n}\n\n/**\n * Get a human-readable string describing time until expiry\n * @param expiresAt - Expiry timestamp in milliseconds since epoch\n * @returns Human-readable time until/since expiry (e.g., \"in 2 hours\", \"expired 5 minutes ago\")\n */\nexport function getTimeUntilExpiry(expiresAt: number): string {\n const now = Date.now()\n const diff = expiresAt - now\n\n if (diff < 0) {\n const minutes = Math.floor(Math.abs(diff) / 60000)\n const hours = Math.floor(minutes / 60)\n\n if (hours > 0) {\n return `expired ${hours} hour${hours > 1 ? 's' : ''} ago`\n }\n return `expired ${minutes} minute${minutes > 1 ? 's' : ''} ago`\n }\n\n const minutes = Math.floor(diff / 60000)\n const hours = Math.floor(minutes / 60)\n\n if (hours > 0) {\n const remainingMinutes = minutes % 60\n if (remainingMinutes > 0) {\n return `in ${hours} hour${hours > 1 ? 's' : ''} ${remainingMinutes} minute${remainingMinutes > 1 ? 's' : ''}`\n }\n return `in ${hours} hour${hours > 1 ? 's' : ''}`\n }\n\n return `in ${minutes} minute${minutes > 1 ? 's' : ''}`\n}\n\n/**\n * Mask a token for safe display\n * Shows first 4 and last 4 characters, masks the middle\n * @param token - Token string to mask\n * @returns Masked token string (e.g., \"eyJh********************************mFbc\")\n */\nexport function maskToken(token: string): string {\n if (token.length <= 8) {\n return '***'\n }\n return `${token.slice(0, 4)}${'*'.repeat(Math.min(token.length - 8, 32))}${token.slice(-4)}`\n}\n"],"names":["formatTime","ms","date","Date","toLocaleString","getTimeUntilExpiry","expiresAt","now","diff","minutes","Math","floor","abs","hours","remainingMinutes","maskToken","token","length","slice","repeat","min"],"mappings":"AAAA;;CAEC,GAED;;;;CAIC,GACD,OAAO,SAASA,WAAWC,EAAU;IACnC,MAAMC,OAAO,IAAIC,KAAKF;IACtB,OAAOC,KAAKE,cAAc;AAC5B;AAEA;;;;CAIC,GACD,OAAO,SAASC,mBAAmBC,SAAiB;IAClD,MAAMC,MAAMJ,KAAKI,GAAG;IACpB,MAAMC,OAAOF,YAAYC;IAEzB,IAAIC,OAA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D,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,YAAY,CAAC,CAmCvB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/formatter.ts"],"sourcesContent":["import { spawn } from 'child_process'\nimport path from 'path'\n\nimport type { PackageManager } from './package-manager.js'\n\nexport type FormatResult = {\n success: boolean\n warning?: string\n}\n\n/**\n * Format file with Prettier\n * Returns warning if formatting fails but does not throw\n */\nexport async function formatFile(\n filePath: string,\n packageManager: PackageManager,\n): Promise<FormatResult> {\n return new Promise((resolve) => {\n try {\n const args = ['exec', 'prettier', '--write', filePath]\n\n const child = spawn(packageManager, args, {\n cwd: path.dirname(filePath),\n shell: true,\n stdio: 'pipe',\n })\n\n child.on('close', (code) => {\n if (code === 0) {\n resolve({ success: true })\n } else {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n }\n })\n\n child.on('error', () => {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n })\n } catch {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n }\n })\n}\n"],"names":["spawn","path","formatFile","filePath","packageManager","Promise","resolve","args","child","cwd","dirname","shell","stdio","on","code","success","warning"],"mappings":"AAAA,SAASA,KAAK,QAAQ,gBAAe;AACrC,OAAOC,UAAU,OAAM;AASvB;;;CAGC,GACD,OAAO,eAAeC,WACpBC,QAAgB,EAChBC,cAA8B;IAE9B,OAAO,IAAIC,QAAQ,CAACC;QAClB,IAAI;YACF,MAAMC,OAAO;gBAAC;gBAAQ;gBAAY;gBAAWJ;aAAS;YAEtD,MAAMK,QAAQR,MAAMI,gBAAgBG,MAAM;gBACxCE,KAAKR,KAAKS,OAAO,CAACP;gBAClBQ,OAAO;gBACPC,OAAO;YACT;YAEAJ,MAAMK,EAAE,CAAC,SAAS,CAACC;gBACjB,IAAIA,SAAS,GAAG;oBACdR,QAAQ;wBAAES,SAAS;oBAAK;gBAC1B,OAAO;oBACLT,QAAQ;wBACNS,SAAS;wBACTC,SAAS;oBACX;gBACF;YACF;YAEAR,MAAMK,EAAE,CAAC,SAAS;gBAChBP,QAAQ;oBACNS,SAAS;oBACTC,SAAS;gBACX;YACF;QACF,EAAE,OAAM;YACNV,QAAQ;gBACNS,SAAS;gBACTC,SAAS;YACX;QACF;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAUtD;AAkBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CA4DjE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/git.ts"],"sourcesContent":["import { execSync } from 'child_process'\n\n/**\n * Check if a directory is already a git repository\n *\n * @param projectPath - Path to check\n * @returns True if directory is a git repo\n */\nexport function isGitRepo(projectPath: string): boolean {\n try {\n execSync('git rev-parse --is-inside-work-tree', {\n cwd: projectPath,\n stdio: 'ignore',\n })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Check if git has a default branch configured\n *\n * @returns True if default branch is configured\n */\nfunction ensureHasDefaultBranch(): boolean {\n try {\n execSync('git config init.defaultBranch', {\n stdio: 'ignore',\n })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Initialize a git repository and create an initial commit\n *\n * @param projectPath - Path to initialize git in\n * @returns True if successful, false otherwise\n */\nexport function tryInitRepoAndCommit(projectPath: string): boolean {\n try {\n // Check if git is available\n execSync('git -v', {\n stdio: 'ignore',\n })\n } catch {\n // Git not available\n return false\n }\n\n // Skip if already in a git repo\n if (isGitRepo(projectPath)) {\n return false\n }\n\n try {\n // Initialize git repository\n execSync('git init', {\n cwd: projectPath,\n stdio: 'ignore',\n })\n\n // Configure git user in CI environments (required for commits)\n if (process.env.CI) {\n execSync('git config user.email \"ci@payloadcms.com\"', {\n cwd: projectPath,\n stdio: 'ignore',\n })\n execSync('git config user.name \"Payload CI\"', {\n cwd: projectPath,\n stdio: 'ignore',\n })\n }\n\n // Create main branch if no default branch configured\n if (!ensureHasDefaultBranch()) {\n execSync('git checkout -b main', {\n cwd: projectPath,\n stdio: 'ignore',\n })\n }\n\n // Stage all files\n execSync('git add -A', {\n cwd: projectPath,\n stdio: 'ignore',\n })\n\n // Create initial commit\n execSync('git commit -m \"feat: initial commit\"', {\n cwd: projectPath,\n stdio: 'ignore',\n })\n\n return true\n } catch {\n // Git operations failed\n return false\n }\n}\n"],"names":["execSync","isGitRepo","projectPath","cwd","stdio","ensureHasDefaultBranch","tryInitRepoAndCommit","process","env","CI"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAe;AAExC;;;;;CAKC,GACD,OAAO,SAASC,UAAUC,WAAmB;IAC3C,IAAI;QACFF,SAAS,uCAAuC;YAC9CG,KAAKD;YACLE,OAAO;QACT;QACA,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA;;;;CAIC,GACD,SAASC;IACP,IAAI;QACFL,SAAS,iCAAiC;YACxCI,OAAO;QACT;QACA,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA;;;;;CAKC,GACD,OAAO,SAASE,qBAAqBJ,WAAmB;IACtD,IAAI;QACF,4BAA4B;QAC5BF,SAAS,UAAU;YACjBI,OAAO;QACT;IACF,EAAE,OAAM;QACN,oBAAoB;QACpB,OAAO;IACT;IAEA,gCAAgC;IAChC,IAAIH,UAAUC,cAAc;QAC1B,OAAO;IACT;IAEA,IAAI;QACF,4BAA4B;QAC5BF,SAAS,YAAY;YACnBG,KAAKD;YACLE,OAAO;QACT;QAEA,+DAA+D;QAC/D,IAAIG,QAAQC,GAAG,CAACC,EAAE,EAAE;YAClBT,SAAS,6CAA6C;gBACpDG,KAAKD;gBACLE,OAAO;YACT;YACAJ,SAAS,qCAAqC;gBAC5CG,KAAKD;gBACLE,OAAO;YACT;QACF;QAEA,qDAAqD;QACrD,IAAI,CAACC,0BAA0B;YAC7BL,SAAS,wBAAwB;gBAC/BG,KAAKD;gBACLE,OAAO;YACT;QACF;QAEA,kBAAkB;QAClBJ,SAAS,cAAc;YACrBG,KAAKD;YACLE,OAAO;QACT;QAEA,wBAAwB;QACxBJ,SAAS,wCAAwC;YAC/CG,KAAKD;YACLE,OAAO;QACT;QAEA,OAAO;IACT,EAAE,OAAM;QACN,wBAAwB;QACxB,OAAO;IACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-debug.d.ts","sourceRoot":"","sources":["../../src/utils/is-debug.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,OAAO,QAAO,OAE1B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/is-debug.ts"],"sourcesContent":["/**\n * Check if debug mode is enabled via DEBUG environment variable\n * @returns true if DEBUG environment variable is set to 'true'\n */\nexport const isDebug = (): boolean => {\n return process.env.DEBUG === 'true'\n}\n"],"names":["isDebug","process","env","DEBUG"],"mappings":"AAAA;;;CAGC,GACD,OAAO,MAAMA,UAAU;IACrB,OAAOC,QAAQC,GAAG,CAACC,KAAK,KAAK;AAC/B,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"lambda-config.d.ts","sourceRoot":"","sources":["../../src/utils/lambda-config.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCjF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/lambda-config.ts"],"sourcesContent":["import { parseModule, Syntax } from 'esprima-next'\nimport fs from 'fs/promises'\nimport path from 'path'\n\nconst RUN_SH_CONTENT = `#!/bin/bash -x\n\n[ ! -d '/tmp/cache' ] && mkdir -p /tmp/cache\n\nNODE_ENV=production exec node server.js\n`\n\nconst BUILD_FOR_LAMBDA_SH_CONTENT = `#!/bin/bash\n\ncp -r .next/static .next/standalone/.next/static\ncp run.sh .next/standalone/run.sh\ncd .next/standalone\nzip -r --symlinks lambda.zip .\nmv lambda.zip ../..\n`\n\n/**\n * Apply Lambda-specific modifications to a Payload project\n *\n * @param projectPath - Path to project directory\n */\nexport async function applyLambdaModifications(projectPath: string): Promise<void> {\n // 1. Create run.sh\n const runShPath = path.join(projectPath, 'run.sh')\n await fs.writeFile(runShPath, RUN_SH_CONTENT, 'utf-8')\n await fs.chmod(runShPath, 0o755) // rwxr-xr-x\n\n // 2. Create build_for_lambda.sh\n const buildShPath = path.join(projectPath, 'build_for_lambda.sh')\n await fs.writeFile(buildShPath, BUILD_FOR_LAMBDA_SH_CONTENT, 'utf-8')\n await fs.chmod(buildShPath, 0o755)\n\n // 3. Modify next config to add standalone output\n await addStandaloneToNextConfig(projectPath)\n\n // 4. Create/update .npmrc\n const npmrcPath = path.join(projectPath, '.npmrc')\n let npmrcContent = ''\n\n try {\n npmrcContent = await fs.readFile(npmrcPath, 'utf-8')\n } catch {\n // File doesn't exist, start fresh\n }\n\n if (!npmrcContent.includes('node-linker=hoisted')) {\n npmrcContent += npmrcContent && !npmrcContent.endsWith('\\n') ? '\\n' : ''\n npmrcContent += 'node-linker=hoisted\\n'\n await fs.writeFile(npmrcPath, npmrcContent, 'utf-8')\n }\n\n // 5. Add lambda:buildzip script to package.json\n await addLambdaBuildScript(projectPath)\n}\n\n/**\n * Find the Next.js config file (next.config.js or next.config.mjs)\n *\n * @todo Support TypeScript config files in future\n */\nasync function findNextConfigPath(projectPath: string): Promise<string> {\n const configFiles = ['next.config.js', 'next.config.mjs']\n\n for (const configFile of configFiles) {\n const configPath = path.join(projectPath, configFile)\n try {\n await fs.access(configPath)\n return configPath\n } catch {\n // File doesn't exist, try next one\n }\n }\n\n throw new Error('Could not find next.config.js or next.config.mjs')\n}\n\n/**\n * Add standalone output to Next.js config using AST parsing\n */\nasync function addStandaloneToNextConfig(projectPath: string): Promise<void> {\n const nextConfigPath = await findNextConfigPath(projectPath)\n const content = await fs.readFile(nextConfigPath, 'utf-8')\n\n // Check if output already configured (quick check before parsing)\n if (content.includes('output:')) {\n return // Already configured\n }\n\n const ast = parseModule(content, { loc: true })\n\n // Find export default declaration\n const exportDefaultDeclaration = ast.body.find(\n (p) => p.type === Syntax.ExportDefaultDeclaration,\n ) as ExportDefaultDeclaration | undefined\n\n if (!exportDefaultDeclaration?.declaration?.loc) {\n throw new Error(`Could not find export default declaration in ${path.basename(nextConfigPath)}`)\n }\n\n // Find the object expression to modify\n let targetObjectExpression: ObjectExpressionNode | undefined\n\n if (exportDefaultDeclaration.declaration.type === 'ObjectExpression') {\n // Direct export: export default { ... }\n targetObjectExpression = exportDefaultDeclaration.declaration as ObjectExpressionNode\n } else if (exportDefaultDeclaration.declaration.type === 'CallExpression') {\n // Wrapped export: export default withPayload(nextConfig, ...)\n const callExpr = exportDefaultDeclaration.declaration as CallExpressionNode\n const firstArg = callExpr.arguments?.[0]\n\n if (firstArg?.type === 'Identifier') {\n // Find the variable declaration for this identifier\n const configVarName = (firstArg as IdentifierNode).name\n const varDeclaration = ast.body.find((node) => {\n if (node.type === Syntax.VariableDeclaration) {\n const varNode = node as VariableDeclarationNode\n return varNode.declarations?.some(\n (decl) =>\n decl.id?.type === 'Identifier' &&\n (decl.id as IdentifierNode).name === configVarName &&\n decl.init?.type === 'ObjectExpression',\n )\n }\n return false\n }) as undefined | VariableDeclarationNode\n\n if (varDeclaration) {\n const declarator = varDeclaration.declarations?.find(\n (decl) =>\n decl.id?.type === 'Identifier' && (decl.id as IdentifierNode).name === configVarName,\n )\n if (declarator?.init?.type === 'ObjectExpression') {\n targetObjectExpression = declarator.init as ObjectExpressionNode\n }\n }\n }\n }\n\n if (!targetObjectExpression?.loc) {\n throw new Error(\n `Could not find Next.js config object in ${path.basename(nextConfigPath)}. ` +\n `Expected either 'export default { ... }' or 'export default wrapper(configVar, ...)'`,\n )\n }\n\n const { loc } = targetObjectExpression\n const lines = content.split('\\n')\n\n // Insert output: 'standalone' as first property\n const insertLine = loc.start.line - 1\n const insertColumn = loc.start.column + 1 // After opening brace\n\n // Find the content of the line with the opening brace\n const targetLine = lines[insertLine]\n if (!targetLine) {\n throw new Error(`Could not find target line in ${path.basename(nextConfigPath)}`)\n }\n\n lines[insertLine] =\n targetLine.slice(0, insertColumn) + \"\\n output: 'standalone',\" + targetLine.slice(insertColumn)\n\n const modifiedContent = lines.join('\\n')\n await fs.writeFile(nextConfigPath, modifiedContent, 'utf-8')\n}\n\ntype ExportDefaultDeclaration = {\n declaration: {\n arguments?: unknown[]\n loc: {\n end: { column: number; line: number }\n start: { column: number; line: number }\n }\n type: string\n }\n type: string\n}\n\ntype ObjectExpressionNode = {\n loc: {\n end: { column: number; line: number }\n start: { column: number; line: number }\n }\n type: 'ObjectExpression'\n}\n\ntype IdentifierNode = {\n name: string\n type: 'Identifier'\n}\n\ntype CallExpressionNode = {\n arguments?: Array<{ type: string }>\n type: 'CallExpression'\n}\n\ntype VariableDeclarationNode = {\n declarations?: Array<{\n id?: { name?: string; type: string }\n init?: { loc?: ObjectExpressionNode['loc']; type: string }\n }>\n type: 'VariableDeclaration'\n}\n\n/**\n * Add lambda:buildzip script to package.json\n */\nasync function addLambdaBuildScript(projectPath: string): Promise<void> {\n const packageJsonPath = path.join(projectPath, 'package.json')\n const content = await fs.readFile(packageJsonPath, 'utf-8')\n const packageJson = JSON.parse(content)\n\n if (!packageJson.scripts) {\n packageJson.scripts = {}\n }\n\n packageJson.scripts['lambda:buildzip'] = 'npm run build && ./build_for_lambda.sh'\n\n await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\\n', 'utf-8')\n}\n"],"names":["parseModule","Syntax","fs","path","RUN_SH_CONTENT","BUILD_FOR_LAMBDA_SH_CONTENT","applyLambdaModifications","projectPath","runShPath","join","writeFile","chmod","buildShPath","addStandaloneToNextConfig","npmrcPath","npmrcContent","readFile","includes","endsWith","addLambdaBuildScript","findNextConfigPath","configFiles","configFile","configPath","access","Error","nextConfigPath","content","ast","loc","exportDefaultDeclaration","body","find","p","type","ExportDefaultDeclaration","declaration","basename","targetObjectExpression","callExpr","firstArg","arguments","configVarName","name","varDeclaration","node","VariableDeclaration","varNode","declarations","some","decl","id","init","declarator","lines","split","insertLine","start","line","insertColumn","column","targetLine","slice","modifiedContent","packageJsonPath","packageJson","JSON","parse","scripts","stringify"],"mappings":"AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,eAAc;AAClD,OAAOC,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB,MAAMC,iBAAiB,CAAC;;;;;AAKxB,CAAC;AAED,MAAMC,8BAA8B,CAAC;;;;;;;AAOrC,CAAC;AAED;;;;CAIC,GACD,OAAO,eAAeC,yBAAyBC,WAAmB;IAChE,mBAAmB;IACnB,MAAMC,YAAYL,KAAKM,IAAI,CAACF,aAAa;IACzC,MAAML,GAAGQ,SAAS,CAACF,WAAWJ,gBAAgB;IAC9C,MAAMF,GAAGS,KAAK,CAACH,WAAW,QAAO,YAAY;IAE7C,gCAAgC;IAChC,MAAMI,cAAcT,KAAKM,IAAI,CAACF,aAAa;IAC3C,MAAML,GAAGQ,SAAS,CAACE,aAAaP,6BAA6B;IAC7D,MAAMH,GAAGS,KAAK,CAACC,aAAa;IAE5B,iDAAiD;IACjD,MAAMC,0BAA0BN;IAEhC,0BAA0B;IAC1B,MAAMO,YAAYX,KAAKM,IAAI,CAACF,aAAa;IACzC,IAAIQ,eAAe;IAEnB,IAAI;QACFA,eAAe,MAAMb,GAAGc,QAAQ,CAACF,WAAW;IAC9C,EAAE,OAAM;IACN,kCAAkC;IACpC;IAEA,IAAI,CAACC,aAAaE,QAAQ,CAAC,wBAAwB;QACjDF,gBAAgBA,gBAAgB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B,EAAEtB,KAAKkC,QAAQ,CAACX,iBAAiB;IAClF;IAEA4B,KAAK,CAACE,WAAW,GACfK,WAAWC,KAAK,CAAC,GAAGH,gBAAgB,8BAA8BE,WAAWC,KAAK,CAACH;IAErF,MAAMI,kBAAkBT,MAAM7C,IAAI,CAAC;IACnC,MAAMP,GAAGQ,SAAS,CAACgB,gBAAgBqC,iBAAiB;AACtD;AAwCA;;CAEC,GACD,eAAe5C,qBAAqBZ,WAAmB;IACrD,MAAMyD,kBAAkB7D,KAAKM,IAAI,CAACF,aAAa;IAC/C,MAAMoB,UAAU,MAAMzB,GAAGc,QAAQ,CAACgD,iBAAiB;IACnD,MAAMC,cAAcC,KAAKC,KAAK,CAACxC;IAE/B,IAAI,CAACsC,YAAYG,OAAO,EAAE;QACxBH,YAAYG,OAAO,GAAG,CAAC;IACzB;IAEAH,YAAYG,OAAO,CAAC,kBAAkB,GAAG;IAEzC,MAAMlE,GAAGQ,SAAS,CAACsD,iBAAiBE,KAAKG,SAAS,CAACJ,aAAa,MAAM,KAAK,MAAM;AACnF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,YAAa,MAAM,KAAG,IAEzC,CAAA;AAED,eAAO,MAAM,IAAI,YAAa,MAAM,KAAG,IAEtC,CAAA;AAED,eAAO,MAAM,KAAK,YAAa,MAAM,KAAG,IAEvC,CAAA;AAED,eAAO,MAAM,KAAK,YAAa,MAAM,KAAG,IAIvC,CAAA;AAED,eAAO,MAAM,GAAG,YAAa,MAAM,KAAG,IAErC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import * as p from '@clack/prompts'\nimport pc from 'picocolors'\n\nimport { isDebug } from './is-debug.js'\n\nexport const warning = (message: string): void => {\n p.log.warn(pc.yellow('? ') + pc.bold(message))\n}\n\nexport const info = (message: string): void => {\n p.log.step(pc.bold(message))\n}\n\nexport const error = (message: string): void => {\n p.log.error(pc.bold(message))\n}\n\nexport const debug = (message: string): void => {\n if (isDebug()) {\n p.log.step(`${pc.bgMagenta('[DEBUG]')} ${pc.gray(message)}`)\n }\n}\n\nexport const log = (message: string): void => {\n p.log.message(message)\n}\n"],"names":["p","pc","isDebug","warning","message","log","warn","yellow","bold","info","step","error","debug","bgMagenta","gray"],"mappings":"AAAA,YAAYA,OAAO,iBAAgB;AACnC,OAAOC,QAAQ,aAAY;AAE3B,SAASC,OAAO,QAAQ,gBAAe;AAEvC,OAAO,MAAMC,UAAU,CAACC;IACtBJ,EAAEK,GAAG,CAACC,IAAI,CAACL,GAAGM,MAAM,CAAC,QAAQN,GAAGO,IAAI,CAACJ;AACvC,EAAC;AAED,OAAO,MAAMK,OAAO,CAACL;IACnBJ,EAAEK,GAAG,CAACK,IAAI,CAACT,GAAGO,IAAI,CAACJ;AACrB,EAAC;AAED,OAAO,MAAMO,QAAQ,CAACP;IACpBJ,EAAEK,GAAG,CAACM,KAAK,CAACV,GAAGO,IAAI,CAACJ;AACtB,EAAC;AAED,OAAO,MAAMQ,QAAQ,CAACR;IACpB,IAAIF,WAAW;QACbF,EAAEK,GAAG,CAACK,IAAI,CAAC,GAAGT,GAAGY,SAAS,CAAC,WAAW,CAAC,EAAEZ,GAAGa,IAAI,CAACV,UAAU;IAC7D;AACF,EAAC;AAED,OAAO,MAAMC,MAAM,CAACD;IAClBJ,EAAEK,GAAG,CAACD,OAAO,CAACA;AAChB,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/utils/messages.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,wBAAgB,WAAW,IAAI,IAAI,CA2ClC;AASD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,MAAM,CAiBzF;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAgBpF;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/messages.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport path from 'path'\nimport pc from 'picocolors'\nimport terminalLink from 'terminal-link'\n\nimport type { PackageManager } from '../types.js'\n\nconst header = (message: string): string => pc.bold(message)\n\nexport function helpMessage(): void {\n console.log(`\n ${pc.bold('USAGE')}\n\n ${pc.dim('@payloadcms/figma <command> [options]')}\n\n ${pc.bold('COMMANDS')}\n\n ${pc.cyan('login')} Authenticate with Figma OAuth2\n ${pc.cyan('logout')} Clear all stored tokens\n ${pc.cyan('list-tokens')} Show stored token information\n ${pc.cyan('init')} Initialize a Figma CMS project\n ${pc.cyan('deploy')} Deploy your project to Figma\n\n ${pc.bold('OPTIONS')}\n\n ${pc.dim('-h, --help Show help')}\n ${pc.dim('--debug Enable debug logging')}\n\n ${pc.bold('AUTHENTICATION')}\n\n ${pc.cyan('@payloadcms/figma login')} Authenticate with Figma\n ${pc.cyan('@payloadcms/figma logout')} Clear all tokens (with confirmation)\n ${pc.cyan('@payloadcms/figma list-tokens')} Display stored OAuth and project tokens\n\n ${pc.bold('INIT COMMAND')}\n\n ${pc.cyan('@payloadcms/figma init --id <cms-id>')} Initialize project with CMS ID\n ${pc.cyan('@payloadcms/figma init')} Initialize (prompts for CMS ID)\n ${pc.cyan('@payloadcms/figma init --name my-cms')} Specify project name for new projects\n ${pc.cyan('@payloadcms/figma init --force')} Force reconfiguration of existing project\n ${pc.cyan('@payloadcms/figma init --skip-auth')} Skip authentication (testing only)\n\n ${pc.bold('DEPLOY COMMAND')}\n\n ${pc.cyan('@payloadcms/figma deploy')} Deploy your project to Figma\n ${pc.dim('--yes, -y')} Skip confirmation prompts\n\n ${pc.bold('DOCUMENTATION')}\n\n ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')}\n ${createTerminalLink('Figma CMS Docs', 'https://www.figma.com/developers/api')}\n`)\n}\n\n// Create terminalLink with fallback for unsupported terminals\nfunction createTerminalLink(text: string, url: string) {\n return terminalLink(text, url, {\n fallback: (text, url) => `${text}: ${url}`,\n })\n}\n\nexport function successMessage(projectDir: string, packageManager: PackageManager): string {\n const relativePath = path.relative(process.cwd(), projectDir)\n return `\n${header('Launch Application:')}\n\n - cd ./${relativePath}\n - ${packageManager === 'npm' ? 'npm run' : packageManager} dev or follow directions in README.md\n\n${header('Documentation:')}\n\n - ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n - ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n\n`\n}\n\nexport function successfulNextInit(): string {\n return `- ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n- ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n`\n}\n\nexport function moveMessage(args: { nextAppDir: string; projectDir: string }): string {\n const relativeAppDir = path.relative(process.cwd(), args.nextAppDir)\n return `\n${header('Next Steps:')}\n\nPayload does not support a top-level layout.tsx file in the app directory.\n\n${pc.bold('To continue:')}\n\n- Create a new directory in ./${relativeAppDir} such as ./${relativeAppDir}/${pc.bold('(app)')}\n- Move all files from ./${relativeAppDir} into that directory\n\nIt is recommended to do this from your IDE if your app has existing file references.\n\nOnce moved, rerun the @payloadcms/figma command again.\n`\n}\n\nexport function feedbackOutro(): string {\n return `${pc.bgCyan(pc.black(' Have feedback? '))} Visit us on ${createTerminalLink('GitHub', 'https://github.com/payloadcms/payload')}.`\n}\n"],"names":["path","pc","terminalLink","header","message","bold","helpMessage","console","log","dim","cyan","createTerminalLink","text","url","fallback","successMessage","projectDir","packageManager","relativePath","relative","process","cwd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