reflex-agent 0.18.2 → 0.19.0
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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +101 -102
- package/.next/app-path-routes-manifest.json +9 -9
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/required-server-files.json +2 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +2 -2
- package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route.js +2 -2
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route.js +0 -0
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +2 -2
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js.nft.json +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/install-archive/route_client-reference-manifest.js +1 -1
- package/.next/server/app/audit/page.js +2 -2
- package/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/dispatcher/page.js +2 -2
- package/.next/server/app/dispatcher/page.js.nft.json +1 -1
- package/.next/server/app/dispatcher/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +3 -3
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/memory/page.js +2 -2
- package/.next/server/app/roots/[id]/memory/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/memory/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/page.js +4 -4
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +4 -4
- package/.next/server/app/roots/new/page.js.nft.json +1 -1
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +5 -5
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -2
- package/.next/server/app/utilities/page.js.nft.json +1 -1
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +9 -9
- package/.next/server/chunks/{6435.js → 1088.js} +1 -1
- package/.next/server/chunks/1105.js +1 -1
- package/.next/server/chunks/1179.js +1 -0
- package/.next/server/chunks/1223.js +1 -1
- package/.next/server/chunks/1244.js +1 -1
- package/.next/server/chunks/1281.js +80 -0
- package/.next/server/chunks/1336.js +252 -0
- package/.next/server/chunks/1353.js +51 -0
- package/.next/server/chunks/1431.js +1 -0
- package/.next/server/chunks/146.js +2 -0
- package/.next/server/chunks/1491.js +79 -0
- package/.next/server/chunks/1496.js +148 -0
- package/.next/server/chunks/{9631.js → 1589.js} +2 -2
- package/.next/server/chunks/1623.js +1 -0
- package/.next/server/chunks/1862.js +77 -0
- package/.next/server/chunks/1888.js +1 -1
- package/.next/server/chunks/1908.js +1 -0
- package/.next/server/chunks/192.js +1 -0
- package/.next/server/chunks/2069.js +1 -0
- package/.next/server/chunks/2087.js +24 -0
- package/.next/server/chunks/209.js +1 -0
- package/.next/server/chunks/2115.js +77 -0
- package/.next/server/chunks/2232.js +80 -0
- package/.next/server/chunks/{4460.js → 2262.js} +2 -2
- package/.next/server/chunks/2280.js +1 -0
- package/.next/server/chunks/2433.js +1 -1
- package/.next/server/chunks/2485.js +3 -8
- package/.next/server/chunks/2503.js +1 -1
- package/.next/server/chunks/2539.js +93 -0
- package/.next/server/chunks/2764.js +80 -0
- package/.next/server/chunks/285.js +24 -75
- package/.next/server/chunks/2888.js +7 -0
- package/.next/server/chunks/302.js +1 -0
- package/.next/server/chunks/3029.js +36 -0
- package/.next/server/chunks/3110.js +0 -0
- package/.next/server/chunks/3117.js +1 -0
- package/.next/server/chunks/3258.js +23 -0
- package/.next/server/chunks/331.js +1 -0
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/{4251.js → 3474.js} +24 -25
- package/.next/server/chunks/3552.js +43 -0
- package/.next/server/chunks/3583.js +104 -0
- package/.next/server/chunks/3631.js +1 -0
- package/.next/server/chunks/3633.js +1 -0
- package/.next/server/chunks/383.js +1 -80
- package/.next/server/chunks/3834.js +1 -1
- package/.next/server/chunks/3953.js +1 -0
- package/.next/server/chunks/3992.js +1 -0
- package/.next/server/chunks/4013.js +1 -0
- package/.next/server/chunks/4031.js +3 -3
- package/.next/server/chunks/4119.js +1 -0
- package/.next/server/chunks/4230.js +12 -0
- package/.next/server/chunks/4250.js +1 -0
- package/.next/server/chunks/4294.js +1 -0
- package/.next/server/chunks/4312.js +1 -0
- package/.next/server/chunks/4342.js +1 -0
- package/.next/server/chunks/4360.js +1 -0
- package/.next/server/chunks/449.js +226 -0
- package/.next/server/chunks/4578.js +0 -0
- package/.next/server/chunks/4585.js +1 -0
- package/.next/server/chunks/4611.js +1 -1
- package/.next/server/chunks/4639.js +1 -0
- package/.next/server/chunks/4682.js +1 -0
- package/.next/server/chunks/4788.js +153 -0
- package/.next/server/chunks/4812.js +2 -2
- package/.next/server/chunks/4925.js +1 -1
- package/.next/server/chunks/4952.js +1 -0
- package/.next/server/chunks/4969.js +4 -1
- package/.next/server/chunks/4989.js +801 -0
- package/.next/server/chunks/5211.js +64 -0
- package/.next/server/chunks/5243.js +1 -1
- package/.next/server/chunks/5308.js +1 -0
- package/.next/server/chunks/5461.js +1 -0
- package/.next/server/chunks/5549.js +1 -0
- package/.next/server/chunks/5719.js +34 -0
- package/.next/server/chunks/5810.js +12 -0
- package/.next/server/chunks/5922.js +1 -0
- package/.next/server/chunks/6142.js +1 -1
- package/.next/server/chunks/6216.js +1 -1
- package/.next/server/chunks/6318.js +9 -0
- package/.next/server/chunks/6483.js +1 -1
- package/.next/server/chunks/6509.js +1 -0
- package/.next/server/chunks/6571.js +166 -0
- package/.next/server/chunks/660.js +1 -0
- package/.next/server/chunks/6692.js +1 -0
- package/.next/server/chunks/6730.js +1 -1
- package/.next/server/chunks/6852.js +1 -0
- package/.next/server/chunks/6970.js +1 -0
- package/.next/server/chunks/7007.js +1 -0
- package/.next/server/chunks/7188.js +1 -1
- package/.next/server/chunks/7220.js +1 -1
- package/.next/server/chunks/7228.js +1 -0
- package/.next/server/chunks/7244.js +1 -0
- package/.next/server/chunks/7373.js +90 -0
- package/.next/server/chunks/7430.js +1 -1
- package/.next/server/chunks/7523.js +1 -0
- package/.next/server/chunks/7576.js +1 -0
- package/.next/server/chunks/7742.js +7 -0
- package/.next/server/chunks/7811.js +215 -0
- package/.next/server/chunks/7885.js +1 -0
- package/.next/server/chunks/8032.js +3 -0
- package/.next/server/chunks/8095.js +24 -0
- package/.next/server/chunks/8129.js +5 -0
- package/.next/server/chunks/8294.js +1 -0
- package/.next/server/chunks/832.js +1 -0
- package/.next/server/chunks/8464.js +180 -0
- package/.next/server/chunks/8511.js +0 -0
- package/.next/server/chunks/8514.js +1 -1
- package/.next/server/chunks/8583.js +4 -0
- package/.next/server/chunks/8609.js +55 -0
- package/.next/server/chunks/8711.js +1 -0
- package/.next/server/chunks/8714.js +1 -0
- package/.next/server/chunks/8730.js +1 -0
- package/.next/server/chunks/8868.js +1 -0
- package/.next/server/chunks/9048.js +1 -0
- package/.next/server/chunks/9058.js +1 -0
- package/.next/server/chunks/9062.js +1 -0
- package/.next/server/chunks/9094.js +1 -0
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/9099.js +1 -0
- package/.next/server/chunks/9171.js +287 -0
- package/.next/server/chunks/9181.js +1 -0
- package/.next/server/chunks/9293.js +1 -1
- package/.next/server/chunks/9478.js +1 -0
- package/.next/server/chunks/9494.js +141 -0
- package/.next/server/chunks/952.js +1 -0
- package/.next/server/chunks/9600.js +1 -0
- package/.next/server/chunks/9607.js +29 -0
- package/.next/server/chunks/9653.js +115 -0
- package/.next/server/chunks/9784.js +1 -0
- package/.next/server/chunks/9798.js +1 -0
- package/.next/server/chunks/9990.js +1 -0
- package/.next/server/edge-instrumentation.js +2 -0
- package/.next/server/edge-instrumentation.js.map +1 -0
- package/.next/server/functions-config-manifest.json +3 -3
- package/.next/server/instrumentation.js +1 -0
- package/.next/server/instrumentation.js.nft.json +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +6 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_error.js +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/3363-f417b308a8cd156d.js +1 -0
- package/.next/static/chunks/3686-0107521d2c14950c.js +1 -0
- package/.next/static/chunks/3695-3576767108de7f38.js +1 -0
- package/.next/static/chunks/4108.19abaa6d618295ed.js +1 -0
- package/.next/static/chunks/5933-4013a6dab4565b5e.js +1 -0
- package/.next/static/chunks/7425-9684ea815b4b1731.js +1 -0
- package/.next/static/chunks/7552-def8a17828891c8c.js +1 -0
- package/.next/static/chunks/8776-2df966dd98c68fd7.js +1 -0
- package/.next/static/chunks/app/layout-baad68d32b917b8f.js +1 -0
- package/.next/static/chunks/app/onboarding/page-b1b1e6a4467ed781.js +1 -0
- package/.next/static/chunks/app/page-556a2139313c3c71.js +1 -0
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-52223811258d07b2.js +1 -0
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-0df769f27549cd16.js +1 -0
- package/.next/static/chunks/app/roots/[id]/memory/{page-4edc11023d8a13fd.js → page-1f6bc3a624b141a5.js} +1 -1
- package/.next/static/chunks/app/roots/[id]/page-17493991b2d391b3.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-a21fe3541418a80a.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/page-0952e5fb53d53c3e.js +1 -0
- package/.next/static/chunks/app/roots/new/{page-98d64261cc2ae2a1.js → page-4f571184c1856103.js} +1 -1
- package/.next/static/chunks/app/settings/page-8c0ad1c1856da988.js +1 -0
- package/.next/static/chunks/app/share/[id]/page-b27a0bc7b9c6cda9.js +1 -0
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-0fe4c377098064d5.js +1 -0
- package/.next/static/chunks/app/utilities/page-445933dcd5a500ae.js +1 -0
- package/.next/static/chunks/{webpack-dbfe1e5d0f7f7a98.js → webpack-88066a85eb2d605f.js} +1 -1
- package/.next/trace +116 -90
- package/dist/lib/reflex/ids.js +66 -0
- package/dist/lib/reflex/ids.js.map +1 -0
- package/dist/lib/reflex/paths.js +26 -0
- package/dist/lib/reflex/paths.js.map +1 -1
- package/dist/lib/reflex/store/json-store.js +50 -0
- package/dist/lib/reflex/store/json-store.js.map +1 -0
- package/package.json +10 -6
- package/.next/server/chunks/133.js +0 -1
- package/.next/server/chunks/1358.js +0 -1
- package/.next/server/chunks/2389.js +0 -4
- package/.next/server/chunks/2787.js +0 -1
- package/.next/server/chunks/3240.js +0 -1
- package/.next/server/chunks/3295.js +0 -1
- package/.next/server/chunks/4842.js +0 -1
- package/.next/server/chunks/5319.js +0 -1
- package/.next/server/chunks/5543.js +0 -1
- package/.next/server/chunks/569.js +0 -1
- package/.next/server/chunks/6356.js +0 -3
- package/.next/server/chunks/7229.js +0 -2
- package/.next/server/chunks/7607.js +0 -1
- package/.next/server/chunks/8040.js +0 -1
- package/.next/server/chunks/8124.js +0 -1
- package/.next/server/chunks/8576.js +0 -7
- package/.next/server/chunks/9809.js +0 -1
- package/.next/server/chunks/9835.js +0 -1
- package/.next/static/chunks/2885-3b6efe9070ae7699.js +0 -1
- package/.next/static/chunks/334-e9ffb96d6720ee5b.js +0 -1
- package/.next/static/chunks/4108.a04c1e0b768f6392.js +0 -1
- package/.next/static/chunks/5371-f2503fe0dffea57d.js +0 -1
- package/.next/static/chunks/5744-eccd279a734c778c.js +0 -1
- package/.next/static/chunks/6568-e4d2de23d9f8d347.js +0 -1
- package/.next/static/chunks/6642-02be14d0b5ca62b7.js +0 -1
- package/.next/static/chunks/8566-5d4c89b722d9cee1.js +0 -1
- package/.next/static/chunks/8775-890699c74c28df61.js +0 -1
- package/.next/static/chunks/app/layout-48a6fb46c228b814.js +0 -1
- package/.next/static/chunks/app/onboarding/page-06103f281ff3f063.js +0 -1
- package/.next/static/chunks/app/page-eed31ba1b952cf24.js +0 -1
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-5fc17c5819406917.js +0 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-a52b2005a7e538ca.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-0f0d498f4b4bd7bf.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-f93d6b1bb29e79f0.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/page-562913d54bcd08d5.js +0 -1
- package/.next/static/chunks/app/settings/page-7a4d8a407fbe5ed8.js +0 -1
- package/.next/static/chunks/app/share/[id]/page-a0540dba09771e84.js +0 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-2cee9be029f211c6.js +0 -1
- package/.next/static/chunks/app/utilities/page-197156f16167514e.js +0 -1
- /package/.next/static/{kKiRbrTiD77WXduAvKNfN → EXoiX_YvMRCB6oNXqJnaz}/_buildManifest.js +0 -0
- /package/.next/static/{kKiRbrTiD77WXduAvKNfN → EXoiX_YvMRCB6oNXqJnaz}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=1888,exports.ids=[94,1223,1888],exports.modules={1223:(a,b,c)=>{c.d(b,{De:()=>u,Dt:()=>s,Sh:()=>r,cL:()=>p,getOAuthTokens:()=>t,gi:()=>v,tY:()=>q});var d=c(73024),e=c(76760),f=c.n(e),g=c(10094),h=c(73652);let i=f().join((0,h._)(),"oauth"),j=f().join(i,"clients"),k=f().join(i,"tokens");function l(a){return f().join(j,`${a}.json`)}function m(a){return f().join(k,`${a}.json`)}async function n(a,b){await d.promises.mkdir(f().dirname(a),{recursive:!0}),await d.promises.writeFile(a,JSON.stringify(b,null,2)+"\n",{encoding:"utf8",mode:384});try{await d.promises.chmod(a,384)}catch{}}async function o(a){try{let b=await d.promises.readFile(a,"utf8");return JSON.parse(b)}catch{return null}}async function p(a,b){let{getOAuthProvider:d}=await Promise.resolve().then(c.bind(c,10094));if(!await d(a))throw Error(`unknown provider: ${a}`);await n(l(a),{...b,updatedAt:new Date().toISOString()})}async function q(a){return o(l(a))}async function r(a){try{await d.promises.unlink(l(a))}catch{}}async function s(a,b){await n(m(a),{...b,updatedAt:new Date().toISOString()})}async function t(a){return o(m(a))}async function u(a){try{await d.promises.unlink(m(a))}catch{}}async function v(){let a=[];for(let b of(await (0,g.E4)())){let c=b.def,d=await q(c.id),e=await t(c.id);a.push({id:c.id,label:c.label,hasClient:!!d,hasTokens:!!e,...e?.expiresAt!==void 0?{expiresAt:e.expiresAt}:{},setupHint:c.setupHint,consoleUrl:c.consoleUrl,origin:b.origin,setupSteps:c.setupSteps})}return a}},10094:(a,b,c)=>{c.d(b,{Cs:()=>n,E4:()=>s,H:()=>w,To:()=>v,getOAuthProvider:()=>t,isOAuthProviderId:()=>u,lL:()=>k,uq:()=>x});var d=c(73024),e=c(48161),f=c.n(e),g=c(76760),h=c.n(g),i=c(56149);let j=i.Ik({title:i.Yj().min(1).max(200),body:i.Yj().max(2e3).optional(),field:i.Yj().max(200).optional(),copy:i.Yj().max(2e3).optional(),choice:i.Yj().max(200).optional()}),k=i.Ik({id:i.Yj().min(1).max(64).regex(/^[a-z][a-z0-9-]*$/,"provider id must be kebab-case (e.g. google, dropbox)"),label:i.Yj().min(1).max(120),authorizeUrl:i.Yj().url(),tokenUrl:i.Yj().url(),defaultScopes:i.YO(i.Yj()).default([]),supportsPKCE:i.zM().default(!0),refreshTokenSupported:i.zM().default(!0),extraAuthorizeParams:i.g1(i.Yj(),i.Yj()).default({}),needsClientSecret:i.zM().default(!0),setupHint:i.Yj().default(""),consoleUrl:i.Yj().url(),setupSteps:i.YO(j).default([])}),l={google:{id:"google",label:"Google",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",defaultScopes:["openid","email","https://www.googleapis.com/auth/calendar"],supportsPKCE:!0,refreshTokenSupported:!0,extraAuthorizeParams:{access_type:"offline",prompt:"consent"},needsClientSecret:!0,setupHint:"If you haven't already — first enable the required API (Calendar/Gmail/Drive) under APIs & Services → Library.",consoleUrl:"https://console.cloud.google.com/apis/credentials",setupSteps:[{title:"Open Google Cloud Console → APIs & Services → Credentials."},{title:'Click "+ CREATE CREDENTIALS" → "OAuth client ID".'},{title:"Application type",choice:"Web application",body:'Not "Desktop" — Reflex uses a fixed localhost redirect.'},{title:'Name — anything, e.g. "Reflex".'},{title:"Authorized redirect URIs → ADD URI",field:"Authorized redirect URIs",copy:"http://localhost:3210/api/oauth/callback",body:"Exactly as shown, no trailing slash, http (not https)."},{title:"Hit CREATE → a popup will show the Client ID and Client Secret."},{title:'Copy both values here. (If lost — open the client in Credentials, use "Download JSON" or "Reset secret".)'},{title:"Before the first Authorize, make sure the required API is enabled: APIs & Services → Library → Google Calendar API → Enable (similarly for other services)."}]},github:{id:"github",label:"GitHub",authorizeUrl:"https://github.com/login/oauth/authorize",tokenUrl:"https://github.com/login/oauth/access_token",defaultScopes:["repo","read:user"],supportsPKCE:!1,refreshTokenSupported:!1,extraAuthorizeParams:{},needsClientSecret:!0,setupHint:"Personal OAuth Apps live in Settings → Developer settings.",consoleUrl:"https://github.com/settings/developers",setupSteps:[{title:"Open github.com/settings/developers → OAuth Apps."},{title:'Click "New OAuth App".'},{title:'Application name — anything, e.g. "Reflex".'},{title:"Homepage URL",field:"Homepage URL",copy:"http://localhost:3210"},{title:"Authorization callback URL",field:"Authorization callback URL",copy:"http://localhost:3210/api/oauth/callback"},{title:'Click "Register application".'},{title:'Copy "Client ID" from here → into Reflex.'},{title:'Click "Generate a new client secret", copy the value immediately (shown only once) → into Reflex.'}]},notion:{id:"notion",label:"Notion",authorizeUrl:"https://api.notion.com/v1/oauth/authorize",tokenUrl:"https://api.notion.com/v1/oauth/token",defaultScopes:[],supportsPKCE:!1,refreshTokenSupported:!1,extraAuthorizeParams:{owner:"user"},needsClientSecret:!0,setupHint:"Reflex uses a Public integration (with OAuth flow), not Internal.",consoleUrl:"https://www.notion.so/profile/integrations",setupSteps:[{title:'Open notion.so/profile/integrations → "+ New integration".'},{title:'Name — "Reflex".'},{title:"Associated workspace — your workspace."},{title:"Type",choice:"Public",body:"Internal doesn't fit — the OAuth flow needs a public integration."},{title:"Submit → integration is created. Go to its page."},{title:'Under "OAuth Domain & URIs" → Redirect URIs → Add URI',field:"Redirect URIs",copy:"http://localhost:3210/api/oauth/callback"},{title:"Save."},{title:'Under "Secrets", copy the OAuth client ID and OAuth client secret here.'}]},slack:{id:"slack",label:"Slack",authorizeUrl:"https://slack.com/oauth/v2/authorize",tokenUrl:"https://slack.com/api/oauth.v2.access",defaultScopes:["chat:write","channels:read"],supportsPKCE:!1,refreshTokenSupported:!0,extraAuthorizeParams:{},needsClientSecret:!0,setupHint:"Default scopes (chat:write, channels:read) can be extended in OAuth & Permissions.",consoleUrl:"https://api.slack.com/apps",setupSteps:[{title:'Open api.slack.com/apps → "Create New App" → "From scratch".'},{title:'App Name — "Reflex", pick your workspace → Create App.'},{title:'In the left panel open "OAuth & Permissions" → Redirect URLs → "Add New Redirect URL"',field:"Redirect URLs",copy:"http://localhost:3210/api/oauth/callback"},{title:"Save URLs."},{title:"Under Scopes → User Token Scopes add the required ones (chat:write, channels:read, etc. — from Reflex defaults)."},{title:'At the top of the page click Install App → grant access → you\'ll get Client ID and Client Secret under "Basic Information".'}]},linear:{id:"linear",label:"Linear",authorizeUrl:"https://linear.app/oauth/authorize",tokenUrl:"https://api.linear.app/oauth/token",defaultScopes:["read","write"],supportsPKCE:!1,refreshTokenSupported:!0,extraAuthorizeParams:{},needsClientSecret:!0,setupHint:"A personal OAuth application is tied to your workspace.",consoleUrl:"https://linear.app/settings/api/applications/new",setupSteps:[{title:"Open linear.app/settings/api/applications/new (Settings → API → OAuth applications → Create new)."},{title:'Name — "Reflex", description anything.'},{title:"Developer URL",field:"Developer URL",copy:"http://localhost:3210"},{title:"Callback URLs",field:"Callback URLs",copy:"http://localhost:3210/api/oauth/callback"},{title:"Scopes — check read + write (or whichever you need: issues:create, etc.)."},{title:"Submit → copy Client ID + Client Secret here."}]}},m=Object.keys(l),n="http://localhost:3210/api/oauth/callback",o=h().join(f().homedir(),".reflex","oauth","providers.json"),p=i.Ik({version:i.eu(1),providers:i.YO(k)});async function q(){try{let a=await d.promises.readFile(o,"utf8"),b=p.safeParse(JSON.parse(a));if(!b.success)return{version:1,providers:[]};return b.data}catch{return{version:1,providers:[]}}}async function r(a){await d.promises.mkdir(h().dirname(o),{recursive:!0}),await d.promises.writeFile(o,JSON.stringify(a,null,2)+"\n",{encoding:"utf8",mode:384});try{await d.promises.chmod(o,384)}catch{}}async function s(){let a=await q(),b=new Set(a.providers.map(a=>a.id)),c=[];for(let a of m)b.has(a)||c.push({def:l[a],origin:"builtin"});for(let b of a.providers)c.push({def:b,origin:"user"});return c}async function t(a){let b=await s();return b.find(b=>b.def.id===a)?.def??null}async function u(a){return await t(a)!==null}async function v(a){let b=k.parse(a);if(void 0!==l[b.id])throw Error(`"${b.id}" is a built-in provider id — pick a different slug`);let c=await q();if(c.providers.some(a=>a.id===b.id))throw Error(`provider "${b.id}" already exists`);c.providers.push(b),await r(c)}async function w(a,b){if(void 0!==l[a])throw Error(`cannot edit built-in provider "${a}"`);let c=await q(),d=c.providers.findIndex(b=>b.id===a);if(d<0)throw Error(`provider "${a}" not found`);let e=k.parse({...c.providers[d],...b,id:a});c.providers[d]=e,await r(c)}async function x(a){if(void 0!==l[a])throw Error(`cannot remove built-in provider "${a}"`);let b=await q(),c=b.providers.filter(b=>b.id!==a);c.length!==b.providers.length&&(b.providers=c,await r(b))}},61888:(a,b,c)=>{c.d(b,{b:()=>i,getAccessToken:()=>j});var d=c(77598),e=c(10094),f=c(1223);let g=globalThis.__reflexOAuthPending??new Map;function h(a){return a.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function i(a,b){let c,i=Date.now()-9e5;for(let[a,b]of g)b.createdAt<i&&g.delete(a);let j=await (0,e.getOAuthProvider)(a);if(!j)throw Error(`unknown provider: ${a}`);let k=await (0,f.tY)(a);if(!k)throw Error(`OAuth client for "${a}" is not configured — set client_id/secret in Settings → OAuth first`);let l=h((0,d.randomBytes)(24)),m=b&&b.length>0?b:k.scopes&&k.scopes.length>0?k.scopes:j.defaultScopes,n=new URLSearchParams({client_id:k.clientId,redirect_uri:e.Cs,response_type:"code",state:l,...m.length>0?{scope:m.join(" ")}:{},...j.extraAuthorizeParams??{}});if(j.supportsPKCE){let{verifier:a,challenge:b}=function(){let a=h((0,d.randomBytes)(32)),b=h((0,d.createHash)("sha256").update(a).digest());return{verifier:a,challenge:b}}();c=a,n.set("code_challenge",b),n.set("code_challenge_method","S256")}g.set(l,{provider:a,...void 0!==c?{codeVerifier:c}:{},scopes:m,createdAt:Date.now()});let o=k.authorizeUrl??j.authorizeUrl;return{authorizeUrl:`${o}?${n.toString()}`,state:l}}async function j(a){let b=await (0,e.getOAuthProvider)(a);if(!b)throw Error(`unknown provider: ${a}`);let c=await (0,f.getOAuthTokens)(a);if(!c)throw Error(`provider "${a}" not authorized — open Settings → OAuth and click Authorize`);if(!(void 0!==c.expiresAt&&c.expiresAt-6e4<Date.now()))return c.accessToken;if(!c.refreshToken)throw Error(`access token for "${a}" expired and no refresh_token — re-authorize`);let d=await (0,f.tY)(a);if(!d)throw Error(`OAuth client for "${a}" is not configured`);let g=new URLSearchParams({grant_type:"refresh_token",refresh_token:c.refreshToken,client_id:d.clientId});b.needsClientSecret&&d.clientSecret&&g.set("client_secret",d.clientSecret);let h=await k(b,d,g),i={accessToken:h.accessToken,refreshToken:h.refreshToken??c.refreshToken,...void 0!==h.expiresAt?{expiresAt:h.expiresAt}:{},...h.scope?{scope:h.scope}:c.scope?{scope:c.scope}:{},...h.tokenType?{tokenType:h.tokenType}:c.tokenType?{tokenType:c.tokenType}:{}};return await (0,f.Dt)(a,i),i.accessToken}async function k(a,b,c){let d,e=b.tokenUrl??a.tokenUrl,f=await fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:c.toString()}),g=await f.text();if(!f.ok)throw Error(`token endpoint HTTP ${f.status}: ${g.slice(0,500)}`);if(g.trim().startsWith("{"))d=JSON.parse(g);else for(let[a,b]of(d={},new URLSearchParams(g)))d[a]=b;if(d.error)throw Error(`OAuth error: ${d.error}${d.error_description?` — ${d.error_description}`:""}`);let h="string"==typeof d.access_token?d.access_token:null;if(!h)throw Error(`token endpoint returned no access_token (${g.slice(0,200)})`);let i="number"==typeof d.expires_in?d.expires_in:"string"==typeof d.expires_in?Number(d.expires_in):void 0;return{accessToken:h,..."string"==typeof d.refresh_token?{refreshToken:d.refresh_token}:{},...void 0!==i&&!Number.isNaN(i)?{expiresAt:Date.now()+1e3*i}:{},..."string"==typeof d.scope?{scope:d.scope}:{},..."string"==typeof d.token_type?{tokenType:d.token_type}:{}}}globalThis.__reflexOAuthPending=g}};
|
|
1
|
+
"use strict";exports.id=1888,exports.ids=[94,1223,1888],exports.modules={1223:(a,b,c)=>{c.d(b,{De:()=>v,Dt:()=>t,Sh:()=>s,cL:()=>q,getOAuthTokens:()=>u,gi:()=>w,tY:()=>r});var d=c(73024),e=c(76760),f=c.n(e),g=c(10094),h=c(73652),i=c(40917);let j=f().join((0,h._)(),"oauth"),k=f().join(j,"clients"),l=f().join(j,"tokens");function m(a){return f().join(k,`${a}.json`)}function n(a){return f().join(l,`${a}.json`)}async function o(a,b){await (0,i.An)(a,b,{mode:384})}async function p(a){try{let b=await d.promises.readFile(a,"utf8");return JSON.parse(b)}catch{return null}}async function q(a,b){let{getOAuthProvider:d}=await Promise.resolve().then(c.bind(c,10094));if(!await d(a))throw Error(`unknown provider: ${a}`);await o(m(a),{...b,updatedAt:new Date().toISOString()})}async function r(a){return p(m(a))}async function s(a){try{await d.promises.unlink(m(a))}catch{}}async function t(a,b){await o(n(a),{...b,updatedAt:new Date().toISOString()})}async function u(a){return p(n(a))}async function v(a){try{await d.promises.unlink(n(a))}catch{}}async function w(){let a=[];for(let b of(await (0,g.E4)())){let c=b.def,d=await r(c.id),e=await u(c.id);a.push({id:c.id,label:c.label,hasClient:!!d,hasTokens:!!e,...e?.expiresAt!==void 0?{expiresAt:e.expiresAt}:{},setupHint:c.setupHint,consoleUrl:c.consoleUrl,origin:b.origin,setupSteps:c.setupSteps})}return a}},10094:(a,b,c)=>{c.d(b,{Cs:()=>n,E4:()=>s,H:()=>w,To:()=>v,getOAuthProvider:()=>t,isOAuthProviderId:()=>u,lL:()=>k,uq:()=>x});var d=c(73024),e=c(48161),f=c.n(e),g=c(76760),h=c.n(g),i=c(56149);let j=i.Ik({title:i.Yj().min(1).max(200),body:i.Yj().max(2e3).optional(),field:i.Yj().max(200).optional(),copy:i.Yj().max(2e3).optional(),choice:i.Yj().max(200).optional()}),k=i.Ik({id:i.Yj().min(1).max(64).regex(/^[a-z][a-z0-9-]*$/,"provider id must be kebab-case (e.g. google, dropbox)"),label:i.Yj().min(1).max(120),authorizeUrl:i.Yj().url(),tokenUrl:i.Yj().url(),defaultScopes:i.YO(i.Yj()).default([]),supportsPKCE:i.zM().default(!0),refreshTokenSupported:i.zM().default(!0),extraAuthorizeParams:i.g1(i.Yj(),i.Yj()).default({}),needsClientSecret:i.zM().default(!0),setupHint:i.Yj().default(""),consoleUrl:i.Yj().url(),setupSteps:i.YO(j).default([])}),l={google:{id:"google",label:"Google",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",defaultScopes:["openid","email","https://www.googleapis.com/auth/calendar"],supportsPKCE:!0,refreshTokenSupported:!0,extraAuthorizeParams:{access_type:"offline",prompt:"consent"},needsClientSecret:!0,setupHint:"If you haven't already — first enable the required API (Calendar/Gmail/Drive) under APIs & Services → Library.",consoleUrl:"https://console.cloud.google.com/apis/credentials",setupSteps:[{title:"Open Google Cloud Console → APIs & Services → Credentials."},{title:'Click "+ CREATE CREDENTIALS" → "OAuth client ID".'},{title:"Application type",choice:"Web application",body:'Not "Desktop" — Reflex uses a fixed localhost redirect.'},{title:'Name — anything, e.g. "Reflex".'},{title:"Authorized redirect URIs → ADD URI",field:"Authorized redirect URIs",copy:"http://localhost:3210/api/oauth/callback",body:"Exactly as shown, no trailing slash, http (not https)."},{title:"Hit CREATE → a popup will show the Client ID and Client Secret."},{title:'Copy both values here. (If lost — open the client in Credentials, use "Download JSON" or "Reset secret".)'},{title:"Before the first Authorize, make sure the required API is enabled: APIs & Services → Library → Google Calendar API → Enable (similarly for other services)."}]},github:{id:"github",label:"GitHub",authorizeUrl:"https://github.com/login/oauth/authorize",tokenUrl:"https://github.com/login/oauth/access_token",defaultScopes:["repo","read:user"],supportsPKCE:!1,refreshTokenSupported:!1,extraAuthorizeParams:{},needsClientSecret:!0,setupHint:"Personal OAuth Apps live in Settings → Developer settings.",consoleUrl:"https://github.com/settings/developers",setupSteps:[{title:"Open github.com/settings/developers → OAuth Apps."},{title:'Click "New OAuth App".'},{title:'Application name — anything, e.g. "Reflex".'},{title:"Homepage URL",field:"Homepage URL",copy:"http://localhost:3210"},{title:"Authorization callback URL",field:"Authorization callback URL",copy:"http://localhost:3210/api/oauth/callback"},{title:'Click "Register application".'},{title:'Copy "Client ID" from here → into Reflex.'},{title:'Click "Generate a new client secret", copy the value immediately (shown only once) → into Reflex.'}]},notion:{id:"notion",label:"Notion",authorizeUrl:"https://api.notion.com/v1/oauth/authorize",tokenUrl:"https://api.notion.com/v1/oauth/token",defaultScopes:[],supportsPKCE:!1,refreshTokenSupported:!1,extraAuthorizeParams:{owner:"user"},needsClientSecret:!0,setupHint:"Reflex uses a Public integration (with OAuth flow), not Internal.",consoleUrl:"https://www.notion.so/profile/integrations",setupSteps:[{title:'Open notion.so/profile/integrations → "+ New integration".'},{title:'Name — "Reflex".'},{title:"Associated workspace — your workspace."},{title:"Type",choice:"Public",body:"Internal doesn't fit — the OAuth flow needs a public integration."},{title:"Submit → integration is created. Go to its page."},{title:'Under "OAuth Domain & URIs" → Redirect URIs → Add URI',field:"Redirect URIs",copy:"http://localhost:3210/api/oauth/callback"},{title:"Save."},{title:'Under "Secrets", copy the OAuth client ID and OAuth client secret here.'}]},slack:{id:"slack",label:"Slack",authorizeUrl:"https://slack.com/oauth/v2/authorize",tokenUrl:"https://slack.com/api/oauth.v2.access",defaultScopes:["chat:write","channels:read"],supportsPKCE:!1,refreshTokenSupported:!0,extraAuthorizeParams:{},needsClientSecret:!0,setupHint:"Default scopes (chat:write, channels:read) can be extended in OAuth & Permissions.",consoleUrl:"https://api.slack.com/apps",setupSteps:[{title:'Open api.slack.com/apps → "Create New App" → "From scratch".'},{title:'App Name — "Reflex", pick your workspace → Create App.'},{title:'In the left panel open "OAuth & Permissions" → Redirect URLs → "Add New Redirect URL"',field:"Redirect URLs",copy:"http://localhost:3210/api/oauth/callback"},{title:"Save URLs."},{title:"Under Scopes → User Token Scopes add the required ones (chat:write, channels:read, etc. — from Reflex defaults)."},{title:'At the top of the page click Install App → grant access → you\'ll get Client ID and Client Secret under "Basic Information".'}]},linear:{id:"linear",label:"Linear",authorizeUrl:"https://linear.app/oauth/authorize",tokenUrl:"https://api.linear.app/oauth/token",defaultScopes:["read","write"],supportsPKCE:!1,refreshTokenSupported:!0,extraAuthorizeParams:{},needsClientSecret:!0,setupHint:"A personal OAuth application is tied to your workspace.",consoleUrl:"https://linear.app/settings/api/applications/new",setupSteps:[{title:"Open linear.app/settings/api/applications/new (Settings → API → OAuth applications → Create new)."},{title:'Name — "Reflex", description anything.'},{title:"Developer URL",field:"Developer URL",copy:"http://localhost:3210"},{title:"Callback URLs",field:"Callback URLs",copy:"http://localhost:3210/api/oauth/callback"},{title:"Scopes — check read + write (or whichever you need: issues:create, etc.)."},{title:"Submit → copy Client ID + Client Secret here."}]}},m=Object.keys(l),n="http://localhost:3210/api/oauth/callback",o=h().join(f().homedir(),".reflex","oauth","providers.json"),p=i.Ik({version:i.eu(1),providers:i.YO(k)});async function q(){try{let a=await d.promises.readFile(o,"utf8"),b=p.safeParse(JSON.parse(a));if(!b.success)return{version:1,providers:[]};return b.data}catch{return{version:1,providers:[]}}}async function r(a){await d.promises.mkdir(h().dirname(o),{recursive:!0}),await d.promises.writeFile(o,JSON.stringify(a,null,2)+"\n",{encoding:"utf8",mode:384});try{await d.promises.chmod(o,384)}catch{}}async function s(){let a=await q(),b=new Set(a.providers.map(a=>a.id)),c=[];for(let a of m)b.has(a)||c.push({def:l[a],origin:"builtin"});for(let b of a.providers)c.push({def:b,origin:"user"});return c}async function t(a){let b=await s();return b.find(b=>b.def.id===a)?.def??null}async function u(a){return await t(a)!==null}async function v(a){let b=k.parse(a);if(void 0!==l[b.id])throw Error(`"${b.id}" is a built-in provider id — pick a different slug`);let c=await q();if(c.providers.some(a=>a.id===b.id))throw Error(`provider "${b.id}" already exists`);c.providers.push(b),await r(c)}async function w(a,b){if(void 0!==l[a])throw Error(`cannot edit built-in provider "${a}"`);let c=await q(),d=c.providers.findIndex(b=>b.id===a);if(d<0)throw Error(`provider "${a}" not found`);let e=k.parse({...c.providers[d],...b,id:a});c.providers[d]=e,await r(c)}async function x(a){if(void 0!==l[a])throw Error(`cannot remove built-in provider "${a}"`);let b=await q(),c=b.providers.filter(b=>b.id!==a);c.length!==b.providers.length&&(b.providers=c,await r(b))}},61888:(a,b,c)=>{c.d(b,{b:()=>i,getAccessToken:()=>j});var d=c(77598),e=c(10094),f=c(1223);let g=globalThis.__reflexOAuthPending??new Map;function h(a){return a.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function i(a,b){let c,i=Date.now()-9e5;for(let[a,b]of g)b.createdAt<i&&g.delete(a);let j=await (0,e.getOAuthProvider)(a);if(!j)throw Error(`unknown provider: ${a}`);let k=await (0,f.tY)(a);if(!k)throw Error(`OAuth client for "${a}" is not configured — set client_id/secret in Settings → OAuth first`);let l=h((0,d.randomBytes)(24)),m=b&&b.length>0?b:k.scopes&&k.scopes.length>0?k.scopes:j.defaultScopes,n=new URLSearchParams({client_id:k.clientId,redirect_uri:e.Cs,response_type:"code",state:l,...m.length>0?{scope:m.join(" ")}:{},...j.extraAuthorizeParams??{}});if(j.supportsPKCE){let{verifier:a,challenge:b}=function(){let a=h((0,d.randomBytes)(32)),b=h((0,d.createHash)("sha256").update(a).digest());return{verifier:a,challenge:b}}();c=a,n.set("code_challenge",b),n.set("code_challenge_method","S256")}g.set(l,{provider:a,...void 0!==c?{codeVerifier:c}:{},scopes:m,createdAt:Date.now()});let o=k.authorizeUrl??j.authorizeUrl;return{authorizeUrl:`${o}?${n.toString()}`,state:l}}async function j(a){let b=await (0,e.getOAuthProvider)(a);if(!b)throw Error(`unknown provider: ${a}`);let c=await (0,f.getOAuthTokens)(a);if(!c)throw Error(`provider "${a}" not authorized — open Settings → OAuth and click Authorize`);if(!(void 0!==c.expiresAt&&c.expiresAt-6e4<Date.now()))return c.accessToken;if(!c.refreshToken)throw Error(`access token for "${a}" expired and no refresh_token — re-authorize`);let d=await (0,f.tY)(a);if(!d)throw Error(`OAuth client for "${a}" is not configured`);let g=new URLSearchParams({grant_type:"refresh_token",refresh_token:c.refreshToken,client_id:d.clientId});b.needsClientSecret&&d.clientSecret&&g.set("client_secret",d.clientSecret);let h=await k(b,d,g),i={accessToken:h.accessToken,refreshToken:h.refreshToken??c.refreshToken,...void 0!==h.expiresAt?{expiresAt:h.expiresAt}:{},...h.scope?{scope:h.scope}:c.scope?{scope:c.scope}:{},...h.tokenType?{tokenType:h.tokenType}:c.tokenType?{tokenType:c.tokenType}:{}};return await (0,f.Dt)(a,i),i.accessToken}async function k(a,b,c){let d,e=b.tokenUrl??a.tokenUrl,f=await fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:c.toString()}),g=await f.text();if(!f.ok)throw Error(`token endpoint HTTP ${f.status}: ${g.slice(0,500)}`);if(g.trim().startsWith("{"))d=JSON.parse(g);else for(let[a,b]of(d={},new URLSearchParams(g)))d[a]=b;if(d.error)throw Error(`OAuth error: ${d.error}${d.error_description?` — ${d.error_description}`:""}`);let h="string"==typeof d.access_token?d.access_token:null;if(!h)throw Error(`token endpoint returned no access_token (${g.slice(0,200)})`);let i="number"==typeof d.expires_in?d.expires_in:"string"==typeof d.expires_in?Number(d.expires_in):void 0;return{accessToken:h,..."string"==typeof d.refresh_token?{refreshToken:d.refresh_token}:{},...void 0!==i&&!Number.isNaN(i)?{expiresAt:Date.now()+1e3*i}:{},..."string"==typeof d.scope?{scope:d.scope}:{},..."string"==typeof d.token_type?{tokenType:d.token_type}:{}}}globalThis.__reflexOAuthPending=g}};
|