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