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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/dist/api/control-plane.d.ts +0 -1
  2. package/dist/api/control-plane.js +0 -2
  3. package/dist/api/error-response.d.ts +0 -1
  4. package/dist/api/error-response.js +0 -2
  5. package/dist/api/figma-api.d.ts +2 -2
  6. package/dist/api/figma-api.js +33 -5
  7. package/dist/auth/browser.d.ts +0 -1
  8. package/dist/auth/browser.js +0 -2
  9. package/dist/auth/callback-server.d.ts +0 -1
  10. package/dist/auth/callback-server.js +0 -2
  11. package/dist/auth/credentials.d.ts +0 -1
  12. package/dist/auth/credentials.js +0 -2
  13. package/dist/auth/crypto-utils.d.ts +0 -1
  14. package/dist/auth/crypto-utils.js +0 -2
  15. package/dist/auth/jwt-validator.d.ts +22 -6
  16. package/dist/auth/jwt-validator.js +33 -7
  17. package/dist/auth/oauth-flow.d.ts +0 -1
  18. package/dist/auth/oauth-flow.js +0 -2
  19. package/dist/auth/paste-code.d.ts +0 -1
  20. package/dist/auth/paste-code.js +0 -2
  21. package/dist/auth/pkce.d.ts +0 -1
  22. package/dist/auth/pkce.js +0 -2
  23. package/dist/auth/project-token.d.ts +0 -1
  24. package/dist/auth/project-token.js +6 -4
  25. package/dist/auth/refresh.d.ts +0 -1
  26. package/dist/auth/refresh.js +0 -2
  27. package/dist/auth/token-store-migration.d.ts +0 -1
  28. package/dist/auth/token-store-migration.js +0 -2
  29. package/dist/auth/token-store.d.ts +0 -1
  30. package/dist/auth/token-store.js +0 -2
  31. package/dist/auth/types.d.ts +5 -2
  32. package/dist/auth/types.js +1 -3
  33. package/dist/cli.d.ts +0 -1
  34. package/dist/cli.js +7 -2
  35. package/dist/commands/bootstrap.d.ts +0 -1
  36. package/dist/commands/bootstrap.js +0 -2
  37. package/dist/commands/build-lambda-zip.d.ts +0 -1
  38. package/dist/commands/build-lambda-zip.js +0 -2
  39. package/dist/commands/debug.d.ts +0 -1
  40. package/dist/commands/debug.js +0 -2
  41. package/dist/commands/deploy.d.ts +0 -1
  42. package/dist/commands/deploy.js +0 -2
  43. package/dist/commands/dump-tokens.d.ts +0 -1
  44. package/dist/commands/dump-tokens.js +0 -2
  45. package/dist/commands/env.d.ts +0 -1
  46. package/dist/commands/env.js +0 -2
  47. package/dist/commands/init.d.ts +0 -1
  48. package/dist/commands/init.js +0 -2
  49. package/dist/commands/list-tokens.d.ts +0 -1
  50. package/dist/commands/list-tokens.js +0 -2
  51. package/dist/commands/login.d.ts +0 -1
  52. package/dist/commands/login.js +0 -2
  53. package/dist/commands/logout.d.ts +0 -1
  54. package/dist/commands/logout.js +0 -2
  55. package/dist/commands/upgrade.d.ts +0 -1
  56. package/dist/commands/upgrade.js +0 -2
  57. package/dist/commands/upload-schema.d.ts +8 -0
  58. package/dist/commands/upload-schema.js +91 -0
  59. package/dist/config/oauth.d.ts +0 -1
  60. package/dist/config/oauth.js +0 -2
  61. package/dist/constants.d.ts +0 -1
  62. package/dist/constants.js +0 -2
  63. package/dist/db-content-api/generated/content-api-types.d.ts +4188 -592
  64. package/dist/db-content-api/generated/content-api-types.js +0 -2
  65. package/dist/db-content-api/index.d.ts +0 -1
  66. package/dist/db-content-api/index.js +0 -2
  67. package/dist/db-content-api/temp-utilities/slug.d.ts +0 -1
  68. package/dist/db-content-api/temp-utilities/slug.js +0 -2
  69. package/dist/db-content-api/temp-utilities/sorting.d.ts +0 -1
  70. package/dist/db-content-api/temp-utilities/sorting.js +0 -2
  71. package/dist/db-content-api/temp-utilities/types.d.ts +0 -1
  72. package/dist/db-content-api/temp-utilities/types.js +0 -2
  73. package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts +0 -1
  74. package/dist/db-content-api/temp-utilities/unwrapDocument.js +0 -2
  75. package/dist/db-content-api/utilities/auth.d.ts +0 -1
  76. package/dist/db-content-api/utilities/auth.js +0 -2
  77. package/dist/db-content-api/utilities/data/applyDefaults.d.ts +0 -1
  78. package/dist/db-content-api/utilities/data/applyDefaults.js +0 -2
  79. package/dist/db-content-api/utilities/data/castFieldValue.d.ts +0 -1
  80. package/dist/db-content-api/utilities/data/castFieldValue.js +0 -2
  81. package/dist/db-content-api/utilities/data/index.d.ts +0 -1
  82. package/dist/db-content-api/utilities/data/index.js +0 -2
  83. package/dist/db-content-api/utilities/data/pointShape.d.ts +3 -0
  84. package/dist/db-content-api/utilities/data/pointShape.js +43 -0
  85. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +0 -1
  86. package/dist/db-content-api/utilities/data/removeVirtualFields.js +0 -2
  87. package/dist/db-content-api/utilities/data/richTextShape.d.ts +3 -0
  88. package/dist/db-content-api/utilities/data/richTextShape.js +56 -0
  89. package/dist/db-content-api/utilities/data/stripFields.d.ts +0 -1
  90. package/dist/db-content-api/utilities/data/stripFields.js +0 -2
  91. package/dist/db-content-api/utilities/data/transformPublishedLocale.d.ts +0 -1
  92. package/dist/db-content-api/utilities/data/transformPublishedLocale.js +0 -2
  93. package/dist/db-content-api/utilities/data/validateRelationships.d.ts +0 -1
  94. package/dist/db-content-api/utilities/data/validateRelationships.js +0 -2
  95. package/dist/db-content-api/utilities/joins.d.ts +0 -1
  96. package/dist/db-content-api/utilities/joins.js +0 -2
  97. package/dist/db-content-api/utilities/locale/index.d.ts +0 -1
  98. package/dist/db-content-api/utilities/locale/index.js +0 -2
  99. package/dist/db-content-api/utilities/meta/buildLocalizedPaths.d.ts +0 -1
  100. package/dist/db-content-api/utilities/meta/buildLocalizedPaths.js +0 -2
  101. package/dist/db-content-api/utilities/meta/buildMeta.d.ts +0 -1
  102. package/dist/db-content-api/utilities/meta/buildMeta.js +0 -2
  103. package/dist/db-content-api/utilities/meta/buildPathTypes.d.ts +0 -1
  104. package/dist/db-content-api/utilities/meta/buildPathTypes.js +0 -2
  105. package/dist/db-content-api/utilities/meta/buildUniquePaths.d.ts +0 -1
  106. package/dist/db-content-api/utilities/meta/buildUniquePaths.js +0 -2
  107. package/dist/db-content-api/utilities/meta/normalizeLocaleInWhere.d.ts +0 -1
  108. package/dist/db-content-api/utilities/meta/normalizeLocaleInWhere.js +0 -2
  109. package/dist/db-content-api/utilities/schema/buildDocumentSchema.d.ts +56 -0
  110. package/dist/db-content-api/utilities/schema/buildDocumentSchema.js +183 -0
  111. package/dist/db-content-api/utilities/where.d.ts +0 -1
  112. package/dist/db-content-api/utilities/where.js +0 -2
  113. package/dist/deploy/schedule-extract-plugin.d.ts +0 -1
  114. package/dist/deploy/schedule-extract-plugin.js +0 -2
  115. package/dist/endpoints/health.d.ts +0 -1
  116. package/dist/endpoints/health.js +0 -2
  117. package/dist/endpoints/schema.d.ts +0 -1
  118. package/dist/endpoints/schema.js +0 -2
  119. package/dist/exports/client.d.ts +0 -1
  120. package/dist/exports/client.js +0 -2
  121. package/dist/index.d.ts +0 -1
  122. package/dist/index.js +0 -2
  123. package/dist/lib/download-skill.d.ts +0 -1
  124. package/dist/lib/download-skill.js +0 -2
  125. package/dist/oauth/components/FigmaAvatar/index.d.ts +0 -1
  126. package/dist/oauth/components/FigmaAvatar/index.js +0 -2
  127. package/dist/oauth/components/FigmaAvatarCell/index.d.ts +0 -1
  128. package/dist/oauth/components/FigmaAvatarCell/index.js +0 -2
  129. package/dist/oauth/components/FigmaAvatarPlaceholder/index.d.ts +0 -1
  130. package/dist/oauth/components/FigmaAvatarPlaceholder/index.js +0 -2
  131. package/dist/oauth/components/LoginButton/iframeAutoLogin.d.ts +0 -1
  132. package/dist/oauth/components/LoginButton/iframeAutoLogin.js +0 -2
  133. package/dist/oauth/components/LoginButton/index.d.ts +0 -1
  134. package/dist/oauth/components/LoginButton/index.js +3 -5
  135. package/dist/oauth/components/LogoutButton/index.d.ts +0 -1
  136. package/dist/oauth/components/LogoutButton/index.js +0 -2
  137. package/dist/oauth/defaults.d.ts +0 -1
  138. package/dist/oauth/defaults.js +8 -2
  139. package/dist/oauth/endpoints/getLoginEndpoint.d.ts +0 -1
  140. package/dist/oauth/endpoints/getLoginEndpoint.js +4 -8
  141. package/dist/oauth/endpoints/getLogoutEndpoint.d.ts +0 -1
  142. package/dist/oauth/endpoints/getLogoutEndpoint.js +0 -2
  143. package/dist/oauth/endpoints/getMetaEndpoint.d.ts +0 -1
  144. package/dist/oauth/endpoints/getMetaEndpoint.js +0 -2
  145. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.d.ts +0 -1
  146. package/dist/oauth/endpoints/getRedirectToLoginEndpoint.js +0 -2
  147. package/dist/oauth/exports/client.d.ts +0 -1
  148. package/dist/oauth/exports/client.js +0 -2
  149. package/dist/oauth/hooks/afterLogout.d.ts +0 -1
  150. package/dist/oauth/hooks/afterLogout.js +0 -2
  151. package/dist/oauth/hooks/me.d.ts +0 -1
  152. package/dist/oauth/hooks/me.js +0 -2
  153. package/dist/oauth/hooks/refresh.d.ts +0 -1
  154. package/dist/oauth/hooks/refresh.js +0 -2
  155. package/dist/oauth/index.d.ts +0 -1
  156. package/dist/oauth/index.js +0 -2
  157. package/dist/oauth/strategy/index.d.ts +0 -1
  158. package/dist/oauth/strategy/index.js +17 -19
  159. package/dist/oauth/types.d.ts +0 -1
  160. package/dist/oauth/types.js +0 -2
  161. package/dist/oauth/utilities/clearCookie.d.ts +0 -1
  162. package/dist/oauth/utilities/clearCookie.js +0 -2
  163. package/dist/oauth/utilities/createCookieOptions.d.ts +0 -1
  164. package/dist/oauth/utilities/createCookieOptions.js +0 -2
  165. package/dist/oauth/utilities/createDebugLogger.d.ts +0 -1
  166. package/dist/oauth/utilities/createDebugLogger.js +0 -2
  167. package/dist/oauth/utilities/establishSession.d.ts +4 -5
  168. package/dist/oauth/utilities/establishSession.js +9 -12
  169. package/dist/oauth/utilities/exchangeCodeForAccessToken.d.ts +0 -1
  170. package/dist/oauth/utilities/exchangeCodeForAccessToken.js +0 -2
  171. package/dist/oauth/utilities/extractOrigin.d.ts +0 -1
  172. package/dist/oauth/utilities/extractOrigin.js +0 -2
  173. package/dist/oauth/utilities/figmaHostnames.d.ts +0 -1
  174. package/dist/oauth/utilities/figmaHostnames.js +0 -2
  175. package/dist/oauth/utilities/getAdminCollectionSlug.d.ts +0 -1
  176. package/dist/oauth/utilities/getAdminCollectionSlug.js +0 -2
  177. package/dist/oauth/utilities/getAuthorizeURL.d.ts +0 -1
  178. package/dist/oauth/utilities/getAuthorizeURL.js +0 -2
  179. package/dist/oauth/utilities/getCookieExpiration.d.ts +0 -1
  180. package/dist/oauth/utilities/getCookieExpiration.js +0 -2
  181. package/dist/oauth/utilities/getSecondsFromTokenExp.d.ts +0 -1
  182. package/dist/oauth/utilities/getSecondsFromTokenExp.js +0 -2
  183. package/dist/oauth/utilities/getTokenExp.d.ts +0 -1
  184. package/dist/oauth/utilities/getTokenExp.js +0 -2
  185. package/dist/oauth/utilities/getUsernameField.d.ts +0 -1
  186. package/dist/oauth/utilities/getUsernameField.js +0 -2
  187. package/dist/oauth/utilities/hasUserTokenPropsChanged.d.ts +0 -1
  188. package/dist/oauth/utilities/hasUserTokenPropsChanged.js +0 -2
  189. package/dist/oauth/utilities/isAbsoluteURL.d.ts +0 -1
  190. package/dist/oauth/utilities/isAbsoluteURL.js +0 -2
  191. package/dist/oauth/utilities/isDuplicateKeyError.d.ts +0 -1
  192. package/dist/oauth/utilities/isDuplicateKeyError.js +0 -2
  193. package/dist/oauth/utilities/mergeHeaders.d.ts +0 -1
  194. package/dist/oauth/utilities/mergeHeaders.js +0 -2
  195. package/dist/oauth/utilities/refreshTokens.d.ts +0 -1
  196. package/dist/oauth/utilities/refreshTokens.js +16 -12
  197. package/dist/oauth/utilities/withPartitionedCookie.d.ts +0 -1
  198. package/dist/oauth/utilities/withPartitionedCookie.js +0 -2
  199. package/dist/oauth/utils/getSearchParam.d.ts +27 -0
  200. package/dist/oauth/utils/getSearchParam.js +45 -0
  201. package/dist/plugin/adapter.d.ts +0 -1
  202. package/dist/plugin/adapter.js +0 -2
  203. package/dist/plugin/auth-preflight.d.ts +0 -1
  204. package/dist/plugin/auth-preflight.js +0 -2
  205. package/dist/plugin/bootstrap-preflight.d.ts +0 -1
  206. package/dist/plugin/bootstrap-preflight.js +0 -2
  207. package/dist/plugin/build-config.d.ts +1 -1
  208. package/dist/plugin/build-config.js +66 -3
  209. package/dist/plugin/dev-cookie-names.d.ts +0 -1
  210. package/dist/plugin/dev-cookie-names.js +0 -2
  211. package/dist/storage-content-api/api-types.d.ts +0 -1
  212. package/dist/storage-content-api/api-types.js +0 -2
  213. package/dist/storage-content-api/client-uploads/ClientUploadHandler.d.ts +0 -1
  214. package/dist/storage-content-api/client-uploads/ClientUploadHandler.js +0 -2
  215. package/dist/storage-content-api/client-uploads/generateSignedURL.d.ts +0 -1
  216. package/dist/storage-content-api/client-uploads/generateSignedURL.js +0 -2
  217. package/dist/storage-content-api/client.d.ts +0 -1
  218. package/dist/storage-content-api/client.js +0 -2
  219. package/dist/storage-content-api/generateURL.d.ts +0 -1
  220. package/dist/storage-content-api/generateURL.js +0 -2
  221. package/dist/storage-content-api/handleDelete.d.ts +0 -1
  222. package/dist/storage-content-api/handleDelete.js +0 -2
  223. package/dist/storage-content-api/handleUpload.d.ts +0 -1
  224. package/dist/storage-content-api/handleUpload.js +0 -2
  225. package/dist/storage-content-api/index.d.ts +0 -1
  226. package/dist/storage-content-api/index.js +0 -2
  227. package/dist/storage-content-api/staticHandler.d.ts +0 -1
  228. package/dist/storage-content-api/staticHandler.js +0 -2
  229. package/dist/storage-content-api/types.d.ts +0 -1
  230. package/dist/storage-content-api/types.js +0 -2
  231. package/dist/storage-content-api/utilities/getSafeFilename.d.ts +0 -1
  232. package/dist/storage-content-api/utilities/getSafeFilename.js +0 -2
  233. package/dist/storage-content-api/utilities/index.d.ts +0 -1
  234. package/dist/storage-content-api/utilities/index.js +0 -2
  235. package/dist/storage-content-api/utilities/parseClientUploadContext.d.ts +0 -1
  236. package/dist/storage-content-api/utilities/parseClientUploadContext.js +0 -2
  237. package/dist/types/config.d.ts +0 -1
  238. package/dist/types/config.js +0 -2
  239. package/dist/types.d.ts +0 -1
  240. package/dist/types.js +0 -2
  241. package/dist/utils/adapters/nextjs.d.ts +0 -1
  242. package/dist/utils/adapters/nextjs.js +0 -2
  243. package/dist/utils/adapters/nitro.d.ts +0 -1
  244. package/dist/utils/adapters/nitro.js +0 -2
  245. package/dist/utils/adapters/vite.d.ts +0 -1
  246. package/dist/utils/adapters/vite.js +0 -2
  247. package/dist/utils/asset-collection.d.ts +0 -1
  248. package/dist/utils/asset-collection.js +0 -2
  249. package/dist/utils/build-detection.d.ts +0 -1
  250. package/dist/utils/build-detection.js +0 -2
  251. package/dist/utils/build-lambda-zip.d.ts +0 -1
  252. package/dist/utils/build-lambda-zip.js +0 -2
  253. package/dist/utils/cache-bootstrap.d.ts +0 -1
  254. package/dist/utils/cache-bootstrap.js +0 -2
  255. package/dist/utils/config.d.ts +0 -1
  256. package/dist/utils/config.js +0 -2
  257. package/dist/utils/deploy-adapter.d.ts +0 -1
  258. package/dist/utils/deploy-adapter.js +0 -2
  259. package/dist/utils/download-template.d.ts +0 -1
  260. package/dist/utils/download-template.js +0 -2
  261. package/dist/utils/env-management.d.ts +0 -1
  262. package/dist/utils/env-management.js +0 -2
  263. package/dist/utils/format-env-suffix.d.ts +0 -1
  264. package/dist/utils/format-env-suffix.js +0 -2
  265. package/dist/utils/format.d.ts +0 -1
  266. package/dist/utils/format.js +0 -2
  267. package/dist/utils/formatter.d.ts +0 -1
  268. package/dist/utils/formatter.js +0 -2
  269. package/dist/utils/fs-utils.d.ts +0 -1
  270. package/dist/utils/fs-utils.js +0 -2
  271. package/dist/utils/git.d.ts +0 -1
  272. package/dist/utils/git.js +0 -2
  273. package/dist/utils/handle-upgrade.d.ts +0 -1
  274. package/dist/utils/handle-upgrade.js +0 -2
  275. package/dist/utils/is-debug.d.ts +0 -1
  276. package/dist/utils/is-debug.js +0 -2
  277. package/dist/utils/lambda-config.d.ts +0 -1
  278. package/dist/utils/lambda-config.js +0 -2
  279. package/dist/utils/load-payload-config.d.ts +9 -0
  280. package/dist/utils/load-payload-config.js +27 -0
  281. package/dist/utils/log.d.ts +0 -1
  282. package/dist/utils/log.js +0 -2
  283. package/dist/utils/messages.d.ts +0 -1
  284. package/dist/utils/messages.js +7 -2
  285. package/dist/utils/package-manager.d.ts +0 -1
  286. package/dist/utils/package-manager.js +0 -2
  287. package/dist/utils/parse-template-spec.d.ts +0 -1
  288. package/dist/utils/parse-template-spec.js +0 -2
  289. package/dist/utils/payload-config-ast.d.ts +0 -1
  290. package/dist/utils/payload-config-ast.js +0 -2
  291. package/dist/utils/payload-config-finder.d.ts +0 -1
  292. package/dist/utils/payload-config-finder.js +0 -2
  293. package/dist/utils/payload-config-modifier.d.ts +0 -1
  294. package/dist/utils/payload-config-modifier.js +0 -2
  295. package/dist/utils/payload-package-check.d.ts +0 -1
  296. package/dist/utils/payload-package-check.js +0 -2
  297. package/dist/utils/project.d.ts +0 -1
  298. package/dist/utils/project.js +0 -2
  299. package/dist/utils/resolve-environment.d.ts +0 -1
  300. package/dist/utils/resolve-environment.js +0 -2
  301. package/dist/utils/s3-upload.d.ts +0 -1
  302. package/dist/utils/s3-upload.js +0 -2
  303. package/dist/utils/token-display.d.ts +0 -1
  304. package/dist/utils/token-display.js +0 -2
  305. package/dist/utils/typescript-validator.d.ts +0 -1
  306. package/dist/utils/typescript-validator.js +0 -2
  307. package/dist/utils/version-check.d.ts +0 -1
  308. package/dist/utils/version-check.js +0 -2
  309. package/package.json +1 -1
@@ -3,5 +3,3 @@
3
3
  * Do not make direct changes to the file.
4
4
  */ /* eslint-disable */ // @ts-nocheck - Recursive types from OpenAPI cause TS2502 errors
5
5
  export { };
6
-
7
- //# sourceMappingURL=content-api-types.js.map
@@ -34,4 +34,3 @@ export type ContentAPIAdapter = {
34
34
  } & BaseDatabaseAdapter;
35
35
  export declare const contentAPIAdapter: (opts: ContentAPIOptions) => DatabaseAdapterObj;
36
36
  export {};
37
- //# sourceMappingURL=index.d.ts.map
@@ -919,5 +919,3 @@ export const contentAPIAdapter = (opts)=>({
919
919
  });
920
920
  }
921
921
  });
922
-
923
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export declare const getGlobalSlug: (slug: string) => string;
2
- //# sourceMappingURL=slug.d.ts.map
@@ -1,3 +1 @@
1
1
  export const getGlobalSlug = (slug)=>`_global-${slug}`;
2
-
3
- //# sourceMappingURL=slug.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Payload } from 'payload';
2
2
  export declare function addFallbackSort(sort: string | string[] | undefined, payload: Payload, collectionSlug: string | string[], defaultSort?: string | string[]): string | string[] | undefined;
3
- //# sourceMappingURL=sorting.d.ts.map
@@ -35,5 +35,3 @@ export function addFallbackSort(sort, payload, collectionSlug, defaultSort) {
35
35
  fallbackSort
36
36
  ];
37
37
  }
38
-
39
- //# sourceMappingURL=sorting.js.map
@@ -19,4 +19,3 @@ export type PathTypeValue = 'array' | {
19
19
  type: 'join' | 'relationship';
20
20
  };
21
21
  export type PathTypesRecord = Record<string, PathTypeValue>;
22
- //# sourceMappingURL=types.d.ts.map
@@ -11,5 +11,3 @@
11
11
  * TODO: This type is defined here temporarily so Content API can test the integration.
12
12
  * Once Content API implements support for this, the type should be generated from openapi.json.
13
13
  */ export { };
14
-
15
- //# sourceMappingURL=types.js.map
@@ -36,4 +36,3 @@ export declare const unwrapFindResponse: (payload: Payload, response: components
36
36
  docs: Record<string, unknown>[];
37
37
  };
38
38
  export {};
39
- //# sourceMappingURL=unwrapDocument.d.ts.map
@@ -60,5 +60,3 @@ export const unwrapFindResponse = (payload, response, collection, locale)=>{
60
60
  ...paginationFields
61
61
  };
62
62
  };
63
-
64
- //# sourceMappingURL=unwrapDocument.js.map
@@ -27,4 +27,3 @@ export declare function createErrorMiddleware(opts: {
27
27
  url: string;
28
28
  }): Middleware;
29
29
  export {};
30
- //# sourceMappingURL=auth.d.ts.map
@@ -80,5 +80,3 @@ export function createErrorMiddleware(opts) {
80
80
  }
81
81
  };
82
82
  }
83
-
84
- //# sourceMappingURL=auth.js.map
@@ -4,4 +4,3 @@ import type { Field } from 'payload';
4
4
  * This handles defaults for nested structures (arrays, groups) which traverseFields doesn't handle
5
5
  */
6
6
  export declare function applyDefaults(data: Record<string, unknown>, fields: Field[]): void;
7
- //# sourceMappingURL=applyDefaults.d.ts.map
@@ -71,5 +71,3 @@
71
71
  }
72
72
  }
73
73
  }
74
-
75
- //# sourceMappingURL=applyDefaults.js.map
@@ -8,4 +8,3 @@ import type { Field, TabAsField } from 'payload';
8
8
  *
9
9
  */
10
10
  export declare function castFieldValue(field: Field | TabAsField, value: unknown): unknown;
11
- //# sourceMappingURL=castFieldValue.d.ts.map
@@ -64,5 +64,3 @@
64
64
  }
65
65
  return value;
66
66
  }
67
-
68
- //# sourceMappingURL=castFieldValue.js.map
@@ -46,4 +46,3 @@ export declare function dataToContentAPI(payload: Payload, collectionSlug: strin
46
46
  export declare function resolveVersionContent(version: unknown, versionMeta: Record<string, unknown>): unknown;
47
47
  export declare function dataFromContentAPI(payload: Payload, collectionSlug: string, data: unknown, locale?: string): unknown;
48
48
  export {};
49
- //# sourceMappingURL=index.d.ts.map
@@ -297,5 +297,3 @@ export function dataFromContentAPI(payload, collectionSlug, data, locale) {
297
297
  }
298
298
  return transformed;
299
299
  }
300
-
301
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import type { Field, TabAsField } from 'payload';
2
+ export declare function encodePointForWrite(field: Field | TabAsField, value: unknown): unknown;
3
+ export declare function decodePointFromRead(field: Field | TabAsField, value: unknown): unknown;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Payload stores a point as GeoJSON; the v1 server uses a bare `[lng, lat]`
3
+ * tuple. Unwrap on write, re-wrap on read so afterRead can restore the tuple.
4
+ */ function isPlainObject(value) {
5
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
6
+ }
7
+ function isCoordinateTuple(value) {
8
+ return Array.isArray(value) && value.length === 2 && value.every((v)=>typeof v === 'number');
9
+ }
10
+ function pointLeafToWire(value) {
11
+ if (isPlainObject(value) && isCoordinateTuple(value.coordinates)) {
12
+ return value.coordinates;
13
+ }
14
+ return value;
15
+ }
16
+ function pointLeafFromWire(value) {
17
+ if (isCoordinateTuple(value)) {
18
+ return {
19
+ type: 'Point',
20
+ coordinates: value
21
+ };
22
+ }
23
+ return value;
24
+ }
25
+ function mapPoint(field, value, mapLeaf) {
26
+ if (field.type !== 'point' || value === null || value === undefined) {
27
+ return value;
28
+ }
29
+ if ('localized' in field && field.localized && isPlainObject(value)) {
30
+ const result = {};
31
+ for (const [locale, localeValue] of Object.entries(value)){
32
+ result[locale] = mapLeaf(localeValue);
33
+ }
34
+ return result;
35
+ }
36
+ return mapLeaf(value);
37
+ }
38
+ export function encodePointForWrite(field, value) {
39
+ return mapPoint(field, value, pointLeafToWire);
40
+ }
41
+ export function decodePointFromRead(field, value) {
42
+ return mapPoint(field, value, pointLeafFromWire);
43
+ }
@@ -9,4 +9,3 @@ import type { CollectionConfig } from 'payload';
9
9
  * find a way to unify everything.
10
10
  */
11
11
  export declare function removeVirtualFields(data: Record<string, unknown>, fieldConfigs: CollectionConfig['fields']): void;
12
- //# sourceMappingURL=removeVirtualFields.d.ts.map
@@ -50,5 +50,3 @@
50
50
  }
51
51
  }
52
52
  }
53
-
54
- //# sourceMappingURL=removeVirtualFields.js.map
@@ -0,0 +1,3 @@
1
+ import type { Field, Payload, TabAsField } from 'payload';
2
+ export declare function encodeRichTextForWrite(field: Field | TabAsField, value: unknown): unknown;
3
+ export declare function decodeRichTextFromRead(field: Field | TabAsField, value: unknown, payload: Payload, fieldPath: string, collectionSlug: string): unknown;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * The v1 server stores richText as a serialized JSON string, so stringify on
3
+ * write and parse on read. A localized richText is a per-locale map, serialized
4
+ * and parsed per entry (not as one blob).
5
+ */ function isPlainObject(value) {
6
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
7
+ }
8
+ function richTextLeafToWire(value) {
9
+ if (value === null || value === undefined || typeof value === 'string') {
10
+ return value;
11
+ }
12
+ return JSON.stringify(value);
13
+ }
14
+ export function encodeRichTextForWrite(field, value) {
15
+ if (field.type !== 'richText' || value === null || value === undefined) {
16
+ return value;
17
+ }
18
+ if ('localized' in field && field.localized && isPlainObject(value)) {
19
+ const result = {};
20
+ for (const [locale, localeValue] of Object.entries(value)){
21
+ result[locale] = richTextLeafToWire(localeValue);
22
+ }
23
+ return result;
24
+ }
25
+ return richTextLeafToWire(value);
26
+ }
27
+ function richTextLeafFromWire(value, onError) {
28
+ if (typeof value !== 'string') {
29
+ return value;
30
+ }
31
+ try {
32
+ return JSON.parse(value);
33
+ } catch (error) {
34
+ onError(error);
35
+ return value;
36
+ }
37
+ }
38
+ export function decodeRichTextFromRead(field, value, payload, fieldPath, collectionSlug) {
39
+ if (field.type !== 'richText' || value === null || value === undefined) {
40
+ return value;
41
+ }
42
+ const onError = (error)=>{
43
+ payload.logger.warn({
44
+ err: error instanceof Error ? error : new Error(String(error)),
45
+ msg: `Failed to parse richtext field '${fieldPath}' in collection '${collectionSlug}'`
46
+ });
47
+ };
48
+ if ('localized' in field && field.localized && isPlainObject(value)) {
49
+ const result = {};
50
+ for (const [locale, localeValue] of Object.entries(value)){
51
+ result[locale] = richTextLeafFromWire(localeValue, onError);
52
+ }
53
+ return result;
54
+ }
55
+ return richTextLeafFromWire(value, onError);
56
+ }
@@ -45,4 +45,3 @@ export declare const stripFields: ({ config, data, fields, parentIsLocalized, re
45
45
  parentIsLocalized?: boolean;
46
46
  reservedKeys?: string[];
47
47
  }) => void;
48
- //# sourceMappingURL=stripFields.d.ts.map
@@ -191,5 +191,3 @@ import { fieldShouldBeLocalized } from 'payload/shared';
191
191
  }
192
192
  }
193
193
  };
194
-
195
- //# sourceMappingURL=stripFields.js.map
@@ -20,4 +20,3 @@ type VersionData = Record<string, unknown>;
20
20
  */
21
21
  export declare function transformToLocalizeStatus(versionData: VersionData, publishedLocale?: string): VersionData;
22
22
  export {};
23
- //# sourceMappingURL=transformPublishedLocale.d.ts.map
@@ -38,5 +38,3 @@
38
38
  }
39
39
  return versionData;
40
40
  }
41
-
42
- //# sourceMappingURL=transformPublishedLocale.js.map
@@ -4,4 +4,3 @@ export declare function validateRelationshipIds({ collectionSlug, data, payload,
4
4
  data: Record<string, unknown>;
5
5
  payload: Payload;
6
6
  }): void;
7
- //# sourceMappingURL=validateRelationships.d.ts.map
@@ -98,5 +98,3 @@ export function validateRelationshipIds({ collectionSlug, data, payload }) {
98
98
  }
99
99
  }
100
100
  }
101
-
102
- //# sourceMappingURL=validateRelationships.js.map
@@ -50,4 +50,3 @@ type ContentAPIJoin = components['schemas']['JoinClause'][number];
50
50
  */
51
51
  export declare function convertPayloadJoinsToContentAPI(payload: Payload, collectionSlug: string, joins: false | JoinQuery | undefined, locale?: string): ContentAPIJoin[] | undefined;
52
52
  export {};
53
- //# sourceMappingURL=joins.d.ts.map
@@ -135,5 +135,3 @@ import { convertPayloadWhereToContentAPI } from './where.js';
135
135
  }
136
136
  return result.length > 0 ? result : undefined;
137
137
  }
138
-
139
- //# sourceMappingURL=joins.js.map
@@ -7,4 +7,3 @@ import type { Payload } from 'payload';
7
7
  * Returns undefined for 'all' and '*' (special Payload values for returning all locales).
8
8
  */
9
9
  export declare function addFallbackLocale(locale: null | string | undefined, payload: Payload): string | undefined;
10
- //# sourceMappingURL=index.d.ts.map
@@ -17,5 +17,3 @@
17
17
  }
18
18
  return undefined;
19
19
  }
20
-
21
- //# sourceMappingURL=index.js.map
@@ -8,4 +8,3 @@ import type { Payload } from 'payload';
8
8
  * @returns Array of dot-notation paths to localized fields (e.g., ['title', 'metadata.description'])
9
9
  */
10
10
  export declare function buildLocalizedPaths(payload: Payload, collectionSlug: string): string[];
11
- //# sourceMappingURL=buildLocalizedPaths.d.ts.map
@@ -70,5 +70,3 @@
70
70
  /** Builds a dot-notation path from parent path and field name */ function buildPath(parentPath, fieldName) {
71
71
  return parentPath ? `${parentPath}.${fieldName}` : fieldName;
72
72
  }
73
-
74
- //# sourceMappingURL=buildLocalizedPaths.js.map
@@ -39,4 +39,3 @@ export declare function buildMeta(payload: Payload, options: BuildMetaOptions):
39
39
  meta?: ContentAPIMetaGenerated;
40
40
  };
41
41
  export {};
42
- //# sourceMappingURL=buildMeta.d.ts.map
@@ -37,5 +37,3 @@ import { buildUniquePaths } from './buildUniquePaths.js';
37
37
  meta: meta
38
38
  } : {};
39
39
  }
40
-
41
- //# sourceMappingURL=buildMeta.js.map
@@ -14,4 +14,3 @@ import type { PathTypesRecord } from '../../temp-utilities/types.js';
14
14
  * - The locale-specific path (e.g. "localizedBlocks.en") IS marked as 'array'
15
15
  */
16
16
  export declare function buildPathTypes(payload: Payload, collectionSlug: string, where: undefined | Where): PathTypesRecord;
17
- //# sourceMappingURL=buildPathTypes.d.ts.map
@@ -240,5 +240,3 @@
240
240
  }
241
241
  return pathTypes;
242
242
  }
243
-
244
- //# sourceMappingURL=buildPathTypes.js.map
@@ -10,4 +10,3 @@ type UniquePath = components['schemas']['UniquePath'];
10
10
  */
11
11
  export declare function buildUniquePaths(payload: Payload, collectionSlug: string, data: Record<string, unknown>): UniquePath[];
12
12
  export {};
13
- //# sourceMappingURL=buildUniquePaths.d.ts.map
@@ -58,5 +58,3 @@ function collectUniqueFields(fields, prefix, data, result) {
58
58
  }
59
59
  }
60
60
  }
61
-
62
- //# sourceMappingURL=buildUniquePaths.js.map
@@ -7,4 +7,3 @@ import type { Payload, Where } from 'payload';
7
7
  * Returns the original where clause if no transformation is needed.
8
8
  */
9
9
  export declare function normalizeLocaleInWhere(where: undefined | Where, payload: Payload, collectionSlug: string, locale: string | undefined): undefined | Where;
10
- //# sourceMappingURL=normalizeLocaleInWhere.d.ts.map
@@ -98,5 +98,3 @@
98
98
  }
99
99
  return transformWhere(where, localizedArrayPaths, locale, localeCodes);
100
100
  }
101
-
102
- //# sourceMappingURL=normalizeLocaleInWhere.js.map
@@ -0,0 +1,56 @@
1
+ import type { Config } from 'payload';
2
+ /**
3
+ * Wire form of the v1 `DocumentSchema` sent on every request so the server can
4
+ * classify each queried path against the index tables. Paths are
5
+ * period-delimited (e.g. `author.name`).
6
+ */
7
+ export interface DocumentSchemaWire {
8
+ collections: Record<string, WireCollectionSchema>;
9
+ version: 1;
10
+ }
11
+ interface WireCollectionSchema {
12
+ hints: WireHint[];
13
+ name: string;
14
+ paths: Record<string, WireFieldSchema>;
15
+ }
16
+ type WireHint = {
17
+ paths: string[];
18
+ type: 'unique';
19
+ };
20
+ type WireFieldSchema = {
21
+ collection: string | string[];
22
+ on: string;
23
+ type: 'join';
24
+ } | {
25
+ collection: string | string[];
26
+ hasMany: boolean;
27
+ localized: boolean;
28
+ type: 'relationship' | 'upload';
29
+ unique: boolean;
30
+ } | {
31
+ format: 'lexical';
32
+ localized: boolean;
33
+ type: 'richText';
34
+ } | {
35
+ hasMany: boolean;
36
+ localized: boolean;
37
+ type: 'group';
38
+ } | {
39
+ hasMany: boolean;
40
+ localized: boolean;
41
+ type: 'number' | 'select' | 'text';
42
+ unique: boolean;
43
+ } | {
44
+ localized: boolean;
45
+ type: 'array' | 'blocks';
46
+ } | {
47
+ localized: boolean;
48
+ type: 'checkbox' | 'date' | 'json' | 'radio';
49
+ } | {
50
+ localized: boolean;
51
+ type: 'code' | 'email' | 'point' | 'textarea';
52
+ unique: boolean;
53
+ };
54
+ export declare function buildDocumentSchema(config: Config): DocumentSchemaWire;
55
+ export declare function buildVersionDocumentSchema(schema: DocumentSchemaWire, targetCollectionSlug: string): DocumentSchemaWire;
56
+ export {};
@@ -0,0 +1,183 @@
1
+ export function buildDocumentSchema(config) {
2
+ const collections = {};
3
+ const blocksBySlug = new Map();
4
+ for (const block of config.blocks ?? []){
5
+ blocksBySlug.set(block.slug, block);
6
+ }
7
+ for (const collection of config.collections ?? []){
8
+ collections[collection.slug] = buildCollectionSchema(collection.slug, collection.fields, blocksBySlug);
9
+ }
10
+ for (const global of config.globals ?? []){
11
+ const slug = `_global-${global.slug}`;
12
+ collections[slug] = buildCollectionSchema(slug, global.fields, blocksBySlug);
13
+ }
14
+ return {
15
+ collections,
16
+ version: 1
17
+ };
18
+ }
19
+ export function buildVersionDocumentSchema(schema, targetCollectionSlug) {
20
+ const target = schema.collections[targetCollectionSlug];
21
+ if (!target) {
22
+ return schema;
23
+ }
24
+ const prefixedPaths = {};
25
+ for (const [path, fieldSchema] of Object.entries(target.paths)){
26
+ prefixedPaths[`version.${path}`] = fieldSchema;
27
+ }
28
+ prefixedPaths['version._payloadAutosave'] = {
29
+ type: 'checkbox',
30
+ localized: false
31
+ };
32
+ return {
33
+ ...schema,
34
+ collections: {
35
+ ...schema.collections,
36
+ [targetCollectionSlug]: {
37
+ ...target,
38
+ paths: prefixedPaths
39
+ }
40
+ }
41
+ };
42
+ }
43
+ function buildCollectionSchema(name, fields, blocksBySlug) {
44
+ const paths = {};
45
+ collectPaths(fields, '', false, paths, blocksBySlug);
46
+ return {
47
+ name,
48
+ hints: [],
49
+ paths
50
+ };
51
+ }
52
+ function collectPaths(fields, prefix, absorbed, paths, blocksBySlug) {
53
+ for (const field of fields){
54
+ if (field.type === 'row' || field.type === 'collapsible' || field.type === 'group' && (!('name' in field) || !field.name)) {
55
+ collectPaths(field.fields, prefix, absorbed, paths, blocksBySlug);
56
+ continue;
57
+ }
58
+ if (field.type === 'tabs') {
59
+ for (const tab of field.tabs){
60
+ const tabOwnLocalized = 'localized' in tab && tab.localized === true;
61
+ if ('name' in tab && tab.name) {
62
+ paths[`${prefix}${tab.name}`] = {
63
+ type: 'group',
64
+ hasMany: false,
65
+ localized: tabOwnLocalized && !absorbed
66
+ };
67
+ collectPaths(tab.fields, `${prefix}${tab.name}.`, absorbed || tabOwnLocalized, paths, blocksBySlug);
68
+ } else {
69
+ collectPaths(tab.fields, prefix, absorbed, paths, blocksBySlug);
70
+ }
71
+ }
72
+ continue;
73
+ }
74
+ if (field.type === 'ui' || !('name' in field) || !field.name) {
75
+ continue;
76
+ }
77
+ collectNamedField(field, prefix, absorbed, paths, blocksBySlug);
78
+ }
79
+ }
80
+ function collectNamedField(field, prefix, absorbed, paths, blocksBySlug) {
81
+ if (!('name' in field) || !field.name) {
82
+ return;
83
+ }
84
+ const path = `${prefix}${field.name}`;
85
+ const localized = 'localized' in field && field.localized === true && !absorbed;
86
+ const childAbsorbed = absorbed || 'localized' in field && field.localized === true;
87
+ const hasMany = 'hasMany' in field ? Boolean(field.hasMany) : false;
88
+ const unique = 'unique' in field ? Boolean(field.unique) : false;
89
+ switch(field.type){
90
+ case 'array':
91
+ paths[path] = {
92
+ type: 'array',
93
+ localized
94
+ };
95
+ collectPaths(field.fields, `${path}.`, childAbsorbed, paths, blocksBySlug);
96
+ return;
97
+ case 'blocks':
98
+ {
99
+ paths[path] = {
100
+ type: 'blocks',
101
+ localized
102
+ };
103
+ paths[`${path}.blockType`] = {
104
+ type: 'text',
105
+ hasMany: false,
106
+ localized: false,
107
+ unique: false
108
+ };
109
+ const blockFields = [];
110
+ for (const block of field.blocks){
111
+ const resolved = typeof block === 'string' ? blocksBySlug.get(block) : block;
112
+ if (resolved) {
113
+ blockFields.push(...resolved.fields);
114
+ }
115
+ }
116
+ collectPaths(blockFields, `${path}.`, childAbsorbed, paths, blocksBySlug);
117
+ return;
118
+ }
119
+ case 'checkbox':
120
+ case 'date':
121
+ case 'json':
122
+ case 'radio':
123
+ paths[path] = {
124
+ type: field.type,
125
+ localized
126
+ };
127
+ return;
128
+ case 'code':
129
+ case 'email':
130
+ case 'point':
131
+ case 'textarea':
132
+ paths[path] = {
133
+ type: field.type,
134
+ localized,
135
+ unique
136
+ };
137
+ return;
138
+ case 'group':
139
+ paths[path] = {
140
+ type: 'group',
141
+ hasMany,
142
+ localized
143
+ };
144
+ collectPaths(field.fields, `${path}.`, childAbsorbed, paths, blocksBySlug);
145
+ return;
146
+ case 'join':
147
+ paths[path] = {
148
+ type: 'join',
149
+ collection: field.collection,
150
+ on: field.on
151
+ };
152
+ return;
153
+ case 'number':
154
+ case 'select':
155
+ case 'text':
156
+ paths[path] = {
157
+ type: field.type,
158
+ hasMany,
159
+ localized,
160
+ unique
161
+ };
162
+ return;
163
+ case 'relationship':
164
+ case 'upload':
165
+ paths[path] = {
166
+ type: field.type,
167
+ collection: field.relationTo,
168
+ hasMany,
169
+ localized,
170
+ unique
171
+ };
172
+ return;
173
+ case 'richText':
174
+ paths[path] = {
175
+ type: 'richText',
176
+ format: 'lexical',
177
+ localized
178
+ };
179
+ return;
180
+ default:
181
+ return;
182
+ }
183
+ }
@@ -17,4 +17,3 @@ type ConvertOptions = {
17
17
  };
18
18
  export declare function convertPayloadWhereToContentAPI(where: undefined | Where, options?: ConvertOptions): WhereClause;
19
19
  export {};
20
- //# sourceMappingURL=where.d.ts.map
@@ -104,5 +104,3 @@ export function convertPayloadWhereToContentAPI(where, options = {}) {
104
104
  and: conditions
105
105
  };
106
106
  }
107
-
108
- //# sourceMappingURL=where.js.map
@@ -8,4 +8,3 @@ import type { Config } from 'payload';
8
8
  * local development the env var is absent and this plugin is a no-op.
9
9
  */
10
10
  export declare function scheduleExtractPlugin(): (config: Config) => Config;
11
- //# sourceMappingURL=schedule-extract-plugin.d.ts.map
@@ -30,5 +30,3 @@ import path from 'path';
30
30
  return config;
31
31
  };
32
32
  }
33
-
34
- //# sourceMappingURL=schedule-extract-plugin.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Endpoint } from 'payload';
2
2
  export declare const health: Endpoint;
3
- //# sourceMappingURL=health.d.ts.map