@ted-galago/wave-cli 0.1.6 → 0.1.7
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/README.md +5 -0
- package/dist/index.cjs +824 -228
- package/dist/index.js +824 -228
- package/package.json +1 -1
- package/scripts/verify-dev-api.mjs +76 -1
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { ZodError } from "zod";
|
|
|
8
8
|
import { Command } from "commander";
|
|
9
9
|
|
|
10
10
|
// src/commands/tasks.ts
|
|
11
|
-
import { z as
|
|
11
|
+
import { z as z2 } from "zod";
|
|
12
12
|
|
|
13
13
|
// src/config.ts
|
|
14
14
|
import { z } from "zod";
|
|
@@ -498,6 +498,22 @@ function graphqlTypeForVariable(name, value) {
|
|
|
498
498
|
function withNonNull(typeName) {
|
|
499
499
|
return typeName.endsWith("!") ? typeName : `${typeName}!`;
|
|
500
500
|
}
|
|
501
|
+
function splitSelectionAndFragments(selectionSet) {
|
|
502
|
+
const trimmed = selectionSet.trim();
|
|
503
|
+
if (trimmed.length === 0) {
|
|
504
|
+
return { fieldSelection: "{}", fragmentDefinitions: "" };
|
|
505
|
+
}
|
|
506
|
+
const fragmentMatch = /\bfragment\s+[A-Za-z0-9_]+\s+on\s+[A-Za-z0-9_]+\s*\{/.exec(trimmed);
|
|
507
|
+
if (!fragmentMatch || fragmentMatch.index <= 0) {
|
|
508
|
+
return { fieldSelection: trimmed, fragmentDefinitions: "" };
|
|
509
|
+
}
|
|
510
|
+
const fieldSelection = trimmed.slice(0, fragmentMatch.index).trim();
|
|
511
|
+
const fragmentDefinitions = trimmed.slice(fragmentMatch.index).trim();
|
|
512
|
+
return {
|
|
513
|
+
fieldSelection: fieldSelection.length > 0 ? fieldSelection : "{}",
|
|
514
|
+
fragmentDefinitions
|
|
515
|
+
};
|
|
516
|
+
}
|
|
501
517
|
function normalizeGraphqlVariables(variables) {
|
|
502
518
|
const normalized = {};
|
|
503
519
|
Object.entries(variables).forEach(([key, value]) => {
|
|
@@ -513,13 +529,15 @@ function buildGraphqlBody(input) {
|
|
|
513
529
|
const variableEntries = Object.entries(graphqlVariables).filter(([, value]) => value !== void 0);
|
|
514
530
|
const variableDecl = variableEntries.map(([name, value]) => {
|
|
515
531
|
const overriddenType = graphqlVariableTypes[name];
|
|
516
|
-
const
|
|
517
|
-
|
|
532
|
+
const hasOverriddenType = typeof overriddenType === "string" && overriddenType.trim().length > 0;
|
|
533
|
+
const typeName = hasOverriddenType ? overriddenType.trim() : graphqlTypeForVariable(name, value);
|
|
534
|
+
return `$${name}: ${hasOverriddenType ? typeName : withNonNull(typeName)}`;
|
|
518
535
|
}).join(", ");
|
|
519
536
|
const fieldArgs = variableEntries.map(([name]) => `${name}: $${name}`).join(", ");
|
|
520
537
|
const signature = variableDecl.length > 0 ? `(${variableDecl})` : "";
|
|
521
538
|
const args = fieldArgs.length > 0 ? `(${fieldArgs})` : "";
|
|
522
|
-
const
|
|
539
|
+
const selection = splitSelectionAndFragments(input.selectionSet);
|
|
540
|
+
const query = `${input.operationType} ${operationName}${signature} { ${graphqlField}${args} ${selection.fieldSelection} }${selection.fragmentDefinitions.length > 0 ? ` ${selection.fragmentDefinitions}` : ""}`;
|
|
523
541
|
return {
|
|
524
542
|
operationName,
|
|
525
543
|
query,
|
|
@@ -714,6 +732,494 @@ function printEnvelopeAndExit(params) {
|
|
|
714
732
|
}
|
|
715
733
|
|
|
716
734
|
// src/commandRunner.ts
|
|
735
|
+
var RESOURCE_QUERY_FIELDS = {
|
|
736
|
+
task: [
|
|
737
|
+
"summary",
|
|
738
|
+
"slug",
|
|
739
|
+
"description",
|
|
740
|
+
"notes",
|
|
741
|
+
"status",
|
|
742
|
+
"priority",
|
|
743
|
+
"rank",
|
|
744
|
+
"dueDate",
|
|
745
|
+
"createdAt",
|
|
746
|
+
"updatedAt",
|
|
747
|
+
"archivedAt",
|
|
748
|
+
"organizationId",
|
|
749
|
+
"memberId",
|
|
750
|
+
"creatorId",
|
|
751
|
+
"projectId",
|
|
752
|
+
"projectSlug",
|
|
753
|
+
"taskId",
|
|
754
|
+
"labelIds",
|
|
755
|
+
"estimateIds",
|
|
756
|
+
"subtasksCount",
|
|
757
|
+
"completedSubtasksCount"
|
|
758
|
+
],
|
|
759
|
+
issue: [
|
|
760
|
+
"name",
|
|
761
|
+
"slug",
|
|
762
|
+
"description",
|
|
763
|
+
"notes",
|
|
764
|
+
"status",
|
|
765
|
+
"priority",
|
|
766
|
+
"rank",
|
|
767
|
+
"dueBy",
|
|
768
|
+
"createdAt",
|
|
769
|
+
"updatedAt",
|
|
770
|
+
"archivedAt",
|
|
771
|
+
"organizationId",
|
|
772
|
+
"memberId",
|
|
773
|
+
"creatorId",
|
|
774
|
+
"issueGroupId",
|
|
775
|
+
"issueGroupSlug",
|
|
776
|
+
"issueType",
|
|
777
|
+
"labelIds",
|
|
778
|
+
"subIssuesCount",
|
|
779
|
+
"completedSubIssuesCount"
|
|
780
|
+
],
|
|
781
|
+
team: [
|
|
782
|
+
"name",
|
|
783
|
+
"slug",
|
|
784
|
+
"createdAt",
|
|
785
|
+
"updatedAt",
|
|
786
|
+
"memberIds",
|
|
787
|
+
"leadMemberId",
|
|
788
|
+
"organizationId",
|
|
789
|
+
"responsibilities",
|
|
790
|
+
"keyMetric"
|
|
791
|
+
],
|
|
792
|
+
member: [
|
|
793
|
+
"slug",
|
|
794
|
+
"email",
|
|
795
|
+
"role",
|
|
796
|
+
"status",
|
|
797
|
+
"title",
|
|
798
|
+
"firstName",
|
|
799
|
+
"lastName",
|
|
800
|
+
"createdAt",
|
|
801
|
+
"updatedAt",
|
|
802
|
+
"lastActiveAt",
|
|
803
|
+
"deactivatedAt",
|
|
804
|
+
"organizationId",
|
|
805
|
+
"organizationSlug",
|
|
806
|
+
"userId",
|
|
807
|
+
"coachId",
|
|
808
|
+
"timezone",
|
|
809
|
+
"province",
|
|
810
|
+
"birthdate",
|
|
811
|
+
"workAnniversary",
|
|
812
|
+
"phone",
|
|
813
|
+
"pinned",
|
|
814
|
+
"rocksCount",
|
|
815
|
+
"measurablesCount",
|
|
816
|
+
"smartKpisCount"
|
|
817
|
+
],
|
|
818
|
+
rock: [
|
|
819
|
+
"name",
|
|
820
|
+
"slug",
|
|
821
|
+
"description",
|
|
822
|
+
"notes",
|
|
823
|
+
"status",
|
|
824
|
+
"priority",
|
|
825
|
+
"rank",
|
|
826
|
+
"dueBy",
|
|
827
|
+
"createdAt",
|
|
828
|
+
"updatedAt",
|
|
829
|
+
"archivedAt",
|
|
830
|
+
"organizationId",
|
|
831
|
+
"memberId",
|
|
832
|
+
"creatorId",
|
|
833
|
+
"rockCollectionId",
|
|
834
|
+
"rockCollectionSlug",
|
|
835
|
+
"quarterlyObjectiveId",
|
|
836
|
+
"rockType",
|
|
837
|
+
"labelIds",
|
|
838
|
+
"milestonesCount",
|
|
839
|
+
"completedMilestonesCount"
|
|
840
|
+
],
|
|
841
|
+
meeting: [
|
|
842
|
+
"createdAt",
|
|
843
|
+
"updatedAt",
|
|
844
|
+
"name",
|
|
845
|
+
"slug",
|
|
846
|
+
"status",
|
|
847
|
+
"description",
|
|
848
|
+
"notes",
|
|
849
|
+
"useAiTranscript",
|
|
850
|
+
"aiTranscript",
|
|
851
|
+
"aiTranscriptStatus",
|
|
852
|
+
"aiTranscriptError",
|
|
853
|
+
"aiTranscriptUpdatedAt",
|
|
854
|
+
"aiSummary",
|
|
855
|
+
"aiSummaryStatus",
|
|
856
|
+
"aiSummaryError",
|
|
857
|
+
"aiSummaryUpdatedAt",
|
|
858
|
+
"repeats",
|
|
859
|
+
"color",
|
|
860
|
+
"talkingPointsCount",
|
|
861
|
+
"completedTalkingPointsCount",
|
|
862
|
+
"date",
|
|
863
|
+
"startTime",
|
|
864
|
+
"endTime",
|
|
865
|
+
"meetingStartTime",
|
|
866
|
+
"meetingEndTime",
|
|
867
|
+
"currentAgendaItemId",
|
|
868
|
+
"memberId",
|
|
869
|
+
"memberIds",
|
|
870
|
+
"teamIds",
|
|
871
|
+
"organizationId",
|
|
872
|
+
"agendaId",
|
|
873
|
+
"parentMeetingId",
|
|
874
|
+
"childMeetingIds",
|
|
875
|
+
"agendaName",
|
|
876
|
+
"occurrenceDate"
|
|
877
|
+
],
|
|
878
|
+
list: [
|
|
879
|
+
"name",
|
|
880
|
+
"slug",
|
|
881
|
+
"description",
|
|
882
|
+
"status",
|
|
883
|
+
"priority",
|
|
884
|
+
"createdAt",
|
|
885
|
+
"updatedAt",
|
|
886
|
+
"startDate",
|
|
887
|
+
"targetDate",
|
|
888
|
+
"archivedAt",
|
|
889
|
+
"memberId",
|
|
890
|
+
"organizationId",
|
|
891
|
+
"teamIds"
|
|
892
|
+
],
|
|
893
|
+
list_item: [
|
|
894
|
+
"summary",
|
|
895
|
+
"slug",
|
|
896
|
+
"description",
|
|
897
|
+
"notes",
|
|
898
|
+
"status",
|
|
899
|
+
"priority",
|
|
900
|
+
"rank",
|
|
901
|
+
"dueDate",
|
|
902
|
+
"createdAt",
|
|
903
|
+
"updatedAt",
|
|
904
|
+
"archivedAt",
|
|
905
|
+
"organizationId",
|
|
906
|
+
"memberId",
|
|
907
|
+
"creatorId",
|
|
908
|
+
"listId",
|
|
909
|
+
"listSlug",
|
|
910
|
+
"labelIds",
|
|
911
|
+
"estimateIds",
|
|
912
|
+
"subitemsCount",
|
|
913
|
+
"completedSubitemsCount"
|
|
914
|
+
],
|
|
915
|
+
issue_group: [
|
|
916
|
+
"name",
|
|
917
|
+
"slug",
|
|
918
|
+
"description",
|
|
919
|
+
"status",
|
|
920
|
+
"priority",
|
|
921
|
+
"startDate",
|
|
922
|
+
"targetDate",
|
|
923
|
+
"createdAt",
|
|
924
|
+
"updatedAt",
|
|
925
|
+
"memberId",
|
|
926
|
+
"organizationId",
|
|
927
|
+
"teamIds"
|
|
928
|
+
],
|
|
929
|
+
todo_group: [
|
|
930
|
+
"name",
|
|
931
|
+
"slug",
|
|
932
|
+
"description",
|
|
933
|
+
"status",
|
|
934
|
+
"priority",
|
|
935
|
+
"startDate",
|
|
936
|
+
"targetDate",
|
|
937
|
+
"createdAt",
|
|
938
|
+
"updatedAt",
|
|
939
|
+
"memberId",
|
|
940
|
+
"organizationId",
|
|
941
|
+
"teamIds"
|
|
942
|
+
],
|
|
943
|
+
todo: [
|
|
944
|
+
"name",
|
|
945
|
+
"slug",
|
|
946
|
+
"description",
|
|
947
|
+
"status",
|
|
948
|
+
"priority",
|
|
949
|
+
"rank",
|
|
950
|
+
"dueBy",
|
|
951
|
+
"createdAt",
|
|
952
|
+
"updatedAt",
|
|
953
|
+
"archivedAt",
|
|
954
|
+
"organizationId",
|
|
955
|
+
"meetingId",
|
|
956
|
+
"memberId",
|
|
957
|
+
"creatorId",
|
|
958
|
+
"todoGroupId",
|
|
959
|
+
"todoGroupSlug",
|
|
960
|
+
"labelIds",
|
|
961
|
+
"subTodosCount",
|
|
962
|
+
"completedSubTodosCount"
|
|
963
|
+
],
|
|
964
|
+
rock_collection: [
|
|
965
|
+
"name",
|
|
966
|
+
"slug",
|
|
967
|
+
"description",
|
|
968
|
+
"status",
|
|
969
|
+
"priority",
|
|
970
|
+
"rockType",
|
|
971
|
+
"createdAt",
|
|
972
|
+
"updatedAt",
|
|
973
|
+
"startDate",
|
|
974
|
+
"targetDate",
|
|
975
|
+
"archivedAt",
|
|
976
|
+
"memberId",
|
|
977
|
+
"organizationId",
|
|
978
|
+
"teamIds"
|
|
979
|
+
],
|
|
980
|
+
content: [
|
|
981
|
+
"name",
|
|
982
|
+
"slug",
|
|
983
|
+
"firstChildSlug",
|
|
984
|
+
"rootParentSlug",
|
|
985
|
+
"status",
|
|
986
|
+
"contentType",
|
|
987
|
+
"lastEdited",
|
|
988
|
+
"organizationId",
|
|
989
|
+
"memberId",
|
|
990
|
+
"focusMemberId",
|
|
991
|
+
"focusTeamId",
|
|
992
|
+
"teamId",
|
|
993
|
+
"creatorId",
|
|
994
|
+
"createdAt",
|
|
995
|
+
"updatedAt",
|
|
996
|
+
"childCount",
|
|
997
|
+
"assignmentType",
|
|
998
|
+
"contentableId",
|
|
999
|
+
"contentableSlug",
|
|
1000
|
+
"contentableType",
|
|
1001
|
+
"votesTotal",
|
|
1002
|
+
"labelIds",
|
|
1003
|
+
"rootContentId",
|
|
1004
|
+
"parentContentId"
|
|
1005
|
+
],
|
|
1006
|
+
stand_up: [
|
|
1007
|
+
"completedDate",
|
|
1008
|
+
"blockers",
|
|
1009
|
+
"plannedWork",
|
|
1010
|
+
"slug",
|
|
1011
|
+
"memberId",
|
|
1012
|
+
"organizationId"
|
|
1013
|
+
],
|
|
1014
|
+
headline: [
|
|
1015
|
+
"slug",
|
|
1016
|
+
"summary",
|
|
1017
|
+
"description",
|
|
1018
|
+
"memberId",
|
|
1019
|
+
"status",
|
|
1020
|
+
"rank",
|
|
1021
|
+
"createdAt",
|
|
1022
|
+
"updatedAt",
|
|
1023
|
+
"headlineType",
|
|
1024
|
+
"teamIds",
|
|
1025
|
+
"meetingId",
|
|
1026
|
+
"labelIds"
|
|
1027
|
+
],
|
|
1028
|
+
question: [
|
|
1029
|
+
"name",
|
|
1030
|
+
"description",
|
|
1031
|
+
"status",
|
|
1032
|
+
"votesTotal",
|
|
1033
|
+
"slug",
|
|
1034
|
+
"createdAt",
|
|
1035
|
+
"updatedAt",
|
|
1036
|
+
"memberId",
|
|
1037
|
+
"creatorId",
|
|
1038
|
+
"organizationId",
|
|
1039
|
+
"acceptedAnswerIds",
|
|
1040
|
+
"labelIds"
|
|
1041
|
+
],
|
|
1042
|
+
feedback: [
|
|
1043
|
+
"name",
|
|
1044
|
+
"slug",
|
|
1045
|
+
"year",
|
|
1046
|
+
"quarter",
|
|
1047
|
+
"organizationId",
|
|
1048
|
+
"memberIds"
|
|
1049
|
+
],
|
|
1050
|
+
survey: [
|
|
1051
|
+
"name",
|
|
1052
|
+
"slug",
|
|
1053
|
+
"createdAt",
|
|
1054
|
+
"dueDate",
|
|
1055
|
+
"updatedAt",
|
|
1056
|
+
"recipientType",
|
|
1057
|
+
"organizationId",
|
|
1058
|
+
"memberIds"
|
|
1059
|
+
],
|
|
1060
|
+
responsibility: ["name", "description", "rank", "slug", "memberId", "organizationId"],
|
|
1061
|
+
smart_kpi_view: [
|
|
1062
|
+
"name",
|
|
1063
|
+
"slug",
|
|
1064
|
+
"description",
|
|
1065
|
+
"status",
|
|
1066
|
+
"priority",
|
|
1067
|
+
"createdAt",
|
|
1068
|
+
"updatedAt",
|
|
1069
|
+
"archivedAt",
|
|
1070
|
+
"memberId",
|
|
1071
|
+
"organizationId",
|
|
1072
|
+
"teamIds"
|
|
1073
|
+
],
|
|
1074
|
+
smart_kpi: [
|
|
1075
|
+
"name",
|
|
1076
|
+
"slug",
|
|
1077
|
+
"notes",
|
|
1078
|
+
"interval",
|
|
1079
|
+
"trend",
|
|
1080
|
+
"smartKpiType",
|
|
1081
|
+
"condition",
|
|
1082
|
+
"status",
|
|
1083
|
+
"progressStatus",
|
|
1084
|
+
"autoIncrease",
|
|
1085
|
+
"createdAt",
|
|
1086
|
+
"updatedAt",
|
|
1087
|
+
"archivedAt",
|
|
1088
|
+
"organizationId",
|
|
1089
|
+
"smartKpiViewId",
|
|
1090
|
+
"smartKpiViewSlug",
|
|
1091
|
+
"memberId",
|
|
1092
|
+
"integrationId",
|
|
1093
|
+
"quarterlyObjectiveId"
|
|
1094
|
+
],
|
|
1095
|
+
measurable_group: [
|
|
1096
|
+
"name",
|
|
1097
|
+
"slug",
|
|
1098
|
+
"description",
|
|
1099
|
+
"status",
|
|
1100
|
+
"priority",
|
|
1101
|
+
"createdAt",
|
|
1102
|
+
"updatedAt",
|
|
1103
|
+
"memberId",
|
|
1104
|
+
"organizationId",
|
|
1105
|
+
"teamIds"
|
|
1106
|
+
],
|
|
1107
|
+
measurable: [
|
|
1108
|
+
"name",
|
|
1109
|
+
"slug",
|
|
1110
|
+
"description",
|
|
1111
|
+
"notes",
|
|
1112
|
+
"interval",
|
|
1113
|
+
"trend",
|
|
1114
|
+
"measurableType",
|
|
1115
|
+
"condition",
|
|
1116
|
+
"status",
|
|
1117
|
+
"rank",
|
|
1118
|
+
"createdAt",
|
|
1119
|
+
"updatedAt",
|
|
1120
|
+
"archivedAt",
|
|
1121
|
+
"organizationId",
|
|
1122
|
+
"measurableGroupId",
|
|
1123
|
+
"measurableGroupSlug",
|
|
1124
|
+
"memberId",
|
|
1125
|
+
"creatorId",
|
|
1126
|
+
"quarterlyObjectiveId",
|
|
1127
|
+
"labelIds"
|
|
1128
|
+
],
|
|
1129
|
+
customer: [
|
|
1130
|
+
"name",
|
|
1131
|
+
"slug",
|
|
1132
|
+
"createdAt",
|
|
1133
|
+
"updatedAt",
|
|
1134
|
+
"memberId",
|
|
1135
|
+
"organizationId",
|
|
1136
|
+
"status",
|
|
1137
|
+
"rank",
|
|
1138
|
+
"revenue",
|
|
1139
|
+
"companySize",
|
|
1140
|
+
"domain",
|
|
1141
|
+
"primaryEmail",
|
|
1142
|
+
"primaryPhone",
|
|
1143
|
+
"primaryLocation"
|
|
1144
|
+
],
|
|
1145
|
+
contact: [
|
|
1146
|
+
"name",
|
|
1147
|
+
"slug",
|
|
1148
|
+
"createdAt",
|
|
1149
|
+
"updatedAt",
|
|
1150
|
+
"memberId",
|
|
1151
|
+
"organizationId",
|
|
1152
|
+
"customerId",
|
|
1153
|
+
"status",
|
|
1154
|
+
"rank",
|
|
1155
|
+
"jobTitle",
|
|
1156
|
+
"email",
|
|
1157
|
+
"phone",
|
|
1158
|
+
"location"
|
|
1159
|
+
],
|
|
1160
|
+
annual_objective: [
|
|
1161
|
+
"name",
|
|
1162
|
+
"description",
|
|
1163
|
+
"status",
|
|
1164
|
+
"createdAt",
|
|
1165
|
+
"updatedAt",
|
|
1166
|
+
"organizationId",
|
|
1167
|
+
"strategicObjectiveId",
|
|
1168
|
+
"ownerId",
|
|
1169
|
+
"creatorId"
|
|
1170
|
+
],
|
|
1171
|
+
quarterly_objective: [
|
|
1172
|
+
"name",
|
|
1173
|
+
"description",
|
|
1174
|
+
"status",
|
|
1175
|
+
"alignmentScore",
|
|
1176
|
+
"alignmentLabel",
|
|
1177
|
+
"rocksCount",
|
|
1178
|
+
"measurablesCount",
|
|
1179
|
+
"smartKpisCount",
|
|
1180
|
+
"createdAt",
|
|
1181
|
+
"updatedAt",
|
|
1182
|
+
"organizationId",
|
|
1183
|
+
"strategicObjectiveId",
|
|
1184
|
+
"annualObjectiveId",
|
|
1185
|
+
"departmentId",
|
|
1186
|
+
"ownerId",
|
|
1187
|
+
"creatorId"
|
|
1188
|
+
],
|
|
1189
|
+
organization_meta_profile: ["summary", "profile"],
|
|
1190
|
+
key_metric_meta_profile: ["summary", "profile"],
|
|
1191
|
+
strategic_plan: [],
|
|
1192
|
+
strategic_objective: []
|
|
1193
|
+
};
|
|
1194
|
+
var RESOURCE_FIELD_ALIASES = {
|
|
1195
|
+
tasks: "task",
|
|
1196
|
+
issues: "issue",
|
|
1197
|
+
teams: "team",
|
|
1198
|
+
members: "member",
|
|
1199
|
+
rocks: "rock",
|
|
1200
|
+
meetings: "meeting",
|
|
1201
|
+
lists: "list",
|
|
1202
|
+
list_items: "list_item",
|
|
1203
|
+
issue_groups: "issue_group",
|
|
1204
|
+
todo_groups: "todo_group",
|
|
1205
|
+
todos: "todo",
|
|
1206
|
+
rock_collections: "rock_collection",
|
|
1207
|
+
contents: "content",
|
|
1208
|
+
stand_ups: "stand_up",
|
|
1209
|
+
headlines: "headline",
|
|
1210
|
+
questions: "question",
|
|
1211
|
+
feedbacks: "feedback",
|
|
1212
|
+
surveys: "survey",
|
|
1213
|
+
responsibilities: "responsibility",
|
|
1214
|
+
smart_kpi_views: "smart_kpi_view",
|
|
1215
|
+
smart_kpis: "smart_kpi",
|
|
1216
|
+
measurable_groups: "measurable_group",
|
|
1217
|
+
measurables: "measurable",
|
|
1218
|
+
customers: "customer",
|
|
1219
|
+
contacts: "contact",
|
|
1220
|
+
annual_objectives: "annual_objective",
|
|
1221
|
+
quarterly_objectives: "quarterly_objective"
|
|
1222
|
+
};
|
|
717
1223
|
function buildCliErrorEnvelope(params) {
|
|
718
1224
|
return {
|
|
719
1225
|
ok: false,
|
|
@@ -734,11 +1240,47 @@ function defaultQuerySelectionSet(field, isList) {
|
|
|
734
1240
|
if (field === "organization") {
|
|
735
1241
|
return "{ id slug membersCount organizationDetail { title name description timezone workspaceName } }";
|
|
736
1242
|
}
|
|
1243
|
+
const canonicalField = RESOURCE_FIELD_ALIASES[field] ?? field;
|
|
1244
|
+
const explicitFields = RESOURCE_QUERY_FIELDS[canonicalField];
|
|
1245
|
+
if (explicitFields) {
|
|
1246
|
+
const fields = Array.from(/* @__PURE__ */ new Set(["id", "type", ...explicitFields, "attributes"])).join(" ");
|
|
1247
|
+
return isList ? `{ data { ${fields} } count currentPage totalPages }` : `{ ${fields} }`;
|
|
1248
|
+
}
|
|
737
1249
|
if (isList) {
|
|
738
1250
|
return "{ data { id type attributes } count currentPage totalPages }";
|
|
739
1251
|
}
|
|
740
1252
|
return "{ id type attributes }";
|
|
741
1253
|
}
|
|
1254
|
+
function isRecord(value) {
|
|
1255
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
1256
|
+
}
|
|
1257
|
+
function normalizeDisplayFieldsInRow(row) {
|
|
1258
|
+
if (!isRecord(row)) return row;
|
|
1259
|
+
const attributes = isRecord(row.attributes) ? row.attributes : null;
|
|
1260
|
+
if (!attributes) return row;
|
|
1261
|
+
const normalized = { ...row };
|
|
1262
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
1263
|
+
if (!Object.prototype.hasOwnProperty.call(normalized, key)) {
|
|
1264
|
+
normalized[key] = value;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
return normalized;
|
|
1268
|
+
}
|
|
1269
|
+
function normalizeQueryFieldPayloadForDisplay(fieldPayload) {
|
|
1270
|
+
if (Array.isArray(fieldPayload)) {
|
|
1271
|
+
return fieldPayload.map((row) => normalizeDisplayFieldsInRow(row));
|
|
1272
|
+
}
|
|
1273
|
+
if (!isRecord(fieldPayload)) {
|
|
1274
|
+
return fieldPayload;
|
|
1275
|
+
}
|
|
1276
|
+
if (Array.isArray(fieldPayload.data)) {
|
|
1277
|
+
return {
|
|
1278
|
+
...fieldPayload,
|
|
1279
|
+
data: fieldPayload.data.map((row) => normalizeDisplayFieldsInRow(row))
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
return normalizeDisplayFieldsInRow(fieldPayload);
|
|
1283
|
+
}
|
|
742
1284
|
function parseBooleanMaybe(value) {
|
|
743
1285
|
const lowered = value.toLowerCase();
|
|
744
1286
|
if (lowered === "true") {
|
|
@@ -799,6 +1341,11 @@ async function runGraphqlQueryCommand(input) {
|
|
|
799
1341
|
selectionSet: input.selectionSet ?? defaultQuerySelectionSet(input.field, Boolean(input.isList)),
|
|
800
1342
|
isShow: input.isShow
|
|
801
1343
|
});
|
|
1344
|
+
const envelopeData = result.envelope.data;
|
|
1345
|
+
if (result.envelope.ok && envelopeData && Object.prototype.hasOwnProperty.call(envelopeData, input.field)) {
|
|
1346
|
+
envelopeData[input.field] = normalizeQueryFieldPayloadForDisplay(envelopeData[input.field]);
|
|
1347
|
+
result.envelope.data = envelopeData;
|
|
1348
|
+
}
|
|
802
1349
|
if (result.envelope.ok && input.transformData && result.envelope.data) {
|
|
803
1350
|
const dataRecord = result.envelope.data;
|
|
804
1351
|
const transformed = input.transformData(dataRecord[input.field]);
|
|
@@ -1094,8 +1641,114 @@ function resolveOrganizationId(raw) {
|
|
|
1094
1641
|
return organizationId;
|
|
1095
1642
|
}
|
|
1096
1643
|
|
|
1644
|
+
// src/commands/tasks.ts
|
|
1645
|
+
var projectIdSchema = z2.string().min(1);
|
|
1646
|
+
var idSchema = z2.string().min(1);
|
|
1647
|
+
var summarySchema = z2.string().min(1);
|
|
1648
|
+
function registerTaskCommands(program) {
|
|
1649
|
+
const tasks = program.command("tasks").description("Task operations");
|
|
1650
|
+
tasks.command("list").option("--project-id <projectId>").option("--page <page>").option("--per <per>").option("--team-id <teamId>").option("--team-ids <teamIds>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--field-name <fieldName>").option("--field-value <fieldValue>").option("--field-blank <fieldBlank>").option("--open <open>").option("--rank-direction <rankDirection>").option("--include-archived <includeArchived>").action(async (opts, cmd) => {
|
|
1651
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1652
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1653
|
+
const projectId = opts.projectId ? projectIdSchema.parse(opts.projectId) : void 0;
|
|
1654
|
+
await runGraphqlQueryCommand({
|
|
1655
|
+
command: "tasks.list",
|
|
1656
|
+
runtimeOptions: context.runtimeOptions,
|
|
1657
|
+
field: "tasks",
|
|
1658
|
+
variables: normalizeGraphqlVariables2({
|
|
1659
|
+
organization_id: organizationId,
|
|
1660
|
+
page: opts.page,
|
|
1661
|
+
per: opts.per,
|
|
1662
|
+
project_id: projectId,
|
|
1663
|
+
team_id: opts.teamId,
|
|
1664
|
+
team_ids: opts.teamIds,
|
|
1665
|
+
member_id: opts.memberId,
|
|
1666
|
+
meeting_id: opts.meetingId,
|
|
1667
|
+
field_name: opts.fieldName,
|
|
1668
|
+
field_value: opts.fieldValue,
|
|
1669
|
+
field_blank: opts.fieldBlank,
|
|
1670
|
+
open: opts.open,
|
|
1671
|
+
rank_direction: opts.rankDirection,
|
|
1672
|
+
include_archived: opts.includeArchived
|
|
1673
|
+
}),
|
|
1674
|
+
isList: true
|
|
1675
|
+
});
|
|
1676
|
+
});
|
|
1677
|
+
tasks.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1678
|
+
const parsed = idSchema.parse(opts.id);
|
|
1679
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1680
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1681
|
+
await runGraphqlQueryCommand({
|
|
1682
|
+
command: "tasks.show",
|
|
1683
|
+
runtimeOptions: context.runtimeOptions,
|
|
1684
|
+
field: "task",
|
|
1685
|
+
variables: {
|
|
1686
|
+
organization_id: organizationId,
|
|
1687
|
+
id: parsed
|
|
1688
|
+
},
|
|
1689
|
+
isShow: true
|
|
1690
|
+
});
|
|
1691
|
+
});
|
|
1692
|
+
tasks.command("create").requiredOption("--project-id <projectId>").option("--title <title>", "Legacy alias for --summary").option("--summary <summary>").action(async (opts, cmd) => {
|
|
1693
|
+
const projectId = projectIdSchema.parse(opts.projectId);
|
|
1694
|
+
const summary = summarySchema.parse(opts.summary ?? opts.title);
|
|
1695
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1696
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1697
|
+
await runGraphqlMutationCommand({
|
|
1698
|
+
command: "tasks.create",
|
|
1699
|
+
runtimeOptions: context.runtimeOptions,
|
|
1700
|
+
field: "create_task",
|
|
1701
|
+
variables: {
|
|
1702
|
+
organization_id: organizationId,
|
|
1703
|
+
params: {
|
|
1704
|
+
task: {
|
|
1705
|
+
project_id: projectId,
|
|
1706
|
+
summary
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
});
|
|
1712
|
+
tasks.command("update").requiredOption("--id <id>").option("--summary <summary>").option("--description <description>").option("--status <status>").option("--priority <priority>").option("--due-date <dueDate>").option("--member-id <memberId>").action(async (opts, cmd) => {
|
|
1713
|
+
const id = idSchema.parse(opts.id);
|
|
1714
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1715
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1716
|
+
const taskPayload = {
|
|
1717
|
+
...opts.summary ? { summary: String(opts.summary) } : {},
|
|
1718
|
+
...opts.description ? { description: String(opts.description) } : {},
|
|
1719
|
+
...opts.status ? { status: String(opts.status) } : {},
|
|
1720
|
+
...opts.priority ? { priority: String(opts.priority) } : {},
|
|
1721
|
+
...opts.dueDate ? { due_date: String(opts.dueDate) } : {},
|
|
1722
|
+
...opts.memberId ? { member_id: String(opts.memberId) } : {}
|
|
1723
|
+
};
|
|
1724
|
+
if (Object.keys(taskPayload).length === 0) {
|
|
1725
|
+
throw new CliError({
|
|
1726
|
+
message: "tasks update requires at least one patch field (summary, description, status, priority, due-date, member-id).",
|
|
1727
|
+
kind: "invalid_args",
|
|
1728
|
+
status: 400,
|
|
1729
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
await runGraphqlMutationCommand({
|
|
1733
|
+
command: "tasks.update",
|
|
1734
|
+
runtimeOptions: context.runtimeOptions,
|
|
1735
|
+
field: "update_task",
|
|
1736
|
+
variables: {
|
|
1737
|
+
organization_id: organizationId,
|
|
1738
|
+
task_id: id,
|
|
1739
|
+
params: {
|
|
1740
|
+
task: taskPayload
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
});
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
// src/commands/projects.ts
|
|
1748
|
+
import { z as z4 } from "zod";
|
|
1749
|
+
|
|
1097
1750
|
// src/commands/entityCrud.ts
|
|
1098
|
-
import { z as
|
|
1751
|
+
import { z as z3 } from "zod";
|
|
1099
1752
|
|
|
1100
1753
|
// src/commands/dtoHelpCatalog.ts
|
|
1101
1754
|
var dtoHelpCatalog = {
|
|
@@ -1676,7 +2329,7 @@ function buildDataJsonHelp(rootKey, mode) {
|
|
|
1676
2329
|
}
|
|
1677
2330
|
|
|
1678
2331
|
// src/commands/entityCrud.ts
|
|
1679
|
-
var
|
|
2332
|
+
var idSchema2 = z3.string().min(1);
|
|
1680
2333
|
function toSingularResourceName(resourcePath) {
|
|
1681
2334
|
if (resourcePath === "organization_meta_profiles") {
|
|
1682
2335
|
return "organization_meta_profile";
|
|
@@ -1756,14 +2409,19 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1756
2409
|
const updateHelp5 = buildDataJsonHelp(config.rootKey, "update") ?? "JSON object, optionally wrapped with root key";
|
|
1757
2410
|
const list = entityCommand.command("list").option("--page <page>").option("--per <per>");
|
|
1758
2411
|
const listParams = config.listParams ?? [];
|
|
2412
|
+
const showParams = config.showParams ?? [];
|
|
2413
|
+
const allowQueryJson = config.allowQueryJson !== false;
|
|
1759
2414
|
listParams.forEach((param) => {
|
|
1760
2415
|
const cliParam = param.replace(/_/g, "-");
|
|
1761
2416
|
list.option(`--${cliParam} <${cliParam}>`);
|
|
1762
2417
|
});
|
|
1763
|
-
|
|
2418
|
+
if (allowQueryJson) {
|
|
2419
|
+
list.option("--query-json <queryJson>", "Additional query params as JSON object");
|
|
2420
|
+
}
|
|
2421
|
+
list.action(async (opts, cmd) => {
|
|
1764
2422
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1765
2423
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1766
|
-
const extraQuery = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2424
|
+
const extraQuery = allowQueryJson ? parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0) : {};
|
|
1767
2425
|
const mappedKnownParams = Object.fromEntries(
|
|
1768
2426
|
listParams.map((param) => {
|
|
1769
2427
|
const optionKey = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
@@ -1780,20 +2438,34 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1780
2438
|
await runGraphqlQueryCommand({
|
|
1781
2439
|
command: `${config.command}.list`,
|
|
1782
2440
|
runtimeOptions: context.runtimeOptions,
|
|
1783
|
-
field: config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath,
|
|
2441
|
+
field: config.listField ?? (config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath),
|
|
1784
2442
|
variables,
|
|
2443
|
+
variableTypes: config.listVariableTypes,
|
|
2444
|
+
selectionSet: config.listSelectionSet,
|
|
1785
2445
|
isList: true
|
|
1786
2446
|
});
|
|
1787
2447
|
});
|
|
1788
|
-
entityCommand.command("show").requiredOption("--id <id>")
|
|
1789
|
-
|
|
2448
|
+
const show = entityCommand.command("show").requiredOption("--id <id>");
|
|
2449
|
+
showParams.forEach((param) => {
|
|
2450
|
+
const cliParam = param.replace(/_/g, "-");
|
|
2451
|
+
show.option(`--${cliParam} <${cliParam}>`);
|
|
2452
|
+
});
|
|
2453
|
+
show.action(async (opts, cmd) => {
|
|
2454
|
+
const id = idSchema2.parse(opts.id);
|
|
1790
2455
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1791
2456
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1792
2457
|
const defaultCommand = `${config.command}.show`;
|
|
1793
|
-
const defaultField = config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath);
|
|
2458
|
+
const defaultField = config.showField ?? (config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath));
|
|
2459
|
+
const mappedShowParams = Object.fromEntries(
|
|
2460
|
+
showParams.map((param) => {
|
|
2461
|
+
const optionKey = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
2462
|
+
return [param, opts[optionKey]];
|
|
2463
|
+
})
|
|
2464
|
+
);
|
|
1794
2465
|
const defaultVariables = normalizeGraphqlVariables2({
|
|
1795
2466
|
organization_id: organizationId,
|
|
1796
|
-
id
|
|
2467
|
+
id,
|
|
2468
|
+
...mappedShowParams
|
|
1797
2469
|
});
|
|
1798
2470
|
const showQuery = config.showQueryFactory ? config.showQueryFactory({
|
|
1799
2471
|
command: defaultCommand,
|
|
@@ -1808,8 +2480,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1808
2480
|
operationName: showQuery?.operationName,
|
|
1809
2481
|
field: showQuery?.field ?? defaultField,
|
|
1810
2482
|
variables: showQuery?.variables ?? defaultVariables,
|
|
1811
|
-
variableTypes: showQuery?.variableTypes,
|
|
1812
|
-
selectionSet: showQuery?.selectionSet,
|
|
2483
|
+
variableTypes: showQuery?.variableTypes ?? config.showVariableTypes,
|
|
2484
|
+
selectionSet: showQuery?.selectionSet ?? config.showSelectionSet,
|
|
1813
2485
|
isShow: true,
|
|
1814
2486
|
transformData: showQuery?.transformData
|
|
1815
2487
|
});
|
|
@@ -1846,7 +2518,7 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1846
2518
|
});
|
|
1847
2519
|
});
|
|
1848
2520
|
entityCommand.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp5).action(async (opts, cmd) => {
|
|
1849
|
-
const id =
|
|
2521
|
+
const id = idSchema2.parse(opts.id);
|
|
1850
2522
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1851
2523
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1852
2524
|
let body = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
@@ -1874,138 +2546,69 @@ var __testables = {
|
|
|
1874
2546
|
parseQueryJson
|
|
1875
2547
|
};
|
|
1876
2548
|
|
|
1877
|
-
// src/commands/tasks.ts
|
|
1878
|
-
var projectIdSchema = z3.string().min(1);
|
|
1879
|
-
var idSchema2 = z3.string().min(1);
|
|
1880
|
-
var summarySchema = z3.string().min(1);
|
|
1881
|
-
function registerTaskCommands(program) {
|
|
1882
|
-
const tasks = program.command("tasks").description("Task operations");
|
|
1883
|
-
tasks.command("list").option("--project-id <projectId>").option("--page <page>").option("--per <per>").option("--team-id <teamId>").option("--team-ids <teamIds>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--field-name <fieldName>").option("--field-value <fieldValue>").option("--field-blank <fieldBlank>").option("--rank-direction <rankDirection>").option("--include-archived <includeArchived>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
1884
|
-
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1885
|
-
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1886
|
-
const projectId = opts.projectId ? projectIdSchema.parse(opts.projectId) : void 0;
|
|
1887
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1888
|
-
await runGraphqlQueryCommand({
|
|
1889
|
-
command: "tasks.list",
|
|
1890
|
-
runtimeOptions: context.runtimeOptions,
|
|
1891
|
-
field: "tasks",
|
|
1892
|
-
variables: normalizeGraphqlVariables2({
|
|
1893
|
-
organization_id: organizationId,
|
|
1894
|
-
page: opts.page,
|
|
1895
|
-
per: opts.per,
|
|
1896
|
-
project_id: projectId,
|
|
1897
|
-
team_id: opts.teamId,
|
|
1898
|
-
team_ids: opts.teamIds,
|
|
1899
|
-
member_id: opts.memberId,
|
|
1900
|
-
meeting_id: opts.meetingId,
|
|
1901
|
-
field_name: opts.fieldName,
|
|
1902
|
-
field_value: opts.fieldValue,
|
|
1903
|
-
field_blank: opts.fieldBlank,
|
|
1904
|
-
rank_direction: opts.rankDirection,
|
|
1905
|
-
include_archived: opts.includeArchived,
|
|
1906
|
-
...extra
|
|
1907
|
-
}),
|
|
1908
|
-
isList: true
|
|
1909
|
-
});
|
|
1910
|
-
});
|
|
1911
|
-
tasks.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1912
|
-
const parsed = idSchema2.parse(opts.id);
|
|
1913
|
-
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1914
|
-
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1915
|
-
await runGraphqlQueryCommand({
|
|
1916
|
-
command: "tasks.show",
|
|
1917
|
-
runtimeOptions: context.runtimeOptions,
|
|
1918
|
-
field: "task",
|
|
1919
|
-
variables: {
|
|
1920
|
-
organization_id: organizationId,
|
|
1921
|
-
id: parsed
|
|
1922
|
-
},
|
|
1923
|
-
isShow: true
|
|
1924
|
-
});
|
|
1925
|
-
});
|
|
1926
|
-
tasks.command("create").requiredOption("--project-id <projectId>").option("--title <title>", "Legacy alias for --summary").option("--summary <summary>").action(async (opts, cmd) => {
|
|
1927
|
-
const projectId = projectIdSchema.parse(opts.projectId);
|
|
1928
|
-
const summary = summarySchema.parse(opts.summary ?? opts.title);
|
|
1929
|
-
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1930
|
-
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1931
|
-
await runGraphqlMutationCommand({
|
|
1932
|
-
command: "tasks.create",
|
|
1933
|
-
runtimeOptions: context.runtimeOptions,
|
|
1934
|
-
field: "create_task",
|
|
1935
|
-
variables: {
|
|
1936
|
-
organization_id: organizationId,
|
|
1937
|
-
params: {
|
|
1938
|
-
task: {
|
|
1939
|
-
project_id: projectId,
|
|
1940
|
-
summary
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
}
|
|
1944
|
-
});
|
|
1945
|
-
});
|
|
1946
|
-
tasks.command("update").requiredOption("--id <id>").option("--summary <summary>").option("--description <description>").option("--status <status>").option("--priority <priority>").option("--due-date <dueDate>").option("--member-id <memberId>").action(async (opts, cmd) => {
|
|
1947
|
-
const id = idSchema2.parse(opts.id);
|
|
1948
|
-
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1949
|
-
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1950
|
-
const taskPayload = {
|
|
1951
|
-
...opts.summary ? { summary: String(opts.summary) } : {},
|
|
1952
|
-
...opts.description ? { description: String(opts.description) } : {},
|
|
1953
|
-
...opts.status ? { status: String(opts.status) } : {},
|
|
1954
|
-
...opts.priority ? { priority: String(opts.priority) } : {},
|
|
1955
|
-
...opts.dueDate ? { due_date: String(opts.dueDate) } : {},
|
|
1956
|
-
...opts.memberId ? { member_id: String(opts.memberId) } : {}
|
|
1957
|
-
};
|
|
1958
|
-
if (Object.keys(taskPayload).length === 0) {
|
|
1959
|
-
throw new CliError({
|
|
1960
|
-
message: "tasks update requires at least one patch field (summary, description, status, priority, due-date, member-id).",
|
|
1961
|
-
kind: "invalid_args",
|
|
1962
|
-
status: 400,
|
|
1963
|
-
exitCode: EXIT_CODES.invalidArgs
|
|
1964
|
-
});
|
|
1965
|
-
}
|
|
1966
|
-
await runGraphqlMutationCommand({
|
|
1967
|
-
command: "tasks.update",
|
|
1968
|
-
runtimeOptions: context.runtimeOptions,
|
|
1969
|
-
field: "update_task",
|
|
1970
|
-
variables: {
|
|
1971
|
-
organization_id: organizationId,
|
|
1972
|
-
task_id: id,
|
|
1973
|
-
params: {
|
|
1974
|
-
task: taskPayload
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
});
|
|
1978
|
-
});
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
2549
|
// src/commands/projects.ts
|
|
1982
|
-
import { z as z4 } from "zod";
|
|
1983
2550
|
var idSchema3 = z4.string().min(1);
|
|
1984
2551
|
var projectCreateDataJsonHelp = buildDataJsonHelp("project", "create") ?? 'JSON object for project or {"project": {...}}';
|
|
1985
2552
|
var projectUpdateDataJsonHelp = buildDataJsonHelp("project", "update") ?? 'JSON object for project or {"project": {...}}';
|
|
2553
|
+
var projectsIndexFullSelectionSet = "{ count currentPage totalPages data { id type attributes { name slug description status priority createdAt updatedAt startDate targetDate archivedAt memberId organizationId teamIds favorites { id memberId } resources { ...ResourceSummaryFull } } name slug description status priority createdAt updatedAt startDate targetDate archivedAt memberId organizationId teamIds emoji { id name memberId } backgroundImage { backgroundType gradientStart gradientEnd gradientDegrees color imageUrl image { url lowUrl } } favorites { id memberId } resources { ...ResourceSummaryFull } displayPreference { id type attributes viewType favorite groupingField groupToggleState memberId focusMemberId focusTeamId displayableId displayableType preferenceType agendaItemId } filterPreferences { id type attributes filterType filter memberId focusMemberId focusTeamId filterableId filterableType preferenceType agendaItemId } healthUpdates { id type attributes value memberId status createdAt updatedAt updatableType updatableId parentUpdateId emojis { id name memberId } resources { ...ResourceSummaryFull } replies { id type attributes value memberId createdAt updatedAt commentType commentableId commentableType parentCommentId emojis { id name memberId } resources { ...ResourceSummaryFull } replies { id type } } } } } fragment ResourceSummaryFull on ResourceSummary { id resourceType slug url skillId skill { id name slug emoji scope description } metadata { urlName imageUrl siteName providerName mediaType skillId skillName skillSlug skillScope skillEmoji skillDescription } attachment { id fileKey filename url } content { id name slug type firstChildSlug childCount } }";
|
|
2554
|
+
function asRecord2(value) {
|
|
2555
|
+
return value && typeof value === "object" ? value : null;
|
|
2556
|
+
}
|
|
2557
|
+
function toNonEmptyString(value) {
|
|
2558
|
+
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
2559
|
+
}
|
|
2560
|
+
function normalizeProjectRowForDisplay(row) {
|
|
2561
|
+
const record = asRecord2(row);
|
|
2562
|
+
if (!record) return row;
|
|
2563
|
+
const attributes = asRecord2(record.attributes);
|
|
2564
|
+
const topLevelName = toNonEmptyString(record.name);
|
|
2565
|
+
const topLevelTitle = toNonEmptyString(record.title);
|
|
2566
|
+
const attributeName = toNonEmptyString(attributes?.name);
|
|
2567
|
+
const attributeTitle = toNonEmptyString(attributes?.title);
|
|
2568
|
+
if (!topLevelName && !topLevelTitle && !attributeName && !attributeTitle) {
|
|
2569
|
+
return record;
|
|
2570
|
+
}
|
|
2571
|
+
return {
|
|
2572
|
+
...record,
|
|
2573
|
+
...topLevelName ? {} : attributeName ? { name: attributeName } : {},
|
|
2574
|
+
...topLevelTitle ? {} : attributeTitle ? { title: attributeTitle } : {}
|
|
2575
|
+
};
|
|
2576
|
+
}
|
|
2577
|
+
function normalizeProjectsListForDisplay(payload) {
|
|
2578
|
+
const record = asRecord2(payload);
|
|
2579
|
+
if (!record || !Array.isArray(record.data)) return payload;
|
|
2580
|
+
return {
|
|
2581
|
+
...record,
|
|
2582
|
+
data: record.data.map((row) => normalizeProjectRowForDisplay(row))
|
|
2583
|
+
};
|
|
2584
|
+
}
|
|
1986
2585
|
function registerProjectCommands(program) {
|
|
1987
2586
|
const projects = program.command("projects").description("Project operations");
|
|
1988
|
-
projects.command("list").option("--page <page>").option("--per <per>").option("--
|
|
2587
|
+
projects.command("list").option("--page <page>").option("--per <per>").option("--team-ids <teamIds>").option("--member-id <memberId>").action(async (opts, cmd) => {
|
|
1989
2588
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1990
2589
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1991
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1992
2590
|
await runGraphqlQueryCommand({
|
|
1993
2591
|
command: "projects.list",
|
|
2592
|
+
operationName: "ProjectsIndexFull",
|
|
1994
2593
|
runtimeOptions: context.runtimeOptions,
|
|
1995
2594
|
field: "projects",
|
|
1996
2595
|
variables: normalizeGraphqlVariables2({
|
|
1997
2596
|
organization_id: organizationId,
|
|
1998
2597
|
page: opts.page,
|
|
1999
2598
|
per: opts.per,
|
|
2000
|
-
include_archived: opts.includeArchived,
|
|
2001
|
-
status: opts.status,
|
|
2002
|
-
term: opts.term,
|
|
2003
2599
|
team_ids: opts.teamIds,
|
|
2004
|
-
member_id: opts.memberId
|
|
2005
|
-
...extra
|
|
2600
|
+
member_id: opts.memberId
|
|
2006
2601
|
}),
|
|
2602
|
+
variableTypes: {
|
|
2603
|
+
organization_id: "ID!",
|
|
2604
|
+
page: "Int",
|
|
2605
|
+
per: "Int",
|
|
2606
|
+
team_ids: "[ID!]",
|
|
2607
|
+
member_id: "ID"
|
|
2608
|
+
},
|
|
2007
2609
|
isList: true,
|
|
2008
|
-
selectionSet:
|
|
2610
|
+
selectionSet: projectsIndexFullSelectionSet,
|
|
2611
|
+
transformData: normalizeProjectsListForDisplay
|
|
2009
2612
|
});
|
|
2010
2613
|
});
|
|
2011
2614
|
projects.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
@@ -2021,7 +2624,8 @@ function registerProjectCommands(program) {
|
|
|
2021
2624
|
id
|
|
2022
2625
|
},
|
|
2023
2626
|
isShow: true,
|
|
2024
|
-
selectionSet: "{ id type }"
|
|
2627
|
+
selectionSet: "{ id type name }",
|
|
2628
|
+
transformData: normalizeProjectRowForDisplay
|
|
2025
2629
|
});
|
|
2026
2630
|
});
|
|
2027
2631
|
projects.command("create").requiredOption("--data-json <dataJson>", projectCreateDataJsonHelp).action(async (opts, cmd) => {
|
|
@@ -2070,11 +2674,10 @@ var createHelp = buildDataJsonHelp("rock", "create") ?? 'JSON object for rock or
|
|
|
2070
2674
|
var updateHelp = buildDataJsonHelp("rock", "update") ?? 'JSON object for rock or {"rock": {...}}';
|
|
2071
2675
|
function registerRockCommands(program) {
|
|
2072
2676
|
const rocks = program.command("rocks").description("Rock operations");
|
|
2073
|
-
rocks.command("list").option("--page <page>").option("--per <per>").option("--rock-collection-id <rockCollectionId>").option("--
|
|
2677
|
+
rocks.command("list").option("--page <page>").option("--per <per>").option("--rock-collection-id <rockCollectionId>").option("--start-date <startDate>").option("--rock-type <rockType>").option("--team-id <teamId>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--annual-objective-id <annualObjectiveId>").option("--quarterly-objective-id <quarterlyObjectiveId>").action(async (opts, cmd) => {
|
|
2074
2678
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2075
2679
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2076
2680
|
const rockCollectionId = opts.rockCollectionId ? rockCollectionIdSchema.parse(opts.rockCollectionId) : void 0;
|
|
2077
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2078
2681
|
await runGraphqlQueryCommand({
|
|
2079
2682
|
command: "rocks.list",
|
|
2080
2683
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2084,18 +2687,13 @@ function registerRockCommands(program) {
|
|
|
2084
2687
|
page: opts.page,
|
|
2085
2688
|
per: opts.per,
|
|
2086
2689
|
rock_collection_id: rockCollectionId,
|
|
2690
|
+
start_date: opts.startDate,
|
|
2691
|
+
rock_type: opts.rockType,
|
|
2087
2692
|
team_id: opts.teamId,
|
|
2088
|
-
team_ids: opts.teamIds,
|
|
2089
2693
|
member_id: opts.memberId,
|
|
2090
2694
|
meeting_id: opts.meetingId,
|
|
2091
2695
|
annual_objective_id: opts.annualObjectiveId,
|
|
2092
|
-
quarterly_objective_id: opts.quarterlyObjectiveId
|
|
2093
|
-
field_name: opts.fieldName,
|
|
2094
|
-
field_value: opts.fieldValue,
|
|
2095
|
-
field_blank: opts.fieldBlank,
|
|
2096
|
-
rank_direction: opts.rankDirection,
|
|
2097
|
-
include_archived: opts.includeArchived,
|
|
2098
|
-
...extra
|
|
2696
|
+
quarterly_objective_id: opts.quarterlyObjectiveId
|
|
2099
2697
|
}),
|
|
2100
2698
|
isList: true
|
|
2101
2699
|
});
|
|
@@ -2306,24 +2904,23 @@ function normalizeMeetingCreateBody(body) {
|
|
|
2306
2904
|
}
|
|
2307
2905
|
function registerMeetingCommands(program) {
|
|
2308
2906
|
const meetings = program.command("meetings").description("Meeting operations");
|
|
2309
|
-
meetings.command("list").option("--per <per>").option("--date <date>").option("--occurrence-date <occurrenceDate>").option("--past <past>").option("--start-time <startTime>").option("--today-and-active <todayAndActive>").option("--
|
|
2907
|
+
meetings.command("list").option("--page <page>").option("--per <per>").option("--date <date>").option("--occurrence-date <occurrenceDate>").option("--past <past>").option("--start-time <startTime>").option("--today-and-active <todayAndActive>").option("--type <type>").action(async (opts, cmd) => {
|
|
2310
2908
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2311
2909
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2312
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2313
2910
|
await runGraphqlQueryCommand({
|
|
2314
2911
|
command: "meetings.list",
|
|
2315
2912
|
runtimeOptions: context.runtimeOptions,
|
|
2316
2913
|
field: "meetings",
|
|
2317
2914
|
variables: normalizeGraphqlVariables2({
|
|
2318
2915
|
organization_id: organizationId,
|
|
2916
|
+
page: opts.page,
|
|
2319
2917
|
per: opts.per,
|
|
2320
2918
|
date: opts.date,
|
|
2321
2919
|
occurrence_date: opts.occurrenceDate,
|
|
2322
2920
|
past: opts.past,
|
|
2323
2921
|
start_time: opts.startTime,
|
|
2324
2922
|
today_and_active: opts.todayAndActive,
|
|
2325
|
-
|
|
2326
|
-
...extra
|
|
2923
|
+
type: opts.type
|
|
2327
2924
|
}),
|
|
2328
2925
|
isList: true
|
|
2329
2926
|
});
|
|
@@ -2403,10 +3000,9 @@ var createHelp3 = buildDataJsonHelp("member", "create") ?? 'JSON object for memb
|
|
|
2403
3000
|
var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for member or {"member": {...}}';
|
|
2404
3001
|
function registerMemberCommands(program) {
|
|
2405
3002
|
const members = program.command("members").description("Member operations");
|
|
2406
|
-
members.command("list").option("--page <page>").option("--per <per>").
|
|
3003
|
+
members.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
2407
3004
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2408
3005
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2409
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2410
3006
|
await runGraphqlQueryCommand({
|
|
2411
3007
|
command: "members.list",
|
|
2412
3008
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2414,8 +3010,7 @@ function registerMemberCommands(program) {
|
|
|
2414
3010
|
variables: normalizeGraphqlVariables2({
|
|
2415
3011
|
organization_id: organizationId,
|
|
2416
3012
|
page: opts.page,
|
|
2417
|
-
per: opts.per
|
|
2418
|
-
...extra
|
|
3013
|
+
per: opts.per
|
|
2419
3014
|
}),
|
|
2420
3015
|
isList: true
|
|
2421
3016
|
});
|
|
@@ -2478,10 +3073,9 @@ var issueTypeSchema = z8.string().min(1).refine((value) => value === "short_term
|
|
|
2478
3073
|
var updateHelp4 = buildDataJsonHelp("issue", "update") ?? 'JSON object for issue or {"issue": {...}}';
|
|
2479
3074
|
function registerIssueCommands(program) {
|
|
2480
3075
|
const issues = program.command("issues").description("Issue operations");
|
|
2481
|
-
issues.command("list").option("--page <page>").option("--per <per>").option("--issue-group-id <issueGroupId>").option("--
|
|
3076
|
+
issues.command("list").option("--page <page>").option("--per <per>").option("--issue-group-id <issueGroupId>").option("--start-date <startDate>").option("--issue-type <issueType>").option("--team-id <teamId>").option("--member-id <memberId>").option("--meeting-id <meetingId>").action(async (opts, cmd) => {
|
|
2482
3077
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2483
3078
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2484
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2485
3079
|
await runGraphqlQueryCommand({
|
|
2486
3080
|
command: "issues.list",
|
|
2487
3081
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2491,13 +3085,11 @@ function registerIssueCommands(program) {
|
|
|
2491
3085
|
page: opts.page,
|
|
2492
3086
|
per: opts.per,
|
|
2493
3087
|
issue_group_id: opts.issueGroupId,
|
|
3088
|
+
start_date: opts.startDate,
|
|
3089
|
+
issue_type: opts.issueType,
|
|
2494
3090
|
team_id: opts.teamId,
|
|
2495
|
-
team_ids: opts.teamIds,
|
|
2496
3091
|
member_id: opts.memberId,
|
|
2497
|
-
meeting_id: opts.meetingId
|
|
2498
|
-
rank_direction: opts.rankDirection,
|
|
2499
|
-
include_archived: opts.includeArchived,
|
|
2500
|
-
...extra
|
|
3092
|
+
meeting_id: opts.meetingId
|
|
2501
3093
|
}),
|
|
2502
3094
|
isList: true
|
|
2503
3095
|
});
|
|
@@ -2764,12 +3356,12 @@ var SCORECARD_INTERVALS = /* @__PURE__ */ new Set([
|
|
|
2764
3356
|
"yearly"
|
|
2765
3357
|
]);
|
|
2766
3358
|
var SCORECARD_TRENDS = /* @__PURE__ */ new Set(["average", "total"]);
|
|
2767
|
-
function
|
|
3359
|
+
function isRecord2(value) {
|
|
2768
3360
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2769
3361
|
}
|
|
2770
3362
|
function ensureEntityObject(body, rootKey) {
|
|
2771
3363
|
const entity = body[rootKey];
|
|
2772
|
-
if (!
|
|
3364
|
+
if (!isRecord2(entity)) {
|
|
2773
3365
|
throw new CliError({
|
|
2774
3366
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
2775
3367
|
kind: "invalid_args",
|
|
@@ -3215,7 +3807,9 @@ function registerSystemToolCommands(program) {
|
|
|
3215
3807
|
description: "List operations",
|
|
3216
3808
|
resourcePath: "lists",
|
|
3217
3809
|
rootKey: "list",
|
|
3218
|
-
listParams: ["
|
|
3810
|
+
listParams: ["member_id", "team_ids"],
|
|
3811
|
+
showParams: ["current_member_id"],
|
|
3812
|
+
allowQueryJson: false
|
|
3219
3813
|
});
|
|
3220
3814
|
registerEntityCrudCommands(program, {
|
|
3221
3815
|
command: "list-items",
|
|
@@ -3223,32 +3817,26 @@ function registerSystemToolCommands(program) {
|
|
|
3223
3817
|
resourcePath: "list_items",
|
|
3224
3818
|
rootKey: "list_item",
|
|
3225
3819
|
requiredCreateFields: ["list_id"],
|
|
3226
|
-
listParams: [
|
|
3227
|
-
|
|
3228
|
-
"field_name",
|
|
3229
|
-
"field_value",
|
|
3230
|
-
"include_archived",
|
|
3231
|
-
"list_id",
|
|
3232
|
-
"meeting_id",
|
|
3233
|
-
"member_id",
|
|
3234
|
-
"rank_direction",
|
|
3235
|
-
"team_id",
|
|
3236
|
-
"team_ids"
|
|
3237
|
-
]
|
|
3820
|
+
listParams: ["list_id", "meeting_id", "open", "team_id", "member_id", "include_archived"],
|
|
3821
|
+
allowQueryJson: false
|
|
3238
3822
|
});
|
|
3239
3823
|
registerEntityCrudCommands(program, {
|
|
3240
3824
|
command: "issue-groups",
|
|
3241
3825
|
description: "Issue group operations",
|
|
3242
3826
|
resourcePath: "issue_groups",
|
|
3243
3827
|
rootKey: "issue_group",
|
|
3244
|
-
listParams: ["
|
|
3828
|
+
listParams: ["member_id", "team_ids"],
|
|
3829
|
+
showParams: ["current_member_id"],
|
|
3830
|
+
allowQueryJson: false
|
|
3245
3831
|
});
|
|
3246
3832
|
registerEntityCrudCommands(program, {
|
|
3247
3833
|
command: "todo-groups",
|
|
3248
3834
|
description: "To-do group operations",
|
|
3249
3835
|
resourcePath: "todo_groups",
|
|
3250
3836
|
rootKey: "todo_group",
|
|
3251
|
-
listParams: ["
|
|
3837
|
+
listParams: ["member_id", "team_ids"],
|
|
3838
|
+
showParams: ["current_member_id"],
|
|
3839
|
+
allowQueryJson: false
|
|
3252
3840
|
});
|
|
3253
3841
|
registerEntityCrudCommands(program, {
|
|
3254
3842
|
command: "todos",
|
|
@@ -3257,22 +3845,17 @@ function registerSystemToolCommands(program) {
|
|
|
3257
3845
|
rootKey: "todo",
|
|
3258
3846
|
requiredCreateFields: ["todo_group_id"],
|
|
3259
3847
|
normalizeCreateBody: normalizeTodosCreateBody,
|
|
3260
|
-
listParams: [
|
|
3261
|
-
|
|
3262
|
-
"meeting_id",
|
|
3263
|
-
"member_id",
|
|
3264
|
-
"rank_direction",
|
|
3265
|
-
"team_id",
|
|
3266
|
-
"team_ids",
|
|
3267
|
-
"todo_group_id"
|
|
3268
|
-
]
|
|
3848
|
+
listParams: ["todo_group_id", "start_date", "team_id", "member_id"],
|
|
3849
|
+
allowQueryJson: false
|
|
3269
3850
|
});
|
|
3270
3851
|
registerEntityCrudCommands(program, {
|
|
3271
3852
|
command: "rock-collections",
|
|
3272
3853
|
description: "Rock collection operations",
|
|
3273
3854
|
resourcePath: "rock_collections",
|
|
3274
3855
|
rootKey: "rock_collection",
|
|
3275
|
-
listParams: ["
|
|
3856
|
+
listParams: ["member_id", "team_ids"],
|
|
3857
|
+
showParams: ["current_member_id"],
|
|
3858
|
+
allowQueryJson: false
|
|
3276
3859
|
});
|
|
3277
3860
|
registerEntityCrudCommands(program, {
|
|
3278
3861
|
command: "knowledge",
|
|
@@ -3283,13 +3866,21 @@ function registerSystemToolCommands(program) {
|
|
|
3283
3866
|
listParams: [
|
|
3284
3867
|
"assigned",
|
|
3285
3868
|
"contentable_id",
|
|
3869
|
+
"contentable_ids",
|
|
3870
|
+
"content_type",
|
|
3286
3871
|
"contentable_type",
|
|
3287
|
-
"
|
|
3288
|
-
"
|
|
3872
|
+
"focus_member_id",
|
|
3873
|
+
"focus_team_id",
|
|
3289
3874
|
"member_id",
|
|
3290
3875
|
"parent_content_id",
|
|
3291
|
-
"
|
|
3292
|
-
|
|
3876
|
+
"sort",
|
|
3877
|
+
"status",
|
|
3878
|
+
"team_id",
|
|
3879
|
+
"term",
|
|
3880
|
+
"type"
|
|
3881
|
+
],
|
|
3882
|
+
showParams: ["include_all_rollups"],
|
|
3883
|
+
allowQueryJson: false
|
|
3293
3884
|
});
|
|
3294
3885
|
registerEntityCrudCommands(program, {
|
|
3295
3886
|
command: "stand-ups",
|
|
@@ -3302,8 +3893,10 @@ function registerSystemToolCommands(program) {
|
|
|
3302
3893
|
"date",
|
|
3303
3894
|
"end_date",
|
|
3304
3895
|
"start_date",
|
|
3896
|
+
"team_id",
|
|
3305
3897
|
"use_week_range"
|
|
3306
|
-
]
|
|
3898
|
+
],
|
|
3899
|
+
allowQueryJson: false
|
|
3307
3900
|
});
|
|
3308
3901
|
registerEntityCrudCommands(program, {
|
|
3309
3902
|
command: "news",
|
|
@@ -3312,7 +3905,8 @@ function registerSystemToolCommands(program) {
|
|
|
3312
3905
|
rootKey: "headline",
|
|
3313
3906
|
requiredCreateFields: ["member_id", "status", "headline_type"],
|
|
3314
3907
|
normalizeCreateBody: normalizeNewsCreateBody,
|
|
3315
|
-
listParams: ["meeting_id", "unread"],
|
|
3908
|
+
listParams: ["meeting_id", "team_id", "unread"],
|
|
3909
|
+
allowQueryJson: false,
|
|
3316
3910
|
showQueryFactory: ({ id, organizationId }) => ({
|
|
3317
3911
|
field: "headlines",
|
|
3318
3912
|
variables: {
|
|
@@ -3320,7 +3914,7 @@ function registerSystemToolCommands(program) {
|
|
|
3320
3914
|
page: 1,
|
|
3321
3915
|
per: 200
|
|
3322
3916
|
},
|
|
3323
|
-
selectionSet: "{ data { id type attributes } count currentPage totalPages }",
|
|
3917
|
+
selectionSet: "{ data { id type slug summary description memberId status rank createdAt updatedAt headlineType teamIds meetingId labelIds attributes } count currentPage totalPages }",
|
|
3324
3918
|
transformData: (value) => {
|
|
3325
3919
|
if (!value || typeof value !== "object") {
|
|
3326
3920
|
return null;
|
|
@@ -3344,16 +3938,20 @@ function registerSystemToolCommands(program) {
|
|
|
3344
3938
|
requiredCreateFields: ["member_id", "name"],
|
|
3345
3939
|
normalizeCreateBody: normalizeQuestionsCreateBody,
|
|
3346
3940
|
normalizeUpdateBody: normalizeQuestionsUpdateBody,
|
|
3347
|
-
listParams: ["answered", "asked",
|
|
3941
|
+
listParams: ["answered", "asked"],
|
|
3942
|
+
allowQueryJson: false
|
|
3348
3943
|
});
|
|
3349
3944
|
registerEntityCrudCommands(program, {
|
|
3350
3945
|
command: "pulse",
|
|
3351
3946
|
description: "Pulse operations",
|
|
3352
3947
|
resourcePath: "health_updates",
|
|
3353
3948
|
rootKey: "health_update",
|
|
3949
|
+
listField: "feedbacks",
|
|
3950
|
+
showField: "feedback",
|
|
3354
3951
|
requiredCreateFields: ["health_updatable_id", "health_updatable_type", "member_id", "status"],
|
|
3355
3952
|
normalizeCreateBody: normalizePulseCreateBody,
|
|
3356
|
-
listParams: ["
|
|
3953
|
+
listParams: ["last", "latest", "start_date", "name", "quarter", "year"],
|
|
3954
|
+
allowQueryJson: false
|
|
3357
3955
|
});
|
|
3358
3956
|
registerEntityCrudCommands(program, {
|
|
3359
3957
|
command: "surveys",
|
|
@@ -3363,7 +3961,8 @@ function registerSystemToolCommands(program) {
|
|
|
3363
3961
|
requiredCreateFields: ["name", "recipient_type"],
|
|
3364
3962
|
normalizeCreateBody: normalizeSurveysCreateBody,
|
|
3365
3963
|
normalizeUpdateBody: normalizeSurveysUpdateBody,
|
|
3366
|
-
listParams: ["completed", "current_member", "due", "exclude_completed"]
|
|
3964
|
+
listParams: ["completed", "current_member", "due", "exclude_completed", "sent"],
|
|
3965
|
+
allowQueryJson: false
|
|
3367
3966
|
});
|
|
3368
3967
|
registerEntityCrudCommands(program, {
|
|
3369
3968
|
command: "feedbacks",
|
|
@@ -3373,7 +3972,8 @@ function registerSystemToolCommands(program) {
|
|
|
3373
3972
|
requiredCreateFields: ["name", "quarter", "year"],
|
|
3374
3973
|
normalizeCreateBody: normalizeFeedbacksCreateBody,
|
|
3375
3974
|
normalizeUpdateBody: normalizeFeedbacksUpdateBody,
|
|
3376
|
-
listParams: ["last", "latest", "start_date"]
|
|
3975
|
+
listParams: ["last", "latest", "start_date"],
|
|
3976
|
+
allowQueryJson: false
|
|
3377
3977
|
});
|
|
3378
3978
|
registerEntityCrudCommands(program, {
|
|
3379
3979
|
command: "accountability",
|
|
@@ -3383,7 +3983,8 @@ function registerSystemToolCommands(program) {
|
|
|
3383
3983
|
requiredCreateFields: ["name", "member_id"],
|
|
3384
3984
|
normalizeCreateBody: normalizeAccountabilityCreateBody,
|
|
3385
3985
|
normalizeUpdateBody: normalizeAccountabilityUpdateBody,
|
|
3386
|
-
listParams: [
|
|
3986
|
+
listParams: [],
|
|
3987
|
+
allowQueryJson: false
|
|
3387
3988
|
});
|
|
3388
3989
|
registerEntityCrudCommands(program, {
|
|
3389
3990
|
command: "kpis",
|
|
@@ -3394,24 +3995,16 @@ function registerSystemToolCommands(program) {
|
|
|
3394
3995
|
body,
|
|
3395
3996
|
organizationId
|
|
3396
3997
|
}),
|
|
3397
|
-
listParams: [
|
|
3398
|
-
|
|
3399
|
-
"include_archived",
|
|
3400
|
-
"interval",
|
|
3401
|
-
"meeting_id",
|
|
3402
|
-
"member_id",
|
|
3403
|
-
"quarterly_objective_id",
|
|
3404
|
-
"smart_kpi_view_id",
|
|
3405
|
-
"team_id",
|
|
3406
|
-
"team_ids"
|
|
3407
|
-
]
|
|
3998
|
+
listParams: ["team_id", "member_id", "smart_kpi_view_id", "quarterly_objective_id"],
|
|
3999
|
+
allowQueryJson: false
|
|
3408
4000
|
});
|
|
3409
4001
|
registerEntityCrudCommands(program, {
|
|
3410
4002
|
command: "scorecard-groups",
|
|
3411
4003
|
description: "Scorecard group operations",
|
|
3412
4004
|
resourcePath: "measurable_groups",
|
|
3413
4005
|
rootKey: "measurable_group",
|
|
3414
|
-
listParams: ["include_archived", "member_id", "name", "sort", "team_ids", "term"]
|
|
4006
|
+
listParams: ["include_archived", "member_id", "name", "sort", "team_ids", "term"],
|
|
4007
|
+
allowQueryJson: false
|
|
3415
4008
|
});
|
|
3416
4009
|
registerEntityCrudCommands(program, {
|
|
3417
4010
|
command: "scorecards",
|
|
@@ -3431,21 +4024,24 @@ function registerSystemToolCommands(program) {
|
|
|
3431
4024
|
"sort",
|
|
3432
4025
|
"team_id",
|
|
3433
4026
|
"team_ids"
|
|
3434
|
-
]
|
|
4027
|
+
],
|
|
4028
|
+
allowQueryJson: false
|
|
3435
4029
|
});
|
|
3436
4030
|
registerEntityCrudCommands(program, {
|
|
3437
4031
|
command: "customers",
|
|
3438
4032
|
description: "CRM customer operations",
|
|
3439
4033
|
resourcePath: "customers",
|
|
3440
4034
|
rootKey: "customer",
|
|
3441
|
-
listParams: ["
|
|
4035
|
+
listParams: ["project_id", "meeting_id", "open", "team_id", "member_id"],
|
|
4036
|
+
allowQueryJson: false
|
|
3442
4037
|
});
|
|
3443
4038
|
registerEntityCrudCommands(program, {
|
|
3444
4039
|
command: "contacts",
|
|
3445
4040
|
description: "CRM contact operations",
|
|
3446
4041
|
resourcePath: "contacts",
|
|
3447
4042
|
rootKey: "contact",
|
|
3448
|
-
listParams: ["customer_id", "member_id",
|
|
4043
|
+
listParams: ["customer_id", "member_id"],
|
|
4044
|
+
allowQueryJson: false
|
|
3449
4045
|
});
|
|
3450
4046
|
}
|
|
3451
4047
|
|
|
@@ -3454,10 +4050,9 @@ import { z as z9 } from "zod";
|
|
|
3454
4050
|
var idSchema8 = z9.string().min(1);
|
|
3455
4051
|
function registerTeamCommands(program) {
|
|
3456
4052
|
const teams = program.command("teams").description("Team operations");
|
|
3457
|
-
teams.command("list").option("--page <page>").option("--per <per>").
|
|
4053
|
+
teams.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
3458
4054
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3459
4055
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3460
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
3461
4056
|
await runGraphqlQueryCommand({
|
|
3462
4057
|
command: "teams.list",
|
|
3463
4058
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -3465,8 +4060,7 @@ function registerTeamCommands(program) {
|
|
|
3465
4060
|
variables: normalizeGraphqlVariables2({
|
|
3466
4061
|
organization_id: organizationId,
|
|
3467
4062
|
page: opts.page,
|
|
3468
|
-
per: opts.per
|
|
3469
|
-
...extra
|
|
4063
|
+
per: opts.per
|
|
3470
4064
|
}),
|
|
3471
4065
|
isList: true
|
|
3472
4066
|
});
|
|
@@ -3521,12 +4115,12 @@ function registerTeamCommands(program) {
|
|
|
3521
4115
|
// src/commands/organizations.ts
|
|
3522
4116
|
import { z as z10 } from "zod";
|
|
3523
4117
|
var idSchema9 = z10.string().min(1);
|
|
3524
|
-
function
|
|
4118
|
+
function isRecord3(value) {
|
|
3525
4119
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3526
4120
|
}
|
|
3527
4121
|
function ensureRootObject(body, rootKey) {
|
|
3528
4122
|
const root = body[rootKey];
|
|
3529
|
-
if (!
|
|
4123
|
+
if (!isRecord3(root)) {
|
|
3530
4124
|
throw new CliError({
|
|
3531
4125
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
3532
4126
|
kind: "invalid_args",
|
|
@@ -3545,7 +4139,7 @@ function asNonEmptyString4(value) {
|
|
|
3545
4139
|
}
|
|
3546
4140
|
function normalizeOrganizationUpdateBody(body) {
|
|
3547
4141
|
const organization = ensureRootObject(body, "organization");
|
|
3548
|
-
const detail =
|
|
4142
|
+
const detail = isRecord3(organization.organization_detail_attributes) ? { ...organization.organization_detail_attributes } : {};
|
|
3549
4143
|
const workspaceName = asNonEmptyString4(organization.workspace_name);
|
|
3550
4144
|
if (workspaceName) {
|
|
3551
4145
|
detail.workspace_name = workspaceName;
|
|
@@ -3558,10 +4152,10 @@ function normalizeOrganizationUpdateBody(body) {
|
|
|
3558
4152
|
}
|
|
3559
4153
|
function normalizeOrganizationMetaProfileUpdateBody(body) {
|
|
3560
4154
|
const root = ensureRootObject(body, "organization_meta_profile");
|
|
3561
|
-
const profile =
|
|
4155
|
+
const profile = isRecord3(root.profile) ? { ...root.profile } : {};
|
|
3562
4156
|
const title = asNonEmptyString4(root.title);
|
|
3563
4157
|
if (title) {
|
|
3564
|
-
const companyIdentity =
|
|
4158
|
+
const companyIdentity = isRecord3(profile.company_identity) ? { ...profile.company_identity } : {};
|
|
3565
4159
|
companyIdentity.one_sentence_summary = title;
|
|
3566
4160
|
profile.company_identity = companyIdentity;
|
|
3567
4161
|
}
|
|
@@ -3588,10 +4182,10 @@ function normalizeOrganizationMetaProfileUpdateBody(body) {
|
|
|
3588
4182
|
}
|
|
3589
4183
|
function normalizeKeyMetricMetaProfileUpdateBody(body) {
|
|
3590
4184
|
const root = ensureRootObject(body, "key_metric_meta_profile");
|
|
3591
|
-
const profile =
|
|
4185
|
+
const profile = isRecord3(root.profile) ? { ...root.profile } : {};
|
|
3592
4186
|
const annualRevenue = asNonEmptyString4(root.annual_revenue);
|
|
3593
4187
|
if (annualRevenue) {
|
|
3594
|
-
const financial =
|
|
4188
|
+
const financial = isRecord3(profile.financial) ? { ...profile.financial } : {};
|
|
3595
4189
|
financial.revenue = annualRevenue;
|
|
3596
4190
|
profile.financial = financial;
|
|
3597
4191
|
}
|
|
@@ -3745,12 +4339,12 @@ var STRATEGIC_OBJECTIVE_ALLOWED_UPDATE_KEYS = /* @__PURE__ */ new Set([
|
|
|
3745
4339
|
"published_at",
|
|
3746
4340
|
"strategic_objective_reads_attributes"
|
|
3747
4341
|
]);
|
|
3748
|
-
function
|
|
4342
|
+
function isRecord4(value) {
|
|
3749
4343
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3750
4344
|
}
|
|
3751
4345
|
function ensureRootObject2(body, rootKey) {
|
|
3752
4346
|
const root = body[rootKey];
|
|
3753
|
-
if (!
|
|
4347
|
+
if (!isRecord4(root)) {
|
|
3754
4348
|
throw new CliError({
|
|
3755
4349
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
3756
4350
|
kind: "invalid_args",
|
|
@@ -3918,7 +4512,8 @@ function registerFoundationCommands(program) {
|
|
|
3918
4512
|
rootKey: "annual_objective",
|
|
3919
4513
|
requiredCreateFields: ["strategic_objective_id", "name"],
|
|
3920
4514
|
normalizeCreateBody: normalizeAnnualObjectiveCreateBody,
|
|
3921
|
-
listParams: []
|
|
4515
|
+
listParams: [],
|
|
4516
|
+
allowQueryJson: false
|
|
3922
4517
|
});
|
|
3923
4518
|
registerEntityCrudCommands(foundation, {
|
|
3924
4519
|
command: "quarterly-objectives",
|
|
@@ -3927,7 +4522,8 @@ function registerFoundationCommands(program) {
|
|
|
3927
4522
|
rootKey: "quarterly_objective",
|
|
3928
4523
|
requiredCreateFields: ["strategic_objective_id", "annual_objective_id", "name"],
|
|
3929
4524
|
normalizeCreateBody: normalizeQuarterlyObjectiveCreateBody,
|
|
3930
|
-
listParams: [
|
|
4525
|
+
listParams: [],
|
|
4526
|
+
allowQueryJson: false
|
|
3931
4527
|
});
|
|
3932
4528
|
}
|
|
3933
4529
|
|
|
@@ -4285,7 +4881,7 @@ function registerNoteCommands(program) {
|
|
|
4285
4881
|
per: opts.per
|
|
4286
4882
|
}),
|
|
4287
4883
|
isList: true,
|
|
4288
|
-
selectionSet: "{ count currentPage totalPages data { id type name
|
|
4884
|
+
selectionSet: "{ count currentPage totalPages data { id type name slug firstChildSlug rootParentSlug status contentType lastEdited organizationId memberId focusMemberId focusTeamId teamId creatorId createdAt updatedAt childCount assignmentType contentableId contentableSlug contentableType votesTotal labelIds rootContentId parentContentId attributes } }"
|
|
4289
4885
|
});
|
|
4290
4886
|
});
|
|
4291
4887
|
notes.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
@@ -4302,7 +4898,7 @@ function registerNoteCommands(program) {
|
|
|
4302
4898
|
id
|
|
4303
4899
|
}),
|
|
4304
4900
|
isShow: true,
|
|
4305
|
-
selectionSet: "{ id type name
|
|
4901
|
+
selectionSet: "{ id type name slug firstChildSlug rootParentSlug status contentType lastEdited organizationId memberId focusMemberId focusTeamId teamId creatorId createdAt updatedAt childCount assignmentType contentableId contentableSlug contentableType votesTotal labelIds rootContentId parentContentId attributes }"
|
|
4306
4902
|
});
|
|
4307
4903
|
});
|
|
4308
4904
|
notes.command("update").requiredOption("--id <id>").option("--name <name>").option("--body <body>").option("--status <status>").action(async (opts, cmd) => {
|
|
@@ -4588,7 +5184,7 @@ import { z as z15 } from "zod";
|
|
|
4588
5184
|
|
|
4589
5185
|
// src/internalOptions.ts
|
|
4590
5186
|
var INTERNAL_OPTIONS_KEY = "__waveInternalOptions";
|
|
4591
|
-
function
|
|
5187
|
+
function asRecord3(value) {
|
|
4592
5188
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
4593
5189
|
return null;
|
|
4594
5190
|
}
|
|
@@ -4602,7 +5198,7 @@ function setInternalCliOptions(program, options) {
|
|
|
4602
5198
|
function getInternalCliOptions(command) {
|
|
4603
5199
|
let current = command;
|
|
4604
5200
|
while (current) {
|
|
4605
|
-
const record =
|
|
5201
|
+
const record = asRecord3(current[INTERNAL_OPTIONS_KEY]);
|
|
4606
5202
|
if (record) {
|
|
4607
5203
|
return {
|
|
4608
5204
|
enableRetryOnEmptyPhrase: record.enableRetryOnEmptyPhrase === true
|