@payloadcms/figma 0.0.1-alpha.42 → 0.0.1-alpha.6

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 (286) hide show
  1. package/dist/api/control-plane.d.ts +1 -22
  2. package/dist/api/control-plane.d.ts.map +1 -1
  3. package/dist/api/control-plane.js +22 -55
  4. package/dist/api/control-plane.js.map +1 -1
  5. package/dist/api/figma-api.d.ts.map +1 -1
  6. package/dist/api/figma-api.js +21 -45
  7. package/dist/api/figma-api.js.map +1 -1
  8. package/dist/auth/callback-server.d.ts.map +1 -1
  9. package/dist/auth/callback-server.js +1 -2
  10. package/dist/auth/callback-server.js.map +1 -1
  11. package/dist/auth/crypto-utils.d.ts.map +1 -1
  12. package/dist/auth/crypto-utils.js +5 -5
  13. package/dist/auth/crypto-utils.js.map +1 -1
  14. package/dist/auth/jwt-validator.d.ts +1 -2
  15. package/dist/auth/jwt-validator.d.ts.map +1 -1
  16. package/dist/auth/jwt-validator.js +2 -2
  17. package/dist/auth/jwt-validator.js.map +1 -1
  18. package/dist/auth/oauth-flow.d.ts +1 -1
  19. package/dist/auth/oauth-flow.d.ts.map +1 -1
  20. package/dist/auth/oauth-flow.js +11 -15
  21. package/dist/auth/oauth-flow.js.map +1 -1
  22. package/dist/auth/project-token.d.ts.map +1 -1
  23. package/dist/auth/project-token.js +4 -9
  24. package/dist/auth/project-token.js.map +1 -1
  25. package/dist/auth/refresh.d.ts +1 -2
  26. package/dist/auth/refresh.d.ts.map +1 -1
  27. package/dist/auth/refresh.js +12 -25
  28. package/dist/auth/refresh.js.map +1 -1
  29. package/dist/auth/token-store.d.ts +0 -12
  30. package/dist/auth/token-store.d.ts.map +1 -1
  31. package/dist/auth/token-store.js +5 -28
  32. package/dist/auth/token-store.js.map +1 -1
  33. package/dist/auth/types.d.ts +4 -7
  34. package/dist/auth/types.d.ts.map +1 -1
  35. package/dist/auth/types.js.map +1 -1
  36. package/dist/cli.d.ts.map +1 -1
  37. package/dist/cli.js +6 -39
  38. package/dist/cli.js.map +1 -1
  39. package/dist/commands/deploy.d.ts +0 -4
  40. package/dist/commands/deploy.d.ts.map +1 -1
  41. package/dist/commands/deploy.js +129 -72
  42. package/dist/commands/deploy.js.map +1 -1
  43. package/dist/commands/init.d.ts +5 -1
  44. package/dist/commands/init.d.ts.map +1 -1
  45. package/dist/commands/init.js +85 -105
  46. package/dist/commands/init.js.map +1 -1
  47. package/dist/commands/list-tokens.d.ts +3 -3
  48. package/dist/commands/list-tokens.d.ts.map +1 -1
  49. package/dist/commands/list-tokens.js +7 -22
  50. package/dist/commands/list-tokens.js.map +1 -1
  51. package/dist/commands/login.d.ts +1 -8
  52. package/dist/commands/login.d.ts.map +1 -1
  53. package/dist/commands/login.js +12 -30
  54. package/dist/commands/login.js.map +1 -1
  55. package/dist/commands/logout.d.ts +4 -5
  56. package/dist/commands/logout.d.ts.map +1 -1
  57. package/dist/commands/logout.js +13 -56
  58. package/dist/commands/logout.js.map +1 -1
  59. package/dist/config/oauth.d.ts +14 -4
  60. package/dist/config/oauth.d.ts.map +1 -1
  61. package/dist/config/oauth.js +40 -19
  62. package/dist/config/oauth.js.map +1 -1
  63. package/dist/constants.d.ts +18 -26
  64. package/dist/constants.d.ts.map +1 -1
  65. package/dist/constants.js +20 -34
  66. package/dist/constants.js.map +1 -1
  67. package/dist/exports/client.d.ts +0 -1
  68. package/dist/exports/client.d.ts.map +1 -1
  69. package/dist/exports/client.js +0 -1
  70. package/dist/exports/client.js.map +1 -1
  71. package/dist/index.d.ts +1 -2
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +1 -3
  74. package/dist/index.js.map +1 -1
  75. package/dist/oauth/components/LoginButton/index.d.ts.map +1 -1
  76. package/dist/oauth/components/LoginButton/index.js +6 -50
  77. package/dist/oauth/components/LoginButton/index.js.map +1 -1
  78. package/dist/oauth/components/LoginButton/index.scss +3 -50
  79. package/dist/oauth/components/LogoutButton/index.d.ts.map +1 -1
  80. package/dist/oauth/components/LogoutButton/index.js +4 -5
  81. package/dist/oauth/components/LogoutButton/index.js.map +1 -1
  82. package/dist/oauth/defaults.d.ts.map +1 -1
  83. package/dist/oauth/defaults.js +5 -29
  84. package/dist/oauth/defaults.js.map +1 -1
  85. package/dist/oauth/endpoints/getLoginEndpoint.d.ts.map +1 -1
  86. package/dist/oauth/endpoints/getLoginEndpoint.js +11 -21
  87. package/dist/oauth/endpoints/getLoginEndpoint.js.map +1 -1
  88. package/dist/oauth/endpoints/getLogoutEndpoint.d.ts.map +1 -1
  89. package/dist/oauth/endpoints/getLogoutEndpoint.js +4 -7
  90. package/dist/oauth/endpoints/getLogoutEndpoint.js.map +1 -1
  91. package/dist/oauth/index.d.ts.map +1 -1
  92. package/dist/oauth/index.js +13 -40
  93. package/dist/oauth/index.js.map +1 -1
  94. package/dist/oauth/strategy/index.d.ts +2 -0
  95. package/dist/oauth/strategy/index.d.ts.map +1 -1
  96. package/dist/oauth/strategy/index.js +15 -38
  97. package/dist/oauth/strategy/index.js.map +1 -1
  98. package/dist/oauth/types.d.ts +6 -6
  99. package/dist/oauth/types.d.ts.map +1 -1
  100. package/dist/oauth/types.js.map +1 -1
  101. package/dist/oauth/utilities/createCookieOptions.d.ts.map +1 -1
  102. package/dist/oauth/utilities/createCookieOptions.js.map +1 -1
  103. package/dist/oauth/utilities/getAdminPath.d.ts +8 -0
  104. package/dist/oauth/utilities/getAdminPath.d.ts.map +1 -0
  105. package/dist/oauth/utilities/getAdminPath.js +9 -0
  106. package/dist/oauth/utilities/getAdminPath.js.map +1 -0
  107. package/dist/oauth/utilities/refreshTokens.d.ts.map +1 -1
  108. package/dist/oauth/utilities/refreshTokens.js +1 -1
  109. package/dist/oauth/utilities/refreshTokens.js.map +1 -1
  110. package/dist/plugin/build-config.d.ts +4 -21
  111. package/dist/plugin/build-config.d.ts.map +1 -1
  112. package/dist/plugin/build-config.js +7 -113
  113. package/dist/plugin/build-config.js.map +1 -1
  114. package/dist/types.d.ts +0 -1
  115. package/dist/types.d.ts.map +1 -1
  116. package/dist/types.js.map +1 -1
  117. package/dist/utils/asset-collection.d.ts +6 -3
  118. package/dist/utils/asset-collection.d.ts.map +1 -1
  119. package/dist/utils/asset-collection.js +34 -10
  120. package/dist/utils/asset-collection.js.map +1 -1
  121. package/dist/utils/config.js +1 -1
  122. package/dist/utils/config.js.map +1 -1
  123. package/dist/utils/env-management.d.ts +8 -9
  124. package/dist/utils/env-management.d.ts.map +1 -1
  125. package/dist/utils/env-management.js +74 -73
  126. package/dist/utils/env-management.js.map +1 -1
  127. package/dist/utils/formatter.d.ts.map +1 -1
  128. package/dist/utils/formatter.js +5 -3
  129. package/dist/utils/formatter.js.map +1 -1
  130. package/dist/utils/lambda-config.d.ts +1 -3
  131. package/dist/utils/lambda-config.d.ts.map +1 -1
  132. package/dist/utils/lambda-config.js +32 -38
  133. package/dist/utils/lambda-config.js.map +1 -1
  134. package/dist/utils/messages.js +8 -8
  135. package/dist/utils/messages.js.map +1 -1
  136. package/dist/utils/payload-config-ast.d.ts +3 -22
  137. package/dist/utils/payload-config-ast.d.ts.map +1 -1
  138. package/dist/utils/payload-config-ast.js +31 -89
  139. package/dist/utils/payload-config-ast.js.map +1 -1
  140. package/dist/utils/payload-config-finder.d.ts +2 -2
  141. package/dist/utils/payload-config-finder.d.ts.map +1 -1
  142. package/dist/utils/payload-config-finder.js +9 -48
  143. package/dist/utils/payload-config-finder.js.map +1 -1
  144. package/dist/utils/payload-config-modifier.d.ts.map +1 -1
  145. package/dist/utils/payload-config-modifier.js +6 -54
  146. package/dist/utils/payload-config-modifier.js.map +1 -1
  147. package/dist/utils/payload-package-check.d.ts +1 -12
  148. package/dist/utils/payload-package-check.d.ts.map +1 -1
  149. package/dist/utils/payload-package-check.js +5 -63
  150. package/dist/utils/payload-package-check.js.map +1 -1
  151. package/dist/utils/project.d.ts.map +1 -1
  152. package/dist/utils/project.js +5 -8
  153. package/dist/utils/project.js.map +1 -1
  154. package/dist/utils/s3-upload.d.ts +1 -0
  155. package/dist/utils/s3-upload.d.ts.map +1 -1
  156. package/dist/utils/s3-upload.js +3 -10
  157. package/dist/utils/s3-upload.js.map +1 -1
  158. package/dist/utils/token-display.d.ts.map +1 -1
  159. package/dist/utils/token-display.js +5 -11
  160. package/dist/utils/token-display.js.map +1 -1
  161. package/dist/utils/typescript-validator.d.ts.map +1 -1
  162. package/dist/utils/typescript-validator.js +6 -4
  163. package/dist/utils/typescript-validator.js.map +1 -1
  164. package/package.json +9 -27
  165. package/dist/commands/build-lambda-zip.d.ts +0 -5
  166. package/dist/commands/build-lambda-zip.d.ts.map +0 -1
  167. package/dist/commands/build-lambda-zip.js +0 -19
  168. package/dist/commands/build-lambda-zip.js.map +0 -1
  169. package/dist/db-content-api/README.md +0 -98
  170. package/dist/db-content-api/generated/content-api-types.d.ts +0 -3914
  171. package/dist/db-content-api/generated/content-api-types.d.ts.map +0 -1
  172. package/dist/db-content-api/generated/content-api-types.js +0 -7
  173. package/dist/db-content-api/generated/content-api-types.js.map +0 -1
  174. package/dist/db-content-api/index.d.ts +0 -18
  175. package/dist/db-content-api/index.d.ts.map +0 -1
  176. package/dist/db-content-api/index.js +0 -586
  177. package/dist/db-content-api/index.js.map +0 -1
  178. package/dist/db-content-api/temp-utilities/slug.d.ts +0 -2
  179. package/dist/db-content-api/temp-utilities/slug.d.ts.map +0 -1
  180. package/dist/db-content-api/temp-utilities/slug.js +0 -3
  181. package/dist/db-content-api/temp-utilities/slug.js.map +0 -1
  182. package/dist/db-content-api/temp-utilities/sorting.d.ts +0 -3
  183. package/dist/db-content-api/temp-utilities/sorting.d.ts.map +0 -1
  184. package/dist/db-content-api/temp-utilities/sorting.js +0 -32
  185. package/dist/db-content-api/temp-utilities/sorting.js.map +0 -1
  186. package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts +0 -34
  187. package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts.map +0 -1
  188. package/dist/db-content-api/temp-utilities/unwrapDocument.js +0 -53
  189. package/dist/db-content-api/temp-utilities/unwrapDocument.js.map +0 -1
  190. package/dist/db-content-api/utilities/auth.d.ts +0 -30
  191. package/dist/db-content-api/utilities/auth.d.ts.map +0 -1
  192. package/dist/db-content-api/utilities/auth.js +0 -81
  193. package/dist/db-content-api/utilities/auth.js.map +0 -1
  194. package/dist/db-content-api/utilities/buildPathTypes.d.ts +0 -12
  195. package/dist/db-content-api/utilities/buildPathTypes.d.ts.map +0 -1
  196. package/dist/db-content-api/utilities/buildPathTypes.js +0 -157
  197. package/dist/db-content-api/utilities/buildPathTypes.js.map +0 -1
  198. package/dist/db-content-api/utilities/data/applyDefaults.d.ts +0 -7
  199. package/dist/db-content-api/utilities/data/applyDefaults.d.ts.map +0 -1
  200. package/dist/db-content-api/utilities/data/applyDefaults.js +0 -59
  201. package/dist/db-content-api/utilities/data/applyDefaults.js.map +0 -1
  202. package/dist/db-content-api/utilities/data/castFieldValue.d.ts +0 -11
  203. package/dist/db-content-api/utilities/data/castFieldValue.d.ts.map +0 -1
  204. package/dist/db-content-api/utilities/data/castFieldValue.js +0 -66
  205. package/dist/db-content-api/utilities/data/castFieldValue.js.map +0 -1
  206. package/dist/db-content-api/utilities/data/index.d.ts +0 -32
  207. package/dist/db-content-api/utilities/data/index.d.ts.map +0 -1
  208. package/dist/db-content-api/utilities/data/index.js +0 -190
  209. package/dist/db-content-api/utilities/data/index.js.map +0 -1
  210. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +0 -12
  211. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts.map +0 -1
  212. package/dist/db-content-api/utilities/data/removeVirtualFields.js +0 -54
  213. package/dist/db-content-api/utilities/data/removeVirtualFields.js.map +0 -1
  214. package/dist/db-content-api/utilities/data/stripFields.d.ts +0 -48
  215. package/dist/db-content-api/utilities/data/stripFields.d.ts.map +0 -1
  216. package/dist/db-content-api/utilities/data/stripFields.js +0 -195
  217. package/dist/db-content-api/utilities/data/stripFields.js.map +0 -1
  218. package/dist/db-content-api/utilities/joins.d.ts +0 -55
  219. package/dist/db-content-api/utilities/joins.d.ts.map +0 -1
  220. package/dist/db-content-api/utilities/joins.js +0 -136
  221. package/dist/db-content-api/utilities/joins.js.map +0 -1
  222. package/dist/db-content-api/utilities/where.d.ts +0 -12
  223. package/dist/db-content-api/utilities/where.d.ts.map +0 -1
  224. package/dist/db-content-api/utilities/where.js +0 -121
  225. package/dist/db-content-api/utilities/where.js.map +0 -1
  226. package/dist/endpoints/health.d.ts +0 -3
  227. package/dist/endpoints/health.d.ts.map +0 -1
  228. package/dist/endpoints/health.js +0 -11
  229. package/dist/endpoints/health.js.map +0 -1
  230. package/dist/oauth/utilities/isDuplicateKeyError.d.ts +0 -7
  231. package/dist/oauth/utilities/isDuplicateKeyError.d.ts.map +0 -1
  232. package/dist/oauth/utilities/isDuplicateKeyError.js +0 -14
  233. package/dist/oauth/utilities/isDuplicateKeyError.js.map +0 -1
  234. package/dist/storage-content-api/api-types.d.ts +0 -168
  235. package/dist/storage-content-api/api-types.d.ts.map +0 -1
  236. package/dist/storage-content-api/api-types.js +0 -6
  237. package/dist/storage-content-api/api-types.js.map +0 -1
  238. package/dist/storage-content-api/client-uploads/ClientUploadHandler.d.ts +0 -9
  239. package/dist/storage-content-api/client-uploads/ClientUploadHandler.d.ts.map +0 -1
  240. package/dist/storage-content-api/client-uploads/ClientUploadHandler.js +0 -42
  241. package/dist/storage-content-api/client-uploads/ClientUploadHandler.js.map +0 -1
  242. package/dist/storage-content-api/client-uploads/generateSignedURL.d.ts +0 -13
  243. package/dist/storage-content-api/client-uploads/generateSignedURL.d.ts.map +0 -1
  244. package/dist/storage-content-api/client-uploads/generateSignedURL.js +0 -32
  245. package/dist/storage-content-api/client-uploads/generateSignedURL.js.map +0 -1
  246. package/dist/storage-content-api/client.d.ts +0 -6
  247. package/dist/storage-content-api/client.d.ts.map +0 -1
  248. package/dist/storage-content-api/client.js +0 -36
  249. package/dist/storage-content-api/client.js.map +0 -1
  250. package/dist/storage-content-api/generateURL.d.ts +0 -7
  251. package/dist/storage-content-api/generateURL.d.ts.map +0 -1
  252. package/dist/storage-content-api/generateURL.js +0 -8
  253. package/dist/storage-content-api/generateURL.js.map +0 -1
  254. package/dist/storage-content-api/handleDelete.d.ts +0 -8
  255. package/dist/storage-content-api/handleDelete.d.ts.map +0 -1
  256. package/dist/storage-content-api/handleDelete.js +0 -17
  257. package/dist/storage-content-api/handleDelete.js.map +0 -1
  258. package/dist/storage-content-api/handleUpload.d.ts +0 -11
  259. package/dist/storage-content-api/handleUpload.d.ts.map +0 -1
  260. package/dist/storage-content-api/handleUpload.js +0 -144
  261. package/dist/storage-content-api/handleUpload.js.map +0 -1
  262. package/dist/storage-content-api/index.d.ts +0 -5
  263. package/dist/storage-content-api/index.d.ts.map +0 -1
  264. package/dist/storage-content-api/index.js +0 -31
  265. package/dist/storage-content-api/index.js.map +0 -1
  266. package/dist/storage-content-api/staticHandler.d.ts +0 -10
  267. package/dist/storage-content-api/staticHandler.d.ts.map +0 -1
  268. package/dist/storage-content-api/staticHandler.js +0 -56
  269. package/dist/storage-content-api/staticHandler.js.map +0 -1
  270. package/dist/storage-content-api/types.d.ts +0 -10
  271. package/dist/storage-content-api/types.d.ts.map +0 -1
  272. package/dist/storage-content-api/types.js +0 -3
  273. package/dist/storage-content-api/types.js.map +0 -1
  274. package/dist/templates/README.md +0 -19
  275. package/dist/utils/build-lambda-zip.d.ts +0 -14
  276. package/dist/utils/build-lambda-zip.d.ts.map +0 -1
  277. package/dist/utils/build-lambda-zip.js +0 -81
  278. package/dist/utils/build-lambda-zip.js.map +0 -1
  279. package/dist/utils/format-env-suffix.d.ts +0 -12
  280. package/dist/utils/format-env-suffix.d.ts.map +0 -1
  281. package/dist/utils/format-env-suffix.js +0 -13
  282. package/dist/utils/format-env-suffix.js.map +0 -1
  283. package/dist/utils/version-check.d.ts +0 -3
  284. package/dist/utils/version-check.d.ts.map +0 -1
  285. package/dist/utils/version-check.js +0 -38
  286. package/dist/utils/version-check.js.map +0 -1
@@ -1,586 +0,0 @@
1
- import createClient from 'openapi-fetch';
2
- import { createDatabaseAdapter } from 'payload';
3
- import { v4 as uuid } from 'uuid';
4
- import { getGlobalSlug } from './temp-utilities/slug.js';
5
- import { addFallbackSort } from './temp-utilities/sorting.js';
6
- import { unwrapDocument, unwrapFindResponse } from './temp-utilities/unwrapDocument.js';
7
- import { createAuthMiddleware, createErrorMiddleware } from './utilities/auth.js';
8
- import { buildPathTypes } from './utilities/buildPathTypes.js';
9
- import { dataToContentAPI } from './utilities/data/index.js';
10
- import { convertPayloadJoinsToContentAPI } from './utilities/joins.js';
11
- import { convertPayloadWhereToContentAPI } from './utilities/where.js';
12
- async function init() {
13
- if (this.auth.mode === 'apiKey') {
14
- this.payload.logger.info('Using API Key authentication');
15
- } else if (this.auth.mode === 'tokenStore') {
16
- this.payload.logger.info('Using TokenStore authentication (local dev)');
17
- } else {
18
- this.payload.logger.info('Using Dev JWT authentication (testing)');
19
- }
20
- if (process.env.PAYLOAD_DROP_DATABASE === 'true') {
21
- this.payload.logger.info(`---- DROPPING CONTENT API SYSTEM (${this.contentSystemId}) ----`);
22
- try {
23
- await fetch(`${this.url}/dev/clear-db`, {
24
- body: JSON.stringify({
25
- contentSystemId: this.contentSystemId
26
- }),
27
- headers: {
28
- 'Content-Type': 'application/json'
29
- },
30
- method: 'POST'
31
- });
32
- this.payload.logger.info('---- DROPPED CONTENT API SYSTEM ----');
33
- } catch (error) {
34
- this.payload.logger.warn(`Failed to drop content system: ${error.message}`);
35
- }
36
- }
37
- let existingIds;
38
- try {
39
- const { data: response, error } = await this.client.GET('/api/v0/content_systems/{contentSystemId}/collections', {
40
- params: {
41
- path: {
42
- contentSystemId: this.contentSystemId
43
- }
44
- }
45
- });
46
- if (error) {
47
- throw new Error(JSON.stringify(error));
48
- }
49
- if (!response) {
50
- throw new Error('No response from collections endpoint');
51
- }
52
- existingIds = new Set(response.data.map((c)=>c.id));
53
- this.payload.logger.info(`Found ${existingIds.size} existing collections`);
54
- } catch (error) {
55
- this.payload.logger.warn(`Failed to fetch collections, will attempt to create all: ${error.message}`);
56
- existingIds = new Set();
57
- }
58
- for (const collection of this.payload.config.collections){
59
- if (!existingIds.has(collection.slug)) {
60
- await createCollection.call(this, collection.slug);
61
- }
62
- }
63
- for (const global of this.payload.config.globals || []){
64
- const globalId = `_global-${global.slug}`;
65
- if (!existingIds.has(globalId)) {
66
- await createCollection.call(this, globalId);
67
- }
68
- }
69
- }
70
- async function createCollection(collectionId) {
71
- try {
72
- const { error } = await this.client.POST('/api/v0/content_systems/{contentSystemId}/collections', {
73
- body: {
74
- id: collectionId
75
- },
76
- params: {
77
- path: {
78
- contentSystemId: this.contentSystemId
79
- }
80
- }
81
- });
82
- if (error) {
83
- throw new Error(JSON.stringify(error));
84
- }
85
- this.payload.logger.info(`Created collection: ${collectionId}`);
86
- } catch (error) {
87
- const errorMessage = error.message;
88
- if (!errorMessage.includes('already exists') && !errorMessage.includes('409')) {
89
- this.payload.logger.warn(`Failed to create collection ${collectionId}: ${errorMessage}`);
90
- }
91
- }
92
- }
93
- async function findMany({ collection, joins, limit, page, pagination, sort, where }) {
94
- const { data: response, error } = await this.client.POST('/api/v0/documents:find', {
95
- body: {
96
- collection,
97
- contentSystemId: this.contentSystemId,
98
- join: convertPayloadJoinsToContentAPI(this.payload, collection, joins),
99
- limit,
100
- page: page ?? 1,
101
- sort: addFallbackSort(sort, this.payload, collection),
102
- where: convertPayloadWhereToContentAPI(where ?? {}),
103
- ...buildPathTypes(this.payload, collection, where)
104
- }
105
- });
106
- if (error) {
107
- throw new Error(`Content API findMany error: ${JSON.stringify(error)}`);
108
- }
109
- if (!response) {
110
- throw new Error('No response from findMany');
111
- }
112
- return unwrapFindResponse(this.payload, response.result, collection);
113
- }
114
- async function find(args) {
115
- const collectionConfig = this.payload.config.collections.find((c)=>c.slug === args.collection);
116
- return findMany.call(this, {
117
- collection: args.collection,
118
- joins: args.joins,
119
- // TODO: FindArgs.limit should be 'number' not 'number | undefined'
120
- // is sanitized by Payload Core before calling the adapter (defaults to 10 or 0 based on pagination)
121
- limit: args.limit,
122
- page: args.page ?? 1,
123
- pagination: args.pagination,
124
- sort: args.sort || collectionConfig?.defaultSort,
125
- where: args.where
126
- });
127
- }
128
- // TODO: remove Omit when this PR is released: https://github.com/payloadcms/payload/pull/15183
129
- async function findVersions(args) {
130
- const sortWithFallback = addFallbackSort(args.sort || '-updatedAt', this.payload, args.collection);
131
- const whereClause = convertPayloadWhereToContentAPI(args.where ?? {}, {
132
- parentToDocumentId: true
133
- });
134
- const { data: response, error } = await this.client.POST('/api/v0/document_versions:find', {
135
- body: {
136
- collection: args.collection,
137
- contentSystemId: this.contentSystemId,
138
- // TODO: FindVersionsArgs.limit should be 'number' not 'number | undefined'
139
- // is sanitized by Payload Core before calling the adapter (defaults to 10 or 0 based on pagination)
140
- limit: args.limit,
141
- page: args.page ?? 1,
142
- sort: sortWithFallback,
143
- where: whereClause,
144
- ...buildPathTypes(this.payload, args.collection, args.where)
145
- }
146
- });
147
- if (error) {
148
- throw new Error(`Content API findVersions error: ${JSON.stringify(error)}`);
149
- }
150
- if (!response) {
151
- throw new Error('No response from findVersions');
152
- }
153
- return unwrapFindResponse(this.payload, response.result, args.collection);
154
- }
155
- async function queryDrafts(args) {
156
- const versionsResult = await this.findVersions({
157
- collection: args.collection,
158
- limit: args.limit,
159
- page: args.page,
160
- pagination: args.pagination,
161
- sort: args.sort,
162
- where: {
163
- ...args.where,
164
- latest: {
165
- equals: true
166
- }
167
- }
168
- });
169
- // queryDrafts should return documents with fields at root level, not nested in 'version'
170
- // So we need to unwrap the version structure and merge version fields to root
171
- const docs = versionsResult.docs.map((versionDoc)=>{
172
- const { version, ...versionMeta } = versionDoc;
173
- return {
174
- ...versionMeta,
175
- ...version,
176
- // Keep version metadata like parent, but document fields take precedence
177
- id: version.id
178
- };
179
- });
180
- return {
181
- ...versionsResult,
182
- docs
183
- };
184
- }
185
- async function createVersion(args) {
186
- const { data: response, error } = await this.client.POST('/api/v0/document_versions:create', {
187
- body: {
188
- collection: args.collectionSlug,
189
- contentSystemId: this.contentSystemId,
190
- versionDoc: {
191
- latest: !args.autosave,
192
- parent: String(args.parent),
193
- version: dataToContentAPI(this.payload, args.collectionSlug, args.versionData, {
194
- applyDefaults: true
195
- })
196
- }
197
- }
198
- });
199
- if (error) {
200
- throw new Error(`Content API createVersion error: ${JSON.stringify(error)}`);
201
- }
202
- if (!response) {
203
- throw new Error('No response from createVersion');
204
- }
205
- return unwrapDocument(this.payload, response.result, args.collectionSlug);
206
- }
207
- async function updateVersion(args) {
208
- const where = args.where ?? {
209
- id: {
210
- equals: args.id
211
- }
212
- };
213
- const { data: response, error } = await this.client.POST('/api/v0/document_versions:update', {
214
- body: {
215
- collection: args.collection,
216
- contentSystemId: this.contentSystemId,
217
- createOnMissing: false,
218
- versionDoc: {
219
- version: dataToContentAPI(this.payload, args.collection, args.versionData)
220
- },
221
- where: convertPayloadWhereToContentAPI(where),
222
- ...buildPathTypes(this.payload, args.collection, where)
223
- }
224
- });
225
- if (error) {
226
- throw new Error(`Content API updateVersion error: ${JSON.stringify(error)}`);
227
- }
228
- if (!response?.result || !('data' in response.result)) {
229
- throw new Error('No document data in updateVersion response');
230
- }
231
- const doc = response.result.data[0];
232
- if (!doc) {
233
- return null;
234
- }
235
- return unwrapDocument(this.payload, doc, args.collection);
236
- }
237
- async function deleteVersions(args) {
238
- if (!args.collection) {
239
- throw new Error('deleteVersions requires a collection');
240
- }
241
- const { error } = await this.client.POST('/api/v0/document_versions:delete', {
242
- body: {
243
- collection: args.collection,
244
- contentSystemId: this.contentSystemId,
245
- where: convertPayloadWhereToContentAPI(args.where),
246
- ...buildPathTypes(this.payload, args.collection, args.where)
247
- }
248
- });
249
- if (error) {
250
- throw new Error(`Content API deleteVersions error: ${JSON.stringify(error)}`);
251
- }
252
- }
253
- async function findOne(args) {
254
- const { docs } = await this.find({
255
- collection: args.collection,
256
- joins: args.joins,
257
- limit: 1,
258
- pagination: false,
259
- where: args.where
260
- });
261
- return docs[0] ?? null;
262
- }
263
- async function updateMany(args) {
264
- const sortWithFallback = addFallbackSort(args.sort || '-updatedAt', this.payload, args.collection);
265
- const { data: response, error } = await this.client.POST('/api/v0/documents:update', {
266
- body: {
267
- collection: args.collection,
268
- contentSystemId: this.contentSystemId,
269
- createOnMissing: false,
270
- doc: dataToContentAPI(this.payload, args.collection, args.data),
271
- limit: args.limit,
272
- returning: {},
273
- sort: sortWithFallback,
274
- where: convertPayloadWhereToContentAPI(args.where),
275
- ...buildPathTypes(this.payload, args.collection, args.where)
276
- }
277
- });
278
- if (error) {
279
- throw new Error(`Content API updateMany error: ${JSON.stringify(error)}`);
280
- }
281
- if (!response) {
282
- throw new Error('No response from updateMany');
283
- }
284
- if (response.result && 'data' in response.result) {
285
- return response.result.data.map((doc)=>unwrapDocument(this.payload, doc, args.collection));
286
- }
287
- return null;
288
- }
289
- async function updateOne(args) {
290
- const where = args.where ?? {
291
- id: {
292
- equals: args.id
293
- }
294
- };
295
- const { data: response, error } = await this.client.POST('/api/v0/documents:update', {
296
- body: {
297
- collection: args.collection,
298
- contentSystemId: this.contentSystemId,
299
- createOnMissing: false,
300
- doc: dataToContentAPI(this.payload, args.collection, args.data),
301
- returning: {},
302
- where: convertPayloadWhereToContentAPI(where),
303
- ...buildPathTypes(this.payload, args.collection, where)
304
- }
305
- });
306
- if (error) {
307
- throw new Error(`Content API updateOne error: ${JSON.stringify(error)}`);
308
- }
309
- if (!response) {
310
- throw new Error('No response from updateOne');
311
- }
312
- if (!response.result || !('data' in response.result)) {
313
- throw new Error('Unexpected response format from updateOne');
314
- }
315
- const doc = response.result.data[0];
316
- if (!doc) {
317
- return null;
318
- }
319
- return unwrapDocument(this.payload, doc, args.collection);
320
- }
321
- async function deleteMany(args) {
322
- const { error } = await this.client.POST('/api/v0/documents:delete', {
323
- body: {
324
- collection: args.collection,
325
- contentSystemId: this.contentSystemId,
326
- where: convertPayloadWhereToContentAPI(args.where),
327
- ...buildPathTypes(this.payload, args.collection, args.where)
328
- }
329
- });
330
- if (error) {
331
- throw new Error(`Content API deleteMany error: ${JSON.stringify(error)}`);
332
- }
333
- }
334
- async function deleteOne(args) {
335
- const { data: response, error } = await this.client.POST('/api/v0/documents:delete', {
336
- body: {
337
- collection: args.collection,
338
- contentSystemId: this.contentSystemId,
339
- returning: {},
340
- where: convertPayloadWhereToContentAPI(args.where),
341
- ...buildPathTypes(this.payload, args.collection, args.where)
342
- }
343
- });
344
- if (error) {
345
- throw new Error(`Content API deleteOne error: ${JSON.stringify(error)}`);
346
- }
347
- if (!response?.result || !('data' in response.result)) {
348
- throw new Error('No document data in deleteOne response');
349
- }
350
- const doc = response.result.data[0];
351
- if (!doc) {
352
- return null;
353
- }
354
- return unwrapDocument(this.payload, doc, args.collection);
355
- }
356
- async function create(args) {
357
- const id = args.data.id || uuid();
358
- const { data: response, error } = await this.client.POST('/api/v0/documents:create', {
359
- body: {
360
- collection: args.collection,
361
- contentSystemId: this.contentSystemId,
362
- doc: {
363
- id: String(id),
364
- ...dataToContentAPI(this.payload, args.collection, args.data, {
365
- applyDefaults: true,
366
- createdAt: true
367
- })
368
- }
369
- }
370
- });
371
- if (error) {
372
- throw new Error(`Content API create error: ${JSON.stringify(error)}`);
373
- }
374
- if (!response) {
375
- throw new Error('No response from create');
376
- }
377
- return unwrapDocument(this.payload, response.result, args.collection);
378
- }
379
- async function count(args) {
380
- const { data: response, error } = await this.client.POST('/api/v0/documents:count', {
381
- body: {
382
- collection: args.collection,
383
- contentSystemId: this.contentSystemId,
384
- where: convertPayloadWhereToContentAPI(args.where),
385
- ...buildPathTypes(this.payload, args.collection, args.where)
386
- }
387
- });
388
- if (error) {
389
- throw new Error(`Content API count error: ${JSON.stringify(error)}`);
390
- }
391
- if (!response) {
392
- throw new Error('No response from count');
393
- }
394
- return {
395
- totalDocs: response.result.count
396
- };
397
- }
398
- async function countVersions(args) {
399
- const { data: response, error } = await this.client.POST('/api/v0/document_versions:count', {
400
- body: {
401
- collection: args.collection,
402
- contentSystemId: this.contentSystemId,
403
- where: convertPayloadWhereToContentAPI(args.where),
404
- ...buildPathTypes(this.payload, args.collection, args.where)
405
- }
406
- });
407
- if (error) {
408
- throw new Error(`Content API countVersions error: ${JSON.stringify(error)}`);
409
- }
410
- if (!response) {
411
- throw new Error('No response from countVersions');
412
- }
413
- return {
414
- totalDocs: response.result.count
415
- };
416
- }
417
- async function upsert(args) {
418
- let documentId = args.data.id;
419
- if (!documentId && args.where && 'id' in args.where) {
420
- const idClause = args.where.id;
421
- if (idClause && 'equals' in idClause) {
422
- documentId = idClause.equals;
423
- }
424
- }
425
- if (!documentId) {
426
- documentId = uuid();
427
- }
428
- const { data: response, error } = await this.client.POST('/api/v0/documents:update', {
429
- body: {
430
- collection: args.collection,
431
- contentSystemId: this.contentSystemId,
432
- createOnMissing: {
433
- id: documentId
434
- },
435
- doc: dataToContentAPI(this.payload, args.collection, args.data, {
436
- applyDefaults: true,
437
- createdAt: true
438
- }),
439
- where: convertPayloadWhereToContentAPI(args.where)
440
- }
441
- });
442
- if (error) {
443
- throw new Error(`Content API upsert error: ${JSON.stringify(error)}`);
444
- }
445
- if (!response) {
446
- throw new Error('No response from upsert');
447
- }
448
- if (!response.result || !('data' in response.result)) {
449
- throw new Error('Unexpected response format from upsert');
450
- }
451
- const doc = response.result.data[0];
452
- if (!doc) {
453
- throw new Error('No document data in upsert response');
454
- }
455
- return unwrapDocument(this.payload, doc, args.collection);
456
- }
457
- function createGlobal(args) {
458
- return this.create({
459
- collection: getGlobalSlug(args.slug),
460
- data: {
461
- ...args.data,
462
- id: args.slug,
463
- globalType: args.slug
464
- }
465
- });
466
- }
467
- function findGlobal(args) {
468
- return this.findOne({
469
- collection: getGlobalSlug(args.slug),
470
- where: args.where ?? {}
471
- });
472
- }
473
- async function updateGlobal(args) {
474
- // Use upsert to ensure the global exists
475
- // Use slug as the consistent document ID for globals
476
- return this.upsert({
477
- collection: getGlobalSlug(args.slug),
478
- data: args.data,
479
- where: {
480
- id: {
481
- equals: args.slug
482
- }
483
- }
484
- });
485
- }
486
- // TODO: remove Omit when this PR is released: https://github.com/payloadcms/payload/pull/15183
487
- function findGlobalVersions(args) {
488
- return this.findVersions({
489
- collection: getGlobalSlug(args.global),
490
- limit: args.limit,
491
- page: args.page,
492
- pagination: args.pagination,
493
- sort: args.sort,
494
- where: args.where
495
- });
496
- }
497
- function createGlobalVersion(args) {
498
- // For globals, use the globalSlug as the consistent document ID
499
- // This matches what we do in updateGlobal
500
- return this.createVersion({
501
- autosave: args.autosave,
502
- collectionSlug: getGlobalSlug(args.globalSlug),
503
- createdAt: args.createdAt,
504
- parent: args.globalSlug,
505
- updatedAt: args.updatedAt,
506
- versionData: args.versionData
507
- });
508
- }
509
- function updateGlobalVersion(args) {
510
- // UpdateVersion requires either id OR where, not both
511
- if (args.id !== undefined) {
512
- return this.updateVersion({
513
- id: args.id,
514
- collection: getGlobalSlug(args.global),
515
- versionData: args.versionData
516
- });
517
- }
518
- // args.where is guaranteed by Payload when args.id is undefined
519
- return this.updateVersion({
520
- collection: getGlobalSlug(args.global),
521
- versionData: args.versionData,
522
- where: args.where
523
- });
524
- }
525
- function countGlobalVersions(args) {
526
- return this.countVersions({
527
- collection: getGlobalSlug(args.global),
528
- where: args.where
529
- });
530
- }
531
- export const contentAPIAdapter = (opts)=>({
532
- name: 'content-api',
533
- defaultIDType: 'text',
534
- init: ({ payload })=>{
535
- const client = createClient({
536
- baseUrl: opts.url
537
- });
538
- const middlewareOpts = {
539
- auth: opts.auth,
540
- contentSystemId: opts.contentSystemId,
541
- logger: payload.logger,
542
- url: opts.url
543
- };
544
- client.use(createAuthMiddleware(middlewareOpts));
545
- client.use(createErrorMiddleware(middlewareOpts));
546
- return createDatabaseAdapter({
547
- name: 'content-api',
548
- auth: opts.auth,
549
- beginTransaction: ()=>Promise.resolve(null),
550
- client,
551
- commitTransaction: async ()=>{},
552
- contentSystemId: opts.contentSystemId,
553
- count: count,
554
- countGlobalVersions: countGlobalVersions,
555
- countVersions: countVersions,
556
- create: create,
557
- createGlobal: createGlobal,
558
- createGlobalVersion: createGlobalVersion,
559
- createVersion: createVersion,
560
- defaultIDType: 'text',
561
- deleteMany: deleteMany,
562
- deleteOne: deleteOne,
563
- deleteVersions: deleteVersions,
564
- find: find,
565
- findDistinct: ()=>Promise.reject(new Error('findDistinct is not yet implemented for Content API adapter')),
566
- findGlobal: findGlobal,
567
- findGlobalVersions: findGlobalVersions,
568
- findOne: findOne,
569
- findVersions: findVersions,
570
- init,
571
- packageName: '@payloadcms/db-content-api',
572
- payload,
573
- queryDrafts: queryDrafts,
574
- rollbackTransaction: async ()=>{},
575
- updateGlobal: updateGlobal,
576
- updateGlobalVersion: updateGlobalVersion,
577
- updateMany: updateMany,
578
- updateOne: updateOne,
579
- updateVersion: updateVersion,
580
- upsert: upsert,
581
- url: opts.url
582
- });
583
- }
584
- });
585
-
586
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/db-content-api/index.ts"],"sourcesContent":["import type {\n BaseDatabaseAdapter,\n Count,\n CountArgs,\n CountGlobalVersionArgs,\n CountGlobalVersions,\n CountVersions,\n Create,\n CreateArgs,\n CreateGlobal,\n CreateGlobalArgs,\n CreateGlobalVersion,\n CreateGlobalVersionArgs,\n CreateVersion,\n CreateVersionArgs,\n DatabaseAdapterObj,\n DeleteMany,\n DeleteManyArgs,\n DeleteOne,\n DeleteOneArgs,\n DeleteVersions,\n DeleteVersionsArgs,\n Find,\n FindArgs,\n FindGlobal,\n FindGlobalArgs,\n FindGlobalVersions,\n FindGlobalVersionsArgs,\n FindOne,\n FindOneArgs,\n FindVersions,\n FindVersionsArgs,\n QueryDrafts,\n QueryDraftsArgs,\n UpdateGlobal,\n UpdateGlobalArgs,\n UpdateGlobalVersion,\n UpdateGlobalVersionArgs,\n UpdateMany,\n UpdateManyArgs,\n UpdateOne,\n UpdateOneArgs,\n UpdateVersion,\n UpdateVersionArgs,\n Upsert,\n UpsertArgs,\n} from 'payload'\n\nimport createClient from 'openapi-fetch'\nimport { createDatabaseAdapter } from 'payload'\nimport { v4 as uuid } from 'uuid'\n\nimport type { paths } from './generated/content-api-types.js'\n\nimport { getGlobalSlug } from './temp-utilities/slug.js'\nimport { addFallbackSort } from './temp-utilities/sorting.js'\nimport { unwrapDocument, unwrapFindResponse } from './temp-utilities/unwrapDocument.js'\nimport { type AuthMode, createAuthMiddleware, createErrorMiddleware } from './utilities/auth.js'\nimport { buildPathTypes } from './utilities/buildPathTypes.js'\nimport { dataToContentAPI } from './utilities/data/index.js'\nimport { convertPayloadJoinsToContentAPI } from './utilities/joins.js'\nimport { convertPayloadWhereToContentAPI } from './utilities/where.js'\n\ntype ContentAPIOptions = {\n auth: AuthMode\n contentSystemId: string\n url: string\n}\n\nexport type ContentAPIAdapter = {\n auth: AuthMode\n client: ReturnType<typeof createClient<paths>>\n contentSystemId: string\n url: string\n} & BaseDatabaseAdapter\n\nasync function init(this: ContentAPIAdapter) {\n if (this.auth.mode === 'apiKey') {\n this.payload.logger.info('Using API Key authentication')\n } else if (this.auth.mode === 'tokenStore') {\n this.payload.logger.info('Using TokenStore authentication (local dev)')\n } else {\n this.payload.logger.info('Using Dev JWT authentication (testing)')\n }\n\n if (process.env.PAYLOAD_DROP_DATABASE === 'true') {\n this.payload.logger.info(`---- DROPPING CONTENT API SYSTEM (${this.contentSystemId}) ----`)\n try {\n await fetch(`${this.url}/dev/clear-db`, {\n body: JSON.stringify({ contentSystemId: this.contentSystemId }),\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\n })\n this.payload.logger.info('---- DROPPED CONTENT API SYSTEM ----')\n } catch (error) {\n this.payload.logger.warn(`Failed to drop content system: ${(error as Error).message}`)\n }\n }\n\n let existingIds: Set<string>\n try {\n const { data: response, error } = await this.client.GET(\n '/api/v0/content_systems/{contentSystemId}/collections',\n {\n params: { path: { contentSystemId: this.contentSystemId } },\n },\n )\n\n if (error) {\n throw new Error(JSON.stringify(error))\n }\n if (!response) {\n throw new Error('No response from collections endpoint')\n }\n\n existingIds = new Set(response.data.map((c) => c.id))\n this.payload.logger.info(`Found ${existingIds.size} existing collections`)\n } catch (error) {\n this.payload.logger.warn(\n `Failed to fetch collections, will attempt to create all: ${(error as Error).message}`,\n )\n existingIds = new Set()\n }\n\n for (const collection of this.payload.config.collections) {\n if (!existingIds.has(collection.slug)) {\n await createCollection.call(this, collection.slug)\n }\n }\n\n for (const global of this.payload.config.globals || []) {\n const globalId = `_global-${global.slug}`\n if (!existingIds.has(globalId)) {\n await createCollection.call(this, globalId)\n }\n }\n}\n\nasync function createCollection(this: ContentAPIAdapter, collectionId: string) {\n try {\n const { error } = await this.client.POST(\n '/api/v0/content_systems/{contentSystemId}/collections',\n {\n body: { id: collectionId },\n params: { path: { contentSystemId: this.contentSystemId } },\n },\n )\n\n if (error) {\n throw new Error(JSON.stringify(error))\n }\n this.payload.logger.info(`Created collection: ${collectionId}`)\n } catch (error) {\n const errorMessage = (error as Error).message\n if (!errorMessage.includes('already exists') && !errorMessage.includes('409')) {\n this.payload.logger.warn(`Failed to create collection ${collectionId}: ${errorMessage}`)\n }\n }\n}\n\nasync function findMany(\n this: ContentAPIAdapter,\n {\n collection,\n joins,\n limit,\n page,\n pagination,\n sort,\n where,\n // Not yet passed to Content API:\n // - select: supported by Content API, pass-through possible\n // Not supported by Content API:\n // - draftsEnabled, locale, versions, projection\n }: Pick<FindArgs, 'joins' | 'pagination' | 'sort' | 'where'> &\n Required<Pick<FindArgs, 'collection' | 'limit' | 'page'>>,\n) {\n const { data: response, error } = await this.client.POST('/api/v0/documents:find', {\n body: {\n collection,\n contentSystemId: this.contentSystemId,\n join: convertPayloadJoinsToContentAPI(this.payload, collection, joins),\n limit,\n page: page ?? 1,\n sort: addFallbackSort(sort, this.payload, collection),\n where: convertPayloadWhereToContentAPI(where ?? {}),\n ...buildPathTypes(this.payload, collection, where),\n },\n })\n\n if (error) {\n throw new Error(`Content API findMany error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from findMany')\n }\n\n return unwrapFindResponse(this.payload, response.result, collection)\n}\n\nasync function find(this: ContentAPIAdapter, args: FindArgs) {\n const collectionConfig = this.payload.config.collections.find((c) => c.slug === args.collection)\n return findMany.call(this, {\n collection: args.collection,\n joins: args.joins,\n // TODO: FindArgs.limit should be 'number' not 'number | undefined'\n // is sanitized by Payload Core before calling the adapter (defaults to 10 or 0 based on pagination)\n limit: args.limit!,\n page: args.page ?? 1,\n pagination: args.pagination,\n sort: args.sort || collectionConfig?.defaultSort,\n where: args.where,\n })\n}\n\n// TODO: remove Omit when this PR is released: https://github.com/payloadcms/payload/pull/15183\nasync function findVersions(this: ContentAPIAdapter, args: Omit<FindVersionsArgs, 'skip'>) {\n const sortWithFallback = addFallbackSort(args.sort || '-updatedAt', this.payload, args.collection)\n\n const whereClause = convertPayloadWhereToContentAPI(args.where ?? {}, {\n parentToDocumentId: true,\n })\n\n const { data: response, error } = await this.client.POST('/api/v0/document_versions:find', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n // TODO: FindVersionsArgs.limit should be 'number' not 'number | undefined'\n // is sanitized by Payload Core before calling the adapter (defaults to 10 or 0 based on pagination)\n limit: args.limit!,\n page: args.page ?? 1,\n sort: sortWithFallback,\n where: whereClause,\n ...buildPathTypes(this.payload, args.collection, args.where),\n },\n })\n\n if (error) {\n throw new Error(`Content API findVersions error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from findVersions')\n }\n\n return unwrapFindResponse(this.payload, response.result, args.collection)\n}\n\nasync function queryDrafts(this: ContentAPIAdapter, args: QueryDraftsArgs) {\n const versionsResult = await this.findVersions({\n collection: args.collection,\n limit: args.limit,\n page: args.page,\n pagination: args.pagination,\n sort: args.sort,\n where: { ...args.where, latest: { equals: true } },\n })\n\n // queryDrafts should return documents with fields at root level, not nested in 'version'\n // So we need to unwrap the version structure and merge version fields to root\n const docs = versionsResult.docs.map((versionDoc) => {\n const { version, ...versionMeta } = versionDoc\n return {\n ...versionMeta,\n ...version,\n // Keep version metadata like parent, but document fields take precedence\n id: version.id, // Document ID, not version ID\n }\n })\n\n return {\n ...versionsResult,\n docs,\n }\n}\n\nasync function createVersion(this: ContentAPIAdapter, args: CreateVersionArgs) {\n const { data: response, error } = await this.client.POST('/api/v0/document_versions:create', {\n body: {\n collection: args.collectionSlug,\n contentSystemId: this.contentSystemId,\n versionDoc: {\n latest: !args.autosave,\n parent: String(args.parent),\n version: dataToContentAPI(this.payload, args.collectionSlug, args.versionData, {\n applyDefaults: true,\n }),\n },\n },\n })\n\n if (error) {\n throw new Error(`Content API createVersion error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from createVersion')\n }\n return unwrapDocument(this.payload, response.result, args.collectionSlug)\n}\n\nasync function updateVersion(this: ContentAPIAdapter, args: UpdateVersionArgs) {\n const where = args.where ?? { id: { equals: args.id } }\n\n const { data: response, error } = await this.client.POST('/api/v0/document_versions:update', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n createOnMissing: false,\n versionDoc: {\n version: dataToContentAPI(this.payload, args.collection, args.versionData),\n },\n where: convertPayloadWhereToContentAPI(where),\n ...buildPathTypes(this.payload, args.collection, where),\n },\n })\n\n if (error) {\n throw new Error(`Content API updateVersion error: ${JSON.stringify(error)}`)\n }\n if (!response?.result || !('data' in response.result)) {\n throw new Error('No document data in updateVersion response')\n }\n\n const doc = response.result.data[0]\n if (!doc) {\n return null\n }\n\n return unwrapDocument(this.payload, doc, args.collection)\n}\n\nasync function deleteVersions(this: ContentAPIAdapter, args: DeleteVersionsArgs) {\n if (!args.collection) {\n throw new Error('deleteVersions requires a collection')\n }\n\n const { error } = await this.client.POST('/api/v0/document_versions:delete', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n where: convertPayloadWhereToContentAPI(args.where),\n ...buildPathTypes(this.payload, args.collection, args.where),\n },\n })\n\n if (error) {\n throw new Error(`Content API deleteVersions error: ${JSON.stringify(error)}`)\n }\n}\n\nasync function findOne(this: ContentAPIAdapter, args: FindOneArgs) {\n const { docs } = await this.find({\n collection: args.collection,\n joins: args.joins,\n limit: 1,\n pagination: false,\n where: args.where,\n })\n return docs[0] ?? null\n}\n\nasync function updateMany(this: ContentAPIAdapter, args: UpdateManyArgs) {\n const sortWithFallback = addFallbackSort(args.sort || '-updatedAt', this.payload, args.collection)\n\n const { data: response, error } = await this.client.POST('/api/v0/documents:update', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n createOnMissing: false,\n doc: dataToContentAPI(this.payload, args.collection, args.data),\n limit: args.limit,\n returning: {},\n sort: sortWithFallback,\n where: convertPayloadWhereToContentAPI(args.where),\n ...buildPathTypes(this.payload, args.collection, args.where),\n },\n })\n\n if (error) {\n throw new Error(`Content API updateMany error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from updateMany')\n }\n\n if (response.result && 'data' in response.result) {\n return response.result.data.map((doc) => unwrapDocument(this.payload, doc, args.collection))\n }\n return null\n}\n\nasync function updateOne(this: ContentAPIAdapter, args: UpdateOneArgs) {\n const where = args.where ?? { id: { equals: args.id } }\n\n const { data: response, error } = await this.client.POST('/api/v0/documents:update', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n createOnMissing: false,\n doc: dataToContentAPI(this.payload, args.collection, args.data),\n returning: {},\n where: convertPayloadWhereToContentAPI(where),\n ...buildPathTypes(this.payload, args.collection, where),\n },\n })\n\n if (error) {\n throw new Error(`Content API updateOne error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from updateOne')\n }\n if (!response.result || !('data' in response.result)) {\n throw new Error('Unexpected response format from updateOne')\n }\n\n const doc = response.result.data[0]\n if (!doc) {\n return null\n }\n\n return unwrapDocument(this.payload, doc, args.collection)\n}\n\nasync function deleteMany(this: ContentAPIAdapter, args: DeleteManyArgs) {\n const { error } = await this.client.POST('/api/v0/documents:delete', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n where: convertPayloadWhereToContentAPI(args.where),\n ...buildPathTypes(this.payload, args.collection, args.where),\n },\n })\n\n if (error) {\n throw new Error(`Content API deleteMany error: ${JSON.stringify(error)}`)\n }\n}\n\nasync function deleteOne(this: ContentAPIAdapter, args: DeleteOneArgs) {\n const { data: response, error } = await this.client.POST('/api/v0/documents:delete', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n returning: {}, // Request deleted document back\n where: convertPayloadWhereToContentAPI(args.where),\n ...buildPathTypes(this.payload, args.collection, args.where),\n },\n })\n\n if (error) {\n throw new Error(`Content API deleteOne error: ${JSON.stringify(error)}`)\n }\n if (!response?.result || !('data' in response.result)) {\n throw new Error('No document data in deleteOne response')\n }\n\n const doc = response.result.data[0]\n if (!doc) {\n return null\n }\n\n return unwrapDocument(this.payload, doc, args.collection)\n}\n\nasync function create(this: ContentAPIAdapter, args: CreateArgs) {\n const id = (args.data.id as string | undefined) || uuid()\n\n const { data: response, error } = await this.client.POST('/api/v0/documents:create', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n doc: {\n id: String(id),\n ...dataToContentAPI(this.payload, args.collection, args.data, {\n applyDefaults: true,\n createdAt: true,\n }),\n },\n },\n })\n\n if (error) {\n throw new Error(`Content API create error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from create')\n }\n return unwrapDocument(this.payload, response.result, args.collection)\n}\n\nasync function count(this: ContentAPIAdapter, args: CountArgs) {\n const { data: response, error } = await this.client.POST('/api/v0/documents:count', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n where: convertPayloadWhereToContentAPI(args.where),\n ...buildPathTypes(this.payload, args.collection, args.where),\n },\n })\n\n if (error) {\n throw new Error(`Content API count error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from count')\n }\n\n return { totalDocs: response.result.count }\n}\n\nasync function countVersions(this: ContentAPIAdapter, args: CountArgs) {\n const { data: response, error } = await this.client.POST('/api/v0/document_versions:count', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n where: convertPayloadWhereToContentAPI(args.where),\n ...buildPathTypes(this.payload, args.collection, args.where),\n },\n })\n\n if (error) {\n throw new Error(`Content API countVersions error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from countVersions')\n }\n\n return { totalDocs: response.result.count }\n}\n\nasync function upsert(this: ContentAPIAdapter, args: UpsertArgs) {\n let documentId = args.data.id as string | undefined\n if (!documentId && args.where && 'id' in args.where) {\n const idClause = (args.where as Record<string, unknown>).id as Record<string, unknown>\n if (idClause && 'equals' in idClause) {\n documentId = idClause.equals as string\n }\n }\n if (!documentId) {\n documentId = uuid()\n }\n\n const { data: response, error } = await this.client.POST('/api/v0/documents:update', {\n body: {\n collection: args.collection,\n contentSystemId: this.contentSystemId,\n createOnMissing: { id: documentId },\n doc: dataToContentAPI(this.payload, args.collection, args.data, {\n applyDefaults: true,\n createdAt: true,\n }),\n where: convertPayloadWhereToContentAPI(args.where),\n },\n })\n\n if (error) {\n throw new Error(`Content API upsert error: ${JSON.stringify(error)}`)\n }\n if (!response) {\n throw new Error('No response from upsert')\n }\n if (!response.result || !('data' in response.result)) {\n throw new Error('Unexpected response format from upsert')\n }\n\n const doc = response.result.data[0]\n if (!doc) {\n throw new Error('No document data in upsert response')\n }\n\n return unwrapDocument(this.payload, doc, args.collection)\n}\n\nfunction createGlobal(this: ContentAPIAdapter, args: CreateGlobalArgs) {\n return this.create({\n collection: getGlobalSlug(args.slug),\n data: { ...args.data, id: args.slug, globalType: args.slug },\n })\n}\n\nfunction findGlobal(this: ContentAPIAdapter, args: FindGlobalArgs) {\n return this.findOne({ collection: getGlobalSlug(args.slug), where: args.where ?? {} })\n}\n\nasync function updateGlobal(this: ContentAPIAdapter, args: UpdateGlobalArgs) {\n // Use upsert to ensure the global exists\n // Use slug as the consistent document ID for globals\n return this.upsert({\n collection: getGlobalSlug(args.slug),\n data: args.data,\n where: { id: { equals: args.slug } },\n })\n}\n\n// TODO: remove Omit when this PR is released: https://github.com/payloadcms/payload/pull/15183\nfunction findGlobalVersions(this: ContentAPIAdapter, args: Omit<FindGlobalVersionsArgs, 'skip'>) {\n return this.findVersions({\n collection: getGlobalSlug(args.global),\n limit: args.limit,\n page: args.page,\n pagination: args.pagination,\n sort: args.sort,\n where: args.where,\n })\n}\n\nfunction createGlobalVersion(this: ContentAPIAdapter, args: CreateGlobalVersionArgs) {\n // For globals, use the globalSlug as the consistent document ID\n // This matches what we do in updateGlobal\n return this.createVersion({\n autosave: args.autosave,\n collectionSlug: getGlobalSlug(args.globalSlug),\n createdAt: args.createdAt,\n parent: args.globalSlug,\n updatedAt: args.updatedAt,\n versionData: args.versionData,\n })\n}\n\nfunction updateGlobalVersion(this: ContentAPIAdapter, args: UpdateGlobalVersionArgs) {\n // UpdateVersion requires either id OR where, not both\n if (args.id !== undefined) {\n return this.updateVersion({\n id: args.id,\n collection: getGlobalSlug(args.global),\n versionData: args.versionData,\n })\n }\n // args.where is guaranteed by Payload when args.id is undefined\n return this.updateVersion({\n collection: getGlobalSlug(args.global),\n versionData: args.versionData,\n where: args.where,\n })\n}\n\nfunction countGlobalVersions(this: ContentAPIAdapter, args: CountGlobalVersionArgs) {\n return this.countVersions({ collection: getGlobalSlug(args.global), where: args.where })\n}\n\nexport const contentAPIAdapter = (opts: ContentAPIOptions): DatabaseAdapterObj => ({\n name: 'content-api',\n defaultIDType: 'text',\n init: ({ payload }) => {\n const client = createClient<paths>({ baseUrl: opts.url })\n\n const middlewareOpts = {\n auth: opts.auth,\n contentSystemId: opts.contentSystemId,\n logger: payload.logger,\n url: opts.url,\n }\n\n client.use(createAuthMiddleware(middlewareOpts))\n client.use(createErrorMiddleware(middlewareOpts))\n\n return createDatabaseAdapter<ContentAPIAdapter>({\n name: 'content-api',\n auth: opts.auth,\n beginTransaction: () => Promise.resolve(null),\n client,\n commitTransaction: async () => {},\n contentSystemId: opts.contentSystemId,\n count: count as Count,\n countGlobalVersions: countGlobalVersions as CountGlobalVersions,\n countVersions: countVersions as CountVersions,\n create: create as Create,\n createGlobal: createGlobal as CreateGlobal,\n createGlobalVersion: createGlobalVersion as CreateGlobalVersion,\n createVersion: createVersion as CreateVersion,\n defaultIDType: 'text',\n deleteMany: deleteMany as DeleteMany,\n deleteOne: deleteOne as DeleteOne,\n deleteVersions: deleteVersions as DeleteVersions,\n find: find as Find,\n findDistinct: () =>\n Promise.reject(new Error('findDistinct is not yet implemented for Content API adapter')),\n findGlobal: findGlobal as FindGlobal,\n findGlobalVersions: findGlobalVersions as FindGlobalVersions,\n findOne: findOne as FindOne,\n findVersions: findVersions as FindVersions,\n init,\n packageName: '@payloadcms/db-content-api',\n payload,\n queryDrafts: queryDrafts as QueryDrafts,\n rollbackTransaction: async () => {},\n updateGlobal: updateGlobal as UpdateGlobal,\n updateGlobalVersion: updateGlobalVersion as UpdateGlobalVersion,\n updateMany: updateMany as UpdateMany,\n updateOne: updateOne as UpdateOne,\n updateVersion: updateVersion as UpdateVersion,\n upsert: upsert as Upsert,\n url: opts.url,\n })\n },\n})\n"],"names":["createClient","createDatabaseAdapter","v4","uuid","getGlobalSlug","addFallbackSort","unwrapDocument","unwrapFindResponse","createAuthMiddleware","createErrorMiddleware","buildPathTypes","dataToContentAPI","convertPayloadJoinsToContentAPI","convertPayloadWhereToContentAPI","init","auth","mode","payload","logger","info","process","env","PAYLOAD_DROP_DATABASE","contentSystemId","fetch","url","body","JSON","stringify","headers","method","error","warn","message","existingIds","data","response","client","GET","params","path","Error","Set","map","c","id","size","collection","config","collections","has","slug","createCollection","call","global","globals","globalId","collectionId","POST","errorMessage","includes","findMany","joins","limit","page","pagination","sort","where","join","result","find","args","collectionConfig","defaultSort","findVersions","sortWithFallback","whereClause","parentToDocumentId","queryDrafts","versionsResult","latest","equals","docs","versionDoc","version","versionMeta","createVersion","collectionSlug","autosave","parent","String","versionData","applyDefaults","updateVersion","createOnMissing","doc","deleteVersions","findOne","updateMany","returning","updateOne","deleteMany","deleteOne","create","createdAt","count","totalDocs","countVersions","upsert","documentId","idClause","createGlobal","globalType","findGlobal","updateGlobal","findGlobalVersions","createGlobalVersion","globalSlug","updatedAt","updateGlobalVersion","undefined","countGlobalVersions","contentAPIAdapter","opts","name","defaultIDType","baseUrl","middlewareOpts","use","beginTransaction","Promise","resolve","commitTransaction","findDistinct","reject","packageName","rollbackTransaction"],"mappings":"AAgDA,OAAOA,kBAAkB,gBAAe;AACxC,SAASC,qBAAqB,QAAQ,UAAS;AAC/C,SAASC,MAAMC,IAAI,QAAQ,OAAM;AAIjC,SAASC,aAAa,QAAQ,2BAA0B;AACxD,SAASC,eAAe,QAAQ,8BAA6B;AAC7D,SAASC,cAAc,EAAEC,kBAAkB,QAAQ,qCAAoC;AACvF,SAAwBC,oBAAoB,EAAEC,qBAAqB,QAAQ,sBAAqB;AAChG,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,SAASC,+BAA+B,QAAQ,uBAAsB;AACtE,SAASC,+BAA+B,QAAQ,uBAAsB;AAetE,eAAeC;IACb,IAAI,IAAI,CAACC,IAAI,CAACC,IAAI,KAAK,UAAU;QAC/B,IAAI,CAACC,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC;IAC3B,OAAO,IAAI,IAAI,CAACJ,IAAI,CAACC,IAAI,KAAK,cAAc;QAC1C,IAAI,CAACC,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC;IAC3B,OAAO;QACL,IAAI,CAACF,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC;IAC3B;IAEA,IAAIC,QAAQC,GAAG,CAACC,qBAAqB,KAAK,QAAQ;QAChD,IAAI,CAACL,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC,CAAC,kCAAkC,EAAE,IAAI,CAACI,eAAe,CAAC,MAAM,CAAC;QAC1F,IAAI;YACF,MAAMC,MAAM,GAAG,IAAI,CAACC,GAAG,CAAC,aAAa,CAAC,EAAE;gBACtCC,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KAAKpG,eAAe;gBACrCkF,OAAOA;gBACPgB,qBAAqBA;gBACrBd,eAAeA;gBACfJ,QAAQA;gBACRQ,cAAcA;gBACdK,qBAAqBA;gBACrB9B,eAAeA;gBACfuC,eAAe;gBACfxB,YAAYA;gBACZC,WAAWA;gBACXN,gBAAgBA;gBAChB1B,MAAMA;gBACN+D,cAAc,IACZH,QAAQI,MAAM,CAAC,IAAI7F,MAAM;gBAC3BwE,YAAYA;gBACZE,oBAAoBA;gBACpBlB,SAASA;gBACTvB,cAAcA;gBACd5D;gBACAyH,aAAa;gBACbtH;gBACA6D,aAAaA;gBACb0D,qBAAqB,WAAa;gBAClCtB,cAAcA;gBACdK,qBAAqBA;gBACrBrB,YAAYA;gBACZE,WAAWA;gBACXP,eAAeA;gBACfe,QAAQA;gBACRnF,KAAKkG,KAAKlG,GAAG;YACf;QACF;IACF,CAAA,EAAE"}
@@ -1,2 +0,0 @@
1
- export declare const getGlobalSlug: (slug: string) => string;
2
- //# sourceMappingURL=slug.d.ts.map