@2digits/tlo-mcp 0.1.27 → 0.1.29
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/dist/TloLive-BTpDuZnK.mjs +1 -0
- package/dist/bin.mjs +1 -1
- package/dist/index.d.mts +293 -584
- package/dist/index.mjs +1 -1
- package/package.json +7 -14
- package/dist/TloLive-CRb5JiMF.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"effect/Context";import*as t from"effect/Effect";import*as n from"effect/Layer";import*as r from"effect/Match";import*as i from"effect/Option";import*as a from"effect/Record";import*as ee from"effect/Redacted";import*as o from"effect/Schema";import*as s from"effect/unstable/http/HttpBody";import*as te from"effect/unstable/http/UrlParams";import*as c from"effect/unstable/http/Cookies";import*as l from"effect/unstable/http/HttpClient";import*as u from"effect/unstable/http/HttpClientRequest";import*as d from"effect/Array";import*as f from"effect/String";import*as p from"effect/Config";import*as m from"effect/unstable/http/FetchHttpClient";var h=class extends e.Service()(`@2digits/tlo-mcp/services/TloConfig`){},g=class extends o.TaggedError()(`TloApiError`,{message:o.String,code:o.optional(o.String),endpoint:o.optional(o.String)}){},_=class extends o.TaggedError()(`TloAuthError`,{message:o.String}){},v=class extends o.TaggedError()(`TloNetworkError`,{message:o.String,cause:o.optional(o.Unknown),endpoint:o.optional(o.String)}){},y=class extends o.TaggedError()(`TloParseError`,{message:o.String,cause:o.optional(o.Unknown)}){};const ne=o.Union([g,_,v,y]);var b=class extends e.Service()(`@2digits/tlo-mcp/services/TloHttpClient`){};const x=n.effect(b,t.gen(function*(){let e=yield*h,t=yield*l.HttpClient,n=c.toCookieHeader(e.cookies),r=t.pipe(l.mapRequest(u.prependUrl(e.baseUrl)),l.mapRequest(u.setHeader(`Cookie`,n)),l.filterStatusOk);return b.of({client:r})}));var S=class extends e.Service()(`@2digits/tlo-mcp/services/TeamLeaderClient`){};const re=o.Struct({MSG:o.String,err:o.Finite}),ie=o.fromJsonString(o.Unknown),ae=/\{MSG:'([^']*)',\s*err:(\d+)\}/;function oe(e){let t=ae.exec(e);return r.value(t).pipe(r.when(r.defined,e=>i.some({MSG:e[1]??`Unknown error`,err:Number(e[2])})),r.orElse(()=>i.none()))}const C=n.effect(S,t.gen(function*(){let e=yield*h,{client:n}=yield*b;return S.of({post:t.fn(`TeamLeaderClient.post`)(function*(i,c,l){let u=a.set(c,`t`,ee.value(e.sessionToken)),d=te.fromInput(u),f=yield*(yield*n.post(i,{body:s.urlParams(d)})).text,p=oe(f);yield*r.value(p).pipe(r.tag(`Some`,({value:e})=>e.err===0?t.void:g.make({message:e.MSG,endpoint:i})),r.tag(`None`,()=>t.void),r.exhaustive);let m=yield*o.decodeEffect(ie)(f).pipe(t.mapError(e=>y.make({message:`Invalid JSON response`,cause:e})));return yield*r.value(m).pipe(r.when(o.is(re),e=>e.err===0?t.void:g.make({message:e.MSG,endpoint:i})),r.orElse(()=>t.void)),yield*o.decodeUnknownEffect(l)(m).pipe(t.mapError(e=>y.make({message:`Failed to parse response`,cause:e})))},t.scoped,(e,n)=>e.pipe(t.mapError(e=>r.value(e).pipe(r.when(o.is(g),e=>e),r.when(o.is(y),e=>e),r.orElse(e=>v.make({message:e.response===void 0?`Request failed: ${e.message}`:`HTTP ${e.response.status}`,cause:e,endpoint:n}))))))})})),w=o.Struct({ID:o.Finite,FOLDERID:o.optional(o.Union([o.String,o.Finite])),PROJECT_ID:o.optional(o.Union([o.String,o.Finite])),TASKID:o.Union([o.String,o.Finite]).pipe(o.NullOr,o.optional),TODOID:o.Union([o.String,o.Finite]).pipe(o.NullOr,o.optional),TICKETID:o.Union([o.String,o.Finite]).pipe(o.NullOr,o.optional),CONTACTID:o.optional(o.Union([o.String,o.Finite])),DESCRIPTION:o.NullOr(o.String),DT:o.String,START_DT:o.optional(o.String),END_DT:o.optional(o.String),DURATION:o.Finite,TYPE:o.optional(o.Finite),PROJECT_NAME:o.String.pipe(o.NullOr,o.optional),TASK_NAME:o.String.pipe(o.NullOr,o.optional),CLIENT_NAME:o.String.pipe(o.NullOr,o.optional),FOLDER_NAME:o.String.pipe(o.NullOr,o.optional),ENTITY_NAME:o.String.pipe(o.NullOr,o.optional),PROJECTOWNER_NAME:o.String.pipe(o.NullOr,o.optional),CLIENT_COLOR:o.String.pipe(o.NullOr,o.optional),PROJECT_COLOR:o.String.pipe(o.NullOr,o.optional),PROJECT_STATE:o.String.pipe(o.NullOr,o.optional),TASK_STATE:o.String.pipe(o.NullOr,o.optional),TIMESHEET_STATE:o.String.pipe(o.NullOr,o.optional),BILLING_MODE:o.String.pipe(o.NullOr,o.optional),NON_BILLABLE:o.Finite.pipe(o.NullOr,o.optional),RATE:o.Finite.pipe(o.NullOr,o.optional),VALUE:o.Finite.pipe(o.NullOr,o.optional),PROJECT_START_DT:o.String.pipe(o.NullOr,o.optional),PROJECT_END_DT:o.String.pipe(o.NullOr,o.optional),TASK_START_DT:o.String.pipe(o.NullOr,o.optional),TASK_END_DT:o.String.pipe(o.NullOr,o.optional),READONLY:o.Finite.pipe(o.NullOr,o.optional),TASK_WORKLOAD:o.Finite.pipe(o.NullOr,o.optional)});var T=class extends o.Class(`Activity`)({id:o.Finite,projectId:o.optional(o.String),folderId:o.optional(o.String),taskId:o.String.pipe(o.NullOr,o.optional),todoId:o.String.pipe(o.NullOr,o.optional),ticketId:o.String.pipe(o.NullOr,o.optional),userId:o.optional(o.String),description:o.NullOr(o.String),startDate:o.String,endDate:o.optional(o.String),durationMinutes:o.Finite,projectName:o.String.pipe(o.NullOr,o.optional),taskName:o.String.pipe(o.NullOr,o.optional),clientName:o.String.pipe(o.NullOr,o.optional),folderName:o.String.pipe(o.NullOr,o.optional),entityName:o.String.pipe(o.NullOr,o.optional),projectOwnerName:o.String.pipe(o.NullOr,o.optional),projectState:o.String.pipe(o.NullOr,o.optional),taskState:o.String.pipe(o.NullOr,o.optional),timesheetState:o.String.pipe(o.NullOr,o.optional),billingMode:o.String.pipe(o.NullOr,o.optional),nonBillable:o.Finite.pipe(o.NullOr,o.optional),rate:o.Finite.pipe(o.NullOr,o.optional),value:o.Finite.pipe(o.NullOr,o.optional),projectStartDate:o.String.pipe(o.NullOr,o.optional),projectEndDate:o.String.pipe(o.NullOr,o.optional),taskStartDate:o.String.pipe(o.NullOr,o.optional),taskEndDate:o.String.pipe(o.NullOr,o.optional),readOnly:o.Boolean.pipe(o.NullOr,o.optional),taskWorkload:o.Finite.pipe(o.NullOr,o.optional),projectColor:o.optional(o.String),clientColor:o.optional(o.String)}){};function E(e){return T.make({id:e.ID,projectId:e.PROJECT_ID===void 0?e.FOLDERID===void 0?void 0:String(e.FOLDERID):String(e.PROJECT_ID),folderId:e.FOLDERID===void 0?void 0:String(e.FOLDERID),taskId:e.TASKID!==void 0&&e.TASKID!==null?String(e.TASKID):null,todoId:e.TODOID!==void 0&&e.TODOID!==null?String(e.TODOID):null,ticketId:e.TICKETID!==void 0&&e.TICKETID!==null?String(e.TICKETID):null,userId:e.CONTACTID===void 0?void 0:String(e.CONTACTID),description:e.DESCRIPTION,startDate:e.DT,endDate:e.END_DT,durationMinutes:e.DURATION,projectName:e.PROJECT_NAME,taskName:e.TASK_NAME,clientName:e.CLIENT_NAME,folderName:e.FOLDER_NAME,entityName:e.ENTITY_NAME,projectOwnerName:e.PROJECTOWNER_NAME,projectState:e.PROJECT_STATE,taskState:e.TASK_STATE,timesheetState:e.TIMESHEET_STATE,billingMode:e.BILLING_MODE,nonBillable:e.NON_BILLABLE,rate:e.RATE,value:e.VALUE,projectStartDate:e.PROJECT_START_DT,projectEndDate:e.PROJECT_END_DT,taskStartDate:e.TASK_START_DT,taskEndDate:e.TASK_END_DT,readOnly:e.READONLY===void 0||e.READONLY===null?void 0:e.READONLY!==0,taskWorkload:e.TASK_WORKLOAD,projectColor:e.PROJECT_COLOR??void 0,clientColor:e.CLIENT_COLOR??void 0})}const se=o.Struct({ACTIVITIES:o.Array(w)}),D=o.Struct({ID:o.Finite,DURATION:o.optional(o.Finite),DT:o.optional(o.String),TYPE:o.optional(o.Finite),DESCRIPTION:o.String.pipe(o.NullOr,o.optional),CLIENT_COLOR:o.optional(o.String),FOLDERID:o.optional(o.Union([o.String,o.Finite]))});function O(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}T${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}`}var k=class extends e.Service()(`@2digits/tlo-mcp/services/TimeService`){};const A=n.effect(k,t.gen(function*(){let e=yield*S;return k.of({getWeek:t.fn(`TimeService.getWeek`)(function*(t,n,r=`Europe/Amsterdam`){let i=yield*e.post(`/ajax/pln/GetWeek`,{DT:O(t),CONTACTID:n,tmz:r},se);return d.map(E)(i.ACTIVITIES)}),createActivity:t.fn(`TimeService.createActivity`)(function*(t){return(yield*e.post(`/ajax/pln/SetActivity`,{ID:0,ACTION:`CREATE`,DT:O(t.startDate),DURATION:t.durationMinutes,FOLDERID:t.folderId,TASKID:t.taskId,TODOID:t.todoId,CONTACTID:t.contactId,CLIENT_COLOR:t.clientColor,DESCRIPTION:t.description},D)).ID}),updateActivity:t.fn(`TimeService.updateActivity`)(function*(t){yield*e.post(`/ajax/pln/SetActivity`,{ID:t.id,ACTION:`MOVE`,DT:t.startDate===void 0?void 0:O(t.startDate),DURATION:t.durationMinutes,DESCRIPTION:t.description},D)}),deleteActivity:t.fn(`TimeService.deleteActivity`)(function*(t){yield*e.post(`/ajax/pln/SetActivity`,{ID:t.id,ACTION:`DELETE`},D)})})})),j=o.Struct({ID:o.Finite,PROJECT_NAME:o.optional(o.String),NAME:o.optional(o.String),STATE:o.optional(o.String),OWNER_NAME:o.optional(o.String),START_DT:o.optional(o.String),END_DT:o.optional(o.String),BILLING_BUDGET:o.optional(o.Finite),BILLING_MODE:o.optional(o.String),BILLING_REMAINING:o.optional(o.Finite),CLIENT_NAME:o.optional(o.String),CLIENT_ID:o.optional(o.Finite),FOLDERID:o.optional(o.Finite),FOLDER_NAME:o.optional(o.String),EXTID:o.optional(o.String),CALC_TOTAL:o.optional(o.Finite),CALC_DONE:o.optional(o.Finite),CALC_PLANNED:o.optional(o.Finite)}),ce=o.Struct({Records:o.Array(j),RecordCount:o.optional(o.Finite)}),le=o.Union([j,o.Struct({Record:j})]);var M=class extends o.Class(`Project`)({id:o.Finite,name:o.String,state:o.optional(o.String),ownerName:o.optional(o.String),startDate:o.optional(o.String),endDate:o.optional(o.String),billingBudget:o.optional(o.Finite),billingMode:o.optional(o.String),billingRemaining:o.optional(o.Finite),clientName:o.optional(o.String),clientId:o.optional(o.Finite),folderId:o.optional(o.Finite),folderName:o.optional(o.String),extId:o.optional(o.String),calcTotal:o.optional(o.Finite),calcDone:o.optional(o.Finite),calcPlanned:o.optional(o.Finite)}){};function N(e){return M.make({id:e.ID,name:e.PROJECT_NAME??e.NAME??``,state:e.STATE,ownerName:e.OWNER_NAME,startDate:e.START_DT,endDate:e.END_DT,billingBudget:e.BILLING_BUDGET,billingMode:e.BILLING_MODE,billingRemaining:e.BILLING_REMAINING,clientName:e.CLIENT_NAME,clientId:e.CLIENT_ID,folderId:e.FOLDERID,folderName:e.FOLDER_NAME,extId:e.EXTID,calcTotal:e.CALC_TOTAL,calcDone:e.CALC_DONE,calcPlanned:e.CALC_PLANNED})}const P=o.Struct({ID:o.Finite,OWNERID:o.optional(o.Finite),OWNER_NAME:o.optional(o.String),AVATAR:o.optional(o.String),CREATED_DT:o.optional(o.String),CONTENT:o.optional(o.String),SUBCONTENT:o.optional(o.String),OBJECTTYPE:o.optional(o.String),OBJECTID:o.optional(o.Finite),OBJECTNAME:o.optional(o.String),MSGTYPE:o.optional(o.String),LIKECNT:o.optional(o.Finite),REPLYCNT:o.optional(o.Finite),OUTQUEUEID:o.optional(o.String),INTERNAL:o.optional(o.Finite)}),F=o.Array(P);var I=class extends o.Class(`Message`)({id:o.Finite,ownerId:o.optional(o.Finite),ownerName:o.optional(o.String),avatar:o.optional(o.String),createdAt:o.optional(o.String),content:o.optional(o.String),subcontent:o.optional(o.String),objectType:o.optional(o.String),objectId:o.optional(o.Finite),objectName:o.optional(o.String),messageType:o.optional(o.String),likeCount:o.optional(o.Finite),replyCount:o.optional(o.Finite),outQueueId:o.optional(o.String),internal:o.optional(o.Boolean)}){};function L(e){return I.make({id:e.ID,ownerId:e.OWNERID,ownerName:e.OWNER_NAME,avatar:e.AVATAR,createdAt:e.CREATED_DT,content:e.CONTENT,subcontent:e.SUBCONTENT,objectType:e.OBJECTTYPE,objectId:e.OBJECTID,objectName:e.OBJECTNAME,messageType:e.MSGTYPE,likeCount:e.LIKECNT,replyCount:e.REPLYCNT,outQueueId:e.OUTQUEUEID,internal:e.INTERNAL===void 0?void 0:e.INTERNAL!==0})}const R=o.Struct({ID:o.Finite,PROJECTID:o.optional(o.Finite),NAME:o.optional(o.String),STATE:o.optional(o.String),OWNER_NAME:o.optional(o.String),START_DT:o.optional(o.String),END_DT:o.optional(o.String),BUDGET:o.optional(o.Finite)}),z=o.Struct({Records:o.Array(R),RecordCount:o.optional(o.Finite)});var B=class extends o.Class(`Task`)({id:o.Finite,projectId:o.optional(o.Finite),name:o.optional(o.String),state:o.optional(o.String),ownerName:o.optional(o.String),startDate:o.optional(o.String),endDate:o.optional(o.String),budget:o.optional(o.Finite)}){};function V(e){return B.make({id:e.ID,projectId:e.PROJECTID,name:e.NAME,state:e.STATE,ownerName:e.OWNER_NAME,startDate:e.START_DT,endDate:e.END_DT,budget:e.BUDGET})}const H=o.Struct({ID:o.Finite,WORKLOAD:o.optional(o.Finite),TOTAL:o.optional(o.Finite),REMAINING:o.optional(o.Finite),AVAIL:o.optional(o.Finite),CLIENTID:o.optional(o.Finite),PROJECTID:o.optional(o.Finite),PROJECT_START_DT:o.optional(o.String),PROJECT_END_DT:o.optional(o.String),START_DT:o.optional(o.String),END_DT:o.optional(o.String),STATE:o.optional(o.String)}),U=o.Struct({Records:o.Array(H)});var W=class extends o.Class(`TaskForUser`)({id:o.Finite,workload:o.optional(o.Finite),total:o.optional(o.Finite),remaining:o.optional(o.Finite),avail:o.optional(o.Finite),clientId:o.optional(o.Finite),projectId:o.optional(o.Finite),projectStartDate:o.optional(o.String),projectEndDate:o.optional(o.String),startDate:o.optional(o.String),endDate:o.optional(o.String),state:o.optional(o.String)}){};function ue(e){return W.make({id:e.ID,workload:e.WORKLOAD,total:e.TOTAL,remaining:e.REMAINING,avail:e.AVAIL,clientId:e.CLIENTID,projectId:e.PROJECTID,projectStartDate:e.PROJECT_START_DT,projectEndDate:e.PROJECT_END_DT,startDate:e.START_DT,endDate:e.END_DT,state:e.STATE})}const G=o.Record(o.String,o.Unknown),de=o.Struct({ID:o.Finite,NAME:o.optional(o.String),BOARDLISTID:o.optional(o.Finite),BOARDID:o.optional(o.Finite),OWNERID:o.optional(o.Finite),EXTID:o.optional(o.String),STATE:o.String.pipe(o.NullOr,o.optional),DUE_DT:o.String.pipe(o.NullOr,o.optional),DESCRIPTION:o.String.pipe(o.NullOr,o.optional)}),K=o.Struct({Records:o.Array(de),RecordCount:o.optional(o.Finite)});var q=class extends o.Class(`TodoSummary`)({id:o.Finite,name:o.optional(o.String),boardListId:o.optional(o.Finite),boardId:o.optional(o.Finite),ownerId:o.optional(o.Finite),extId:o.optional(o.String),state:o.String.pipe(o.NullOr,o.optional),dueDate:o.String.pipe(o.NullOr,o.optional),description:o.String.pipe(o.NullOr,o.optional)}){};function J(e){return q.make({id:e.ID,name:e.NAME,boardListId:e.BOARDLISTID,boardId:e.BOARDID,ownerId:e.OWNERID,extId:e.EXTID,state:e.STATE,dueDate:e.DUE_DT,description:e.DESCRIPTION})}var Y=class extends e.Service()(`@2digits/tlo-mcp/services/BoardService`){};function fe(e){return`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,`0`)}-${e.getDate().toString().padStart(2,`0`)}`}const X=n.effect(Y,t.gen(function*(){let e=yield*S;return Y.of({getProjects:t.fn(`BoardService.getProjects`)(function*(t={}){let n=t.states??[`DRAFT`,`OPEN`,`CLOSED`],r=yield*e.post(`/ajax/pln/GetProjects`,{STATE:d.join(n,`|`),COLUMNS:`ID|PROJECT_NAME|NAME|STATE|OWNER_NAME|START_DT|END_DT|BILLING_BUDGET|BILLING_MODE|BILLING_REMAINING|CLIENT_NAME|CLIENT_ID|FOLDERID|FOLDER_NAME|EXTID|CALC_TOTAL|CALC_DONE|CALC_PLANNED`,limit:t.limit??100,page:t.page??1},ce);return d.map(N)(r.Records)}),getProjectDetails:t.fn(`BoardService.getProjectDetails`)(function*(t){let n=yield*e.post(`/ajax/pln/GetProjectDetails`,{ID:t.projectId},le);return N(r.value(n).pipe(r.when({Record:r.any},({Record:e})=>e),r.orElse(e=>e)))}),getMessages:t.fn(`BoardService.getMessages`)(function*(t){let n=yield*e.post(`/ajax/board/ProcessMessage`,{OBJECTTYPE:t.objectType,OBJECTID:t.objectId,ONLYCOMMENTS:t.onlyComments===!1?0:1,HIDEINTERNAL:t.hideInternal===!1?0:1,PAGETYPE:`SEQID`,MINID:0,limit:t.limit??100},F);return d.map(L)(n)}),getTasks:t.fn(`BoardService.getTasks`)(function*(t){let n=t.states??[`DRAFT`,`OPEN`,`CLOSED`],r=yield*e.post(`/ajax/pln/GetTasks`,{PROJECTID:t.projectId,STATE:d.join(n,`|`),COLUMNS:`ID|PROJECTID|NAME|STATE|OWNER_NAME|START_DT|END_DT|BUDGET`,limit:t.limit??100,page:t.page??1},z);return d.map(V)(r.Records)}),getTasksForUser:t.fn(`BoardService.getTasksForUser`)(function*(t){let n=yield*e.post(`/ajax/pln/GetTasksForUser`,{CONTACTID:t.contactId,START_DT:fe(t.startDate),PERIOD:t.period},U);return d.map(ue)(n.Records)}),getTodoDetail:t.fn(`BoardService.getTodoDetail`)(function*(t){return yield*e.post(`/ajax/board/GetTodoDetail`,{ID:t.id},G)}),getBoardTodos:t.fn(`BoardService.getBoardTodos`)(function*(t){let n=yield*e.post(`/ajax/board/GetTodos`,{BOARDID:t.boardId,BOARDLISTID:t.boardListId,limit:t.limit??100},K),i=d.map(J)(n.Records);return r.value(t.query).pipe(r.when(r.nonEmptyString,e=>{let t=f.toLowerCase(e);return d.filter(i,e=>e.name!==void 0&&f.includes(t)(f.toLowerCase(e.name)))}),r.orElse(()=>i))}),moveTodo:t.fn(`BoardService.moveTodo`)(function*(t){yield*e.post(`/ajax/board/MoveTodo`,{ID:t.id,BOARDID:t.boardId,BOARDLISTID:t.boardListId,SORTINDEX:t.sortIndex},o.Unknown)}),postMessage:t.fn(`BoardService.postMessage`)(function*(t){yield*e.post(`/ajax/board/ProcessMessage`,{ACTION:`ADD`,OBJECTTYPE:t.objectType,OBJECTID:t.objectId,CONTENT:t.content},o.Unknown)}),setTaskState:t.fn(`BoardService.setTaskState`)(function*(t){yield*e.post(`/ajax/pln/SetTaskState`,{PROJECTID:t.projectId,ID:t.taskId,STATE:t.state},o.Unknown)})})})),Z=t.gen(function*(){let e=yield*p.redacted(`TLO_SESSION_TOKEN`),n=yield*p.string(`TLO_BASE_URL`).pipe(p.withDefault(`https://socialbrothers.orbit.teamleader.eu`)),r=yield*p.string(`TLO_COOKIES`).pipe(p.withDefault(``));return{baseUrl:n,sessionToken:e,cookies:yield*t.fromResult(c.setAll(c.empty,a.toEntries(c.parseHeader(r))))}}),pe=n.effect(h,Z),Q=n.mergeAll(A,X),$=C.pipe(n.provide(x.pipe(n.provide(m.layer)))),me=Q.pipe(n.provide($));export{g as C,y as D,v as E,h as O,C as S,ne as T,k as _,pe as a,E as b,I as c,W as d,G as f,J as g,N as h,Z as i,M as l,L as m,me as n,Y as o,q as p,Q as r,X as s,$ as t,B as u,A as v,_ as w,S as x,T as y};
|
package/dist/bin.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{T as e,_ as t,a as n,c as r,d as i,f as a,l as o,n as s,o as c,p as l,u,y as d}from"./TloLive-CRb5JiMF.mjs";import*as f from"effect/Effect";import*as p from"effect/Layer";import*as m from"effect/Schema";import*as h from"@effect/platform-node/NodeContext";import*as g from"@effect/platform-node/NodeRuntime";import*as _ from"@effect/cli/Command";import*as v from"@effect/ai/McpServer";import*as y from"@effect/platform-node/NodeSink";import*as b from"@effect/platform-node/NodeStream";import*as x from"effect/Logger";import*as S from"@effect/ai/Toolkit";import*as C from"@effect/ai/Tool";const w=m.Literal(`DRAFT`,`OPEN`,`COMPLETED`,`CLOSED`),T=m.Literal(`TODO`,`BOARD`,`PROJECT`),E=m.Date.annotations({description:`ISO 8601 date string (e.g., 2025-01-20T10:00:00Z)`}),D=C.make(`get_projects`,{description:`List all projects. Returns projectId, folderId, client, owner, dates, and budget info. Use to discover projects before drilling into tasks or logging time. Data hierarchy: FOLDER → PROJECT → TASK → ACTIVITY.`,parameters:{states:m.optional(m.Array(w)).annotations({description:`Filter by project states: DRAFT, OPEN, COMPLETED, CLOSED. Defaults to DRAFT, OPEN, CLOSED`}),limit:m.optional(m.Number).annotations({description:`Maximum number of projects to return. Defaults to 100`}),page:m.optional(m.Number).annotations({description:`Page number for pagination. Defaults to 1`})},success:m.Struct({projects:m.Array(o)}),failure:e,failureMode:`return`,dependencies:[c]}),O=C.make(`get_project_details`,{description:`Get single project with full details including billing rates and folder info. Requires projectId from get_projects.`,parameters:{projectId:m.Number.annotations({description:`Project ID from get_projects response`})},success:m.Struct({project:o}),failure:e,failureMode:`return`,dependencies:[c]}),k=C.make(`get_messages`,{description:`Get comments/messages on a project, board, or todo. Use to read discussion history or context about work items.`,parameters:{objectType:T.annotations({description:`Type of object: PROJECT (for project comments), BOARD (board-level), TODO (kanban card)`}),objectId:m.Number.annotations({description:`ID of the project, board, or todo`}),onlyComments:m.optional(m.Boolean).annotations({description:`Only return user comments (exclude system messages). Defaults to true`}),hideInternal:m.optional(m.Boolean).annotations({description:`Hide internal/private messages. Defaults to true`}),limit:m.optional(m.Number).annotations({description:`Maximum number of messages to return. Defaults to 100`})},success:m.Struct({messages:m.Array(r)}),failure:e,failureMode:`return`,dependencies:[c]}),A=C.make(`set_task_state`,{description:`Change task state. Typical flow: DRAFT → OPEN → COMPLETED → CLOSED. Requires both projectId and taskId from get_tasks.`,parameters:{projectId:m.Number.annotations({description:`Project ID containing the task (from get_projects)`}),taskId:m.Number.annotations({description:`Task ID to update (from get_tasks)`}),state:w.annotations({description:`New state: DRAFT, OPEN, COMPLETED, or CLOSED`})},success:m.Void,failure:e,failureMode:`return`,dependencies:[c]}),j=C.make(`get_tasks`,{description:`Get tasks within a project. Tasks have budget (workload), remaining hours, and state. Use taskId when logging time to attribute work to specific deliverables.`,parameters:{projectId:m.Number.annotations({description:`Project ID from get_projects`}),states:m.optional(m.Array(w)).annotations({description:`Filter by task states: DRAFT, OPEN, COMPLETED, CLOSED. Defaults to DRAFT, OPEN, CLOSED`}),limit:m.optional(m.Number).annotations({description:`Maximum number of tasks to return. Defaults to 100`}),page:m.optional(m.Number).annotations({description:`Page number for pagination. Defaults to 1`})},success:m.Struct({tasks:m.Array(u)}),failure:e,failureMode:`return`,dependencies:[c]}),M=C.make(`get_tasks_for_user`,{description:`Get tasks assigned to a user for a date range. Returns tasks with REMAINING budget hours. Useful for finding what work is available to log time against.`,parameters:{contactId:m.String.annotations({description:`User/contact ID to get tasks for`}),startDate:E.annotations({description:`Start date for the query (e.g., 2025-01-20T00:00:00Z)`}),period:m.Number.annotations({description:`Number of days to include in the query`})},success:m.Struct({tasks:m.Array(i)}),failure:e,failureMode:`return`,dependencies:[c]}),N=C.make(`get_todo_detail`,{description:`Get kanban card details. Response includes: BOARDLISTS (all columns with IDs for move_todo), LINKS (connected tasks), ACTIVITIES (time logged against this todo).`,parameters:{id:m.Number.annotations({description:`Todo/card ID to retrieve`})},success:m.Struct({todo:a}),failure:e,failureMode:`return`,dependencies:[c]}),P=C.make(`get_board_todos`,{description:`List todos/cards from a kanban board. Use to find todo IDs by name for use with get_todo_detail. Get boardId from get_todo_detail BOARDID field or project board URL.`,parameters:{boardId:m.Number.annotations({description:`Board ID (from get_todo_detail TODO.BOARDID field or URL)`}),query:m.optional(m.String).annotations({description:`Filter todos by name (case-insensitive partial match)`}),boardListId:m.optional(m.Number).annotations({description:`Filter by column ID (from BOARDLISTS in get_todo_detail)`}),limit:m.optional(m.Number).annotations({description:`Maximum results. Defaults to 100`})},success:m.Struct({todos:m.Array(l)}),failure:e,failureMode:`return`,dependencies:[c]}),F=C.make(`move_todo`,{description:`Move kanban card between columns. Get boardId and boardListId from get_todo_detail response (BOARDLISTS array contains column IDs).`,parameters:{id:m.Number.annotations({description:`Todo/card ID to move`}),boardId:m.Number.annotations({description:`Board ID (from get_todo_detail)`}),boardListId:m.Number.annotations({description:`Target column ID (from BOARDLISTS in get_todo_detail)`}),sortIndex:m.Number.annotations({description:`Position within column (0 = top)`})},success:m.Void,failure:e,failureMode:`return`,dependencies:[c]}),I=C.make(`post_message`,{description:`Add a comment to a project, board, or todo. Use to leave notes or updates on work items.`,parameters:{objectType:T.annotations({description:`Type of object: PROJECT, BOARD, or TODO`}),objectId:m.Number.annotations({description:`ID of the project, board, or todo to comment on`}),content:m.String.annotations({description:`Comment text to post`})},success:m.Void,failure:e,failureMode:`return`,dependencies:[c]}),L=C.make(`get_week_activities`,{description:`Get all time entries for the week containing the given date. Returns project/task names, duration, and IDs. Use to review or summarize work. Response includes folderId which can be used for create_activity.`,parameters:{date:E.annotations({description:`Any date within target week (e.g., 2025-01-20). Week is Mon-Sun.`}),contactId:m.String.annotations({description:`User/contact ID to get activities for`}),timezone:m.optional(m.String).annotations({description:`Timezone for week boundaries. Defaults to Europe/Amsterdam`})},success:m.Struct({activities:m.Array(d)}),failure:e,failureMode:`return`,dependencies:[t]}),R=C.make(`create_activity`,{description:`Log time against a project/task. Get folderId from get_projects or get_week_activities. Duration examples: 60=1h, 90=1.5h, 120=2h. Optionally link to a taskId for specific work attribution or todoId for kanban card.`,parameters:{folderId:m.String.annotations({description:`Folder/project ID to log time against (from get_projects or get_week_activities)`}),startDate:E.annotations({description:`Date and time of the activity (e.g., 2025-01-20T09:00:00Z). Time is for display.`}),durationMinutes:m.Number.annotations({description:`Duration in minutes. Examples: 30, 60 (1h), 90 (1.5h), 120 (2h)`}),contactId:m.String.annotations({description:`User/contact ID who performed the work`}),taskId:m.optional(m.String).annotations({description:`Task ID to attribute time to (from get_tasks). Links time to specific deliverable.`}),todoId:m.optional(m.String).annotations({description:`Todo/kanban card ID to link this time entry to`}),description:m.optional(m.String).annotations({description:`Description of work performed`}),clientColor:m.optional(m.String).annotations({description:`Hex color code for display (e.g., #eeeeee)`})},success:m.Struct({id:m.Number.annotations({description:`ID of the created activity`})}),failure:e,failureMode:`return`,dependencies:[t]}),z=C.make(`update_activity`,{description:`Modify an existing time entry. Get activity ID from get_week_activities. Only specify fields you want to change.`,parameters:{id:m.Number.annotations({description:`Activity ID to update (from get_week_activities)`}),startDate:m.optional(E).annotations({description:`New date/time for the activity`}),durationMinutes:m.optional(m.Number).annotations({description:`New duration in minutes`}),description:m.optional(m.String).annotations({description:`New description`})},success:m.Void,failure:e,failureMode:`return`,dependencies:[t]}),B=C.make(`delete_activity`,{description:`Remove a time entry. Get activity ID from get_week_activities. This action cannot be undone.`,parameters:{id:m.Number.annotations({description:`Activity ID to delete (from get_week_activities)`})},success:m.Void,failure:e,failureMode:`return`,dependencies:[t]}),V=S.make(D,O,k,j,M,N,P,F,I,A,L,R,z,B),H=[`DRAFT`,`OPEN`,`CLOSED`],U=V.toLayer({get_projects:f.fn(`TloToolkitHandlers.get_projects`)(function*(e){return{projects:yield*(yield*c).getProjects({...e,states:e.states??[...H],limit:e.limit??100,page:e.page??1})}}),get_project_details:f.fn(`TloToolkitHandlers.get_project_details`)(function*(e){return{project:yield*(yield*c).getProjectDetails(e)}}),get_messages:f.fn(`TloToolkitHandlers.get_messages`)(function*(e){return{messages:yield*(yield*c).getMessages({...e,onlyComments:e.onlyComments??!0,hideInternal:e.hideInternal??!0,limit:e.limit??100})}}),set_task_state:f.fn(`TloToolkitHandlers.set_task_state`)(function*(e){yield*(yield*c).setTaskState(e)}),get_tasks:f.fn(`TloToolkitHandlers.get_tasks`)(function*(e){return{tasks:yield*(yield*c).getTasks({...e,states:e.states??[...H],limit:e.limit??100,page:e.page??1})}}),get_tasks_for_user:f.fn(`TloToolkitHandlers.get_tasks_for_user`)(function*(e){return{tasks:yield*(yield*c).getTasksForUser(e)}}),get_todo_detail:f.fn(`TloToolkitHandlers.get_todo_detail`)(function*(e){return{todo:yield*(yield*c).getTodoDetail(e)}}),get_board_todos:f.fn(`TloToolkitHandlers.get_board_todos`)(function*(e){return{todos:yield*(yield*c).getBoardTodos({...e,limit:e.limit??100})}}),move_todo:f.fn(`TloToolkitHandlers.move_todo`)(function*(e){yield*(yield*c).moveTodo(e)}),post_message:f.fn(`TloToolkitHandlers.post_message`)(function*(e){yield*(yield*c).postMessage(e)}),get_week_activities:f.fn(`TloToolkitHandlers.get_week_activities`)(function*(e){let n=yield*t,r=e.timezone??`Europe/Amsterdam`;return{activities:yield*n.getWeek(e.date,e.contactId,r)}}),create_activity:f.fn(`TloToolkitHandlers.create_activity`)(function*(e){return{id:yield*(yield*t).createActivity(e)}}),update_activity:f.fn(`TloToolkitHandlers.update_activity`)(function*(e){yield*(yield*t).updateActivity(e)}),delete_activity:f.fn(`TloToolkitHandlers.delete_activity`)(function*(e){yield*(yield*t).deleteActivity(e)})});function W(e){return v.toolkit(V).pipe(p.provide(U),p.provide(v.layerStdio({...e,stdin:b.stdin,stdout:y.stdout})),p.provide(x.add(x.prettyLogger({stderr:!0}))))}const G=`tlo-mcp`,K=`0.0.0`,q=_.make(G,{},f.fn(function*(){return yield*W({name:G,version:K}).pipe(p.provide(s),p.provide(n),p.launch)}));_.run(q,{name:G,version:K})(process.argv).pipe(f.provide(h.layer),g.runMain);export{};
|
|
2
|
+
import{T as e,_ as t,a as n,c as r,d as i,f as a,l as o,n as s,o as c,p as l,u,y as d}from"./TloLive-BTpDuZnK.mjs";import*as f from"effect/Effect";import*as p from"effect/Layer";import*as m from"effect/Schema";import*as h from"@effect/platform-node/NodeRuntime";import*as g from"@effect/platform-node/NodeServices";import*as _ from"effect/unstable/cli/Command";import*as v from"effect/Logger";import*as y from"effect/unstable/ai/McpProtocol";import*as b from"effect/unstable/ai/McpServer";import*as x from"effect/unstable/ai/Toolkit";import*as S from"effect/unstable/ai/Tool";const C=m.Literals([`DRAFT`,`OPEN`,`COMPLETED`,`CLOSED`]),w=m.Literals([`TODO`,`BOARD`,`PROJECT`]),T=m.DateFromString.annotate({description:`ISO 8601 date string (e.g., 2025-01-20T10:00:00Z)`}),E=S.make(`get_projects`,{description:`List all projects. Returns projectId, folderId, client, owner, dates, and budget info. Use to discover projects before drilling into tasks or logging time. Data hierarchy: FOLDER → PROJECT → TASK → ACTIVITY.`,parameters:m.Struct({states:C.pipe(m.Array,m.optional).annotate({description:`Filter by project states: DRAFT, OPEN, COMPLETED, CLOSED. Defaults to DRAFT, OPEN, CLOSED`}),limit:m.optional(m.Finite).annotate({description:`Maximum number of projects to return. Defaults to 100`}),page:m.optional(m.Finite).annotate({description:`Page number for pagination. Defaults to 1`})}),success:m.Struct({projects:m.Array(o)}),failure:e,failureMode:`return`,dependencies:[c]}),D=S.make(`get_project_details`,{description:`Get single project with full details including billing rates and folder info. Requires projectId from get_projects.`,parameters:m.Struct({projectId:m.Finite.annotate({description:`Project ID from get_projects response`})}),success:m.Struct({project:o}),failure:e,failureMode:`return`,dependencies:[c]}),O=S.make(`get_messages`,{description:`Get comments/messages on a project, board, or todo. Use to read discussion history or context about work items.`,parameters:m.Struct({objectType:w.annotate({description:`Type of object: PROJECT (for project comments), BOARD (board-level), TODO (kanban card)`}),objectId:m.Finite.annotate({description:`ID of the project, board, or todo`}),onlyComments:m.optional(m.Boolean).annotate({description:`Only return user comments (exclude system messages). Defaults to true`}),hideInternal:m.optional(m.Boolean).annotate({description:`Hide internal/private messages. Defaults to true`}),limit:m.optional(m.Finite).annotate({description:`Maximum number of messages to return. Defaults to 100`})}),success:m.Struct({messages:m.Array(r)}),failure:e,failureMode:`return`,dependencies:[c]}),k=S.make(`set_task_state`,{description:`Change task state. Typical flow: DRAFT → OPEN → COMPLETED → CLOSED. Requires both projectId and taskId from get_tasks.`,parameters:m.Struct({projectId:m.Finite.annotate({description:`Project ID containing the task (from get_projects)`}),taskId:m.Finite.annotate({description:`Task ID to update (from get_tasks)`}),state:C.annotate({description:`New state: DRAFT, OPEN, COMPLETED, or CLOSED`})}),success:m.Void,failure:e,failureMode:`return`,dependencies:[c]}),A=S.make(`get_tasks`,{description:`Get tasks within a project. Tasks have budget (workload), remaining hours, and state. Use taskId when logging time to attribute work to specific deliverables.`,parameters:m.Struct({projectId:m.Finite.annotate({description:`Project ID from get_projects`}),states:C.pipe(m.Array,m.optional).annotate({description:`Filter by task states: DRAFT, OPEN, COMPLETED, CLOSED. Defaults to DRAFT, OPEN, CLOSED`}),limit:m.optional(m.Finite).annotate({description:`Maximum number of tasks to return. Defaults to 100`}),page:m.optional(m.Finite).annotate({description:`Page number for pagination. Defaults to 1`})}),success:m.Struct({tasks:m.Array(u)}),failure:e,failureMode:`return`,dependencies:[c]}),j=S.make(`get_tasks_for_user`,{description:`Get tasks assigned to a user for a date range. Returns tasks with REMAINING budget hours. Useful for finding what work is available to log time against.`,parameters:m.Struct({contactId:m.String.annotate({description:`User/contact ID to get tasks for`}),startDate:T.annotate({description:`Start date for the query (e.g., 2025-01-20T00:00:00Z)`}),period:m.Finite.annotate({description:`Number of days to include in the query`})}),success:m.Struct({tasks:m.Array(i)}),failure:e,failureMode:`return`,dependencies:[c]}),M=S.make(`get_todo_detail`,{description:`Get kanban card details. Response includes: BOARDLISTS (all columns with IDs for move_todo), LINKS (connected tasks), ACTIVITIES (time logged against this todo).`,parameters:m.Struct({id:m.Finite.annotate({description:`Todo/card ID to retrieve`})}),success:m.Struct({todo:a}),failure:e,failureMode:`return`,dependencies:[c]}),N=S.make(`get_board_todos`,{description:`List todos/cards from a kanban board. Use to find todo IDs by name for use with get_todo_detail. Get boardId from get_todo_detail BOARDID field or project board URL.`,parameters:m.Struct({boardId:m.Finite.annotate({description:`Board ID (from get_todo_detail TODO.BOARDID field or URL)`}),query:m.optional(m.String).annotate({description:`Filter todos by name (case-insensitive partial match)`}),boardListId:m.optional(m.Finite).annotate({description:`Filter by column ID (from BOARDLISTS in get_todo_detail)`}),limit:m.optional(m.Finite).annotate({description:`Maximum results. Defaults to 100`})}),success:m.Struct({todos:m.Array(l)}),failure:e,failureMode:`return`,dependencies:[c]}),P=S.make(`move_todo`,{description:`Move kanban card between columns. Get boardId and boardListId from get_todo_detail response (BOARDLISTS array contains column IDs).`,parameters:m.Struct({id:m.Finite.annotate({description:`Todo/card ID to move`}),boardId:m.Finite.annotate({description:`Board ID (from get_todo_detail)`}),boardListId:m.Finite.annotate({description:`Target column ID (from BOARDLISTS in get_todo_detail)`}),sortIndex:m.Finite.annotate({description:`Position within column (0 = top)`})}),success:m.Void,failure:e,failureMode:`return`,dependencies:[c]}),F=S.make(`post_message`,{description:`Add a comment to a project, board, or todo. Use to leave notes or updates on work items.`,parameters:m.Struct({objectType:w.annotate({description:`Type of object: PROJECT, BOARD, or TODO`}),objectId:m.Finite.annotate({description:`ID of the project, board, or todo to comment on`}),content:m.String.annotate({description:`Comment text to post`})}),success:m.Void,failure:e,failureMode:`return`,dependencies:[c]}),I=S.make(`get_week_activities`,{description:`Get all time entries for the week containing the given date. Returns project/task names, duration, and IDs. Use to review or summarize work. Response includes folderId which can be used for create_activity.`,parameters:m.Struct({date:T.annotate({description:`Any date within target week (e.g., 2025-01-20). Week is Mon-Sun.`}),contactId:m.String.annotate({description:`User/contact ID to get activities for`}),timezone:m.optional(m.String).annotate({description:`Timezone for week boundaries. Defaults to Europe/Amsterdam`})}),success:m.Struct({activities:m.Array(d)}),failure:e,failureMode:`return`,dependencies:[t]}),L=S.make(`create_activity`,{description:`Log time against a project/task. Get folderId from get_projects or get_week_activities. Duration examples: 60=1h, 90=1.5h, 120=2h. Optionally link to a taskId for specific work attribution or todoId for kanban card.`,parameters:m.Struct({folderId:m.String.annotate({description:`Folder/project ID to log time against (from get_projects or get_week_activities)`}),startDate:T.annotate({description:`Date and time of the activity (e.g., 2025-01-20T09:00:00Z). Time is for display.`}),durationMinutes:m.Finite.annotate({description:`Duration in minutes. Examples: 30, 60 (1h), 90 (1.5h), 120 (2h)`}),contactId:m.String.annotate({description:`User/contact ID who performed the work`}),taskId:m.optional(m.String).annotate({description:`Task ID to attribute time to (from get_tasks). Links time to specific deliverable.`}),todoId:m.optional(m.String).annotate({description:`Todo/kanban card ID to link this time entry to`}),description:m.optional(m.String).annotate({description:`Description of work performed`}),clientColor:m.optional(m.String).annotate({description:`Hex color code for display (e.g., #eeeeee)`})}),success:m.Struct({id:m.Finite.annotate({description:`ID of the created activity`})}),failure:e,failureMode:`return`,dependencies:[t]}),R=S.make(`update_activity`,{description:`Modify an existing time entry. Get activity ID from get_week_activities. Only specify fields you want to change.`,parameters:m.Struct({id:m.Finite.annotate({description:`Activity ID to update (from get_week_activities)`}),startDate:m.optional(T).annotate({description:`New date/time for the activity`}),durationMinutes:m.optional(m.Finite).annotate({description:`New duration in minutes`}),description:m.optional(m.String).annotate({description:`New description`})}),success:m.Void,failure:e,failureMode:`return`,dependencies:[t]}),z=S.make(`delete_activity`,{description:`Remove a time entry. Get activity ID from get_week_activities. This action cannot be undone.`,parameters:m.Struct({id:m.Finite.annotate({description:`Activity ID to delete (from get_week_activities)`})}),success:m.Void,failure:e,failureMode:`return`,dependencies:[t]}),B=x.make(E,D,O,A,j,M,N,P,F,k,I,L,R,z),V=B.toLayer({get_projects:f.fn(`TloToolkitHandlers.get_projects`)(function*(e){return{projects:yield*(yield*c).getProjects(e)}}),get_project_details:f.fn(`TloToolkitHandlers.get_project_details`)(function*(e){return{project:yield*(yield*c).getProjectDetails(e)}}),get_messages:f.fn(`TloToolkitHandlers.get_messages`)(function*(e){return{messages:yield*(yield*c).getMessages(e)}}),set_task_state:f.fn(`TloToolkitHandlers.set_task_state`)(function*(e){yield*(yield*c).setTaskState(e)}),get_tasks:f.fn(`TloToolkitHandlers.get_tasks`)(function*(e){return{tasks:yield*(yield*c).getTasks(e)}}),get_tasks_for_user:f.fn(`TloToolkitHandlers.get_tasks_for_user`)(function*(e){return{tasks:yield*(yield*c).getTasksForUser(e)}}),get_todo_detail:f.fn(`TloToolkitHandlers.get_todo_detail`)(function*(e){return{todo:yield*(yield*c).getTodoDetail(e)}}),get_board_todos:f.fn(`TloToolkitHandlers.get_board_todos`)(function*(e){return{todos:yield*(yield*c).getBoardTodos(e)}}),move_todo:f.fn(`TloToolkitHandlers.move_todo`)(function*(e){yield*(yield*c).moveTodo(e)}),post_message:f.fn(`TloToolkitHandlers.post_message`)(function*(e){yield*(yield*c).postMessage(e)}),get_week_activities:f.fn(`TloToolkitHandlers.get_week_activities`)(function*(e){return{activities:yield*(yield*t).getWeek(e.date,e.contactId,e.timezone)}}),create_activity:f.fn(`TloToolkitHandlers.create_activity`)(function*(e){return{id:yield*(yield*t).createActivity(e)}}),update_activity:f.fn(`TloToolkitHandlers.update_activity`)(function*(e){yield*(yield*t).updateActivity(e)}),delete_activity:f.fn(`TloToolkitHandlers.delete_activity`)(function*(e){yield*(yield*t).deleteActivity(e)})});function H(e){return b.toolkit(B).pipe(p.provide(V),p.provide(b.layerStdio({...e,protocols:[y.v2025_06_18]})),p.provide(v.layer([v.consolePretty({stderr:!0})])))}const U=`tlo-mcp`,W=`0.0.0`,G=_.make(U,{},f.fn(`TloMcp.serve`)(function*(){return yield*H({name:U,version:W}).pipe(p.provide(s),p.provide(n),p.launch)}));f.fn(`TloMcp.run`)(function*(e){return yield*_.run(G,{version:W})})(process.argv).pipe(f.provide(g.layer),h.runMain);export{};
|
package/dist/index.d.mts
CHANGED
|
@@ -3,55 +3,49 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as Redacted from "effect/Redacted";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
|
-
import * as
|
|
6
|
+
import * as Cookies from "effect/unstable/http/Cookies";
|
|
7
|
+
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
8
|
+
import * as Config from "effect/Config";
|
|
7
9
|
import * as Brand from "effect/Brand";
|
|
8
10
|
//#region src/services/TloConfig.d.ts
|
|
9
11
|
interface TloConfigShape {
|
|
10
12
|
readonly baseUrl: string;
|
|
11
13
|
readonly sessionToken: Redacted.Redacted;
|
|
12
|
-
readonly cookies:
|
|
14
|
+
readonly cookies: Cookies.Cookies;
|
|
13
15
|
}
|
|
14
|
-
declare const TloConfig_base: Context.
|
|
16
|
+
declare const TloConfig_base: Context.ServiceClass<TloConfig, "@2digits/tlo-mcp/services/TloConfig", TloConfigShape>;
|
|
15
17
|
declare class TloConfig extends TloConfig_base {}
|
|
16
18
|
//#endregion
|
|
17
19
|
//#region src/schemas/errors.d.ts
|
|
18
|
-
declare const TloApiError_base: Schema.
|
|
19
|
-
readonly
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
endpoint: Schema.optional<typeof Schema.String>;
|
|
24
|
-
}>;
|
|
20
|
+
declare const TloApiError_base: Schema.Class<TloApiError, Schema.TaggedStruct<"TloApiError", {
|
|
21
|
+
readonly message: Schema.String;
|
|
22
|
+
readonly code: Schema.optional<Schema.String>;
|
|
23
|
+
readonly endpoint: Schema.optional<Schema.String>;
|
|
24
|
+
}>, import("effect/Cause").YieldableError>;
|
|
25
25
|
/**
|
|
26
26
|
* Error returned when the TLO API indicates failure. This occurs when success: false in the response envelope.
|
|
27
27
|
*/
|
|
28
28
|
declare class TloApiError extends TloApiError_base {}
|
|
29
|
-
declare const TloAuthError_base: Schema.
|
|
30
|
-
readonly
|
|
31
|
-
}
|
|
32
|
-
message: typeof Schema.String;
|
|
33
|
-
}>;
|
|
29
|
+
declare const TloAuthError_base: Schema.Class<TloAuthError, Schema.TaggedStruct<"TloAuthError", {
|
|
30
|
+
readonly message: Schema.String;
|
|
31
|
+
}>, import("effect/Cause").YieldableError>;
|
|
34
32
|
/**
|
|
35
33
|
* Error for authentication failures. Session token expired or invalid credentials.
|
|
36
34
|
*/
|
|
37
35
|
declare class TloAuthError extends TloAuthError_base {}
|
|
38
|
-
declare const TloNetworkError_base: Schema.
|
|
39
|
-
readonly
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
endpoint: Schema.optional<typeof Schema.String>;
|
|
44
|
-
}>;
|
|
36
|
+
declare const TloNetworkError_base: Schema.Class<TloNetworkError, Schema.TaggedStruct<"TloNetworkError", {
|
|
37
|
+
readonly message: Schema.String;
|
|
38
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
39
|
+
readonly endpoint: Schema.optional<Schema.String>;
|
|
40
|
+
}>, import("effect/Cause").YieldableError>;
|
|
45
41
|
/**
|
|
46
42
|
* Error for network/transport failures. Connection refused, timeout, etc.
|
|
47
43
|
*/
|
|
48
44
|
declare class TloNetworkError extends TloNetworkError_base {}
|
|
49
|
-
declare const TloParseError_base: Schema.
|
|
50
|
-
readonly
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
cause: Schema.optional<typeof Schema.Unknown>;
|
|
54
|
-
}>;
|
|
45
|
+
declare const TloParseError_base: Schema.Class<TloParseError, Schema.TaggedStruct<"TloParseError", {
|
|
46
|
+
readonly message: Schema.String;
|
|
47
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
48
|
+
}>, import("effect/Cause").YieldableError>;
|
|
55
49
|
/**
|
|
56
50
|
* Error when response parsing fails. Unexpected response format from TLO.
|
|
57
51
|
*/
|
|
@@ -62,14 +56,14 @@ type TloError = TloApiError | TloAuthError | TloNetworkError | TloParseError;
|
|
|
62
56
|
interface TloHttpClientShape {
|
|
63
57
|
readonly client: HttpClient.HttpClient;
|
|
64
58
|
}
|
|
65
|
-
declare const TloHttpClient_base: Context.
|
|
59
|
+
declare const TloHttpClient_base: Context.ServiceClass<TloHttpClient, "@2digits/tlo-mcp/services/TloHttpClient", TloHttpClientShape>;
|
|
66
60
|
declare class TloHttpClient extends TloHttpClient_base {}
|
|
67
61
|
//#endregion
|
|
68
62
|
//#region src/services/TeamLeaderClient.d.ts
|
|
69
63
|
interface TeamLeaderClientShape {
|
|
70
|
-
readonly post: <
|
|
64
|
+
readonly post: <TSchema extends Schema.Constraint>(path: string, body: Record<string, string | number | boolean | undefined>, schema: TSchema) => Effect.Effect<TSchema['Type'], TloError, TSchema['DecodingServices']>;
|
|
71
65
|
}
|
|
72
|
-
declare const TeamLeaderClient_base: Context.
|
|
66
|
+
declare const TeamLeaderClient_base: Context.ServiceClass<TeamLeaderClient, "@2digits/tlo-mcp/services/TeamLeaderClient", TeamLeaderClientShape>;
|
|
73
67
|
declare class TeamLeaderClient extends TeamLeaderClient_base {}
|
|
74
68
|
declare const TeamLeaderClientLive: Layer.Layer<TeamLeaderClient, never, TloConfig | TloHttpClient>;
|
|
75
69
|
//#endregion
|
|
@@ -78,222 +72,125 @@ declare const TeamLeaderClientLive: Layer.Layer<TeamLeaderClient, never, TloConf
|
|
|
78
72
|
* Raw activity from TLO API response. Field names match the API exactly.
|
|
79
73
|
*/
|
|
80
74
|
declare const ActivityRaw: Schema.Struct<{
|
|
81
|
-
ID:
|
|
82
|
-
FOLDERID: Schema.optional<Schema.Union<[
|
|
83
|
-
PROJECT_ID: Schema.optional<Schema.Union<[
|
|
84
|
-
TASKID: Schema.optional<Schema.NullOr<Schema.Union<[
|
|
85
|
-
TODOID: Schema.optional<Schema.NullOr<Schema.Union<[
|
|
86
|
-
TICKETID: Schema.optional<Schema.NullOr<Schema.Union<[
|
|
87
|
-
CONTACTID: Schema.optional<Schema.Union<[
|
|
88
|
-
DESCRIPTION: Schema.NullOr<
|
|
89
|
-
DT:
|
|
90
|
-
START_DT: Schema.optional<
|
|
91
|
-
END_DT: Schema.optional<
|
|
92
|
-
DURATION:
|
|
93
|
-
TYPE: Schema.optional<
|
|
94
|
-
PROJECT_NAME: Schema.optional<Schema.NullOr<
|
|
95
|
-
TASK_NAME: Schema.optional<Schema.NullOr<
|
|
96
|
-
CLIENT_NAME: Schema.optional<Schema.NullOr<
|
|
97
|
-
FOLDER_NAME: Schema.optional<Schema.NullOr<
|
|
98
|
-
ENTITY_NAME: Schema.optional<Schema.NullOr<
|
|
99
|
-
PROJECTOWNER_NAME: Schema.optional<Schema.NullOr<
|
|
100
|
-
CLIENT_COLOR: Schema.optional<Schema.NullOr<
|
|
101
|
-
PROJECT_COLOR: Schema.optional<Schema.NullOr<
|
|
102
|
-
PROJECT_STATE: Schema.optional<Schema.NullOr<
|
|
103
|
-
TASK_STATE: Schema.optional<Schema.NullOr<
|
|
104
|
-
TIMESHEET_STATE: Schema.optional<Schema.NullOr<
|
|
105
|
-
BILLING_MODE: Schema.optional<Schema.NullOr<
|
|
106
|
-
NON_BILLABLE: Schema.optional<Schema.NullOr<
|
|
107
|
-
RATE: Schema.optional<Schema.NullOr<
|
|
108
|
-
VALUE: Schema.optional<Schema.NullOr<
|
|
109
|
-
PROJECT_START_DT: Schema.optional<Schema.NullOr<
|
|
110
|
-
PROJECT_END_DT: Schema.optional<Schema.NullOr<
|
|
111
|
-
TASK_START_DT: Schema.optional<Schema.NullOr<
|
|
112
|
-
TASK_END_DT: Schema.optional<Schema.NullOr<
|
|
113
|
-
READONLY: Schema.optional<Schema.NullOr<
|
|
114
|
-
TASK_WORKLOAD: Schema.optional<Schema.NullOr<
|
|
75
|
+
readonly ID: Schema.Finite;
|
|
76
|
+
readonly FOLDERID: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Finite]>>;
|
|
77
|
+
readonly PROJECT_ID: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Finite]>>;
|
|
78
|
+
readonly TASKID: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Finite]>>>;
|
|
79
|
+
readonly TODOID: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Finite]>>>;
|
|
80
|
+
readonly TICKETID: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Finite]>>>;
|
|
81
|
+
readonly CONTACTID: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Finite]>>;
|
|
82
|
+
readonly DESCRIPTION: Schema.NullOr<Schema.String>;
|
|
83
|
+
readonly DT: Schema.String;
|
|
84
|
+
readonly START_DT: Schema.optional<Schema.String>;
|
|
85
|
+
readonly END_DT: Schema.optional<Schema.String>;
|
|
86
|
+
readonly DURATION: Schema.Finite;
|
|
87
|
+
readonly TYPE: Schema.optional<Schema.Finite>;
|
|
88
|
+
readonly PROJECT_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
89
|
+
readonly TASK_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
90
|
+
readonly CLIENT_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
91
|
+
readonly FOLDER_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
92
|
+
readonly ENTITY_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
93
|
+
readonly PROJECTOWNER_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
94
|
+
readonly CLIENT_COLOR: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
95
|
+
readonly PROJECT_COLOR: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
96
|
+
readonly PROJECT_STATE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
97
|
+
readonly TASK_STATE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
98
|
+
readonly TIMESHEET_STATE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
99
|
+
readonly BILLING_MODE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
100
|
+
readonly NON_BILLABLE: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
101
|
+
readonly RATE: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
102
|
+
readonly VALUE: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
103
|
+
readonly PROJECT_START_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
104
|
+
readonly PROJECT_END_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
105
|
+
readonly TASK_START_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
106
|
+
readonly TASK_END_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
107
|
+
readonly READONLY: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
108
|
+
readonly TASK_WORKLOAD: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
115
109
|
}>;
|
|
116
110
|
type ActivityRaw = typeof ActivityRaw.Type;
|
|
117
|
-
declare const Activity_base: Schema.Class<Activity, {
|
|
118
|
-
id:
|
|
119
|
-
projectId: Schema.optional<
|
|
120
|
-
folderId: Schema.optional<
|
|
121
|
-
taskId: Schema.optional<Schema.NullOr<
|
|
122
|
-
todoId: Schema.optional<Schema.NullOr<
|
|
123
|
-
ticketId: Schema.optional<Schema.NullOr<
|
|
124
|
-
userId: Schema.optional<
|
|
125
|
-
description: Schema.NullOr<
|
|
126
|
-
startDate:
|
|
127
|
-
endDate: Schema.optional<
|
|
128
|
-
durationMinutes:
|
|
129
|
-
projectName: Schema.optional<Schema.NullOr<
|
|
130
|
-
taskName: Schema.optional<Schema.NullOr<
|
|
131
|
-
clientName: Schema.optional<Schema.NullOr<
|
|
132
|
-
folderName: Schema.optional<Schema.NullOr<
|
|
133
|
-
entityName: Schema.optional<Schema.NullOr<
|
|
134
|
-
projectOwnerName: Schema.optional<Schema.NullOr<
|
|
135
|
-
projectState: Schema.optional<Schema.NullOr<
|
|
136
|
-
taskState: Schema.optional<Schema.NullOr<
|
|
137
|
-
timesheetState: Schema.optional<Schema.NullOr<
|
|
138
|
-
billingMode: Schema.optional<Schema.NullOr<
|
|
139
|
-
nonBillable: Schema.optional<Schema.NullOr<
|
|
140
|
-
rate: Schema.optional<Schema.NullOr<
|
|
141
|
-
value: Schema.optional<Schema.NullOr<
|
|
142
|
-
projectStartDate: Schema.optional<Schema.NullOr<
|
|
143
|
-
projectEndDate: Schema.optional<Schema.NullOr<
|
|
144
|
-
taskStartDate: Schema.optional<Schema.NullOr<
|
|
145
|
-
taskEndDate: Schema.optional<Schema.NullOr<
|
|
146
|
-
readOnly: Schema.optional<Schema.NullOr<
|
|
147
|
-
taskWorkload: Schema.optional<Schema.NullOr<
|
|
148
|
-
projectColor: Schema.optional<
|
|
149
|
-
clientColor: Schema.optional<
|
|
150
|
-
}
|
|
151
|
-
id: typeof Schema.Number;
|
|
152
|
-
projectId: Schema.optional<typeof Schema.String>;
|
|
153
|
-
folderId: Schema.optional<typeof Schema.String>;
|
|
154
|
-
taskId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
155
|
-
todoId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
156
|
-
ticketId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
157
|
-
userId: Schema.optional<typeof Schema.String>;
|
|
158
|
-
description: Schema.NullOr<typeof Schema.String>;
|
|
159
|
-
startDate: typeof Schema.String;
|
|
160
|
-
endDate: Schema.optional<typeof Schema.String>;
|
|
161
|
-
durationMinutes: typeof Schema.Number;
|
|
162
|
-
projectName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
163
|
-
taskName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
164
|
-
clientName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
165
|
-
folderName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
166
|
-
entityName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
167
|
-
projectOwnerName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
168
|
-
projectState: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
169
|
-
taskState: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
170
|
-
timesheetState: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
171
|
-
billingMode: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
172
|
-
nonBillable: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
173
|
-
rate: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
174
|
-
value: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
175
|
-
projectStartDate: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
176
|
-
projectEndDate: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
177
|
-
taskStartDate: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
178
|
-
taskEndDate: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
179
|
-
readOnly: Schema.optional<Schema.NullOr<typeof Schema.Boolean>>;
|
|
180
|
-
taskWorkload: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
181
|
-
projectColor: Schema.optional<typeof Schema.String>;
|
|
182
|
-
clientColor: Schema.optional<typeof Schema.String>;
|
|
183
|
-
}>, never, {
|
|
184
|
-
readonly billingMode?: string | null | undefined;
|
|
185
|
-
} & {
|
|
186
|
-
readonly clientColor?: string | undefined;
|
|
187
|
-
} & {
|
|
188
|
-
readonly clientName?: string | null | undefined;
|
|
189
|
-
} & {
|
|
190
|
-
readonly endDate?: string | undefined;
|
|
191
|
-
} & {
|
|
192
|
-
readonly entityName?: string | null | undefined;
|
|
193
|
-
} & {
|
|
194
|
-
readonly folderId?: string | undefined;
|
|
195
|
-
} & {
|
|
196
|
-
readonly folderName?: string | null | undefined;
|
|
197
|
-
} & {
|
|
198
|
-
readonly nonBillable?: number | null | undefined;
|
|
199
|
-
} & {
|
|
200
|
-
readonly projectColor?: string | undefined;
|
|
201
|
-
} & {
|
|
202
|
-
readonly projectEndDate?: string | null | undefined;
|
|
203
|
-
} & {
|
|
204
|
-
readonly projectId?: string | undefined;
|
|
205
|
-
} & {
|
|
206
|
-
readonly projectName?: string | null | undefined;
|
|
207
|
-
} & {
|
|
208
|
-
readonly projectOwnerName?: string | null | undefined;
|
|
209
|
-
} & {
|
|
210
|
-
readonly projectStartDate?: string | null | undefined;
|
|
211
|
-
} & {
|
|
212
|
-
readonly projectState?: string | null | undefined;
|
|
213
|
-
} & {
|
|
214
|
-
readonly rate?: number | null | undefined;
|
|
215
|
-
} & {
|
|
216
|
-
readonly readOnly?: boolean | null | undefined;
|
|
217
|
-
} & {
|
|
218
|
-
readonly taskEndDate?: string | null | undefined;
|
|
219
|
-
} & {
|
|
220
|
-
readonly taskId?: string | null | undefined;
|
|
221
|
-
} & {
|
|
222
|
-
readonly taskName?: string | null | undefined;
|
|
223
|
-
} & {
|
|
224
|
-
readonly taskStartDate?: string | null | undefined;
|
|
225
|
-
} & {
|
|
226
|
-
readonly taskState?: string | null | undefined;
|
|
227
|
-
} & {
|
|
228
|
-
readonly taskWorkload?: number | null | undefined;
|
|
229
|
-
} & {
|
|
230
|
-
readonly ticketId?: string | null | undefined;
|
|
231
|
-
} & {
|
|
232
|
-
readonly timesheetState?: string | null | undefined;
|
|
233
|
-
} & {
|
|
234
|
-
readonly todoId?: string | null | undefined;
|
|
235
|
-
} & {
|
|
236
|
-
readonly userId?: string | undefined;
|
|
237
|
-
} & {
|
|
238
|
-
readonly value?: number | null | undefined;
|
|
239
|
-
} & {
|
|
240
|
-
readonly description: string | null;
|
|
241
|
-
} & {
|
|
242
|
-
readonly durationMinutes: number;
|
|
243
|
-
} & {
|
|
244
|
-
readonly id: number;
|
|
245
|
-
} & {
|
|
246
|
-
readonly startDate: string;
|
|
247
|
-
}, {}, {}>;
|
|
111
|
+
declare const Activity_base: Schema.Class<Activity, Schema.Struct<{
|
|
112
|
+
readonly id: Schema.Finite;
|
|
113
|
+
readonly projectId: Schema.optional<Schema.String>;
|
|
114
|
+
readonly folderId: Schema.optional<Schema.String>;
|
|
115
|
+
readonly taskId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
116
|
+
readonly todoId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
117
|
+
readonly ticketId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
118
|
+
readonly userId: Schema.optional<Schema.String>;
|
|
119
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
120
|
+
readonly startDate: Schema.String;
|
|
121
|
+
readonly endDate: Schema.optional<Schema.String>;
|
|
122
|
+
readonly durationMinutes: Schema.Finite;
|
|
123
|
+
readonly projectName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
124
|
+
readonly taskName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
125
|
+
readonly clientName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
126
|
+
readonly folderName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
127
|
+
readonly entityName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
128
|
+
readonly projectOwnerName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
129
|
+
readonly projectState: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
130
|
+
readonly taskState: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
131
|
+
readonly timesheetState: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
132
|
+
readonly billingMode: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
133
|
+
readonly nonBillable: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
134
|
+
readonly rate: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
135
|
+
readonly value: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
136
|
+
readonly projectStartDate: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
137
|
+
readonly projectEndDate: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
138
|
+
readonly taskStartDate: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
139
|
+
readonly taskEndDate: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
140
|
+
readonly readOnly: Schema.optional<Schema.NullOr<Schema.Boolean>>;
|
|
141
|
+
readonly taskWorkload: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
142
|
+
readonly projectColor: Schema.optional<Schema.String>;
|
|
143
|
+
readonly clientColor: Schema.optional<Schema.String>;
|
|
144
|
+
}>, {}>;
|
|
248
145
|
declare class Activity extends Activity_base {}
|
|
249
|
-
declare function activityFromRaw(raw: ActivityRaw):
|
|
146
|
+
declare function activityFromRaw(raw: ActivityRaw): Activity;
|
|
250
147
|
declare const GetWeekResponse: Schema.Struct<{
|
|
251
|
-
ACTIVITIES: Schema
|
|
252
|
-
ID:
|
|
253
|
-
FOLDERID: Schema.optional<Schema.Union<[
|
|
254
|
-
PROJECT_ID: Schema.optional<Schema.Union<[
|
|
255
|
-
TASKID: Schema.optional<Schema.NullOr<Schema.Union<[
|
|
256
|
-
TODOID: Schema.optional<Schema.NullOr<Schema.Union<[
|
|
257
|
-
TICKETID: Schema.optional<Schema.NullOr<Schema.Union<[
|
|
258
|
-
CONTACTID: Schema.optional<Schema.Union<[
|
|
259
|
-
DESCRIPTION: Schema.NullOr<
|
|
260
|
-
DT:
|
|
261
|
-
START_DT: Schema.optional<
|
|
262
|
-
END_DT: Schema.optional<
|
|
263
|
-
DURATION:
|
|
264
|
-
TYPE: Schema.optional<
|
|
265
|
-
PROJECT_NAME: Schema.optional<Schema.NullOr<
|
|
266
|
-
TASK_NAME: Schema.optional<Schema.NullOr<
|
|
267
|
-
CLIENT_NAME: Schema.optional<Schema.NullOr<
|
|
268
|
-
FOLDER_NAME: Schema.optional<Schema.NullOr<
|
|
269
|
-
ENTITY_NAME: Schema.optional<Schema.NullOr<
|
|
270
|
-
PROJECTOWNER_NAME: Schema.optional<Schema.NullOr<
|
|
271
|
-
CLIENT_COLOR: Schema.optional<Schema.NullOr<
|
|
272
|
-
PROJECT_COLOR: Schema.optional<Schema.NullOr<
|
|
273
|
-
PROJECT_STATE: Schema.optional<Schema.NullOr<
|
|
274
|
-
TASK_STATE: Schema.optional<Schema.NullOr<
|
|
275
|
-
TIMESHEET_STATE: Schema.optional<Schema.NullOr<
|
|
276
|
-
BILLING_MODE: Schema.optional<Schema.NullOr<
|
|
277
|
-
NON_BILLABLE: Schema.optional<Schema.NullOr<
|
|
278
|
-
RATE: Schema.optional<Schema.NullOr<
|
|
279
|
-
VALUE: Schema.optional<Schema.NullOr<
|
|
280
|
-
PROJECT_START_DT: Schema.optional<Schema.NullOr<
|
|
281
|
-
PROJECT_END_DT: Schema.optional<Schema.NullOr<
|
|
282
|
-
TASK_START_DT: Schema.optional<Schema.NullOr<
|
|
283
|
-
TASK_END_DT: Schema.optional<Schema.NullOr<
|
|
284
|
-
READONLY: Schema.optional<Schema.NullOr<
|
|
285
|
-
TASK_WORKLOAD: Schema.optional<Schema.NullOr<
|
|
148
|
+
readonly ACTIVITIES: Schema.$Array<Schema.Struct<{
|
|
149
|
+
readonly ID: Schema.Finite;
|
|
150
|
+
readonly FOLDERID: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Finite]>>;
|
|
151
|
+
readonly PROJECT_ID: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Finite]>>;
|
|
152
|
+
readonly TASKID: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Finite]>>>;
|
|
153
|
+
readonly TODOID: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Finite]>>>;
|
|
154
|
+
readonly TICKETID: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Finite]>>>;
|
|
155
|
+
readonly CONTACTID: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Finite]>>;
|
|
156
|
+
readonly DESCRIPTION: Schema.NullOr<Schema.String>;
|
|
157
|
+
readonly DT: Schema.String;
|
|
158
|
+
readonly START_DT: Schema.optional<Schema.String>;
|
|
159
|
+
readonly END_DT: Schema.optional<Schema.String>;
|
|
160
|
+
readonly DURATION: Schema.Finite;
|
|
161
|
+
readonly TYPE: Schema.optional<Schema.Finite>;
|
|
162
|
+
readonly PROJECT_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
163
|
+
readonly TASK_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
164
|
+
readonly CLIENT_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
165
|
+
readonly FOLDER_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
166
|
+
readonly ENTITY_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
167
|
+
readonly PROJECTOWNER_NAME: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
168
|
+
readonly CLIENT_COLOR: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
169
|
+
readonly PROJECT_COLOR: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
170
|
+
readonly PROJECT_STATE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
171
|
+
readonly TASK_STATE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
172
|
+
readonly TIMESHEET_STATE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
173
|
+
readonly BILLING_MODE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
174
|
+
readonly NON_BILLABLE: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
175
|
+
readonly RATE: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
176
|
+
readonly VALUE: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
177
|
+
readonly PROJECT_START_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
178
|
+
readonly PROJECT_END_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
179
|
+
readonly TASK_START_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
180
|
+
readonly TASK_END_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
181
|
+
readonly READONLY: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
182
|
+
readonly TASK_WORKLOAD: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
286
183
|
}>>;
|
|
287
184
|
}>;
|
|
288
185
|
type GetWeekResponse = typeof GetWeekResponse.Type;
|
|
289
186
|
declare const SetActivityResponse: Schema.Struct<{
|
|
290
|
-
ID:
|
|
291
|
-
DURATION: Schema.optional<
|
|
292
|
-
DT: Schema.optional<
|
|
293
|
-
TYPE: Schema.optional<
|
|
294
|
-
DESCRIPTION: Schema.optional<Schema.NullOr<
|
|
295
|
-
CLIENT_COLOR: Schema.optional<
|
|
296
|
-
FOLDERID: Schema.optional<Schema.Union<[
|
|
187
|
+
readonly ID: Schema.Finite;
|
|
188
|
+
readonly DURATION: Schema.optional<Schema.Finite>;
|
|
189
|
+
readonly DT: Schema.optional<Schema.String>;
|
|
190
|
+
readonly TYPE: Schema.optional<Schema.Finite>;
|
|
191
|
+
readonly DESCRIPTION: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
192
|
+
readonly CLIENT_COLOR: Schema.optional<Schema.String>;
|
|
193
|
+
readonly FOLDERID: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Finite]>>;
|
|
297
194
|
}>;
|
|
298
195
|
type SetActivityResponse = typeof SetActivityResponse.Type;
|
|
299
196
|
interface CreateActivityParams {
|
|
@@ -318,240 +215,117 @@ interface DeleteActivityParams {
|
|
|
318
215
|
//#endregion
|
|
319
216
|
//#region src/services/TimeService.d.ts
|
|
320
217
|
interface TimeServiceShape {
|
|
321
|
-
readonly getWeek: (date: Date, contactId: string, timezone?: string) => Effect.Effect<ReadonlyArray<
|
|
218
|
+
readonly getWeek: (date: Date, contactId: string, timezone?: string) => Effect.Effect<ReadonlyArray<Activity>, TloError>;
|
|
322
219
|
readonly createActivity: (params: CreateActivityParams) => Effect.Effect<number, TloError>;
|
|
323
220
|
readonly updateActivity: (params: UpdateActivityParams) => Effect.Effect<void, TloError>;
|
|
324
221
|
readonly deleteActivity: (params: DeleteActivityParams) => Effect.Effect<void, TloError>;
|
|
325
222
|
}
|
|
326
|
-
declare const TimeService_base: Context.
|
|
223
|
+
declare const TimeService_base: Context.ServiceClass<TimeService, "@2digits/tlo-mcp/services/TimeService", TimeServiceShape>;
|
|
327
224
|
declare class TimeService extends TimeService_base {}
|
|
328
225
|
declare const TimeServiceLive: Layer.Layer<TimeService, never, TeamLeaderClient>;
|
|
329
226
|
//#endregion
|
|
330
227
|
//#region src/schemas/board.d.ts
|
|
331
228
|
type ProjectRaw = typeof ProjectRaw.Type;
|
|
332
229
|
declare const ProjectRaw: Schema.Struct<{
|
|
333
|
-
ID:
|
|
334
|
-
PROJECT_NAME: Schema.optional<
|
|
335
|
-
NAME: Schema.optional<
|
|
336
|
-
STATE: Schema.optional<
|
|
337
|
-
OWNER_NAME: Schema.optional<
|
|
338
|
-
START_DT: Schema.optional<
|
|
339
|
-
END_DT: Schema.optional<
|
|
340
|
-
BILLING_BUDGET: Schema.optional<
|
|
341
|
-
BILLING_MODE: Schema.optional<
|
|
342
|
-
BILLING_REMAINING: Schema.optional<
|
|
343
|
-
CLIENT_NAME: Schema.optional<
|
|
344
|
-
CLIENT_ID: Schema.optional<
|
|
345
|
-
FOLDERID: Schema.optional<
|
|
346
|
-
FOLDER_NAME: Schema.optional<
|
|
347
|
-
EXTID: Schema.optional<
|
|
348
|
-
CALC_TOTAL: Schema.optional<
|
|
349
|
-
CALC_DONE: Schema.optional<
|
|
350
|
-
CALC_PLANNED: Schema.optional<
|
|
230
|
+
readonly ID: Schema.Finite;
|
|
231
|
+
readonly PROJECT_NAME: Schema.optional<Schema.String>;
|
|
232
|
+
readonly NAME: Schema.optional<Schema.String>;
|
|
233
|
+
readonly STATE: Schema.optional<Schema.String>;
|
|
234
|
+
readonly OWNER_NAME: Schema.optional<Schema.String>;
|
|
235
|
+
readonly START_DT: Schema.optional<Schema.String>;
|
|
236
|
+
readonly END_DT: Schema.optional<Schema.String>;
|
|
237
|
+
readonly BILLING_BUDGET: Schema.optional<Schema.Finite>;
|
|
238
|
+
readonly BILLING_MODE: Schema.optional<Schema.String>;
|
|
239
|
+
readonly BILLING_REMAINING: Schema.optional<Schema.Finite>;
|
|
240
|
+
readonly CLIENT_NAME: Schema.optional<Schema.String>;
|
|
241
|
+
readonly CLIENT_ID: Schema.optional<Schema.Finite>;
|
|
242
|
+
readonly FOLDERID: Schema.optional<Schema.Finite>;
|
|
243
|
+
readonly FOLDER_NAME: Schema.optional<Schema.String>;
|
|
244
|
+
readonly EXTID: Schema.optional<Schema.String>;
|
|
245
|
+
readonly CALC_TOTAL: Schema.optional<Schema.Finite>;
|
|
246
|
+
readonly CALC_DONE: Schema.optional<Schema.Finite>;
|
|
247
|
+
readonly CALC_PLANNED: Schema.optional<Schema.Finite>;
|
|
351
248
|
}>;
|
|
352
|
-
declare const Project_base: Schema.Class<Project, {
|
|
353
|
-
id:
|
|
354
|
-
name:
|
|
355
|
-
state: Schema.optional<
|
|
356
|
-
ownerName: Schema.optional<
|
|
357
|
-
startDate: Schema.optional<
|
|
358
|
-
endDate: Schema.optional<
|
|
359
|
-
billingBudget: Schema.optional<
|
|
360
|
-
billingMode: Schema.optional<
|
|
361
|
-
billingRemaining: Schema.optional<
|
|
362
|
-
clientName: Schema.optional<
|
|
363
|
-
clientId: Schema.optional<
|
|
364
|
-
folderId: Schema.optional<
|
|
365
|
-
folderName: Schema.optional<
|
|
366
|
-
extId: Schema.optional<
|
|
367
|
-
calcTotal: Schema.optional<
|
|
368
|
-
calcDone: Schema.optional<
|
|
369
|
-
calcPlanned: Schema.optional<
|
|
370
|
-
}
|
|
371
|
-
id: typeof Schema.Number;
|
|
372
|
-
name: typeof Schema.String;
|
|
373
|
-
state: Schema.optional<typeof Schema.String>;
|
|
374
|
-
ownerName: Schema.optional<typeof Schema.String>;
|
|
375
|
-
startDate: Schema.optional<typeof Schema.String>;
|
|
376
|
-
endDate: Schema.optional<typeof Schema.String>;
|
|
377
|
-
billingBudget: Schema.optional<typeof Schema.Number>;
|
|
378
|
-
billingMode: Schema.optional<typeof Schema.String>;
|
|
379
|
-
billingRemaining: Schema.optional<typeof Schema.Number>;
|
|
380
|
-
clientName: Schema.optional<typeof Schema.String>;
|
|
381
|
-
clientId: Schema.optional<typeof Schema.Number>;
|
|
382
|
-
folderId: Schema.optional<typeof Schema.Number>;
|
|
383
|
-
folderName: Schema.optional<typeof Schema.String>;
|
|
384
|
-
extId: Schema.optional<typeof Schema.String>;
|
|
385
|
-
calcTotal: Schema.optional<typeof Schema.Number>;
|
|
386
|
-
calcDone: Schema.optional<typeof Schema.Number>;
|
|
387
|
-
calcPlanned: Schema.optional<typeof Schema.Number>;
|
|
388
|
-
}>, never, {
|
|
389
|
-
readonly billingBudget?: number | undefined;
|
|
390
|
-
} & {
|
|
391
|
-
readonly billingMode?: string | undefined;
|
|
392
|
-
} & {
|
|
393
|
-
readonly billingRemaining?: number | undefined;
|
|
394
|
-
} & {
|
|
395
|
-
readonly calcDone?: number | undefined;
|
|
396
|
-
} & {
|
|
397
|
-
readonly calcPlanned?: number | undefined;
|
|
398
|
-
} & {
|
|
399
|
-
readonly calcTotal?: number | undefined;
|
|
400
|
-
} & {
|
|
401
|
-
readonly clientId?: number | undefined;
|
|
402
|
-
} & {
|
|
403
|
-
readonly clientName?: string | undefined;
|
|
404
|
-
} & {
|
|
405
|
-
readonly endDate?: string | undefined;
|
|
406
|
-
} & {
|
|
407
|
-
readonly extId?: string | undefined;
|
|
408
|
-
} & {
|
|
409
|
-
readonly folderId?: number | undefined;
|
|
410
|
-
} & {
|
|
411
|
-
readonly folderName?: string | undefined;
|
|
412
|
-
} & {
|
|
413
|
-
readonly ownerName?: string | undefined;
|
|
414
|
-
} & {
|
|
415
|
-
readonly startDate?: string | undefined;
|
|
416
|
-
} & {
|
|
417
|
-
readonly state?: string | undefined;
|
|
418
|
-
} & {
|
|
419
|
-
readonly id: number;
|
|
420
|
-
} & {
|
|
421
|
-
readonly name: string;
|
|
422
|
-
}, {}, {}>;
|
|
249
|
+
declare const Project_base: Schema.Class<Project, Schema.Struct<{
|
|
250
|
+
readonly id: Schema.Finite;
|
|
251
|
+
readonly name: Schema.String;
|
|
252
|
+
readonly state: Schema.optional<Schema.String>;
|
|
253
|
+
readonly ownerName: Schema.optional<Schema.String>;
|
|
254
|
+
readonly startDate: Schema.optional<Schema.String>;
|
|
255
|
+
readonly endDate: Schema.optional<Schema.String>;
|
|
256
|
+
readonly billingBudget: Schema.optional<Schema.Finite>;
|
|
257
|
+
readonly billingMode: Schema.optional<Schema.String>;
|
|
258
|
+
readonly billingRemaining: Schema.optional<Schema.Finite>;
|
|
259
|
+
readonly clientName: Schema.optional<Schema.String>;
|
|
260
|
+
readonly clientId: Schema.optional<Schema.Finite>;
|
|
261
|
+
readonly folderId: Schema.optional<Schema.Finite>;
|
|
262
|
+
readonly folderName: Schema.optional<Schema.String>;
|
|
263
|
+
readonly extId: Schema.optional<Schema.String>;
|
|
264
|
+
readonly calcTotal: Schema.optional<Schema.Finite>;
|
|
265
|
+
readonly calcDone: Schema.optional<Schema.Finite>;
|
|
266
|
+
readonly calcPlanned: Schema.optional<Schema.Finite>;
|
|
267
|
+
}>, {}>;
|
|
423
268
|
declare class Project extends Project_base {}
|
|
424
269
|
declare function projectFromRaw(raw: ProjectRaw): Project;
|
|
425
270
|
type MessageRaw = typeof MessageRaw.Type;
|
|
426
271
|
declare const MessageRaw: Schema.Struct<{
|
|
427
|
-
ID:
|
|
428
|
-
OWNERID: Schema.optional<
|
|
429
|
-
OWNER_NAME: Schema.optional<
|
|
430
|
-
AVATAR: Schema.optional<
|
|
431
|
-
CREATED_DT: Schema.optional<
|
|
432
|
-
CONTENT: Schema.optional<
|
|
433
|
-
SUBCONTENT: Schema.optional<
|
|
434
|
-
OBJECTTYPE: Schema.optional<
|
|
435
|
-
OBJECTID: Schema.optional<
|
|
436
|
-
OBJECTNAME: Schema.optional<
|
|
437
|
-
MSGTYPE: Schema.optional<
|
|
438
|
-
LIKECNT: Schema.optional<
|
|
439
|
-
REPLYCNT: Schema.optional<
|
|
440
|
-
OUTQUEUEID: Schema.optional<
|
|
441
|
-
INTERNAL: Schema.optional<
|
|
272
|
+
readonly ID: Schema.Finite;
|
|
273
|
+
readonly OWNERID: Schema.optional<Schema.Finite>;
|
|
274
|
+
readonly OWNER_NAME: Schema.optional<Schema.String>;
|
|
275
|
+
readonly AVATAR: Schema.optional<Schema.String>;
|
|
276
|
+
readonly CREATED_DT: Schema.optional<Schema.String>;
|
|
277
|
+
readonly CONTENT: Schema.optional<Schema.String>;
|
|
278
|
+
readonly SUBCONTENT: Schema.optional<Schema.String>;
|
|
279
|
+
readonly OBJECTTYPE: Schema.optional<Schema.String>;
|
|
280
|
+
readonly OBJECTID: Schema.optional<Schema.Finite>;
|
|
281
|
+
readonly OBJECTNAME: Schema.optional<Schema.String>;
|
|
282
|
+
readonly MSGTYPE: Schema.optional<Schema.String>;
|
|
283
|
+
readonly LIKECNT: Schema.optional<Schema.Finite>;
|
|
284
|
+
readonly REPLYCNT: Schema.optional<Schema.Finite>;
|
|
285
|
+
readonly OUTQUEUEID: Schema.optional<Schema.String>;
|
|
286
|
+
readonly INTERNAL: Schema.optional<Schema.Finite>;
|
|
442
287
|
}>;
|
|
443
|
-
declare const Message_base: Schema.Class<Message, {
|
|
444
|
-
id:
|
|
445
|
-
ownerId: Schema.optional<
|
|
446
|
-
ownerName: Schema.optional<
|
|
447
|
-
avatar: Schema.optional<
|
|
448
|
-
createdAt: Schema.optional<
|
|
449
|
-
content: Schema.optional<
|
|
450
|
-
subcontent: Schema.optional<
|
|
451
|
-
objectType: Schema.optional<
|
|
452
|
-
objectId: Schema.optional<
|
|
453
|
-
objectName: Schema.optional<
|
|
454
|
-
messageType: Schema.optional<
|
|
455
|
-
likeCount: Schema.optional<
|
|
456
|
-
replyCount: Schema.optional<
|
|
457
|
-
outQueueId: Schema.optional<
|
|
458
|
-
internal: Schema.optional<
|
|
459
|
-
}
|
|
460
|
-
id: typeof Schema.Number;
|
|
461
|
-
ownerId: Schema.optional<typeof Schema.Number>;
|
|
462
|
-
ownerName: Schema.optional<typeof Schema.String>;
|
|
463
|
-
avatar: Schema.optional<typeof Schema.String>;
|
|
464
|
-
createdAt: Schema.optional<typeof Schema.String>;
|
|
465
|
-
content: Schema.optional<typeof Schema.String>;
|
|
466
|
-
subcontent: Schema.optional<typeof Schema.String>;
|
|
467
|
-
objectType: Schema.optional<typeof Schema.String>;
|
|
468
|
-
objectId: Schema.optional<typeof Schema.Number>;
|
|
469
|
-
objectName: Schema.optional<typeof Schema.String>;
|
|
470
|
-
messageType: Schema.optional<typeof Schema.String>;
|
|
471
|
-
likeCount: Schema.optional<typeof Schema.Number>;
|
|
472
|
-
replyCount: Schema.optional<typeof Schema.Number>;
|
|
473
|
-
outQueueId: Schema.optional<typeof Schema.String>;
|
|
474
|
-
internal: Schema.optional<typeof Schema.Boolean>;
|
|
475
|
-
}>, never, {
|
|
476
|
-
readonly avatar?: string | undefined;
|
|
477
|
-
} & {
|
|
478
|
-
readonly content?: string | undefined;
|
|
479
|
-
} & {
|
|
480
|
-
readonly createdAt?: string | undefined;
|
|
481
|
-
} & {
|
|
482
|
-
readonly internal?: boolean | undefined;
|
|
483
|
-
} & {
|
|
484
|
-
readonly likeCount?: number | undefined;
|
|
485
|
-
} & {
|
|
486
|
-
readonly messageType?: string | undefined;
|
|
487
|
-
} & {
|
|
488
|
-
readonly objectId?: number | undefined;
|
|
489
|
-
} & {
|
|
490
|
-
readonly objectName?: string | undefined;
|
|
491
|
-
} & {
|
|
492
|
-
readonly objectType?: string | undefined;
|
|
493
|
-
} & {
|
|
494
|
-
readonly outQueueId?: string | undefined;
|
|
495
|
-
} & {
|
|
496
|
-
readonly ownerId?: number | undefined;
|
|
497
|
-
} & {
|
|
498
|
-
readonly ownerName?: string | undefined;
|
|
499
|
-
} & {
|
|
500
|
-
readonly replyCount?: number | undefined;
|
|
501
|
-
} & {
|
|
502
|
-
readonly subcontent?: string | undefined;
|
|
503
|
-
} & {
|
|
504
|
-
readonly id: number;
|
|
505
|
-
}, {}, {}>;
|
|
288
|
+
declare const Message_base: Schema.Class<Message, Schema.Struct<{
|
|
289
|
+
readonly id: Schema.Finite;
|
|
290
|
+
readonly ownerId: Schema.optional<Schema.Finite>;
|
|
291
|
+
readonly ownerName: Schema.optional<Schema.String>;
|
|
292
|
+
readonly avatar: Schema.optional<Schema.String>;
|
|
293
|
+
readonly createdAt: Schema.optional<Schema.String>;
|
|
294
|
+
readonly content: Schema.optional<Schema.String>;
|
|
295
|
+
readonly subcontent: Schema.optional<Schema.String>;
|
|
296
|
+
readonly objectType: Schema.optional<Schema.String>;
|
|
297
|
+
readonly objectId: Schema.optional<Schema.Finite>;
|
|
298
|
+
readonly objectName: Schema.optional<Schema.String>;
|
|
299
|
+
readonly messageType: Schema.optional<Schema.String>;
|
|
300
|
+
readonly likeCount: Schema.optional<Schema.Finite>;
|
|
301
|
+
readonly replyCount: Schema.optional<Schema.Finite>;
|
|
302
|
+
readonly outQueueId: Schema.optional<Schema.String>;
|
|
303
|
+
readonly internal: Schema.optional<Schema.Boolean>;
|
|
304
|
+
}>, {}>;
|
|
506
305
|
declare class Message extends Message_base {}
|
|
507
|
-
declare function messageFromRaw(raw: MessageRaw):
|
|
306
|
+
declare function messageFromRaw(raw: MessageRaw): Message;
|
|
508
307
|
type TaskState = 'OPEN' | 'COMPLETED' | 'DRAFT' | 'CLOSED';
|
|
509
308
|
type TaskRaw = typeof TaskRaw.Type;
|
|
510
309
|
declare const TaskRaw: Schema.Struct<{
|
|
511
|
-
ID:
|
|
512
|
-
PROJECTID: Schema.optional<
|
|
513
|
-
NAME: Schema.optional<
|
|
514
|
-
STATE: Schema.optional<
|
|
515
|
-
OWNER_NAME: Schema.optional<
|
|
516
|
-
START_DT: Schema.optional<
|
|
517
|
-
END_DT: Schema.optional<
|
|
518
|
-
BUDGET: Schema.optional<
|
|
310
|
+
readonly ID: Schema.Finite;
|
|
311
|
+
readonly PROJECTID: Schema.optional<Schema.Finite>;
|
|
312
|
+
readonly NAME: Schema.optional<Schema.String>;
|
|
313
|
+
readonly STATE: Schema.optional<Schema.String>;
|
|
314
|
+
readonly OWNER_NAME: Schema.optional<Schema.String>;
|
|
315
|
+
readonly START_DT: Schema.optional<Schema.String>;
|
|
316
|
+
readonly END_DT: Schema.optional<Schema.String>;
|
|
317
|
+
readonly BUDGET: Schema.optional<Schema.Finite>;
|
|
519
318
|
}>;
|
|
520
|
-
declare const Task_base: Schema.Class<Task, {
|
|
521
|
-
id:
|
|
522
|
-
projectId: Schema.optional<
|
|
523
|
-
name: Schema.optional<
|
|
524
|
-
state: Schema.optional<
|
|
525
|
-
ownerName: Schema.optional<
|
|
526
|
-
startDate: Schema.optional<
|
|
527
|
-
endDate: Schema.optional<
|
|
528
|
-
budget: Schema.optional<
|
|
529
|
-
}
|
|
530
|
-
id: typeof Schema.Number;
|
|
531
|
-
projectId: Schema.optional<typeof Schema.Number>;
|
|
532
|
-
name: Schema.optional<typeof Schema.String>;
|
|
533
|
-
state: Schema.optional<typeof Schema.String>;
|
|
534
|
-
ownerName: Schema.optional<typeof Schema.String>;
|
|
535
|
-
startDate: Schema.optional<typeof Schema.String>;
|
|
536
|
-
endDate: Schema.optional<typeof Schema.String>;
|
|
537
|
-
budget: Schema.optional<typeof Schema.Number>;
|
|
538
|
-
}>, never, {
|
|
539
|
-
readonly budget?: number | undefined;
|
|
540
|
-
} & {
|
|
541
|
-
readonly endDate?: string | undefined;
|
|
542
|
-
} & {
|
|
543
|
-
readonly name?: string | undefined;
|
|
544
|
-
} & {
|
|
545
|
-
readonly ownerName?: string | undefined;
|
|
546
|
-
} & {
|
|
547
|
-
readonly projectId?: number | undefined;
|
|
548
|
-
} & {
|
|
549
|
-
readonly startDate?: string | undefined;
|
|
550
|
-
} & {
|
|
551
|
-
readonly state?: string | undefined;
|
|
552
|
-
} & {
|
|
553
|
-
readonly id: number;
|
|
554
|
-
}, {}, {}>;
|
|
319
|
+
declare const Task_base: Schema.Class<Task, Schema.Struct<{
|
|
320
|
+
readonly id: Schema.Finite;
|
|
321
|
+
readonly projectId: Schema.optional<Schema.Finite>;
|
|
322
|
+
readonly name: Schema.optional<Schema.String>;
|
|
323
|
+
readonly state: Schema.optional<Schema.String>;
|
|
324
|
+
readonly ownerName: Schema.optional<Schema.String>;
|
|
325
|
+
readonly startDate: Schema.optional<Schema.String>;
|
|
326
|
+
readonly endDate: Schema.optional<Schema.String>;
|
|
327
|
+
readonly budget: Schema.optional<Schema.Finite>;
|
|
328
|
+
}>, {}>;
|
|
555
329
|
declare class Task extends Task_base {}
|
|
556
330
|
interface SetTaskStateParams {
|
|
557
331
|
readonly projectId: number;
|
|
@@ -572,126 +346,61 @@ interface GetProjectsParams {
|
|
|
572
346
|
}
|
|
573
347
|
type TaskForUserRaw = typeof TaskForUserRaw.Type;
|
|
574
348
|
declare const TaskForUserRaw: Schema.Struct<{
|
|
575
|
-
ID:
|
|
576
|
-
WORKLOAD: Schema.optional<
|
|
577
|
-
TOTAL: Schema.optional<
|
|
578
|
-
REMAINING: Schema.optional<
|
|
579
|
-
AVAIL: Schema.optional<
|
|
580
|
-
CLIENTID: Schema.optional<
|
|
581
|
-
PROJECTID: Schema.optional<
|
|
582
|
-
PROJECT_START_DT: Schema.optional<
|
|
583
|
-
PROJECT_END_DT: Schema.optional<
|
|
584
|
-
START_DT: Schema.optional<
|
|
585
|
-
END_DT: Schema.optional<
|
|
586
|
-
STATE: Schema.optional<
|
|
349
|
+
readonly ID: Schema.Finite;
|
|
350
|
+
readonly WORKLOAD: Schema.optional<Schema.Finite>;
|
|
351
|
+
readonly TOTAL: Schema.optional<Schema.Finite>;
|
|
352
|
+
readonly REMAINING: Schema.optional<Schema.Finite>;
|
|
353
|
+
readonly AVAIL: Schema.optional<Schema.Finite>;
|
|
354
|
+
readonly CLIENTID: Schema.optional<Schema.Finite>;
|
|
355
|
+
readonly PROJECTID: Schema.optional<Schema.Finite>;
|
|
356
|
+
readonly PROJECT_START_DT: Schema.optional<Schema.String>;
|
|
357
|
+
readonly PROJECT_END_DT: Schema.optional<Schema.String>;
|
|
358
|
+
readonly START_DT: Schema.optional<Schema.String>;
|
|
359
|
+
readonly END_DT: Schema.optional<Schema.String>;
|
|
360
|
+
readonly STATE: Schema.optional<Schema.String>;
|
|
587
361
|
}>;
|
|
588
|
-
declare const TaskForUser_base: Schema.Class<TaskForUser, {
|
|
589
|
-
id:
|
|
590
|
-
workload: Schema.optional<
|
|
591
|
-
total: Schema.optional<
|
|
592
|
-
remaining: Schema.optional<
|
|
593
|
-
avail: Schema.optional<
|
|
594
|
-
clientId: Schema.optional<
|
|
595
|
-
projectId: Schema.optional<
|
|
596
|
-
projectStartDate: Schema.optional<
|
|
597
|
-
projectEndDate: Schema.optional<
|
|
598
|
-
startDate: Schema.optional<
|
|
599
|
-
endDate: Schema.optional<
|
|
600
|
-
state: Schema.optional<
|
|
601
|
-
}
|
|
602
|
-
id: typeof Schema.Number;
|
|
603
|
-
workload: Schema.optional<typeof Schema.Number>;
|
|
604
|
-
total: Schema.optional<typeof Schema.Number>;
|
|
605
|
-
remaining: Schema.optional<typeof Schema.Number>;
|
|
606
|
-
avail: Schema.optional<typeof Schema.Number>;
|
|
607
|
-
clientId: Schema.optional<typeof Schema.Number>;
|
|
608
|
-
projectId: Schema.optional<typeof Schema.Number>;
|
|
609
|
-
projectStartDate: Schema.optional<typeof Schema.String>;
|
|
610
|
-
projectEndDate: Schema.optional<typeof Schema.String>;
|
|
611
|
-
startDate: Schema.optional<typeof Schema.String>;
|
|
612
|
-
endDate: Schema.optional<typeof Schema.String>;
|
|
613
|
-
state: Schema.optional<typeof Schema.String>;
|
|
614
|
-
}>, never, {
|
|
615
|
-
readonly avail?: number | undefined;
|
|
616
|
-
} & {
|
|
617
|
-
readonly clientId?: number | undefined;
|
|
618
|
-
} & {
|
|
619
|
-
readonly endDate?: string | undefined;
|
|
620
|
-
} & {
|
|
621
|
-
readonly projectEndDate?: string | undefined;
|
|
622
|
-
} & {
|
|
623
|
-
readonly projectId?: number | undefined;
|
|
624
|
-
} & {
|
|
625
|
-
readonly projectStartDate?: string | undefined;
|
|
626
|
-
} & {
|
|
627
|
-
readonly remaining?: number | undefined;
|
|
628
|
-
} & {
|
|
629
|
-
readonly startDate?: string | undefined;
|
|
630
|
-
} & {
|
|
631
|
-
readonly state?: string | undefined;
|
|
632
|
-
} & {
|
|
633
|
-
readonly total?: number | undefined;
|
|
634
|
-
} & {
|
|
635
|
-
readonly workload?: number | undefined;
|
|
636
|
-
} & {
|
|
637
|
-
readonly id: number;
|
|
638
|
-
}, {}, {}>;
|
|
362
|
+
declare const TaskForUser_base: Schema.Class<TaskForUser, Schema.Struct<{
|
|
363
|
+
readonly id: Schema.Finite;
|
|
364
|
+
readonly workload: Schema.optional<Schema.Finite>;
|
|
365
|
+
readonly total: Schema.optional<Schema.Finite>;
|
|
366
|
+
readonly remaining: Schema.optional<Schema.Finite>;
|
|
367
|
+
readonly avail: Schema.optional<Schema.Finite>;
|
|
368
|
+
readonly clientId: Schema.optional<Schema.Finite>;
|
|
369
|
+
readonly projectId: Schema.optional<Schema.Finite>;
|
|
370
|
+
readonly projectStartDate: Schema.optional<Schema.String>;
|
|
371
|
+
readonly projectEndDate: Schema.optional<Schema.String>;
|
|
372
|
+
readonly startDate: Schema.optional<Schema.String>;
|
|
373
|
+
readonly endDate: Schema.optional<Schema.String>;
|
|
374
|
+
readonly state: Schema.optional<Schema.String>;
|
|
375
|
+
}>, {}>;
|
|
639
376
|
declare class TaskForUser extends TaskForUser_base {}
|
|
640
377
|
type TodoDetail = typeof TodoDetail.Type;
|
|
641
|
-
declare const TodoDetail: Schema
|
|
378
|
+
declare const TodoDetail: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
642
379
|
type TodoSummaryRaw = typeof TodoSummaryRaw.Type;
|
|
643
380
|
declare const TodoSummaryRaw: Schema.Struct<{
|
|
644
|
-
ID:
|
|
645
|
-
NAME: Schema.optional<
|
|
646
|
-
BOARDLISTID: Schema.optional<
|
|
647
|
-
BOARDID: Schema.optional<
|
|
648
|
-
OWNERID: Schema.optional<
|
|
649
|
-
EXTID: Schema.optional<
|
|
650
|
-
STATE: Schema.optional<Schema.NullOr<
|
|
651
|
-
DUE_DT: Schema.optional<Schema.NullOr<
|
|
652
|
-
DESCRIPTION: Schema.optional<Schema.NullOr<
|
|
381
|
+
readonly ID: Schema.Finite;
|
|
382
|
+
readonly NAME: Schema.optional<Schema.String>;
|
|
383
|
+
readonly BOARDLISTID: Schema.optional<Schema.Finite>;
|
|
384
|
+
readonly BOARDID: Schema.optional<Schema.Finite>;
|
|
385
|
+
readonly OWNERID: Schema.optional<Schema.Finite>;
|
|
386
|
+
readonly EXTID: Schema.optional<Schema.String>;
|
|
387
|
+
readonly STATE: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
388
|
+
readonly DUE_DT: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
389
|
+
readonly DESCRIPTION: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
653
390
|
}>;
|
|
654
|
-
declare const TodoSummary_base: Schema.Class<TodoSummary, {
|
|
655
|
-
id:
|
|
656
|
-
name: Schema.optional<
|
|
657
|
-
boardListId: Schema.optional<
|
|
658
|
-
boardId: Schema.optional<
|
|
659
|
-
ownerId: Schema.optional<
|
|
660
|
-
extId: Schema.optional<
|
|
661
|
-
state: Schema.optional<Schema.NullOr<
|
|
662
|
-
dueDate: Schema.optional<Schema.NullOr<
|
|
663
|
-
description: Schema.optional<Schema.NullOr<
|
|
664
|
-
}
|
|
665
|
-
id: typeof Schema.Number;
|
|
666
|
-
name: Schema.optional<typeof Schema.String>;
|
|
667
|
-
boardListId: Schema.optional<typeof Schema.Number>;
|
|
668
|
-
boardId: Schema.optional<typeof Schema.Number>;
|
|
669
|
-
ownerId: Schema.optional<typeof Schema.Number>;
|
|
670
|
-
extId: Schema.optional<typeof Schema.String>;
|
|
671
|
-
state: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
672
|
-
dueDate: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
673
|
-
description: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
674
|
-
}>, never, {
|
|
675
|
-
readonly boardId?: number | undefined;
|
|
676
|
-
} & {
|
|
677
|
-
readonly boardListId?: number | undefined;
|
|
678
|
-
} & {
|
|
679
|
-
readonly description?: string | null | undefined;
|
|
680
|
-
} & {
|
|
681
|
-
readonly dueDate?: string | null | undefined;
|
|
682
|
-
} & {
|
|
683
|
-
readonly extId?: string | undefined;
|
|
684
|
-
} & {
|
|
685
|
-
readonly name?: string | undefined;
|
|
686
|
-
} & {
|
|
687
|
-
readonly ownerId?: number | undefined;
|
|
688
|
-
} & {
|
|
689
|
-
readonly state?: string | null | undefined;
|
|
690
|
-
} & {
|
|
691
|
-
readonly id: number;
|
|
692
|
-
}, {}, {}>;
|
|
391
|
+
declare const TodoSummary_base: Schema.Class<TodoSummary, Schema.Struct<{
|
|
392
|
+
readonly id: Schema.Finite;
|
|
393
|
+
readonly name: Schema.optional<Schema.String>;
|
|
394
|
+
readonly boardListId: Schema.optional<Schema.Finite>;
|
|
395
|
+
readonly boardId: Schema.optional<Schema.Finite>;
|
|
396
|
+
readonly ownerId: Schema.optional<Schema.Finite>;
|
|
397
|
+
readonly extId: Schema.optional<Schema.String>;
|
|
398
|
+
readonly state: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
399
|
+
readonly dueDate: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
400
|
+
readonly description: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
401
|
+
}>, {}>;
|
|
693
402
|
declare class TodoSummary extends TodoSummary_base {}
|
|
694
|
-
declare function todoSummaryFromRaw(raw: TodoSummaryRaw):
|
|
403
|
+
declare function todoSummaryFromRaw(raw: TodoSummaryRaw): TodoSummary;
|
|
695
404
|
interface GetBoardTodosParams {
|
|
696
405
|
readonly boardId: number;
|
|
697
406
|
readonly boardListId?: number;
|
|
@@ -729,18 +438,18 @@ interface PostMessageParams {
|
|
|
729
438
|
//#endregion
|
|
730
439
|
//#region src/services/BoardService.d.ts
|
|
731
440
|
interface BoardServiceShape {
|
|
732
|
-
readonly getProjects: (params?: GetProjectsParams) => Effect.Effect<ReadonlyArray<
|
|
733
|
-
readonly getProjectDetails: (params: GetProjectDetailsParams) => Effect.Effect<
|
|
734
|
-
readonly getMessages: (params: GetMessagesParams) => Effect.Effect<ReadonlyArray<
|
|
735
|
-
readonly getTasks: (params: GetTasksParams) => Effect.Effect<ReadonlyArray<
|
|
736
|
-
readonly getTasksForUser: (params: GetTasksForUserParams) => Effect.Effect<ReadonlyArray<
|
|
441
|
+
readonly getProjects: (params?: GetProjectsParams) => Effect.Effect<ReadonlyArray<Project>, TloError>;
|
|
442
|
+
readonly getProjectDetails: (params: GetProjectDetailsParams) => Effect.Effect<Project, TloError>;
|
|
443
|
+
readonly getMessages: (params: GetMessagesParams) => Effect.Effect<ReadonlyArray<Message>, TloError>;
|
|
444
|
+
readonly getTasks: (params: GetTasksParams) => Effect.Effect<ReadonlyArray<Task>, TloError>;
|
|
445
|
+
readonly getTasksForUser: (params: GetTasksForUserParams) => Effect.Effect<ReadonlyArray<TaskForUser>, TloError>;
|
|
737
446
|
readonly getTodoDetail: (params: GetTodoDetailParams) => Effect.Effect<TodoDetail, TloError>;
|
|
738
|
-
readonly getBoardTodos: (params: GetBoardTodosParams) => Effect.Effect<ReadonlyArray<
|
|
447
|
+
readonly getBoardTodos: (params: GetBoardTodosParams) => Effect.Effect<ReadonlyArray<TodoSummary>, TloError>;
|
|
739
448
|
readonly moveTodo: (params: MoveTodoParams) => Effect.Effect<void, TloError>;
|
|
740
449
|
readonly postMessage: (params: PostMessageParams) => Effect.Effect<void, TloError>;
|
|
741
450
|
readonly setTaskState: (params: SetTaskStateParams) => Effect.Effect<void, TloError>;
|
|
742
451
|
}
|
|
743
|
-
declare const BoardService_base: Context.
|
|
452
|
+
declare const BoardService_base: Context.ServiceClass<BoardService, "@2digits/tlo-mcp/services/BoardService", BoardServiceShape>;
|
|
744
453
|
declare class BoardService extends BoardService_base {}
|
|
745
454
|
declare const BoardServiceLive: Layer.Layer<BoardService, never, TeamLeaderClient>;
|
|
746
455
|
//#endregion
|
|
@@ -748,9 +457,9 @@ declare const BoardServiceLive: Layer.Layer<BoardService, never, TeamLeaderClien
|
|
|
748
457
|
declare const TloConfigFromEnv: Effect.Effect<{
|
|
749
458
|
baseUrl: string;
|
|
750
459
|
sessionToken: import("effect/Redacted").Redacted<string>;
|
|
751
|
-
cookies:
|
|
752
|
-
},
|
|
753
|
-
declare const TloConfigLive: Layer.Layer<TloConfig,
|
|
460
|
+
cookies: Cookies.Cookies;
|
|
461
|
+
}, Config.ConfigError | Cookies.CookiesError, never>;
|
|
462
|
+
declare const TloConfigLive: Layer.Layer<TloConfig, Config.ConfigError | Cookies.CookiesError, never>;
|
|
754
463
|
//#endregion
|
|
755
464
|
//#region src/layers/TloLive.d.ts
|
|
756
465
|
declare const TloServicesLive: Layer.Layer<BoardService | TimeService, never, TeamLeaderClient>;
|
|
@@ -761,7 +470,7 @@ declare const TloLive: Layer.Layer<BoardService | TimeService, never, TloConfig>
|
|
|
761
470
|
/**
|
|
762
471
|
* TeamLeader Orbit uses YYYYMMDDHHMMSS format for dates. Example: "20251117143000" = Nov 17, 2025 14:30:00.
|
|
763
472
|
*/
|
|
764
|
-
declare const TloDateString: Schema.brand<Schema.
|
|
473
|
+
declare const TloDateString: Schema.brand<Schema.String, "TloDateString">;
|
|
765
474
|
type TloDateString = typeof TloDateString.Type;
|
|
766
475
|
/**
|
|
767
476
|
* Format Date to YYYYMMDDHHMMSS string.
|
|
@@ -772,25 +481,25 @@ declare function formatTloDate(date: Date): TloDateString;
|
|
|
772
481
|
/**
|
|
773
482
|
* Transform between TLO date strings and JavaScript Date objects.
|
|
774
483
|
*/
|
|
775
|
-
declare const TloDate: Schema.
|
|
484
|
+
declare const TloDate: Schema.decodeTo<Schema.Date, Schema.brand<Schema.String, "TloDateString">, never, never>;
|
|
776
485
|
type TloDate = typeof TloDate.Type;
|
|
777
486
|
/**
|
|
778
487
|
* TLO entity IDs are numeric strings.
|
|
779
488
|
*/
|
|
780
489
|
type TloId = string & Brand.Brand<'TloId'>;
|
|
781
|
-
declare const TloId: Brand.
|
|
782
|
-
declare const TloIdSchema: Schema.
|
|
490
|
+
declare const TloId: Brand.Constructor<TloId>;
|
|
491
|
+
declare const TloIdSchema: Schema.brand<Schema.String, "TloId">;
|
|
783
492
|
/**
|
|
784
493
|
* Standard TLO API response envelope schema. Note: Most endpoints return data directly without this wrapper. Kept for
|
|
785
494
|
* potential use with endpoints that do use the envelope pattern.
|
|
786
495
|
*
|
|
787
496
|
* @param dataSchema - Data schema to wrap.
|
|
788
497
|
*/
|
|
789
|
-
declare function TloResponse
|
|
790
|
-
success:
|
|
791
|
-
ID: Schema.optional<
|
|
792
|
-
OBJ: Schema.Schema
|
|
793
|
-
err: Schema.optional<
|
|
498
|
+
declare function TloResponse<T>(dataSchema: Schema.Schema<T>): Schema.Struct<{
|
|
499
|
+
readonly success: Schema.Boolean;
|
|
500
|
+
readonly ID: Schema.optional<Schema.Finite>;
|
|
501
|
+
readonly OBJ: Schema.Schema<T>;
|
|
502
|
+
readonly err: Schema.optional<Schema.String>;
|
|
794
503
|
}>;
|
|
795
504
|
//#endregion
|
|
796
505
|
export { Activity, type ActivityRaw, BoardService, BoardServiceLive, type BoardServiceShape, type CreateActivityParams, type DeleteActivityParams, type GetBoardTodosParams, type GetMessagesParams, type GetProjectDetailsParams, type GetProjectsParams, type GetTasksForUserParams, type GetTodoDetailParams, type GetWeekResponse, Message, type MessageRaw, type MoveTodoParams, type PostMessageParams, Project, type ProjectRaw, type SetActivityResponse, type SetTaskStateParams, Task, TaskForUser, type TaskForUserRaw, type TaskRaw, type TaskState, TeamLeaderClient, TeamLeaderClientLive, type TeamLeaderClientShape, TimeService, TimeServiceLive, type TimeServiceShape, TloApiError, TloAuthError, TloClientLive, TloConfig, TloConfigFromEnv, TloConfigLive, type TloConfigShape, TloDate, TloDateString, type TloError, TloId, TloIdSchema, TloLive, TloNetworkError, TloParseError, TloResponse, TloServicesLive, TodoDetail, TodoSummary, type UpdateActivityParams, activityFromRaw, formatTloDate, messageFromRaw, projectFromRaw, todoSummaryFromRaw };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,D as t,E as n,O as r,S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,w,x as T,y as E}from"./TloLive-
|
|
1
|
+
import{C as e,D as t,E as n,O as r,S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,w,x as T,y as E}from"./TloLive-BTpDuZnK.mjs";import*as D from"effect/Schema";import*as O from"effect/Brand";import*as k from"effect/DateTime";import*as A from"effect/SchemaTransformation";const j=D.String.pipe(D.check(D.isPattern(/^\d{14}$/)),D.brand(`TloDateString`));function M(e){let t=Number.parseInt(e.slice(0,4),10),n=Number.parseInt(e.slice(4,6),10),r=Number.parseInt(e.slice(6,8),10),i=Number.parseInt(e.slice(8,10),10),a=Number.parseInt(e.slice(10,12),10),o=Number.parseInt(e.slice(12,14),10);return k.makeZonedUnsafe({year:t<=99?t+1900:t,month:n,day:r,hour:i,minute:a,second:o},{timeZone:k.zoneMakeLocal(),adjustForTimeZone:!0}).pipe(k.toDateUtc)}function N(e){let t=e.getFullYear().toString().padStart(4,`0`),n=(e.getMonth()+1).toString().padStart(2,`0`),r=e.getDate().toString().padStart(2,`0`),i=e.getHours().toString().padStart(2,`0`),a=e.getMinutes().toString().padStart(2,`0`),o=e.getSeconds().toString().padStart(2,`0`);return j.make(`${t}${n}${r}${i}${a}${o}`)}const P=j.pipe(D.decodeTo(D.Date,A.transform({decode:M,encode:N}))),F=O.nominal(),I=D.String.pipe(D.fromBrand(`TloId`,F));function L(e){return D.Struct({success:D.Boolean,ID:D.optional(D.Finite),OBJ:e,err:D.optional(D.String)})}export{E as Activity,_ as BoardService,b as BoardServiceLive,c as Message,m as Project,S as Task,l as TaskForUser,T as TeamLeaderClient,i as TeamLeaderClientLive,a as TimeService,C as TimeServiceLive,e as TloApiError,w as TloAuthError,x as TloClientLive,r as TloConfig,p as TloConfigFromEnv,o as TloConfigLive,P as TloDate,j as TloDateString,F as TloId,I as TloIdSchema,g as TloLive,n as TloNetworkError,t as TloParseError,L as TloResponse,y as TloServicesLive,u as TodoDetail,v as TodoSummary,s as activityFromRaw,N as formatTloDate,h as messageFromRaw,f as projectFromRaw,d as todoSummaryFromRaw};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2digits/tlo-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/2digits-agency/configs.git",
|
|
@@ -24,22 +24,15 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@effect/
|
|
28
|
-
"
|
|
29
|
-
"@effect/experimental": "0.61.1",
|
|
30
|
-
"@effect/platform": "0.97.1",
|
|
31
|
-
"@effect/platform-node": "0.108.1",
|
|
32
|
-
"@effect/rpc": "0.76.2",
|
|
33
|
-
"effect": "3.22.1"
|
|
27
|
+
"@effect/platform-node": "4.0.0-rc.109",
|
|
28
|
+
"effect": "4.0.0-rc.109"
|
|
34
29
|
},
|
|
35
30
|
"devDependencies": {
|
|
36
31
|
"@arethetypeswrong/core": "0.18.5",
|
|
37
|
-
"@effect/
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"typescript": "6.0.3",
|
|
42
|
-
"vite-plus": "0.2.7",
|
|
32
|
+
"@effect/vitest": "4.0.0-rc.109",
|
|
33
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
34
|
+
"publint": "0.3.23",
|
|
35
|
+
"vite-plus": "0.2.9",
|
|
43
36
|
"vitest": "4.1.10",
|
|
44
37
|
"@2digits/tsconfig": "0.8.7"
|
|
45
38
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"effect/Context";import*as t from"@effect/platform/HttpBody";import*as n from"@effect/platform/UrlParams";import*as r from"effect/Effect";import*as i from"effect/Layer";import*as a from"effect/Option";import*as o from"effect/Redacted";import*as s from"effect/Schema";import*as c from"@effect/platform/HttpClient";import*as l from"@effect/platform/HttpClientRequest";import*as u from"effect/Config";import*as d from"@effect/platform/FetchHttpClient";var f=class extends e.Tag(`@2digits/tlo-mcp/services/TloConfig`)(){},p=class extends s.TaggedError()(`TloApiError`,{message:s.String,code:s.optional(s.String),endpoint:s.optional(s.String)}){},m=class extends s.TaggedError()(`TloAuthError`,{message:s.String}){},h=class extends s.TaggedError()(`TloNetworkError`,{message:s.String,cause:s.optional(s.Unknown),endpoint:s.optional(s.String)}){},g=class extends s.TaggedError()(`TloParseError`,{message:s.String,cause:s.optional(s.Unknown)}){};const ee=s.Union(p,m,h,g);var _=class extends e.Tag(`@2digits/tlo-mcp/services/TloHttpClient`)(){};function v(e){return e.entries().map(([e,t])=>`${e}=${t}`).toArray().join(`; `)}const te=i.effect(_,r.gen(function*(){let e=yield*f,t=(yield*c.HttpClient).pipe(c.mapRequest(l.prependUrl(e.baseUrl)),c.mapRequest(t=>t.pipe(l.setHeader(`Cookie`,v(e.cookies)))),c.filterStatusOk);return _.of({client:t})}));var y=class extends e.Tag(`@2digits/tlo-mcp/services/TeamLeaderClient`)(){};function b(e){return t=>new h({message:t._tag===`ResponseError`?`HTTP ${t.response.status}`:`Request failed: ${t.reason}`,cause:t,endpoint:e})}function ne(e){return new g({message:`Failed to parse response`,cause:e})}function x(e){return typeof e==`object`&&!!e&&`err`in e&&typeof e.err==`number`&&e.err!==0}const re=/\{MSG:'([^']*)',\s*err:(\d+)\}/;function S(e){let t=re.exec(e);return t?a.some({MSG:t[1]??`Unknown error`,err:Number(t[2])}):a.none()}const C=i.effect(y,r.gen(function*(){let e=yield*f,{client:i}=yield*_;return y.of({post:r.fn(`TeamLeaderClient.post`)(function*(c,l,u){let d={...l,t:o.value(e.sessionToken)},f=n.fromInput(d);return yield*i.post(c,{body:t.urlParams(f)}).pipe(r.flatMap(e=>e.text),r.flatMap(e=>{let t=S(e);if(a.isSome(t)&&t.value.err!==0)return r.fail(new p({message:t.value.MSG,endpoint:c}));let n;try{n=JSON.parse(e)}catch{return r.fail(new g({message:`Invalid JSON response`,cause:e}))}return x(n)?r.fail(new p({message:n.MSG,endpoint:c})):s.decodeUnknown(u)(n).pipe(r.mapError(ne))}),r.scoped,r.mapError(e=>e instanceof p||e instanceof g?e:b(c)(e)))})})})),w=s.Struct({ID:s.Number,FOLDERID:s.optional(s.Union(s.String,s.Number)),PROJECT_ID:s.optional(s.Union(s.String,s.Number)),TASKID:s.optional(s.NullOr(s.Union(s.String,s.Number))),TODOID:s.optional(s.NullOr(s.Union(s.String,s.Number))),TICKETID:s.optional(s.NullOr(s.Union(s.String,s.Number))),CONTACTID:s.optional(s.Union(s.String,s.Number)),DESCRIPTION:s.NullOr(s.String),DT:s.String,START_DT:s.optional(s.String),END_DT:s.optional(s.String),DURATION:s.Number,TYPE:s.optional(s.Number),PROJECT_NAME:s.optional(s.NullOr(s.String)),TASK_NAME:s.optional(s.NullOr(s.String)),CLIENT_NAME:s.optional(s.NullOr(s.String)),FOLDER_NAME:s.optional(s.NullOr(s.String)),ENTITY_NAME:s.optional(s.NullOr(s.String)),PROJECTOWNER_NAME:s.optional(s.NullOr(s.String)),CLIENT_COLOR:s.optional(s.NullOr(s.String)),PROJECT_COLOR:s.optional(s.NullOr(s.String)),PROJECT_STATE:s.optional(s.NullOr(s.String)),TASK_STATE:s.optional(s.NullOr(s.String)),TIMESHEET_STATE:s.optional(s.NullOr(s.String)),BILLING_MODE:s.optional(s.NullOr(s.String)),NON_BILLABLE:s.optional(s.NullOr(s.Number)),RATE:s.optional(s.NullOr(s.Number)),VALUE:s.optional(s.NullOr(s.Number)),PROJECT_START_DT:s.optional(s.NullOr(s.String)),PROJECT_END_DT:s.optional(s.NullOr(s.String)),TASK_START_DT:s.optional(s.NullOr(s.String)),TASK_END_DT:s.optional(s.NullOr(s.String)),READONLY:s.optional(s.NullOr(s.Number)),TASK_WORKLOAD:s.optional(s.NullOr(s.Number))});var T=class extends s.Class(`Activity`)({id:s.Number,projectId:s.optional(s.String),folderId:s.optional(s.String),taskId:s.optional(s.NullOr(s.String)),todoId:s.optional(s.NullOr(s.String)),ticketId:s.optional(s.NullOr(s.String)),userId:s.optional(s.String),description:s.NullOr(s.String),startDate:s.String,endDate:s.optional(s.String),durationMinutes:s.Number,projectName:s.optional(s.NullOr(s.String)),taskName:s.optional(s.NullOr(s.String)),clientName:s.optional(s.NullOr(s.String)),folderName:s.optional(s.NullOr(s.String)),entityName:s.optional(s.NullOr(s.String)),projectOwnerName:s.optional(s.NullOr(s.String)),projectState:s.optional(s.NullOr(s.String)),taskState:s.optional(s.NullOr(s.String)),timesheetState:s.optional(s.NullOr(s.String)),billingMode:s.optional(s.NullOr(s.String)),nonBillable:s.optional(s.NullOr(s.Number)),rate:s.optional(s.NullOr(s.Number)),value:s.optional(s.NullOr(s.Number)),projectStartDate:s.optional(s.NullOr(s.String)),projectEndDate:s.optional(s.NullOr(s.String)),taskStartDate:s.optional(s.NullOr(s.String)),taskEndDate:s.optional(s.NullOr(s.String)),readOnly:s.optional(s.NullOr(s.Boolean)),taskWorkload:s.optional(s.NullOr(s.Number)),projectColor:s.optional(s.String),clientColor:s.optional(s.String)}){};function E(e){return new T({id:e.ID,projectId:e.PROJECT_ID===void 0?e.FOLDERID===void 0?void 0:String(e.FOLDERID):String(e.PROJECT_ID),folderId:e.FOLDERID===void 0?void 0:String(e.FOLDERID),taskId:e.TASKID!==void 0&&e.TASKID!==null?String(e.TASKID):null,todoId:e.TODOID!==void 0&&e.TODOID!==null?String(e.TODOID):null,ticketId:e.TICKETID!==void 0&&e.TICKETID!==null?String(e.TICKETID):null,userId:e.CONTACTID===void 0?void 0:String(e.CONTACTID),description:e.DESCRIPTION,startDate:e.DT,endDate:e.END_DT,durationMinutes:e.DURATION,projectName:e.PROJECT_NAME,taskName:e.TASK_NAME,clientName:e.CLIENT_NAME,folderName:e.FOLDER_NAME,entityName:e.ENTITY_NAME,projectOwnerName:e.PROJECTOWNER_NAME,projectState:e.PROJECT_STATE,taskState:e.TASK_STATE,timesheetState:e.TIMESHEET_STATE,billingMode:e.BILLING_MODE,nonBillable:e.NON_BILLABLE,rate:e.RATE,value:e.VALUE,projectStartDate:e.PROJECT_START_DT,projectEndDate:e.PROJECT_END_DT,taskStartDate:e.TASK_START_DT,taskEndDate:e.TASK_END_DT,readOnly:e.READONLY===void 0||e.READONLY===null?void 0:e.READONLY!==0,taskWorkload:e.TASK_WORKLOAD,projectColor:e.PROJECT_COLOR??void 0,clientColor:e.CLIENT_COLOR??void 0})}const D=s.Struct({ACTIVITIES:s.Array(w)}),O=s.Struct({ID:s.Number,DURATION:s.optional(s.Number),DT:s.optional(s.String),TYPE:s.optional(s.Number),DESCRIPTION:s.optional(s.NullOr(s.String)),CLIENT_COLOR:s.optional(s.String),FOLDERID:s.optional(s.Union(s.String,s.Number))});function k(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}T${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}`}var A=class extends e.Tag(`@2digits/tlo-mcp/services/TimeService`)(){};const j=i.effect(A,r.gen(function*(){let e=yield*y;return A.of({getWeek:r.fn(`TimeService.getWeek`)(function*(t,n,i=`Europe/Amsterdam`){return yield*e.post(`/ajax/pln/GetWeek`,{DT:k(t),CONTACTID:n,tmz:i},D).pipe(r.map(e=>e.ACTIVITIES.map(e=>E(e))))}),createActivity:r.fn(`TimeService.createActivity`)(function*(t){return yield*e.post(`/ajax/pln/SetActivity`,{ID:0,ACTION:`CREATE`,DT:k(t.startDate),DURATION:t.durationMinutes,FOLDERID:t.folderId,TASKID:t.taskId,TODOID:t.todoId,CONTACTID:t.contactId,CLIENT_COLOR:t.clientColor,DESCRIPTION:t.description},O).pipe(r.map(e=>e.ID))}),updateActivity:r.fn(`TimeService.updateActivity`)(function*(t){return yield*e.post(`/ajax/pln/SetActivity`,{ID:t.id,ACTION:`MOVE`,DT:t.startDate?k(t.startDate):void 0,DURATION:t.durationMinutes,DESCRIPTION:t.description},O).pipe(r.asVoid)}),deleteActivity:r.fn(`TimeService.deleteActivity`)(function*(t){return yield*e.post(`/ajax/pln/SetActivity`,{ID:t.id,ACTION:`DELETE`},O).pipe(r.asVoid)})})})),M=s.Struct({ID:s.Number,PROJECT_NAME:s.optional(s.String),NAME:s.optional(s.String),STATE:s.optional(s.String),OWNER_NAME:s.optional(s.String),START_DT:s.optional(s.String),END_DT:s.optional(s.String),BILLING_BUDGET:s.optional(s.Number),BILLING_MODE:s.optional(s.String),BILLING_REMAINING:s.optional(s.Number),CLIENT_NAME:s.optional(s.String),CLIENT_ID:s.optional(s.Number),FOLDERID:s.optional(s.Number),FOLDER_NAME:s.optional(s.String),EXTID:s.optional(s.String),CALC_TOTAL:s.optional(s.Number),CALC_DONE:s.optional(s.Number),CALC_PLANNED:s.optional(s.Number)}),ie=s.Struct({Records:s.Array(M),RecordCount:s.optional(s.Number)}),ae=s.Union(M,s.Struct({Record:M}));var N=class extends s.Class(`Project`)({id:s.Number,name:s.String,state:s.optional(s.String),ownerName:s.optional(s.String),startDate:s.optional(s.String),endDate:s.optional(s.String),billingBudget:s.optional(s.Number),billingMode:s.optional(s.String),billingRemaining:s.optional(s.Number),clientName:s.optional(s.String),clientId:s.optional(s.Number),folderId:s.optional(s.Number),folderName:s.optional(s.String),extId:s.optional(s.String),calcTotal:s.optional(s.Number),calcDone:s.optional(s.Number),calcPlanned:s.optional(s.Number)}){};function P(e){return N.make({id:e.ID,name:e.PROJECT_NAME??e.NAME??``,state:e.STATE,ownerName:e.OWNER_NAME,startDate:e.START_DT,endDate:e.END_DT,billingBudget:e.BILLING_BUDGET,billingMode:e.BILLING_MODE,billingRemaining:e.BILLING_REMAINING,clientName:e.CLIENT_NAME,clientId:e.CLIENT_ID,folderId:e.FOLDERID,folderName:e.FOLDER_NAME,extId:e.EXTID,calcTotal:e.CALC_TOTAL,calcDone:e.CALC_DONE,calcPlanned:e.CALC_PLANNED})}const oe=s.Struct({ID:s.Number,OWNERID:s.optional(s.Number),OWNER_NAME:s.optional(s.String),AVATAR:s.optional(s.String),CREATED_DT:s.optional(s.String),CONTENT:s.optional(s.String),SUBCONTENT:s.optional(s.String),OBJECTTYPE:s.optional(s.String),OBJECTID:s.optional(s.Number),OBJECTNAME:s.optional(s.String),MSGTYPE:s.optional(s.String),LIKECNT:s.optional(s.Number),REPLYCNT:s.optional(s.Number),OUTQUEUEID:s.optional(s.String),INTERNAL:s.optional(s.Number)}),F=s.Array(oe);var I=class extends s.Class(`Message`)({id:s.Number,ownerId:s.optional(s.Number),ownerName:s.optional(s.String),avatar:s.optional(s.String),createdAt:s.optional(s.String),content:s.optional(s.String),subcontent:s.optional(s.String),objectType:s.optional(s.String),objectId:s.optional(s.Number),objectName:s.optional(s.String),messageType:s.optional(s.String),likeCount:s.optional(s.Number),replyCount:s.optional(s.Number),outQueueId:s.optional(s.String),internal:s.optional(s.Boolean)}){};function L(e){return new I({id:e.ID,ownerId:e.OWNERID,ownerName:e.OWNER_NAME,avatar:e.AVATAR,createdAt:e.CREATED_DT,content:e.CONTENT,subcontent:e.SUBCONTENT,objectType:e.OBJECTTYPE,objectId:e.OBJECTID,objectName:e.OBJECTNAME,messageType:e.MSGTYPE,likeCount:e.LIKECNT,replyCount:e.REPLYCNT,outQueueId:e.OUTQUEUEID,internal:e.INTERNAL===void 0?void 0:e.INTERNAL!==0})}const R=s.Struct({ID:s.Number,PROJECTID:s.optional(s.Number),NAME:s.optional(s.String),STATE:s.optional(s.String),OWNER_NAME:s.optional(s.String),START_DT:s.optional(s.String),END_DT:s.optional(s.String),BUDGET:s.optional(s.Number)}),z=s.Struct({Records:s.Array(R),RecordCount:s.optional(s.Number)});var B=class extends s.Class(`Task`)({id:s.Number,projectId:s.optional(s.Number),name:s.optional(s.String),state:s.optional(s.String),ownerName:s.optional(s.String),startDate:s.optional(s.String),endDate:s.optional(s.String),budget:s.optional(s.Number)}){};function V(e){return new B({id:e.ID,projectId:e.PROJECTID,name:e.NAME,state:e.STATE,ownerName:e.OWNER_NAME,startDate:e.START_DT,endDate:e.END_DT,budget:e.BUDGET})}const H=s.Struct({ID:s.Number,WORKLOAD:s.optional(s.Number),TOTAL:s.optional(s.Number),REMAINING:s.optional(s.Number),AVAIL:s.optional(s.Number),CLIENTID:s.optional(s.Number),PROJECTID:s.optional(s.Number),PROJECT_START_DT:s.optional(s.String),PROJECT_END_DT:s.optional(s.String),START_DT:s.optional(s.String),END_DT:s.optional(s.String),STATE:s.optional(s.String)}),U=s.Struct({Records:s.Array(H)});var W=class extends s.Class(`TaskForUser`)({id:s.Number,workload:s.optional(s.Number),total:s.optional(s.Number),remaining:s.optional(s.Number),avail:s.optional(s.Number),clientId:s.optional(s.Number),projectId:s.optional(s.Number),projectStartDate:s.optional(s.String),projectEndDate:s.optional(s.String),startDate:s.optional(s.String),endDate:s.optional(s.String),state:s.optional(s.String)}){};function G(e){return new W({id:e.ID,workload:e.WORKLOAD,total:e.TOTAL,remaining:e.REMAINING,avail:e.AVAIL,clientId:e.CLIENTID,projectId:e.PROJECTID,projectStartDate:e.PROJECT_START_DT,projectEndDate:e.PROJECT_END_DT,startDate:e.START_DT,endDate:e.END_DT,state:e.STATE})}const K=s.Record({key:s.String,value:s.Unknown}),se=s.Struct({ID:s.Number,NAME:s.optional(s.String),BOARDLISTID:s.optional(s.Number),BOARDID:s.optional(s.Number),OWNERID:s.optional(s.Number),EXTID:s.optional(s.String),STATE:s.optional(s.NullOr(s.String)),DUE_DT:s.optional(s.NullOr(s.String)),DESCRIPTION:s.optional(s.NullOr(s.String))}),ce=s.Struct({Records:s.Array(se),RecordCount:s.optional(s.Number)});var q=class extends s.Class(`TodoSummary`)({id:s.Number,name:s.optional(s.String),boardListId:s.optional(s.Number),boardId:s.optional(s.Number),ownerId:s.optional(s.Number),extId:s.optional(s.String),state:s.optional(s.NullOr(s.String)),dueDate:s.optional(s.NullOr(s.String)),description:s.optional(s.NullOr(s.String))}){};function J(e){return new q({id:e.ID,name:e.NAME,boardListId:e.BOARDLISTID,boardId:e.BOARDID,ownerId:e.OWNERID,extId:e.EXTID,state:e.STATE,dueDate:e.DUE_DT,description:e.DESCRIPTION})}var Y=class extends e.Tag(`@2digits/tlo-mcp/services/BoardService`)(){};function le(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function ue(e){return e.Records}const X=i.effect(Y,r.gen(function*(){let e=yield*y;return Y.of({getProjects:r.fn(`BoardService.getProjects`)(function*(t={}){let n=t.states??[`DRAFT`,`OPEN`,`CLOSED`];return yield*e.post(`/ajax/pln/GetProjects`,{STATE:n.join(`|`),COLUMNS:`ID|PROJECT_NAME|NAME|STATE|OWNER_NAME|START_DT|END_DT|BILLING_BUDGET|BILLING_MODE|BILLING_REMAINING|CLIENT_NAME|CLIENT_ID|FOLDERID|FOLDER_NAME|EXTID|CALC_TOTAL|CALC_DONE|CALC_PLANNED`,limit:t.limit??100,page:t.page??1},ie).pipe(r.map(e=>e.Records.map(e=>P(e))))}),getProjectDetails:r.fn(`BoardService.getProjectDetails`)(function*(t){return yield*e.post(`/ajax/pln/GetProjectDetails`,{ID:t.projectId},ae).pipe(r.map(e=>`Record`in e?e.Record:e),r.map(e=>P(e)))}),getMessages:r.fn(`BoardService.getMessages`)(function*(t){return yield*e.post(`/ajax/board/ProcessMessage`,{OBJECTTYPE:t.objectType,OBJECTID:t.objectId,ONLYCOMMENTS:t.onlyComments===!1?0:1,HIDEINTERNAL:t.hideInternal===!1?0:1,PAGETYPE:`SEQID`,MINID:0,limit:t.limit??100},F).pipe(r.map(e=>e.map(e=>L(e))))}),getTasks:r.fn(`BoardService.getTasks`)(function*(t){let n=t.states??[`DRAFT`,`OPEN`,`CLOSED`];return yield*e.post(`/ajax/pln/GetTasks`,{PROJECTID:t.projectId,STATE:n.join(`|`),COLUMNS:`ID|PROJECTID|NAME|STATE|OWNER_NAME|START_DT|END_DT|BUDGET`,limit:t.limit??100,page:t.page??1},z).pipe(r.map(e=>e.Records.map(e=>V(e))))}),getTasksForUser:r.fn(`BoardService.getTasksForUser`)(function*(t){return yield*e.post(`/ajax/pln/GetTasksForUser`,{CONTACTID:t.contactId,START_DT:le(t.startDate),PERIOD:t.period},U).pipe(r.map(e=>ue(e)),r.map(e=>e.map(e=>G(e))))}),getTodoDetail:r.fn(`BoardService.getTodoDetail`)(function*(t){return yield*e.post(`/ajax/board/GetTodoDetail`,{ID:t.id},K)}),getBoardTodos:r.fn(`BoardService.getBoardTodos`)(function*(t){return yield*e.post(`/ajax/board/GetTodos`,{BOARDID:t.boardId,BOARDLISTID:t.boardListId,limit:t.limit??100},ce).pipe(r.map(e=>e.Records.map(e=>J(e))),r.map(e=>{if(t.query){let n=t.query.toLowerCase();return e.filter(e=>e.name?.toLowerCase().includes(n))}return e}))}),moveTodo:r.fn(`BoardService.moveTodo`)(function*(t){return yield*e.post(`/ajax/board/MoveTodo`,{ID:t.id,BOARDID:t.boardId,BOARDLISTID:t.boardListId,SORTINDEX:t.sortIndex},s.Unknown).pipe(r.asVoid)}),postMessage:r.fn(`BoardService.postMessage`)(function*(t){return yield*e.post(`/ajax/board/ProcessMessage`,{ACTION:`ADD`,OBJECTTYPE:t.objectType,OBJECTID:t.objectId,CONTENT:t.content},s.Unknown).pipe(r.asVoid)}),setTaskState:r.fn(`BoardService.setTaskState`)(function*(t){return yield*e.post(`/ajax/pln/SetTaskState`,{PROJECTID:t.projectId,ID:t.taskId,STATE:t.state},s.Unknown).pipe(r.asVoid)})})}));function de(e){if(a.isNone(e))return new Map;let t=e.value.split(`;`).map(e=>e.trim().split(`=`)).filter(e=>e.length===2);return new Map(t)}const Z=r.gen(function*(){let e=yield*u.redacted(`TLO_SESSION_TOKEN`);return{baseUrl:yield*u.string(`TLO_BASE_URL`).pipe(u.withDefault(`https://socialbrothers.orbit.teamleader.eu`)),sessionToken:e,cookies:de(yield*u.option(u.string(`TLO_COOKIES`)))}}),fe=i.effect(f,Z),Q=i.mergeAll(j,X),$=C.pipe(i.provide(te.pipe(i.provide(d.layer)))),pe=Q.pipe(i.provide($));export{p as C,g as D,h as E,f as O,C as S,ee as T,A as _,fe as a,E as b,I as c,W as d,K as f,J as g,P as h,Z as i,N as l,L as m,pe as n,Y as o,q as p,Q as r,X as s,$ as t,B as u,j as v,m as w,y as x,T as y};
|