@@ -2,14 +2,6 @@ import linearApp from "../../linear.app.mjs";
22
33const DEFAULT_CONNECTION_LIMIT = 50 ;
44
5- const toIsoString = ( value ) => value ?. toISOString ?. ( ) ?? null ;
6- const toPageInfo = ( pageInfo ) => pageInfo && ( {
7- endCursor : pageInfo . endCursor ,
8- hasNextPage : pageInfo . hasNextPage ,
9- hasPreviousPage : pageInfo . hasPreviousPage ,
10- startCursor : pageInfo . startCursor ,
11- } ) ;
12-
135export default {
146 key : "linear-get-current-user" ,
157 name : "Get Current User" ,
@@ -42,119 +34,14 @@ export default {
4234 } ) ,
4335 ] ) ;
4436
45- const teams = teamsConnection ?. nodes ?. map ( ( team ) => ( {
46- id : team . id ,
47- key : team . key ,
48- name : team . name ,
49- displayName : team . displayName ,
50- description : team . description ,
51- icon : team . icon ,
52- color : team . color ,
53- private : team . private ,
54- timezone : team . timezone ,
55- inviteHash : team . inviteHash ,
56- issueCount : team . issueCount ,
57- cycleDuration : team . cycleDuration ,
58- cyclesEnabled : team . cyclesEnabled ,
59- triageEnabled : team . triageEnabled ,
60- createdAt : toIsoString ( team . createdAt ) ,
61- updatedAt : toIsoString ( team . updatedAt ) ,
62- } ) ) ?? [ ] ;
63-
64- const user = {
65- id : viewer . id ,
66- name : viewer . name ,
67- displayName : viewer . displayName ,
68- email : viewer . email ,
69- active : viewer . active ,
70- admin : viewer . admin ,
71- guest : viewer . guest ,
72- description : viewer . description ,
73- disableReason : viewer . disableReason ,
74- timezone : viewer . timezone ,
75- statusEmoji : viewer . statusEmoji ,
76- statusLabel : viewer . statusLabel ,
77- isAssignable : viewer . isAssignable ,
78- isMentionable : viewer . isMentionable ,
79- avatarUrl : viewer . avatarUrl ,
80- url : viewer . url ,
81- calendarHash : viewer . calendarHash ,
82- inviteHash : viewer . inviteHash ,
83- initials : viewer . initials ,
84- createdIssueCount : viewer . createdIssueCount ,
85- createdAt : toIsoString ( viewer . createdAt ) ,
86- updatedAt : toIsoString ( viewer . updatedAt ) ,
87- archivedAt : toIsoString ( viewer . archivedAt ) ,
88- lastSeen : toIsoString ( viewer . lastSeen ) ,
89- statusUntilAt : toIsoString ( viewer . statusUntilAt ) ,
90- } ;
91-
92- const teamMemberships = teamMembershipsConnection ?. nodes ?. map ( ( membership ) => ( {
93- id : membership . id ,
94- owner : membership . owner ,
95- sortOrder : membership . sortOrder ,
96- teamId : membership . teamId ,
97- userId : membership . userId ,
98- createdAt : toIsoString ( membership . createdAt ) ,
99- updatedAt : toIsoString ( membership . updatedAt ) ,
100- archivedAt : toIsoString ( membership . archivedAt ) ,
101- } ) ) ?? [ ] ;
102-
103- const organizationData = organization && {
104- id : organization . id ,
105- name : organization . name ,
106- urlKey : organization . urlKey ,
107- allowedAuthServices : organization . allowedAuthServices ,
108- allowMembersToInvite : organization . allowMembersToInvite ,
109- customersEnabled : organization . customersEnabled ,
110- feedEnabled : organization . feedEnabled ,
111- gitBranchFormat : organization . gitBranchFormat ,
112- gitLinkbackMessagesEnabled : organization . gitLinkbackMessagesEnabled ,
113- gitPublicLinkbackMessagesEnabled : organization . gitPublicLinkbackMessagesEnabled ,
114- initiativeUpdateReminderFrequencyInWeeks :
115- organization . initiativeUpdateReminderFrequencyInWeeks ,
116- initiativeUpdateRemindersDay : organization . initiativeUpdateRemindersDay ,
117- initiativeUpdateRemindersHour : organization . initiativeUpdateRemindersHour ,
118- projectUpdateReminderFrequencyInWeeks :
119- organization . projectUpdateReminderFrequencyInWeeks ,
120- projectUpdateRemindersDay : organization . projectUpdateRemindersDay ,
121- projectUpdateRemindersHour : organization . projectUpdateRemindersHour ,
122- projectUpdatesReminderFrequency : organization . projectUpdatesReminderFrequency ,
123- restrictLabelManagementToAdmins : organization . restrictLabelManagementToAdmins ,
124- restrictTeamCreationToAdmins : organization . restrictTeamCreationToAdmins ,
125- roadmapEnabled : organization . roadmapEnabled ,
126- samlEnabled : organization . samlEnabled ,
127- scimEnabled : organization . scimEnabled ,
128- releaseChannel : organization . releaseChannel ,
129- fiscalYearStartMonth : organization . fiscalYearStartMonth ,
130- slaDayCount : organization . slaDayCount ,
131- previousUrlKeys : organization . previousUrlKeys ,
132- logoUrl : organization . logoUrl ,
133- createdIssueCount : organization . createdIssueCount ,
134- customerCount : organization . customerCount ,
135- periodUploadVolume : organization . periodUploadVolume ,
136- userCount : organization . userCount ,
137- trialEndsAt : toIsoString ( organization . trialEndsAt ) ,
138- deletionRequestedAt : toIsoString ( organization . deletionRequestedAt ) ,
139- archivedAt : toIsoString ( organization . archivedAt ) ,
140- createdAt : toIsoString ( organization . createdAt ) ,
141- updatedAt : toIsoString ( organization . updatedAt ) ,
142- } ;
143-
144- const summaryIdentifier = user . name || user . displayName || user . email || user . id ;
37+ const summaryIdentifier = viewer . name || viewer . displayName || viewer . email || viewer . id ;
14538 $ . export ( "$summary" , `Retrieved Linear user ${ summaryIdentifier } ` ) ;
14639
14740 return {
148- user,
149- organization : organizationData ,
150- teams : {
151- nodes : teams ,
152- pageInfo : toPageInfo ( teamsConnection ?. pageInfo ) ,
153- } ,
154- teamMemberships : {
155- nodes : teamMemberships ,
156- pageInfo : toPageInfo ( teamMembershipsConnection ?. pageInfo ) ,
157- } ,
41+ user : viewer ,
42+ organization,
43+ teams : teamsConnection ,
44+ teamMemberships : teamMembershipsConnection ,
15845 } ;
15946 } ,
16047} ;
0 commit comments