@mavenagi/apps 0.0.0-alpha.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/dist/index.js +32 -0
- package/dist/next.js +1 -0
- package/index.ts +39 -0
- package/package.json +21 -0
- package/tsconfig.json +108 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execFileSync } from 'child_process';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
import { compiledUserWorkerEntrypointScript } from './next.js';
|
|
6
|
+
const p = (f) => `${fs.existsSync('./src') ? 'src/' : ''}${f}`;
|
|
7
|
+
fs.mkdirSync(p('app/mavenagi-cgi'), { recursive: true });
|
|
8
|
+
fs.writeFileSync(p('app/mavenagi-cgi/next.ts'), `// @ts-nocheck\n${compiledUserWorkerEntrypointScript}`);
|
|
9
|
+
Object.entries({
|
|
10
|
+
'pre-install': 'preInstall',
|
|
11
|
+
'post-install': 'postInstall',
|
|
12
|
+
feedbacks: 'feedbackCreatedOrUpdated',
|
|
13
|
+
conversations: 'conversationCreatedOrUpdated',
|
|
14
|
+
'execute-action': 'executeAction',
|
|
15
|
+
'knowledge-base-refreshed': 'knowledgeBaseRefreshed',
|
|
16
|
+
}).forEach(([f, name]) => {
|
|
17
|
+
fs.mkdirSync(p(`app/mavenagi-cgi/v1/${f}`), { recursive: true });
|
|
18
|
+
fs.writeFileSync(p(`app/mavenagi-cgi/v1/${f}/route.ts`), `// @ts-nocheck\nimport {${name}} from '../../next'
|
|
19
|
+
import userWorker from '../../../..'
|
|
20
|
+
|
|
21
|
+
export const POST = ${name}
|
|
22
|
+
export const runtime = userWorker.runtime ?? 'edge'
|
|
23
|
+
export const maxDuration = 900
|
|
24
|
+
`);
|
|
25
|
+
});
|
|
26
|
+
try {
|
|
27
|
+
execFileSync('next', process.argv.slice(2), { stdio: 'inherit' });
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
process.exit(err.status || 1);
|
|
32
|
+
}
|
package/dist/next.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const compiledUserWorkerEntrypointScript = `var Ar=Object.create;var K=Object.defineProperty;var Nr=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var Ur=Object.getPrototypeOf,kr=Object.prototype.hasOwnProperty;var C=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Cr=(e,r)=>{for(var n in r)K(e,n,{get:r[n],enumerable:!0})},Mr=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Pr(r))!kr.call(e,o)&&o!==n&&K(e,o,{get:()=>r[o],enumerable:!(t=Nr(r,o))||t.enumerable});return e};var Lr=(e,r,n)=>(n=e!=null?Ar(Ur(e)):{},Mr(r||!e||!e.__esModule?K(n,"default",{value:e,enumerable:!0}):n,e));var xe=C((Dt,be)=>{"use strict";var W=Object.defineProperty,Dr=Object.getOwnPropertyDescriptor,zr=Object.getOwnPropertyNames,Vr=Object.prototype.hasOwnProperty,Br=(e,r)=>{for(var n in r)W(e,n,{get:r[n],enumerable:!0})},Gr=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of zr(r))!Vr.call(e,o)&&o!==n&&W(e,o,{get:()=>r[o],enumerable:!(t=Dr(r,o))||t.enumerable});return e},Fr=e=>Gr(W({},"__esModule",{value:!0}),e),fe={};Br(fe,{CITY_HEADER_NAME:()=>ue,COUNTRY_HEADER_NAME:()=>q,EMOJI_FLAG_UNICODE_STARTING_POSITION:()=>ye,IP_HEADER_NAME:()=>me,LATITUDE_HEADER_NAME:()=>le,LONGITUDE_HEADER_NAME:()=>de,REGION_HEADER_NAME:()=>ge,REQUEST_ID_HEADER_NAME:()=>Ee,geolocation:()=>Wr,ipAddress:()=>Kr});be.exports=Fr(fe);var ue="x-vercel-ip-city",q="x-vercel-ip-country",me="x-real-ip",le="x-vercel-ip-latitude",de="x-vercel-ip-longitude",ge="x-vercel-ip-country-region",Ee="x-vercel-id",ye=127397;function T(e,r){return e.headers.get(r)??void 0}function Hr(e){let r=new RegExp("^[A-Z]{2}\$").test(e);if(!(!e||!r))return String.fromCodePoint(...e.split("").map(n=>ye+n.charCodeAt(0)))}function Kr(e){return T(e,me)}function qr(e){return e?e.split(":")[0]:"dev1"}function Wr(e){return{city:T(e,ue),country:T(e,q),flag:Hr(T(e,q)),countryRegion:T(e,ge),region:qr(T(e,Ee)),latitude:T(e,le),longitude:T(e,de)}}});var he=C((zt,Oe)=>{"use strict";var \$=Object.defineProperty,\$r=Object.getOwnPropertyDescriptor,Yr=Object.getOwnPropertyNames,Jr=Object.prototype.hasOwnProperty,Qr=(e,r)=>{for(var n in r)\$(e,n,{get:r[n],enumerable:!0})},Xr=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Yr(r))!Jr.call(e,o)&&o!==n&&\$(e,o,{get:()=>r[o],enumerable:!(t=\$r(r,o))||t.enumerable});return e},Zr=e=>Xr(\$({},"__esModule",{value:!0}),e),_e={};Qr(_e,{getEnv:()=>et});Oe.exports=Zr(_e);var et=(e=process.env)=>({VERCEL:g(e,"VERCEL"),CI:g(e,"CI"),VERCEL_ENV:g(e,"VERCEL_ENV"),VERCEL_URL:g(e,"VERCEL_URL"),VERCEL_BRANCH_URL:g(e,"VERCEL_BRANCH_URL"),VERCEL_PROJECT_PRODUCTION_URL:g(e,"VERCEL_PROJECT_PRODUCTION_URL"),VERCEL_REGION:g(e,"VERCEL_REGION"),VERCEL_DEPLOYMENT_ID:g(e,"VERCEL_DEPLOYMENT_ID"),VERCEL_SKEW_PROTECTION_ENABLED:g(e,"VERCEL_SKEW_PROTECTION_ENABLED"),VERCEL_AUTOMATION_BYPASS_SECRET:g(e,"VERCEL_AUTOMATION_BYPASS_SECRET"),VERCEL_GIT_PROVIDER:g(e,"VERCEL_GIT_PROVIDER"),VERCEL_GIT_REPO_SLUG:g(e,"VERCEL_GIT_REPO_SLUG"),VERCEL_GIT_REPO_OWNER:g(e,"VERCEL_GIT_REPO_OWNER"),VERCEL_GIT_REPO_ID:g(e,"VERCEL_GIT_REPO_ID"),VERCEL_GIT_COMMIT_REF:g(e,"VERCEL_GIT_COMMIT_REF"),VERCEL_GIT_COMMIT_SHA:g(e,"VERCEL_GIT_COMMIT_SHA"),VERCEL_GIT_COMMIT_MESSAGE:g(e,"VERCEL_GIT_COMMIT_MESSAGE"),VERCEL_GIT_COMMIT_AUTHOR_LOGIN:g(e,"VERCEL_GIT_COMMIT_AUTHOR_LOGIN"),VERCEL_GIT_COMMIT_AUTHOR_NAME:g(e,"VERCEL_GIT_COMMIT_AUTHOR_NAME"),VERCEL_GIT_PREVIOUS_SHA:g(e,"VERCEL_GIT_PREVIOUS_SHA"),VERCEL_GIT_PULL_REQUEST_ID:g(e,"VERCEL_GIT_PULL_REQUEST_ID")}),g=(e,r)=>{let n=e[r];return n===""?void 0:n}});var Ie=C((Vt,Re)=>{"use strict";var Y=Object.defineProperty,rt=Object.getOwnPropertyDescriptor,tt=Object.getOwnPropertyNames,ot=Object.prototype.hasOwnProperty,nt=(e,r)=>{for(var n in r)Y(e,n,{get:r[n],enumerable:!0})},it=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of tt(r))!ot.call(e,o)&&o!==n&&Y(e,o,{get:()=>r[o],enumerable:!(t=rt(r,o))||t.enumerable});return e},st=e=>it(Y({},"__esModule",{value:!0}),e),ve={};nt(ve,{SYMBOL_FOR_REQ_CONTEXT:()=>Te,getContext:()=>at});Re.exports=st(ve);var Te=Symbol.for("@vercel/request-context");function at(){return globalThis[Te]?.get?.()??{}}});var we=C((Bt,Se)=>{"use strict";var J=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,pt=Object.getOwnPropertyNames,ft=Object.prototype.hasOwnProperty,ut=(e,r)=>{for(var n in r)J(e,n,{get:r[n],enumerable:!0})},mt=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of pt(r))!ft.call(e,o)&&o!==n&&J(e,o,{get:()=>r[o],enumerable:!(t=ct(r,o))||t.enumerable});return e},lt=e=>mt(J({},"__esModule",{value:!0}),e),je={};ut(je,{waitUntil:()=>gt});Se.exports=lt(je);var dt=Ie(),gt=e=>{if(e===null||typeof e!="object"||typeof e.then!="function")throw new TypeError(\`waitUntil can only be called with a Promise, got \${typeof e}\`);return(0,dt.getContext)().waitUntil?.(e)}});var Ue=C((Gt,Pe)=>{"use strict";var Q=Object.defineProperty,Et=Object.getOwnPropertyDescriptor,yt=Object.getOwnPropertyNames,bt=Object.prototype.hasOwnProperty,xt=(e,r)=>{for(var n in r)Q(e,n,{get:r[n],enumerable:!0})},_t=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of yt(r))!bt.call(e,o)&&o!==n&&Q(e,o,{get:()=>r[o],enumerable:!(t=Et(r,o))||t.enumerable});return e},Ot=e=>_t(Q({},"__esModule",{value:!0}),e),Ne={};xt(Ne,{geolocation:()=>Ae.geolocation,getEnv:()=>ht.getEnv,ipAddress:()=>Ae.ipAddress,waitUntil:()=>vt.waitUntil});Pe.exports=Ot(Ne);var Ae=xe(),ht=he(),vt=we()});var P=Lr(Ue());var X,Z,ee,re,te,Tt=typeof window<"u"&&typeof window.document<"u",Rt=typeof self=="object"&&typeof self?.importScripts=="function"&&(((X=self.constructor)===null||X===void 0?void 0:X.name)==="DedicatedWorkerGlobalScope"||((Z=self.constructor)===null||Z===void 0?void 0:Z.name)==="ServiceWorkerGlobalScope"||((ee=self.constructor)===null||ee===void 0?void 0:ee.name)==="SharedWorkerGlobalScope"),ke=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Ce=typeof Bun<"u"&&typeof Bun.version<"u",It=typeof process<"u"&&!!process.version&&!!(!((re=process.versions)===null||re===void 0)&&re.node)&&!ke&&!Ce,jt=typeof navigator<"u"&&navigator?.product==="ReactNative",St=typeof globalThis<"u"&&((te=globalThis?.navigator)===null||te===void 0?void 0:te.userAgent)==="Cloudflare-Workers",oe=wt();function wt(){return Tt?{type:"browser",version:window.navigator.userAgent}:St?{type:"workerd"}:Rt?{type:"web-worker"}:ke?{type:"deno",version:Deno.version.deno}:Ce?{type:"bun",version:Bun.version}:It?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:jt?{type:"react-native"}:{type:"unknown"}}var i={};Cr(i,{JsonError:()=>j,ParseError:()=>S,any:()=>Ye,boolean:()=>Je,booleanLiteral:()=>\$e,date:()=>Le,discriminant:()=>ir,enum_:()=>V,getObjectLikeUtils:()=>h,getObjectUtils:()=>A,getSchemaUtils:()=>d,isProperty:()=>I,lazy:()=>De,lazyObject:()=>Ke,list:()=>G,number:()=>Qe,object:()=>B,objectWithoutOptionalProperties:()=>He,optional:()=>ne,property:()=>Ve,record:()=>rr,set:()=>tr,string:()=>Xe,stringLiteral:()=>We,transform:()=>ie,undiscriminatedUnion:()=>nr,union:()=>ar,unknown:()=>Ze,withParsedProperties:()=>ae});var u={DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function l(e,r){return\`Expected \${r}. Received \${At(e)}.\`}function At(e){if(Array.isArray(e))return"list";if(e===null)return"null";switch(typeof e){case"string":return\`"\${e}"\`;case"number":case"boolean":case"undefined":return\`\${e}\`}return typeof e}function E(e){return Object.assign(Object.assign({},e),{json:Me(e.json),parse:Me(e.parse)})}function Me(e){return(r,n)=>{let t=e(r,n),{skipValidation:o=!1}=n??{};return!t.ok&&o?(console.warn(["Failed to validate.",...t.errors.map(s=>" - "+(s.path.length>0?\`\${s.path.join(".")}: \${s.message}\`:s.message))].join(\`\n\`)),{ok:!0,value:r}):t}}function z(e){return e.path.length===0?e.message:\`\${e.path.join(" -> ")}: \${e.message}\`}var j=class e extends Error{constructor(r){super(r.map(z).join("; ")),this.errors=r,Object.setPrototypeOf(this,e.prototype)}};var S=class e extends Error{constructor(r){super(r.map(z).join("; ")),this.errors=r,Object.setPrototypeOf(this,e.prototype)}};function d(e){return{optional:()=>ne(e),transform:r=>ie(e,r),parseOrThrow:(r,n)=>{let t=e.parse(r,n);if(t.ok)return t.value;throw new S(t.errors)},jsonOrThrow:(r,n)=>{let t=e.json(r,n);if(t.ok)return t.value;throw new j(t.errors)}}}function ne(e){let r={parse:(n,t)=>n==null?{ok:!0,value:void 0}:e.parse(n,t),json:(n,t)=>t?.omitUndefined&&n===void 0?{ok:!0,value:void 0}:n==null?{ok:!0,value:null}:e.json(n,t),getType:()=>u.OPTIONAL};return Object.assign(Object.assign({},r),d(r))}function ie(e,r){let n={parse:(t,o)=>{let s=e.parse(t,o);return s.ok?{ok:!0,value:r.transform(s.value)}:s},json:(t,o)=>{let s=r.untransform(t);return e.json(s,o)},getType:()=>e.getType()};return Object.assign(Object.assign({},n),d(n))}var Nt=/^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?\$/;function Le(){let e={parse:(r,{breadcrumbsPrefix:n=[]}={})=>typeof r!="string"?{ok:!1,errors:[{path:n,message:l(r,"string")}]}:Nt.test(r)?{ok:!0,value:new Date(r)}:{ok:!1,errors:[{path:n,message:l(r,"ISO 8601 date string")}]},json:(r,{breadcrumbsPrefix:n=[]}={})=>r instanceof Date?{ok:!0,value:r.toISOString()}:{ok:!1,errors:[{path:n,message:l(r,"Date object")}]},getType:()=>u.DATE};return Object.assign(Object.assign({},E(e)),d(e))}function y(e,r){return()=>{let n={parse:r,json:r,getType:()=>e};return Object.assign(Object.assign({},E(n)),d(n))}}function V(e){let r=new Set(e);return y(u.ENUM,(t,{allowUnrecognizedEnumValues:o,breadcrumbsPrefix:s=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:s,message:l(t,"string")}]}:!r.has(t)&&!o?{ok:!1,errors:[{path:s,message:l(t,"enum")}]}:{ok:!0,value:t})()}function De(e){let r=se(e);return Object.assign(Object.assign({},r),d(r))}function se(e){return{parse:(r,n)=>w(e).parse(r,n),json:(r,n)=>w(e).json(r,n),getType:()=>w(e).getType()}}function w(e){let r=e;return r.__zurg_memoized==null&&(r.__zurg_memoized=e()),r.__zurg_memoized}function M(e){return Object.entries(e)}function L(e,r){let n=new Set(r);return Object.entries(e).reduce((t,[o,s])=>(n.has(o)&&(t[o]=s),t),{})}function R(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function D(e){return Object.keys(e)}function ze(e,r){let n=[],t=[];for(let o of e)r(o)?n.push(o):t.push(o);return[n,t]}function h(e){return{withParsedProperties:r=>ae(e,r)}}function ae(e,r){let n={parse:(t,o)=>{let s=e.parse(t,o);if(!s.ok)return s;let c=Object.entries(r).reduce((a,[p,f])=>Object.assign(Object.assign({},a),{[p]:typeof f=="function"?f(s.value):f}),{});return{ok:!0,value:Object.assign(Object.assign({},s.value),c)}},json:(t,o)=>{var s;if(!R(t))return{ok:!1,errors:[{path:(s=o?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],message:l(t,"object")}]};let c=new Set(Object.keys(r)),a=L(t,Object.keys(t).filter(p=>!c.has(p)));return e.json(a,o)},getType:()=>e.getType()};return Object.assign(Object.assign(Object.assign({},n),d(n)),h(n))}function Ve(e,r){return{rawKey:e,valueSchema:r,isProperty:!0}}function I(e){return e.isProperty}function B(e){let r={_getRawProperties:()=>Object.entries(e).map(([n,t])=>I(t)?t.rawKey:n),_getParsedProperties:()=>D(e),parse:(n,t)=>{let o={},s=[];for(let[c,a]of M(e)){let p=I(a)?a.rawKey:c,f=I(a)?a.valueSchema:a,b={rawKey:p,parsedKey:c,valueSchema:f};o[p]=b,Fe(f)&&s.push(p)}return Be({value:n,requiredKeys:s,getProperty:c=>{let a=o[c];if(a!=null)return{transformedKey:a.parsedKey,transform:p=>{var f;return a.valueSchema.parse(p,Object.assign(Object.assign({},t),{breadcrumbsPrefix:[...(f=t?.breadcrumbsPrefix)!==null&&f!==void 0?f:[],c]}))}}},unrecognizedObjectKeys:t?.unrecognizedObjectKeys,skipValidation:t?.skipValidation,breadcrumbsPrefix:t?.breadcrumbsPrefix,omitUndefined:t?.omitUndefined})},json:(n,t)=>{let o=[];for(let[s,c]of M(e)){let a=I(c)?c.valueSchema:c;Fe(a)&&o.push(s)}return Be({value:n,requiredKeys:o,getProperty:s=>{let c=e[s];if(c!=null)return I(c)?{transformedKey:c.rawKey,transform:a=>{var p;return c.valueSchema.json(a,Object.assign(Object.assign({},t),{breadcrumbsPrefix:[...(p=t?.breadcrumbsPrefix)!==null&&p!==void 0?p:[],s]}))}}:{transformedKey:s,transform:a=>{var p;return c.json(a,Object.assign(Object.assign({},t),{breadcrumbsPrefix:[...(p=t?.breadcrumbsPrefix)!==null&&p!==void 0?p:[],s]}))}}},unrecognizedObjectKeys:t?.unrecognizedObjectKeys,skipValidation:t?.skipValidation,breadcrumbsPrefix:t?.breadcrumbsPrefix,omitUndefined:t?.omitUndefined})},getType:()=>u.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},E(r)),d(r)),h(r)),A(r))}function Be({value:e,requiredKeys:r,getProperty:n,unrecognizedObjectKeys:t="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!R(e))return{ok:!1,errors:[{path:s,message:l(e,"object")}]};let c=new Set(r),a=[],p={};for(let[f,b]of Object.entries(e)){let O=n(f);if(O!=null){c.delete(f);let x=O.transform(b);x.ok?p[O.transformedKey]=x.value:(p[f]=b,a.push(...x.errors))}else switch(t){case"fail":a.push({path:[...s,f],message:\`Unexpected key "\${f}"\`});break;case"strip":break;case"passthrough":p[f]=b;break}}return a.push(...r.filter(f=>c.has(f)).map(f=>({path:s,message:\`Missing required key "\${f}"\`}))),a.length===0||o?{ok:!0,value:p}:{ok:!1,errors:a}}function A(e){return{extend:r=>{let n={_getParsedProperties:()=>[...e._getParsedProperties(),...r._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...r._getRawProperties()],parse:(t,o)=>Ge({extensionKeys:r._getRawProperties(),value:t,transformBase:s=>e.parse(s,o),transformExtension:s=>r.parse(s,o)}),json:(t,o)=>Ge({extensionKeys:r._getParsedProperties(),value:t,transformBase:s=>e.json(s,o),transformExtension:s=>r.json(s,o)}),getType:()=>u.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},n),d(n)),h(n)),A(n))}}}function Ge({extensionKeys:e,value:r,transformBase:n,transformExtension:t}){let o=new Set(e),[s,c]=ze(D(r),f=>o.has(f)),a=n(L(r,c)),p=t(L(r,s));return a.ok&&p.ok?{ok:!0,value:Object.assign(Object.assign({},a.value),p.value)}:{ok:!1,errors:[...a.ok?[]:a.errors,...p.ok?[]:p.errors]}}function Fe(e){return!Pt(e)}function Pt(e){switch(e.getType()){case u.ANY:case u.UNKNOWN:case u.OPTIONAL:return!0;default:return!1}}function He(e){return B(e)}function Ke(e){let r=Object.assign(Object.assign({},se(e)),{_getRawProperties:()=>w(e)._getRawProperties(),_getParsedProperties:()=>w(e)._getParsedProperties()});return Object.assign(Object.assign(Object.assign(Object.assign({},r),d(r)),h(r)),A(r))}function G(e){let r={parse:(n,t)=>qe(n,(o,s)=>{var c;return e.parse(o,Object.assign(Object.assign({},t),{breadcrumbsPrefix:[...(c=t?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],\`[\${s}]\`]}))}),json:(n,t)=>qe(n,(o,s)=>{var c;return e.json(o,Object.assign(Object.assign({},t),{breadcrumbsPrefix:[...(c=t?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],\`[\${s}]\`]}))}),getType:()=>u.LIST};return Object.assign(Object.assign({},E(r)),d(r))}function qe(e,r){return Array.isArray(e)?e.map((t,o)=>r(t,o)).reduce((t,o)=>{if(t.ok&&o.ok)return{ok:!0,value:[...t.value,o.value]};let s=[];return t.ok||s.push(...t.errors),o.ok||s.push(...o.errors),{ok:!1,errors:s}},{ok:!0,value:[]}):{ok:!1,errors:[{message:l(e,"list"),path:[]}]}}function We(e){return y(u.STRING_LITERAL,(n,{breadcrumbsPrefix:t=[]}={})=>n===e?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:l(n,\`"\${e}"\`)}]})()}function \$e(e){return y(u.BOOLEAN_LITERAL,(n,{breadcrumbsPrefix:t=[]}={})=>n===e?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:l(n,\`\${e.toString()}\`)}]})()}var Ye=y(u.ANY,e=>({ok:!0,value:e}));var Je=y(u.BOOLEAN,(e,{breadcrumbsPrefix:r=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:r,message:l(e,"boolean")}]});var Qe=y(u.NUMBER,(e,{breadcrumbsPrefix:r=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:r,message:l(e,"number")}]});var Xe=y(u.STRING,(e,{breadcrumbsPrefix:r=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:r,message:l(e,"string")}]});var Ze=y(u.UNKNOWN,e=>({ok:!0,value:e}));function rr(e,r){let n={parse:(t,o)=>er({value:t,isKeyNumeric:e.getType()===u.NUMBER,transformKey:s=>{var c;return e.parse(s,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(c=o?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],\`\${s} (key)\`]}))},transformValue:(s,c)=>{var a;return r.parse(s,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(a=o?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],\`\${c}\`]}))},breadcrumbsPrefix:o?.breadcrumbsPrefix}),json:(t,o)=>er({value:t,isKeyNumeric:e.getType()===u.NUMBER,transformKey:s=>{var c;return e.json(s,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(c=o?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],\`\${s} (key)\`]}))},transformValue:(s,c)=>{var a;return r.json(s,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(a=o?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],\`\${c}\`]}))},breadcrumbsPrefix:o?.breadcrumbsPrefix}),getType:()=>u.RECORD};return Object.assign(Object.assign({},E(n)),d(n))}function er({value:e,isKeyNumeric:r,transformKey:n,transformValue:t,breadcrumbsPrefix:o=[]}){return R(e)?M(e).reduce((s,[c,a])=>{if(a==null)return s;let p=s,f=c;if(r){let k=c.length>0?Number(c):NaN;isNaN(k)||(f=k)}let b=n(f),O=t(a,f);if(p.ok&&b.ok&&O.ok)return{ok:!0,value:Object.assign(Object.assign({},p.value),{[b.value]:O.value})};let x=[];return p.ok||x.push(...p.errors),b.ok||x.push(...b.errors),O.ok||x.push(...O.errors),{ok:!1,errors:x}},{ok:!0,value:{}}):{ok:!1,errors:[{path:o,message:l(e,"object")}]}}function tr(e){let r=G(e),n={parse:(t,o)=>{let s=r.parse(t,o);return s.ok?{ok:!0,value:new Set(s.value)}:s},json:(t,o)=>{var s;return t instanceof Set?r.json([...t],o):{ok:!1,errors:[{path:(s=o?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],message:l(t,"Set")}]}},getType:()=>u.SET};return Object.assign(Object.assign({},E(n)),d(n))}function nr(e){let r={parse:(n,t)=>or((o,s)=>o.parse(n,s),e,t),json:(n,t)=>or((o,s)=>o.json(n,s),e,t),getType:()=>u.UNDISCRIMINATED_UNION};return Object.assign(Object.assign({},E(r)),d(r))}function or(e,r,n){let t=[];for(let[o,s]of r.entries()){let c=e(s,Object.assign(Object.assign({},n),{skipValidation:!1}));if(c.ok)return c;for(let a of c.errors)t.push({path:a.path,message:\`[Variant \${o}] \${a.message}\`})}return{ok:!1,errors:t}}function ir(e,r){return{parsedDiscriminant:e,rawDiscriminant:r}}var Ut=function(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]]);return n};function ar(e,r){let n=typeof e=="string"?e:e.rawDiscriminant,t=typeof e=="string"?e:e.parsedDiscriminant,o=V(D(r)),s={parse:(c,a)=>sr({value:c,discriminant:n,transformedDiscriminant:t,transformDiscriminantValue:p=>{var f;return o.parse(p,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(f=a?.breadcrumbsPrefix)!==null&&f!==void 0?f:[],n]})},getAdditionalPropertiesSchema:p=>r[p],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(p,f)=>f.parse(p,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(c,a)=>sr({value:c,discriminant:t,transformedDiscriminant:n,transformDiscriminantValue:p=>{var f;return o.json(p,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(f=a?.breadcrumbsPrefix)!==null&&f!==void 0?f:[],t]})},getAdditionalPropertiesSchema:p=>r[p],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(p,f)=>f.json(p,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>u.UNION};return Object.assign(Object.assign(Object.assign({},E(s)),d(s)),h(s))}function sr({value:e,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:t,getAdditionalPropertiesSchema:o,allowUnrecognizedUnionMembers:s=!1,transformAdditionalProperties:c,breadcrumbsPrefix:a=[]}){if(!R(e))return{ok:!1,errors:[{path:a,message:l(e,"object")}]};let p=e,f=r,b=p[f],O=Ut(p,[typeof f=="symbol"?f:f+""]);if(b==null)return{ok:!1,errors:[{path:a,message:\`Missing discriminant ("\${r}")\`}]};let x=t(b);if(!x.ok)return{ok:!1,errors:x.errors};let k=o(x.value);if(k==null)return s?{ok:!0,value:Object.assign({[n]:x.value},O)}:{ok:!1,errors:[{path:[...a,r],message:"Unexpected discriminant value"}]};let H=c(O,k);return H.ok?{ok:!0,value:Object.assign({[n]:b},H.value)}:H}var _=i.object({organizationId:i.string(),agentId:i.string(),settings:i.record(i.string(),i.unknown())});var cr=i.object({}).extend(_);var pr=i.object({}).extend(_);var fr=i.enum_(["CONVERSATION","CONVERSATION_MESSAGE","KNOWLEDGE_BASE","KNOWLEDGE_DOCUMENT","ACTION","USER","USER_EVENT","EVENT_TRIGGER","USER_PROFILE","FEEDBACK"]);var N=i.object({referenceId:i.string()});var v=i.object({type:fr,appId:i.string(),organizationId:i.string(),agentId:i.string()}).extend(N);var ur=i.enum_(["THUMBS_UP","THUMBS_DOWN","INSERT","HANDOFF"]);var mr=i.object({type:ur,text:i.string().optional()});var lr=i.object({feedbackId:v,conversationId:v,conversationMessageId:v}).extend(mr);var dr=i.object({feedbacks:i.list(lr)}).extend(_);var gr=i.object({conversations:i.list(v)}).extend(_);var Er=i.object({name:i.string().optional(),id:i.record(i.string(),i.string()).optional(),email:i.string().optional(),context:i.record(i.string(),i.string()).optional()});var yr=i.object({actionId:i.string(),conversationMetadata:i.record(i.string(),i.string()),parameters:i.record(i.string(),i.unknown()),user:Er}).extend(_);var pa=i.object({response:i.string()});var br=i.object({knowledgeBaseId:N}).extend(_);var va=i.object({message:i.string().optional()});function xr(e){return e}var _r=i.string().transform({transform:xr,untransform:e=>e});var Or=i.enum_(["text"]);var hr=i.object({displayName:i.string(),description:i.string().optional(),type:Or});var Mc=i.record(_r,hr);var vr=i.enum_(["EMAIL","PHONE_NUMBER"]);var Tr=i.object({value:i.string(),userIdentifyingPropertyType:vr});var Rr=i.object({identifiers:i.list(Tr)});var Ir=i.enum_(["VISIBLE","PARTIALLY_VISIBLE","HIDDEN"]);var jr=i.object({value:i.string(),visibility:Ir.optional()});var F=i.object({userIdentifiers:Rr.optional(),metadata:i.record(i.string(),jr).optional()});var Qc=i.object({appUserId:N}).extend(F);var rp=i.object({appUserId:v,allUserData:i.record(i.string(),i.record(i.string(),i.string()))}).extend(F);var Sr=i.enum_(["CONVERSATION_CREATED","FEEDBACK_CREATED"]);var wr=i.object({description:i.string(),type:Sr});var cp=i.object({triggerId:v}).extend(wr);var fp=i.object({number:i.number(),size:i.number(),totalElements:i.number(),totalPages:i.number()});import U from"../..";async function Kp(e){let{organizationId:r,agentId:n,settings:t,actionId:o,conversationMetadata:s,parameters:c,user:a}=yr.parseOrThrow(await e.json());try{let p=await U.executeAction?.({organizationId:r,agentId:n,settings:t,actionId:o,conversationMetadata:s,parameters:c,user:a});return new Response(JSON.stringify({response:p}),{status:200,headers:{"Content-Type":"application/json"}})}catch(p){return console.error(p),p instanceof Error?new Response(p.message,{status:500}):new Response("No result returned",{status:204})}}async function qp(e){let{organizationId:r,agentId:n,settings:t,feedbacks:o}=dr.parseOrThrow(await e.json());try{return await U.feedbackCreatedOrUpdated?.({organizationId:r,agentId:n,settings:t,feedbacks:o,ctx:{waitUntil:P.waitUntil}}),new Response(null)}catch(s){return console.error(s),s instanceof Error?new Response(s.message,{status:500}):new Response("Unknown error",{status:500})}}async function Wp(e){let{organizationId:r,agentId:n,settings:t,conversations:o}=gr.parseOrThrow(await e.json());try{return await U.conversationCreatedOrUpdated?.({organizationId:r,agentId:n,settings:t,conversations:o,ctx:{waitUntil:P.waitUntil}}),new Response(null)}catch(s){return console.error(s),s instanceof Error?new Response(s.message,{status:500}):new Response("Unknown error",{status:500})}}async function \$p(e){let{organizationId:r,agentId:n,settings:t,knowledgeBaseId:o}=br.parseOrThrow(await e.json());try{return await U.knowledgeBaseRefreshed?.({organizationId:r,agentId:n,knowledgeBaseId:o,settings:t,ctx:{waitUntil:P.waitUntil}}),new Response(null)}catch(s){return console.error(s),s instanceof Error?new Response(s.message,{status:500}):new Response("Unknown error",{status:500})}}async function Yp(e){let{organizationId:r,agentId:n,settings:t}=pr.parseOrThrow(await e.json());try{return await U.postInstall?.({organizationId:r,agentId:n,settings:t,ctx:{waitUntil:P.waitUntil}}),new Response(null)}catch(o){return console.error(o),o instanceof Error?new Response(o.message,{status:400}):new Response("Unknown error",{status:500})}}async function Jp(e){let{organizationId:r,agentId:n,settings:t}=cr.parseOrThrow(await e.json());try{return await U.preInstall?.({organizationId:r,agentId:n,settings:t,ctx:{waitUntil:P.waitUntil}}),new Response(null)}catch(o){return console.error(o),o instanceof Error?new Response(o.message,{status:400}):new Response("Unknown error",{status:500})}}export{Wp as conversationCreatedOrUpdated,Kp as executeAction,qp as feedbackCreatedOrUpdated,\$p as knowledgeBaseRefreshed,Yp as postInstall,Jp as preInstall};\n`
|
package/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {execFileSync} from 'child_process'
|
|
3
|
+
import fs from 'fs'
|
|
4
|
+
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import {compiledUserWorkerEntrypointScript} from './next.js'
|
|
7
|
+
|
|
8
|
+
const p = (f: string) => `${fs.existsSync('./src') ? 'src/' : ''}${f}`
|
|
9
|
+
|
|
10
|
+
fs.rmSync(p('app/mavenagi-cgi'), {recursive: true, force: true})
|
|
11
|
+
fs.mkdirSync(p('app/mavenagi-cgi'), {recursive: true})
|
|
12
|
+
fs.writeFileSync(p('app/mavenagi-cgi/next.ts'), `// @ts-nocheck\n${compiledUserWorkerEntrypointScript}`)
|
|
13
|
+
Object.entries({
|
|
14
|
+
'pre-install': 'preInstall',
|
|
15
|
+
'post-install': 'postInstall',
|
|
16
|
+
feedbacks: 'feedbackCreatedOrUpdated',
|
|
17
|
+
conversations: 'conversationCreatedOrUpdated',
|
|
18
|
+
'execute-action': 'executeAction',
|
|
19
|
+
'knowledge-base-refreshed': 'knowledgeBaseRefreshed',
|
|
20
|
+
}).forEach(([f, name]) => {
|
|
21
|
+
fs.mkdirSync(p(`app/mavenagi-cgi/v1/${f}`), {recursive: true})
|
|
22
|
+
fs.writeFileSync(
|
|
23
|
+
p(`app/mavenagi-cgi/v1/${f}/route.ts`),
|
|
24
|
+
`// @ts-nocheck\nimport {${name}} from '../../next'
|
|
25
|
+
import userWorker from '../../../..'
|
|
26
|
+
|
|
27
|
+
export const POST = ${name}
|
|
28
|
+
export const runtime = userWorker.runtime ?? 'edge'
|
|
29
|
+
export const maxDuration = userWorker.maxDuration ?? 900
|
|
30
|
+
`
|
|
31
|
+
)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
execFileSync('next', process.argv.slice(2), {stdio: 'inherit'})
|
|
36
|
+
process.exit(0)
|
|
37
|
+
} catch (err: any) {
|
|
38
|
+
process.exit(err.status || 1)
|
|
39
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mavenagi/apps",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.0-alpha.0",
|
|
5
|
+
"description": "CLI for developing apps for Maven AGI",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"author": "Maven AGI",
|
|
9
|
+
"bin": {
|
|
10
|
+
"mavenagi": "dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "tsc --watch",
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"publish": "npm publish"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^22.2.0",
|
|
19
|
+
"typescript": "^5.5.4"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
|
+
|
|
27
|
+
/* Modules */
|
|
28
|
+
"module": "ES2022" /* Specify what module code is generated. */,
|
|
29
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
+
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
31
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
32
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
34
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
35
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
36
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
37
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
38
|
+
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
39
|
+
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
40
|
+
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
41
|
+
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
42
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
43
|
+
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
44
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
45
|
+
|
|
46
|
+
/* JavaScript Support */
|
|
47
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
48
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
49
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
50
|
+
|
|
51
|
+
/* Emit */
|
|
52
|
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
53
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
54
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
55
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
56
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
57
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
58
|
+
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
|
59
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
60
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
61
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
62
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
63
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
64
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
65
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
66
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
67
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
68
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
69
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
70
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
71
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
72
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
73
|
+
|
|
74
|
+
/* Interop Constraints */
|
|
75
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
76
|
+
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
77
|
+
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
|
78
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
79
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
80
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
81
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
82
|
+
|
|
83
|
+
/* Type Checking */
|
|
84
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
85
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
86
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
87
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
88
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
89
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
90
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
91
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
92
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
93
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
94
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
95
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
96
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
97
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
98
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
99
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
100
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
101
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
102
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
103
|
+
|
|
104
|
+
/* Completeness */
|
|
105
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
106
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
107
|
+
}
|
|
108
|
+
}
|