@powerhousedao/network-admin 0.0.51 → 0.0.52
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/style.css +1222 -0
- package/dist/subgraphs/networks/resolvers.js +1 -1
- package/dist/subgraphs/networks/schema.js +1 -1
- package/dist/subgraphs/workstreams/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/workstreams/resolvers.js +191 -55
- package/dist/subgraphs/workstreams/schema.js +3 -3
- package/package.json +2 -1
|
@@ -103,7 +103,7 @@ export const getResolvers = (subgraph) => {
|
|
|
103
103
|
type: state?.type || "INDIVIDUAL",
|
|
104
104
|
_contributorPhids: contributorPhids, // Internal field for resolver
|
|
105
105
|
status: state?.status || null,
|
|
106
|
-
|
|
106
|
+
skils: state?.skils || [],
|
|
107
107
|
scopes: state?.scopes || [],
|
|
108
108
|
links: state?.links || [],
|
|
109
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/workstreams/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAuC5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/workstreams/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAuC5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CA+5BxE,CAAC"}
|
|
@@ -9,6 +9,17 @@ export const getResolvers = (subgraph) => {
|
|
|
9
9
|
// Shared state for builder profile resolution (used by field resolvers)
|
|
10
10
|
let getBuilderProfileByPhid = null;
|
|
11
11
|
const deriveSlug = (name) => name.toLowerCase().trim().split(/\s+/).join("-");
|
|
12
|
+
const extractPhid = (value) => {
|
|
13
|
+
if (typeof value === "string")
|
|
14
|
+
return value;
|
|
15
|
+
if (value &&
|
|
16
|
+
typeof value === "object" &&
|
|
17
|
+
"id" in value &&
|
|
18
|
+
typeof value.id === "string") {
|
|
19
|
+
return value.id;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
};
|
|
12
23
|
const getCandidateDrives = async () => {
|
|
13
24
|
try {
|
|
14
25
|
const drives = await reactor.getDrives?.();
|
|
@@ -359,15 +370,33 @@ export const getResolvers = (subgraph) => {
|
|
|
359
370
|
// Collect SOWs and their contributors
|
|
360
371
|
const sowDocs = collectSowsFromWorkstreams(resolved);
|
|
361
372
|
for (const sow of sowDocs) {
|
|
362
|
-
if (sow
|
|
373
|
+
if (!sow || typeof sow !== "object")
|
|
374
|
+
continue;
|
|
375
|
+
if (Array.isArray(sow.contributors)) {
|
|
363
376
|
sow.contributors.forEach((contributor) => {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
377
|
+
const phid = extractPhid(contributor);
|
|
378
|
+
if (phid)
|
|
379
|
+
contributorPhids.add(phid);
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
// Collect deliverable owners too so `SOW_Deliverable.owner` can resolve
|
|
383
|
+
if (Array.isArray(sow.deliverables)) {
|
|
384
|
+
sow.deliverables.forEach((deliverable) => {
|
|
385
|
+
if (!deliverable || typeof deliverable !== "object")
|
|
386
|
+
return;
|
|
387
|
+
const phid = extractPhid(deliverable.owner);
|
|
388
|
+
if (phid)
|
|
389
|
+
contributorPhids.add(phid);
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
// Collect project owners too so `SOW_Project.projectOwner` can resolve
|
|
393
|
+
if (Array.isArray(sow.projects)) {
|
|
394
|
+
sow.projects.forEach((project) => {
|
|
395
|
+
if (!project || typeof project !== "object")
|
|
396
|
+
return;
|
|
397
|
+
const phid = extractPhid(project.projectOwner);
|
|
398
|
+
if (phid)
|
|
369
399
|
contributorPhids.add(phid);
|
|
370
|
-
}
|
|
371
400
|
});
|
|
372
401
|
}
|
|
373
402
|
}
|
|
@@ -380,21 +409,36 @@ export const getResolvers = (subgraph) => {
|
|
|
380
409
|
return null;
|
|
381
410
|
const state = doc.state.global;
|
|
382
411
|
// Store contributor PHIDs separately - they'll be resolved by the field resolver
|
|
383
|
-
const contributorPhids = state?.contributors
|
|
412
|
+
const contributorPhids = state?.contributors ?? [];
|
|
413
|
+
// Ensure all non-nullable Builder fields are properly handled
|
|
414
|
+
// name: String! - non-nullable
|
|
415
|
+
const name = String(state?.name ?? doc.header?.name ?? "");
|
|
416
|
+
// icon: String! - non-nullable
|
|
417
|
+
const icon = String(state?.icon ?? "");
|
|
418
|
+
// description: String! - non-nullable
|
|
419
|
+
const description = String(state?.description ?? state?.slug ?? "");
|
|
420
|
+
// type: teamType! - non-nullable, default to "INDIVIDUAL"
|
|
421
|
+
const type = state?.type ?? "INDIVIDUAL";
|
|
422
|
+
// skils: [BuilderSkill!]! - non-nullable array
|
|
423
|
+
const skils = Array.isArray(state?.skils) ? state.skils : [];
|
|
424
|
+
// scopes: [BuilderScope!]! - non-nullable array
|
|
425
|
+
const scopes = Array.isArray(state?.scopes) ? state.scopes : [];
|
|
426
|
+
// links: [BuilderLink!]! - non-nullable array
|
|
427
|
+
const links = Array.isArray(state?.links) ? state.links : [];
|
|
384
428
|
return {
|
|
385
429
|
id: doc.header.id,
|
|
386
|
-
code: state?.code
|
|
387
|
-
slug: state?.slug
|
|
388
|
-
name
|
|
389
|
-
icon
|
|
390
|
-
description
|
|
391
|
-
lastModified: state?.lastModified
|
|
392
|
-
type
|
|
430
|
+
code: state?.code ?? null,
|
|
431
|
+
slug: state?.slug ?? null,
|
|
432
|
+
name,
|
|
433
|
+
icon,
|
|
434
|
+
description,
|
|
435
|
+
lastModified: state?.lastModified ?? null,
|
|
436
|
+
type,
|
|
393
437
|
_contributorPhids: contributorPhids, // Internal field for resolver
|
|
394
|
-
status: state?.status
|
|
395
|
-
|
|
396
|
-
scopes
|
|
397
|
-
links
|
|
438
|
+
status: state?.status ?? null,
|
|
439
|
+
skils,
|
|
440
|
+
scopes,
|
|
441
|
+
links,
|
|
398
442
|
};
|
|
399
443
|
};
|
|
400
444
|
return resolved;
|
|
@@ -434,15 +478,33 @@ export const getResolvers = (subgraph) => {
|
|
|
434
478
|
// Collect SOWs and their contributors
|
|
435
479
|
const sowDocs = collectSowsFromWorkstreams(results);
|
|
436
480
|
for (const sow of sowDocs) {
|
|
437
|
-
if (sow
|
|
481
|
+
if (!sow || typeof sow !== "object")
|
|
482
|
+
continue;
|
|
483
|
+
if (Array.isArray(sow.contributors)) {
|
|
438
484
|
sow.contributors.forEach((contributor) => {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
485
|
+
const phid = extractPhid(contributor);
|
|
486
|
+
if (phid)
|
|
487
|
+
contributorPhids.add(phid);
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
// Collect deliverable owners too so `SOW_Deliverable.owner` can resolve
|
|
491
|
+
if (Array.isArray(sow.deliverables)) {
|
|
492
|
+
sow.deliverables.forEach((deliverable) => {
|
|
493
|
+
if (!deliverable || typeof deliverable !== "object")
|
|
494
|
+
return;
|
|
495
|
+
const phid = extractPhid(deliverable.owner);
|
|
496
|
+
if (phid)
|
|
497
|
+
contributorPhids.add(phid);
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
// Collect project owners too so `SOW_Project.projectOwner` can resolve
|
|
501
|
+
if (Array.isArray(sow.projects)) {
|
|
502
|
+
sow.projects.forEach((project) => {
|
|
503
|
+
if (!project || typeof project !== "object")
|
|
504
|
+
return;
|
|
505
|
+
const phid = extractPhid(project.projectOwner);
|
|
506
|
+
if (phid)
|
|
444
507
|
contributorPhids.add(phid);
|
|
445
|
-
}
|
|
446
508
|
});
|
|
447
509
|
}
|
|
448
510
|
}
|
|
@@ -455,21 +517,36 @@ export const getResolvers = (subgraph) => {
|
|
|
455
517
|
return null;
|
|
456
518
|
const state = doc.state.global;
|
|
457
519
|
// Store contributor PHIDs separately - they'll be resolved by the field resolver
|
|
458
|
-
const contributorPhids = state?.contributors
|
|
520
|
+
const contributorPhids = state?.contributors ?? [];
|
|
521
|
+
// Ensure all non-nullable Builder fields are properly handled
|
|
522
|
+
// name: String! - non-nullable
|
|
523
|
+
const name = String(state?.name ?? doc.header?.name ?? "");
|
|
524
|
+
// icon: String! - non-nullable
|
|
525
|
+
const icon = String(state?.icon ?? "");
|
|
526
|
+
// description: String! - non-nullable
|
|
527
|
+
const description = String(state?.description ?? state?.slug ?? "");
|
|
528
|
+
// type: teamType! - non-nullable, default to "INDIVIDUAL"
|
|
529
|
+
const type = state?.type ?? "INDIVIDUAL";
|
|
530
|
+
// skils: [BuilderSkill!]! - non-nullable array
|
|
531
|
+
const skils = Array.isArray(state?.skils) ? state.skils : [];
|
|
532
|
+
// scopes: [BuilderScope!]! - non-nullable array
|
|
533
|
+
const scopes = Array.isArray(state?.scopes) ? state.scopes : [];
|
|
534
|
+
// links: [BuilderLink!]! - non-nullable array
|
|
535
|
+
const links = Array.isArray(state?.links) ? state.links : [];
|
|
459
536
|
return {
|
|
460
537
|
id: doc.header.id,
|
|
461
|
-
code: state?.code
|
|
462
|
-
slug: state?.slug
|
|
463
|
-
name
|
|
464
|
-
icon
|
|
465
|
-
description
|
|
466
|
-
lastModified: state?.lastModified
|
|
467
|
-
type
|
|
538
|
+
code: state?.code ?? null,
|
|
539
|
+
slug: state?.slug ?? null,
|
|
540
|
+
name,
|
|
541
|
+
icon,
|
|
542
|
+
description,
|
|
543
|
+
lastModified: state?.lastModified ?? null,
|
|
544
|
+
type,
|
|
468
545
|
_contributorPhids: contributorPhids, // Internal field for resolver
|
|
469
|
-
status: state?.status
|
|
470
|
-
|
|
471
|
-
scopes
|
|
472
|
-
links
|
|
546
|
+
status: state?.status ?? null,
|
|
547
|
+
skils,
|
|
548
|
+
scopes,
|
|
549
|
+
links,
|
|
473
550
|
};
|
|
474
551
|
};
|
|
475
552
|
return results;
|
|
@@ -560,13 +637,33 @@ export const getResolvers = (subgraph) => {
|
|
|
560
637
|
}
|
|
561
638
|
// Collect contributor PHIDs from all SOWs
|
|
562
639
|
for (const sow of sowDocs) {
|
|
563
|
-
if (sow
|
|
640
|
+
if (!sow || typeof sow !== "object")
|
|
641
|
+
continue;
|
|
642
|
+
if (Array.isArray(sow.contributors)) {
|
|
564
643
|
sow.contributors.forEach((contributor) => {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
644
|
+
const phid = extractPhid(contributor);
|
|
645
|
+
if (phid)
|
|
646
|
+
contributorPhids.add(phid);
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
// Collect deliverable owners too so `SOW_Deliverable.owner` can resolve
|
|
650
|
+
if (Array.isArray(sow.deliverables)) {
|
|
651
|
+
sow.deliverables.forEach((deliverable) => {
|
|
652
|
+
if (!deliverable || typeof deliverable !== "object")
|
|
653
|
+
return;
|
|
654
|
+
const phid = extractPhid(deliverable.owner);
|
|
655
|
+
if (phid)
|
|
656
|
+
contributorPhids.add(phid);
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
// Collect project owners too so `SOW_Project.projectOwner` can resolve
|
|
660
|
+
if (Array.isArray(sow.projects)) {
|
|
661
|
+
sow.projects.forEach((project) => {
|
|
662
|
+
if (!project || typeof project !== "object")
|
|
663
|
+
return;
|
|
664
|
+
const phid = extractPhid(project.projectOwner);
|
|
665
|
+
if (phid)
|
|
568
666
|
contributorPhids.add(phid);
|
|
569
|
-
}
|
|
570
667
|
});
|
|
571
668
|
}
|
|
572
669
|
}
|
|
@@ -590,21 +687,36 @@ export const getResolvers = (subgraph) => {
|
|
|
590
687
|
return null;
|
|
591
688
|
const state = doc.state.global;
|
|
592
689
|
// Store contributor PHIDs separately - they'll be resolved by the field resolver
|
|
593
|
-
const contributorPhids = state?.contributors
|
|
690
|
+
const contributorPhids = state?.contributors ?? [];
|
|
691
|
+
// Ensure all non-nullable Builder fields are properly handled
|
|
692
|
+
// name: String! - non-nullable
|
|
693
|
+
const name = String(state?.name ?? doc.header?.name ?? "");
|
|
694
|
+
// icon: String! - non-nullable
|
|
695
|
+
const icon = String(state?.icon ?? "");
|
|
696
|
+
// description: String! - non-nullable
|
|
697
|
+
const description = String(state?.description ?? state?.slug ?? "");
|
|
698
|
+
// type: teamType! - non-nullable, default to "INDIVIDUAL"
|
|
699
|
+
const type = state?.type ?? "INDIVIDUAL";
|
|
700
|
+
// skils: [BuilderSkill!]! - non-nullable array
|
|
701
|
+
const skils = Array.isArray(state?.skils) ? state.skils : [];
|
|
702
|
+
// scopes: [BuilderScope!]! - non-nullable array
|
|
703
|
+
const scopes = Array.isArray(state?.scopes) ? state.scopes : [];
|
|
704
|
+
// links: [BuilderLink!]! - non-nullable array
|
|
705
|
+
const links = Array.isArray(state?.links) ? state.links : [];
|
|
594
706
|
return {
|
|
595
707
|
id: doc.header.id,
|
|
596
|
-
code: state?.code
|
|
597
|
-
slug: state?.slug
|
|
598
|
-
name
|
|
599
|
-
icon
|
|
600
|
-
description
|
|
601
|
-
lastModified: state?.lastModified
|
|
602
|
-
type
|
|
708
|
+
code: state?.code ?? null,
|
|
709
|
+
slug: state?.slug ?? null,
|
|
710
|
+
name,
|
|
711
|
+
icon,
|
|
712
|
+
description,
|
|
713
|
+
lastModified: state?.lastModified ?? null,
|
|
714
|
+
type,
|
|
603
715
|
_contributorPhids: contributorPhids, // Internal field for resolver
|
|
604
|
-
status: state?.status
|
|
605
|
-
|
|
606
|
-
scopes
|
|
607
|
-
links
|
|
716
|
+
status: state?.status ?? null,
|
|
717
|
+
skils,
|
|
718
|
+
scopes,
|
|
719
|
+
links,
|
|
608
720
|
};
|
|
609
721
|
};
|
|
610
722
|
return results;
|
|
@@ -648,6 +760,30 @@ export const getResolvers = (subgraph) => {
|
|
|
648
760
|
.filter((builder) => builder !== null);
|
|
649
761
|
},
|
|
650
762
|
},
|
|
763
|
+
SOW_Deliverable: {
|
|
764
|
+
owner: (parent) => {
|
|
765
|
+
if (!parent?.owner)
|
|
766
|
+
return null;
|
|
767
|
+
if (!getBuilderProfileByPhid)
|
|
768
|
+
return null;
|
|
769
|
+
const phid = extractPhid(parent.owner);
|
|
770
|
+
if (!phid)
|
|
771
|
+
return null;
|
|
772
|
+
return getBuilderProfileByPhid(phid);
|
|
773
|
+
},
|
|
774
|
+
},
|
|
775
|
+
SOW_Project: {
|
|
776
|
+
projectOwner: (parent) => {
|
|
777
|
+
if (!parent?.projectOwner)
|
|
778
|
+
return null;
|
|
779
|
+
if (!getBuilderProfileByPhid)
|
|
780
|
+
return null;
|
|
781
|
+
const phid = extractPhid(parent.projectOwner);
|
|
782
|
+
if (!phid)
|
|
783
|
+
return null;
|
|
784
|
+
return getBuilderProfileByPhid(phid);
|
|
785
|
+
},
|
|
786
|
+
},
|
|
651
787
|
Builder: {
|
|
652
788
|
contributors: (parent) => {
|
|
653
789
|
// Resolve contributor PHIDs to Builder objects
|
|
@@ -220,7 +220,7 @@ export const schema = gql `
|
|
|
220
220
|
|
|
221
221
|
type SOW_Deliverable {
|
|
222
222
|
id: OID!
|
|
223
|
-
owner:
|
|
223
|
+
owner: Builder
|
|
224
224
|
title: String!
|
|
225
225
|
code: String!
|
|
226
226
|
description: String!
|
|
@@ -277,7 +277,7 @@ export const schema = gql `
|
|
|
277
277
|
code: String!
|
|
278
278
|
title: String!
|
|
279
279
|
slug: String!
|
|
280
|
-
projectOwner:
|
|
280
|
+
projectOwner: Builder
|
|
281
281
|
abstract: String
|
|
282
282
|
imageUrl: URL
|
|
283
283
|
scope: SOW_DeliverablesSet
|
|
@@ -472,7 +472,7 @@ export const schema = gql `
|
|
|
472
472
|
type: teamType!
|
|
473
473
|
contributors: [Builder!]!
|
|
474
474
|
status: BuilderStatus
|
|
475
|
-
|
|
475
|
+
skils: [BuilderSkill!]!
|
|
476
476
|
scopes: [BuilderScope!]!
|
|
477
477
|
links: [BuilderLink!]!
|
|
478
478
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/network-admin",
|
|
3
3
|
"description": "Network Admin package for Powerhouse",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.52",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"service-unstartup": "bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
+
"@powerhousedao/builder-profile": "0.0.5",
|
|
65
66
|
"@powerhousedao/builder-tools": "^5.0.12",
|
|
66
67
|
"@powerhousedao/common": "^5.0.12",
|
|
67
68
|
"@powerhousedao/design-system": "^5.0.12",
|