@ted-galago/wave-cli 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/index.cjs +824 -228
- package/dist/index.js +824 -228
- package/package.json +1 -1
- package/scripts/verify-dev-api.mjs +76 -1
package/dist/index.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,47 @@ 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
|
+
const fields = Array.from(/* @__PURE__ */ new Set(["id", "type", ...explicitFields, "attributes"])).join(" ");
|
|
1248
|
+
return isList ? `{ data { ${fields} } count currentPage totalPages }` : `{ ${fields} }`;
|
|
1249
|
+
}
|
|
738
1250
|
if (isList) {
|
|
739
1251
|
return "{ data { id type attributes } count currentPage totalPages }";
|
|
740
1252
|
}
|
|
741
1253
|
return "{ id type attributes }";
|
|
742
1254
|
}
|
|
1255
|
+
function isRecord(value) {
|
|
1256
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
1257
|
+
}
|
|
1258
|
+
function normalizeDisplayFieldsInRow(row) {
|
|
1259
|
+
if (!isRecord(row)) return row;
|
|
1260
|
+
const attributes = isRecord(row.attributes) ? row.attributes : null;
|
|
1261
|
+
if (!attributes) return row;
|
|
1262
|
+
const normalized = { ...row };
|
|
1263
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
1264
|
+
if (!Object.prototype.hasOwnProperty.call(normalized, key)) {
|
|
1265
|
+
normalized[key] = value;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
return normalized;
|
|
1269
|
+
}
|
|
1270
|
+
function normalizeQueryFieldPayloadForDisplay(fieldPayload) {
|
|
1271
|
+
if (Array.isArray(fieldPayload)) {
|
|
1272
|
+
return fieldPayload.map((row) => normalizeDisplayFieldsInRow(row));
|
|
1273
|
+
}
|
|
1274
|
+
if (!isRecord(fieldPayload)) {
|
|
1275
|
+
return fieldPayload;
|
|
1276
|
+
}
|
|
1277
|
+
if (Array.isArray(fieldPayload.data)) {
|
|
1278
|
+
return {
|
|
1279
|
+
...fieldPayload,
|
|
1280
|
+
data: fieldPayload.data.map((row) => normalizeDisplayFieldsInRow(row))
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
return normalizeDisplayFieldsInRow(fieldPayload);
|
|
1284
|
+
}
|
|
743
1285
|
function parseBooleanMaybe(value) {
|
|
744
1286
|
const lowered = value.toLowerCase();
|
|
745
1287
|
if (lowered === "true") {
|
|
@@ -800,6 +1342,11 @@ async function runGraphqlQueryCommand(input) {
|
|
|
800
1342
|
selectionSet: input.selectionSet ?? defaultQuerySelectionSet(input.field, Boolean(input.isList)),
|
|
801
1343
|
isShow: input.isShow
|
|
802
1344
|
});
|
|
1345
|
+
const envelopeData = result.envelope.data;
|
|
1346
|
+
if (result.envelope.ok && envelopeData && Object.prototype.hasOwnProperty.call(envelopeData, input.field)) {
|
|
1347
|
+
envelopeData[input.field] = normalizeQueryFieldPayloadForDisplay(envelopeData[input.field]);
|
|
1348
|
+
result.envelope.data = envelopeData;
|
|
1349
|
+
}
|
|
803
1350
|
if (result.envelope.ok && input.transformData && result.envelope.data) {
|
|
804
1351
|
const dataRecord = result.envelope.data;
|
|
805
1352
|
const transformed = input.transformData(dataRecord[input.field]);
|
|
@@ -1095,8 +1642,114 @@ function resolveOrganizationId(raw) {
|
|
|
1095
1642
|
return organizationId;
|
|
1096
1643
|
}
|
|
1097
1644
|
|
|
1645
|
+
// src/commands/tasks.ts
|
|
1646
|
+
var projectIdSchema = import_zod2.z.string().min(1);
|
|
1647
|
+
var idSchema = import_zod2.z.string().min(1);
|
|
1648
|
+
var summarySchema = import_zod2.z.string().min(1);
|
|
1649
|
+
function registerTaskCommands(program) {
|
|
1650
|
+
const tasks = program.command("tasks").description("Task operations");
|
|
1651
|
+
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) => {
|
|
1652
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1653
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1654
|
+
const projectId = opts.projectId ? projectIdSchema.parse(opts.projectId) : void 0;
|
|
1655
|
+
await runGraphqlQueryCommand({
|
|
1656
|
+
command: "tasks.list",
|
|
1657
|
+
runtimeOptions: context.runtimeOptions,
|
|
1658
|
+
field: "tasks",
|
|
1659
|
+
variables: normalizeGraphqlVariables2({
|
|
1660
|
+
organization_id: organizationId,
|
|
1661
|
+
page: opts.page,
|
|
1662
|
+
per: opts.per,
|
|
1663
|
+
project_id: projectId,
|
|
1664
|
+
team_id: opts.teamId,
|
|
1665
|
+
team_ids: opts.teamIds,
|
|
1666
|
+
member_id: opts.memberId,
|
|
1667
|
+
meeting_id: opts.meetingId,
|
|
1668
|
+
field_name: opts.fieldName,
|
|
1669
|
+
field_value: opts.fieldValue,
|
|
1670
|
+
field_blank: opts.fieldBlank,
|
|
1671
|
+
open: opts.open,
|
|
1672
|
+
rank_direction: opts.rankDirection,
|
|
1673
|
+
include_archived: opts.includeArchived
|
|
1674
|
+
}),
|
|
1675
|
+
isList: true
|
|
1676
|
+
});
|
|
1677
|
+
});
|
|
1678
|
+
tasks.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1679
|
+
const parsed = idSchema.parse(opts.id);
|
|
1680
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1681
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1682
|
+
await runGraphqlQueryCommand({
|
|
1683
|
+
command: "tasks.show",
|
|
1684
|
+
runtimeOptions: context.runtimeOptions,
|
|
1685
|
+
field: "task",
|
|
1686
|
+
variables: {
|
|
1687
|
+
organization_id: organizationId,
|
|
1688
|
+
id: parsed
|
|
1689
|
+
},
|
|
1690
|
+
isShow: true
|
|
1691
|
+
});
|
|
1692
|
+
});
|
|
1693
|
+
tasks.command("create").requiredOption("--project-id <projectId>").option("--title <title>", "Legacy alias for --summary").option("--summary <summary>").action(async (opts, cmd) => {
|
|
1694
|
+
const projectId = projectIdSchema.parse(opts.projectId);
|
|
1695
|
+
const summary = summarySchema.parse(opts.summary ?? opts.title);
|
|
1696
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1697
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1698
|
+
await runGraphqlMutationCommand({
|
|
1699
|
+
command: "tasks.create",
|
|
1700
|
+
runtimeOptions: context.runtimeOptions,
|
|
1701
|
+
field: "create_task",
|
|
1702
|
+
variables: {
|
|
1703
|
+
organization_id: organizationId,
|
|
1704
|
+
params: {
|
|
1705
|
+
task: {
|
|
1706
|
+
project_id: projectId,
|
|
1707
|
+
summary
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
});
|
|
1712
|
+
});
|
|
1713
|
+
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) => {
|
|
1714
|
+
const id = idSchema.parse(opts.id);
|
|
1715
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1716
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1717
|
+
const taskPayload = {
|
|
1718
|
+
...opts.summary ? { summary: String(opts.summary) } : {},
|
|
1719
|
+
...opts.description ? { description: String(opts.description) } : {},
|
|
1720
|
+
...opts.status ? { status: String(opts.status) } : {},
|
|
1721
|
+
...opts.priority ? { priority: String(opts.priority) } : {},
|
|
1722
|
+
...opts.dueDate ? { due_date: String(opts.dueDate) } : {},
|
|
1723
|
+
...opts.memberId ? { member_id: String(opts.memberId) } : {}
|
|
1724
|
+
};
|
|
1725
|
+
if (Object.keys(taskPayload).length === 0) {
|
|
1726
|
+
throw new CliError({
|
|
1727
|
+
message: "tasks update requires at least one patch field (summary, description, status, priority, due-date, member-id).",
|
|
1728
|
+
kind: "invalid_args",
|
|
1729
|
+
status: 400,
|
|
1730
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
await runGraphqlMutationCommand({
|
|
1734
|
+
command: "tasks.update",
|
|
1735
|
+
runtimeOptions: context.runtimeOptions,
|
|
1736
|
+
field: "update_task",
|
|
1737
|
+
variables: {
|
|
1738
|
+
organization_id: organizationId,
|
|
1739
|
+
task_id: id,
|
|
1740
|
+
params: {
|
|
1741
|
+
task: taskPayload
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
});
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
// src/commands/projects.ts
|
|
1749
|
+
var import_zod4 = require("zod");
|
|
1750
|
+
|
|
1098
1751
|
// src/commands/entityCrud.ts
|
|
1099
|
-
var
|
|
1752
|
+
var import_zod3 = require("zod");
|
|
1100
1753
|
|
|
1101
1754
|
// src/commands/dtoHelpCatalog.ts
|
|
1102
1755
|
var dtoHelpCatalog = {
|
|
@@ -1677,7 +2330,7 @@ function buildDataJsonHelp(rootKey, mode) {
|
|
|
1677
2330
|
}
|
|
1678
2331
|
|
|
1679
2332
|
// src/commands/entityCrud.ts
|
|
1680
|
-
var
|
|
2333
|
+
var idSchema2 = import_zod3.z.string().min(1);
|
|
1681
2334
|
function toSingularResourceName(resourcePath) {
|
|
1682
2335
|
if (resourcePath === "organization_meta_profiles") {
|
|
1683
2336
|
return "organization_meta_profile";
|
|
@@ -1757,14 +2410,19 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1757
2410
|
const updateHelp5 = buildDataJsonHelp(config.rootKey, "update") ?? "JSON object, optionally wrapped with root key";
|
|
1758
2411
|
const list = entityCommand.command("list").option("--page <page>").option("--per <per>");
|
|
1759
2412
|
const listParams = config.listParams ?? [];
|
|
2413
|
+
const showParams = config.showParams ?? [];
|
|
2414
|
+
const allowQueryJson = config.allowQueryJson !== false;
|
|
1760
2415
|
listParams.forEach((param) => {
|
|
1761
2416
|
const cliParam = param.replace(/_/g, "-");
|
|
1762
2417
|
list.option(`--${cliParam} <${cliParam}>`);
|
|
1763
2418
|
});
|
|
1764
|
-
|
|
2419
|
+
if (allowQueryJson) {
|
|
2420
|
+
list.option("--query-json <queryJson>", "Additional query params as JSON object");
|
|
2421
|
+
}
|
|
2422
|
+
list.action(async (opts, cmd) => {
|
|
1765
2423
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1766
2424
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1767
|
-
const extraQuery = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2425
|
+
const extraQuery = allowQueryJson ? parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0) : {};
|
|
1768
2426
|
const mappedKnownParams = Object.fromEntries(
|
|
1769
2427
|
listParams.map((param) => {
|
|
1770
2428
|
const optionKey = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
@@ -1781,20 +2439,34 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1781
2439
|
await runGraphqlQueryCommand({
|
|
1782
2440
|
command: `${config.command}.list`,
|
|
1783
2441
|
runtimeOptions: context.runtimeOptions,
|
|
1784
|
-
field: config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath,
|
|
2442
|
+
field: config.listField ?? (config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath),
|
|
1785
2443
|
variables,
|
|
2444
|
+
variableTypes: config.listVariableTypes,
|
|
2445
|
+
selectionSet: config.listSelectionSet,
|
|
1786
2446
|
isList: true
|
|
1787
2447
|
});
|
|
1788
2448
|
});
|
|
1789
|
-
entityCommand.command("show").requiredOption("--id <id>")
|
|
1790
|
-
|
|
2449
|
+
const show = entityCommand.command("show").requiredOption("--id <id>");
|
|
2450
|
+
showParams.forEach((param) => {
|
|
2451
|
+
const cliParam = param.replace(/_/g, "-");
|
|
2452
|
+
show.option(`--${cliParam} <${cliParam}>`);
|
|
2453
|
+
});
|
|
2454
|
+
show.action(async (opts, cmd) => {
|
|
2455
|
+
const id = idSchema2.parse(opts.id);
|
|
1791
2456
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1792
2457
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1793
2458
|
const defaultCommand = `${config.command}.show`;
|
|
1794
|
-
const defaultField = config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath);
|
|
2459
|
+
const defaultField = config.showField ?? (config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath));
|
|
2460
|
+
const mappedShowParams = Object.fromEntries(
|
|
2461
|
+
showParams.map((param) => {
|
|
2462
|
+
const optionKey = param.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
2463
|
+
return [param, opts[optionKey]];
|
|
2464
|
+
})
|
|
2465
|
+
);
|
|
1795
2466
|
const defaultVariables = normalizeGraphqlVariables2({
|
|
1796
2467
|
organization_id: organizationId,
|
|
1797
|
-
id
|
|
2468
|
+
id,
|
|
2469
|
+
...mappedShowParams
|
|
1798
2470
|
});
|
|
1799
2471
|
const showQuery = config.showQueryFactory ? config.showQueryFactory({
|
|
1800
2472
|
command: defaultCommand,
|
|
@@ -1809,8 +2481,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1809
2481
|
operationName: showQuery?.operationName,
|
|
1810
2482
|
field: showQuery?.field ?? defaultField,
|
|
1811
2483
|
variables: showQuery?.variables ?? defaultVariables,
|
|
1812
|
-
variableTypes: showQuery?.variableTypes,
|
|
1813
|
-
selectionSet: showQuery?.selectionSet,
|
|
2484
|
+
variableTypes: showQuery?.variableTypes ?? config.showVariableTypes,
|
|
2485
|
+
selectionSet: showQuery?.selectionSet ?? config.showSelectionSet,
|
|
1814
2486
|
isShow: true,
|
|
1815
2487
|
transformData: showQuery?.transformData
|
|
1816
2488
|
});
|
|
@@ -1847,7 +2519,7 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1847
2519
|
});
|
|
1848
2520
|
});
|
|
1849
2521
|
entityCommand.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp5).action(async (opts, cmd) => {
|
|
1850
|
-
const id =
|
|
2522
|
+
const id = idSchema2.parse(opts.id);
|
|
1851
2523
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1852
2524
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1853
2525
|
let body = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
@@ -1875,138 +2547,69 @@ var __testables = {
|
|
|
1875
2547
|
parseQueryJson
|
|
1876
2548
|
};
|
|
1877
2549
|
|
|
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
2550
|
// src/commands/projects.ts
|
|
1983
|
-
var import_zod4 = require("zod");
|
|
1984
2551
|
var idSchema3 = import_zod4.z.string().min(1);
|
|
1985
2552
|
var projectCreateDataJsonHelp = buildDataJsonHelp("project", "create") ?? 'JSON object for project or {"project": {...}}';
|
|
1986
2553
|
var projectUpdateDataJsonHelp = buildDataJsonHelp("project", "update") ?? 'JSON object for project or {"project": {...}}';
|
|
2554
|
+
var projectsIndexFullSelectionSet = "{ count currentPage totalPages data { id type attributes { name slug description status priority createdAt updatedAt startDate targetDate archivedAt memberId organizationId teamIds favorites { id memberId } resources { ...ResourceSummaryFull } } name slug description status priority createdAt updatedAt startDate targetDate archivedAt memberId organizationId teamIds emoji { id name memberId } backgroundImage { backgroundType gradientStart gradientEnd gradientDegrees color imageUrl image { url lowUrl } } favorites { id memberId } resources { ...ResourceSummaryFull } displayPreference { id type attributes viewType favorite groupingField groupToggleState memberId focusMemberId focusTeamId displayableId displayableType preferenceType agendaItemId } filterPreferences { id type attributes filterType filter memberId focusMemberId focusTeamId filterableId filterableType preferenceType agendaItemId } healthUpdates { id type attributes value memberId status createdAt updatedAt updatableType updatableId parentUpdateId emojis { id name memberId } resources { ...ResourceSummaryFull } replies { id type attributes value memberId createdAt updatedAt commentType commentableId commentableType parentCommentId emojis { id name memberId } resources { ...ResourceSummaryFull } replies { id type } } } } } fragment ResourceSummaryFull on ResourceSummary { id resourceType slug url skillId skill { id name slug emoji scope description } metadata { urlName imageUrl siteName providerName mediaType skillId skillName skillSlug skillScope skillEmoji skillDescription } attachment { id fileKey filename url } content { id name slug type firstChildSlug childCount } }";
|
|
2555
|
+
function asRecord2(value) {
|
|
2556
|
+
return value && typeof value === "object" ? value : null;
|
|
2557
|
+
}
|
|
2558
|
+
function toNonEmptyString(value) {
|
|
2559
|
+
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
2560
|
+
}
|
|
2561
|
+
function normalizeProjectRowForDisplay(row) {
|
|
2562
|
+
const record = asRecord2(row);
|
|
2563
|
+
if (!record) return row;
|
|
2564
|
+
const attributes = asRecord2(record.attributes);
|
|
2565
|
+
const topLevelName = toNonEmptyString(record.name);
|
|
2566
|
+
const topLevelTitle = toNonEmptyString(record.title);
|
|
2567
|
+
const attributeName = toNonEmptyString(attributes?.name);
|
|
2568
|
+
const attributeTitle = toNonEmptyString(attributes?.title);
|
|
2569
|
+
if (!topLevelName && !topLevelTitle && !attributeName && !attributeTitle) {
|
|
2570
|
+
return record;
|
|
2571
|
+
}
|
|
2572
|
+
return {
|
|
2573
|
+
...record,
|
|
2574
|
+
...topLevelName ? {} : attributeName ? { name: attributeName } : {},
|
|
2575
|
+
...topLevelTitle ? {} : attributeTitle ? { title: attributeTitle } : {}
|
|
2576
|
+
};
|
|
2577
|
+
}
|
|
2578
|
+
function normalizeProjectsListForDisplay(payload) {
|
|
2579
|
+
const record = asRecord2(payload);
|
|
2580
|
+
if (!record || !Array.isArray(record.data)) return payload;
|
|
2581
|
+
return {
|
|
2582
|
+
...record,
|
|
2583
|
+
data: record.data.map((row) => normalizeProjectRowForDisplay(row))
|
|
2584
|
+
};
|
|
2585
|
+
}
|
|
1987
2586
|
function registerProjectCommands(program) {
|
|
1988
2587
|
const projects = program.command("projects").description("Project operations");
|
|
1989
|
-
projects.command("list").option("--page <page>").option("--per <per>").option("--
|
|
2588
|
+
projects.command("list").option("--page <page>").option("--per <per>").option("--team-ids <teamIds>").option("--member-id <memberId>").action(async (opts, cmd) => {
|
|
1990
2589
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1991
2590
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1992
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1993
2591
|
await runGraphqlQueryCommand({
|
|
1994
2592
|
command: "projects.list",
|
|
2593
|
+
operationName: "ProjectsIndexFull",
|
|
1995
2594
|
runtimeOptions: context.runtimeOptions,
|
|
1996
2595
|
field: "projects",
|
|
1997
2596
|
variables: normalizeGraphqlVariables2({
|
|
1998
2597
|
organization_id: organizationId,
|
|
1999
2598
|
page: opts.page,
|
|
2000
2599
|
per: opts.per,
|
|
2001
|
-
include_archived: opts.includeArchived,
|
|
2002
|
-
status: opts.status,
|
|
2003
|
-
term: opts.term,
|
|
2004
2600
|
team_ids: opts.teamIds,
|
|
2005
|
-
member_id: opts.memberId
|
|
2006
|
-
...extra
|
|
2601
|
+
member_id: opts.memberId
|
|
2007
2602
|
}),
|
|
2603
|
+
variableTypes: {
|
|
2604
|
+
organization_id: "ID!",
|
|
2605
|
+
page: "Int",
|
|
2606
|
+
per: "Int",
|
|
2607
|
+
team_ids: "[ID!]",
|
|
2608
|
+
member_id: "ID"
|
|
2609
|
+
},
|
|
2008
2610
|
isList: true,
|
|
2009
|
-
selectionSet:
|
|
2611
|
+
selectionSet: projectsIndexFullSelectionSet,
|
|
2612
|
+
transformData: normalizeProjectsListForDisplay
|
|
2010
2613
|
});
|
|
2011
2614
|
});
|
|
2012
2615
|
projects.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
@@ -2022,7 +2625,8 @@ function registerProjectCommands(program) {
|
|
|
2022
2625
|
id
|
|
2023
2626
|
},
|
|
2024
2627
|
isShow: true,
|
|
2025
|
-
selectionSet: "{ id type }"
|
|
2628
|
+
selectionSet: "{ id type name }",
|
|
2629
|
+
transformData: normalizeProjectRowForDisplay
|
|
2026
2630
|
});
|
|
2027
2631
|
});
|
|
2028
2632
|
projects.command("create").requiredOption("--data-json <dataJson>", projectCreateDataJsonHelp).action(async (opts, cmd) => {
|
|
@@ -2071,11 +2675,10 @@ var createHelp = buildDataJsonHelp("rock", "create") ?? 'JSON object for rock or
|
|
|
2071
2675
|
var updateHelp = buildDataJsonHelp("rock", "update") ?? 'JSON object for rock or {"rock": {...}}';
|
|
2072
2676
|
function registerRockCommands(program) {
|
|
2073
2677
|
const rocks = program.command("rocks").description("Rock operations");
|
|
2074
|
-
rocks.command("list").option("--page <page>").option("--per <per>").option("--rock-collection-id <rockCollectionId>").option("--
|
|
2678
|
+
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
2679
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2076
2680
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2077
2681
|
const rockCollectionId = opts.rockCollectionId ? rockCollectionIdSchema.parse(opts.rockCollectionId) : void 0;
|
|
2078
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2079
2682
|
await runGraphqlQueryCommand({
|
|
2080
2683
|
command: "rocks.list",
|
|
2081
2684
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2085,18 +2688,13 @@ function registerRockCommands(program) {
|
|
|
2085
2688
|
page: opts.page,
|
|
2086
2689
|
per: opts.per,
|
|
2087
2690
|
rock_collection_id: rockCollectionId,
|
|
2691
|
+
start_date: opts.startDate,
|
|
2692
|
+
rock_type: opts.rockType,
|
|
2088
2693
|
team_id: opts.teamId,
|
|
2089
|
-
team_ids: opts.teamIds,
|
|
2090
2694
|
member_id: opts.memberId,
|
|
2091
2695
|
meeting_id: opts.meetingId,
|
|
2092
2696
|
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
|
|
2697
|
+
quarterly_objective_id: opts.quarterlyObjectiveId
|
|
2100
2698
|
}),
|
|
2101
2699
|
isList: true
|
|
2102
2700
|
});
|
|
@@ -2307,24 +2905,23 @@ function normalizeMeetingCreateBody(body) {
|
|
|
2307
2905
|
}
|
|
2308
2906
|
function registerMeetingCommands(program) {
|
|
2309
2907
|
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("--
|
|
2908
|
+
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
2909
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2312
2910
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2313
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2314
2911
|
await runGraphqlQueryCommand({
|
|
2315
2912
|
command: "meetings.list",
|
|
2316
2913
|
runtimeOptions: context.runtimeOptions,
|
|
2317
2914
|
field: "meetings",
|
|
2318
2915
|
variables: normalizeGraphqlVariables2({
|
|
2319
2916
|
organization_id: organizationId,
|
|
2917
|
+
page: opts.page,
|
|
2320
2918
|
per: opts.per,
|
|
2321
2919
|
date: opts.date,
|
|
2322
2920
|
occurrence_date: opts.occurrenceDate,
|
|
2323
2921
|
past: opts.past,
|
|
2324
2922
|
start_time: opts.startTime,
|
|
2325
2923
|
today_and_active: opts.todayAndActive,
|
|
2326
|
-
|
|
2327
|
-
...extra
|
|
2924
|
+
type: opts.type
|
|
2328
2925
|
}),
|
|
2329
2926
|
isList: true
|
|
2330
2927
|
});
|
|
@@ -2404,10 +3001,9 @@ var createHelp3 = buildDataJsonHelp("member", "create") ?? 'JSON object for memb
|
|
|
2404
3001
|
var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for member or {"member": {...}}';
|
|
2405
3002
|
function registerMemberCommands(program) {
|
|
2406
3003
|
const members = program.command("members").description("Member operations");
|
|
2407
|
-
members.command("list").option("--page <page>").option("--per <per>").
|
|
3004
|
+
members.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
2408
3005
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2409
3006
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2410
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2411
3007
|
await runGraphqlQueryCommand({
|
|
2412
3008
|
command: "members.list",
|
|
2413
3009
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2415,8 +3011,7 @@ function registerMemberCommands(program) {
|
|
|
2415
3011
|
variables: normalizeGraphqlVariables2({
|
|
2416
3012
|
organization_id: organizationId,
|
|
2417
3013
|
page: opts.page,
|
|
2418
|
-
per: opts.per
|
|
2419
|
-
...extra
|
|
3014
|
+
per: opts.per
|
|
2420
3015
|
}),
|
|
2421
3016
|
isList: true
|
|
2422
3017
|
});
|
|
@@ -2479,10 +3074,9 @@ var issueTypeSchema = import_zod8.z.string().min(1).refine((value) => value ===
|
|
|
2479
3074
|
var updateHelp4 = buildDataJsonHelp("issue", "update") ?? 'JSON object for issue or {"issue": {...}}';
|
|
2480
3075
|
function registerIssueCommands(program) {
|
|
2481
3076
|
const issues = program.command("issues").description("Issue operations");
|
|
2482
|
-
issues.command("list").option("--page <page>").option("--per <per>").option("--issue-group-id <issueGroupId>").option("--
|
|
3077
|
+
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
3078
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2484
3079
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2485
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2486
3080
|
await runGraphqlQueryCommand({
|
|
2487
3081
|
command: "issues.list",
|
|
2488
3082
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -2492,13 +3086,11 @@ function registerIssueCommands(program) {
|
|
|
2492
3086
|
page: opts.page,
|
|
2493
3087
|
per: opts.per,
|
|
2494
3088
|
issue_group_id: opts.issueGroupId,
|
|
3089
|
+
start_date: opts.startDate,
|
|
3090
|
+
issue_type: opts.issueType,
|
|
2495
3091
|
team_id: opts.teamId,
|
|
2496
|
-
team_ids: opts.teamIds,
|
|
2497
3092
|
member_id: opts.memberId,
|
|
2498
|
-
meeting_id: opts.meetingId
|
|
2499
|
-
rank_direction: opts.rankDirection,
|
|
2500
|
-
include_archived: opts.includeArchived,
|
|
2501
|
-
...extra
|
|
3093
|
+
meeting_id: opts.meetingId
|
|
2502
3094
|
}),
|
|
2503
3095
|
isList: true
|
|
2504
3096
|
});
|
|
@@ -2765,12 +3357,12 @@ var SCORECARD_INTERVALS = /* @__PURE__ */ new Set([
|
|
|
2765
3357
|
"yearly"
|
|
2766
3358
|
]);
|
|
2767
3359
|
var SCORECARD_TRENDS = /* @__PURE__ */ new Set(["average", "total"]);
|
|
2768
|
-
function
|
|
3360
|
+
function isRecord2(value) {
|
|
2769
3361
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2770
3362
|
}
|
|
2771
3363
|
function ensureEntityObject(body, rootKey) {
|
|
2772
3364
|
const entity = body[rootKey];
|
|
2773
|
-
if (!
|
|
3365
|
+
if (!isRecord2(entity)) {
|
|
2774
3366
|
throw new CliError({
|
|
2775
3367
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
2776
3368
|
kind: "invalid_args",
|
|
@@ -3216,7 +3808,9 @@ function registerSystemToolCommands(program) {
|
|
|
3216
3808
|
description: "List operations",
|
|
3217
3809
|
resourcePath: "lists",
|
|
3218
3810
|
rootKey: "list",
|
|
3219
|
-
listParams: ["
|
|
3811
|
+
listParams: ["member_id", "team_ids"],
|
|
3812
|
+
showParams: ["current_member_id"],
|
|
3813
|
+
allowQueryJson: false
|
|
3220
3814
|
});
|
|
3221
3815
|
registerEntityCrudCommands(program, {
|
|
3222
3816
|
command: "list-items",
|
|
@@ -3224,32 +3818,26 @@ function registerSystemToolCommands(program) {
|
|
|
3224
3818
|
resourcePath: "list_items",
|
|
3225
3819
|
rootKey: "list_item",
|
|
3226
3820
|
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
|
-
]
|
|
3821
|
+
listParams: ["list_id", "meeting_id", "open", "team_id", "member_id", "include_archived"],
|
|
3822
|
+
allowQueryJson: false
|
|
3239
3823
|
});
|
|
3240
3824
|
registerEntityCrudCommands(program, {
|
|
3241
3825
|
command: "issue-groups",
|
|
3242
3826
|
description: "Issue group operations",
|
|
3243
3827
|
resourcePath: "issue_groups",
|
|
3244
3828
|
rootKey: "issue_group",
|
|
3245
|
-
listParams: ["
|
|
3829
|
+
listParams: ["member_id", "team_ids"],
|
|
3830
|
+
showParams: ["current_member_id"],
|
|
3831
|
+
allowQueryJson: false
|
|
3246
3832
|
});
|
|
3247
3833
|
registerEntityCrudCommands(program, {
|
|
3248
3834
|
command: "todo-groups",
|
|
3249
3835
|
description: "To-do group operations",
|
|
3250
3836
|
resourcePath: "todo_groups",
|
|
3251
3837
|
rootKey: "todo_group",
|
|
3252
|
-
listParams: ["
|
|
3838
|
+
listParams: ["member_id", "team_ids"],
|
|
3839
|
+
showParams: ["current_member_id"],
|
|
3840
|
+
allowQueryJson: false
|
|
3253
3841
|
});
|
|
3254
3842
|
registerEntityCrudCommands(program, {
|
|
3255
3843
|
command: "todos",
|
|
@@ -3258,22 +3846,17 @@ function registerSystemToolCommands(program) {
|
|
|
3258
3846
|
rootKey: "todo",
|
|
3259
3847
|
requiredCreateFields: ["todo_group_id"],
|
|
3260
3848
|
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
|
-
]
|
|
3849
|
+
listParams: ["todo_group_id", "start_date", "team_id", "member_id"],
|
|
3850
|
+
allowQueryJson: false
|
|
3270
3851
|
});
|
|
3271
3852
|
registerEntityCrudCommands(program, {
|
|
3272
3853
|
command: "rock-collections",
|
|
3273
3854
|
description: "Rock collection operations",
|
|
3274
3855
|
resourcePath: "rock_collections",
|
|
3275
3856
|
rootKey: "rock_collection",
|
|
3276
|
-
listParams: ["
|
|
3857
|
+
listParams: ["member_id", "team_ids"],
|
|
3858
|
+
showParams: ["current_member_id"],
|
|
3859
|
+
allowQueryJson: false
|
|
3277
3860
|
});
|
|
3278
3861
|
registerEntityCrudCommands(program, {
|
|
3279
3862
|
command: "knowledge",
|
|
@@ -3284,13 +3867,21 @@ function registerSystemToolCommands(program) {
|
|
|
3284
3867
|
listParams: [
|
|
3285
3868
|
"assigned",
|
|
3286
3869
|
"contentable_id",
|
|
3870
|
+
"contentable_ids",
|
|
3871
|
+
"content_type",
|
|
3287
3872
|
"contentable_type",
|
|
3288
|
-
"
|
|
3289
|
-
"
|
|
3873
|
+
"focus_member_id",
|
|
3874
|
+
"focus_team_id",
|
|
3290
3875
|
"member_id",
|
|
3291
3876
|
"parent_content_id",
|
|
3292
|
-
"
|
|
3293
|
-
|
|
3877
|
+
"sort",
|
|
3878
|
+
"status",
|
|
3879
|
+
"team_id",
|
|
3880
|
+
"term",
|
|
3881
|
+
"type"
|
|
3882
|
+
],
|
|
3883
|
+
showParams: ["include_all_rollups"],
|
|
3884
|
+
allowQueryJson: false
|
|
3294
3885
|
});
|
|
3295
3886
|
registerEntityCrudCommands(program, {
|
|
3296
3887
|
command: "stand-ups",
|
|
@@ -3303,8 +3894,10 @@ function registerSystemToolCommands(program) {
|
|
|
3303
3894
|
"date",
|
|
3304
3895
|
"end_date",
|
|
3305
3896
|
"start_date",
|
|
3897
|
+
"team_id",
|
|
3306
3898
|
"use_week_range"
|
|
3307
|
-
]
|
|
3899
|
+
],
|
|
3900
|
+
allowQueryJson: false
|
|
3308
3901
|
});
|
|
3309
3902
|
registerEntityCrudCommands(program, {
|
|
3310
3903
|
command: "news",
|
|
@@ -3313,7 +3906,8 @@ function registerSystemToolCommands(program) {
|
|
|
3313
3906
|
rootKey: "headline",
|
|
3314
3907
|
requiredCreateFields: ["member_id", "status", "headline_type"],
|
|
3315
3908
|
normalizeCreateBody: normalizeNewsCreateBody,
|
|
3316
|
-
listParams: ["meeting_id", "unread"],
|
|
3909
|
+
listParams: ["meeting_id", "team_id", "unread"],
|
|
3910
|
+
allowQueryJson: false,
|
|
3317
3911
|
showQueryFactory: ({ id, organizationId }) => ({
|
|
3318
3912
|
field: "headlines",
|
|
3319
3913
|
variables: {
|
|
@@ -3321,7 +3915,7 @@ function registerSystemToolCommands(program) {
|
|
|
3321
3915
|
page: 1,
|
|
3322
3916
|
per: 200
|
|
3323
3917
|
},
|
|
3324
|
-
selectionSet: "{ data { id type attributes } count currentPage totalPages }",
|
|
3918
|
+
selectionSet: "{ data { id type slug summary description memberId status rank createdAt updatedAt headlineType teamIds meetingId labelIds attributes } count currentPage totalPages }",
|
|
3325
3919
|
transformData: (value) => {
|
|
3326
3920
|
if (!value || typeof value !== "object") {
|
|
3327
3921
|
return null;
|
|
@@ -3345,16 +3939,20 @@ function registerSystemToolCommands(program) {
|
|
|
3345
3939
|
requiredCreateFields: ["member_id", "name"],
|
|
3346
3940
|
normalizeCreateBody: normalizeQuestionsCreateBody,
|
|
3347
3941
|
normalizeUpdateBody: normalizeQuestionsUpdateBody,
|
|
3348
|
-
listParams: ["answered", "asked",
|
|
3942
|
+
listParams: ["answered", "asked"],
|
|
3943
|
+
allowQueryJson: false
|
|
3349
3944
|
});
|
|
3350
3945
|
registerEntityCrudCommands(program, {
|
|
3351
3946
|
command: "pulse",
|
|
3352
3947
|
description: "Pulse operations",
|
|
3353
3948
|
resourcePath: "health_updates",
|
|
3354
3949
|
rootKey: "health_update",
|
|
3950
|
+
listField: "feedbacks",
|
|
3951
|
+
showField: "feedback",
|
|
3355
3952
|
requiredCreateFields: ["health_updatable_id", "health_updatable_type", "member_id", "status"],
|
|
3356
3953
|
normalizeCreateBody: normalizePulseCreateBody,
|
|
3357
|
-
listParams: ["
|
|
3954
|
+
listParams: ["last", "latest", "start_date", "name", "quarter", "year"],
|
|
3955
|
+
allowQueryJson: false
|
|
3358
3956
|
});
|
|
3359
3957
|
registerEntityCrudCommands(program, {
|
|
3360
3958
|
command: "surveys",
|
|
@@ -3364,7 +3962,8 @@ function registerSystemToolCommands(program) {
|
|
|
3364
3962
|
requiredCreateFields: ["name", "recipient_type"],
|
|
3365
3963
|
normalizeCreateBody: normalizeSurveysCreateBody,
|
|
3366
3964
|
normalizeUpdateBody: normalizeSurveysUpdateBody,
|
|
3367
|
-
listParams: ["completed", "current_member", "due", "exclude_completed"]
|
|
3965
|
+
listParams: ["completed", "current_member", "due", "exclude_completed", "sent"],
|
|
3966
|
+
allowQueryJson: false
|
|
3368
3967
|
});
|
|
3369
3968
|
registerEntityCrudCommands(program, {
|
|
3370
3969
|
command: "feedbacks",
|
|
@@ -3374,7 +3973,8 @@ function registerSystemToolCommands(program) {
|
|
|
3374
3973
|
requiredCreateFields: ["name", "quarter", "year"],
|
|
3375
3974
|
normalizeCreateBody: normalizeFeedbacksCreateBody,
|
|
3376
3975
|
normalizeUpdateBody: normalizeFeedbacksUpdateBody,
|
|
3377
|
-
listParams: ["last", "latest", "start_date"]
|
|
3976
|
+
listParams: ["last", "latest", "start_date"],
|
|
3977
|
+
allowQueryJson: false
|
|
3378
3978
|
});
|
|
3379
3979
|
registerEntityCrudCommands(program, {
|
|
3380
3980
|
command: "accountability",
|
|
@@ -3384,7 +3984,8 @@ function registerSystemToolCommands(program) {
|
|
|
3384
3984
|
requiredCreateFields: ["name", "member_id"],
|
|
3385
3985
|
normalizeCreateBody: normalizeAccountabilityCreateBody,
|
|
3386
3986
|
normalizeUpdateBody: normalizeAccountabilityUpdateBody,
|
|
3387
|
-
listParams: [
|
|
3987
|
+
listParams: [],
|
|
3988
|
+
allowQueryJson: false
|
|
3388
3989
|
});
|
|
3389
3990
|
registerEntityCrudCommands(program, {
|
|
3390
3991
|
command: "kpis",
|
|
@@ -3395,24 +3996,16 @@ function registerSystemToolCommands(program) {
|
|
|
3395
3996
|
body,
|
|
3396
3997
|
organizationId
|
|
3397
3998
|
}),
|
|
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
|
-
]
|
|
3999
|
+
listParams: ["team_id", "member_id", "smart_kpi_view_id", "quarterly_objective_id"],
|
|
4000
|
+
allowQueryJson: false
|
|
3409
4001
|
});
|
|
3410
4002
|
registerEntityCrudCommands(program, {
|
|
3411
4003
|
command: "scorecard-groups",
|
|
3412
4004
|
description: "Scorecard group operations",
|
|
3413
4005
|
resourcePath: "measurable_groups",
|
|
3414
4006
|
rootKey: "measurable_group",
|
|
3415
|
-
listParams: ["include_archived", "member_id", "name", "sort", "team_ids", "term"]
|
|
4007
|
+
listParams: ["include_archived", "member_id", "name", "sort", "team_ids", "term"],
|
|
4008
|
+
allowQueryJson: false
|
|
3416
4009
|
});
|
|
3417
4010
|
registerEntityCrudCommands(program, {
|
|
3418
4011
|
command: "scorecards",
|
|
@@ -3432,21 +4025,24 @@ function registerSystemToolCommands(program) {
|
|
|
3432
4025
|
"sort",
|
|
3433
4026
|
"team_id",
|
|
3434
4027
|
"team_ids"
|
|
3435
|
-
]
|
|
4028
|
+
],
|
|
4029
|
+
allowQueryJson: false
|
|
3436
4030
|
});
|
|
3437
4031
|
registerEntityCrudCommands(program, {
|
|
3438
4032
|
command: "customers",
|
|
3439
4033
|
description: "CRM customer operations",
|
|
3440
4034
|
resourcePath: "customers",
|
|
3441
4035
|
rootKey: "customer",
|
|
3442
|
-
listParams: ["
|
|
4036
|
+
listParams: ["project_id", "meeting_id", "open", "team_id", "member_id"],
|
|
4037
|
+
allowQueryJson: false
|
|
3443
4038
|
});
|
|
3444
4039
|
registerEntityCrudCommands(program, {
|
|
3445
4040
|
command: "contacts",
|
|
3446
4041
|
description: "CRM contact operations",
|
|
3447
4042
|
resourcePath: "contacts",
|
|
3448
4043
|
rootKey: "contact",
|
|
3449
|
-
listParams: ["customer_id", "member_id",
|
|
4044
|
+
listParams: ["customer_id", "member_id"],
|
|
4045
|
+
allowQueryJson: false
|
|
3450
4046
|
});
|
|
3451
4047
|
}
|
|
3452
4048
|
|
|
@@ -3455,10 +4051,9 @@ var import_zod9 = require("zod");
|
|
|
3455
4051
|
var idSchema8 = import_zod9.z.string().min(1);
|
|
3456
4052
|
function registerTeamCommands(program) {
|
|
3457
4053
|
const teams = program.command("teams").description("Team operations");
|
|
3458
|
-
teams.command("list").option("--page <page>").option("--per <per>").
|
|
4054
|
+
teams.command("list").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
3459
4055
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3460
4056
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3461
|
-
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
3462
4057
|
await runGraphqlQueryCommand({
|
|
3463
4058
|
command: "teams.list",
|
|
3464
4059
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -3466,8 +4061,7 @@ function registerTeamCommands(program) {
|
|
|
3466
4061
|
variables: normalizeGraphqlVariables2({
|
|
3467
4062
|
organization_id: organizationId,
|
|
3468
4063
|
page: opts.page,
|
|
3469
|
-
per: opts.per
|
|
3470
|
-
...extra
|
|
4064
|
+
per: opts.per
|
|
3471
4065
|
}),
|
|
3472
4066
|
isList: true
|
|
3473
4067
|
});
|
|
@@ -3522,12 +4116,12 @@ function registerTeamCommands(program) {
|
|
|
3522
4116
|
// src/commands/organizations.ts
|
|
3523
4117
|
var import_zod10 = require("zod");
|
|
3524
4118
|
var idSchema9 = import_zod10.z.string().min(1);
|
|
3525
|
-
function
|
|
4119
|
+
function isRecord3(value) {
|
|
3526
4120
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3527
4121
|
}
|
|
3528
4122
|
function ensureRootObject(body, rootKey) {
|
|
3529
4123
|
const root = body[rootKey];
|
|
3530
|
-
if (!
|
|
4124
|
+
if (!isRecord3(root)) {
|
|
3531
4125
|
throw new CliError({
|
|
3532
4126
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
3533
4127
|
kind: "invalid_args",
|
|
@@ -3546,7 +4140,7 @@ function asNonEmptyString4(value) {
|
|
|
3546
4140
|
}
|
|
3547
4141
|
function normalizeOrganizationUpdateBody(body) {
|
|
3548
4142
|
const organization = ensureRootObject(body, "organization");
|
|
3549
|
-
const detail =
|
|
4143
|
+
const detail = isRecord3(organization.organization_detail_attributes) ? { ...organization.organization_detail_attributes } : {};
|
|
3550
4144
|
const workspaceName = asNonEmptyString4(organization.workspace_name);
|
|
3551
4145
|
if (workspaceName) {
|
|
3552
4146
|
detail.workspace_name = workspaceName;
|
|
@@ -3559,10 +4153,10 @@ function normalizeOrganizationUpdateBody(body) {
|
|
|
3559
4153
|
}
|
|
3560
4154
|
function normalizeOrganizationMetaProfileUpdateBody(body) {
|
|
3561
4155
|
const root = ensureRootObject(body, "organization_meta_profile");
|
|
3562
|
-
const profile =
|
|
4156
|
+
const profile = isRecord3(root.profile) ? { ...root.profile } : {};
|
|
3563
4157
|
const title = asNonEmptyString4(root.title);
|
|
3564
4158
|
if (title) {
|
|
3565
|
-
const companyIdentity =
|
|
4159
|
+
const companyIdentity = isRecord3(profile.company_identity) ? { ...profile.company_identity } : {};
|
|
3566
4160
|
companyIdentity.one_sentence_summary = title;
|
|
3567
4161
|
profile.company_identity = companyIdentity;
|
|
3568
4162
|
}
|
|
@@ -3589,10 +4183,10 @@ function normalizeOrganizationMetaProfileUpdateBody(body) {
|
|
|
3589
4183
|
}
|
|
3590
4184
|
function normalizeKeyMetricMetaProfileUpdateBody(body) {
|
|
3591
4185
|
const root = ensureRootObject(body, "key_metric_meta_profile");
|
|
3592
|
-
const profile =
|
|
4186
|
+
const profile = isRecord3(root.profile) ? { ...root.profile } : {};
|
|
3593
4187
|
const annualRevenue = asNonEmptyString4(root.annual_revenue);
|
|
3594
4188
|
if (annualRevenue) {
|
|
3595
|
-
const financial =
|
|
4189
|
+
const financial = isRecord3(profile.financial) ? { ...profile.financial } : {};
|
|
3596
4190
|
financial.revenue = annualRevenue;
|
|
3597
4191
|
profile.financial = financial;
|
|
3598
4192
|
}
|
|
@@ -3746,12 +4340,12 @@ var STRATEGIC_OBJECTIVE_ALLOWED_UPDATE_KEYS = /* @__PURE__ */ new Set([
|
|
|
3746
4340
|
"published_at",
|
|
3747
4341
|
"strategic_objective_reads_attributes"
|
|
3748
4342
|
]);
|
|
3749
|
-
function
|
|
4343
|
+
function isRecord4(value) {
|
|
3750
4344
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3751
4345
|
}
|
|
3752
4346
|
function ensureRootObject2(body, rootKey) {
|
|
3753
4347
|
const root = body[rootKey];
|
|
3754
|
-
if (!
|
|
4348
|
+
if (!isRecord4(root)) {
|
|
3755
4349
|
throw new CliError({
|
|
3756
4350
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
3757
4351
|
kind: "invalid_args",
|
|
@@ -3919,7 +4513,8 @@ function registerFoundationCommands(program) {
|
|
|
3919
4513
|
rootKey: "annual_objective",
|
|
3920
4514
|
requiredCreateFields: ["strategic_objective_id", "name"],
|
|
3921
4515
|
normalizeCreateBody: normalizeAnnualObjectiveCreateBody,
|
|
3922
|
-
listParams: []
|
|
4516
|
+
listParams: [],
|
|
4517
|
+
allowQueryJson: false
|
|
3923
4518
|
});
|
|
3924
4519
|
registerEntityCrudCommands(foundation, {
|
|
3925
4520
|
command: "quarterly-objectives",
|
|
@@ -3928,7 +4523,8 @@ function registerFoundationCommands(program) {
|
|
|
3928
4523
|
rootKey: "quarterly_objective",
|
|
3929
4524
|
requiredCreateFields: ["strategic_objective_id", "annual_objective_id", "name"],
|
|
3930
4525
|
normalizeCreateBody: normalizeQuarterlyObjectiveCreateBody,
|
|
3931
|
-
listParams: [
|
|
4526
|
+
listParams: [],
|
|
4527
|
+
allowQueryJson: false
|
|
3932
4528
|
});
|
|
3933
4529
|
}
|
|
3934
4530
|
|
|
@@ -4286,7 +4882,7 @@ function registerNoteCommands(program) {
|
|
|
4286
4882
|
per: opts.per
|
|
4287
4883
|
}),
|
|
4288
4884
|
isList: true,
|
|
4289
|
-
selectionSet: "{ count currentPage totalPages data { id type name
|
|
4885
|
+
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
4886
|
});
|
|
4291
4887
|
});
|
|
4292
4888
|
notes.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
@@ -4303,7 +4899,7 @@ function registerNoteCommands(program) {
|
|
|
4303
4899
|
id
|
|
4304
4900
|
}),
|
|
4305
4901
|
isShow: true,
|
|
4306
|
-
selectionSet: "{ id type name
|
|
4902
|
+
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
4903
|
});
|
|
4308
4904
|
});
|
|
4309
4905
|
notes.command("update").requiredOption("--id <id>").option("--name <name>").option("--body <body>").option("--status <status>").action(async (opts, cmd) => {
|
|
@@ -4589,7 +5185,7 @@ var import_zod15 = require("zod");
|
|
|
4589
5185
|
|
|
4590
5186
|
// src/internalOptions.ts
|
|
4591
5187
|
var INTERNAL_OPTIONS_KEY = "__waveInternalOptions";
|
|
4592
|
-
function
|
|
5188
|
+
function asRecord3(value) {
|
|
4593
5189
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
4594
5190
|
return null;
|
|
4595
5191
|
}
|
|
@@ -4603,7 +5199,7 @@ function setInternalCliOptions(program, options) {
|
|
|
4603
5199
|
function getInternalCliOptions(command) {
|
|
4604
5200
|
let current = command;
|
|
4605
5201
|
while (current) {
|
|
4606
|
-
const record =
|
|
5202
|
+
const record = asRecord3(current[INTERNAL_OPTIONS_KEY]);
|
|
4607
5203
|
if (record) {
|
|
4608
5204
|
return {
|
|
4609
5205
|
enableRetryOnEmptyPhrase: record.enableRetryOnEmptyPhrase === true
|