@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.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,50 @@ 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
|
+
if (isList) {
|
|
1247
|
+
return "{ data { id type attributes } count currentPage totalPages }";
|
|
1248
|
+
}
|
|
1249
|
+
const fields = Array.from(/* @__PURE__ */ new Set(["id", "type", ...explicitFields, "attributes"])).join(" ");
|
|
1250
|
+
return `{ ${fields} }`;
|
|
1251
|
+
}
|
|
737
1252
|
if (isList) {
|
|
738
1253
|
return "{ data { id type attributes } count currentPage totalPages }";
|
|
739
1254
|
}
|
|
740
1255
|
return "{ id type attributes }";
|
|
741
1256
|
}
|
|
1257
|
+
function isRecord(value) {
|
|
1258
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
1259
|
+
}
|
|
1260
|
+
function normalizeDisplayFieldsInRow(row) {
|
|
1261
|
+
if (!isRecord(row)) return row;
|
|
1262
|
+
const attributes = isRecord(row.attributes) ? row.attributes : null;
|
|
1263
|
+
if (!attributes) return row;
|
|
1264
|
+
const normalized = { ...row };
|
|
1265
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
1266
|
+
if (!Object.prototype.hasOwnProperty.call(normalized, key)) {
|
|
1267
|
+
normalized[key] = value;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
return normalized;
|
|
1271
|
+
}
|
|
1272
|
+
function normalizeQueryFieldPayloadForDisplay(fieldPayload) {
|
|
1273
|
+
if (Array.isArray(fieldPayload)) {
|
|
1274
|
+
return fieldPayload.map((row) => normalizeDisplayFieldsInRow(row));
|
|
1275
|
+
}
|
|
1276
|
+
if (!isRecord(fieldPayload)) {
|
|
1277
|
+
return fieldPayload;
|
|
1278
|
+
}
|
|
1279
|
+
if (Array.isArray(fieldPayload.data)) {
|
|
1280
|
+
return {
|
|
1281
|
+
...fieldPayload,
|
|
1282
|
+
data: fieldPayload.data.map((row) => normalizeDisplayFieldsInRow(row))
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
return normalizeDisplayFieldsInRow(fieldPayload);
|
|
1286
|
+
}
|
|
742
1287
|
function parseBooleanMaybe(value) {
|
|
743
1288
|
const lowered = value.toLowerCase();
|
|
744
1289
|
if (lowered === "true") {
|
|
@@ -799,6 +1344,11 @@ async function runGraphqlQueryCommand(input) {
|
|
|
799
1344
|
selectionSet: input.selectionSet ?? defaultQuerySelectionSet(input.field, Boolean(input.isList)),
|
|
800
1345
|
isShow: input.isShow
|
|
801
1346
|
});
|
|
1347
|
+
const envelopeData = result.envelope.data;
|
|
1348
|
+
if (result.envelope.ok && envelopeData && Object.prototype.hasOwnProperty.call(envelopeData, input.field)) {
|
|
1349
|
+
envelopeData[input.field] = normalizeQueryFieldPayloadForDisplay(envelopeData[input.field]);
|
|
1350
|
+
result.envelope.data = envelopeData;
|
|
1351
|
+
}
|
|
802
1352
|
if (result.envelope.ok && input.transformData && result.envelope.data) {
|
|
803
1353
|
const dataRecord = result.envelope.data;
|
|
804
1354
|
const transformed = input.transformData(dataRecord[input.field]);
|
|
@@ -1094,8 +1644,114 @@ function resolveOrganizationId(raw) {
|
|
|
1094
1644
|
return organizationId;
|
|
1095
1645
|
}
|
|
1096
1646
|
|
|
1647
|
+
// src/commands/tasks.ts
|
|
1648
|
+
var projectIdSchema = z2.string().min(1);
|
|
1649
|
+
var idSchema = z2.string().min(1);
|
|
1650
|
+
var summarySchema = z2.string().min(1);
|
|
1651
|
+
function registerTaskCommands(program) {
|
|
1652
|
+
const tasks = program.command("tasks").description("Task operations");
|
|
1653
|
+
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) => {
|
|
1654
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1655
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1656
|
+
const projectId = opts.projectId ? projectIdSchema.parse(opts.projectId) : void 0;
|
|
1657
|
+
await runGraphqlQueryCommand({
|
|
1658
|
+
command: "tasks.list",
|
|
1659
|
+
runtimeOptions: context.runtimeOptions,
|
|
1660
|
+
field: "tasks",
|
|
1661
|
+
variables: normalizeGraphqlVariables2({
|
|
1662
|
+
organization_id: organizationId,
|
|
1663
|
+
page: opts.page,
|
|
1664
|
+
per: opts.per,
|
|
1665
|
+
project_id: projectId,
|
|
1666
|
+
team_id: opts.teamId,
|
|
1667
|
+
team_ids: opts.teamIds,
|
|
1668
|
+
member_id: opts.memberId,
|
|
1669
|
+
meeting_id: opts.meetingId,
|
|
1670
|
+
field_name: opts.fieldName,
|
|
1671
|
+
field_value: opts.fieldValue,
|
|
1672
|
+
field_blank: opts.fieldBlank,
|
|
1673
|
+
open: opts.open,
|
|
1674
|
+
rank_direction: opts.rankDirection,
|
|
1675
|
+
include_archived: opts.includeArchived
|
|
1676
|
+
}),
|
|
1677
|
+
isList: true
|
|
1678
|
+
});
|
|
1679
|
+
});
|
|
1680
|
+
tasks.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1681
|
+
const parsed = idSchema.parse(opts.id);
|
|
1682
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1683
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1684
|
+
await runGraphqlQueryCommand({
|
|
1685
|
+
command: "tasks.show",
|
|
1686
|
+
runtimeOptions: context.runtimeOptions,
|
|
1687
|
+
field: "task",
|
|
1688
|
+
variables: {
|
|
1689
|
+
organization_id: organizationId,
|
|
1690
|
+
id: parsed
|
|
1691
|
+
},
|
|
1692
|
+
isShow: true
|
|
1693
|
+
});
|
|
1694
|
+
});
|
|
1695
|
+
tasks.command("create").requiredOption("--project-id <projectId>").option("--title <title>", "Legacy alias for --summary").option("--summary <summary>").action(async (opts, cmd) => {
|
|
1696
|
+
const projectId = projectIdSchema.parse(opts.projectId);
|
|
1697
|
+
const summary = summarySchema.parse(opts.summary ?? opts.title);
|
|
1698
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1699
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1700
|
+
await runGraphqlMutationCommand({
|
|
1701
|
+
command: "tasks.create",
|
|
1702
|
+
runtimeOptions: context.runtimeOptions,
|
|
1703
|
+
field: "create_task",
|
|
1704
|
+
variables: {
|
|
1705
|
+
organization_id: organizationId,
|
|
1706
|
+
params: {
|
|
1707
|
+
task: {
|
|
1708
|
+
project_id: projectId,
|
|
1709
|
+
summary
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
});
|
|
1714
|
+
});
|
|
1715
|
+
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) => {
|
|
1716
|
+
const id = idSchema.parse(opts.id);
|
|
1717
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1718
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1719
|
+
const taskPayload = {
|
|
1720
|
+
...opts.summary ? { summary: String(opts.summary) } : {},
|
|
1721
|
+
...opts.description ? { description: String(opts.description) } : {},
|
|
1722
|
+
...opts.status ? { status: String(opts.status) } : {},
|
|
1723
|
+
...opts.priority ? { priority: String(opts.priority) } : {},
|
|
1724
|
+
...opts.dueDate ? { due_date: String(opts.dueDate) } : {},
|
|
1725
|
+
...opts.memberId ? { member_id: String(opts.memberId) } : {}
|
|
1726
|
+
};
|
|
1727
|
+
if (Object.keys(taskPayload).length === 0) {
|
|
1728
|
+
throw new CliError({
|
|
1729
|
+
message: "tasks update requires at least one patch field (summary, description, status, priority, due-date, member-id).",
|
|
1730
|
+
kind: "invalid_args",
|
|
1731
|
+
status: 400,
|
|
1732
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1735
|
+
await runGraphqlMutationCommand({
|
|
1736
|
+
command: "tasks.update",
|
|
1737
|
+
runtimeOptions: context.runtimeOptions,
|
|
1738
|
+
field: "update_task",
|
|
1739
|
+
variables: {
|
|
1740
|
+
organization_id: organizationId,
|
|
1741
|
+
task_id: id,
|
|
1742
|
+
params: {
|
|
1743
|
+
task: taskPayload
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
// src/commands/projects.ts
|
|
1751
|
+
import { z as z4 } from "zod";
|
|
1752
|
+
|
|
1097
1753
|
// src/commands/entityCrud.ts
|
|
1098
|
-
import { z as
|
|
1754
|
+
import { z as z3 } from "zod";
|
|
1099
1755
|
|
|
1100
1756
|
// src/commands/dtoHelpCatalog.ts
|
|
1101
1757
|
var dtoHelpCatalog = {
|
|
@@ -1676,7 +2332,7 @@ function buildDataJsonHelp(rootKey, mode) {
|
|
|
1676
2332
|
}
|
|
1677
2333
|
|
|
1678
2334
|
// src/commands/entityCrud.ts
|
|
1679
|
-
var
|
|
2335
|
+
var idSchema2 = z3.string().min(1);
|
|
1680
2336
|
function toSingularResourceName(resourcePath) {
|
|
1681
2337
|
if (resourcePath === "organization_meta_profiles") {
|
|
1682
2338
|
return "organization_meta_profile";
|
|
@@ -1756,14 +2412,19 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1756
2412
|
const updateHelp5 = buildDataJsonHelp(config.rootKey, "update") ?? "JSON object, optionally wrapped with root key";
|
|
1757
2413
|
const list = entityCommand.command("list").option("--page <page>").option("--per <per>");
|
|
1758
2414
|
const listParams = config.listParams ?? [];
|
|
2415
|
+
const showParams = config.showParams ?? [];
|
|
2416
|
+
const allowQueryJson = config.allowQueryJson !== false;
|
|
1759
2417
|
listParams.forEach((param) => {
|
|
1760
2418
|
const cliParam = param.replace(/_/g, "-");
|
|
1761
2419
|
list.option(`--${cliParam} <${cliParam}>`);
|
|
1762
2420
|
});
|
|
1763
|
-
|
|
2421
|
+
if (allowQueryJson) {
|
|
2422
|
+
list.option("--query-json <queryJson>", "Additional query params as JSON object");
|
|
2423
|
+
}
|
|
2424
|
+
list.action(async (opts, cmd) => {
|
|
1764
2425
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1765
2426
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1766
|
-
const extraQuery = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2427
|
+
const extraQuery = allowQueryJson ? parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0) : {};
|
|
1767
2428
|
const mappedKnownParams = Object.fromEntries(
|
|
1768
2429
|
listParams.map((param) => {
|
|
1769
2430
|
const optionKey = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
@@ -1780,20 +2441,34 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1780
2441
|
await runGraphqlQueryCommand({
|
|
1781
2442
|
command: `${config.command}.list`,
|
|
1782
2443
|
runtimeOptions: context.runtimeOptions,
|
|
1783
|
-
field: config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath,
|
|
2444
|
+
field: config.listField ?? (config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath),
|
|
1784
2445
|
variables,
|
|
2446
|
+
variableTypes: config.listVariableTypes,
|
|
2447
|
+
selectionSet: config.listSelectionSet,
|
|
1785
2448
|
isList: true
|
|
1786
2449
|
});
|
|
1787
2450
|
});
|
|
1788
|
-
entityCommand.command("show").requiredOption("--id <id>")
|
|
1789
|
-
|
|
2451
|
+
const show = entityCommand.command("show").requiredOption("--id <id>");
|
|
2452
|
+
showParams.forEach((param) => {
|
|
2453
|
+
const cliParam = param.replace(/_/g, "-");
|
|
2454
|
+
show.option(`--${cliParam} <${cliParam}>`);
|
|
2455
|
+
});
|
|
2456
|
+
show.action(async (opts, cmd) => {
|
|
2457
|
+
const id = idSchema2.parse(opts.id);
|
|
1790
2458
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1791
2459
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1792
2460
|
const defaultCommand = `${config.command}.show`;
|
|
1793
|
-
const defaultField = config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath);
|
|
2461
|
+
const defaultField = config.showField ?? (config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath));
|
|
2462
|
+
const mappedShowParams = Object.fromEntries(
|
|
2463
|
+
showParams.map((param) => {
|
|
2464
|
+
const optionKey = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
2465
|
+
return [param, opts[optionKey]];
|
|
2466
|
+
})
|
|
2467
|
+
);
|
|
1794
2468
|
const defaultVariables = normalizeGraphqlVariables2({
|
|
1795
2469
|
organization_id: organizationId,
|
|
1796
|
-
id
|
|
2470
|
+
id,
|
|
2471
|
+
...mappedShowParams
|
|
1797
2472
|
});
|
|
1798
2473
|
const showQuery = config.showQueryFactory ? config.showQueryFactory({
|
|
1799
2474
|
command: defaultCommand,
|
|
@@ -1808,8 +2483,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1808
2483
|
operationName: showQuery?.operationName,
|
|
1809
2484
|
field: showQuery?.field ?? defaultField,
|
|
1810
2485
|
variables: showQuery?.variables ?? defaultVariables,
|
|
1811
|
-
variableTypes: showQuery?.variableTypes,
|
|
1812
|
-
selectionSet: showQuery?.selectionSet,
|
|
2486
|
+
variableTypes: showQuery?.variableTypes ?? config.showVariableTypes,
|
|
2487
|
+
selectionSet: showQuery?.selectionSet ?? config.showSelectionSet,
|
|
1813
2488
|
isShow: true,
|
|
1814
2489
|
transformData: showQuery?.transformData
|
|
1815
2490
|
});
|
|
@@ -1846,7 +2521,7 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1846
2521
|
});
|
|
1847
2522
|
});
|
|
1848
2523
|
entityCommand.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp5).action(async (opts, cmd) => {
|
|
1849
|
-
const id =
|
|
2524
|
+
const id = idSchema2.parse(opts.id);
|
|
1850
2525
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1851
2526
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1852
2527
|
let body = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
@@ -1874,138 +2549,70 @@ var __testables = {
|
|
|
1874
2549
|
parseQueryJson
|
|
1875
2550
|
};
|
|
1876
2551
|
|
|
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
2552
|
// src/commands/projects.ts
|
|
1982
|
-
import { z as z4 } from "zod";
|
|
1983
2553
|
var idSchema3 = z4.string().min(1);
|
|
1984
2554
|
var projectCreateDataJsonHelp = buildDataJsonHelp("project", "create") ?? 'JSON object for project or {"project": {...}}';
|
|
1985
2555
|
var projectUpdateDataJsonHelp = buildDataJsonHelp("project", "update") ?? 'JSON object for project or {"project": {...}}';
|
|
2556
|
+
var projectsIndexMinimalSelectionSet = "{ count currentPage totalPages data { id type attributes { name slug status priority } } }";
|
|
2557
|
+
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 } }";
|
|
2558
|
+
function asRecord2(value) {
|
|
2559
|
+
return value && typeof value === "object" ? value : null;
|
|
2560
|
+
}
|
|
2561
|
+
function toNonEmptyString(value) {
|
|
2562
|
+
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
2563
|
+
}
|
|
2564
|
+
function normalizeProjectRowForDisplay(row) {
|
|
2565
|
+
const record = asRecord2(row);
|
|
2566
|
+
if (!record) return row;
|
|
2567
|
+
const attributes = asRecord2(record.attributes);
|
|
2568
|
+
const topLevelName = toNonEmptyString(record.name);
|
|
2569
|
+
const topLevelTitle = toNonEmptyString(record.title);
|
|
2570
|
+
const attributeName = toNonEmptyString(attributes?.name);
|
|
2571
|
+
const attributeTitle = toNonEmptyString(attributes?.title);
|
|
2572
|
+
if (!topLevelName && !topLevelTitle && !attributeName && !attributeTitle) {
|
|
2573
|
+
return record;
|
|
2574
|
+
}
|
|
2575
|
+
return {
|
|
2576
|
+
...record,
|
|
2577
|
+
...topLevelName ? {} : attributeName ? { name: attributeName } : {},
|
|
2578
|
+
...topLevelTitle ? {} : attributeTitle ? { title: attributeTitle } : {}
|
|
2579
|
+
};
|
|
2580
|
+
}
|
|
2581
|
+
function normalizeProjectsListForDisplay(payload) {
|
|
2582
|
+
const record = asRecord2(payload);
|
|
2583
|
+
if (!record || !Array.isArray(record.data)) return payload;
|
|
2584
|
+
return {
|
|
2585
|
+
...record,
|
|
2586
|
+
data: record.data.map((row) => normalizeProjectRowForDisplay(row))
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
1986
2589
|
function registerProjectCommands(program) {
|
|
1987
2590
|
const projects = program.command("projects").description("Project operations");
|
|
1988
|
-
projects.command("list").option("--page <page>").option("--per <per>").option("--
|
|
2591
|
+
projects.command("list").option("--page <page>").option("--per <per>").option("--team-ids <teamIds>").option("--member-id <memberId>").action(async (opts, cmd) => {
|
|
1989
2592
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1990
2593
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1991
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1992
2594
|
await runGraphqlQueryCommand({
|
|
1993
2595
|
command: "projects.list",
|
|
2596
|
+
operationName: "ProjectsIndexSlim",
|
|
1994
2597
|
runtimeOptions: context.runtimeOptions,
|
|
1995
2598
|
field: "projects",
|
|
1996
2599
|
variables: normalizeGraphqlVariables2({
|
|
1997
2600
|
organization_id: organizationId,
|
|
1998
2601
|
page: opts.page,
|
|
1999
2602
|
per: opts.per,
|
|
2000
|
-
include_archived: opts.includeArchived,
|
|
2001
|
-
status: opts.status,
|
|
2002
|
-
term: opts.term,
|
|
2003
2603
|
team_ids: opts.teamIds,
|
|
2004
|
-
member_id: opts.memberId
|
|
2005
|
-
...extra
|
|
2604
|
+
member_id: opts.memberId
|
|
2006
2605
|
}),
|
|
2606
|
+
variableTypes: {
|
|
2607
|
+
organization_id: "ID!",
|
|
2608
|
+
page: "Int",
|
|
2609
|
+
per: "Int",
|
|
2610
|
+
team_ids: "[ID!]",
|
|
2611
|
+
member_id: "ID"
|
|
2612
|
+
},
|
|
2007
2613
|
isList: true,
|
|
2008
|
-
selectionSet:
|
|
2614
|
+
selectionSet: projectsIndexMinimalSelectionSet,
|
|
2615
|
+
transformData: normalizeProjectsListForDisplay
|
|
2009
2616
|
});
|
|
2010
2617
|
});
|
|
2011
2618
|
projects.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
@@ -2014,6 +2621,7 @@ function registerProjectCommands(program) {
|
|
|
2014
2621
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2015
2622
|
await runGraphqlQueryCommand({
|
|
2016
2623
|
command: "projects.show",
|
|
2624
|
+
operationName: "ProjectShowDeepV2",
|
|
2017
2625
|
runtimeOptions: context.runtimeOptions,
|
|
2018
2626
|
field: "project",
|
|
2019
2627
|
variables: {
|
|
@@ -2021,7 +2629,8 @@ function registerProjectCommands(program) {
|
|
|
2021
2629
|
id
|
|
2022
2630
|
},
|
|
2023
2631
|
isShow: true,
|
|
2024
|
-
selectionSet:
|
|
2632
|
+
selectionSet: projectShowFullSelectionSet,
|
|
2633
|
+
transformData: normalizeProjectRowForDisplay
|
|
2025
2634
|
});
|
|
2026
2635
|
});
|
|
2027
2636
|
projects.command("create").requiredOption("--data-json <dataJson>", projectCreateDataJsonHelp).action(async (opts, cmd) => {
|
|
@@ -2070,11 +2679,10 @@ var createHelp = buildDataJsonHelp("rock", "create") ?? 'JSON object for rock or
|
|
|
2070
2679
|
var updateHelp = buildDataJsonHelp("rock", "update") ?? 'JSON object for rock or {"rock": {...}}';
|
|
2071
2680
|
function registerRockCommands(program) {
|
|
2072
2681
|
const rocks = program.command("rocks").description("Rock operations");
|
|
2073
|
-
rocks.command("list").option("--page <page>").option("--per <per>").option("--rock-collection-id <rockCollectionId>").option("--
|
|
2682
|
+
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
2683
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2075
2684
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2076
2685
|
const rockCollectionId = opts.rockCollectionId ? rockCollectionIdSchema.parse(opts.rockCollectionId) : void 0;
|
|
2077
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2078
2686
|
await runGraphqlQueryCommand({
|
|
2079
2687
|
command: "rocks.list",
|
|
2080
2688
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2084,18 +2692,13 @@ function registerRockCommands(program) {
|
|
|
2084
2692
|
page: opts.page,
|
|
2085
2693
|
per: opts.per,
|
|
2086
2694
|
rock_collection_id: rockCollectionId,
|
|
2695
|
+
start_date: opts.startDate,
|
|
2696
|
+
rock_type: opts.rockType,
|
|
2087
2697
|
team_id: opts.teamId,
|
|
2088
|
-
team_ids: opts.teamIds,
|
|
2089
2698
|
member_id: opts.memberId,
|
|
2090
2699
|
meeting_id: opts.meetingId,
|
|
2091
2700
|
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
|
|
2701
|
+
quarterly_objective_id: opts.quarterlyObjectiveId
|
|
2099
2702
|
}),
|
|
2100
2703
|
isList: true
|
|
2101
2704
|
});
|
|
@@ -2306,24 +2909,23 @@ function normalizeMeetingCreateBody(body) {
|
|
|
2306
2909
|
}
|
|
2307
2910
|
function registerMeetingCommands(program) {
|
|
2308
2911
|
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("--
|
|
2912
|
+
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
2913
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2311
2914
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2312
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2313
2915
|
await runGraphqlQueryCommand({
|
|
2314
2916
|
command: "meetings.list",
|
|
2315
2917
|
runtimeOptions: context.runtimeOptions,
|
|
2316
2918
|
field: "meetings",
|
|
2317
2919
|
variables: normalizeGraphqlVariables2({
|
|
2318
2920
|
organization_id: organizationId,
|
|
2921
|
+
page: opts.page,
|
|
2319
2922
|
per: opts.per,
|
|
2320
2923
|
date: opts.date,
|
|
2321
2924
|
occurrence_date: opts.occurrenceDate,
|
|
2322
2925
|
past: opts.past,
|
|
2323
2926
|
start_time: opts.startTime,
|
|
2324
2927
|
today_and_active: opts.todayAndActive,
|
|
2325
|
-
|
|
2326
|
-
...extra
|
|
2928
|
+
type: opts.type
|
|
2327
2929
|
}),
|
|
2328
2930
|
isList: true
|
|
2329
2931
|
});
|
|
@@ -2403,10 +3005,9 @@ var createHelp3 = buildDataJsonHelp("member", "create") ?? 'JSON object for memb
|
|
|
2403
3005
|
var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for member or {"member": {...}}';
|
|
2404
3006
|
function registerMemberCommands(program) {
|
|
2405
3007
|
const members = program.command("members").description("Member operations");
|
|
2406
|
-
members.command("list").option("--page <page>").option("--per <per>").
|
|
3008
|
+
members.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
2407
3009
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2408
3010
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2409
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2410
3011
|
await runGraphqlQueryCommand({
|
|
2411
3012
|
command: "members.list",
|
|
2412
3013
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2414,8 +3015,7 @@ function registerMemberCommands(program) {
|
|
|
2414
3015
|
variables: normalizeGraphqlVariables2({
|
|
2415
3016
|
organization_id: organizationId,
|
|
2416
3017
|
page: opts.page,
|
|
2417
|
-
per: opts.per
|
|
2418
|
-
...extra
|
|
3018
|
+
per: opts.per
|
|
2419
3019
|
}),
|
|
2420
3020
|
isList: true
|
|
2421
3021
|
});
|
|
@@ -2478,10 +3078,9 @@ var issueTypeSchema = z8.string().min(1).refine((value) => value === "short_term
|
|
|
2478
3078
|
var updateHelp4 = buildDataJsonHelp("issue", "update") ?? 'JSON object for issue or {"issue": {...}}';
|
|
2479
3079
|
function registerIssueCommands(program) {
|
|
2480
3080
|
const issues = program.command("issues").description("Issue operations");
|
|
2481
|
-
issues.command("list").option("--page <page>").option("--per <per>").option("--issue-group-id <issueGroupId>").option("--
|
|
3081
|
+
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
3082
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2483
3083
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2484
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2485
3084
|
await runGraphqlQueryCommand({
|
|
2486
3085
|
command: "issues.list",
|
|
2487
3086
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2491,13 +3090,11 @@ function registerIssueCommands(program) {
|
|
|
2491
3090
|
page: opts.page,
|
|
2492
3091
|
per: opts.per,
|
|
2493
3092
|
issue_group_id: opts.issueGroupId,
|
|
3093
|
+
start_date: opts.startDate,
|
|
3094
|
+
issue_type: opts.issueType,
|
|
2494
3095
|
team_id: opts.teamId,
|
|
2495
|
-
team_ids: opts.teamIds,
|
|
2496
3096
|
member_id: opts.memberId,
|
|
2497
|
-
meeting_id: opts.meetingId
|
|
2498
|
-
rank_direction: opts.rankDirection,
|
|
2499
|
-
include_archived: opts.includeArchived,
|
|
2500
|
-
...extra
|
|
3097
|
+
meeting_id: opts.meetingId
|
|
2501
3098
|
}),
|
|
2502
3099
|
isList: true
|
|
2503
3100
|
});
|
|
@@ -2764,12 +3361,12 @@ var SCORECARD_INTERVALS = /* @__PURE__ */ new Set([
|
|
|
2764
3361
|
"yearly"
|
|
2765
3362
|
]);
|
|
2766
3363
|
var SCORECARD_TRENDS = /* @__PURE__ */ new Set(["average", "total"]);
|
|
2767
|
-
function
|
|
3364
|
+
function isRecord2(value) {
|
|
2768
3365
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2769
3366
|
}
|
|
2770
3367
|
function ensureEntityObject(body, rootKey) {
|
|
2771
3368
|
const entity = body[rootKey];
|
|
2772
|
-
if (!
|
|
3369
|
+
if (!isRecord2(entity)) {
|
|
2773
3370
|
throw new CliError({
|
|
2774
3371
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
2775
3372
|
kind: "invalid_args",
|
|
@@ -3215,7 +3812,9 @@ function registerSystemToolCommands(program) {
|
|
|
3215
3812
|
description: "List operations",
|
|
3216
3813
|
resourcePath: "lists",
|
|
3217
3814
|
rootKey: "list",
|
|
3218
|
-
listParams: ["
|
|
3815
|
+
listParams: ["member_id", "team_ids"],
|
|
3816
|
+
showParams: ["current_member_id"],
|
|
3817
|
+
allowQueryJson: false
|
|
3219
3818
|
});
|
|
3220
3819
|
registerEntityCrudCommands(program, {
|
|
3221
3820
|
command: "list-items",
|
|
@@ -3223,32 +3822,26 @@ function registerSystemToolCommands(program) {
|
|
|
3223
3822
|
resourcePath: "list_items",
|
|
3224
3823
|
rootKey: "list_item",
|
|
3225
3824
|
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
|
-
]
|
|
3825
|
+
listParams: ["list_id", "meeting_id", "open", "team_id", "member_id", "include_archived"],
|
|
3826
|
+
allowQueryJson: false
|
|
3238
3827
|
});
|
|
3239
3828
|
registerEntityCrudCommands(program, {
|
|
3240
3829
|
command: "issue-groups",
|
|
3241
3830
|
description: "Issue group operations",
|
|
3242
3831
|
resourcePath: "issue_groups",
|
|
3243
3832
|
rootKey: "issue_group",
|
|
3244
|
-
listParams: ["
|
|
3833
|
+
listParams: ["member_id", "team_ids"],
|
|
3834
|
+
showParams: ["current_member_id"],
|
|
3835
|
+
allowQueryJson: false
|
|
3245
3836
|
});
|
|
3246
3837
|
registerEntityCrudCommands(program, {
|
|
3247
3838
|
command: "todo-groups",
|
|
3248
3839
|
description: "To-do group operations",
|
|
3249
3840
|
resourcePath: "todo_groups",
|
|
3250
3841
|
rootKey: "todo_group",
|
|
3251
|
-
listParams: ["
|
|
3842
|
+
listParams: ["member_id", "team_ids"],
|
|
3843
|
+
showParams: ["current_member_id"],
|
|
3844
|
+
allowQueryJson: false
|
|
3252
3845
|
});
|
|
3253
3846
|
registerEntityCrudCommands(program, {
|
|
3254
3847
|
command: "todos",
|
|
@@ -3257,22 +3850,17 @@ function registerSystemToolCommands(program) {
|
|
|
3257
3850
|
rootKey: "todo",
|
|
3258
3851
|
requiredCreateFields: ["todo_group_id"],
|
|
3259
3852
|
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
|
-
]
|
|
3853
|
+
listParams: ["todo_group_id", "start_date", "team_id", "member_id"],
|
|
3854
|
+
allowQueryJson: false
|
|
3269
3855
|
});
|
|
3270
3856
|
registerEntityCrudCommands(program, {
|
|
3271
3857
|
command: "rock-collections",
|
|
3272
3858
|
description: "Rock collection operations",
|
|
3273
3859
|
resourcePath: "rock_collections",
|
|
3274
3860
|
rootKey: "rock_collection",
|
|
3275
|
-
listParams: ["
|
|
3861
|
+
listParams: ["member_id", "team_ids"],
|
|
3862
|
+
showParams: ["current_member_id"],
|
|
3863
|
+
allowQueryJson: false
|
|
3276
3864
|
});
|
|
3277
3865
|
registerEntityCrudCommands(program, {
|
|
3278
3866
|
command: "knowledge",
|
|
@@ -3283,13 +3871,21 @@ function registerSystemToolCommands(program) {
|
|
|
3283
3871
|
listParams: [
|
|
3284
3872
|
"assigned",
|
|
3285
3873
|
"contentable_id",
|
|
3874
|
+
"contentable_ids",
|
|
3875
|
+
"content_type",
|
|
3286
3876
|
"contentable_type",
|
|
3287
|
-
"
|
|
3288
|
-
"
|
|
3877
|
+
"focus_member_id",
|
|
3878
|
+
"focus_team_id",
|
|
3289
3879
|
"member_id",
|
|
3290
3880
|
"parent_content_id",
|
|
3291
|
-
"
|
|
3292
|
-
|
|
3881
|
+
"sort",
|
|
3882
|
+
"status",
|
|
3883
|
+
"team_id",
|
|
3884
|
+
"term",
|
|
3885
|
+
"type"
|
|
3886
|
+
],
|
|
3887
|
+
showParams: ["include_all_rollups"],
|
|
3888
|
+
allowQueryJson: false
|
|
3293
3889
|
});
|
|
3294
3890
|
registerEntityCrudCommands(program, {
|
|
3295
3891
|
command: "stand-ups",
|
|
@@ -3302,8 +3898,10 @@ function registerSystemToolCommands(program) {
|
|
|
3302
3898
|
"date",
|
|
3303
3899
|
"end_date",
|
|
3304
3900
|
"start_date",
|
|
3901
|
+
"team_id",
|
|
3305
3902
|
"use_week_range"
|
|
3306
|
-
]
|
|
3903
|
+
],
|
|
3904
|
+
allowQueryJson: false
|
|
3307
3905
|
});
|
|
3308
3906
|
registerEntityCrudCommands(program, {
|
|
3309
3907
|
command: "news",
|
|
@@ -3312,7 +3910,8 @@ function registerSystemToolCommands(program) {
|
|
|
3312
3910
|
rootKey: "headline",
|
|
3313
3911
|
requiredCreateFields: ["member_id", "status", "headline_type"],
|
|
3314
3912
|
normalizeCreateBody: normalizeNewsCreateBody,
|
|
3315
|
-
listParams: ["meeting_id", "unread"],
|
|
3913
|
+
listParams: ["meeting_id", "team_id", "unread"],
|
|
3914
|
+
allowQueryJson: false,
|
|
3316
3915
|
showQueryFactory: ({ id, organizationId }) => ({
|
|
3317
3916
|
field: "headlines",
|
|
3318
3917
|
variables: {
|
|
@@ -3320,7 +3919,7 @@ function registerSystemToolCommands(program) {
|
|
|
3320
3919
|
page: 1,
|
|
3321
3920
|
per: 200
|
|
3322
3921
|
},
|
|
3323
|
-
selectionSet: "{ data { id type attributes } count currentPage totalPages }",
|
|
3922
|
+
selectionSet: "{ data { id type slug summary description memberId status rank createdAt updatedAt headlineType teamIds meetingId labelIds attributes } count currentPage totalPages }",
|
|
3324
3923
|
transformData: (value) => {
|
|
3325
3924
|
if (!value || typeof value !== "object") {
|
|
3326
3925
|
return null;
|
|
@@ -3344,16 +3943,20 @@ function registerSystemToolCommands(program) {
|
|
|
3344
3943
|
requiredCreateFields: ["member_id", "name"],
|
|
3345
3944
|
normalizeCreateBody: normalizeQuestionsCreateBody,
|
|
3346
3945
|
normalizeUpdateBody: normalizeQuestionsUpdateBody,
|
|
3347
|
-
listParams: ["answered", "asked",
|
|
3946
|
+
listParams: ["answered", "asked"],
|
|
3947
|
+
allowQueryJson: false
|
|
3348
3948
|
});
|
|
3349
3949
|
registerEntityCrudCommands(program, {
|
|
3350
3950
|
command: "pulse",
|
|
3351
3951
|
description: "Pulse operations",
|
|
3352
3952
|
resourcePath: "health_updates",
|
|
3353
3953
|
rootKey: "health_update",
|
|
3954
|
+
listField: "feedbacks",
|
|
3955
|
+
showField: "feedback",
|
|
3354
3956
|
requiredCreateFields: ["health_updatable_id", "health_updatable_type", "member_id", "status"],
|
|
3355
3957
|
normalizeCreateBody: normalizePulseCreateBody,
|
|
3356
|
-
listParams: ["
|
|
3958
|
+
listParams: ["last", "latest", "start_date", "name", "quarter", "year"],
|
|
3959
|
+
allowQueryJson: false
|
|
3357
3960
|
});
|
|
3358
3961
|
registerEntityCrudCommands(program, {
|
|
3359
3962
|
command: "surveys",
|
|
@@ -3363,7 +3966,8 @@ function registerSystemToolCommands(program) {
|
|
|
3363
3966
|
requiredCreateFields: ["name", "recipient_type"],
|
|
3364
3967
|
normalizeCreateBody: normalizeSurveysCreateBody,
|
|
3365
3968
|
normalizeUpdateBody: normalizeSurveysUpdateBody,
|
|
3366
|
-
listParams: ["completed", "current_member", "due", "exclude_completed"]
|
|
3969
|
+
listParams: ["completed", "current_member", "due", "exclude_completed", "sent"],
|
|
3970
|
+
allowQueryJson: false
|
|
3367
3971
|
});
|
|
3368
3972
|
registerEntityCrudCommands(program, {
|
|
3369
3973
|
command: "feedbacks",
|
|
@@ -3373,7 +3977,8 @@ function registerSystemToolCommands(program) {
|
|
|
3373
3977
|
requiredCreateFields: ["name", "quarter", "year"],
|
|
3374
3978
|
normalizeCreateBody: normalizeFeedbacksCreateBody,
|
|
3375
3979
|
normalizeUpdateBody: normalizeFeedbacksUpdateBody,
|
|
3376
|
-
listParams: ["last", "latest", "start_date"]
|
|
3980
|
+
listParams: ["last", "latest", "start_date"],
|
|
3981
|
+
allowQueryJson: false
|
|
3377
3982
|
});
|
|
3378
3983
|
registerEntityCrudCommands(program, {
|
|
3379
3984
|
command: "accountability",
|
|
@@ -3383,7 +3988,8 @@ function registerSystemToolCommands(program) {
|
|
|
3383
3988
|
requiredCreateFields: ["name", "member_id"],
|
|
3384
3989
|
normalizeCreateBody: normalizeAccountabilityCreateBody,
|
|
3385
3990
|
normalizeUpdateBody: normalizeAccountabilityUpdateBody,
|
|
3386
|
-
listParams: [
|
|
3991
|
+
listParams: [],
|
|
3992
|
+
allowQueryJson: false
|
|
3387
3993
|
});
|
|
3388
3994
|
registerEntityCrudCommands(program, {
|
|
3389
3995
|
command: "kpis",
|
|
@@ -3394,24 +4000,16 @@ function registerSystemToolCommands(program) {
|
|
|
3394
4000
|
body,
|
|
3395
4001
|
organizationId
|
|
3396
4002
|
}),
|
|
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
|
-
]
|
|
4003
|
+
listParams: ["team_id", "member_id", "smart_kpi_view_id", "quarterly_objective_id"],
|
|
4004
|
+
allowQueryJson: false
|
|
3408
4005
|
});
|
|
3409
4006
|
registerEntityCrudCommands(program, {
|
|
3410
4007
|
command: "scorecard-groups",
|
|
3411
4008
|
description: "Scorecard group operations",
|
|
3412
4009
|
resourcePath: "measurable_groups",
|
|
3413
4010
|
rootKey: "measurable_group",
|
|
3414
|
-
listParams: ["include_archived", "member_id", "name", "sort", "team_ids", "term"]
|
|
4011
|
+
listParams: ["include_archived", "member_id", "name", "sort", "team_ids", "term"],
|
|
4012
|
+
allowQueryJson: false
|
|
3415
4013
|
});
|
|
3416
4014
|
registerEntityCrudCommands(program, {
|
|
3417
4015
|
command: "scorecards",
|
|
@@ -3431,21 +4029,24 @@ function registerSystemToolCommands(program) {
|
|
|
3431
4029
|
"sort",
|
|
3432
4030
|
"team_id",
|
|
3433
4031
|
"team_ids"
|
|
3434
|
-
]
|
|
4032
|
+
],
|
|
4033
|
+
allowQueryJson: false
|
|
3435
4034
|
});
|
|
3436
4035
|
registerEntityCrudCommands(program, {
|
|
3437
4036
|
command: "customers",
|
|
3438
4037
|
description: "CRM customer operations",
|
|
3439
4038
|
resourcePath: "customers",
|
|
3440
4039
|
rootKey: "customer",
|
|
3441
|
-
listParams: ["
|
|
4040
|
+
listParams: ["project_id", "meeting_id", "open", "team_id", "member_id"],
|
|
4041
|
+
allowQueryJson: false
|
|
3442
4042
|
});
|
|
3443
4043
|
registerEntityCrudCommands(program, {
|
|
3444
4044
|
command: "contacts",
|
|
3445
4045
|
description: "CRM contact operations",
|
|
3446
4046
|
resourcePath: "contacts",
|
|
3447
4047
|
rootKey: "contact",
|
|
3448
|
-
listParams: ["customer_id", "member_id",
|
|
4048
|
+
listParams: ["customer_id", "member_id"],
|
|
4049
|
+
allowQueryJson: false
|
|
3449
4050
|
});
|
|
3450
4051
|
}
|
|
3451
4052
|
|
|
@@ -3454,10 +4055,9 @@ import { z as z9 } from "zod";
|
|
|
3454
4055
|
var idSchema8 = z9.string().min(1);
|
|
3455
4056
|
function registerTeamCommands(program) {
|
|
3456
4057
|
const teams = program.command("teams").description("Team operations");
|
|
3457
|
-
teams.command("list").option("--page <page>").option("--per <per>").
|
|
4058
|
+
teams.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
3458
4059
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3459
4060
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3460
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
3461
4061
|
await runGraphqlQueryCommand({
|
|
3462
4062
|
command: "teams.list",
|
|
3463
4063
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -3465,8 +4065,7 @@ function registerTeamCommands(program) {
|
|
|
3465
4065
|
variables: normalizeGraphqlVariables2({
|
|
3466
4066
|
organization_id: organizationId,
|
|
3467
4067
|
page: opts.page,
|
|
3468
|
-
per: opts.per
|
|
3469
|
-
...extra
|
|
4068
|
+
per: opts.per
|
|
3470
4069
|
}),
|
|
3471
4070
|
isList: true
|
|
3472
4071
|
});
|
|
@@ -3521,12 +4120,12 @@ function registerTeamCommands(program) {
|
|
|
3521
4120
|
// src/commands/organizations.ts
|
|
3522
4121
|
import { z as z10 } from "zod";
|
|
3523
4122
|
var idSchema9 = z10.string().min(1);
|
|
3524
|
-
function
|
|
4123
|
+
function isRecord3(value) {
|
|
3525
4124
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3526
4125
|
}
|
|
3527
4126
|
function ensureRootObject(body, rootKey) {
|
|
3528
4127
|
const root = body[rootKey];
|
|
3529
|
-
if (!
|
|
4128
|
+
if (!isRecord3(root)) {
|
|
3530
4129
|
throw new CliError({
|
|
3531
4130
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
3532
4131
|
kind: "invalid_args",
|
|
@@ -3545,7 +4144,7 @@ function asNonEmptyString4(value) {
|
|
|
3545
4144
|
}
|
|
3546
4145
|
function normalizeOrganizationUpdateBody(body) {
|
|
3547
4146
|
const organization = ensureRootObject(body, "organization");
|
|
3548
|
-
const detail =
|
|
4147
|
+
const detail = isRecord3(organization.organization_detail_attributes) ? { ...organization.organization_detail_attributes } : {};
|
|
3549
4148
|
const workspaceName = asNonEmptyString4(organization.workspace_name);
|
|
3550
4149
|
if (workspaceName) {
|
|
3551
4150
|
detail.workspace_name = workspaceName;
|
|
@@ -3558,10 +4157,10 @@ function normalizeOrganizationUpdateBody(body) {
|
|
|
3558
4157
|
}
|
|
3559
4158
|
function normalizeOrganizationMetaProfileUpdateBody(body) {
|
|
3560
4159
|
const root = ensureRootObject(body, "organization_meta_profile");
|
|
3561
|
-
const profile =
|
|
4160
|
+
const profile = isRecord3(root.profile) ? { ...root.profile } : {};
|
|
3562
4161
|
const title = asNonEmptyString4(root.title);
|
|
3563
4162
|
if (title) {
|
|
3564
|
-
const companyIdentity =
|
|
4163
|
+
const companyIdentity = isRecord3(profile.company_identity) ? { ...profile.company_identity } : {};
|
|
3565
4164
|
companyIdentity.one_sentence_summary = title;
|
|
3566
4165
|
profile.company_identity = companyIdentity;
|
|
3567
4166
|
}
|
|
@@ -3588,10 +4187,10 @@ function normalizeOrganizationMetaProfileUpdateBody(body) {
|
|
|
3588
4187
|
}
|
|
3589
4188
|
function normalizeKeyMetricMetaProfileUpdateBody(body) {
|
|
3590
4189
|
const root = ensureRootObject(body, "key_metric_meta_profile");
|
|
3591
|
-
const profile =
|
|
4190
|
+
const profile = isRecord3(root.profile) ? { ...root.profile } : {};
|
|
3592
4191
|
const annualRevenue = asNonEmptyString4(root.annual_revenue);
|
|
3593
4192
|
if (annualRevenue) {
|
|
3594
|
-
const financial =
|
|
4193
|
+
const financial = isRecord3(profile.financial) ? { ...profile.financial } : {};
|
|
3595
4194
|
financial.revenue = annualRevenue;
|
|
3596
4195
|
profile.financial = financial;
|
|
3597
4196
|
}
|
|
@@ -3745,12 +4344,12 @@ var STRATEGIC_OBJECTIVE_ALLOWED_UPDATE_KEYS = /* @__PURE__ */ new Set([
|
|
|
3745
4344
|
"published_at",
|
|
3746
4345
|
"strategic_objective_reads_attributes"
|
|
3747
4346
|
]);
|
|
3748
|
-
function
|
|
4347
|
+
function isRecord4(value) {
|
|
3749
4348
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3750
4349
|
}
|
|
3751
4350
|
function ensureRootObject2(body, rootKey) {
|
|
3752
4351
|
const root = body[rootKey];
|
|
3753
|
-
if (!
|
|
4352
|
+
if (!isRecord4(root)) {
|
|
3754
4353
|
throw new CliError({
|
|
3755
4354
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
3756
4355
|
kind: "invalid_args",
|
|
@@ -3918,7 +4517,8 @@ function registerFoundationCommands(program) {
|
|
|
3918
4517
|
rootKey: "annual_objective",
|
|
3919
4518
|
requiredCreateFields: ["strategic_objective_id", "name"],
|
|
3920
4519
|
normalizeCreateBody: normalizeAnnualObjectiveCreateBody,
|
|
3921
|
-
listParams: []
|
|
4520
|
+
listParams: [],
|
|
4521
|
+
allowQueryJson: false
|
|
3922
4522
|
});
|
|
3923
4523
|
registerEntityCrudCommands(foundation, {
|
|
3924
4524
|
command: "quarterly-objectives",
|
|
@@ -3927,7 +4527,8 @@ function registerFoundationCommands(program) {
|
|
|
3927
4527
|
rootKey: "quarterly_objective",
|
|
3928
4528
|
requiredCreateFields: ["strategic_objective_id", "annual_objective_id", "name"],
|
|
3929
4529
|
normalizeCreateBody: normalizeQuarterlyObjectiveCreateBody,
|
|
3930
|
-
listParams: [
|
|
4530
|
+
listParams: [],
|
|
4531
|
+
allowQueryJson: false
|
|
3931
4532
|
});
|
|
3932
4533
|
}
|
|
3933
4534
|
|
|
@@ -4285,7 +4886,7 @@ function registerNoteCommands(program) {
|
|
|
4285
4886
|
per: opts.per
|
|
4286
4887
|
}),
|
|
4287
4888
|
isList: true,
|
|
4288
|
-
selectionSet: "{ count currentPage totalPages data { id type name
|
|
4889
|
+
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
4890
|
});
|
|
4290
4891
|
});
|
|
4291
4892
|
notes.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
@@ -4302,7 +4903,7 @@ function registerNoteCommands(program) {
|
|
|
4302
4903
|
id
|
|
4303
4904
|
}),
|
|
4304
4905
|
isShow: true,
|
|
4305
|
-
selectionSet: "{ id type name
|
|
4906
|
+
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
4907
|
});
|
|
4307
4908
|
});
|
|
4308
4909
|
notes.command("update").requiredOption("--id <id>").option("--name <name>").option("--body <body>").option("--status <status>").action(async (opts, cmd) => {
|
|
@@ -4588,7 +5189,7 @@ import { z as z15 } from "zod";
|
|
|
4588
5189
|
|
|
4589
5190
|
// src/internalOptions.ts
|
|
4590
5191
|
var INTERNAL_OPTIONS_KEY = "__waveInternalOptions";
|
|
4591
|
-
function
|
|
5192
|
+
function asRecord3(value) {
|
|
4592
5193
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
4593
5194
|
return null;
|
|
4594
5195
|
}
|
|
@@ -4602,7 +5203,7 @@ function setInternalCliOptions(program, options) {
|
|
|
4602
5203
|
function getInternalCliOptions(command) {
|
|
4603
5204
|
let current = command;
|
|
4604
5205
|
while (current) {
|
|
4605
|
-
const record =
|
|
5206
|
+
const record = asRecord3(current[INTERNAL_OPTIONS_KEY]);
|
|
4606
5207
|
if (record) {
|
|
4607
5208
|
return {
|
|
4608
5209
|
enableRetryOnEmptyPhrase: record.enableRetryOnEmptyPhrase === true
|