@entrydesk/cli 2.2.0-beta.2 → 2.2.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -3
- package/dist/{add-BYupRwo_.js → add-QRCNes33.js} +1 -1
- package/dist/{agents-CeXkI4US.js → agents-C6_4nYx3.js} +1 -1
- package/dist/{billing-BeaQvLSK.js → billing-B52QpxBo.js} +1 -1
- package/dist/{budget-B4SKcu-1.js → budget-CCZUSzQX.js} +1 -1
- package/dist/build-task-request-config-D1BoTQ_r.js +10 -0
- package/dist/{commands-Bisc9IY0.js → commands-DT40svYr.js} +1 -1
- package/dist/{commands-Drf0_Uu8.js → commands-OQF1wQ6Z.js} +1 -1
- package/dist/{config-ROg2C1qz.js → config-DRasb4uc.js} +2 -2
- package/dist/connectors-CGdm_hGV.js +11 -0
- package/dist/{file-upload-ClVCUJp1.js → file-upload-DuXlHqyj.js} +1 -1
- package/dist/{format-B6a10P86.js → format-C0MI0rzh.js} +1 -1
- package/dist/index.js +43 -23
- package/dist/{instruction-D0Sy5WJu.js → instruction-OdStaJMu.js} +1 -1
- package/dist/{login-7nuzjqqL.js → login-BJK-C-yF.js} +1 -1
- package/dist/{logout-O7uVmxmK.js → logout-b335WkA6.js} +1 -1
- package/dist/{marketplace-8V1DNOld.js → marketplace-B5HXnl23.js} +2 -2
- package/dist/{mcp-client-DpDabxv9.js → mcp-client-mMhJPPZN.js} +1 -1
- package/dist/{mcp-DwMCTWU-.js → mcp-hLbWIery.js} +1 -1
- package/dist/{meeting-DCMyPA59.js → meeting-2Z2c7Ppj.js} +1 -1
- package/dist/{message-utils-C6JS91tT.js → message-utils-BHtHL44l.js} +7 -7
- package/dist/{models-BdxCIBZD.js → models-Cd725_l2.js} +1 -1
- package/dist/{notifications-BZxmGqEM.js → notifications-D1-iA_h8.js} +1 -1
- package/dist/{paginate-B-nHzQ0j.js → paginate-y3CJuqRW.js} +1 -1
- package/dist/{paths-ZPsPG0IC.js → paths-CIj_zxDF.js} +1 -1
- package/dist/profile-B1Jui2gr.js +10 -0
- package/dist/profile-storage-BPBUFvA6.js +74 -0
- package/dist/{project-Ba5LBPMF.js → project-DwR8Pf3y.js} +1 -1
- package/dist/project-context-CiI3hHaT.js +10 -0
- package/dist/{project-governance-B66BEQxO.js → project-governance-OVpv9LXv.js} +1 -1
- package/dist/{project-sources-D4m1oEvu.js → project-sources-CtSvnInR.js} +1 -1
- package/dist/{project-sources-write-CCICd6f8.js → project-sources-write-BaWV2jtH.js} +1 -1
- package/dist/{project-tasks-ylwpld2n.js → project-tasks-BKdZe3qu.js} +1 -1
- package/dist/{push-CNZNGP6D.js → push-CMRb7H6f.js} +1 -1
- package/dist/{recordings-DpDUq0iw.js → recordings-Bz6wVqBM.js} +1 -1
- package/dist/{remove-CbGljmXk.js → remove-B7p4PV6f.js} +1 -1
- package/dist/resolve-DdZsf3QT.js +14 -0
- package/dist/resource-grants-HDU2bPhQ.js +10 -0
- package/dist/{schedules-CTFIi2SL.js → schedules-DrzGEvSR.js} +2 -2
- package/dist/{skills-DbFd9oBS.js → skills-CdcBhRxn.js} +1 -1
- package/dist/{status-Br8KI96N.js → status-p4tJRN-I.js} +1 -1
- package/dist/status-wTfceoHq.js +10 -0
- package/dist/task-CyuwUFin.js +116 -0
- package/dist/tasks-B0x5P4UU.js +22 -0
- package/dist/{tasks-CNUJbs7w.js → tasks-BpqBNtta.js} +1 -1
- package/dist/{team-BfBb-uk2.js → team-R67MPRfp.js} +1 -1
- package/dist/{teams-47YS8wYw.js → teams-DvACXgpt.js} +1 -1
- package/dist/{token-CvjOXFDB.js → token-Diy_e8pF.js} +1 -1
- package/dist/{tool-D_n28XK0.js → tool-CFaX5Q8e.js} +7 -7
- package/dist/{update-B8gxXkSO.js → update-CvHLQuTu.js} +1 -1
- package/dist/{usage-BPyHU-GL.js → usage-Bv04bmPn.js} +1 -1
- package/dist/{usage-audit-STxCfVta.js → usage-audit-D65sU87J.js} +3 -3
- package/dist/{version-Ca4arzgb.js → version-BFfQldMJ.js} +1 -1
- package/dist/{webhook-B0E0M2EK.js → webhook-h1JuRyJf.js} +1 -1
- package/dist/{workflow-B-iN8d5R.js → workflow-CrOwbORs.js} +1 -1
- package/dist/{workspaces-DmqtYNX1.js → workspaces-CJP3Q8wV.js} +1 -1
- package/package.json +4 -4
- package/dist/build-task-request-config-eOeyGAfk.js +0 -10
- package/dist/connectors-jktsuWlk.js +0 -11
- package/dist/profile-D4jP-vQE.js +0 -10
- package/dist/profile-storage--QCh_u_Q.js +0 -73
- package/dist/project-context-8lb14kaU.js +0 -10
- package/dist/resolve-Di6ohyyF.js +0 -14
- package/dist/resource-grants-DojPWFs8.js +0 -10
- package/dist/status-DLI2OgMv.js +0 -10
- package/dist/task-CRwWxEOf.js +0 -116
- package/dist/tasks-VEfTbXVT.js +0 -22
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{O as e,_n as t}from"./profile-storage--QCh_u_Q.js";import{C as n,S as r,a as i,d as a,k as o,o as s,p as c,y as l}from"./resolve-Di6ohyyF.js";const u=t.options.join(`, `),d=`tasks:read`;function f(e,t){return c(t,t=>i(t,e))}function p(t){return t===`asset`||t===`assets`?new s(`asset_not_on_context_surface`,`Assets are not part of the CLI context surface — open them in the Hub. Pass one of: ${u}.`):new s(`invalid_context_source_type`,`"${e(t)}" is not a context source type. Pass one of: ${u}.`)}function m(e,t){return new s(`invalid_argument`,`${e} ${t}.`)}function h(e,t,n,r){if(!/^[+-]?\d+$/u.test(t.trim()))return m(e,`must be an integer`);let i=Number.parseInt(t,10);return i<n||i>r?m(e,`must be between ${n} and ${r}`):null}async function g(e,t,n,r,i){if(t===void 0)return;let o=h(e,t,n,r);return o&&await a(i,o),Number.parseInt(t,10)}async function _(e,t){let n=e.trim();return n.length===0&&await a(t,m(`<query>`,`must not be empty`)),n.length>200&&await a(t,m(`<query>`,`must be at most 200 characters`)),n}async function v(e,n){let r=t.safeParse(e);return r.success?r.data:a(n,p(e))}async function y(t,n,i){let a=await _(n,i),o=i.type?await v(i.type,i):void 0,s=await g(`--limit`,i.limit,1,20,i),u=await f(t,i);await c(i,async t=>{let{results:n}=await t.client.searchProjectContext(t.accessToken,t.workspaceId,u,{q:a,...o&&{type:o},...s!==void 0&&{limit:s}});if(i.json){r({results:n});return}if(n.length===0){console.log(`Nothing matched ${e(a)}.`);return}l(n)},d)}function b(e){if(e.nextOffset===void 0)return`Output was truncated at this source's text limit.`;let t=e.revision===void 0?``:` --revision ${e.revision}`;return`Output was truncated. Read on with --offset ${e.nextOffset}${t}.`}function x(e,t){if(t.json){r(e);return}process.stdout.write(o(e.content)),e.truncated&&console.error(b(e))}function S(t){let n=e(t.title);return t.status===`download`?`"${n}" holds no text to read. Download it instead — the link is short-lived and tied to you: ${e(t.downloadUrl)}`:t.status===`pending`?`"${n}" is still being fetched. Try again once its snapshot is ready.`:`"${n}" could not be fetched: ${e(t.error)}`}function C(e,t){t.json?n(e):console.error(`Error: ${S(e)}`),process.exit(1)}async function w(e,t,n,r){let i=await v(t,r),a=await g(`--offset`,r.offset,0,2**53-1,r),o=await f(e,r),s=await c(r,async e=>e.client.readProjectContext(e.accessToken,e.workspaceId,o,{sourceType:i,sourceId:n},{depth:i===`task`&&(r.full||a!==void 0)?`full`:`summary`,...a!==void 0&&{offset:a},...r.revision!==void 0&&{revision:r.revision}}),d);if(s.status===`text`){x(s,r);return}C(s,r)}export{w as readProjectContext,y as searchProjectContext};
|
package/dist/resolve-Di6ohyyF.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{C as e,D as t,O as n,bn as r,en as i,mn as a,o,p as s,s as ee,vn as c,w as l,y as u,yn as d}from"./profile-storage--QCh_u_Q.js";import"./options-Dpxg1wT1.js";import{t as f}from"./terminal-text-cBPBiP3x.js";import{a as p,r as m}from"./format-B6a10P86.js";import{HTTPError as h}from"ky";import{validate as g}from"uuid";function _(e){return n(e)}function v(e){return e.split(`
|
|
11
|
-
`).map(_)}function y(e,{numbered:t}){console.log(`Projects (${e.length}):\n`);for(let[n,r]of e.entries()){let e=t?`${String(n+1).padStart(2,` `)} `:``;console.log(` ${e}${_(r.name)}`),console.log(` ${r.role} · updated ${m(r.updatedAt)}`),console.log(` ID: ${r.id}`),console.log(``)}t||console.log("This listing is filtered or paged, so its positions are not the numbers `<project>` takes — pass an ID above.")}function b(e){return`${_(e.name)} <${_(e.email)}> · ${e.role}`}function x(e){return Array.isArray(e.teams)?e.teams:[]}function S(e){let t=[_(e.name),p(e.memberCount,`member`),e.visibility];return e.canExpand||t.push(`locked`),t.join(` · `)}function C(e,t){e.some(e=>!e.canExpand)&&console.log(`\n${t}A locked team is a hidden team you are not in: only its own members can see who belongs to it.`)}function w(e){console.log(`${_(e.name)}\n`),console.log(` ID: ${e.id}`),console.log(` Role: ${e.role}`),e.description&&console.log(` Description: ${_(e.description)}`),console.log(` Updated: ${m(e.updatedAt)}`),console.log(` Sources: ${e.sourceCount} · Tasks: ${e.taskCount} · Assets: ${e.assetCount}`),console.log(`\n Members (${e.members.length}):`);for(let t of e.members)console.log(` - ${b(t)}`);let t=x(e);console.log(`\n Teams (${t.length}):`);for(let e of t)console.log(` - ${S(e)}`);if(C(t,` `),console.log(`
|
|
12
|
-
Instruction:`),!e.instruction){console.log(` (none)`);return}for(let t of v(e.instruction))console.log(` ${t}`)}function te(e){console.log(`Members of ${_(e.name)} (${e.members.length}):\n`);for(let t of e.members)console.log(` - ${b(t)}`),console.log(` ID: ${t.userId}`);let t=x(e);console.log(`\nTeams (${t.length}):\n`);for(let e of t)console.log(` - ${S(e)}`),console.log(` ID: ${e.teamId}`);C(t,``)}function ne(e){console.log(`Deleting project: ${_(e.name)}`),console.log(` ID: ${e.id}\n`),console.log(`This will:`),console.log(` - Detach its ${p(e.taskCount,`task`)}; each returns to its owner's main list`),console.log(` - Delete its ${p(e.sourceCount,`source`)} — the files and links in it`),console.log(` - Delete its ${p(e.assetCount,`asset`)}, with every version in their history`),console.log(`
|
|
13
|
-
This can't be undone.`)}function re(e){return process.stdout.isTTY?v(e).join(`
|
|
14
|
-
`):e}function ie(e){console.log(f(e))}function T(e){process.stderr.write(`${f(e)}\n`)}function ae(e){return{type:`file`,id:e.id,title:c(e),description:e.description,status:`ready`,versionNumber:e.versionNumber}}function oe(e){return{type:`link`,id:e.id,title:r(e),description:e.description,status:e.status,url:e.url,fetchError:e.fetchError}}function E(e){return e.status===`failed`&&e.fetchError?`${e.status} — ${_(e.fetchError)}`:e.status}function D(e){console.log(`Sources (${e.length}):\n`);for(let t of e)console.log(` [${t.type}] ${_(t.title)}`),console.log(` ID: ${t.id}`),console.log(` Status: ${E(t)}`),t.versionNumber!==void 0&&console.log(` Version: ${t.versionNumber}`),t.url&&console.log(` URL: ${_(t.url)}`),console.log(` Description: ${t.description?_(t.description):`(none)`}`),console.log(``)}function O(e,t,n){console.log(`${e} ${t.type}: ${_(t.title)}`),console.log(` ID: ${t.id}`),console.log(` Status: ${E(t)}`),t.versionNumber!==void 0&&console.log(` Version: ${t.versionNumber}`),n&&console.log(n)}function k(e){for(let t of v(e))console.log(` ${t}`)}function A(e){console.log(`Results (${e.length}):\n`);for(let t of e)console.log(` [${t.type}] ${_(t.title)}`),t.type===`task`?(console.log(` ID: ${t.taskId}`),console.log(` Updated: ${m(t.updatedAt)}`)):(console.log(` ID: ${t.sourceId}`),t.description&&console.log(` Description: ${_(t.description)}`)),t.snippet&&k(t.snippet),console.log(``)}var j=class extends Error{code;conflict;constructor(e,t,n){super(t),this.code=e,this.conflict=n,this.name=`ProjectCommandError`}};const M=`Project not found`,N="Source not found. Check the type and id against `entrydesk project sources <project>`.",P=`Only a project owner can do this. Ask an owner, or have one make you an owner first.`,F=`That team is already in this project.`;function I(){return new j(`project_not_found`,M)}function L(){return new j(`server_unsupported`,"This server does not support this command yet. Update the server, or point `entrydesk profile set apiUrl <url>` at one that does.")}function R(){return new j(`project_feature_disabled`,"Projects are not enabled on this server. Ask an operator to set ENABLE_PROJECT, or point `entrydesk profile set apiUrl <url>` at a server that has them.")}const z={context_source_not_found:`Context source not found. Check the id, and note that assets are not part of the CLI context surface — view them in the Hub.`,project_owner_required:P,project_last_owner_required:`This is the last owner of the project. Promote another member to owner before removing or demoting them.`,project_invitee_not_in_workspace:`That user is not a member of this workspace, so they cannot be added to a project in it.`,project_member_already_exists:`That user is already a member of this project.`,project_member_not_found:`That user is not a member of this project.`,project_member_via_team:`This person is in the project through a team, not as a direct member. They leave it by leaving the team, or when an owner removes the team from the project.`,project_team_not_found:"Team not found. Only a team in this workspace can be added — a hidden team only by its own members — and only a team already in the project can be removed. `entrydesk project members <project>` lists the teams in it.",project_team_already_added:F,task_not_found:`Task not found. Only a task you own can be moved or shared, and only by its id.`,asset_sharing_confirmation_required:`This task produced assets the project does not hold yet. Moving it in shares them with every member of the project — re-run with --confirm-asset-sharing to confirm.`,task_not_in_project:`This task is not in a project, so there are no project members to share it with.`,task_project_mismatch:"This task was moved out of this project while the command ran, so nothing was changed. `entrydesk project tasks <project>` lists the tasks in each project; re-run against the one it is in now.",not_project_member:"That member or team is not in the project. `entrydesk project members <project>` lists the members and teams with their ids.",task_grant_not_found:`This task is not shared with that member or team, so there is nothing to stop sharing.`,sharing_disabled:`Sharing is turned off for this workspace by an admin.`,share_visibility_not_allowed:`This share level is not allowed by the workspace share policy set by an admin.`,project_not_found:M,project_file_not_found:N,project_link_not_found:N,file_not_found:`The uploaded file is no longer there to attach. Run the command again.`,project_file_already_attached:`This file is already a source of the project.`,project_link_fetch_in_progress:"This link is already being fetched. Wait for `entrydesk project sources <project>` to show it as ready or failed, then refetch."};function B(){return new j(`project_owner_required`,P)}function V(){return new j(`project_team_already_added`,F)}function se(e){if(e.response.status!==409)return null;let t=d.safeParse(e.data);if(!t.success)return null;let n=t.data.data;return new j(a,`This source changed after version ${n.baseVersionNumber}, which your edit is based on: it is now at version ${n.currentVersionNumber}, saved by ${n.currentVersionEditor.name||n.currentVersionEditor.id} at ${n.currentVersionSavedAt} (${n.size} bytes). Read it again${n.url?` from ${n.url}`:``}, merge your change into it, then replace with --expected-version ${n.currentVersionNumber}.`,n)}function H(e){return z[e]}function U(e){let{status:n}=e.response;if(n<400||n>=500)return null;let r=t(e.data);if(r===void 0)return null;let i=z[r];return i===void 0?null:new j(r,i)}async function W(e,n){try{let{features:r}=await e.getRuntimeConfig();if(!r.enableProject)return R();if(t(n.data)===`not_found`)return L()}catch{}return I()}const G=[/\/projects\/[^/]+\/notes$/u,/\/projects\/[^/]+\/tasks$/u,/\/tasks\/[^/]+$/u,/\/tasks\/[^/]+\/project$/u,/\/tasks\/[^/]+\/shares(?:\/(?:members|teams)\/[^/]+)?$/u];function K(e){let{pathname:t}=new URL(e.request.url),n=G.some(e=>e.test(t));return e.request.method.toUpperCase()===`GET`?n?`tasks:read`:`projects:read`:n?`tasks:write`:`projects:write`}function ce(e){if(typeof e!=`object`||!e)return;let t=e.data;if(typeof t!=`object`||!t)return;let{missingScopes:n,mode:r}=t;if(!Array.isArray(n)||n.length===0)return;let a=n.filter(e=>typeof e==`string`&&Object.hasOwn(i,e));if(a.length===n.length)return{scopes:a,mode:r===`any`?`any`:`all`}}function le({scopes:e,mode:t}){let n=e.map(e=>`\`${e}\``);if(n.length===1)return`the ${n[0]} scope`;let r=new Intl.ListFormat(`en`,{type:t===`any`?`disjunction`:`conjunction`}).format(n);return t===`any`?`one of the ${r} scopes`:`the ${r} scopes`}function ue(e){let t=null;try{t=u()}catch{}let n=le(e),r=e.scopes.length===1||e.mode===`any`?`it`:`them`;return t?.authSource===`pat-env`?`This token is missing ${n}. Issue a personal access token that grants ${r}, then set ENTRYDESK_TOKEN to it.`:`Your session is missing ${n} — it predates project support. Run \`entrydesk login\` again to grant ${r}.`}function q(e){return new j(`insufficient_scope`,ue(e))}function de(e){if(!(e instanceof l))return null;switch(e.code){case`project_not_found`:return I();case`project_not_enabled`:return R();case`insufficient_scope`:return q({scopes:[`tasks:write`],mode:`all`});default:return null}}async function J(e,n,r){if(n instanceof j)return n;if(!(n instanceof h))return null;let i=n.response.status;return i===403&&t(n.data)===`insufficient_scope`?q(ce(n.data)??{scopes:[r??K(n)],mode:`all`}):i===404&&e?U(n)??W(e,n):se(n)??U(n)}async function fe(e,t={}){return J(t.client,e,t.requiredScope)}async function Y(e,t,r,i){let a=await J(e,t,i);r.json||(a||ee(t),console.error(`Error: ${n(a.message)}`),process.exit(1)),T({error:a?{code:a.code,message:a.message,...a.conflict&&{data:a.conflict}}:o(t)}),process.exit(1)}function X(e,t){return Y(void 0,t,e)}async function Z(t,n,r){let i=new e;try{let{accessToken:e,workspaceId:t}=await s();return await n({client:i,accessToken:e,workspaceId:t})}catch(e){return Y(i,e,t,r)}}async function pe(e,t){await Z(e,t)}async function Q({client:e,accessToken:t,workspaceId:n},r){return e.listProjects(t,n,{limit:r.limit??20,nextKey:r.nextKey,filter:r.filter,sortBy:r.sortBy??`createdAt`,order:r.order??`asc`})}async function $(e,t){if(g(t))return t;if(!/^\d+$/u.test(t))throw I();let n=Number.parseInt(t,10),{projects:r}=await Q(e,{filter:`all`}),i=r[n-1];if(i===void 0)throw new j(`project_index_out_of_range`,`No project numbered ${n}. \`entrydesk project list\` shows ${r.length}.`);return i.id}async function me(e,t){let n=await $(e,t);return e.client.getProject(e.accessToken,e.workspaceId,n)}async function he(e,t){await e.client.getTasks(e.accessToken,e.workspaceId,{limit:1,projectId:t})}async function ge(e,t){return Z({json:t},t=>$(t,e),`projects:read`)}export{T as C,D,O as E,x as O,ie as S,te as T,ae as _,$ as a,ne as b,de as c,X as d,pe as f,S as g,b as h,ge as i,re as k,B as l,H as m,Q as n,j as o,Z as p,me as r,fe as s,he as t,V as u,oe as v,y as w,w as x,A as y};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{C as e,Gt as t,K as n,O as r,Wt as i,p as a,qt as o,r as s}from"./profile-storage--QCh_u_Q.js";import{t as c}from"./terminal-text-cBPBiP3x.js";import{isHTTPError as l}from"ky";const u={published:!1,versionNumber:null,versionId:null,publishId:null,status:null,rejectReason:null};function d(e){if(e.addUser!==void 0)return{subject:{subjectType:o.USER,subjectId:e.addUser},remove:!1};if(e.removeUser!==void 0)return{subject:{subjectType:o.USER,subjectId:e.removeUser},remove:!0};if(e.addTeam!==void 0)return{subject:{subjectType:o.TEAM,subjectId:e.addTeam},remove:!1};if(e.removeTeam!==void 0)return{subject:{subjectType:o.TEAM,subjectId:e.removeTeam},remove:!0}}function f(e){return e.target.findEditable?.(e.client,e.accessToken,e.workspaceId)??Promise.resolve(void 0)}async function p(e){let t=await f(e);if(t)return t.publishedTo?.workspace??u}function m(e){switch(e.status){case i.APPROVED:return`shared with everyone in the workspace`;case i.PENDING_UPDATE:return`shared with everyone in the workspace; an update is waiting for admin review`;case i.PENDING:return`waiting for a workspace admin to approve`;case i.REJECTED:return e.rejectReason?`rejected by a workspace admin: ${r(e.rejectReason)}`:`rejected by a workspace admin`;case null:return`not shared`;default:return e.status}}function h(e){let t=e.grants.filter(e=>e.subjectType===o.TEAM);console.log(`Team grants (${t.length}):`),t.length===0&&console.log(` (none)`);for(let e of t)console.log(` - ${r(e.team.name)} · ${e.role}`),console.log(` ID: ${e.subjectId}`);let i=n(e);console.log(`User grants (${i.length}):`),i.length===0&&console.log(` (none)`);for(let e of i)console.log(` - ${r(e.user.name)} <${r(e.user.email)}> · ${e.role}`),console.log(` ID: ${e.subjectId}`)}async function g(e){if(e.options.role===t.OWNER)throw new s(`A team can be granted viewer or editor, not owner.`);if((await f(e))?.kind===`managed`)throw new s(`Managed ${e.target.label}s can only be shared with individual users.`)}async function _(e,t){let{client:n,accessToken:r,workspaceId:i,target:a,options:s}=e,{subjectType:l,subjectId:u}=t.subject;if(t.remove){if(await n.removeResourceGrant(r,i,a.resource,t.subject),s.json){console.log(c({[`${l}Id`]:u,removed:!0}));return}console.log(`Revoked access for ${l} ${u}`);return}l===o.TEAM&&await g(e);let d=await n.upsertResourceGrant(r,i,a.resource,t.subject,s.role);if(s.json){console.log(c(d));return}console.log(`Granted ${s.role} to ${l} ${u}`)}async function v(e,t){let{client:n,accessToken:r,workspaceId:i,target:a,options:o}=e;await n.submitWorkspacePublish(r,i,{resourceType:t,resourceId:a.resource.id});let s=await p(e);if(o.json){console.log(c({id:a.resource.id,published:s?.published??!1,workspace:s??null}));return}console.log(s?`Workspace: ${m(s)}`:`Submitted the ${a.label} for sharing with the workspace`)}async function y(e){let{client:t,accessToken:n,workspaceId:r,target:i,options:a}=e,o=await p(e);if(!o?.publishId)throw new s(`This ${i.label} is not shared with the workspace, or you cannot edit it.`);for(let i=0;o?.publishId&&i<3;i+=1)await t.revokeWorkspacePublish(n,r,o.publishId),o=await p(e);if(o?.publishId)throw new s(`The ${i.label} is still shared with the workspace (${m(o)}); run the command again.`);if(a.json){console.log(c({workspace:null,removed:!0}));return}console.log(`Stopped sharing the ${i.label} with the workspace`)}async function b(e){let{client:t,accessToken:n,workspaceId:r,target:i,options:a}=e,[o,s]=await Promise.all([t.listResourceGrants(n,r,i.resource),i.publishResourceType?p(e):void 0]);if(a.json){console.log(c(i.publishResourceType?{...o,workspace:s??null}:o));return}s&&console.log(`Workspace: ${m(s)}`),h(o)}async function x(t,n){let{accessToken:r,workspaceId:i}=await a(),o={client:new e,accessToken:r,workspaceId:i,target:t,options:n},s=d(n);if(s){await _(o,s);return}if(t.publishResourceType&&n.addWorkspace){await v(o,t.publishResourceType);return}if(t.publishResourceType&&n.removeWorkspace){await y(o);return}await b(o)}async function S(e,t){try{await x(e,t)}catch(n){if(l(n)&&n.response.status===403){let r=t.addWorkspace||t.removeWorkspace?` Sharing with the whole workspace also needs your workspace role to allow publishing ${e.label}s.`:``;throw new s(`Forbidden (403): you can't change who can access this ${e.label}. Only its owner can manage sharing.${r}`,1,n)}throw n}}export{S as t};
|
package/dist/status-DLI2OgMv.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var __entrydeskNodeFloor = 24;
|
|
3
|
-
if (parseInt(process.versions.node, 10) < __entrydeskNodeFloor) {
|
|
4
|
-
process.stderr.write(
|
|
5
|
-
'entrydesk: Node.js ' + __entrydeskNodeFloor + ' or newer is required, but this is Node ' + process.versions.node + '.\n' +
|
|
6
|
-
'Upgrade Node (https://nodejs.org/en/download), then reinstall @entrydesk/cli.\n'
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
import{C as e,E as t,M as n,d as r,l as i,t as a,y as o,z as s}from"./profile-storage--QCh_u_Q.js";import{t as c}from"./terminal-text-cBPBiP3x.js";async function l(l){let u=a.getEffectiveProfileName(),d={model:s.getDefaultModel(),connectors:s.getDefaultConnectorIds()},f=o();if(f){l.json?console.log(c({loggedIn:!0,authSource:f.authSource,profile:u,server:n(),workspaceId:f.workspaceId,defaults:d})):(console.log(`Profile: ${u}`),console.log(`Server: ${n()}`),console.log(`Authenticated via ${f.label} (no login required)`),console.log(`Workspace ID: ${f.workspaceId}`));return}let p=await t.getAll();if(!p){l.json?console.log(c({loggedIn:!1,profile:u,server:n(),defaults:d})):(console.log(`Profile: ${u}`),console.log(`Server: ${n()}`),console.log(`Not logged in`),console.log("Run `entrydesk login` to log in"));return}let m;if(p.workspaceId)try{let t=new e,n=await r(),{workspaces:i}=await t.getWorkspaces(n);m=i.find(e=>e.id===p.workspaceId)?.name}catch(e){if(e instanceof i){l.json?console.log(c({loggedIn:!1,profile:u,server:n(),defaults:d})):(console.log(`Profile: ${u}`),console.log(`Server: ${n()}`),console.log(`Not logged in`),console.log("Run `entrydesk login` to log in"));return}}l.json?console.log(c({loggedIn:!0,authSource:`file`,profile:u,server:n(),email:p.email,workspaceId:p.workspaceId,workspaceName:m,defaults:d})):(console.log(`Profile: ${u}`),console.log(`Server: ${n()}`),console.log(`Logged in as ${p.email}`),m&&console.log(`Workspace: ${m}`),p.workspaceId&&console.log(`Workspace ID: ${p.workspaceId}`))}export{l as runStatus};
|