@captiveorigins/payload-plugin-onepedigree 0.1.0-alpha.12 → 0.1.0-alpha.15

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.
package/dist/integrity.js CHANGED
@@ -46,8 +46,10 @@ export async function checkParentage(req, opts, proposal, { trusted = false } =
46
46
  for (const p of unique)
47
47
  if (!seen.has(p))
48
48
  issues.push(err('UNRESOLVED_PARENT', 'A parent does not exist or you cannot access it.', path, [p]));
49
- if (proposal.id && unique.length) {
50
- const proposed = new Set(unique);
49
+ // Loops are checked only among parents the editor can read. Others are already refused as unresolved, and saying
50
+ // one would loop would reveal that a private record exists and descends from this one.
51
+ const proposed = new Set(unique.filter((p) => seen.has(p)));
52
+ if (proposal.id && proposed.size) {
51
53
  const reached = new Set([proposal.id]);
52
54
  let frontier = [proposal.id];
53
55
  while (frontier.length && !issues.some((i) => i.code === 'PARENT_IS_DESCENDANT')) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@captiveorigins/payload-plugin-onepedigree",
3
- "version": "0.1.0-alpha.12",
3
+ "version": "0.1.0-alpha.15",
4
4
  "description": "OnePedigree for Payload: parentage fields, cycle-safe parentage writes, deletion policies, permission-aware pedigree endpoints for all 13 views, and Admin previews.",
5
- "homepage": "https://github.com/mgilardi/onepedigree#readme",
5
+ "homepage": "https://github.com/CaptiveOrigins/onepedigree#readme",
6
6
  "bugs": {
7
- "url": "https://github.com/mgilardi/onepedigree/issues"
7
+ "url": "https://github.com/CaptiveOrigins/onepedigree/issues"
8
8
  },
9
9
  "keywords": [
10
10
  "payload",
@@ -17,7 +17,7 @@
17
17
  "license": "PolyForm-Noncommercial-1.0.0",
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/mgilardi/onepedigree.git",
20
+ "url": "git+https://github.com/CaptiveOrigins/onepedigree.git",
21
21
  "directory": "packages/payload"
22
22
  },
23
23
  "type": "module",
@@ -42,8 +42,8 @@
42
42
  "node": ">=22"
43
43
  },
44
44
  "dependencies": {
45
- "@captiveorigins/onepedigree-core": "^0.1.0-alpha.12",
46
- "@captiveorigins/onepedigree-react": "^0.1.0-alpha.12"
45
+ "@captiveorigins/onepedigree-react": "^0.1.0-alpha.15",
46
+ "@captiveorigins/onepedigree-core": "^0.1.0-alpha.15"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@payloadcms/ui": "^3.80.0",