@powerhousedao/network-admin 0.0.6 → 0.0.8
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/powerhouse.manifest.json +23 -11
- package/dist/style.css +109 -8
- package/dist/subgraphs/index.d.ts +3 -3
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +3 -3
- package/dist/subgraphs/network-profile/index.d.ts +3 -2
- package/dist/subgraphs/network-profile/index.d.ts.map +1 -1
- package/dist/subgraphs/network-profile/resolvers.d.ts +1 -1
- package/dist/subgraphs/network-profile/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/network-profile/resolvers.js +144 -85
- package/dist/subgraphs/network-profile/schema.js +3 -3
- package/dist/subgraphs/payment-terms/index.d.ts +3 -2
- package/dist/subgraphs/payment-terms/index.d.ts.map +1 -1
- package/dist/subgraphs/payment-terms/resolvers.d.ts +1 -1
- package/dist/subgraphs/payment-terms/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/payment-terms/resolvers.js +18 -2
- package/dist/subgraphs/payment-terms/schema.d.ts.map +1 -1
- package/dist/subgraphs/payment-terms/schema.js +30 -8
- package/dist/subgraphs/request-for-proposals/index.d.ts +3 -2
- package/dist/subgraphs/request-for-proposals/index.d.ts.map +1 -1
- package/dist/subgraphs/request-for-proposals/resolvers.d.ts +1 -1
- package/dist/subgraphs/request-for-proposals/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/request-for-proposals/resolvers.js +95 -61
- package/dist/subgraphs/request-for-proposals/schema.js +3 -3
- package/dist/subgraphs/workstream/index.d.ts +3 -2
- package/dist/subgraphs/workstream/index.d.ts.map +1 -1
- package/dist/subgraphs/workstream/resolvers.d.ts +1 -1
- package/dist/subgraphs/workstream/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/workstream/resolvers.js +125 -76
- package/dist/subgraphs/workstream/schema.js +3 -3
- package/package.json +13 -13
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"description": "
|
|
4
|
-
"category": "
|
|
2
|
+
"name": "network-admin",
|
|
3
|
+
"description": "A place to handle all network related info",
|
|
4
|
+
"category": "Governance",
|
|
5
5
|
"publisher": {
|
|
6
|
-
"name": "
|
|
7
|
-
"url": "
|
|
6
|
+
"name": "powerhouse.io",
|
|
7
|
+
"url": ""
|
|
8
8
|
},
|
|
9
9
|
"documentModels": [
|
|
10
10
|
{
|
|
@@ -28,22 +28,30 @@
|
|
|
28
28
|
{
|
|
29
29
|
"id": "workstream-editor",
|
|
30
30
|
"name": "Workstream Editor",
|
|
31
|
-
"documentTypes": [
|
|
31
|
+
"documentTypes": [
|
|
32
|
+
"powerhouse/workstream"
|
|
33
|
+
]
|
|
32
34
|
},
|
|
33
35
|
{
|
|
34
36
|
"id": "request-for-proposals-editor",
|
|
35
37
|
"name": "Request for Proposals Editor",
|
|
36
|
-
"documentTypes": [
|
|
38
|
+
"documentTypes": [
|
|
39
|
+
"powerhouse/rfp"
|
|
40
|
+
]
|
|
37
41
|
},
|
|
38
42
|
{
|
|
39
43
|
"id": "payment-terms-editor",
|
|
40
44
|
"name": "Payment Terms Editor",
|
|
41
|
-
"documentTypes": [
|
|
45
|
+
"documentTypes": [
|
|
46
|
+
"payment-terms"
|
|
47
|
+
]
|
|
42
48
|
},
|
|
43
49
|
{
|
|
44
50
|
"id": "network-profile-editor",
|
|
45
51
|
"name": "Network Profile Editor",
|
|
46
|
-
"documentTypes": [
|
|
52
|
+
"documentTypes": [
|
|
53
|
+
"powerhouse/network-profile"
|
|
54
|
+
]
|
|
47
55
|
}
|
|
48
56
|
],
|
|
49
57
|
"apps": [
|
|
@@ -51,14 +59,18 @@
|
|
|
51
59
|
"id": "powerhouse/network-admin",
|
|
52
60
|
"name": "Network Admin Drive Explorer",
|
|
53
61
|
"description": "Custom drive explorer for managing and organizing network administration documents and workstreams",
|
|
54
|
-
"documentTypes": [
|
|
62
|
+
"documentTypes": [
|
|
63
|
+
"powerhouse/document-drive"
|
|
64
|
+
]
|
|
55
65
|
}
|
|
56
66
|
],
|
|
57
67
|
"subgraphs": [
|
|
58
68
|
{
|
|
59
69
|
"id": "powerhouse/workstream-subgraph",
|
|
60
70
|
"name": "Workstream Subgraph",
|
|
61
|
-
"documentTypes": [
|
|
71
|
+
"documentTypes": [
|
|
72
|
+
"powerhouse/workstream"
|
|
73
|
+
]
|
|
62
74
|
}
|
|
63
75
|
],
|
|
64
76
|
"importScripts": []
|
package/dist/style.css
CHANGED
|
@@ -7466,6 +7466,9 @@ input[type="number"] {
|
|
|
7466
7466
|
}
|
|
7467
7467
|
}
|
|
7468
7468
|
@layer utilities {
|
|
7469
|
+
.pointer-events-none {
|
|
7470
|
+
pointer-events: none;
|
|
7471
|
+
}
|
|
7469
7472
|
.visible {
|
|
7470
7473
|
visibility: visible;
|
|
7471
7474
|
}
|
|
@@ -7475,9 +7478,24 @@ input[type="number"] {
|
|
|
7475
7478
|
.fixed {
|
|
7476
7479
|
position: fixed;
|
|
7477
7480
|
}
|
|
7481
|
+
.relative {
|
|
7482
|
+
position: relative;
|
|
7483
|
+
}
|
|
7478
7484
|
.static {
|
|
7479
7485
|
position: static;
|
|
7480
7486
|
}
|
|
7487
|
+
.top-full {
|
|
7488
|
+
top: 100%;
|
|
7489
|
+
}
|
|
7490
|
+
.bottom-full {
|
|
7491
|
+
bottom: 100%;
|
|
7492
|
+
}
|
|
7493
|
+
.left-1\/2 {
|
|
7494
|
+
left: calc(1/2 * 100%);
|
|
7495
|
+
}
|
|
7496
|
+
.z-10 {
|
|
7497
|
+
z-index: 10;
|
|
7498
|
+
}
|
|
7481
7499
|
.col-span-1 {
|
|
7482
7500
|
grid-column: span 1 / span 1;
|
|
7483
7501
|
}
|
|
@@ -7538,6 +7556,12 @@ input[type="number"] {
|
|
|
7538
7556
|
.inline {
|
|
7539
7557
|
display: inline;
|
|
7540
7558
|
}
|
|
7559
|
+
.inline-block {
|
|
7560
|
+
display: inline-block;
|
|
7561
|
+
}
|
|
7562
|
+
.h-0 {
|
|
7563
|
+
height: calc(var(--spacing) * 0);
|
|
7564
|
+
}
|
|
7541
7565
|
.h-2 {
|
|
7542
7566
|
height: calc(var(--spacing) * 2);
|
|
7543
7567
|
}
|
|
@@ -7550,6 +7574,9 @@ input[type="number"] {
|
|
|
7550
7574
|
.h-screen {
|
|
7551
7575
|
height: 100vh;
|
|
7552
7576
|
}
|
|
7577
|
+
.w-0 {
|
|
7578
|
+
width: calc(var(--spacing) * 0);
|
|
7579
|
+
}
|
|
7553
7580
|
.w-2 {
|
|
7554
7581
|
width: calc(var(--spacing) * 2);
|
|
7555
7582
|
}
|
|
@@ -7586,9 +7613,19 @@ input[type="number"] {
|
|
|
7586
7613
|
.flex-1 {
|
|
7587
7614
|
flex: 1;
|
|
7588
7615
|
}
|
|
7616
|
+
.-translate-x-1\/2 {
|
|
7617
|
+
--tw-translate-x: calc(calc(1/2 * 100%) * -1);
|
|
7618
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
7619
|
+
}
|
|
7620
|
+
.transform {
|
|
7621
|
+
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
|
7622
|
+
}
|
|
7589
7623
|
.cursor-default {
|
|
7590
7624
|
cursor: default;
|
|
7591
7625
|
}
|
|
7626
|
+
.cursor-help {
|
|
7627
|
+
cursor: help;
|
|
7628
|
+
}
|
|
7592
7629
|
.cursor-pointer {
|
|
7593
7630
|
cursor: pointer;
|
|
7594
7631
|
}
|
|
@@ -7661,6 +7698,18 @@ input[type="number"] {
|
|
|
7661
7698
|
border-style: var(--tw-border-style);
|
|
7662
7699
|
border-width: 1px;
|
|
7663
7700
|
}
|
|
7701
|
+
.border-t-4 {
|
|
7702
|
+
border-top-style: var(--tw-border-style);
|
|
7703
|
+
border-top-width: 4px;
|
|
7704
|
+
}
|
|
7705
|
+
.border-r-4 {
|
|
7706
|
+
border-right-style: var(--tw-border-style);
|
|
7707
|
+
border-right-width: 4px;
|
|
7708
|
+
}
|
|
7709
|
+
.border-l-4 {
|
|
7710
|
+
border-left-style: var(--tw-border-style);
|
|
7711
|
+
border-left-width: 4px;
|
|
7712
|
+
}
|
|
7664
7713
|
.border-gray-200 {
|
|
7665
7714
|
border-color: var(--color-gray-200);
|
|
7666
7715
|
}
|
|
@@ -7670,6 +7719,12 @@ input[type="number"] {
|
|
|
7670
7719
|
.border-red-300 {
|
|
7671
7720
|
border-color: var(--color-red-300);
|
|
7672
7721
|
}
|
|
7722
|
+
.border-transparent {
|
|
7723
|
+
border-color: transparent;
|
|
7724
|
+
}
|
|
7725
|
+
.border-t-gray-800 {
|
|
7726
|
+
border-top-color: var(--color-gray-800);
|
|
7727
|
+
}
|
|
7673
7728
|
.bg-blue-50 {
|
|
7674
7729
|
background-color: var(--color-blue-50);
|
|
7675
7730
|
}
|
|
@@ -7688,6 +7743,9 @@ input[type="number"] {
|
|
|
7688
7743
|
.bg-gray-300 {
|
|
7689
7744
|
background-color: var(--color-gray-300);
|
|
7690
7745
|
}
|
|
7746
|
+
.bg-gray-800 {
|
|
7747
|
+
background-color: var(--color-gray-800);
|
|
7748
|
+
}
|
|
7691
7749
|
.bg-green-500 {
|
|
7692
7750
|
background-color: var(--color-green-500);
|
|
7693
7751
|
}
|
|
@@ -7718,9 +7776,15 @@ input[type="number"] {
|
|
|
7718
7776
|
.px-2 {
|
|
7719
7777
|
padding-inline: calc(var(--spacing) * 2);
|
|
7720
7778
|
}
|
|
7779
|
+
.px-3 {
|
|
7780
|
+
padding-inline: calc(var(--spacing) * 3);
|
|
7781
|
+
}
|
|
7721
7782
|
.py-1 {
|
|
7722
7783
|
padding-block: calc(var(--spacing) * 1);
|
|
7723
7784
|
}
|
|
7785
|
+
.py-2 {
|
|
7786
|
+
padding-block: calc(var(--spacing) * 2);
|
|
7787
|
+
}
|
|
7724
7788
|
.pt-4 {
|
|
7725
7789
|
padding-top: calc(var(--spacing) * 4);
|
|
7726
7790
|
}
|
|
@@ -7763,6 +7827,9 @@ input[type="number"] {
|
|
|
7763
7827
|
--tw-font-weight: var(--font-weight-medium);
|
|
7764
7828
|
font-weight: var(--font-weight-medium);
|
|
7765
7829
|
}
|
|
7830
|
+
.whitespace-nowrap {
|
|
7831
|
+
white-space: nowrap;
|
|
7832
|
+
}
|
|
7766
7833
|
.text-blue-700 {
|
|
7767
7834
|
color: var(--color-blue-700);
|
|
7768
7835
|
}
|
|
@@ -7781,9 +7848,15 @@ input[type="number"] {
|
|
|
7781
7848
|
.text-red-500 {
|
|
7782
7849
|
color: var(--color-red-500);
|
|
7783
7850
|
}
|
|
7851
|
+
.text-white {
|
|
7852
|
+
color: var(--color-white);
|
|
7853
|
+
}
|
|
7784
7854
|
.italic {
|
|
7785
7855
|
font-style: italic;
|
|
7786
7856
|
}
|
|
7857
|
+
.opacity-0 {
|
|
7858
|
+
opacity: 0%;
|
|
7859
|
+
}
|
|
7787
7860
|
.shadow-sm {
|
|
7788
7861
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
7789
7862
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -7798,10 +7871,19 @@ input[type="number"] {
|
|
|
7798
7871
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
7799
7872
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
7800
7873
|
}
|
|
7874
|
+
.transition-opacity {
|
|
7875
|
+
transition-property: opacity;
|
|
7876
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
7877
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
7878
|
+
}
|
|
7801
7879
|
.duration-75 {
|
|
7802
7880
|
--tw-duration: 75ms;
|
|
7803
7881
|
transition-duration: 75ms;
|
|
7804
7882
|
}
|
|
7883
|
+
.duration-200 {
|
|
7884
|
+
--tw-duration: 200ms;
|
|
7885
|
+
transition-duration: 200ms;
|
|
7886
|
+
}
|
|
7805
7887
|
.duration-300 {
|
|
7806
7888
|
--tw-duration: 300ms;
|
|
7807
7889
|
transition-duration: 300ms;
|
|
@@ -7810,6 +7892,13 @@ input[type="number"] {
|
|
|
7810
7892
|
--tw-ease: linear;
|
|
7811
7893
|
transition-timing-function: linear;
|
|
7812
7894
|
}
|
|
7895
|
+
.group-hover\:opacity-100 {
|
|
7896
|
+
&:is(:where(.group):hover *) {
|
|
7897
|
+
@media (hover: hover) {
|
|
7898
|
+
opacity: 100%;
|
|
7899
|
+
}
|
|
7900
|
+
}
|
|
7901
|
+
}
|
|
7813
7902
|
.hover\:cursor-pointer {
|
|
7814
7903
|
&:hover {
|
|
7815
7904
|
@media (hover: hover) {
|
|
@@ -7838,6 +7927,13 @@ input[type="number"] {
|
|
|
7838
7927
|
}
|
|
7839
7928
|
}
|
|
7840
7929
|
}
|
|
7930
|
+
.hover\:text-gray-700 {
|
|
7931
|
+
&:hover {
|
|
7932
|
+
@media (hover: hover) {
|
|
7933
|
+
color: var(--color-gray-700);
|
|
7934
|
+
}
|
|
7935
|
+
}
|
|
7936
|
+
}
|
|
7841
7937
|
.hover\:text-gray-900 {
|
|
7842
7938
|
&:hover {
|
|
7843
7939
|
@media (hover: hover) {
|
|
@@ -8047,6 +8143,11 @@ input[type="number"] {
|
|
|
8047
8143
|
font-size: 12px !important;
|
|
8048
8144
|
}
|
|
8049
8145
|
}
|
|
8146
|
+
.\[\&_\.sidebar\\\\_\\\\_item--active\]\:text-black {
|
|
8147
|
+
& .sidebar\_\_item--active {
|
|
8148
|
+
color: var(--color-black);
|
|
8149
|
+
}
|
|
8150
|
+
}
|
|
8050
8151
|
}
|
|
8051
8152
|
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
|
|
8052
8153
|
@layer properties;
|
|
@@ -19216,6 +19317,14 @@ input[type="number"] {
|
|
|
19216
19317
|
@layer properties {
|
|
19217
19318
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
19218
19319
|
*, ::before, ::after, ::backdrop {
|
|
19320
|
+
--tw-translate-x: 0;
|
|
19321
|
+
--tw-translate-y: 0;
|
|
19322
|
+
--tw-translate-z: 0;
|
|
19323
|
+
--tw-rotate-x: initial;
|
|
19324
|
+
--tw-rotate-y: initial;
|
|
19325
|
+
--tw-rotate-z: initial;
|
|
19326
|
+
--tw-skew-x: initial;
|
|
19327
|
+
--tw-skew-y: initial;
|
|
19219
19328
|
--tw-space-x-reverse: 0;
|
|
19220
19329
|
--tw-border-style: solid;
|
|
19221
19330
|
--tw-font-weight: initial;
|
|
@@ -19235,17 +19344,9 @@ input[type="number"] {
|
|
|
19235
19344
|
--tw-ring-offset-shadow: 0 0 #0000;
|
|
19236
19345
|
--tw-duration: initial;
|
|
19237
19346
|
--tw-ease: initial;
|
|
19238
|
-
--tw-translate-x: 0;
|
|
19239
|
-
--tw-translate-y: 0;
|
|
19240
|
-
--tw-translate-z: 0;
|
|
19241
19347
|
--tw-scale-x: 1;
|
|
19242
19348
|
--tw-scale-y: 1;
|
|
19243
19349
|
--tw-scale-z: 1;
|
|
19244
|
-
--tw-rotate-x: initial;
|
|
19245
|
-
--tw-rotate-y: initial;
|
|
19246
|
-
--tw-rotate-z: initial;
|
|
19247
|
-
--tw-skew-x: initial;
|
|
19248
|
-
--tw-skew-y: initial;
|
|
19249
19350
|
--tw-divide-y-reverse: 0;
|
|
19250
19351
|
--tw-leading: initial;
|
|
19251
19352
|
--tw-tracking: initial;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
export * as WorkstreamSubgraph from "./workstream/index.js";
|
|
3
|
-
export * as RequestForProposalsSubgraph from "./request-for-proposals/index.js";
|
|
4
|
-
export * as PaymentTermsSubgraph from "./payment-terms/index.js";
|
|
5
2
|
export * as NetworkProfileSubgraph from "./network-profile/index.js";
|
|
3
|
+
export * as PaymentTermsSubgraph from "./payment-terms/index.js";
|
|
4
|
+
export * as RequestForProposalsSubgraph from "./request-for-proposals/index.js";
|
|
5
|
+
export * as WorkstreamSubgraph from "./workstream/index.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../subgraphs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AACV,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../subgraphs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AACV,OAAO,KAAK,sBAAsB,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,oBAAoB,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,2BAA2B,MAAM,kCAAkC,CAAC;AAChF,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC"}
|
package/dist/subgraphs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * as WorkstreamSubgraph from "./workstream/index.js";
|
|
2
|
-
export * as RequestForProposalsSubgraph from "./request-for-proposals/index.js";
|
|
3
|
-
export * as PaymentTermsSubgraph from "./payment-terms/index.js";
|
|
4
1
|
export * as NetworkProfileSubgraph from "./network-profile/index.js";
|
|
2
|
+
export * as PaymentTermsSubgraph from "./payment-terms/index.js";
|
|
3
|
+
export * as RequestForProposalsSubgraph from "./request-for-proposals/index.js";
|
|
4
|
+
export * as WorkstreamSubgraph from "./workstream/index.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Subgraph } from "@powerhousedao/reactor-api";
|
|
2
|
+
import type { DocumentNode } from "graphql";
|
|
2
3
|
export declare class NetworkProfileSubgraph extends Subgraph {
|
|
3
4
|
name: string;
|
|
4
|
-
typeDefs:
|
|
5
|
-
resolvers: Record<string,
|
|
5
|
+
typeDefs: DocumentNode;
|
|
6
|
+
resolvers: Record<string, unknown>;
|
|
6
7
|
additionalContextFields: {};
|
|
7
8
|
onSetup(): Promise<void>;
|
|
8
9
|
onDisconnect(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/network-profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/network-profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,sBAAuB,SAAQ,QAAQ;IAClD,IAAI,SAAqB;IACzB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/network-profile/resolvers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/network-profile/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAmB3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAkUvE,CAAC"}
|
|
@@ -1,38 +1,49 @@
|
|
|
1
1
|
import { addFile } from "document-drive";
|
|
2
|
-
import { actions } from "../../document-models/network-profile/index.js";
|
|
3
|
-
import {
|
|
4
|
-
const DEFAULT_DRIVE_ID = "powerhouse";
|
|
2
|
+
import { actions, } from "../../document-models/network-profile/index.js";
|
|
3
|
+
import { setName } from "document-model";
|
|
5
4
|
export const getResolvers = (subgraph) => {
|
|
6
5
|
const reactor = subgraph.reactor;
|
|
7
6
|
return {
|
|
8
7
|
Query: {
|
|
9
|
-
NetworkProfile: async (
|
|
8
|
+
NetworkProfile: async () => {
|
|
10
9
|
return {
|
|
11
10
|
getDocument: async (args) => {
|
|
12
|
-
const driveId = args
|
|
13
|
-
|
|
11
|
+
const { docId, driveId } = args;
|
|
12
|
+
if (!docId) {
|
|
13
|
+
throw new Error("Document id is required");
|
|
14
|
+
}
|
|
15
|
+
if (driveId) {
|
|
16
|
+
const docIds = await reactor.getDocuments(driveId);
|
|
17
|
+
if (!docIds.includes(docId)) {
|
|
18
|
+
throw new Error(`Document with id ${docId} is not part of ${driveId}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
14
21
|
const doc = await reactor.getDocument(docId);
|
|
15
22
|
return {
|
|
16
23
|
driveId: driveId,
|
|
17
24
|
...doc,
|
|
18
25
|
...doc.header,
|
|
26
|
+
created: doc.header.createdAtUtcIso,
|
|
27
|
+
lastModified: doc.header.lastModifiedAtUtcIso,
|
|
19
28
|
state: doc.state.global,
|
|
20
29
|
stateJSON: doc.state.global,
|
|
21
|
-
revision: doc.header
|
|
30
|
+
revision: doc.header?.revision?.global ?? 0,
|
|
22
31
|
};
|
|
23
32
|
},
|
|
24
33
|
getDocuments: async (args) => {
|
|
25
|
-
const driveId = args
|
|
34
|
+
const { driveId } = args;
|
|
26
35
|
const docsIds = await reactor.getDocuments(driveId);
|
|
27
36
|
const docs = await Promise.all(docsIds.map(async (docId) => {
|
|
28
|
-
const doc = await reactor.getDocument(
|
|
37
|
+
const doc = await reactor.getDocument(docId);
|
|
29
38
|
return {
|
|
30
39
|
driveId: driveId,
|
|
31
40
|
...doc,
|
|
32
41
|
...doc.header,
|
|
42
|
+
created: doc.header.createdAtUtcIso,
|
|
43
|
+
lastModified: doc.header.lastModifiedAtUtcIso,
|
|
33
44
|
state: doc.state.global,
|
|
34
45
|
stateJSON: doc.state.global,
|
|
35
|
-
revision: doc.header
|
|
46
|
+
revision: doc.header?.revision?.global ?? 0,
|
|
36
47
|
};
|
|
37
48
|
}));
|
|
38
49
|
return docs.filter((doc) => doc.header.documentType === "powerhouse/network-profile");
|
|
@@ -42,103 +53,151 @@ export const getResolvers = (subgraph) => {
|
|
|
42
53
|
},
|
|
43
54
|
Mutation: {
|
|
44
55
|
NetworkProfile_createDocument: async (_, args) => {
|
|
45
|
-
const driveId = args
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
branch: "main",
|
|
59
|
-
scope: "local",
|
|
60
|
-
syncId: generateId(),
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
}));
|
|
64
|
-
return docId;
|
|
56
|
+
const { driveId, name } = args;
|
|
57
|
+
const document = await reactor.addDocument("powerhouse/network-profile");
|
|
58
|
+
if (driveId) {
|
|
59
|
+
await reactor.addAction(driveId, addFile({
|
|
60
|
+
name,
|
|
61
|
+
id: document.header.id,
|
|
62
|
+
documentType: "powerhouse/network-profile",
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
if (name) {
|
|
66
|
+
await reactor.addAction(document.header.id, setName(name));
|
|
67
|
+
}
|
|
68
|
+
return document.header.id;
|
|
65
69
|
},
|
|
66
70
|
NetworkProfile_setIcon: async (_, args) => {
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
const { docId, input } = args;
|
|
72
|
+
const doc = await reactor.getDocument(docId);
|
|
73
|
+
if (!doc) {
|
|
74
|
+
throw new Error("Document not found");
|
|
75
|
+
}
|
|
76
|
+
const result = await reactor.addAction(docId, actions.setIcon(input));
|
|
77
|
+
if (result.status !== "SUCCESS") {
|
|
78
|
+
throw new Error(result.error?.message ?? "Failed to setIcon");
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
72
81
|
},
|
|
73
82
|
NetworkProfile_setLogo: async (_, args) => {
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
const { docId, input } = args;
|
|
84
|
+
const doc = await reactor.getDocument(docId);
|
|
85
|
+
if (!doc) {
|
|
86
|
+
throw new Error("Document not found");
|
|
87
|
+
}
|
|
88
|
+
const result = await reactor.addAction(docId, actions.setLogo(input));
|
|
89
|
+
if (result.status !== "SUCCESS") {
|
|
90
|
+
throw new Error(result.error?.message ?? "Failed to setLogo");
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
79
93
|
},
|
|
80
94
|
NetworkProfile_setLogoBig: async (_, args) => {
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
95
|
+
const { docId, input } = args;
|
|
96
|
+
const doc = await reactor.getDocument(docId);
|
|
97
|
+
if (!doc) {
|
|
98
|
+
throw new Error("Document not found");
|
|
99
|
+
}
|
|
100
|
+
const result = await reactor.addAction(docId, actions.setLogoBig(input));
|
|
101
|
+
if (result.status !== "SUCCESS") {
|
|
102
|
+
throw new Error(result.error?.message ?? "Failed to setLogoBig");
|
|
103
|
+
}
|
|
104
|
+
return true;
|
|
86
105
|
},
|
|
87
106
|
NetworkProfile_setWebsite: async (_, args) => {
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
const { docId, input } = args;
|
|
108
|
+
const doc = await reactor.getDocument(docId);
|
|
109
|
+
if (!doc) {
|
|
110
|
+
throw new Error("Document not found");
|
|
111
|
+
}
|
|
112
|
+
const result = await reactor.addAction(docId, actions.setWebsite(input));
|
|
113
|
+
if (result.status !== "SUCCESS") {
|
|
114
|
+
throw new Error(result.error?.message ?? "Failed to setWebsite");
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
93
117
|
},
|
|
94
118
|
NetworkProfile_setDescription: async (_, args) => {
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
119
|
+
const { docId, input } = args;
|
|
120
|
+
const doc = await reactor.getDocument(docId);
|
|
121
|
+
if (!doc) {
|
|
122
|
+
throw new Error("Document not found");
|
|
123
|
+
}
|
|
124
|
+
const result = await reactor.addAction(docId, actions.setDescription(input));
|
|
125
|
+
if (result.status !== "SUCCESS") {
|
|
126
|
+
throw new Error(result.error?.message ?? "Failed to setDescription");
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
100
129
|
},
|
|
101
130
|
NetworkProfile_setCategory: async (_, args) => {
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
131
|
+
const { docId, input } = args;
|
|
132
|
+
const doc = await reactor.getDocument(docId);
|
|
133
|
+
if (!doc) {
|
|
134
|
+
throw new Error("Document not found");
|
|
135
|
+
}
|
|
136
|
+
const result = await reactor.addAction(docId, actions.setCategory(input));
|
|
137
|
+
if (result.status !== "SUCCESS") {
|
|
138
|
+
throw new Error(result.error?.message ?? "Failed to setCategory");
|
|
139
|
+
}
|
|
140
|
+
return true;
|
|
107
141
|
},
|
|
108
142
|
NetworkProfile_setX: async (_, args) => {
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
143
|
+
const { docId, input } = args;
|
|
144
|
+
const doc = await reactor.getDocument(docId);
|
|
145
|
+
if (!doc) {
|
|
146
|
+
throw new Error("Document not found");
|
|
147
|
+
}
|
|
148
|
+
const result = await reactor.addAction(docId, actions.setX(input));
|
|
149
|
+
if (result.status !== "SUCCESS") {
|
|
150
|
+
throw new Error(result.error?.message ?? "Failed to setX");
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
114
153
|
},
|
|
115
154
|
NetworkProfile_setGithub: async (_, args) => {
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
155
|
+
const { docId, input } = args;
|
|
156
|
+
const doc = await reactor.getDocument(docId);
|
|
157
|
+
if (!doc) {
|
|
158
|
+
throw new Error("Document not found");
|
|
159
|
+
}
|
|
160
|
+
const result = await reactor.addAction(docId, actions.setGithub(input));
|
|
161
|
+
if (result.status !== "SUCCESS") {
|
|
162
|
+
throw new Error(result.error?.message ?? "Failed to setGithub");
|
|
163
|
+
}
|
|
164
|
+
return true;
|
|
121
165
|
},
|
|
122
166
|
NetworkProfile_setDiscord: async (_, args) => {
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
167
|
+
const { docId, input } = args;
|
|
168
|
+
const doc = await reactor.getDocument(docId);
|
|
169
|
+
if (!doc) {
|
|
170
|
+
throw new Error("Document not found");
|
|
171
|
+
}
|
|
172
|
+
const result = await reactor.addAction(docId, actions.setDiscord(input));
|
|
173
|
+
if (result.status !== "SUCCESS") {
|
|
174
|
+
throw new Error(result.error?.message ?? "Failed to setDiscord");
|
|
175
|
+
}
|
|
176
|
+
return true;
|
|
128
177
|
},
|
|
129
178
|
NetworkProfile_setYoutube: async (_, args) => {
|
|
130
|
-
const
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
179
|
+
const { docId, input } = args;
|
|
180
|
+
const doc = await reactor.getDocument(docId);
|
|
181
|
+
if (!doc) {
|
|
182
|
+
throw new Error("Document not found");
|
|
183
|
+
}
|
|
184
|
+
const result = await reactor.addAction(docId, actions.setYoutube(input));
|
|
185
|
+
if (result.status !== "SUCCESS") {
|
|
186
|
+
throw new Error(result.error?.message ?? "Failed to setYoutube");
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
135
189
|
},
|
|
136
190
|
NetworkProfile_setProfileName: async (_, args) => {
|
|
137
|
-
const
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
191
|
+
const { docId, input } = args;
|
|
192
|
+
const doc = await reactor.getDocument(docId);
|
|
193
|
+
if (!doc) {
|
|
194
|
+
throw new Error("Document not found");
|
|
195
|
+
}
|
|
196
|
+
const result = await reactor.addAction(docId, actions.setProfileName(input));
|
|
197
|
+
if (result.status !== "SUCCESS") {
|
|
198
|
+
throw new Error(result.error?.message ?? "Failed to setProfileName");
|
|
199
|
+
}
|
|
200
|
+
return true;
|
|
142
201
|
},
|
|
143
202
|
},
|
|
144
203
|
};
|