@npayload/sdk 5.1.0 → 6.1.1
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 +12 -12
- package/dist/chunk-2U3QN6IU.mjs +1 -0
- package/dist/{chunk-ZDOLKWQD.mjs → chunk-2UJADZ6K.mjs} +1 -1
- package/dist/chunk-2ZK6PEZR.mjs +1 -0
- package/dist/chunk-3RE3BK3W.mjs +1 -0
- package/dist/chunk-4QKJIAQO.mjs +1 -0
- package/dist/chunk-64SVI75H.mjs +1 -0
- package/dist/chunk-7AZ3YJ62.mjs +1 -0
- package/dist/chunk-BPVBERWX.mjs +3 -0
- package/dist/chunk-C4LTBM2E.mjs +1 -0
- package/dist/chunk-CJIZRYGT.mjs +5 -0
- package/dist/{chunk-GG7UQYUV.mjs → chunk-EM46J3TV.mjs} +1 -1
- package/dist/chunk-ERQXEWTC.mjs +1 -0
- package/dist/chunk-F4F5GA36.mjs +9 -0
- package/dist/chunk-F5PMOFZY.mjs +1 -0
- package/dist/chunk-GEDYBXWJ.mjs +1 -0
- package/dist/chunk-HNHTAV57.mjs +1 -0
- package/dist/chunk-IA5ADBRQ.mjs +2 -0
- package/dist/chunk-IKKXOIJF.mjs +20 -0
- package/dist/chunk-IW34IJP4.mjs +1 -0
- package/dist/chunk-JWEUM2BU.mjs +1 -0
- package/dist/chunk-JYVB32D3.mjs +1 -0
- package/dist/chunk-K6H7MJ4W.mjs +1 -0
- package/dist/{chunk-M7WGBUJ2.mjs → chunk-MKQUL5LA.mjs} +1 -1
- package/dist/{chunk-HX6PH7C3.mjs → chunk-MYM6C3WY.mjs} +1 -1
- package/dist/chunk-NCKK7PHF.mjs +1 -0
- package/dist/{chunk-STS7CL74.mjs → chunk-NV6B7I6P.mjs} +1 -1
- package/dist/chunk-O2USGVDT.mjs +1 -0
- package/dist/chunk-O7KSYRUO.mjs +2 -0
- package/dist/chunk-OGXDRDCJ.mjs +1 -0
- package/dist/chunk-PX7FINE4.mjs +17 -0
- package/dist/chunk-QXEFKQAF.mjs +1 -0
- package/dist/chunk-ROYJNUAJ.mjs +4 -0
- package/dist/chunk-TOF3BORJ.mjs +5 -0
- package/dist/chunk-TYVWHQ4H.mjs +1 -0
- package/dist/chunk-VC3Y57EV.mjs +1 -0
- package/dist/chunk-VZZ4FDPO.mjs +1 -0
- package/dist/{chunk-ORT5FUFW.mjs → chunk-WLHCORNO.mjs} +1 -1
- package/dist/chunk-WWSPP7WV.mjs +1 -0
- package/dist/chunk-XAB3ANJT.mjs +22 -0
- package/dist/chunk-XF6XPU25.mjs +5 -0
- package/dist/chunk-XPZRF64T.mjs +1 -0
- package/dist/{chunk-YFFHEYYK.mjs → chunk-XVZEP6PT.mjs} +1 -1
- package/dist/chunk-YVGH2T7O.mjs +5 -0
- package/dist/{chunk-IH2OLS7G.mjs → chunk-Z24VZ6HI.mjs} +1 -1
- package/dist/chunk-ZYMM2PCZ.mjs +65 -0
- package/dist/cli/index.js +353 -336
- package/dist/cli/index.mjs +272 -257
- package/dist/index.d.mts +68 -9
- package/dist/index.d.ts +68 -9
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-2G46BKEC.mjs +0 -1
- package/dist/chunk-2WG7FETK.mjs +0 -22
- package/dist/chunk-5R5L7GTT.mjs +0 -17
- package/dist/chunk-5SMWYS7Z.mjs +0 -1
- package/dist/chunk-6R2QLUWE.mjs +0 -20
- package/dist/chunk-7IFTQ52O.mjs +0 -1
- package/dist/chunk-7QTR5IWG.mjs +0 -1
- package/dist/chunk-AECDYMA2.mjs +0 -1
- package/dist/chunk-AGDMCMF3.mjs +0 -1
- package/dist/chunk-BBHWYMQA.mjs +0 -1
- package/dist/chunk-C5EDDEPR.mjs +0 -1
- package/dist/chunk-CDA75PLA.mjs +0 -1
- package/dist/chunk-CFM43QNN.mjs +0 -64
- package/dist/chunk-GGXNXM73.mjs +0 -1
- package/dist/chunk-K3YY77PG.mjs +0 -3
- package/dist/chunk-KQCX2PCW.mjs +0 -1
- package/dist/chunk-LCUELOEE.mjs +0 -2
- package/dist/chunk-N6NIJISZ.mjs +0 -5
- package/dist/chunk-OA73YMB6.mjs +0 -6
- package/dist/chunk-ONTNXGOM.mjs +0 -1
- package/dist/chunk-R6DPWMZM.mjs +0 -1
- package/dist/chunk-TQFAYJEP.mjs +0 -4
- package/dist/chunk-TUWFD3AZ.mjs +0 -1
- package/dist/chunk-UDLS46F5.mjs +0 -1
- package/dist/chunk-VZT7RCAC.mjs +0 -4
- package/dist/chunk-WOMYXKGW.mjs +0 -5
- package/dist/chunk-X3CZMXOZ.mjs +0 -9
- package/dist/chunk-XLK55DEY.mjs +0 -1
- package/dist/chunk-YHUBO6K4.mjs +0 -1
- package/dist/chunk-YLV3KSNV.mjs +0 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The package ships the SDK, the `npayload` CLI (also callable as `np`) and its MC
|
|
|
15
15
|
```bash
|
|
16
16
|
npx @npayload/sdk init # provision credentials and scaffold a project (device flow)
|
|
17
17
|
# or, non-interactive:
|
|
18
|
-
|
|
18
|
+
npx @npayload/sdk login --org <org> --app <app> --env sandbox
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
```ts
|
|
@@ -42,7 +42,7 @@ with your app's key. HTTP/JSON is a permanent opt-in:
|
|
|
42
42
|
import { NPayload } from "@npayload/sdk";
|
|
43
43
|
|
|
44
44
|
const np = await NPayload.connect({ clientId: process.env.NPAYLOAD_CLIENT_ID!, transport: "http" }); // explicit opt-in
|
|
45
|
-
// or NPAYLOAD_TRANSPORT=http, or `
|
|
45
|
+
// or NPAYLOAD_TRANSPORT=http, or `npx @npayload/sdk --transport http` on the CLI
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
By default the SDK and the CLI reach npayload's hosted service: its API at
|
|
@@ -54,7 +54,7 @@ develop, name its API, its sign-in host and its live connection together:
|
|
|
54
54
|
|
|
55
55
|
- In code, with the `baseUrl`, `authUrl` and `edgeUrl` options of
|
|
56
56
|
`NPayload.connect` and `new NPayload`.
|
|
57
|
-
- In the shell that runs `
|
|
57
|
+
- In the shell that runs the CLI (`npx @npayload/sdk init`, `npx @npayload/sdk login` or any other command), with
|
|
58
58
|
`NPAYLOAD_API_URL`, `NPAYLOAD_AUTH_URL` and `NPAYLOAD_EDGE_URL`. The CLI reads
|
|
59
59
|
your project's `.env` to see which deployment you are on, but dials only what
|
|
60
60
|
the shell exports, so export them.
|
|
@@ -93,8 +93,8 @@ const event = await webhooks.constructEvent(rawBody, req.headers, endpointSecret
|
|
|
93
93
|
During development, pair a local listener with a synthetic trigger:
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
npx @npayload/sdk listen --forward http://localhost:3000/api/webhooks # temporary subscription, forwarded to your handler
|
|
97
|
+
npx @npayload/sdk trigger order.confirmed # fire a sample event at it
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
## Networks and fingerprints
|
|
@@ -138,13 +138,13 @@ npayload from, read on your machine and sent nowhere, with the entry to add.
|
|
|
138
138
|
|
|
139
139
|
| Command | What it does |
|
|
140
140
|
|---|---|
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
144
|
-
| `
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
147
|
-
| `
|
|
141
|
+
| `npx @npayload/sdk init` / `npx @npayload/sdk login` | Provision credentials (device flow or flags); stored in the OS keychain |
|
|
142
|
+
| `npx @npayload/sdk pull` / `npx @npayload/sdk deploy` | Config as code: secrets always become `{{ secrets.… }}` references, never literals |
|
|
143
|
+
| `npx @npayload/sdk validate` | Fails on raw secret values in config |
|
|
144
|
+
| `npx @npayload/sdk listen` | Forward live webhooks to localhost with signature headers intact |
|
|
145
|
+
| `npx @npayload/sdk trigger <event-type>` | Fire a sample event (catalogue example or `--payload-file`) |
|
|
146
|
+
| `npx @npayload/sdk tail <channel>` | Watch events arrive on a channel, live |
|
|
147
|
+
| `npx @npayload/sdk doctor` | Environment, network and auth diagnostics |
|
|
148
148
|
|
|
149
149
|
## Requirements
|
|
150
150
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as a,e as b,f as c,g as d}from"./chunk-IKKXOIJF.mjs";import"./chunk-MDW42OG6.mjs";import"./chunk-EM46J3TV.mjs";import"./chunk-Z24VZ6HI.mjs";import"./chunk-TOF3BORJ.mjs";import"./chunk-2UJADZ6K.mjs";import"./chunk-ZYMM2PCZ.mjs";import"./chunk-OGXDRDCJ.mjs";import"./chunk-ROYJNUAJ.mjs";import"./chunk-4NWQCPI4.mjs";import"./chunk-MYM6C3WY.mjs";import"./chunk-QXEFKQAF.mjs";import"./chunk-CJDCY2NH.mjs";import"./chunk-MKQUL5LA.mjs";import"./chunk-7AZ3YJ62.mjs";import"./chunk-YVGH2T7O.mjs";import"./chunk-IA5ADBRQ.mjs";import"./chunk-WWSPP7WV.mjs";import"./chunk-XF6XPU25.mjs";import"./chunk-XVZEP6PT.mjs";import"./chunk-JWEUM2BU.mjs";import"./chunk-O7KSYRUO.mjs";import"./chunk-BPVBERWX.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-HNHTAV57.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{c as pullScopesIntoManifest,d as registerScopes,b as runScopesDiff,a as runScopesFix};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{y as i,z as c}from"./chunk-ZYMM2PCZ.mjs";import{a as e,b as n,c as t}from"./chunk-MYM6C3WY.mjs";import{a as o}from"./chunk-LJNU5QHZ.mjs";var a={events:e,pipes:n,primus:t};async function u(){let s=new Set;for(let[f,p]of Object.entries(a)){let r=i(f);if(!r)continue;let g=await c(r);for(let m of p(g))s.add(m)}return[...s].sort()}o(u,"projectAllPermissions");export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-XAB3ANJT.mjs";import"./chunk-MYM6C3WY.mjs";import"./chunk-QXEFKQAF.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{e as checkPermissionsDrift,g as checkScopesDrift,a as permissionsContentHash,b as renderPermissionsModule,c as scopesFromConfig,d as writePermissionsModule,f as writeScopesModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h}from"./chunk-CJIZRYGT.mjs";import"./chunk-IA5ADBRQ.mjs";import"./chunk-WWSPP7WV.mjs";import"./chunk-XF6XPU25.mjs";import"./chunk-XVZEP6PT.mjs";import"./chunk-JWEUM2BU.mjs";import"./chunk-O7KSYRUO.mjs";import"./chunk-BPVBERWX.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-HNHTAV57.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{a as CliDoorRefusal,d as CliSession,h as appCreateRefusalMessage,g as deviceLogin,b as readDoorRefusal,e as restoreSession,c as signInAddressOf,f as verificationPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"./chunk-Z24VZ6HI.mjs";import"./chunk-TOF3BORJ.mjs";import"./chunk-2UJADZ6K.mjs";import"./chunk-ZYMM2PCZ.mjs";import"./chunk-OGXDRDCJ.mjs";import"./chunk-ROYJNUAJ.mjs";import"./chunk-4NWQCPI4.mjs";import"./chunk-MYM6C3WY.mjs";import"./chunk-QXEFKQAF.mjs";import"./chunk-CJDCY2NH.mjs";import"./chunk-MKQUL5LA.mjs";import"./chunk-7AZ3YJ62.mjs";import"./chunk-YVGH2T7O.mjs";import"./chunk-IA5ADBRQ.mjs";import"./chunk-WWSPP7WV.mjs";import"./chunk-XF6XPU25.mjs";import"./chunk-XVZEP6PT.mjs";import"./chunk-JWEUM2BU.mjs";import"./chunk-O7KSYRUO.mjs";import"./chunk-BPVBERWX.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-HNHTAV57.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{a as computeFloor,c as coversFloor,b as floorGap};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l}from"./chunk-7AZ3YJ62.mjs";import"./chunk-IW34IJP4.mjs";import{i as a}from"./chunk-HNHTAV57.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{k as MASKED_SECRET_HEADER,j as assertNoRawSecretHeaders,i as findRawSecretHeaders,a as isSecretHeaderName,c as isSecretRef,g as loadSecretEnv,l as maskSecretHeaderValues,f as parseDotenv,d as parseSecretRef,e as redactSecretHeaders,h as resolveSecretRefs,b as secretRefFor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as l}from"./chunk-IW34IJP4.mjs";import{i as d}from"./chunk-HNHTAV57.mjs";import{a as c}from"./chunk-LJNU5QHZ.mjs";import{existsSync as k,readFileSync as S}from"fs";import{dirname as j,isAbsolute as x,join as w,resolve as A}from"path";function g(e){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}c(g,"sanitize");function E(e){return e.trim().toLowerCase()==="authorization"?"AUTH":g(e)}c(E,"headerSuffix");function b(e,n){return`{{ secrets.${[e.app?g(e.app):"",g(e.channel),E(n)].filter(r=>r.length>0).join("_")} }}`}c(b,"secretRefFor");var m=/^\s*\{\{\s*secrets\.([A-Za-z_][A-Za-z0-9_]*)\s*\}\}\s*$/;function h(e){return typeof e=="string"&&m.test(e)}c(h,"isSecretRef");function $(e){if(typeof e!="string")return null;let n=m.exec(e);return n?n[1]:null}c($,"parseSecretRef");function Z(e,n){let o={};for(let[r,t]of Object.entries(e))d(r)&&!h(t)?o[r]=b(n,r):o[r]=t;return o}c(Z,"redactSecretHeaders");var _=/^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)(?:\s*=|:\s)(.*)$/;function H(e){let n={};for(let o of e.split(/\r?\n/)){let r=o.trim();if(!r||r.startsWith("#"))continue;let t=_.exec(r);t&&(n[t[1]]=t[2].trim().replace(/^(["'])(.*)\1$/,"$2"))}return n}c(H,"parseDotenv");function D(e,n=process.env){let o=x(e)?e:A(process.cwd(),e),r=j(o),t=[w(r,".env"),w(r,"npayload",".env")],a={};for(let s of[...t].reverse())if(k(s))try{Object.assign(a,H(S(s,"utf8")))}catch{}for(let[s,i]of Object.entries(n))i!==void 0&&i!==""&&(a[s]=i);return{env:a,searched:t}}c(D,"loadSecretEnv");function F(e,n=process.env,o=[]){let r=[],t=c(s=>{if(typeof s=="string"){let i=$(s);if(i===null)return s;let u=n[i];return u===void 0||u===""?(r.push(i),s):u}if(Array.isArray(s))return s.map(t);if(s&&typeof s=="object"){let i={};for(let[u,f]of Object.entries(s))i[u]=t(f);return i}return s},"walk"),a=t(e);if(r.length>0)throw new Error(`unresolved secret reference(s): ${[...new Set(r)].sort().join(", ")} \u2014 set them in your environment (process env, project .env, npayload/.env) before pushing`+(o.length>0?`; files searched: ${o.join(", ")}`:""));return a}c(F,"resolveSecretRefs");function p(e){return e.map(n=>`/${n}`).join("")}c(p,"pathOf");function y(e){return e.map(n=>`/${n.replace(/~/g,"~0").replace(/\//g,"~1")}`).join("")}c(y,"pointerOf");function T(e,n,o){if(o===void 0)return{path:p(e),header:n};let r=o,t=e.findIndex((i,u)=>r.get(y(e.slice(0,u)))?.has(i)===!0);if(t===-1)return{path:p(e),header:n};let a=e.length-1,s=t===a||r.get(y(e.slice(0,a)))?.has(n)===!0;return{path:p(e.slice(0,t))||"(root)",header:n,...t<a?{inRefusedEntry:!0}:{},...s?{nameRefused:!0}:{}}}c(T,"rawSecretHeaderAt");function v(e,n){let o=[],r=c((t,a)=>{if(Array.isArray(t)){t.forEach((s,i)=>r(s,[...a,String(i)]));return}if(!(!t||typeof t!="object"))for(let[s,i]of Object.entries(t)){let u=[...a,s];if(s==="headers"&&i&&typeof i=="object"&&!Array.isArray(i))for(let[f,R]of Object.entries(i))d(f)&&typeof R=="string"&&!h(R)&&o.push(T([...u,f],f,n));r(i,u)}},"walk");return r(e,[]),o}c(v,"findRawSecretHeaders");function V(e,n){let o=v(e,n);if(o.length!==0)throw new Error(`raw secret header value(s) in config \u2014 replace each with a {{ secrets.NAME }} reference (${l("pull")} writes them; ${l("validate")} lists them): `+o.map(r=>`${r.nameRefused?"a header whose name is not shown here":r.header} at ${r.path}`+(r.inRefusedEntry?" (in an entry whose name is not shown here)":"")).join("; "))}c(V,"assertNoRawSecretHeaders");var O="[redacted \u2014 secret header]";function I(e){let n=c((o,r)=>{if(Array.isArray(o))return o.map(t=>n(t,!1));if(o&&typeof o=="object"){let t={};for(let[a,s]of Object.entries(o))r&&d(a)&&typeof s=="string"&&!h(s)?t[a]=O:t[a]=n(s,a==="headers");return t}return o},"walk");return n(e,!1)}c(I,"maskSecretHeaderValues");export{b as a,h as b,$ as c,Z as d,H as e,D as f,F as g,v as h,V as i,O as j,I as k};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as o}from"./chunk-LJNU5QHZ.mjs";var p="https://api.npayload.com",g="https://auth.npayload.com",a="https://npp.npayload.com",u="npayload.com",h=new Map([[new URL(p).hostname,"API"],[new URL(g).hostname,"auth host"],[new URL(a).hostname,"edge"]]);function R(n){return n===u||n.endsWith(`.${u}`)}o(R,"isProductionHost");function A(n){let e;try{e=new URL(n).hostname}catch{return}try{e=decodeURIComponent(e)}catch{}return e.toLowerCase().replace(/\.+$/,"")}o(A,"hostOf");function c(n){let e=n?.trim();return e||void 0}o(c,"named");function i(n){let e=c(n);if(e===void 0)return;let t=A(e);if(!(t===void 0||!R(t)))return h.get(t)??"host"}o(i,"productionRole");function m(n){let e=[];for(let[s,d]of n){let r=c(d);r!==void 0&&e.push({source:s,url:r})}let t=e.find(s=>i(s.url)===void 0);return t===void 0?{named:e}:{named:e,other:t}}o(m,"estateOf");var P=["NPAYLOAD_API_URL","NPAYLOAD_AUTH_URL","NPAYLOAD_EDGE_URL","NPAYLOAD_PRIMUS_API_URL","NPAYLOAD_ACCOUNT_API_URL","NPAYLOAD_ADMIN_API_URL","KERNEL_DOOR_URL"];function _(n,e=t=>t){return P.map(t=>[e(t),n[t]])}o(_,"environmentSources");function f(n){try{let e=new URL(n).origin;return e&&e!=="null"?e:n}catch{return n}}o(f,"shown");function L(n,e){if(n.other===void 0)return;let t=i(e);if(t!==void 0)return`this run names another estate (${n.other.source} ${n.other.url}), so it sends no request to npayload's production ${t} (${f(e)}): npayload's production hosts serve its production estate alone`}o(L,"dialRefusal");function U(n,e){if(n.other===void 0)return;let t=i(e);if(t!==void 0)return`this run names another estate (${n.other.source} ${n.other.url}), so it opens no page on npayload's production ${t} (${f(e)}): npayload's production hosts serve its production estate alone`}o(U,"pageRefusal");function O(n){if(n.other!==void 0)return`this run names another estate (${n.other.source} ${n.other.url}) and no edge of it: npayload's production edge ${a} is the default of its production estate alone`}o(O,"noEdgeRefusal");function x(n){let e={},t=n.replace(/\r\n?/g,`
|
|
2
|
+
`),s=/^\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\n]+)?\s*(?:#.*)?$/gm;for(let d=s.exec(t);d!==null;d=s.exec(t)){let r=(d[2]??"").trim(),l=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),l==='"'&&(r=r.replace(/\\n/g,`
|
|
3
|
+
`).replace(/\\r/g,"\r")),e[d[1]]=r}return e}o(x,"readDotenvText");export{p as a,a as b,c,i as d,m as e,_ as f,L as g,U as h,O as i,x as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-ROYJNUAJ.mjs";import"./chunk-XF6XPU25.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{a as AuthError,b as findProjectCredentials,c as resolveCredentials,d as tryResolveCredentials};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{b as m,d as x}from"./chunk-IA5ADBRQ.mjs";import{d as b,e as O,f as T}from"./chunk-XF6XPU25.mjs";import{b as _,h as $}from"./chunk-JWEUM2BU.mjs";import{U as u}from"./chunk-O7KSYRUO.mjs";import{a as S}from"./chunk-BPVBERWX.mjs";import{b as A,e as R}from"./chunk-IW34IJP4.mjs";import{a as o}from"./chunk-LJNU5QHZ.mjs";import{hostname as z}from"os";import{SignJWT as H,importJWK as G}from"jose";import{generateKeyPair as N,exportJWK as C,calculateJwkThumbprint as K}from"jose";async function D(){let{publicKey:n,privateKey:e}=await N("ES256",{extractable:!0}),t=await C(n),r=await C(e);return{kid:(await K(t,"sha256")).slice(0,12),alg:"ES256",publicJwk:t,privateJwk:r,createdAt:Date.now()}}o(D,"generateDpopKeypair");import E from"chalk";var d=class extends Error{static{o(this,"RevokedSessionError")}constructor(e="Your npayload CLI session was revoked."){super(e),this.name="RevokedSessionError"}};function te(n){if(n instanceof d)return!0;let e=(n instanceof Error?n.message:String(n)).toLowerCase();return/fetch failed|econnrefused|etimedout|enotfound|eai_again|network|socket hang up|aborted|timed? ?out|and_error|dns/.test(e)?!1:/revoked|invalid_grant|unauthorized|session[_ ]?revoked|\b401\b/.test(e)}o(te,"isRevokedError");function ne(n={}){let e=n.write??(r=>void process.stderr.write(r)),t=n.exit??(r=>process.exit(r));e(`
|
|
2
|
+
`+E.red("\u2716 Your npayload CLI session was revoked.")+`
|
|
3
|
+
`),e(" "+E.yellow("\u2192")+" Run `"+A("login")+`\` to re-authenticate.
|
|
4
|
+
|
|
5
|
+
`),t(1)}o(ne,"exitRevoked");var y=class extends Error{constructor(t,r,s){super(t);this.reason=r;this.httpStatus=s;this.name="CliDoorRefusal"}static{o(this,"CliDoorRefusal")}};function he(n){if(n===null||typeof n!="object")return;let e=n;if(!(e.name!=="CliDoorRefusal"||typeof e.httpStatus!="number"))return{reason:typeof e.reason=="string"?e.reason:void 0,httpStatus:e.httpStatus}}o(he,"readDoorRefusal");function j(n){let e=o(r=>(r??"").trim().replace(/\/+$/,""),"trimmed"),t=e(n);if(t===e(S))return"";for(let r of["NPAYLOAD_AUTH_URL","NPAYLOAD_API_URL"])if(e(process.env[r])===t)return` at the address ${r} names (it is not shown here)`;return` at ${n}`}o(j,"signInAddressOf");function M(n,e){return n.split(e).join("the sign-in address").replace(/\bhttps?:\/\/\S+/g,"the sign-in address")}o(M,"withoutAddress");function J(n){return x(n).base}o(J,"authBase");function p(n,e){return _(m())(n,e)}o(p,"dial");function Y(){try{let n=z();return n?n.slice(0,80):void 0}catch{return}}o(Y,"safeHostname");function W(){let n=new Uint8Array(16);return crypto.getRandomValues(n),Array.from(n,e=>e.toString(16).padStart(2,"0")).join("")}o(W,"randomJti");function B(n){let e="";for(let t of n)e+=String.fromCharCode(t);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}o(B,"base64url");async function q(n){let e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(n));return B(new Uint8Array(e))}o(q,"accessTokenHash");async function w(n,e,t,r){let s=await G(n.privateJwk,"ES256"),i=new URL(t),l={htm:e.toUpperCase(),htu:`${i.origin}${i.pathname}`,jti:W()};return r&&(l.ath=await q(r)),new H(l).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:n.publicJwk}).setIssuedAt().sign(s)}o(w,"signDpopProof");var k=class{constructor(e,t,r,s){this.accessToken=e;this.refreshToken=t;this.keypair=r;this.base=s}static{o(this,"CliSession")}async call(e,t,r,s=!0,i=15e3){let l=`${this.base}/oauth/cli/${t}`,g=await w(this.keypair,e,l,this.accessToken),f=await p(l,{method:e,headers:{Authorization:`DPoP ${this.accessToken}`,DPoP:g,...r!==void 0?{"Content-Type":"application/json"}:{}},body:r!==void 0?JSON.stringify(r):void 0,signal:AbortSignal.timeout(i)});return f.status===401&&s&&await this.refresh()?this.call(e,t,r,!1,i):f}async refresh(){let e=`${this.base}/oauth/cli/refresh`,t=await w(this.keypair,"POST",e,this.refreshToken),r=await p(e,{method:"POST",headers:{Authorization:`DPoP ${this.refreshToken}`,DPoP:t},signal:AbortSignal.timeout(15e3)});if(!r.ok)return!1;let s=await r.json();return s.accessToken?(this.accessToken=s.accessToken,await b({accessToken:this.accessToken,refreshToken:this.refreshToken,dpopKeypair:this.keypair,storedAt:Date.now()}),!0):!1}async listOrgs(){let e=await this.call("GET","orgs");if(!e.ok)throw new Error(`Could not list organizations (${e.status}).`);return(await e.json()).orgs}async listApps(e){let t=await this.call("GET",`apps?orgId=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`Could not list apps (${t.status}).`);return(await t.json()).apps}async createApp(e,t){let r=await this.call("POST","apps",{orgId:e,...t});if(!r.ok){let s=await r.json().catch(()=>({}));throw new y(U(s.error,r.status,{slug:t.platformSlug}),s.error,r.status)}return await r.json()}async registerPlatform(e,t){let r=await this.call("POST","platforms",{orgId:e,slug:t.slug,...t.name!==void 0?{name:t.name}:{}});if(!r.ok){let s=await r.json().catch(()=>({}));throw new y(U(s.error,r.status,{slug:t.slug,door:"platforms"}),s.error,r.status)}return await r.json()}async provisionOac(e,t,r=!1,s){let i=await this.call("POST","oac",{...e?{orgId:e}:{},appGid:t,rotate:r,...s&&s.length>0?{requestedScopes:s}:{}});if(!i.ok)throw new Error(`Could not provision credentials (${i.status}).`);return await i.json()}async getOacGrant(e){let t;try{t=await this.call("GET",`oac?appGid=${encodeURIComponent(e)}`)}catch(s){return $(s),null}if(!t.ok)return null;let r=await t.json().catch(()=>({}));return{scopes:r.allowedScopes??[],configDrift:r.configDrift===!0}}async post(e,t,r=6e4){let s=await this.call("POST",e,t,!0,r);if(!s.ok){let i=await s.json().catch(()=>({}));throw new Error(i.message??i.error??`Request failed (${s.status}).`)}return await s.json()}async logout(){let e;try{let t=`${this.base}/oauth/cli/revoke`,r=await w(this.keypair,"POST",t,this.refreshToken);await p(t,{method:"POST",headers:{Authorization:`DPoP ${this.refreshToken}`,DPoP:r},signal:AbortSignal.timeout(8e3)})}catch(t){t instanceof u&&(e=t)}if(await T(),e!==void 0)throw e}async logoutAll(){let e;try{let t=`${this.base}/oauth/cli/revoke`,r=await w(this.keypair,"POST",t,this.refreshToken);await p(t,{method:"POST",headers:{Authorization:`DPoP ${this.refreshToken}`,DPoP:r,"Content-Type":"application/json"},body:JSON.stringify({all:!0}),signal:AbortSignal.timeout(8e3)})}catch(t){t instanceof u&&(e=t)}if(await T(),e!==void 0)throw e}sessionId(){try{let e=this.accessToken.split(".")[1];if(!e)return null;let t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));return typeof t.sid=="string"?t.sid:null}catch{return null}}orgId(){try{let e=this.accessToken.split(".")[1];if(!e)return null;let t=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),r=t["npayload/orgId"]??t.orgId??t.org??t.org_id;return typeof r=="string"&&r.length>0?r:null}catch{return null}}async heartbeat(e){let t=await this.call("POST","heartbeat",{verb:e});if(t.status===401)throw new d;if(!t.ok)throw new Error(`heartbeat failed (${t.status})`)}async whoami(){let e=await this.call("GET","whoami");if(e.status===401)throw new d;if(!e.ok)throw new Error(`whoami failed (${e.status})`);let t=await e.json().catch(()=>({}));return{sid:typeof t.sid=="string"?t.sid:this.sessionId(),label:typeof t.label=="string"?t.label:null}}};async function me(n){let e=await O();return e?new k(e.accessToken,e.refreshToken,e.dpopKeypair,J(n)):null}o(me,"restoreSession");function F(n){if(Array.isArray(n))return"a JSON array";if(n===null)return"JSON null";if(typeof n!="string")return`a JSON ${typeof n}, not a string`;if(n==="")return"an empty string";let e=/^([A-Za-z][A-Za-z0-9+.-]*):/.exec(n)?.[1];return e===void 0?"a string with no scheme":/^https?$/i.test(e)?`an address under the ${e.toLowerCase()}: scheme with no // after it, or with no host`:`an address under the ${e.toLowerCase()}: scheme`}o(F,"pageForm");function I(n,e){if(e!==void 0){if(typeof e=="string"&&/^https?:\/\//i.test(e))try{let t=new URL(e);if((t.protocol==="http:"||t.protocol==="https:")&&t.hostname!=="")return t.href}catch{}throw new u(`The device sign-in's answer names its ${n} as ${F(e)}, not an absolute http(s) URL: the sign-in ends here, before anything is printed or opened.`)}}o(I,"verificationPage");async function we(n){let e=J(n.authUrl);m().check(`${e}/oauth/cli/code`),n.onStart?.(e);let t=await D(),r;try{r=await p(`${e}/oauth/cli/code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dpop_jwk:t.publicJwk,hostname:Y(),os:process.platform,cli_version:R()}),signal:AbortSignal.timeout(15e3)})}catch(c){if(c instanceof u)throw c;let a=M(c instanceof Error?c.message:String(c),e);throw new Error(`Could not reach npayload's sign-in service${j(e)} (${a}). Check your network connection, or set NPAYLOAD_AUTH_URL if your account uses another sign-in address, then retry.`)}if(r.status===429)throw new Error("Too many sign-in attempts from this network. Please wait a minute and try again.");if(!r.ok)throw new Error(`Could not start the sign-in (${r.status}). Is npayload's sign-in service reachable${j(e)}?`);let s=await r.json(),i=I("verification_uri_complete",s.verification_uri_complete),l=I("verification_uri",s.verification_uri);if(i===void 0&&l===void 0)throw new u("The device sign-in's answer names no verification page, so there is nothing to print or open: the sign-in ends here.");m().checkPages(...[i,l].filter(c=>c!==void 0)),n.onPrompt({userCode:s.user_code,verificationUri:l??"",verificationUriComplete:i??"",expiresIn:s.expires_in});let g=(s.interval||5)*1e3,f=Date.now()+s.expires_in*1e3,v=!1,h=null,P=o(()=>{v=!0,h?.()},"onSigint");process.once("SIGINT",P);try{for(;Date.now()<f;){if(v||n.signal?.aborted)throw new Error("Login cancelled.");n.onPoll?.();let c=null;try{c=await p(`${e}/oauth/cli/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:s.device_code,dpop_jwk:t.publicJwk}),signal:AbortSignal.timeout(15e3)})}catch(a){if(a instanceof u)throw a;c=null}if(c){let a=await c.json().catch(()=>({}));if(c.ok&&a.access_token&&a.refresh_token)return await b({accessToken:a.access_token,refreshToken:a.refresh_token,dpopKeypair:t,storedAt:Date.now()}),new k(a.access_token,a.refresh_token,t,e);switch(a.error){case"authorization_pending":break;case"slow_down":g=(a.interval??g/1e3+5)*1e3;break;case"access_denied":throw new Error("Login was denied in the browser.");case"expired_token":throw new Error("The login code expired. Please run the command again.");default:if(!c.ok&&c.status>=500)throw new Error("The auth service returned an error. Please try again.")}}await new Promise(a=>{let L=setTimeout(()=>{h=null,a()},g);h=o(()=>{clearTimeout(L),h=null,a()},"wakeSleep")})}throw new Error("Login timed out. Please run the command again.")}finally{process.removeListener("SIGINT",P)}}o(we,"deviceLogin");function U(n,e,t={}){let r=t.slug??"this platform slug",s=t.organization??"your organization";switch(n){case"platform_not_registered":return`${r} is not registered to ${s} \u2014 register it as your own platform, or build on it as a standard connect app`;case"platform_claimed":return`${r} is operated by another organization \u2014 build on it as a standard connect app`;case"connect_write_required":return`registering ${r} needs an admin or owner of ${s}, or a member holding org:connect:write \u2014 ask an organization admin`;case"slug_taken":return"That slug is already taken.";case"reserved_slug":return"That slug is reserved. Choose another slug.";case"invalid_slug":return"That slug is not valid \u2014 lowercase alphanumeric with hyphens, no leading/trailing hyphens.";case"missing_tenancy_mode":return"The control plane requires a tenancy mode (none | tenanted) and this CLI did not send one \u2014 update npayload to the latest version.";case"invalid_tenancyMode":return'Tenancy mode must be exactly "none" or "tenanted".';case"feed_cannot_be_tenanted":return'A feed app cannot be tenanted \u2014 create it with tenancy "none".';case"invalid_appType":return"App type must be internal, connect, or feed.";case"invalid_subtype":return"Connect subtype must be device, mobile, or platform.";case"invalid_platform":return"Platform slug is not valid for this connect app.";case"missing_args":return"App name and slug are both required.";case"missing_tenancy_mode_flip_blocked":case"insufficient_scope":return`Your credential lacks the scope to create apps here (${n}).`;default:return t.door==="platforms"?`Could not register the platform (${n??"no reason given"}, HTTP ${e}).`:`Could not create app (${n??"no reason given"}, HTTP ${e}).`}}o(U,"appCreateRefusalMessage");export{d as a,te as b,ne as c,y as d,he as e,j as f,k as g,me as h,I as i,we as j,U as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-Z24VZ6HI.mjs";import{a as l}from"./chunk-LJNU5QHZ.mjs";function t(e){return[...new Set(e)].sort()}l(t,"normalizeScopes");function f(e,r){let o=t(e),n=t(r);return o.length===n.length&&o.every((i,c)=>i===n[c])}l(f,"scopesEqual");function d(e,r,o){let n=new Set(e),i=new Set(r),c=new Set(o);return{base:t(e),manifest:t(r),remote:t(o),localAdded:t(r.filter(s=>!n.has(s))),localRemoved:t(e.filter(s=>!i.has(s))),remoteAdded:t(o.filter(s=>!n.has(s))),remoteRemoved:t(e.filter(s=>!c.has(s)))}}l(d,"diffAgainstBase");function p(e){let r=t(e.declared),o=e.resolution??"none",n=a(r,e.floor);if(n.length>0)return{kind:"floor-gap",gap:n};let i=t(e.remote.scopes),c=t(e.pullBase??e.remote.scopes);return e.remote.configDrift&&!f(r,i)?o==="accept-remote"?{kind:"accept-remote",grant:i,manifest:i}:o==="overwrite-remote"?{kind:"sync",grant:r}:{kind:"conflict",diff:d(c,r,i)}:{kind:"sync",grant:r}}l(p,"reconcileScopes");export{p as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,k as b}from"./chunk-PX7FINE4.mjs";import"./chunk-F5PMOFZY.mjs";import"./chunk-ZYMM2PCZ.mjs";import"./chunk-OGXDRDCJ.mjs";import"./chunk-ROYJNUAJ.mjs";import"./chunk-4NWQCPI4.mjs";import"./chunk-CJDCY2NH.mjs";import"./chunk-MKQUL5LA.mjs";import"./chunk-7AZ3YJ62.mjs";import"./chunk-YVGH2T7O.mjs";import"./chunk-IA5ADBRQ.mjs";import"./chunk-WWSPP7WV.mjs";import"./chunk-XF6XPU25.mjs";import"./chunk-XVZEP6PT.mjs";import"./chunk-JWEUM2BU.mjs";import"./chunk-O7KSYRUO.mjs";import"./chunk-BPVBERWX.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-HNHTAV57.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{a as buildReport,b as registerDoctor};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as f}from"./chunk-EM46J3TV.mjs";import{a as m,b as p}from"./chunk-Z24VZ6HI.mjs";import"./chunk-TOF3BORJ.mjs";import"./chunk-2UJADZ6K.mjs";import{l as c,o as l}from"./chunk-ZYMM2PCZ.mjs";import"./chunk-OGXDRDCJ.mjs";import"./chunk-ROYJNUAJ.mjs";import"./chunk-4NWQCPI4.mjs";import"./chunk-MYM6C3WY.mjs";import"./chunk-QXEFKQAF.mjs";import"./chunk-CJDCY2NH.mjs";import"./chunk-MKQUL5LA.mjs";import"./chunk-7AZ3YJ62.mjs";import"./chunk-YVGH2T7O.mjs";import"./chunk-IA5ADBRQ.mjs";import"./chunk-WWSPP7WV.mjs";import"./chunk-XF6XPU25.mjs";import"./chunk-XVZEP6PT.mjs";import"./chunk-JWEUM2BU.mjs";import"./chunk-O7KSYRUO.mjs";import"./chunk-BPVBERWX.mjs";import{b as a}from"./chunk-IW34IJP4.mjs";import"./chunk-HNHTAV57.mjs";import"./chunk-K6H7MJ4W.mjs";import{a as n}from"./chunk-LJNU5QHZ.mjs";var r=class extends Error{static{n(this,"ScopeFloorError")}gap;constructor(t){super(`npayload.toml [access_scopes] does not cover the required scope floor \u2014 ${t.length} scope(s) missing:
|
|
2
|
+
${t.join(`
|
|
3
|
+
`)}
|
|
4
|
+
Run \`${a("scopes fix")}\` to append exactly these to the manifest.`),this.name="ScopeFloorError",this.gap=t}},s=class extends Error{static{n(this,"ScopeDriftError")}diff;constructor(t){super(`The remote grant has drifted from the manifest \u2014 refusing to overwrite it silently.
|
|
5
|
+
manifest declares : ${t.manifest.join(", ")||"(none)"}
|
|
6
|
+
remote grant now : ${t.remote.join(", ")||"(none)"}
|
|
7
|
+
`+(t.remoteAdded.length?` remote added : ${t.remoteAdded.join(", ")}
|
|
8
|
+
`:"")+(t.remoteRemoved.length?` remote removed : ${t.remoteRemoved.join(", ")}
|
|
9
|
+
`:"")+"Re-run with --accept-remote (pull the remote change into the manifest) or --overwrite-remote (replace the remote with the manifest)."),this.name="ScopeDriftError",this.diff=t}};async function y(e){let t=e.manifest!==void 0?e.manifest:l(e.cwd);if(!t)return null;if(c(t.accessScopes),!e.check){let o=e.floor??await m({...e.cwd!==void 0?{cwd:e.cwd}:{},components:t.embedComponents}),i=p(t.accessScopes,o);if(i.length>0)throw new r(i)}return t}n(y,"assertScopesGate");async function G(e){let t=await e.readRemoteGrant(e.appGid)??{scopes:[],configDrift:!1},o=f({declared:e.declared,floor:e.floor,remote:t,...e.resolution?{resolution:e.resolution}:{}});switch(o.kind){case"floor-gap":throw new r(o.gap);case"conflict":throw new s(o.diff);case"accept-remote":return e.writeManifestScopes?.(o.manifest),await e.syncGrant(e.appGid,o.grant),o;case"sync":return await e.syncGrant(e.appGid,o.grant),o}}n(G,"runDeclaredGrantSync");export{s as ScopeDriftError,r as ScopeFloorError,y as assertScopesGate,G as runDeclaredGrantSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="6505cc30387b87671ad3da5e95269788ca649dc53627971dcb01603d2548caf2",t={$schema:"http://json-schema.org/draft-07/schema#",title:"EventsConfig",type:"object",additionalProperties:!1,properties:{channels:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{name:{type:"string",maxLength:4096},idempotencyKey:{type:"string",maxLength:4096},description:{type:"string",maxLength:4096},type:{type:"string",enum:["topic","queue","stream"]},schema:{type:"object",properties:{type:{type:"string",enum:["json","avro","protobuf"]},definition:{type:"string",maxLength:4096},strict:{type:"boolean"}},required:["type"],additionalProperties:!1},settings:{type:"object",properties:{retentionMs:{type:"number"},maxMessageSize:{type:"number"},maxSubscriptions:{type:"number"},idempotencyWindowMs:{type:"number"}},additionalProperties:!1},metadata:{type:"object",additionalProperties:{oneOf:[{type:"string",maxLength:4096},{type:"number"},{type:"boolean"},{type:"null"}]},propertyNames:{maxLength:256,not:{enum:["__proto__","constructor","prototype"]}}},retentionMode:{type:"string",enum:["standard","compacted","compacted_with_log"]},compactionConfig:{type:"object",properties:{minAge:{type:"number"},deletePolicy:{type:"string",enum:["compact","delete","compact_and_delete"]}},additionalProperties:!1},nppMinQos:{type:"number"},rateLimit:{type:"object",properties:{ratePerSec:{type:"number"},burst:{type:"number"}},required:["ratePerSec","burst"],additionalProperties:!1},complianceClass:{type:"string",enum:["NONE","SOC2","GDPR","HIPAA","PCI","FEDRAMP_MOD","FEDRAMP_HIGH","IL5","ITAR"]},privacy:{type:"object",properties:{mode:{type:"string",enum:["standard","e2e","hybrid"]},encryptionProvider:{type:"string",enum:["none","publisher","platform"]}},required:["mode","encryptionProvider"],additionalProperties:!1},privacyMode:{type:"string",enum:["standard","hybrid","e2e"]},pii:{type:"string",enum:["strip","allow","block"]}},required:["name"]}},consumerGroups:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{channelGid:{type:"string",maxLength:4096},strategy:{type:"string",enum:["competing","sticky","broadcast"]},maxConcurrency:{type:"number"}},required:["strategy"]}},eventTypes:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{displayName:{type:"string",maxLength:4096},description:{type:"string",maxLength:4096},domain:{type:"string",maxLength:4096},entity:{type:"string",maxLength:4096},action:{type:"string",maxLength:4096},ownership:{type:"object",properties:{team:{type:"string",maxLength:4096},contact:{type:"string",maxLength:4096},slackChannel:{type:"string",maxLength:4096}},required:["team","contact"],additionalProperties:!1},channels:{type:"array",items:{type:"string",maxLength:4096}},tags:{type:"array",items:{type:"string",maxLength:4096}},schema:{type:"object",properties:{format:{type:"string",enum:["json_schema","avro","protobuf"]},definition:{type:"string",maxLength:4096}},required:["format","definition"],additionalProperties:!1}},required:["displayName","description","ownership"]}},exchanges:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{type:{type:"string",enum:["direct","fanout","topic","headers"]},config:{type:"object",properties:{headersMatchMode:{}},additionalProperties:!1}}}},subscriptions:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{channelGid:{type:"string",maxLength:4096},subscribesTo:{type:"string",enum:["messages","failures"]},idempotencyKey:{type:"string",maxLength:4096},consumerAppId:{type:"string",maxLength:4096},description:{type:"string",maxLength:4096},type:{type:"string",enum:["webhook","queue","adapter"]},filter:{type:"object",properties:{where:{type:"object",additionalProperties:{oneOf:[{type:"string",maxLength:4096},{type:"number"},{type:"boolean"}]},propertyNames:{maxLength:256,not:{enum:["__proto__","constructor","prototype"]}}},routingKey:{type:"string",maxLength:4096},subject:{type:"string",maxLength:4096}},additionalProperties:!1},subjectFilter:{type:"string",maxLength:4096},endpoint:{type:"object",properties:{url:{type:"string",format:"npayload-safe-url",maxLength:4096},method:{type:"string",enum:["POST","PUT"]},headers:{type:"object",additionalProperties:{type:"string",pattern:"^[^\\r\\n]*$",maxLength:4096},propertyNames:{pattern:"^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,128}$"}},queueName:{type:"string",maxLength:4096}},additionalProperties:!1},delivery:{type:"object",properties:{timeoutMs:{type:"number"},retryPolicy:{type:"object",properties:{maxAttempts:{type:"number"},backoffStrategy:{type:"string",enum:["exponential","linear","constant"]},initialDelayMs:{type:"number"},maxDelayMs:{type:"number"},backoffMultiplier:{type:"number"}},additionalProperties:!1},batchSize:{type:"number"},batchWindowMs:{type:"number"}},additionalProperties:!1},dlq:{type:"object",properties:{enabled:{type:"boolean"},maxAge:{type:"number"}},required:["enabled"],additionalProperties:!1},deliveryConfig:{type:"object",properties:{maxPerMinute:{type:"number"}},additionalProperties:!1},metadata:{type:"object",additionalProperties:{oneOf:[{type:"string",maxLength:4096},{type:"number"},{type:"boolean"},{type:"null"}]},propertyNames:{maxLength:256,not:{enum:["__proto__","constructor","prototype"]}}},transformPipeId:{type:"string",maxLength:4096},transformTimeout:{type:"number"},transformOnFailure:{type:"string",enum:["deliver_raw","drop_to_dlq"]}},required:["endpoint"]}}}};export{e as a,t as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-TOF3BORJ.mjs";import"./chunk-4NWQCPI4.mjs";import"./chunk-MKQUL5LA.mjs";import"./chunk-JWEUM2BU.mjs";import"./chunk-O7KSYRUO.mjs";import"./chunk-BPVBERWX.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-HNHTAV57.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{b as computePushGrant,a as reconcileOpScopes,c as syncCredentialScopes,d as syncExactGrant};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-LJNU5QHZ.mjs";var l={"org:apps:admin":{description:"Administer all apps in the org (bypass app-level RLS)",category:"security",tier:"admin"},"org:account:read":{description:"Read account surfaces for the bound app (environments, app metadata)",category:"security",tier:"developer"},"org:account:write":{description:"Manage account resources for the bound app (create environments, clone)",category:"security",tier:"developer"},"org:events:read":{description:"Read all Events resources (roll-up over every events:*:read scope)",category:"events",tier:"developer"},"org:events:write":{description:"Create/update/publish across all Events resources (roll-up over every events:*:write scope)",category:"events",tier:"developer"},"org:events:admin":{description:"Administer all Events resources (roll-up \u2014 satisfies every Events scope: read, write, and destructive)",category:"events",tier:"admin"},"org:channels:read":{description:"List and view channels",category:"events",tier:"developer"},"org:channels:write":{description:"Create and update channels",category:"events",tier:"developer"},"org:channels:admin":{description:"Delete and archive channels",category:"events",tier:"admin"},"org:messages:read":{description:"Read message history",category:"events",tier:"developer"},"org:messages:write":{description:"Publish messages",category:"events",tier:"developer"},"org:messages:admin":{description:"Delete and purge messages; manage message retention",category:"events",tier:"admin"},"org:subscriptions:read":{description:"List and view subscriptions",category:"events",tier:"developer"},"org:subscriptions:write":{description:"Create and update subscriptions",category:"events",tier:"developer"},"org:subscriptions:admin":{description:"Delete subscriptions and manage delivery tokens",category:"events",tier:"admin"},"org:dlq:read":{description:"View dead-letter queue entries",category:"events",tier:"developer"},"org:dlq:write":{description:"Reprocess and retry DLQ entries",category:"events",tier:"developer"},"org:dlq:admin":{description:"Purge and discard DLQ entries",category:"events",tier:"admin"},"org:consumer_groups:read":{description:"List and view consumer groups",category:"events",tier:"developer"},"org:consumer_groups:write":{description:"Create and update consumer groups",category:"events",tier:"developer"},"org:consumer_groups:admin":{description:"Delete consumer groups and reset offsets",category:"events",tier:"admin"},"org:streams:read":{description:"Read streams and consumer offsets",category:"events",tier:"developer"},"org:streams:write":{description:"Create streams and commit offsets",category:"events",tier:"developer"},"org:streams:admin":{description:"Delete streams and truncate offsets",category:"events",tier:"admin"},"org:snapshots:read":{description:"View subscription snapshots",category:"events",tier:"developer"},"org:snapshots:write":{description:"Create subscription snapshots",category:"events",tier:"developer"},"org:snapshots:admin":{description:"Delete subscription snapshots",category:"events",tier:"admin"},"org:scheduled:read":{description:"View scheduled messages",category:"events",tier:"developer"},"org:scheduled:write":{description:"Schedule messages for future delivery",category:"events",tier:"developer"},"org:scheduled:admin":{description:"Cancel scheduled messages",category:"events",tier:"admin"},"org:kv:read":{description:"Read compacted (key-value) channel state",category:"events",tier:"developer"},"org:kv:write":{description:"Write compacted (key-value) channel state",category:"events",tier:"developer"},"org:kv:admin":{description:"Delete compacted keys and purge KV state",category:"events",tier:"admin"},"org:cross_channels:read":{description:"View cross-channel (cross-cell) routing and remotes",category:"events",tier:"developer"},"org:cross_channels:write":{description:"Configure cross-channel routing and remote definitions",category:"events",tier:"developer"},"org:cross_channels:admin":{description:"Delete cross-channel routes and manage replication",category:"events",tier:"admin"},"org:archive:read":{description:"View archived (cold-tier) messages",category:"events",tier:"developer"},"org:archive:write":{description:"Archive live messages; restore and replay archived messages into channels",category:"events",tier:"developer"},"org:archive:admin":{description:"Restore and purge archived messages",category:"events",tier:"admin"},"org:time_travel:read":{description:"Query historical channel state (time travel)",category:"events",tier:"developer"},"org:time_travel:write":{description:"Create and update time-travel checkpoints and replays",category:"events",tier:"developer"},"org:time_travel:admin":{description:"Delete time-travel checkpoints and purge historical state",category:"events",tier:"admin"},"org:storage_policies:read":{description:"View storage tier policies",category:"events",tier:"developer"},"org:storage_policies:write":{description:"Create and update storage tier policies",category:"events",tier:"developer"},"org:storage_policies:admin":{description:"Delete storage tier policies (admin roll-up: satisfies read + write)",category:"events",tier:"admin"},"org:catalogue:read":{description:"View event catalogue (schema registry) entries",category:"events",tier:"developer"},"org:catalogue:write":{description:"Register and version event types in the catalogue",category:"events",tier:"developer"},"org:catalogue:admin":{description:"Deprecate and delete event catalogue entries",category:"events",tier:"admin"},"org:exchanges:read":{description:"List and view exchanges",category:"events",tier:"developer"},"org:exchanges:write":{description:"Create exchanges and bind channels",category:"events",tier:"developer"},"org:exchanges:admin":{description:"Delete exchanges and remove bindings",category:"events",tier:"admin"},"org:deliveries:read":{description:"View delivery status and history",category:"messaging",tier:"developer"},"org:deliveries:write":{description:"Retry and reprocess failed deliveries",category:"messaging",tier:"admin"},"org:webhooks:read":{description:"View inbound webhook configurations",category:"events",tier:"developer"},"org:webhooks:write":{description:"Create, update, and pause inbound webhooks",category:"events",tier:"developer"},"org:webhooks:admin":{description:"Rotate and reveal inbound webhook signing secrets; revoke webhooks",category:"events",tier:"admin"},"org:notify:read":{description:"Read Notifications resources (dispatches, inbox, preferences, templates, suppression, push tokens)",category:"notifications",tier:"developer"},"org:notify:write":{description:"Send and manage Notifications (dispatch, cancel, inbox, preferences, push tokens)",category:"notifications",tier:"developer"},"org:notify:admin":{description:"Administer Notifications (templates, suppression list, provider webhooks)",category:"notifications",tier:"admin"},"org:adapters:read":{description:"View adapter configurations",category:"adapters",tier:"developer"},"org:adapters:write":{description:"Create, update, and delete adapters",category:"adapters",tier:"admin"},"org:observability:read":{description:"View connector status",category:"adapters",tier:"developer"},"org:observability:write":{description:"Configure connectors (Datadog, SIEM, etc.)",category:"adapters",tier:"admin"},"org:tools:read":{description:"View tool definitions",category:"ai",tier:"developer"},"org:tools:execute":{description:"Execute tools via ASP",category:"ai",tier:"developer"},"org:asp:read":{description:"View ASP sessions",category:"ai",tier:"developer"},"org:asp:write":{description:"Create and update ASP sessions",category:"ai",tier:"developer"},"org:feed:read":{description:"Read all Feed resources (browse listings, view own subscriptions; roll-up over every feed:*:read scope)",category:"feed",tier:"developer"},"org:feed:write":{description:"Manage Feed subscriptions (subscribe, cancel, pause, resume, convert trial\u2192paid; roll-up over every feed:*:write scope)",category:"feed",tier:"developer"},"org:feed:admin":{description:"Administer all Feed resources (roll-up \u2014 satisfies every Feed permission: read, write, and destructive)",category:"feed",tier:"admin"},"org:publishers:read":{description:"View publisher profile",category:"feed",tier:"developer"},"org:publishers:write":{description:"Create and update publisher profile",category:"feed",tier:"admin"},"org:listings:read":{description:"View own listings",category:"feed",tier:"developer"},"org:listings:write":{description:"Create, publish, and depublish listings",category:"feed",tier:"admin"},"org:oauth_clients:read":{description:"View OAuth clients",category:"platform",tier:"developer"},"org:oauth_clients:write":{description:"Create, rotate, and revoke OAuth clients",category:"platform",tier:"developer"},"org:oauth_clients:admin":{description:"Assign admin-tier scopes to OAuth clients",category:"platform",tier:"admin"},"org:settings:read":{description:"View organization settings",category:"platform",tier:"developer"},"org:settings:write":{description:"Update organization settings",category:"platform",tier:"admin"},"org:members:read":{description:"View organization members",category:"platform",tier:"developer"},"org:members:admin":{description:"Invite, remove, and change member roles",category:"platform",tier:"admin"},"org:billing:read":{description:"View plans, invoices, usage",category:"billing",tier:"developer"},"org:billing:write":{description:"Add and update payment methods; create subscriptions",category:"billing",tier:"developer"},"org:billing:admin":{description:"Change plans; manage payouts, refunds, and credits",category:"billing",tier:"owner"},"org:analytics:read":{description:"View analytics (rollups, summaries, event tail, sketches)",category:"analytics",tier:"developer"},"org:audit:read":{description:"View audit logs",category:"security",tier:"developer"},"org:federation:read":{description:"View federation consents",category:"security",tier:"developer"},"org:federation:admin":{description:"Request, approve, and revoke federation",category:"security",tier:"owner"},"org:platform:read":{description:"View platform partner surfaces (apps, tenants, consents)",category:"platform",tier:"developer"},"org:connect:read":{description:"All Connect read surfaces (roll-up over every Connect resource)",category:"connect",tier:"developer"},"org:connect:write":{description:"All Connect write surfaces (roll-up over every Connect resource)",category:"connect",tier:"admin"},"org:connect:admin":{description:"Administer Connect \u2014 satisfies every Connect permission (roll-up)",category:"connect",tier:"owner"},"org:grants:read":{description:"View cross-org access grants, trust scores, usage",category:"connect",tier:"developer"},"org:grants:write":{description:"Request and resume access grants",category:"connect",tier:"admin"},"org:grants:admin":{description:"Approve, reject, and revoke cross-org access grants",category:"connect",tier:"admin"},"org:bridges:read":{description:"View identity bridges and bridge metrics",category:"connect",tier:"developer"},"org:bridges:write":{description:"Create, confirm, resync, suspend, consent identity bridges",category:"connect",tier:"admin"},"org:bridges:admin":{description:"Archive identity bridges (destructive tier)",category:"connect",tier:"owner"},"org:tenant_approvals:read":{description:"View tenant approvals and per-platform tenants",category:"connect",tier:"developer"},"org:tenant_approvals:write":{description:"Initiate and request tenant approvals",category:"connect",tier:"admin"},"org:tenant_approvals:admin":{description:"Approve, revoke, transfer tenant approvals; policy overrides",category:"connect",tier:"admin"},"org:consents:read":{description:"View platform-connect consents and consent challenges",category:"connect",tier:"developer"},"org:consents:write":{description:"Initiate, verify, revoke platform-connect consents",category:"connect",tier:"developer"},"org:profile:read":{description:"View the app's Connect profile and validation preview",category:"connect",tier:"developer"},"org:profile:write":{description:"Update the app's Connect profile (visibility, metadata)",category:"connect",tier:"developer"},"org:explore:read":{description:"Browse and search Connect Explore (read-only surface)",category:"connect",tier:"developer"},"org:partner:read":{description:"View partner governance: audit feed, governed apps, approvals",category:"connect",tier:"developer"},"org:partner:admin":{description:"Partner governance: freeze, reinstate, delist apps (no write tier \u2014 governance, not CRUD)",category:"connect",tier:"owner"},"org:alert_rules:read":{description:"View Connect alert rules",category:"connect",tier:"developer"},"org:alert_rules:write":{description:"Create and update Connect alert rules",category:"connect",tier:"developer"},"org:infrastructure:read":{description:"View cell assignments and health",category:"security",tier:"developer"},"org:infrastructure:admin":{description:"Request provisioning and manage cells",category:"security",tier:"owner"},"org:metrics:read":{description:"View analytics dashboards",category:"security",tier:"developer"},"org:embed:read":{description:"Read embed origin registry",category:"connect",tier:"developer"},"org:embed:write":{description:"Mint/revoke embed sessions and manage embed origins",category:"connect",tier:"developer"},"org:agents:read":{description:"List and view AI agents",category:"primus",tier:"developer"},"org:agents:execute":{description:"Run agent executions (chat, goal)",category:"primus",tier:"developer"},"org:conversations:read":{description:"View agent conversations",category:"primus",tier:"developer"},"org:memory:read":{description:"Search and view agent memories",category:"primus",tier:"developer"},"org:skills:read":{description:"View skill definitions",category:"primus",tier:"developer"},"org:executions:read":{description:"View execution history and status",category:"primus",tier:"developer"},"org:triggers:read":{description:"View agent triggers",category:"primus",tier:"developer"},"org:approvals:read":{description:"View approval queue",category:"primus",tier:"developer"},"org:guardrails:read":{description:"View kill switch and defense config",category:"primus",tier:"developer"},"org:brain:read":{description:"View LLM provider configuration",category:"primus",tier:"developer"},"org:tenants:read":{description:"List and view tenants",category:"primus",tier:"developer"},"org:discovery:read":{description:"View ASP discovery settings",category:"primus",tier:"developer"},"org:discovery:write":{description:"Enable or disable agent discovery",category:"primus",tier:"admin"},"org:compute:read":{description:"View skill runner environments",category:"primus",tier:"developer"},"org:compute:write":{description:"Provision compute environments",category:"primus",tier:"developer"},"org:compute:admin":{description:"Decommission compute environments",category:"primus",tier:"admin"},"org:learning:read":{description:"View learning patterns and feedback",category:"primus",tier:"developer"},"org:teams:read":{description:"View team hierarchy",category:"primus",tier:"developer"},"org:npp:read":{description:"View NPP wire security (per-app DPoP keys + hardware attestation status)",category:"security",tier:"developer"},"org:npp:write":{description:"Self-enroll the app's own NPP DPoP key",category:"security",tier:"developer"},"org:npp:admin":{description:"Rotate NPP DPoP keys + enroll/manage hardware attestation",category:"security",tier:"admin"},"org:keys:write":{description:"Register the app's own NPP DPoP/Ed25519 signing key (connect-time self-enrollment)",category:"security",tier:"developer"},"org:pipes:read":{description:"View pipes, their runs, connectors and governance settings",category:"pipes",tier:"developer"},"org:pipes:write":{description:"Create, update, activate, pause and archive pipes; approve or reject a decision a pipe is waiting on; replace a webhook pipe's secret and receive the new one; replay or discard records that failed; reset where a pipe resumes reading its source; and ask for approval to use a connector",category:"pipes",tier:"developer"},"org:pipes:execute":{description:"Run pipes, test a single step, backfill a pipe over past dates, and cancel runs",category:"pipes",tier:"developer"},"org:pipes:admin":{description:"View and change pipes, delete pipes, and manage connector credentials",category:"pipes",tier:"admin"},"org:credentials:read":{description:"List connector credentials (metadata only \u2014 never the secret)",category:"pipes",tier:"developer"},"org:credentials:write":{description:"Store, update, rotate, revoke, delete, test connector credentials",category:"pipes",tier:"developer"},"org:credentials:admin":{description:"Full connector-credential control (admin roll-up \u2014 satisfies credentials read + write)",category:"pipes",tier:"admin"},"org:agents:write":{description:"Create, update, pause, activate, invoke/run agents; assign/unassign skills (product-level write tier)",category:"primus",tier:"developer"},"org:agents:admin":{description:"Destructive agent governance \u2014 archive and remove agents (product-level admin tier)",category:"primus",tier:"admin"},"org:conversations:write":{description:"Create, update, send, and archive conversations",category:"primus",tier:"developer"},"org:conversations:admin":{description:"Remove conversations (destructive)",category:"primus",tier:"admin"},"org:memory:write":{description:"Store, update, and quarantine agent memories",category:"primus",tier:"developer"},"org:memory:admin":{description:"Bulk-delete and purge memories (destructive)",category:"primus",tier:"admin"},"org:skills:write":{description:"Create, update, enable, and synthesize skills",category:"primus",tier:"developer"},"org:skills:admin":{description:"Remove skills and runner environments (destructive)",category:"primus",tier:"admin"},"org:tools:write":{description:"Register, update, and connect tools and MCP servers",category:"primus",tier:"developer"},"org:tools:admin":{description:"Remove tools and disconnect MCP servers (destructive)",category:"primus",tier:"admin"},"org:executions:execute":{description:"Start and run agent executions",category:"primus",tier:"developer"},"org:executions:admin":{description:"Cancel and remove executions (destructive)",category:"primus",tier:"admin"},"org:triggers:write":{description:"Create, update, and enable triggers",category:"primus",tier:"developer"},"org:triggers:admin":{description:"Remove and archive triggers (destructive)",category:"primus",tier:"admin"},"org:approvals:write":{description:"Create approval requests",category:"primus",tier:"developer"},"org:approvals:admin":{description:"Approve or reject agent actions (governance)",category:"primus",tier:"admin"},"org:guardrails:write":{description:"Update guardrail configuration",category:"primus",tier:"developer"},"org:guardrails:admin":{description:"Activate the kill switch and set thresholds (governance)",category:"primus",tier:"admin"},"org:brain:write":{description:"Configure LLM providers and store provider keys",category:"primus",tier:"developer"},"org:brain:admin":{description:"Delete brain configuration (destructive)",category:"primus",tier:"admin"},"org:teams:write":{description:"Create teams and assign specialists",category:"primus",tier:"developer"},"org:teams:admin":{description:"Remove and restructure teams (destructive)",category:"primus",tier:"admin"},"org:tenants:write":{description:"Create and update tenants",category:"primus",tier:"developer"},"org:tenants:admin":{description:"Suspend and archive tenants (destructive)",category:"primus",tier:"admin"},"org:connections:read":{description:"View third-party connections",category:"primus",tier:"developer"},"org:connections:write":{description:"Create, connect, and reconnect connections",category:"primus",tier:"developer"},"org:connections:admin":{description:"Revoke and remove connections (destructive)",category:"primus",tier:"admin"},"org:learning:write":{description:"Submit feedback and manage learning patterns",category:"primus",tier:"developer"},"org:learning:admin":{description:"Purge learning data (destructive)",category:"primus",tier:"admin"},"org:agent_webhooks:read":{description:"List the agent-event webhook endpoints (never the signing secret)",category:"primus",tier:"developer"},"org:agent_webhooks:write":{description:"Create and remove agent-event webhook endpoints (the signing secret is answered once, on create)",category:"primus",tier:"developer"},"org:audit:admin":{description:"Audit governance (retention, config)",category:"primus",tier:"admin"},"org:connectors:read":{description:"View Primus flow workflows and their executions",category:"primus",tier:"developer"},"org:connectors:write":{description:"Create, update, activate, pause, and delete Primus flow workflows; cancel flow executions",category:"primus",tier:"developer"}},g=Object.keys(l);var f=["agents","conversations","memory","skills","tools","executions","triggers","brain","teams","tenants","connections","approvals","guardrails","learning","agent_webhooks","audit"];var h=["channels","messages","subscriptions","dlq","consumer_groups","streams","snapshots","scheduled","kv","cross_channels","archive","time_travel","storage_policies","catalogue","exchanges","webhooks"];var E=["grants","bridges","tenant_approvals","consents","profile","explore","partner","alert_rules"];var b=["pipes","credentials"];function T(){let e={};for(let[r,o]of Object.entries(l)){let i=r.replace(/^org:/,"");e[i]=o}return e}n(T,"buildScopes");var m=T(),u=Object.keys(l).map(e=>e.replace(/^org:/,""));var M={developer:Object.entries(m).filter(([,e])=>e.tier==="developer").map(([e])=>e),admin:Object.entries(m).filter(([,e])=>e.tier==="admin").map(([e])=>e),owner:Object.entries(m).filter(([,e])=>e.tier==="owner").map(([e])=>e)},V={"publish-only":{label:"Publish Only",description:"Least-privilege publisher: publish messages only \u2014 no channel, subscription, or DLQ access",scopes:["messages:write"],recommended:!0},"read-only":{label:"Read Only",description:"View data without modifications",scopes:["events:read","deliveries:read","npp:read"],recommended:!0},standard:{label:"Standard",description:"Typical SDK usage for publishing and reading events",scopes:["events:read","events:write","deliveries:read"],recommended:!0},pipes:{label:"Pipes (Automation)",description:"Build + run automation workflows: manage workflows, executions, and connector credentials",scopes:["pipes:read","pipes:write","pipes:execute","credentials:read","credentials:write"],recommended:!1},"pipes-readonly":{label:"Pipes \u2014 Read Only",description:"Observe automation: view workflows, executions, governance, and credential metadata \u2014 no changes",scopes:["pipes:read","credentials:read"],recommended:!0},"pipes-operator":{label:"Pipes \u2014 Operator",description:"Author and run workflows (read + write + execute) WITHOUT connector-credential management \u2014 separation of duties",scopes:["pipes:read","pipes:write","pipes:execute"],recommended:!1},"credentials-manager":{label:"Connector Credentials Manager",description:"Manage connector credentials only (read + write) \u2014 store/rotate/revoke secrets without workflow access",scopes:["credentials:read","credentials:write"],recommended:!1},"full-messaging":{label:"Full Events",description:"All Events operations including DLQ/ops, plus delivery + webhook management",scopes:["events:read","events:write","events:admin","deliveries:read","deliveries:write","webhooks:read","webhooks:write"],recommended:!1},"npp-wire":{label:"NPP Wire",description:"Per-app NPP DPoP key + hardware-attestation management",scopes:["npp:read","npp:admin"],recommended:!1},admin:{label:"Admin",description:"Full access: every concrete catalog scope enumerated (incl. the 4 execute scopes). Assign sparingly.",scopes:[...u],recommended:!1,dangerous:!0}},P=g.filter(e=>e.endsWith(":read"));var L=[...P,"org:metrics:read"];var D=g.filter(e=>l[e].tier==="developer"),F=g.filter(e=>e!=="org:billing:write"&&e!=="org:billing:admin"&&e!=="org:federation:admin"&&e!=="org:infrastructure:admin"&&e!=="org:apps:admin"&&e!=="org:feed:admin"&&e!==""&&e!==""),U=[...g];var I={"DELETE /v1/primus/agents/:agentId":["agents:admin"],"DELETE /v1/primus/brain/config":["brain:admin"],"DELETE /v1/primus/conversations/:conversationId":["conversations:admin"],"DELETE /v1/primus/memory/:memoryId":["memory:admin"],"DELETE /v1/primus/skills/:skillId":["skills:admin"],"DELETE /v1/primus/teams/:teamId":["teams:admin"],"DELETE /v1/primus/tools/:toolId":["tools:admin"],"DELETE /v1/primus/triggers/:triggerId":["triggers:admin"],"DELETE /v1/primus/webhooks/:webhookId":["agent_webhooks:write"],"GET /v1/primus/agent-goals":["agents:read"],"GET /v1/primus/agent-goals/:goalId":["agents:read"],"GET /v1/primus/agents":["agents:read"],"GET /v1/primus/agents/:agentId":["agents:read"],"GET /v1/primus/approvals":["approvals:read"],"GET /v1/primus/approvals/:approvalId":["approvals:read"],"GET /v1/primus/approvals/by-agent":["approvals:read"],"GET /v1/primus/approvals/pending":["approvals:read"],"GET /v1/primus/approvals/pending/count":["approvals:read"],"GET /v1/primus/approvals/pending/summary":["approvals:read"],"GET /v1/primus/brain/config":["brain:read"],"GET /v1/primus/brain/llm-dashboard":["brain:read"],"GET /v1/primus/brain/models":["brain:read"],"GET /v1/primus/brain/usage-dashboard":["brain:read"],"GET /v1/primus/config/export":["agents:admin"],"GET /v1/primus/conversations":["conversations:read"],"GET /v1/primus/conversations/:conversationId":["conversations:read"],"GET /v1/primus/conversations/:conversationId/messages":["conversations:read"],"GET /v1/primus/conversations/by-agent":["conversations:read"],"GET /v1/primus/conversations/stats":["conversations:read"],"GET /v1/primus/delegations/by-delegate":["agents:read"],"GET /v1/primus/delegations/by-delegator":["agents:read"],"GET /v1/primus/delegations/by-team":["agents:read"],"GET /v1/primus/entitlements":["agents:read"],"GET /v1/primus/executions":["executions:read"],"GET /v1/primus/executions/:executionId":["executions:read"],"GET /v1/primus/executions/:executionId/details":["executions:read"],"GET /v1/primus/executions/:executionId/events":["executions:read"],"GET /v1/primus/executions/:executionId/traces":["executions:read"],"GET /v1/primus/executions/by-agent":["executions:read"],"GET /v1/primus/executions/by-conversation":["executions:read"],"GET /v1/primus/executions/pending-approvals":["executions:read"],"GET /v1/primus/executions/stats":["executions:read"],"GET /v1/primus/integrations":["connections:read"],"GET /v1/primus/integrations/:connectionId":["connections:read"],"GET /v1/primus/kill-switch":["guardrails:read"],"GET /v1/primus/kill-switch/:killSwitchId":["guardrails:read"],"GET /v1/primus/kill-switch/active":["guardrails:read"],"GET /v1/primus/kill-switch/check":["guardrails:read"],"GET /v1/primus/kill-switch/status":["guardrails:read"],"GET /v1/primus/learning/feedback":["agents:read"],"GET /v1/primus/learning/feedback/by-agent":["agents:read"],"GET /v1/primus/learning/patterns":["agents:read"],"GET /v1/primus/learning/patterns/by-agent":["agents:read"],"GET /v1/primus/learning/predictions":["agents:read"],"GET /v1/primus/learning/proactive-actions":["agents:read"],"GET /v1/primus/learning/stats":["agents:read"],"GET /v1/primus/mcp-connections":["connections:read"],"GET /v1/primus/mcp-servers":["tools:read"],"GET /v1/primus/mcp-servers/:mcpServerId":["tools:read"],"GET /v1/primus/memories/:memoryId/encryption":["memory:read"],"GET /v1/primus/memory":["memory:read"],"GET /v1/primus/memory/:memoryId":["memory:read"],"GET /v1/primus/memory/by-agent":["memory:read"],"GET /v1/primus/memory/by-conversation":["memory:read"],"GET /v1/primus/memory/quarantined":["memory:read"],"GET /v1/primus/memory/recall":["memory:read"],"GET /v1/primus/memory/store/:memoryId/lineage":["memory:read"],"GET /v1/primus/memory/store/:memoryId/retrieval-history":["memory:read"],"GET /v1/primus/memory/store/by-team":["memory:read"],"GET /v1/primus/memory/store/list":["memory:read"],"GET /v1/primus/memory/store/quarantine-summary":["memory:read"],"GET /v1/primus/memory/store/quarantined":["memory:read"],"GET /v1/primus/metrics":["agents:read"],"GET /v1/primus/metrics/aggregate":["agents:read"],"GET /v1/primus/metrics/system":["agents:read"],"GET /v1/primus/observability/alerts":["agents:read"],"GET /v1/primus/observability/errors":["agents:read"],"GET /v1/primus/observability/errors/by-agent":["agents:read"],"GET /v1/primus/observability/errors/by-execution":["agents:read"],"GET /v1/primus/observability/errors/distribution":["agents:read"],"GET /v1/primus/observability/traces/:traceId":["agents:read"],"GET /v1/primus/overview/active-triggers":["agents:read"],"GET /v1/primus/overview/memory-health":["agents:read"],"GET /v1/primus/overview/metrics-summary":["agents:read"],"GET /v1/primus/overview/stats":["agents:read"],"GET /v1/primus/overview/top-agents":["agents:read"],"GET /v1/primus/self-knowledge":["agents:read"],"GET /v1/primus/self-knowledge/:knowledgeId":["agents:read"],"GET /v1/primus/skill-synthesis":["agents:read"],"GET /v1/primus/skill-synthesis/:skillId":["agents:read"],"GET /v1/primus/skill-synthesis/for-tool":["agents:read"],"GET /v1/primus/skills":["skills:read"],"GET /v1/primus/skills/:skillId":["skills:read"],"GET /v1/primus/skills/:skillId/executions":["skills:read"],"GET /v1/primus/skills/:skillId/stats":["skills:read"],"GET /v1/primus/skills/built-in":["skills:read"],"GET /v1/primus/skills/by-category":["skills:read"],"GET /v1/primus/teams":["teams:read"],"GET /v1/primus/teams/:teamId":["teams:read"],"GET /v1/primus/tenants":["tenants:read"],"GET /v1/primus/tenants/:tenantId":["tenants:read"],"GET /v1/primus/tenants/by-external-id":["tenants:read"],"GET /v1/primus/tools":["tools:read"],"GET /v1/primus/tools/:toolId":["tools:read"],"GET /v1/primus/tools/by-name":["tools:read"],"GET /v1/primus/tools/stats":["tools:read"],"GET /v1/primus/triggers":["triggers:read"],"GET /v1/primus/triggers/:triggerId":["triggers:read"],"GET /v1/primus/triggers/:triggerId/executions":["triggers:read"],"GET /v1/primus/triggers/by-agent":["triggers:read"],"GET /v1/primus/usage/by-tenant":["billing:read"],"GET /v1/primus/usage/history":["billing:read"],"GET /v1/primus/usage/limits":["billing:read"],"GET /v1/primus/usage/summary":["billing:read"],"GET /v1/primus/webhooks":["agent_webhooks:read"],"GET /v1/tools":["tools:read"],"PATCH /v1/primus/agent-goals/:goalId":["agents:write"],"PATCH /v1/primus/agents/:agentId":["agents:write"],"PATCH /v1/primus/conversations/:conversationId":["conversations:write"],"PATCH /v1/primus/memory/:memoryId":["memory:write"],"PATCH /v1/primus/skills/:skillId":["skills:write"],"PATCH /v1/primus/teams/:teamId":["teams:write"],"PATCH /v1/primus/tenants/:tenantId":["tenants:write"],"PATCH /v1/primus/tools/:toolId":["tools:write"],"PATCH /v1/primus/triggers/:triggerId":["triggers:write"],"POST /v1/primus/agent-goals":["agents:write"],"POST /v1/primus/agent-goals/:goalId/progress":["agents:write"],"POST /v1/primus/agent-goals/:goalId/status":["agents:write"],"POST /v1/primus/agents":["agents:write"],"POST /v1/primus/agents/:agentId/activate":["agents:write"],"POST /v1/primus/agents/:agentId/archive":["agents:admin"],"POST /v1/primus/agents/:agentId/invoke":["agents:execute"],"POST /v1/primus/agents/:agentId/pause":["agents:write"],"POST /v1/primus/agents/:agentId/run":["agents:execute"],"POST /v1/primus/agents/:agentId/skills/assign":["agents:write"],"POST /v1/primus/agents/:agentId/skills/unassign":["agents:write"],"POST /v1/primus/approvals":["approvals:write"],"POST /v1/primus/approvals/:approvalId/approve":["approvals:write"],"POST /v1/primus/approvals/:approvalId/reject":["approvals:write"],"POST /v1/primus/brain/models/refresh":["brain:write"],"POST /v1/primus/brain/provider-keys":["brain:write"],"POST /v1/primus/brain/provider-models":["brain:read"],"POST /v1/primus/chat/stream-pipeline":["executions:execute"],"POST /v1/primus/config/apply":["agents:admin"],"POST /v1/primus/conversations":["conversations:write"],"POST /v1/primus/conversations/:conversationId/archive":["conversations:admin"],"POST /v1/primus/conversations/:conversationId/send":["conversations:write"],"POST /v1/primus/executions":["executions:execute"],"POST /v1/primus/executions/:executionId/approve":["executions:admin"],"POST /v1/primus/executions/:executionId/cancel":["executions:execute"],"POST /v1/primus/executions/:executionId/reject":["executions:admin"],"POST /v1/primus/executions/batch":["executions:execute"],"POST /v1/primus/integrations/:connectionId/disconnect":["connections:write"],"POST /v1/primus/integrations/:connectionId/refresh":["connections:write"],"POST /v1/primus/integrations/connect":["connections:write"],"POST /v1/primus/kill-switch/activate":["guardrails:admin"],"POST /v1/primus/kill-switch/deactivate":["guardrails:admin"],"POST /v1/primus/learning/feedback":["agents:write"],"POST /v1/primus/learning/patterns/set-active":["agents:write"],"POST /v1/primus/learning/proactive-actions/decide":["agents:write"],"POST /v1/primus/mcp-connections/:credentialId/revoke":["connections:write"],"POST /v1/primus/mcp-servers":["tools:write"],"POST /v1/primus/mcp-servers/:mcpServerId/connect/begin":["connections:write"],"POST /v1/primus/mcp-servers/:mcpServerId/disconnect":["tools:admin"],"POST /v1/primus/mcp-servers/:mcpServerId/oauth/begin":["tools:write"],"POST /v1/primus/mcp-servers/:mcpServerId/oauth/client":["tools:admin"],"POST /v1/primus/mcp-servers/:mcpServerId/reconnect":["tools:write"],"POST /v1/primus/mcp-servers/:mcpServerId/rename":["tools:write"],"POST /v1/primus/mcp-servers/:mcpServerId/rotate-auth":["tools:admin"],"POST /v1/primus/mcp-servers/test":["tools:write"],"POST /v1/primus/memories/:memoryId/decrypt":["memory:read"],"POST /v1/primus/memories/:memoryId/reencrypt":["memory:write"],"POST /v1/primus/memory":["memory:write"],"POST /v1/primus/memory/:memoryId/quarantine":["memory:write"],"POST /v1/primus/memory/:memoryId/unquarantine":["memory:write"],"POST /v1/primus/memory/search":["memory:read"],"POST /v1/primus/memory/search/explain":["memory:read"],"POST /v1/primus/memory/store":["memory:write"],"POST /v1/primus/observability/alerts/acknowledge":["agents:write"],"POST /v1/primus/observability/alerts/resolve":["agents:write"],"POST /v1/primus/observability/errors/resolve":["agents:write"],"POST /v1/primus/self-knowledge":["agents:write"],"POST /v1/primus/self-knowledge/:knowledgeId/active":["agents:write"],"POST /v1/primus/self-knowledge/:knowledgeId/validate":["agents:write"],"POST /v1/primus/skill-synthesis/:skillId/promote":["agents:write"],"POST /v1/primus/skill-synthesis/run-pipeline":["agents:execute"],"POST /v1/primus/skills":["skills:write"],"POST /v1/primus/skills/:skillId/disable":["skills:write"],"POST /v1/primus/skills/:skillId/enable":["skills:write"],"POST /v1/primus/teams":["teams:write"],"POST /v1/primus/teams/assign":["teams:write"],"POST /v1/primus/teams/delegate":["teams:write"],"POST /v1/primus/teams/members":["teams:write"],"POST /v1/primus/teams/remove-member":["teams:admin"],"POST /v1/primus/teams/unassign":["teams:write"],"POST /v1/primus/teams/with-specialists":["teams:write"],"POST /v1/primus/tenants":["tenants:write"],"POST /v1/primus/tenants/:tenantId/archive":["tenants:admin"],"POST /v1/primus/tenants/:tenantId/suspend":["tenants:write"],"POST /v1/primus/tools":["tools:write"],"POST /v1/primus/tools/:toolId/disable":["tools:admin"],"POST /v1/primus/tools/:toolId/enable":["tools:write"],"POST /v1/primus/tools/:toolId/test":["tools:write"],"POST /v1/primus/tools/import":["tools:write"],"POST /v1/primus/triggers":["triggers:write"],"POST /v1/primus/triggers/:triggerId/disable":["triggers:write"],"POST /v1/primus/triggers/:triggerId/enable":["triggers:write"],"POST /v1/primus/triggers/:triggerId/test-fire":["triggers:write"],"POST /v1/primus/webhooks":["agent_webhooks:write"],"PUT /v1/primus/brain/config":["brain:write"]};var O={"agent-list":{label:"AgentList",ops:[{op:"GET /v1/primus/agents",phase:"mount"}],modeFloor:"custom",status:"live"},"agent-configurator":{label:"AgentConfigurator",ops:[{op:"POST /v1/primus/agents",phase:"action",action:"create",gatesMount:!0},{op:"PATCH /v1/primus/agents/:agentId",phase:"action",action:"update",gatesMount:!0}],modeFloor:"custom",status:"live"},chat:{label:"AgentChat",ops:[{op:"GET /v1/primus/conversations/by-agent",phase:"mount"},{op:"GET /v1/primus/conversations/:conversationId/messages",phase:"mount"},{op:"POST /v1/primus/conversations/:conversationId/send",phase:"action",action:"send",gatesMount:!0},{op:"POST /v1/primus/chat/stream-pipeline",phase:"action",action:"send",gatesMount:!0}],modeFloor:"custom",status:"live"},"run-timeline":{label:"RunTimeline",ops:[{op:"GET /v1/primus/executions",phase:"mount"},{op:"GET /v1/primus/executions/by-agent",phase:"mount"},{op:"GET /v1/primus/executions/by-conversation",phase:"mount"},{op:"GET /v1/primus/executions/:executionId/events",phase:"mount"},{op:"GET /v1/primus/executions/:executionId/traces",phase:"mount"}],modeFloor:"custom",status:"live"},"memory-browser":{label:"MemoryBrowser",ops:[{op:"GET /v1/primus/memory",phase:"mount"},{op:"GET /v1/primus/memory/by-agent",phase:"mount"},{op:"GET /v1/primus/memory/by-conversation",phase:"mount"}],modeFloor:"custom",status:"live"},"guardrails-panel":{label:"GuardrailsPanel",ops:[{op:"GET /v1/primus/kill-switch",phase:"mount"},{op:"GET /v1/primus/kill-switch/status",phase:"mount"},{op:"POST /v1/primus/kill-switch/activate",phase:"action",action:"decide",unwired:!0},{op:"POST /v1/primus/kill-switch/deactivate",phase:"action",action:"decide",unwired:!0}],modeFloor:"custom",status:"not-embeddable"},"approval-inbox":{label:"ApprovalInbox",ops:[{op:"GET /v1/primus/approvals/pending",phase:"mount"},{op:"GET /v1/primus/approvals/pending/summary",phase:"mount"},{op:"POST /v1/primus/approvals/:approvalId/approve",phase:"action",action:"decide"},{op:"POST /v1/primus/approvals/:approvalId/reject",phase:"action",action:"decide"}],modeFloor:"custom",status:"live"},skills:{label:"SkillsTab",ops:[{op:"GET /v1/primus/skills",phase:"mount"},{op:"GET /v1/primus/tools",phase:"mount"},{op:"POST /v1/primus/skills",phase:"action",action:"create"},{op:"POST /v1/primus/agents/:agentId/skills/assign",phase:"action",action:"create"},{op:"POST /v1/primus/agents/:agentId/skills/assign",phase:"action",action:"assign"},{op:"POST /v1/primus/agents/:agentId/skills/unassign",phase:"action",action:"unassign"}],modeFloor:"custom",status:"live"},connect:{label:"Connect",ops:[{op:"GET /v1/primus/mcp-connections",phase:"mount"},{op:"POST /v1/primus/mcp-servers/:mcpServerId/connect/begin",phase:"action",action:"connect"},{op:"POST /v1/primus/mcp-connections/:credentialId/revoke",phase:"action",action:"disconnect"}],modeFloor:"custom",status:"live"},primus:{label:"Primus",ops:[],composedOf:["agent-list","agent-configurator","chat","run-timeline","memory-browser","approval-inbox","skills"],modeFloor:"custom",status:"live"},"tenants.credentials":{label:"tenants.credentials",ops:[],modeFloor:"isolated",status:"not-built",rung:4,aspirationalScope:"tenants.credentials:admin",plannedScopes:[]}};function k(e){return I[e]}n(k,"scopesOf");var y=n(e=>[...new Set(e)].sort(),"sorted");function G(e){let r=new Set,o=new Map,i=[];for(let t of e.ops){let a=k(t.op);if(e.status!=="not-built"){if(t.phase==="mount"||t.gatesMount===!0)for(let c of a)r.add(c);if(t.phase==="action"){let c=t.action;if(c===void 0)throw new Error(`componentSource: action op "${t.op}" has no \`action\` key`);let p=o.get(c)??new Set;for(let S of a)p.add(S);o.set(c,p)}i.push(`${t.op} \u2192 ${a.join(", ")}`+(t.phase==="action"?` (action: ${t.action}${t.gatesMount?", gates mount":""})`:" (mount)")+(t.unwired?" (not offered by the component)":""))}}let s=Object.fromEntries([...o.entries()].map(([t,a])=>[t,y(a)]));return{label:e.label,requiredScopes:y(r),...e.composedOf?{composedOf:e.composedOf}:{},...Object.keys(s).length>0?{actionScopes:s}:{},modeFloor:e.modeFloor,status:e.status,...e.rung!==void 0?{rung:e.rung}:{},...e.aspirationalScope!==void 0?{aspirationalScope:e.aspirationalScope}:{},evidence:i}}n(G,"derive");var R=Object.freeze(Object.fromEntries(Object.entries(O).map(([e,r])=>[e,G(r)])));function w(e){let r=new Set,o=[],i=n(s=>{if(r.has(s))return;r.add(s);let t=R[s];if(t){if(t.composedOf){for(let a of t.composedOf)i(a);return}t.status==="live"&&o.push(t)}},"visit");for(let s of e)i(s);return o}n(w,"expandLive");function q(e){let r=new Set;for(let o of w(e))for(let i of o.requiredScopes)r.add(i);return[...r].sort()}n(q,"unionRequiredScopes");function j(e){let r=new Set;for(let o of w(e))for(let i of Object.values(o.actionScopes??{}))for(let s of i)r.add(s);return[...r].sort()}n(j,"unionActionScopes");var x=new Set(h),_=new Set(b),C=new Set(E),W=new Set(f);function d(e){return e.replace(/^org:/,"")}n(d,"toScopeForm");function v(e,r){return e.includes(r)}n(v,"hasScope");var N=new Set(u);function $(e){return typeof e!="string"||e.length===0||e==="*"||e.endsWith(":*")?!1:N.has(d(e))}n($,"isValidMachineScope");function A(e,r){let o=e.length,i=r.length,s=Array.from({length:i+1},(t,a)=>a);for(let t=1;t<=o;t++){let a=s[0];s[0]=t;for(let c=1;c<=i;c++){let p=s[c];s[c]=e[t-1]===r[c-1]?a:1+Math.min(a,s[c],s[c-1]),a=p}}return s[i]}n(A,"editDistance");function B(e){let r=d(e),o=null,i=1/0;for(let s of u){let t=A(r,s);t<i&&(i=t,o=s)}return o!==null&&i<=Math.max(2,Math.floor(r.length/2))?o:null}n(B,"suggestMachineScope");function H(e,r){let o=d(r),i=e.map(d);if(v(i,o))return!0;let[s,t]=o.split(":");return!(s==="events"||x.has(s))||!t?!1:!!(i.includes("events:admin")||t==="read"&&i.includes("events:read")||t==="write"&&i.includes("events:write")||(t==="read"||t==="write")&&i.includes(`${s}:admin`))}n(H,"eventsScopeSatisfies");function z(e,r){let o=d(r),i=e.map(d);if(v(i,o))return!0;let[s,t]=o.split(":");return!_.has(s)||!t?!1:!!(t!=="execute"&&i.includes("pipes:admin")||s==="credentials"&&i.includes("credentials:admin"))}n(z,"pipesScopeSatisfies");function K(e,r){let o=d(r),i=e.map(d);if(v(i,o))return!0;let[s,t]=o.split(":");return!(s==="connect"||C.has(s))||!t?!1:!!(i.includes("connect:admin")||t==="read"&&i.includes("connect:read")||t==="write"&&i.includes("connect:write")||(t==="read"||t==="write")&&i.includes(`${s}:admin`))}n(K,"connectScopeSatisfies");function X(e){let r=e.trim().toLowerCase();if(r==="authorization"||r==="proxy-authorization"||r==="auth"||r==="x-api-key"||r==="api-key"||r==="apikey"||r==="cookie"||r==="password"||r==="signature"||r.endsWith("-token")||r.endsWith("-secret")||r.endsWith("-api-key")||r.endsWith("-auth")||r.endsWith("-password")||r.endsWith("-secret-key")||r.endsWith("-access-key")||r.endsWith("-signing-key")||r.endsWith("-private-key"))return!0;let o=r.split("-");return o.includes("secret")||o.includes("token")?!0:/-signature(-[a-z0-9]+)?$/.test(r)}n(X,"isSecretHeaderName");export{R as a,q as b,j as c,$ as d,B as e,H as f,z as g,K as h,X as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-WWSPP7WV.mjs";import{a as f}from"./chunk-JWEUM2BU.mjs";import{a,e as p,f as d,j as l}from"./chunk-BPVBERWX.mjs";import{a as r}from"./chunk-LJNU5QHZ.mjs";import{existsSync as u,readFileSync as U}from"fs";import{join as s,resolve as c}from"path";function A(t){if(!u(t))return{};try{return l(U(t,"utf8"))}catch{return{}}}r(A,"dotenvAt");function h(t){try{return u(t)?U(t,"utf8"):void 0}catch{return}}r(h,"textAt");function y(t=process.cwd()){let e=c(t);for(let n=0;n<5;n+=1){if(u(s(e,".npayload.json")))return e;let o=s(e,"..");if(o===e)break;e=o}return c(t)}r(y,"projectRoot");var g=!1;function D(t){if(t!==void 0)return A(s(t,".env"));let e=c(process.cwd()),n=y(e);if(n!==e&&!g){let o=h(s(e,".env"));o!==void 0&&o!==h(s(n,".env"))&&(g=!0,process.stderr.write(`npayload: reading the project's .env (${s(n,".env")}), the one beside its .npayload.json, for this run's estate; the .env in ${e} differs and is not read.
|
|
2
|
+
`))}return A(s(n,".env"))}r(D,"projectDotenv");function L(t=[],e){return p([...d(process.env),...d(D(e),n=>`${n} in the project's .env`),...t])}r(L,"cliEstate");function R(t){return`${t==="auth host"?"Name that estate's auth host with NPAYLOAD_AUTH_URL, or name none so the CLI mints at that estate's API":t==="edge"?"Set NPAYLOAD_EDGE_URL to the edge of that estate":"Name that estate's API with NPAYLOAD_API_URL (the CLI dials no address the project's .env names: export it)"}, or name nothing outside npayload's production hosts to use its production estate.`}r(R,"cliCure");function m(t=[],e){return new f(L(t,e),R)}r(m,"cliGuard");function w(t){let e=m(t!==void 0?[["the lane gateway",t]]:[]),n=t??i(process.env.NPAYLOAD_API_URL,"apiUrl",a),v=i(process.env.NPAYLOAD_AUTH_URL,"authUrl")??(e.production?a:n);return{apiUrl:n,authUrl:v,guard:e}}r(w,"cliEndpoints");function I(t){let e=t??i(process.env.NPAYLOAD_AUTH_URL,"authUrl"),n=i(process.env.NPAYLOAD_API_URL,"apiUrl");return{base:(e??(m().production?void 0:n)??a).replace(/\/+$/,"")}}r(I,"cliSessionBase");export{D as a,m as b,w as c,I as d};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{b as R,c as $}from"./chunk-MDW42OG6.mjs";import{a as P}from"./chunk-EM46J3TV.mjs";import{a as y,b}from"./chunk-Z24VZ6HI.mjs";import{g as G,k as g,l as h,o as m,p as w}from"./chunk-ZYMM2PCZ.mjs";import{g as x}from"./chunk-YVGH2T7O.mjs";import{b as S}from"./chunk-IW34IJP4.mjs";import{a as c}from"./chunk-LJNU5QHZ.mjs";import{readFileSync as D,writeFileSync as k}from"fs";import a from"chalk";import{existsSync as u,readFileSync as _,watch as C}from"fs";import{resolve as I,join as d}from"path";function M(o){if(o){let e=I(process.cwd(),o);return u(e)?[e]:[]}let t=[];for(let e of["events","primus","pipes"])for(let n of[d("npayload",`${e}.config.ts`),`${e}.config.ts`]){let r=d(process.cwd(),n);u(r)&&t.push(r)}return t}c(M,"findAllConfigs");function F(o,t){if(u(o))try{for(let e of _(o,"utf8").split(`
|
|
2
|
+
`)){let n=e.trim();if(!n||n.startsWith("#"))continue;let r=n.indexOf("=");if(!(r===-1||n.slice(0,r).trim()!==t))return n.slice(r+1).trim().replace(/^["']|["']$/g,"")}}catch{}}c(F,"readEnvVar");function v(o){if(o)return o;let t=process.env.NPAYLOAD_APP_ID?.trim();if(t)return t;for(let e of[d(process.cwd(),".env"),d(process.cwd(),"npayload",".env")]){let n=F(e,"NPAYLOAD_APP_ID");if(n)return n}for(let e=process.cwd(),n=0;n<5;n++){let r=d(e,".npayload.json");if(u(r))try{let i=JSON.parse(_(r,"utf8"));if(typeof i.appId=="string"&&i.appId.trim())return i.appId.trim()}catch{}let s=d(e,"..");if(s===e)break;e=s}}c(v,"resolveAppGid");function Y(o,t,e=300,n){let r=null,s=c(()=>{r&&clearTimeout(r),r=setTimeout(()=>void t("change"),e)},"bump"),i=o.map(p=>C(p,s)),f=new Promise(p=>{process.on("SIGINT",()=>p())});return n===void 0?f:Promise.race([f,n.ended]).catch(p=>{r&&clearTimeout(r);for(let l of i)l.close();throw p})}c(Y,"watchConfigs");function A(o,t){return{...o!==void 0?{cwd:o}:{},components:t}}c(A,"floorOptions");function j(o,t){let e=G(o);e.length!==0&&t?.(a.dim(` (declared component(s) not embeddable \u2014 they contribute no scope: ${e.join(", ")})
|
|
3
|
+
`))}c(j,"reportInertComponents");async function T(o={}){let t=m(o.cwd),e=t?.path??w(o.cwd);if(!t||!e)throw new Error("no npayload.toml found \u2014 `np scopes fix` needs a manifest with an [access_scopes] block.");h(t.accessScopes);let n=o.floor??await y(A(o.cwd,t.embedComponents));j(t.embedComponents,o.log);let r=b(t.accessScopes,n),s=r.filter(l=>g(l)),i=r.filter(l=>!g(l));if(i.length>0&&o.log?.(a.dim(` (skipped ${i.length} non-catalog projection scope(s) \u2014 not declarable in [access_scopes]: ${i.join(", ")})
|
|
4
|
+
`)),s.length===0)return o.log?.(a.dim(` [access_scopes] already covers the projected floor \u2014 nothing to add.
|
|
5
|
+
`)),{appended:[],path:e,covered:!0};let f=D(e,"utf8"),p=$(f,t.accessScopes,s);return k(e,p,"utf8"),o.log?.(a.green(`\u2713 appended ${s.length} floor scope(s) to [access_scopes]:
|
|
6
|
+
${s.join(`
|
|
7
|
+
`)}
|
|
8
|
+
`)),{appended:s,path:e,covered:!0}}c(T,"runScopesFix");async function E(o={}){let t=m(o.cwd);if(!t)throw new Error("no npayload.toml found \u2014 `np scopes diff` needs a manifest with an [access_scopes] block.");h(t.accessScopes);let e=o.floor??await y(A(o.cwd,t.embedComponents)),n=o.appGid??v(),r=null;o.readRemoteGrant&&n&&(r=await o.readRemoteGrant(n));let s=P({declared:t.accessScopes,floor:e,remote:r??{scopes:[],configDrift:!1}}),i=o.log??(f=>process.stdout.write(f));switch(j(t.embedComponents,i),s.kind){case"floor-gap":i(a.yellow(`\u2717 [access_scopes] is missing ${s.gap.length} floor scope(s):
|
|
9
|
+
${s.gap.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`)),i(a.dim(" run `"+S("scopes fix")+"` to add them.\n"));break;case"conflict":i(a.yellow(`\u2717 remote grant has drifted from the manifest:
|
|
12
|
+
`)),i(a.dim(` manifest : ${s.diff.manifest.join(", ")||"(none)"}
|
|
13
|
+
`)),i(a.dim(` remote : ${s.diff.remote.join(", ")||"(none)"}
|
|
14
|
+
`)),i(a.dim(` resolve on push with --accept-remote or --overwrite-remote.
|
|
15
|
+
`));break;case"sync":i(a.green(`\u2713 [access_scopes] covers the floor and matches the remote grant (${s.grant.length} scope(s)).
|
|
16
|
+
`));break;case"accept-remote":i(a.green(`\u2713 resolvable via --accept-remote.
|
|
17
|
+
`));break}return s}c(E,"runScopesDiff");async function oe(o){let t=m(o.cwd),e=t?.path??w(o.cwd);if(!t||!e)return null;let n=o.appGid??v();if(!n)return null;let r=await o.readRemoteGrant(n);if(!r)return null;let s=[...new Set(r.scopes)].sort(),i=R(D(e,"utf8"),s);return k(e,i,"utf8"),o.log?.(a.green(`\u2713 pulled ${s.length} scope(s) from the remote grant into [access_scopes].
|
|
18
|
+
`)),{written:s,path:e}}c(oe,"pullScopesIntoManifest");async function O(o){let{restoreSession:t}=await import("./chunk-3RE3BK3W.mjs"),e=await t();return e?e.getOacGrant(o):null}c(O,"sessionGrantReader");function te(o){let t=o.command("scopes").description("Scopes-as-code: inspect and reconcile the manifest's [access_scopes] against the floor + the remote grant");t.command("diff").description("Show the floor gap + manifest\u21C4remote drift for [access_scopes]. Exit 0 in sync, 2 with a gap/conflict, 1 on error.").action(async()=>{try{let e=await E({readRemoteGrant:O});process.exit(e.kind==="sync"||e.kind==="accept-remote"?0:2)}catch(e){process.stderr.write(a.red(`${x(`scopes diff failed: ${e instanceof Error?e.message:String(e)}`,e)}
|
|
19
|
+
`)),process.exit(1)}}),t.command("fix").description("Append exactly the projected-floor gap to the manifest's [access_scopes] (idempotent)").action(async()=>{try{await T({log:c(e=>process.stdout.write(e),"log")}),process.exit(0)}catch(e){process.stderr.write(a.red(`scopes fix failed: ${e instanceof Error?e.message:String(e)}
|
|
20
|
+
`)),process.exit(1)}})}c(te,"registerScopes");export{M as a,v as b,Y as c,T as d,E as e,oe as f,te as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-K6H7MJ4W.mjs";import{a as n}from"./chunk-LJNU5QHZ.mjs";import{readFileSync as c}from"fs";import{join as l,dirname as a}from"path";import{fileURLToPath as u}from"url";var t="@npayload/sdk",m=`npx ${t}`;function E(r){return`${m} ${r}`}n(E,"runnable");var y=["@npayload/npayload"];function p(){try{let r=a(u(import.meta.url));for(let e=0;e<6;e++){try{let o=JSON.parse(c(l(r,"package.json"),"utf8"));if(o.name===t&&o.version)return o.version}catch{}let i=a(r);if(i===r)break;r=i}}catch{}return null}n(p,"resolveRuntimeVersion");function A(){return p()??s}n(A,"cliVersion");function R(){let r=p();return r?`${t}@${r}`:t}n(R,"installPinSpec");export{t as a,E as b,y as c,p as d,A as e,R as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as E,U as u,aa as T,w as R}from"./chunk-O7KSYRUO.mjs";import{a as h,d as g,e as m,g as U,h as k,i as b}from"./chunk-BPVBERWX.mjs";import{a as r}from"./chunk-LJNU5QHZ.mjs";var A=class e{constructor(n,t){this.estate=n;this.cureFor=t}static{r(this,"DialGuard")}get production(){return this.estate.other===void 0}refusal(n){let t=U(this.estate,n);return t===void 0?void 0:`${t}. ${this.cureFor(g(n))}`}noEdge(){let n=b(this.estate);return n===void 0?void 0:`${n}. ${this.cureFor("edge")}`}checkPages(...n){for(let t of n){let a=k(this.estate,t);if(a!==void 0)throw new u(y(`${a}. ${this.cureFor(g(t))}`))}}check(...n){for(let t of n){let a=this.refusal(t);if(a!==void 0)throw new u(y(a))}}with(n){return new e(m([...this.estate.named.map(t=>[t.source,t.url]),...n]),this.cureFor)}};function C(e,n){return E(t=>e.refusal(t),t=>new u(y(t)),n)}r(C,"guardedFetch");var D=Symbol("npayload.dial.refusal");function K(e){let n=new Error(e.message);return n.name="AbortError",n[D]=e,n}r(K,"carried");function $(e){return e instanceof Error?e[D]:void 0}r($,"refusalCarriedBy");function y(e){return e.charAt(0).toUpperCase()+e.slice(1)}r(y,"capitalised");var f=new WeakMap;function j(e){return f.get(e)?.guard}r(j,"guardOf");function H(e){return f.get(e)?.tokenUrl}r(H,"tokenUrlOf");function L(e){return f.get(e)?.apiUrl}r(L,"apiUrlOf");function v(e){return`${(e.authUrl??e.baseUrl??h).replace(/\/+$/,"")}/oauth/token`}r(v,"tokenEndpointOf");function F(e,n){let t=n.path;for(let[a,d]of Object.entries(n.pathParams??{}))t=t.replace(`{${a}}`,encodeURIComponent(d));return e.replace(/\/+$/,"")+t}r(F,"requestUrl");function S(e,n){let t=C(n),a,d={fetch:r(async o=>{try{return await t(o.url,{method:o.method,headers:o.headers,body:o.body??null,...o.signal!==void 0?{signal:o.signal}:{},...a!==void 0?{dispatcher:a}:{}})}catch(i){throw i instanceof u?K(i):I(i)}},"fetch")},s=new R({config:{...e,httpClient:d}});a=s.dispatcher;let p=v(e),w=e.baseUrl??h;f.set(s,{guard:n,tokenUrl:p,apiUrl:w});let c=s.auth;if(c!==void 0&&typeof c.getAccessToken=="function"){let o=c;typeof o.fetchImpl=="function"&&(o.fetchImpl=C(n,o.fetchImpl));let i=c.getAccessToken.bind(c);c.getAccessToken=async l=>(n.check(p),i(l))}if(typeof s.send=="function"){let o=s.send.bind(s);s.send=(async i=>{n.check(p,F(w,i));try{return await o(i)}catch(l){throw $(l)??l}})}return s}r(S,"dialKernel");function I(e){if(!(e instanceof TypeError))return e;let n=e.cause,t=n instanceof Error?n.message:typeof n=="string"?n:void 0;return t===void 0||t===""||e.message.includes(t)?e:new TypeError(`${e.message}: ${t}`,{cause:n})}r(I,"withDialReason");function _(e){if(e instanceof u)throw e}r(_,"rethrowRefusal");function N(e,n){T(e,t=>n.refusal(t))}r(N,"guardTransport");export{A as a,C as b,j as c,H as d,L as e,v as f,S as g,_ as h,N as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h}from"./chunk-VC3Y57EV.mjs";import"./chunk-F5PMOFZY.mjs";import"./chunk-OGXDRDCJ.mjs";import"./chunk-WWSPP7WV.mjs";import"./chunk-XVZEP6PT.mjs";import"./chunk-BPVBERWX.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{b as isPlainOrReservedDoor,a as isSafeWebhookUrl,c as resolveUrlPosture,d as validateConfig,g as validateConnectConfig,e as validateEventsConfig,f as validatePipesConfig,h as validatePrimusConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="6.1.1";var t=e,i="npayload",o=`${i}/${t}`;export{t as a,i as b,o as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-LJNU5QHZ.mjs";var t="
|
|
1
|
+
import{a as e}from"./chunk-LJNU5QHZ.mjs";var t="6505cc30387b87671ad3da5e95269788ca649dc53627971dcb01603d2548caf2";function s(n){return n}e(s,"defineEventsConfig");var r={channels:{identity:"slug",deps:[],refs:{},ops:{archive:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelId/archive",scopes:["channels:admin"],pathParams:{channelId:"channelGid"}},create:{convexFn:"",method:"POST",pattern:"/v1/apps/channels",scopes:["channels:write"]},list:{convexFn:"",method:"GET",pattern:"/v1/apps/channels",scopes:["channels:read"]},pause:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelId/pause",scopes:["channels:write"],pathParams:{channelId:"channelGid"}},remove:{convexFn:"",method:"DELETE",pattern:"/v1/channels/:channelId",scopes:["channels:admin"],pathParams:{channelId:"channelGid"}},resume:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelId/resume",scopes:["channels:write"],pathParams:{channelId:"channelGid"}},update:{convexFn:"",method:"PATCH",pattern:"/v1/channels/:channelId",scopes:["channels:write"],pathParams:{channelId:"channelGid"},updatable:["complianceClass","nppMinQos","rateLimit","name","description","status","schema","settings","privacy","replication","compactionConfig","schemaValidation","platformConnectEnforcement","metadata","pii"]}}},consumerGroups:{identity:"name",deps:["channels"],refs:{channelGid:{parent:"channels",product:"events",wire:"gid",identity:"slug",array:!1,publicField:"channelGid"}},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelGid/consumer-groups",scopes:["consumer_groups:write"],pathParams:{channelGid:"channelGid"}},join:{convexFn:"",method:"POST",pattern:"/v1/consumer-groups/:consumerGroupGid/members",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid"},updatable:["subscriptionGid"]},leave:{convexFn:"",method:"DELETE",pattern:"/v1/consumer-groups/:consumerGroupGid/members/:subscriptionGid",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid",subscriptionGid:"subscriptionGid"}},list:{convexFn:"",method:"GET",pattern:"/v1/channels/:channelGid/consumer-groups",scopes:["consumer_groups:read"],pathParams:{channelGid:"channelGid"}},pause:{convexFn:"",method:"POST",pattern:"/v1/consumer-groups/:consumerGroupGid/pause",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid"}},resume:{convexFn:"",method:"POST",pattern:"/v1/consumer-groups/:consumerGroupGid/resume",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid"}},update:{convexFn:"",method:"PATCH",pattern:"/v1/consumer-groups/:consumerGroupGid",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid"},updatable:["strategy","maxConcurrency"]}}},eventTypes:{identity:"name",deps:["channels"],refs:{channels:{parent:"channels",product:"events",wire:"gid",identity:"slug",array:!0,publicField:"channels"}},ops:{activate:{convexFn:"",method:"POST",pattern:"/v1/events/types/:eventTypeGid/activate",scopes:["catalogue:write"],pathParams:{eventTypeGid:"eventTypeGid"}},deprecate:{convexFn:"",method:"POST",pattern:"/v1/events/types/:eventTypeGid/deprecate",scopes:["catalogue:admin"],pathParams:{eventTypeGid:"eventTypeGid"},updatable:["message","sunsetDate"]},list:{convexFn:"",method:"GET",pattern:"/v1/apps/events/types",scopes:["catalogue:read"]},create:{convexFn:"",method:"POST",pattern:"/v1/apps/events/types",scopes:["catalogue:write"]},registerVersion:{convexFn:"",method:"POST",pattern:"/v1/events/types/:eventTypeGid/versions",scopes:["catalogue:write"],pathParams:{eventTypeGid:"eventTypeGid"},updatable:["version","schema","compatibility","changelog","publishedBy"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/events/types/:eventTypeGid",scopes:["catalogue:write"],pathParams:{eventTypeGid:"eventTypeGid"},updatable:["displayName","description","ownership","channels","tags","schema"]}}},exchanges:{identity:"name",deps:[],refs:{},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/exchanges",scopes:["exchanges:write"]},createBinding:{convexFn:"",method:"POST",pattern:"/v1/exchanges/:exchange_gid/bindings",scopes:["exchanges:write"],pathParams:{exchange_gid:"exchangeGid"},updatable:["channelGid","routingKey","headerRules"]},pause:{convexFn:"",method:"POST",pattern:"/v1/exchanges/:exchange_gid/disable",scopes:["exchanges:write"],pathParams:{exchange_gid:"exchangeGid"}},resume:{convexFn:"",method:"POST",pattern:"/v1/exchanges/:exchange_gid/enable",scopes:["exchanges:write"],pathParams:{exchange_gid:"exchangeGid"}},list:{convexFn:"",method:"GET",pattern:"/v1/exchanges",scopes:["exchanges:read"]},remove:{convexFn:"",method:"DELETE",pattern:"/v1/exchanges/:exchange_gid",scopes:["exchanges:admin"],pathParams:{exchange_gid:"exchangeGid"}},removeBinding:{convexFn:"",method:"DELETE",pattern:"/v1/exchange-bindings/:binding_gid",scopes:["exchanges:write"],pathParams:{binding_gid:"bindingGid"}},update:{convexFn:"",method:"PATCH",pattern:"/v1/exchanges/:exchange_gid",scopes:["exchanges:write"],pathParams:{exchange_gid:"exchangeGid"},updatable:["config"]}}},subscriptions:{identity:"name",deps:["channels"],refs:{channelGid:{parent:"channels",product:"events",wire:"gid",identity:"slug",array:!1,publicField:"channelGid"}},ops:{archive:{convexFn:"",method:"POST",pattern:"/v1/subscriptions/:subscriptionId/archive",scopes:["subscriptions:write"],pathParams:{subscriptionId:"subscriptionGid"}},create:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelId/subscriptions",scopes:["subscriptions:write"],pathParams:{channelId:"channelGid"}},list:{convexFn:"",method:"GET",pattern:"/v1/channels/:channelId/subscriptions",scopes:["subscriptions:read"],pathParams:{channelId:"channelGid"}},pause:{convexFn:"",method:"POST",pattern:"/v1/subscriptions/:subscriptionId/pause",scopes:["subscriptions:write"],pathParams:{subscriptionId:"subscriptionGid"}},remove:{convexFn:"",method:"DELETE",pattern:"/v1/subscriptions/:subscriptionId",scopes:["subscriptions:admin"],pathParams:{subscriptionId:"subscriptionGid"}},resume:{convexFn:"",method:"POST",pattern:"/v1/subscriptions/:subscriptionId/resume",scopes:["subscriptions:write"],pathParams:{subscriptionId:"subscriptionGid"}},update:{convexFn:"",method:"PATCH",pattern:"/v1/subscriptions/:subscriptionId",scopes:["subscriptions:write"],pathParams:{subscriptionId:"subscriptionGid"},updatable:["description","status","filter","endpoint","delivery","dlq","metadata","deliveryConfig","transformPipeId","transformTimeout","transformOnFailure"]}}}};var o="41cca5221cf2d3f14ebe43426ffadbc50816dfa8db8d6325205687a732db66dc";function c(n){return n}e(c,"definePrimusConfig");var p={agents:{identity:"slug",deps:["skills"],refs:{skills:{parent:"skills",product:"primus",wire:"gid",identity:"name",array:!0,publicField:"skills"}},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/primus/agents",scopes:["agents:write"]},list:{convexFn:"",method:"GET",pattern:"/v1/primus/agents",scopes:["agents:read"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/primus/agents/:agentId",scopes:["agents:write"],pathParams:{agentId:"agentGid"},updatable:["name","description","systemPrompt","personality","language","skills","enabledIntegrations","trustLevel","defaultModel","maxTurns","config"]}}},skills:{identity:"slug",deps:[],refs:{},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/primus/skills",scopes:["skills:write"]},list:{convexFn:"",method:"GET",pattern:"/v1/primus/skills",scopes:["skills:read"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/primus/skills/:skillId",scopes:["skills:write"],pathParams:{skillId:"skillGid"},updatable:["name","description","category","icon","executor","enabled","definition","limits"]}}},tools:{identity:"slug",deps:[],refs:{},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/primus/tools",scopes:["tools:write"]},list:{convexFn:"",method:"GET",pattern:"/v1/primus/tools",scopes:["tools:read"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/primus/tools/:toolId",scopes:["tools:write"],pathParams:{toolId:"toolGid"},updatable:["description","parameters","outputSchema","riskLevel","requiresApproval","endpoint","executor","timeout","category","secretRef","headers"]}}},triggers:{identity:"slug",deps:["agents"],refs:{agentGid:{parent:"agents",product:"primus",wire:"gid",identity:"slug",array:!1,publicField:"agentGid"}},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/primus/triggers",scopes:["triggers:write"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/primus/triggers/:triggerId",scopes:["triggers:write"],pathParams:{triggerId:"triggerGid"},updatable:["name","description","config","action","conditions","enabled"]},list:{convexFn:"",method:"GET",pattern:"/v1/primus/triggers",scopes:["triggers:read"]}}}};export{t as a,s as b,r as c,o as d,c as e,p as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-QXEFKQAF.mjs";import{a as i}from"./chunk-LJNU5QHZ.mjs";function n(s){return!!s&&Object.keys(s).length>0}i(n,"nonEmpty");function a(){let s={};for(let e of c.commands)if(e.key.split(".")[0]==="events")for(let r of e.scopes??[]){let[d,t]=r.split(":");!d||!t||d!=="events"&&(s[d]??=new Set).add(t)}return s}i(a,"enforcedVerbsByResource");var g=a();function o(s,e){for(let r of g[e]??[])s.add(`${e}:${r}`)}i(o,"grantAll");function l(s){let e=new Set,r=s.channels??{},d=s.subscriptions??{};if(n(r)){for(let t of["channels","messages","scheduled","snapshots","consumer_groups","dlq","archive","time_travel","storage_policies"])o(e,t);for(let t of Object.values(r))t&&(t.type==="stream"&&o(e,"streams"),(t.retentionMode==="compacted"||t.retentionMode==="compacted_with_log")&&o(e,"kv"))}if(n(d))for(let t of["subscriptions","dlq","snapshots"])o(e,t);return n(s.eventTypes)&&o(e,"catalogue"),n(s.exchanges)&&o(e,"exchanges"),n(s.crossChannels)&&o(e,"cross_channels"),e.size>0&&o(e,"keys"),[...e].sort()}i(l,"projectPermissions");function p(s){let e=new Set;return n(s.workflows)&&(e.add("pipes:read"),e.add("pipes:write"),e.add("pipes:execute")),n(s.credentials)&&(e.add("credentials:read"),e.add("credentials:write")),[...e].sort()}i(p,"projectPipesPermissions");function f(s){let e=new Set;if(n(s.agents))for(let r of["agents:read","agents:write","executions:read","executions:execute","conversations:read","conversations:write","memory:read","memory:write"])e.add(r);return n(s.skills)&&(e.add("skills:read"),e.add("skills:write")),n(s.tools)&&(e.add("tools:read"),e.add("tools:write")),n(s.triggers)&&(e.add("triggers:read"),e.add("triggers:write")),n(s.teams)&&(e.add("teams:read"),e.add("teams:write"),e.add("agents:read")),[...e].sort()}i(f,"projectPrimusPermissions");export{l as a,p as b,f as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as c,B as d,C as e,D as f,E as g,F as h,G as i,H as j,I as k,J as l,K as m,L as n,M as o,N as p,O as q,P as r,Q as s,R as t,S as u,T as v,y as a,z as b}from"./chunk-ZYMM2PCZ.mjs";import"./chunk-OGXDRDCJ.mjs";import"./chunk-ROYJNUAJ.mjs";import"./chunk-4NWQCPI4.mjs";import"./chunk-CJDCY2NH.mjs";import"./chunk-MKQUL5LA.mjs";import"./chunk-7AZ3YJ62.mjs";import"./chunk-YVGH2T7O.mjs";import"./chunk-IA5ADBRQ.mjs";import"./chunk-WWSPP7WV.mjs";import"./chunk-XF6XPU25.mjs";import"./chunk-XVZEP6PT.mjs";import"./chunk-JWEUM2BU.mjs";import"./chunk-O7KSYRUO.mjs";import"./chunk-BPVBERWX.mjs";import"./chunk-IW34IJP4.mjs";import"./chunk-HNHTAV57.mjs";import"./chunk-K6H7MJ4W.mjs";import"./chunk-LJNU5QHZ.mjs";export{c as READ_ONLY_SEND_BUDGET,h as assertPlanHasNoFailures,v as assertPushHasNoRawSecretHeaders,d as buildKernel,j as canonicalEntryOrder,k as canonicalPlan,o as changedFields,m as envFromCommandLine,g as failedRows,u as findConfig,a as findConfigForProduct,p as immutableDrift,q as isAlreadyExistsError,b as loadEventsConfig,f as planCreatePathParams,i as planThenApply,s as registerDeploy,e as resolveAppIdPublic,r as resolveExistingByIdentity,t as runDeploy,n as syncExitCode,l as yesFromCommandLine};
|