@squiz/component-cli-lib 1.41.1-alpha.7 → 1.42.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/.npm/_logs/{2023-08-03T03_38_10_370Z-debug-0.log → 2023-08-09T04_04_08_189Z-debug-0.log}
RENAMED
|
@@ -2,36 +2,36 @@
|
|
|
2
2
|
1 info using npm@9.5.0
|
|
3
3
|
2 info using node@v18.15.0
|
|
4
4
|
3 timing npm:load:whichnode Completed in 1ms
|
|
5
|
-
4 timing config:load:defaults Completed in
|
|
6
|
-
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in
|
|
7
|
-
6 timing config:load:builtin Completed in
|
|
8
|
-
7 timing config:load:cli Completed in
|
|
5
|
+
4 timing config:load:defaults Completed in 2ms
|
|
6
|
+
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
|
|
7
|
+
6 timing config:load:builtin Completed in 1ms
|
|
8
|
+
7 timing config:load:cli Completed in 2ms
|
|
9
9
|
8 timing config:load:env Completed in 1ms
|
|
10
10
|
9 info found workspace root at /builds/developer-experience/cmp
|
|
11
11
|
10 timing config:load:file:/builds/developer-experience/cmp/.npmrc Completed in 0ms
|
|
12
12
|
11 timing config:load:project Completed in 27ms
|
|
13
13
|
12 timing config:load:file:/root/.npmrc Completed in 1ms
|
|
14
|
-
13 timing config:load:user Completed in
|
|
14
|
+
13 timing config:load:user Completed in 1ms
|
|
15
15
|
14 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
|
|
16
16
|
15 timing config:load:global Completed in 0ms
|
|
17
17
|
16 timing config:load:setEnvs Completed in 1ms
|
|
18
18
|
17 timing config:load Completed in 37ms
|
|
19
19
|
18 timing npm:load:configload Completed in 37ms
|
|
20
|
-
19 timing npm:load:mkdirpcache Completed in
|
|
20
|
+
19 timing npm:load:mkdirpcache Completed in 0ms
|
|
21
21
|
20 timing npm:load:mkdirplogs Completed in 0ms
|
|
22
22
|
21 verbose title npm run compile
|
|
23
23
|
22 verbose argv "run" "compile" "--"
|
|
24
|
-
23 timing npm:load:setTitle Completed in
|
|
25
|
-
24 timing config:load:flatten Completed in
|
|
24
|
+
23 timing npm:load:setTitle Completed in 1ms
|
|
25
|
+
24 timing config:load:flatten Completed in 5ms
|
|
26
26
|
25 timing npm:load:display Completed in 7ms
|
|
27
|
-
26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-08-
|
|
28
|
-
27 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-08-
|
|
27
|
+
26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-08-09T04_04_08_189Z-
|
|
28
|
+
27 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-08-09T04_04_08_189Z-debug-0.log
|
|
29
29
|
28 timing npm:load:logFile Completed in 4ms
|
|
30
30
|
29 timing npm:load:timers Completed in 0ms
|
|
31
|
-
30 timing npm:load:configScope Completed in
|
|
31
|
+
30 timing npm:load:configScope Completed in 1ms
|
|
32
32
|
31 timing npm:load Completed in 53ms
|
|
33
33
|
32 silly logfile done cleaning log files
|
|
34
|
-
33 timing command:run Completed in
|
|
34
|
+
33 timing command:run Completed in 6814ms
|
|
35
35
|
34 verbose exit 0
|
|
36
|
-
35 timing npm Completed in
|
|
36
|
+
35 timing npm Completed in 6881ms
|
|
37
37
|
36 info ok
|
package/lib/index.js
CHANGED
|
@@ -60,7 +60,7 @@ ${b}`),f.pop(),`{${j}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";
|
|
|
60
60
|
`),stack:t.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(t)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:K9e.loadavg(),uptime:K9e.uptime()}}getTrace(t){return(t?Y9e.parse(t):Y9e.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(t){if(!this.handlers.has(t)){t.handleExceptions=!0;let r=new fFr(t);this.handlers.set(t,r),this.logger.pipe(r)}}_uncaughtException(t){let r=this.getAllInfo(t),n=this._getExceptionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(t):this.logger.exitOnError,s;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),i=!1);function o(){ehe("doExit",i),ehe("process._exiting",process._exiting),i&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(o);pFr(n,(a,c)=>{let u=mFr(c),l=a.transport||a;function d(p){return()=>{ehe(p),u()}}l._ending=!0,l.once("finish",d("finished")),l.once("error",d("error"))},()=>i&&o()),this.logger.log(r),i&&(s=setTimeout(o,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(t=>(t.transport||t).handleExceptions)}}});var nhe=h((QNi,eWe)=>{"use strict";var X9e=require("os"),_Fr=qV(),rhe=KI()("winston:rejection"),hFr=Q_e(),Z9e=X_e(),gFr=Z_e();eWe.exports=class{constructor(t){if(!t)throw new Error("Logger is required to handle rejections");this.logger=t,this.handlers=new Map}handle(...t){t.forEach(r=>{if(Array.isArray(r))return r.forEach(n=>this._addHandler(n));this._addHandler(r)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(t=>this.logger.unpipe(t)))}getAllInfo(t){let r=null;return t&&(r=typeof t=="string"?t:t.message),{error:t,level:"error",message:[`unhandledRejection: ${r||"(no error message)"}`,t&&t.stack||" No stack trace"].join(`
|
|
61
61
|
`),stack:t&&t.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(t)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:X9e.loadavg(),uptime:X9e.uptime()}}getTrace(t){return(t?Z9e.parse(t):Z9e.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(t){if(!this.handlers.has(t)){t.handleRejections=!0;let r=new gFr(t);this.handlers.set(t,r),this.logger.pipe(r)}}_unhandledRejection(t){let r=this.getAllInfo(t),n=this._getRejectionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(t):this.logger.exitOnError,s;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),i=!1);function o(){rhe("doExit",i),rhe("process._exiting",process._exiting),i&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(o);_Fr(n,(a,c)=>{let u=hFr(c),l=a.transport||a;function d(p){return()=>{rhe(p),u()}}l._ending=!0,l.once("finish",d("finished")),l.once("error",d("error"))},()=>i&&o()),this.logger.log(r),i&&(s=setTimeout(o,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(t=>(t.transport||t).handleRejections)}}});var rWe=h((ZNi,tWe)=>{"use strict";tWe.exports=class{constructor(t){if(!t)throw new Error("Logger is required for profiling.");this.logger=t,this.start=Date.now()}done(...t){typeof t[t.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),t.pop());let r=typeof t[t.length-1]=="object"?t.pop():{};return r.level=r.level||"info",r.durationMs=Date.now()-this.start,this.logger.write(r)}}});var aWe=h((eMi,oWe)=>{"use strict";var{Stream:vFr,Transform:yFr}=W0(),nWe=qV(),{LEVEL:cp,SPLAT:iWe}=ds(),sWe=K_e(),bFr=the(),SFr=nhe(),EFr=x_e(),wFr=rWe(),{warn:FFr}=Qfe(),CFr=TV(),xFr=/%[scdjifoO%]/g,NV=class extends yFr{constructor(t){super({objectMode:!0}),this.configure(t)}child(t){let r=this;return Object.create(r,{write:{value:function(n){let i=Object.assign({},t,n);n instanceof Error&&(i.stack=n.stack,i.message=n.message),r.write(i)}}})}configure({silent:t,format:r,defaultMeta:n,levels:i,level:s="info",exitOnError:o=!0,transports:a,colors:c,emitErrs:u,formatters:l,padLevels:d,rewriters:p,stripColors:m,exceptionHandlers:f,rejectionHandlers:v}={}){if(this.transports.length&&this.clear(),this.silent=t,this.format=r||this.format||Vfe()(),this.defaultMeta=n||null,this.levels=i||this.levels||CFr.npm.levels,this.level=s,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new bFr(this),this.rejections=new SFr(this),this.profilers={},this.exitOnError=o,a&&(a=Array.isArray(a)?a:[a],a.forEach(y=>this.add(y))),c||u||l||d||p||m)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
62
62
|
`));f&&this.exceptions.handle(f),v&&this.rejections.handle(v)}isLevelEnabled(t){let r=ihe(this.levels,t);if(r===null)return!1;let n=ihe(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=r:this.transports.findIndex(s=>{let o=ihe(this.levels,s.level);return o===null&&(o=n),o>=r})!==-1}log(t,r,...n){if(arguments.length===1)return t[cp]=t.level,this._addDefaultMeta(t),this.write(t),this;if(arguments.length===2)return r&&typeof r=="object"?(r[cp]=r.level=t,this._addDefaultMeta(r),this.write(r),this):(r={[cp]:t,level:t,message:r},this._addDefaultMeta(r),this.write(r),this);let[i]=n;if(typeof i=="object"&&i!==null&&!(r&&r.match&&r.match(xFr))){let o=Object.assign({},this.defaultMeta,i,{[cp]:t,[iWe]:n,level:t,message:r});return i.message&&(o.message=`${o.message} ${i.message}`),i.stack&&(o.stack=i.stack),this.write(o),this}return this.write(Object.assign({},this.defaultMeta,{[cp]:t,[iWe]:n,level:t,message:r})),this}_transform(t,r,n){if(this.silent)return n();t[cp]||(t[cp]=t.level),!this.levels[t[cp]]&&this.levels[t[cp]]!==0&&console.error("[winston] Unknown logger level: %s",t[cp]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",t);try{this.push(this.format.transform(t,this.format.options))}finally{this._writableState.sync=!1,n()}}_final(t){let r=this.transports.slice();nWe(r,(n,i)=>{if(!n||n.finished)return setImmediate(i);n.once("finish",i),n.end()},t)}add(t){let r=!sWe(t)||t.log.length>2?new EFr({transport:t}):t;if(!r._writableState||!r._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",r),this._onEvent("warn",r),this.pipe(r),t.handleExceptions&&this.exceptions.handle(),t.handleRejections&&this.rejections.handle(),this}remove(t){if(!t)return this;let r=t;return(!sWe(t)||t.log.length>2)&&(r=this.transports.filter(n=>n.transport===t)[0]),r&&this.unpipe(r),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){FFr.deprecated("setLevels")}query(t,r){typeof t=="function"&&(r=t,t={}),t=t||{};let n={},i=Object.assign({},t.query||{});function s(a,c){t.query&&typeof a.formatQuery=="function"&&(t.query=a.formatQuery(i)),a.query(t,(u,l)=>{if(u)return c(u);typeof a.formatResults=="function"&&(l=a.formatResults(l,t.format)),c(null,l)})}function o(a,c){s(a,(u,l)=>{c&&(l=u||l,l&&(n[a.name]=l),c()),c=null})}nWe(this.transports.filter(a=>!!a.query),o,()=>r(null,n))}stream(t={}){let r=new vFr,n=[];return r._streams=n,r.destroy=()=>{let i=n.length;for(;i--;)n[i].destroy()},this.transports.filter(i=>!!i.stream).forEach(i=>{let s=i.stream(t);s&&(n.push(s),s.on("log",o=>{o.transport=o.transport||[],o.transport.push(i.name),r.emit("log",o)}),s.on("error",o=>{o.transport=o.transport||[],o.transport.push(i.name),r.emit("error",o)}))}),r}startTimer(){return new wFr(this)}profile(t,...r){let n=Date.now();if(this.profilers[t]){let i=this.profilers[t];delete this.profilers[t],typeof r[r.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),r.pop());let s=typeof r[r.length-1]=="object"?r.pop():{};return s.level=s.level||"info",s.durationMs=n-i,s.message=s.message||t,this.write(s)}return this.profilers[t]=n,this}handleExceptions(...t){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...t)}unhandleExceptions(...t){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...t)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
63
|
-
`))}_onEvent(t,r){function n(i){t==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(t,i,r)}r["__winston"+t]||(r["__winston"+t]=n.bind(this),r.on(t,r["__winston"+t]))}_addDefaultMeta(t){this.defaultMeta&&Object.assign(t,this.defaultMeta)}};function ihe(e,t){let r=e[t];return!r&&r!==0?null:r}Object.defineProperty(NV.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});oWe.exports=NV});var she=h((tMi,cWe)=>{"use strict";var{LEVEL:RFr}=ds(),PFr=TV(),AFr=aWe(),IFr=KI()("winston:create-logger");function TFr(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}cWe.exports=function(e={}){e.levels=e.levels||PFr.npm.levels;class t extends AFr{constructor(i){super(i)}}let r=new t(e);return Object.keys(e.levels).forEach(function(n){if(IFr('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}t.prototype[n]=function(...i){let s=this||r;if(i.length===1){let[o]=i,a=o&&o.message&&o||{message:o};return a.level=a[RFr]=n,s._addDefaultMeta(a),s.write(a),this||r}return i.length===0?(s.log(n,""),s):s.log(n,...i)},t.prototype[TFr(n)]=function(){return(this||r).isLevelEnabled(n)}}),r}});var uWe=h((nMi,lWe)=>{"use strict";var OFr=she();lWe.exports=class{constructor(t={}){this.loggers=new Map,this.options=t}add(t,r){if(!this.loggers.has(t)){r=Object.assign({},r||this.options);let n=r.transports||this.options.transports;r.transports=n?n.slice():[];let i=OFr(r);i.on("close",()=>this._delete(t)),this.loggers.set(t,i)}return this.loggers.get(t)}get(t,r){return this.add(t,r)}has(t){return!!this.loggers.has(t)}close(t){if(t)return this._removeLogger(t);this.loggers.forEach((r,n)=>this._removeLogger(n))}_removeLogger(t){if(!this.loggers.has(t))return;this.loggers.get(t).close(),this._delete(t)}_delete(t){this.loggers.delete(t)}}});var MV=h(ni=>{"use strict";var dWe=Yfe(),{warn:Y0}=Qfe();ni.version=UVe().version;ni.transports=L9e();ni.config=TV();ni.addColors=dWe.levels;ni.format=dWe.format;ni.createLogger=she();ni.ExceptionHandler=the();ni.RejectionHandler=nhe();ni.Container=uWe();ni.Transport=Fy();ni.loggers=new ni.Container;var kf=ni.createLogger();Object.keys(ni.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>ni[e]=(...t)=>kf[e](...t));Object.defineProperty(ni,"level",{get(){return kf.level},set(e){kf.level=e}});Object.defineProperty(ni,"exceptions",{get(){return kf.exceptions}});["exitOnError"].forEach(e=>{Object.defineProperty(ni,e,{get(){return kf[e]},set(t){kf[e]=t}})});Object.defineProperty(ni,"default",{get(){return{exceptionHandlers:kf.exceptionHandlers,rejectionHandlers:kf.rejectionHandlers,transports:kf.transports}}});Y0.deprecated(ni,"setLevels");Y0.forFunctions(ni,"useFormat",["cli"]);Y0.forProperties(ni,"useFormat",["padLevels","stripColors"]);Y0.forFunctions(ni,"deprecated",["addRewriter","addFilter","clone","extend"]);Y0.forProperties(ni,"deprecated",["emitErrs","levelLength"]);Y0.moved(ni,"createLogger","Logger")});var pWe=h(od=>{"use strict";var kFr=od&&od.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(od,"__esModule",{value:!0});od.getHumanFormat=od.errorFormatting=od.getJsonFormat=void 0;var jf=kFr(MV());function jFr(){return jf.default.format.combine(jf.default.format.errors(),jf.default.format.json(),jf.default.format.timestamp({alias:"time"}))}od.getJsonFormat=jFr;od.errorFormatting=jf.default.format.printf(e=>`${e.timestamp} ${e.level}: ${e.stack||e.message}`);function DFr(){return jf.default.format.combine(jf.default.format.colorize(),jf.default.format.timestamp(),jf.default.format.errors({stack:!0}),od.errorFormatting)}od.getHumanFormat=DFr});var Py=h(Vh=>{"use strict";var qFr=Vh&&Vh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vh,"__esModule",{value:!0});Vh.getLogger=Vh.Logger=void 0;var mWe=qFr(MV()),fWe=pWe(),NFr=MV();Object.defineProperty(Vh,"Logger",{enumerable:!0,get:function(){return NFr.Logger}});function MFr(e){var t;let r=e.format==="human"?(0,fWe.getHumanFormat)():(0,fWe.getJsonFormat)();return mWe.default.createLogger({defaultMeta:{...e.meta,name:e.name},format:r,transports:[new mWe.default.transports.Console({silent:(t=e.silent)!==null&&t!==void 0?t:process.env.NODE_ENV==="test"})]})}Vh.getLogger=MFr});var ahe=h(LV=>{"use strict";Object.defineProperty(LV,"__esModule",{value:!0});LV.CloudflareApiKeyService=void 0;var _We=yGe(),hWe=hue(),LFr=Py(),Hh={"matrix-keys":[],"inter-service-keys":[]},gWe,zFr=7*24*3600*1e3,ohe=class{constructor(t,r){this.secretName=t,this.secretsClient=new _We.SecretsManagerClient({region:"ap-southeast-2"}),r||(r=(0,LFr.getLogger)({name:"CloudflareApiKeyService"})),this.logger=r}matrixKeyIsValid(t,r){var n;if(Hh["matrix-keys"].length==0)throw new hWe.UnAuthenticatedRequestError("No api keys to check against");return Hh["matrix-keys"].includes(t)?(this.logger.info("Request authenticated using legacy Matrix API key",{url:r.url,userAgent:(n=r.headers)===null||n===void 0?void 0:n["user-agent"]}),!0):!1}interServiceKeyIsValid(t){if(Hh["inter-service-keys"].length==0)throw new hWe.UnAuthenticatedRequestError("No inter service api keys to check against");return Hh["inter-service-keys"].includes(t)}async getValidApiKeys(){let t;try{t=await this.secretsClient.send(new _We.GetSecretValueCommand({SecretId:this.secretName}))}catch(r){throw console.error(r),new Error("Failed to request api key from aws"+r.message)}try{if(!t.SecretString)throw new Error("cloudflare api key SecretString undefined");let r=JSON.parse(t.SecretString);if(r["matrix-keys"]&&r["inter-service-keys"])return r;throw new Error("api keys retrieved and decoded successfully but contained no values")}catch{throw new Error("failed to decode cloudflare api key values")}}async refreshApiKeys(){this.logger.info("refreshing keys"),Hh=await this.getValidApiKeys(),this.logger.info(`found ${Hh["matrix-keys"].length} valid matrix keys`),this.logger.info(`found ${Hh["inter-service-keys"].length} valid inter service keys`),gWe||(gWe=setInterval(async()=>{await this.refreshApiKeys()},zFr))}getInterServiceKeys(){return Hh["inter-service-keys"]}};LV.CloudflareApiKeyService=ohe});var lhe=h(zV=>{"use strict";Object.defineProperty(zV,"__esModule",{value:!0});zV.DevelopmentApiKeyService=void 0;var UFr=Py(),che=class{constructor(t){this.logger=t||(0,UFr.getLogger)({name:"DevelopmentApiKeyService"})}matrixKeyIsValid(t,r){var n;return this.logger.info("Request authenticated using legacy Matrix API key",{url:r.url,userAgent:(n=r.headers)===null||n===void 0?void 0:n["user-agent"]}),!0}interServiceKeyIsValid(t){return Boolean(t&&this.getInterServiceKeys().includes(t))}getInterServiceKeys(){return["inter-service-api-key"]}};zV.DevelopmentApiKeyService=che});var yWe=h(UV=>{"use strict";Object.defineProperty(UV,"__esModule",{value:!0});UV.getApiKeyService=void 0;var vWe=que(),BFr=ahe(),$Fr=lhe();function GFr(e){let t=(0,vWe.getNodeEnv)();switch(t){case"development":return new $Fr.DevelopmentApiKeyService;case"production":if(e==null)throw new Error("invalid production state, need to have deploymentEnvironment and squiz region set");return new BFr.CloudflareApiKeyService(`dx-${e.deploymentEnvironment}-${e.squizRegion}-cmp-cloudflare-keys`);default:(0,vWe.never)(t)}}UV.getApiKeyService=GFr});var uhe=h(BV=>{"use strict";Object.defineProperty(BV,"__esModule",{value:!0});BV.applyDefaultRulesToCacheControlObject=void 0;var Df=dhe();function VFr(e){let t={...e};return t["max-age"]!==void 0&&(t["max-age"]=(0,Df.ensureBetween)(t["max-age"],Df.MIN_CACHE_SECONDS,Df.MAX_CACHE_SECONDS)),t["s-maxage"]!==void 0&&(t["s-maxage"]=(0,Df.ensureBetween)(t["s-maxage"],Df.MIN_CACHE_SECONDS,Df.MAX_CACHE_SECONDS)),t["min-fresh"]!==void 0&&(t["min-fresh"]=(0,Df.ensureBetween)(t["min-fresh"],Df.MIN_CACHE_SECONDS,Df.MAX_CACHE_SECONDS)),delete t["no-store"],delete t["no-cache"],t}BV.applyDefaultRulesToCacheControlObject=VFr});var phe=h($V=>{"use strict";Object.defineProperty($V,"__esModule",{value:!0});$V.cacheControlToString=void 0;function HFr(e){let t=[];for(let r of Object.keys(e)){let n=e[r];typeof n=="boolean"&&n===!0?t.push(r):(typeof n=="number"?n=n.toString():typeof n=="string"&&(n=`"${n}"`),t.push(`${r}=${n}`))}return t.join(", ")}$V.cacheControlToString=HFr});var mhe=h(GV=>{"use strict";Object.defineProperty(GV,"__esModule",{value:!0});GV.parseCacheControl=void 0;function WFr(e){let t=e.split(/,(?=(?:[^"]|"[^"]*")*$)/),r={};for(let n of t){let[i,s]=n.split("="),o=i.trim(),a=s!==void 0?s.trim():void 0,c=JFr(a),u=KFr(c,o);r[o]=u}return r}GV.parseCacheControl=WFr;function JFr(e){return e===void 0?e:e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e}function KFr(e,t){if(t==="max-age"||t==="s-maxage"||t==="min-fresh"||t==="stale-while-revalidate"||t==="stale-if-error")if(e){let r=parseInt(e,10);return isNaN(r)?e||!0:r}else return 0;return e===void 0?!0:e}});var dhe=h(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.ensureBetween=il.parseAndSanitiseCacheControlHeader=il.DEFAULT_CACHE_CONTROL_HEADER=il.MAX_CACHE_SECONDS=il.MIN_CACHE_SECONDS=void 0;var YFr=uhe(),bWe=phe(),QFr=mhe();il.MIN_CACHE_SECONDS=30;il.MAX_CACHE_SECONDS=SWe(30);il.DEFAULT_CACHE_CONTROL_HEADER=(0,bWe.cacheControlToString)({public:!0,"max-age":SWe(30)});function XFr(e){if(!e)return il.DEFAULT_CACHE_CONTROL_HEADER;let t=(0,QFr.parseCacheControl)(e);return t=(0,YFr.applyDefaultRulesToCacheControlObject)(t),(0,bWe.cacheControlToString)(t)}il.parseAndSanitiseCacheControlHeader=XFr;function ZFr(e,t,r){return Math.max(t,Math.min(e,r))}il.ensureBetween=ZFr;function SWe(e){return e*60}});var EWe=h(lp=>{"use strict";var eCr=lp&&lp.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),VV=lp&&lp.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&eCr(t,e,r)};Object.defineProperty(lp,"__esModule",{value:!0});VV(dhe(),lp);VV(mhe(),lp);VV(uhe(),lp);VV(phe(),lp)});var FWe=h(wWe=>{"use strict";Object.defineProperty(wWe,"__esModule",{value:!0})});var xWe=h(CWe=>{"use strict";Object.defineProperty(CWe,"__esModule",{value:!0})});var PWe=h(Ql=>{"use strict";var tCr=Ql&&Ql.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),rCr=Ql&&Ql.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),RWe=Ql&&Ql.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&tCr(t,e,r);return rCr(t,e),t};Object.defineProperty(Ql,"__esModule",{value:!0});Ql.JobV1=Ql.v1=void 0;Ql.v1=RWe(FWe());Ql.JobV1=RWe(xWe())});var fhe=h((vMi,nCr)=>{nCr.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namespace of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var _he=h((yMi,iCr)=>{iCr.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"JobManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},name:{type:"string",description:"Name of the job",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the job"},description:{type:"string",description:"Description of the job"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},timeout:{type:"number",description:"Timeout in seconds before a job is stopped (min 5s, max 8h)",minimum:5,maximum:28800},concurrency:{type:"number",description:"The number of these jobs that can be run at once",minimum:1},functions:{type:"array",minItems:0,items:{title:"JobFunction",description:"Job function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"}},required:["name","entry","input"]}}},required:["name","displayName","description","version","functions","$schema","mainFunction","concurrency","timeout"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var IWe=h(Wh=>{"use strict";var AWe=Wh&&Wh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wh,"__esModule",{value:!0});Wh.JobV1=Wh.v1=void 0;var sCr=AWe(fhe());Wh.v1=sCr.default;var oCr=AWe(_he());Wh.JobV1=oCr.default});var OWe=h(TWe=>{"use strict";Object.defineProperty(TWe,"__esModule",{value:!0})});var kWe=h(up=>{"use strict";var aCr=up&&up.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),cCr=up&&up.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lCr=up&&up.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&aCr(t,e,r);return cCr(t,e),t};Object.defineProperty(up,"__esModule",{value:!0});up.v1=void 0;up.v1=lCr(OWe())});var hhe=h((wMi,uCr)=>{uCr.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/TextNode"},{$ref:"#/definitions/ComponentNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{title:"FormattedNodeFontProperties",type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}}},required:["type","tag","children"]},ComponentNode:{type:"object",additionalProperties:!1,properties:{type:{const:"component"},componentId:{type:"string"},componentSet:{type:"string"},contentItem:{type:"object",title:"ContentItemReference",properties:{id:{type:"string"}},required:[]}},required:["type","componentSet","componentId"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"}},required:["type","matrixDomain","matrixAssetId"]}}}});var jWe=h(Q0=>{"use strict";var dCr=Q0&&Q0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.v1=void 0;var pCr=dCr(hhe());Q0.v1=pCr.default});var ghe=h((exports,module)=>{(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof exports=="object"?exports.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:exports,()=>(()=>{var __webpack_modules__={604:function(e){typeof self<"u",e.exports=(()=>{"use strict";var t={d:(E,C)=>{for(var M in C)t.o(C,M)&&!t.o(E,M)&&Object.defineProperty(E,M,{enumerable:!0,get:C[M]})},o:(E,C)=>Object.prototype.hasOwnProperty.call(E,C),r:E=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})}},r={};function n(E){return E==="#"||E===""||Array.isArray(E)&&E.length===0||!1}t.r(r),t.d(r,{default:()=>A,get:()=>d,isRoot:()=>n,join:()=>R,remove:()=>F,removeUndefinedItems:()=>S,set:()=>y,split:()=>l});let i=/~1/g,s=/~0/g,o=/\/+/g,a=/(^[#/]*|\/+$)/g;function c(E){return E.replace(i,"/").replace(s,"~")}function u(E){return c(decodeURIComponent(E))}function l(E){if(E==null||typeof E!="string"||n(E))return Array.isArray(E)?E:[];let C=E.indexOf("#")>=0?u:c,M=(E=(E=E.replace(o,"/")).replace(a,"")).split("/");for(let D=0,V=M.length;D<V;D+=1)M[D]=C(M[D]);return M}function d(E,C,M){if(C==null||E==null)return M;if(n(C))return E;let D=p(E,l(C));return D===void 0?M:D}function p(E,C){let M=C.shift();if(E!==void 0)return M!==void 0?p(E[M],C):E}let m=/^\[.*\]$/,f=/^\[(.+)\]$/;function v(E,C){return E==="__proto__"||E=="constructor"&&C.length>0&&C[0]=="prototype"}function y(E,C,M){if(C==null)return E;let D=l(C);if(D.length===0)return E;E==null&&(E=m.test(D[0])?[]:{});let V,Y,oe=E;for(;D.length>1;)V=D.shift(),Y=m.test(D[0]),v(V,D)||(oe=g(oe,V,Y));return V=D.pop(),b(oe,V,M),E}function b(E,C,M){let D,V=C.match(f);C==="[]"&&Array.isArray(E)?E.push(M):V?(D=V.pop(),E[D]=M):E[C]=M}function g(E,C,M){if(E[C]!=null)return E[C];let D=M?[]:{};return b(E,C,D),D}function S(E){let C=0,M=0;for(;C+M<E.length;)E[C+M]===void 0&&(M+=1),E[C]=E[C+M],C+=1;return E.length=E.length-M,E}function F(E,C,M){let D=l(C),V=D.pop(),Y=d(E,D);return Y&&delete Y[V],Array.isArray(Y)&&M!==!0&&S(Y),E}let j=/\/+/g,P=/~/g,T=/\//g;function k(E,C){if(E.length===0)return C?"#":"";for(let M=0,D=E.length;M<D;M+=1)E[M]=E[M].replace(P,"~0").replace(T,"~1"),C&&(E[M]=encodeURIComponent(E[M]));return((C?"#/":"/")+E.join("/")).replace(j,"/")}function R(E,...C){let M=[];if(Array.isArray(E))return k(E,arguments[1]===!0);let D=arguments[arguments.length-1],V=typeof D=="boolean"?D:E&&E[0]==="#";for(let oe=0,L=arguments.length;oe<L;oe+=1)M.push.apply(M,l(arguments[oe]));let Y=[];for(let oe=0,L=M.length;oe<L;oe+=1)if(M[oe]===".."){if(Y.length===0)return V?"#":"";Y.pop()}else Y.push(M[oe]);return k(Y,V)}let A={get:d,set:y,remove:F,join:R,split:l,splitLast:function(E){let C=l(E);if(C.length===0)return typeof E=="string"&&E[0]==="#"?["#",C[0]]:["",void 0];if(C.length===1)return E[0]==="#"?["#",C[0]]:["",C[0]];let M=C.pop();return[R(C,E[0]==="#"),M]},isRoot:n,removeUndefinedItems:S};return r})()},723:(e,t,r)=>{"use strict";let n=r(802);var i;(function(s){s.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],s.defaultParser=new n.Parser(s.RULES,{debug:!1});let o=/^(!|&)/,a=/(\?|\+|\*)$/,c=/^%/;function u(g,S){if(typeof g=="string"){if(o.test(g))return"";if(c.test(g)){let F=a.exec(g),j=F?F[0]+" ":"";return function(T,k){let R=n.findRuleByName(T,k);return R&&R.bnf.length==1&&R.bnf[0].length==1&&(R.bnf[0][0]instanceof RegExp||R.bnf[0][0][0]=='"'||R.bnf[0][0][0]=="'")}(g,S)?l(g,S)+j:"("+l(g,S)+")"+j}return g}return g.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function l(g,S){let F=n.findRuleByName(g,S);return F?F.bnf.map(j=>function(P,T){return P.map(k=>u(k,T)).join(" ")}(j,S)).join(" | "):"RULE_NOT_FOUND {"+g+"}"}function d(g){let S=[];return g.grammarRules.forEach(F=>{if(!/^%/.test(F.name)){let j=F.recover?" /* { recoverUntil="+F.recover+" } */":"";S.push(F.name+" ::= "+l(F.name,g)+j)}}),S.join(`
|
|
63
|
+
`))}_onEvent(t,r){function n(i){t==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(t,i,r)}r["__winston"+t]||(r["__winston"+t]=n.bind(this),r.on(t,r["__winston"+t]))}_addDefaultMeta(t){this.defaultMeta&&Object.assign(t,this.defaultMeta)}};function ihe(e,t){let r=e[t];return!r&&r!==0?null:r}Object.defineProperty(NV.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});oWe.exports=NV});var she=h((tMi,cWe)=>{"use strict";var{LEVEL:RFr}=ds(),PFr=TV(),AFr=aWe(),IFr=KI()("winston:create-logger");function TFr(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}cWe.exports=function(e={}){e.levels=e.levels||PFr.npm.levels;class t extends AFr{constructor(i){super(i)}}let r=new t(e);return Object.keys(e.levels).forEach(function(n){if(IFr('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}t.prototype[n]=function(...i){let s=this||r;if(i.length===1){let[o]=i,a=o&&o.message&&o||{message:o};return a.level=a[RFr]=n,s._addDefaultMeta(a),s.write(a),this||r}return i.length===0?(s.log(n,""),s):s.log(n,...i)},t.prototype[TFr(n)]=function(){return(this||r).isLevelEnabled(n)}}),r}});var uWe=h((nMi,lWe)=>{"use strict";var OFr=she();lWe.exports=class{constructor(t={}){this.loggers=new Map,this.options=t}add(t,r){if(!this.loggers.has(t)){r=Object.assign({},r||this.options);let n=r.transports||this.options.transports;r.transports=n?n.slice():[];let i=OFr(r);i.on("close",()=>this._delete(t)),this.loggers.set(t,i)}return this.loggers.get(t)}get(t,r){return this.add(t,r)}has(t){return!!this.loggers.has(t)}close(t){if(t)return this._removeLogger(t);this.loggers.forEach((r,n)=>this._removeLogger(n))}_removeLogger(t){if(!this.loggers.has(t))return;this.loggers.get(t).close(),this._delete(t)}_delete(t){this.loggers.delete(t)}}});var MV=h(ni=>{"use strict";var dWe=Yfe(),{warn:Y0}=Qfe();ni.version=UVe().version;ni.transports=L9e();ni.config=TV();ni.addColors=dWe.levels;ni.format=dWe.format;ni.createLogger=she();ni.ExceptionHandler=the();ni.RejectionHandler=nhe();ni.Container=uWe();ni.Transport=Fy();ni.loggers=new ni.Container;var kf=ni.createLogger();Object.keys(ni.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>ni[e]=(...t)=>kf[e](...t));Object.defineProperty(ni,"level",{get(){return kf.level},set(e){kf.level=e}});Object.defineProperty(ni,"exceptions",{get(){return kf.exceptions}});["exitOnError"].forEach(e=>{Object.defineProperty(ni,e,{get(){return kf[e]},set(t){kf[e]=t}})});Object.defineProperty(ni,"default",{get(){return{exceptionHandlers:kf.exceptionHandlers,rejectionHandlers:kf.rejectionHandlers,transports:kf.transports}}});Y0.deprecated(ni,"setLevels");Y0.forFunctions(ni,"useFormat",["cli"]);Y0.forProperties(ni,"useFormat",["padLevels","stripColors"]);Y0.forFunctions(ni,"deprecated",["addRewriter","addFilter","clone","extend"]);Y0.forProperties(ni,"deprecated",["emitErrs","levelLength"]);Y0.moved(ni,"createLogger","Logger")});var pWe=h(od=>{"use strict";var kFr=od&&od.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(od,"__esModule",{value:!0});od.getHumanFormat=od.errorFormatting=od.getJsonFormat=void 0;var jf=kFr(MV());function jFr(){return jf.default.format.combine(jf.default.format.errors(),jf.default.format.json(),jf.default.format.timestamp({alias:"time"}))}od.getJsonFormat=jFr;od.errorFormatting=jf.default.format.printf(e=>`${e.timestamp} ${e.level}: ${e.stack||e.message}`);function DFr(){return jf.default.format.combine(jf.default.format.colorize(),jf.default.format.timestamp(),jf.default.format.errors({stack:!0}),od.errorFormatting)}od.getHumanFormat=DFr});var Py=h(Vh=>{"use strict";var qFr=Vh&&Vh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vh,"__esModule",{value:!0});Vh.getLogger=Vh.Logger=void 0;var mWe=qFr(MV()),fWe=pWe(),NFr=MV();Object.defineProperty(Vh,"Logger",{enumerable:!0,get:function(){return NFr.Logger}});function MFr(e){var t;let r=e.format==="human"?(0,fWe.getHumanFormat)():(0,fWe.getJsonFormat)();return mWe.default.createLogger({defaultMeta:{...e.meta,name:e.name},format:r,transports:[new mWe.default.transports.Console({silent:(t=e.silent)!==null&&t!==void 0?t:process.env.NODE_ENV==="test"})]})}Vh.getLogger=MFr});var ahe=h(LV=>{"use strict";Object.defineProperty(LV,"__esModule",{value:!0});LV.CloudflareApiKeyService=void 0;var _We=yGe(),hWe=hue(),LFr=Py(),Hh={"matrix-keys":[],"inter-service-keys":[]},gWe,zFr=7*24*3600*1e3,ohe=class{constructor(t,r){this.secretName=t,this.secretsClient=new _We.SecretsManagerClient({region:"ap-southeast-2"}),r||(r=(0,LFr.getLogger)({name:"CloudflareApiKeyService"})),this.logger=r}matrixKeyIsValid(t,r){var n;if(Hh["matrix-keys"].length==0)throw new hWe.UnAuthenticatedRequestError("No api keys to check against");return Hh["matrix-keys"].includes(t)?(this.logger.info("Request authenticated using legacy Matrix API key",{url:r.url,userAgent:(n=r.headers)===null||n===void 0?void 0:n["user-agent"]}),!0):!1}interServiceKeyIsValid(t){if(Hh["inter-service-keys"].length==0)throw new hWe.UnAuthenticatedRequestError("No inter service api keys to check against");return Hh["inter-service-keys"].includes(t)}async getValidApiKeys(){let t;try{t=await this.secretsClient.send(new _We.GetSecretValueCommand({SecretId:this.secretName}))}catch(r){throw console.error(r),new Error("Failed to request api key from aws"+r.message)}try{if(!t.SecretString)throw new Error("cloudflare api key SecretString undefined");let r=JSON.parse(t.SecretString);if(r["matrix-keys"]&&r["inter-service-keys"])return r;throw new Error("api keys retrieved and decoded successfully but contained no values")}catch{throw new Error("failed to decode cloudflare api key values")}}async refreshApiKeys(){this.logger.info("refreshing keys"),Hh=await this.getValidApiKeys(),this.logger.info(`found ${Hh["matrix-keys"].length} valid matrix keys`),this.logger.info(`found ${Hh["inter-service-keys"].length} valid inter service keys`),gWe||(gWe=setInterval(async()=>{await this.refreshApiKeys()},zFr))}getInterServiceKeys(){return Hh["inter-service-keys"]}};LV.CloudflareApiKeyService=ohe});var lhe=h(zV=>{"use strict";Object.defineProperty(zV,"__esModule",{value:!0});zV.DevelopmentApiKeyService=void 0;var UFr=Py(),che=class{constructor(t){this.logger=t||(0,UFr.getLogger)({name:"DevelopmentApiKeyService"})}matrixKeyIsValid(t,r){var n;return this.logger.info("Request authenticated using legacy Matrix API key",{url:r.url,userAgent:(n=r.headers)===null||n===void 0?void 0:n["user-agent"]}),!0}interServiceKeyIsValid(t){return Boolean(t&&this.getInterServiceKeys().includes(t))}getInterServiceKeys(){return["inter-service-api-key"]}};zV.DevelopmentApiKeyService=che});var yWe=h(UV=>{"use strict";Object.defineProperty(UV,"__esModule",{value:!0});UV.getApiKeyService=void 0;var vWe=que(),BFr=ahe(),$Fr=lhe();function GFr(e){let t=(0,vWe.getNodeEnv)();switch(t){case"development":return new $Fr.DevelopmentApiKeyService;case"production":if(e==null)throw new Error("invalid production state, need to have deploymentEnvironment and squiz region set");return new BFr.CloudflareApiKeyService(`dx-${e.deploymentEnvironment}-${e.squizRegion}-cmp-cloudflare-keys`);default:(0,vWe.never)(t)}}UV.getApiKeyService=GFr});var uhe=h(BV=>{"use strict";Object.defineProperty(BV,"__esModule",{value:!0});BV.applyDefaultRulesToCacheControlObject=void 0;var Df=dhe();function VFr(e){let t={...e};return t["max-age"]!==void 0&&(t["max-age"]=(0,Df.ensureBetween)(t["max-age"],Df.MIN_CACHE_SECONDS,Df.MAX_CACHE_SECONDS)),t["s-maxage"]!==void 0&&(t["s-maxage"]=(0,Df.ensureBetween)(t["s-maxage"],Df.MIN_CACHE_SECONDS,Df.MAX_CACHE_SECONDS)),t["min-fresh"]!==void 0&&(t["min-fresh"]=(0,Df.ensureBetween)(t["min-fresh"],Df.MIN_CACHE_SECONDS,Df.MAX_CACHE_SECONDS)),delete t["no-store"],delete t["no-cache"],t}BV.applyDefaultRulesToCacheControlObject=VFr});var phe=h($V=>{"use strict";Object.defineProperty($V,"__esModule",{value:!0});$V.cacheControlToString=void 0;function HFr(e){let t=[];for(let r of Object.keys(e)){let n=e[r];typeof n=="boolean"&&n===!0?t.push(r):(typeof n=="number"?n=n.toString():typeof n=="string"&&(n=`"${n}"`),t.push(`${r}=${n}`))}return t.join(", ")}$V.cacheControlToString=HFr});var mhe=h(GV=>{"use strict";Object.defineProperty(GV,"__esModule",{value:!0});GV.parseCacheControl=void 0;function WFr(e){let t=e.split(/,(?=(?:[^"]|"[^"]*")*$)/),r={};for(let n of t){let[i,s]=n.split("="),o=i.trim(),a=s!==void 0?s.trim():void 0,c=JFr(a),u=KFr(c,o);r[o]=u}return r}GV.parseCacheControl=WFr;function JFr(e){return e===void 0?e:e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e}function KFr(e,t){if(t==="max-age"||t==="s-maxage"||t==="min-fresh"||t==="stale-while-revalidate"||t==="stale-if-error")if(e){let r=parseInt(e,10);return isNaN(r)?e||!0:r}else return 0;return e===void 0?!0:e}});var dhe=h(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.ensureBetween=il.parseAndSanitiseCacheControlHeader=il.DEFAULT_CACHE_CONTROL_HEADER=il.MAX_CACHE_SECONDS=il.MIN_CACHE_SECONDS=void 0;var YFr=uhe(),bWe=phe(),QFr=mhe();il.MIN_CACHE_SECONDS=30;il.MAX_CACHE_SECONDS=SWe(30);il.DEFAULT_CACHE_CONTROL_HEADER=(0,bWe.cacheControlToString)({public:!0,"max-age":SWe(30)});function XFr(e){if(!e)return il.DEFAULT_CACHE_CONTROL_HEADER;let t=(0,QFr.parseCacheControl)(e);return t=(0,YFr.applyDefaultRulesToCacheControlObject)(t),(0,bWe.cacheControlToString)(t)}il.parseAndSanitiseCacheControlHeader=XFr;function ZFr(e,t,r){return Math.max(t,Math.min(e,r))}il.ensureBetween=ZFr;function SWe(e){return e*60}});var EWe=h(lp=>{"use strict";var eCr=lp&&lp.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),VV=lp&&lp.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&eCr(t,e,r)};Object.defineProperty(lp,"__esModule",{value:!0});VV(dhe(),lp);VV(mhe(),lp);VV(uhe(),lp);VV(phe(),lp)});var FWe=h(wWe=>{"use strict";Object.defineProperty(wWe,"__esModule",{value:!0})});var xWe=h(CWe=>{"use strict";Object.defineProperty(CWe,"__esModule",{value:!0})});var PWe=h(Ql=>{"use strict";var tCr=Ql&&Ql.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),rCr=Ql&&Ql.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),RWe=Ql&&Ql.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&tCr(t,e,r);return rCr(t,e),t};Object.defineProperty(Ql,"__esModule",{value:!0});Ql.JobV1=Ql.v1=void 0;Ql.v1=RWe(FWe());Ql.JobV1=RWe(xWe())});var fhe=h((vMi,nCr)=>{nCr.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namespace of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var _he=h((yMi,iCr)=>{iCr.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"JobManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},name:{type:"string",description:"Name of the job",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the job"},description:{type:"string",description:"Description of the job"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},timeout:{type:"number",description:"Timeout in seconds before a job is stopped (min 10min, max 8h)",minimum:600,maximum:28800},concurrency:{type:"number",description:"The number of these jobs that can be run at once",minimum:1},functions:{type:"array",minItems:0,items:{title:"JobFunction",description:"Job function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"}},required:["name","entry","input"]}}},required:["name","displayName","description","version","functions","$schema","mainFunction","concurrency","timeout"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var IWe=h(Wh=>{"use strict";var AWe=Wh&&Wh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wh,"__esModule",{value:!0});Wh.JobV1=Wh.v1=void 0;var sCr=AWe(fhe());Wh.v1=sCr.default;var oCr=AWe(_he());Wh.JobV1=oCr.default});var OWe=h(TWe=>{"use strict";Object.defineProperty(TWe,"__esModule",{value:!0})});var kWe=h(up=>{"use strict";var aCr=up&&up.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),cCr=up&&up.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lCr=up&&up.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&aCr(t,e,r);return cCr(t,e),t};Object.defineProperty(up,"__esModule",{value:!0});up.v1=void 0;up.v1=lCr(OWe())});var hhe=h((wMi,uCr)=>{uCr.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/TextNode"},{$ref:"#/definitions/ComponentNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{title:"FormattedNodeFontProperties",type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}}},required:["type","tag","children"]},ComponentNode:{type:"object",additionalProperties:!1,properties:{type:{const:"component"},componentId:{type:"string"},componentSet:{type:"string"},contentItem:{type:"object",title:"ContentItemReference",properties:{id:{type:"string"}},required:[]}},required:["type","componentSet","componentId"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"}},required:["type","matrixDomain","matrixAssetId"]}}}});var jWe=h(Q0=>{"use strict";var dCr=Q0&&Q0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.v1=void 0;var pCr=dCr(hhe());Q0.v1=pCr.default});var ghe=h((exports,module)=>{(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof exports=="object"?exports.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:exports,()=>(()=>{var __webpack_modules__={604:function(e){typeof self<"u",e.exports=(()=>{"use strict";var t={d:(E,C)=>{for(var M in C)t.o(C,M)&&!t.o(E,M)&&Object.defineProperty(E,M,{enumerable:!0,get:C[M]})},o:(E,C)=>Object.prototype.hasOwnProperty.call(E,C),r:E=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})}},r={};function n(E){return E==="#"||E===""||Array.isArray(E)&&E.length===0||!1}t.r(r),t.d(r,{default:()=>A,get:()=>d,isRoot:()=>n,join:()=>R,remove:()=>F,removeUndefinedItems:()=>S,set:()=>y,split:()=>l});let i=/~1/g,s=/~0/g,o=/\/+/g,a=/(^[#/]*|\/+$)/g;function c(E){return E.replace(i,"/").replace(s,"~")}function u(E){return c(decodeURIComponent(E))}function l(E){if(E==null||typeof E!="string"||n(E))return Array.isArray(E)?E:[];let C=E.indexOf("#")>=0?u:c,M=(E=(E=E.replace(o,"/")).replace(a,"")).split("/");for(let D=0,V=M.length;D<V;D+=1)M[D]=C(M[D]);return M}function d(E,C,M){if(C==null||E==null)return M;if(n(C))return E;let D=p(E,l(C));return D===void 0?M:D}function p(E,C){let M=C.shift();if(E!==void 0)return M!==void 0?p(E[M],C):E}let m=/^\[.*\]$/,f=/^\[(.+)\]$/;function v(E,C){return E==="__proto__"||E=="constructor"&&C.length>0&&C[0]=="prototype"}function y(E,C,M){if(C==null)return E;let D=l(C);if(D.length===0)return E;E==null&&(E=m.test(D[0])?[]:{});let V,Y,oe=E;for(;D.length>1;)V=D.shift(),Y=m.test(D[0]),v(V,D)||(oe=g(oe,V,Y));return V=D.pop(),b(oe,V,M),E}function b(E,C,M){let D,V=C.match(f);C==="[]"&&Array.isArray(E)?E.push(M):V?(D=V.pop(),E[D]=M):E[C]=M}function g(E,C,M){if(E[C]!=null)return E[C];let D=M?[]:{};return b(E,C,D),D}function S(E){let C=0,M=0;for(;C+M<E.length;)E[C+M]===void 0&&(M+=1),E[C]=E[C+M],C+=1;return E.length=E.length-M,E}function F(E,C,M){let D=l(C),V=D.pop(),Y=d(E,D);return Y&&delete Y[V],Array.isArray(Y)&&M!==!0&&S(Y),E}let j=/\/+/g,P=/~/g,T=/\//g;function k(E,C){if(E.length===0)return C?"#":"";for(let M=0,D=E.length;M<D;M+=1)E[M]=E[M].replace(P,"~0").replace(T,"~1"),C&&(E[M]=encodeURIComponent(E[M]));return((C?"#/":"/")+E.join("/")).replace(j,"/")}function R(E,...C){let M=[];if(Array.isArray(E))return k(E,arguments[1]===!0);let D=arguments[arguments.length-1],V=typeof D=="boolean"?D:E&&E[0]==="#";for(let oe=0,L=arguments.length;oe<L;oe+=1)M.push.apply(M,l(arguments[oe]));let Y=[];for(let oe=0,L=M.length;oe<L;oe+=1)if(M[oe]===".."){if(Y.length===0)return V?"#":"";Y.pop()}else Y.push(M[oe]);return k(Y,V)}let A={get:d,set:y,remove:F,join:R,split:l,splitLast:function(E){let C=l(E);if(C.length===0)return typeof E=="string"&&E[0]==="#"?["#",C[0]]:["",void 0];if(C.length===1)return E[0]==="#"?["#",C[0]]:["",C[0]];let M=C.pop();return[R(C,E[0]==="#"),M]},isRoot:n,removeUndefinedItems:S};return r})()},723:(e,t,r)=>{"use strict";let n=r(802);var i;(function(s){s.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],s.defaultParser=new n.Parser(s.RULES,{debug:!1});let o=/^(!|&)/,a=/(\?|\+|\*)$/,c=/^%/;function u(g,S){if(typeof g=="string"){if(o.test(g))return"";if(c.test(g)){let F=a.exec(g),j=F?F[0]+" ":"";return function(T,k){let R=n.findRuleByName(T,k);return R&&R.bnf.length==1&&R.bnf[0].length==1&&(R.bnf[0][0]instanceof RegExp||R.bnf[0][0][0]=='"'||R.bnf[0][0][0]=="'")}(g,S)?l(g,S)+j:"("+l(g,S)+")"+j}return g}return g.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function l(g,S){let F=n.findRuleByName(g,S);return F?F.bnf.map(j=>function(P,T){return P.map(k=>u(k,T)).join(" ")}(j,S)).join(" | "):"RULE_NOT_FOUND {"+g+"}"}function d(g){let S=[];return g.grammarRules.forEach(F=>{if(!/^%/.test(F.name)){let j=F.recover?" /* { recoverUntil="+F.recover+" } */":"";S.push(F.name+" ::= "+l(F.name,g)+j)}}),S.join(`
|
|
64
64
|
`)}s.emit=d;let p=0;function m(g){return new RegExp(g.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function f(g,S,F){let j=null,P=[];return S.children.forEach((T,k)=>{T.type=="Minus"&&function(A,E){throw console.log("reberia restar "+E+" a "+A),new Error("Difference not supported yet")}(j,T);let R=S.children[k+1];switch(R=R&&R.type=="PrimaryDecoration"&&R.text||"",T.type){case"SubItem":let A="%"+(F+p++);v(g,T,A),P.push(""+A+R);break;case"NCName":case"StringLiteral":P.push(""+T.text+R);break;case"CharCode":case"CharClass":if(R){let E={name:"%"+(F+p++),bnf:[[m(T.text)]]};g.push(E),P.push(""+E.name+R)}else P.push(m(T.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+T.type+" -> "+JSON.stringify(T.text))}j=T}),P}function v(g,S,F){let j=S.children.filter(k=>k.type=="SequenceOrDifference").map(k=>f(g,k,F)),P={name:F,bnf:j},T=null;j.forEach(k=>{T=T||k.recover,delete k.recover}),F.indexOf("%")==0&&(P.fragment=!0),T&&(P.recover=T),g.push(P)}function y(g,S=s.defaultParser){let F=S.getAST(g);if(!F)throw new Error("Could not parse "+g);if(F.errors&&F.errors.length)throw F.errors[0];let j=[];return F.children.filter(P=>P.type=="Production").map(P=>{let T=P.children.filter(k=>k.type=="NCName")[0].text;v(j,P,T)}),j}s.getRules=y,s.Transform=function(g,S=s.defaultParser){return y(g.join(""),S)};class b extends n.Parser{constructor(S,F){super(y(S,F&&F.debugRulesParser===!0?new n.Parser(s.RULES,{debug:!0}):s.defaultParser),F)}emitSource(){return d(this)}}s.Parser=b})(i||(i={})),t.Z=i},802:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Parser=exports.findRuleByName=exports.parseRuleName=exports.escapeRegExp=exports.readToken=void 0;let UPPER_SNAKE_RE=/^[A-Z0-9_]+$/,decorationRE=/(\?|\+|\*)$/,preDecorationRE=/^(@|&|!)/,WS_RULE="WS",TokenError_1=__webpack_require__(239);function readToken(e,t){let r=t.exec(e);return r&&r.index==0?r[0].length==0&&t.source.length>0?null:{type:null,text:r[0],rest:e.substr(r[0].length),start:0,end:r[0].length-1,fullText:r[0],errors:[],children:[],parent:null}:null}function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function fixRest(e){e.rest="",e.children&&e.children.forEach(t=>fixRest(t))}function fixPositions(e,t){e.start+=t,e.end+=t,e.children&&e.children.forEach(r=>fixPositions(r,e.start))}function agregateErrors(e,t){t.errors&&t.errors.length&&t.errors.forEach(r=>e.push(r)),t.children&&t.children.forEach(r=>agregateErrors(e,r))}function parseRuleName(e){let t=decorationRE.exec(e),r=preDecorationRE.exec(e),n=t&&t[0]||"",i=r&&r[0]||"",s={raw:e,name:e.replace(decorationRE,"").replace(preDecorationRE,""),isOptional:n=="?"||n=="*",allowRepetition:n=="+"||n=="*",atLeastOne:n=="+",lookupPositive:i=="&",lookupNegative:i=="!",pinned:i=="@",lookup:!1,isLiteral:!1};return s.isLiteral=s.name[0]=="'"||s.name[0]=='"',s.lookup=s.lookupNegative||s.lookupPositive,s}function findRuleByName(e,t){let r=parseRuleName(e);return t.cachedRules[r.name]||null}function stripRules(e,t){if(e.children){let r=e.children.filter(n=>n.type&&t.test(n.type));for(let n=0;n<r.length;n++){let i=e.children.indexOf(r[n]);i!=-1&&e.children.splice(i,1)}e.children.forEach(n=>stripRules(n,t))}}exports.readToken=readToken,exports.escapeRegExp=escapeRegExp,exports.parseRuleName=parseRuleName,exports.findRuleByName=findRuleByName;let ignoreMissingRules=["EOF"];class Parser{constructor(e,t){this.grammarRules=e,this.options=t,this.cachedRules={},this.debug=!!t&&t.debug===!0;let r=[],n=[];if(e.forEach(i=>{let s=parseRuleName(i.name);if(s.name in this.cachedRules)r.push("Duplicated rule "+s.name);else{if(this.cachedRules[s.name]=i,i.bnf&&i.bnf.length)i.bnf.forEach(o=>{if(typeof o[0]=="string"&&parseRuleName(o[0]).name==i.name){let a="Left recursion is not allowed, rule: "+i.name;r.indexOf(a)==-1&&r.push(a)}o.forEach(a=>{if(typeof a=="string"){let c=parseRuleName(a);c.isLiteral||n.indexOf(c.name)!=-1||ignoreMissingRules.indexOf(c.name)!=-1||n.push(c.name)}})});else{let o="Missing rule content, rule: "+i.name;r.indexOf(o)==-1&&r.push(o)}WS_RULE==i.name&&(i.implicitWs=!1),i.implicitWs&&n.indexOf(WS_RULE)==-1&&n.push(WS_RULE),i.recover&&n.indexOf(i.recover)==-1&&n.push(i.recover)}}),n.forEach(i=>{i in this.cachedRules||r.push("Missing rule "+i)}),r.length)throw new Error(r.join(`
|
|
65
65
|
`))}getAST(e,t){t||(t=this.grammarRules.filter(n=>!n.fragment&&n.name.indexOf("%")!=0)[0].name);let r=this.parse(e,t);if(r){agregateErrors(r.errors,r),fixPositions(r,0),stripRules(r,/^%/),this.options&&this.options.keepUpperRules||stripRules(r,UPPER_SNAKE_RE);let n=r.rest;n&&new TokenError_1.TokenError(`Unexpected end of input:
|
|
66
66
|
`+n,r),fixRest(r),r.rest=n}return r}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(txt,target,recursion=0){let out=null,type=parseRuleName(target),expr,printable=this.debug&&!UPPER_SNAKE_RE.test(type.name);printable&&console.log(new Array(recursion).join("\u2502 ")+"Trying to get "+target+" from "+JSON.stringify(txt.split(`
|
|
@@ -204,7 +204,7 @@ ${L}`),V.pop(),`{${ee}}`}case"number":return isFinite(D)?String(D):g?g(D):"null"
|
|
|
204
204
|
`),stack:u.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(u)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:r.loadavg(),uptime:r.uptime()}}getTrace(u){return(u?o.parse(u):o.get()).map(d=>({column:d.getColumnNumber(),file:d.getFileName(),function:d.getFunctionName(),line:d.getLineNumber(),method:d.getMethodName(),native:d.isNative()}))}_addHandler(u){if(!this.handlers.has(u)){u.handleExceptions=!0;let l=new a(u);this.handlers.set(u,l),this.logger.pipe(l)}}_uncaughtException(u){let l=this.getAllInfo(u),d=this._getExceptionHandlers(),p=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(u):this.logger.exitOnError,m;!d.length&&p&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),p=!1);function f(){i("doExit",p),i("process._exiting",process._exiting),p&&!process._exiting&&(m&&clearTimeout(m),process.exit(1))}if(!d||d.length===0)return process.nextTick(f);n(d,(v,y)=>{let b=s(y),g=v.transport||v;function S(F){return()=>{i(F),b()}}g._ending=!0,g.once("finish",S("finished")),g.once("error",S("error"))},()=>p&&f()),this.logger.log(l),p&&(m=setTimeout(f,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(u=>(u.transport||u).handleExceptions)}}}}),require_rejection_handler=__commonJS({"../../node_modules/winston/lib/winston/rejection-handler.js"(e,t){"use strict";var r=require("os"),n=require_forEach(),i=require_node2()("winston:rejection"),s=require_one_time(),o=require_stack_trace(),a=require_exception_stream();t.exports=class{constructor(u){if(!u)throw new Error("Logger is required to handle rejections");this.logger=u,this.handlers=new Map}handle(...u){u.forEach(l=>{if(Array.isArray(l))return l.forEach(d=>this._addHandler(d));this._addHandler(l)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(u=>this.logger.unpipe(u)))}getAllInfo(u){let l=null;return u&&(l=typeof u=="string"?u:u.message),{error:u,level:"error",message:[`unhandledRejection: ${l||"(no error message)"}`,u&&u.stack||" No stack trace"].join(`
|
|
205
205
|
`),stack:u&&u.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(u)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:r.loadavg(),uptime:r.uptime()}}getTrace(u){return(u?o.parse(u):o.get()).map(d=>({column:d.getColumnNumber(),file:d.getFileName(),function:d.getFunctionName(),line:d.getLineNumber(),method:d.getMethodName(),native:d.isNative()}))}_addHandler(u){if(!this.handlers.has(u)){u.handleRejections=!0;let l=new a(u);this.handlers.set(u,l),this.logger.pipe(l)}}_unhandledRejection(u){let l=this.getAllInfo(u),d=this._getRejectionHandlers(),p=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(u):this.logger.exitOnError,m;!d.length&&p&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),p=!1);function f(){i("doExit",p),i("process._exiting",process._exiting),p&&!process._exiting&&(m&&clearTimeout(m),process.exit(1))}if(!d||d.length===0)return process.nextTick(f);n(d,(v,y)=>{let b=s(y),g=v.transport||v;function S(F){return()=>{i(F),b()}}g._ending=!0,g.once("finish",S("finished")),g.once("error",S("error"))},()=>p&&f()),this.logger.log(l),p&&(m=setTimeout(f,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(u=>(u.transport||u).handleRejections)}}}}),require_profiler=__commonJS({"../../node_modules/winston/lib/winston/profiler.js"(e,t){"use strict";t.exports=class{constructor(n){if(!n)throw new Error("Logger is required for profiling.");this.logger=n,this.start=Date.now()}done(...n){typeof n[n.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),n.pop());let i=typeof n[n.length-1]=="object"?n.pop():{};return i.level=i.level||"info",i.durationMs=Date.now()-this.start,this.logger.write(i)}}}}),require_logger2=__commonJS({"../../node_modules/winston/lib/winston/logger.js"(e,t){"use strict";var{Stream:r,Transform:n}=require_readable3(),i=require_forEach(),{LEVEL:s,SPLAT:o}=require_triple_beam(),a=require_is_stream(),c=require_exception_handler(),u=require_rejection_handler(),l=require_legacy(),d=require_profiler(),{warn:p}=require_common2(),m=require_config4(),f=/%[scdjifoO%]/g,v=class extends n{constructor(b){super({objectMode:!0}),this.configure(b)}child(b){let g=this;return Object.create(g,{write:{value:function(S){let F=Object.assign({},b,S);S instanceof Error&&(F.stack=S.stack,F.message=S.message),g.write(F)}}})}configure({silent:b,format:g,defaultMeta:S,levels:F,level:j="info",exitOnError:P=!0,transports:T,colors:k,emitErrs:R,formatters:A,padLevels:E,rewriters:C,stripColors:M,exceptionHandlers:D,rejectionHandlers:V}={}){if(this.transports.length&&this.clear(),this.silent=b,this.format=g||this.format||require_json3()(),this.defaultMeta=S||null,this.levels=F||this.levels||m.npm.levels,this.level=j,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new c(this),this.rejections=new u(this),this.profilers={},this.exitOnError=P,T&&(T=Array.isArray(T)?T:[T],T.forEach(Y=>this.add(Y))),k||R||A||E||C||M)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
206
206
|
`));D&&this.exceptions.handle(D),V&&this.rejections.handle(V)}isLevelEnabled(b){let g=y(this.levels,b);if(g===null)return!1;let S=y(this.levels,this.level);return S===null?!1:!this.transports||this.transports.length===0?S>=g:this.transports.findIndex(j=>{let P=y(this.levels,j.level);return P===null&&(P=S),P>=g})!==-1}log(b,g,...S){if(arguments.length===1)return b[s]=b.level,this._addDefaultMeta(b),this.write(b),this;if(arguments.length===2)return g&&typeof g=="object"?(g[s]=g.level=b,this._addDefaultMeta(g),this.write(g),this):(g={[s]:b,level:b,message:g},this._addDefaultMeta(g),this.write(g),this);let[F]=S;if(typeof F=="object"&&F!==null&&!(g&&g.match&&g.match(f))){let P=Object.assign({},this.defaultMeta,F,{[s]:b,[o]:S,level:b,message:g});return F.message&&(P.message=`${P.message} ${F.message}`),F.stack&&(P.stack=F.stack),this.write(P),this}return this.write(Object.assign({},this.defaultMeta,{[s]:b,[o]:S,level:b,message:g})),this}_transform(b,g,S){if(this.silent)return S();b[s]||(b[s]=b.level),!this.levels[b[s]]&&this.levels[b[s]]!==0&&console.error("[winston] Unknown logger level: %s",b[s]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",b);try{this.push(this.format.transform(b,this.format.options))}finally{this._writableState.sync=!1,S()}}_final(b){let g=this.transports.slice();i(g,(S,F)=>{if(!S||S.finished)return setImmediate(F);S.once("finish",F),S.end()},b)}add(b){let g=!a(b)||b.log.length>2?new l({transport:b}):b;if(!g._writableState||!g._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",g),this._onEvent("warn",g),this.pipe(g),b.handleExceptions&&this.exceptions.handle(),b.handleRejections&&this.rejections.handle(),this}remove(b){if(!b)return this;let g=b;return(!a(b)||b.log.length>2)&&(g=this.transports.filter(S=>S.transport===b)[0]),g&&this.unpipe(g),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){p.deprecated("setLevels")}query(b,g){typeof b=="function"&&(g=b,b={}),b=b||{};let S={},F=Object.assign({},b.query||{});function j(T,k){b.query&&typeof T.formatQuery=="function"&&(b.query=T.formatQuery(F)),T.query(b,(R,A)=>{if(R)return k(R);typeof T.formatResults=="function"&&(A=T.formatResults(A,b.format)),k(null,A)})}function P(T,k){j(T,(R,A)=>{k&&(A=R||A,A&&(S[T.name]=A),k()),k=null})}i(this.transports.filter(T=>!!T.query),P,()=>g(null,S))}stream(b={}){let g=new r,S=[];return g._streams=S,g.destroy=()=>{let F=S.length;for(;F--;)S[F].destroy()},this.transports.filter(F=>!!F.stream).forEach(F=>{let j=F.stream(b);j&&(S.push(j),j.on("log",P=>{P.transport=P.transport||[],P.transport.push(F.name),g.emit("log",P)}),j.on("error",P=>{P.transport=P.transport||[],P.transport.push(F.name),g.emit("error",P)}))}),g}startTimer(){return new d(this)}profile(b,...g){let S=Date.now();if(this.profilers[b]){let F=this.profilers[b];delete this.profilers[b],typeof g[g.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),g.pop());let j=typeof g[g.length-1]=="object"?g.pop():{};return j.level=j.level||"info",j.durationMs=S-F,j.message=j.message||b,this.write(j)}return this.profilers[b]=S,this}handleExceptions(...b){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...b)}unhandleExceptions(...b){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...b)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
207
|
-
`))}_onEvent(b,g){function S(F){b==="error"&&!this.transports.includes(g)&&this.add(g),this.emit(b,F,g)}g["__winston"+b]||(g["__winston"+b]=S.bind(this),g.on(b,g["__winston"+b]))}_addDefaultMeta(b){this.defaultMeta&&Object.assign(b,this.defaultMeta)}};function y(b,g){let S=b[g];return!S&&S!==0?null:S}Object.defineProperty(v.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:b}=this._readableState;return Array.isArray(b)?b:[b].filter(Boolean)}}),t.exports=v}}),require_create_logger=__commonJS({"../../node_modules/winston/lib/winston/create-logger.js"(e,t){"use strict";var{LEVEL:r}=require_triple_beam(),n=require_config4(),i=require_logger2(),s=require_node2()("winston:create-logger");function o(a){return"is"+a.charAt(0).toUpperCase()+a.slice(1)+"Enabled"}t.exports=function(a={}){a.levels=a.levels||n.npm.levels;class c extends i{constructor(d){super(d)}}let u=new c(a);return Object.keys(a.levels).forEach(function(l){if(s('Define prototype method for "%s"',l),l==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}c.prototype[l]=function(...d){let p=this||u;if(d.length===1){let[m]=d,f=m&&m.message&&m||{message:m};return f.level=f[r]=l,p._addDefaultMeta(f),p.write(f),this||u}return d.length===0?(p.log(l,""),p):p.log(l,...d)},c.prototype[o(l)]=function(){return(this||u).isLevelEnabled(l)}}),u}}}),require_container=__commonJS({"../../node_modules/winston/lib/winston/container.js"(e,t){"use strict";var r=require_create_logger();t.exports=class{constructor(i={}){this.loggers=new Map,this.options=i}add(i,s){if(!this.loggers.has(i)){s=Object.assign({},s||this.options);let o=s.transports||this.options.transports;s.transports=o?o.slice():[];let a=r(s);a.on("close",()=>this._delete(i)),this.loggers.set(i,a)}return this.loggers.get(i)}get(i,s){return this.add(i,s)}has(i){return!!this.loggers.has(i)}close(i){if(i)return this._removeLogger(i);this.loggers.forEach((s,o)=>this._removeLogger(o))}_removeLogger(i){if(!this.loggers.has(i))return;this.loggers.get(i).close(),this._delete(i)}_delete(i){this.loggers.delete(i)}}}}),require_winston=__commonJS({"../../node_modules/winston/lib/winston.js"(e){"use strict";var t=require_logform(),{warn:r}=require_common2();e.version=require_package5().version,e.transports=require_transports(),e.config=require_config4(),e.addColors=t.levels,e.format=t.format,e.createLogger=require_create_logger(),e.ExceptionHandler=require_exception_handler(),e.RejectionHandler=require_rejection_handler(),e.Container=require_container(),e.Transport=require_winston_transport(),e.loggers=new e.Container;var n=e.createLogger();Object.keys(e.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(i=>e[i]=(...s)=>n[i](...s)),Object.defineProperty(e,"level",{get(){return n.level},set(i){n.level=i}}),Object.defineProperty(e,"exceptions",{get(){return n.exceptions}}),["exitOnError"].forEach(i=>{Object.defineProperty(e,i,{get(){return n[i]},set(s){n[i]=s}})}),Object.defineProperty(e,"default",{get(){return{exceptionHandlers:n.exceptionHandlers,rejectionHandlers:n.rejectionHandlers,transports:n.transports}}}),r.deprecated(e,"setLevels"),r.forFunctions(e,"useFormat",["cli"]),r.forProperties(e,"useFormat",["padLevels","stripColors"]),r.forFunctions(e,"deprecated",["addRewriter","addFilter","clone","extend"]),r.forProperties(e,"deprecated",["emitErrs","levelLength"]),r.moved(e,"createLogger","Logger")}}),require_formatters=__commonJS({"../dx-logger-lib/lib/formatters.js"(e){"use strict";var t=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.getHumanFormat=e.errorFormatting=e.getJsonFormat=void 0;var r=t(require_winston());function n(){return r.default.format.combine(r.default.format.errors(),r.default.format.json(),r.default.format.timestamp({alias:"time"}))}e.getJsonFormat=n,e.errorFormatting=r.default.format.printf(s=>`${s.timestamp} ${s.level}: ${s.stack||s.message}`);function i(){return r.default.format.combine(r.default.format.colorize(),r.default.format.timestamp(),r.default.format.errors({stack:!0}),e.errorFormatting)}e.getHumanFormat=i}}),require_lib4=__commonJS({"../dx-logger-lib/lib/index.js"(e){"use strict";var t=e&&e.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLogger=e.Logger=void 0;var r=t(require_winston()),n=require_formatters(),i=require_winston();Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return i.Logger}});function s(o){var a;let c=o.format==="human"?(0,n.getHumanFormat)():(0,n.getJsonFormat)();return r.default.createLogger({defaultMeta:{...o.meta,name:o.name},format:c,transports:[new r.default.transports.Console({silent:(a=o.silent)!==null&&a!==void 0?a:process.env.NODE_ENV==="test"})]})}e.getLogger=s}}),require_CloudflareApiKeyService=__commonJS({"../dx-common-lib/lib/api-key-validation/CloudflareApiKeyService.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CloudflareApiKeyService=void 0;var t=require_dist_cjs51(),r=require_UnAuthenticatedRequestError(),n=require_lib4(),i={"matrix-keys":[],"inter-service-keys":[]},s,o=7*24*3600*1e3,a=class{constructor(c,u){this.secretName=c,this.secretsClient=new t.SecretsManagerClient({region:"ap-southeast-2"}),u||(u=(0,n.getLogger)({name:"CloudflareApiKeyService"})),this.logger=u}matrixKeyIsValid(c,u){var l;if(i["matrix-keys"].length==0)throw new r.UnAuthenticatedRequestError("No api keys to check against");return i["matrix-keys"].includes(c)?(this.logger.info("Request authenticated using legacy Matrix API key",{url:u.url,userAgent:(l=u.headers)===null||l===void 0?void 0:l["user-agent"]}),!0):!1}interServiceKeyIsValid(c){if(i["inter-service-keys"].length==0)throw new r.UnAuthenticatedRequestError("No inter service api keys to check against");return i["inter-service-keys"].includes(c)}async getValidApiKeys(){let c;try{c=await this.secretsClient.send(new t.GetSecretValueCommand({SecretId:this.secretName}))}catch(u){throw console.error(u),new Error("Failed to request api key from aws"+u.message)}try{if(!c.SecretString)throw new Error("cloudflare api key SecretString undefined");let u=JSON.parse(c.SecretString);if(u["matrix-keys"]&&u["inter-service-keys"])return u;throw new Error("api keys retrieved and decoded successfully but contained no values")}catch{throw new Error("failed to decode cloudflare api key values")}}async refreshApiKeys(){this.logger.info("refreshing keys"),i=await this.getValidApiKeys(),this.logger.info(`found ${i["matrix-keys"].length} valid matrix keys`),this.logger.info(`found ${i["inter-service-keys"].length} valid inter service keys`),s||(s=setInterval(async()=>{await this.refreshApiKeys()},o))}getInterServiceKeys(){return i["inter-service-keys"]}};e.CloudflareApiKeyService=a}}),require_DevelopmentApiKeyService=__commonJS({"../dx-common-lib/lib/api-key-validation/DevelopmentApiKeyService.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DevelopmentApiKeyService=void 0;var t=require_lib4(),r=class{constructor(n){this.logger=n||(0,t.getLogger)({name:"DevelopmentApiKeyService"})}matrixKeyIsValid(n,i){var s;return this.logger.info("Request authenticated using legacy Matrix API key",{url:i.url,userAgent:(s=i.headers)===null||s===void 0?void 0:s["user-agent"]}),!0}interServiceKeyIsValid(n){return Boolean(n&&this.getInterServiceKeys().includes(n))}getInterServiceKeys(){return["inter-service-api-key"]}};e.DevelopmentApiKeyService=r}}),require_getApiKeyService=__commonJS({"../dx-common-lib/lib/api-key-validation/getApiKeyService.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getApiKeyService=void 0;var t=require_util(),r=require_CloudflareApiKeyService(),n=require_DevelopmentApiKeyService();function i(s){let o=(0,t.getNodeEnv)();switch(o){case"development":return new n.DevelopmentApiKeyService;case"production":if(s==null)throw new Error("invalid production state, need to have deploymentEnvironment and squiz region set");return new r.CloudflareApiKeyService(`dx-${s.deploymentEnvironment}-${s.squizRegion}-cmp-cloudflare-keys`);default:(0,t.never)(o)}}e.getApiKeyService=i}}),require_applyDefaultRulesToCacheControlObject=__commonJS({"../dx-common-lib/lib/cache/applyDefaultRulesToCacheControlObject.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyDefaultRulesToCacheControlObject=void 0;var t=require_parseAndSanitiseCacheControlHeader();function r(n){let i={...n};return i["max-age"]!==void 0&&(i["max-age"]=(0,t.ensureBetween)(i["max-age"],t.MIN_CACHE_SECONDS,t.MAX_CACHE_SECONDS)),i["s-maxage"]!==void 0&&(i["s-maxage"]=(0,t.ensureBetween)(i["s-maxage"],t.MIN_CACHE_SECONDS,t.MAX_CACHE_SECONDS)),i["min-fresh"]!==void 0&&(i["min-fresh"]=(0,t.ensureBetween)(i["min-fresh"],t.MIN_CACHE_SECONDS,t.MAX_CACHE_SECONDS)),delete i["no-store"],delete i["no-cache"],i}e.applyDefaultRulesToCacheControlObject=r}}),require_cacheControlToString=__commonJS({"../dx-common-lib/lib/cache/cacheControlToString.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cacheControlToString=void 0;function t(r){let n=[];for(let i of Object.keys(r)){let s=r[i];typeof s=="boolean"&&s===!0?n.push(i):(typeof s=="number"?s=s.toString():typeof s=="string"&&(s=`"${s}"`),n.push(`${i}=${s}`))}return n.join(", ")}e.cacheControlToString=t}}),require_parseCacheControl=__commonJS({"../dx-common-lib/lib/cache/parseCacheControl.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseCacheControl=void 0;function t(i){let s=i.split(/,(?=(?:[^"]|"[^"]*")*$)/),o={};for(let a of s){let[c,u]=a.split("="),l=c.trim(),d=u!==void 0?u.trim():void 0,p=r(d),m=n(p,l);o[l]=m}return o}e.parseCacheControl=t;function r(i){return i===void 0?i:i[0]==='"'&&i[i.length-1]==='"'?i.substring(1,i.length-1):i}function n(i,s){if(s==="max-age"||s==="s-maxage"||s==="min-fresh"||s==="stale-while-revalidate"||s==="stale-if-error")if(i){let o=parseInt(i,10);return isNaN(o)?i||!0:o}else return 0;return i===void 0?!0:i}}}),require_parseAndSanitiseCacheControlHeader=__commonJS({"../dx-common-lib/lib/cache/parseAndSanitiseCacheControlHeader.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ensureBetween=e.parseAndSanitiseCacheControlHeader=e.DEFAULT_CACHE_CONTROL_HEADER=e.MAX_CACHE_SECONDS=e.MIN_CACHE_SECONDS=void 0;var t=require_applyDefaultRulesToCacheControlObject(),r=require_cacheControlToString(),n=require_parseCacheControl();e.MIN_CACHE_SECONDS=30,e.MAX_CACHE_SECONDS=o(30),e.DEFAULT_CACHE_CONTROL_HEADER=(0,r.cacheControlToString)({public:!0,"max-age":o(30)});function i(a){if(!a)return e.DEFAULT_CACHE_CONTROL_HEADER;let c=(0,n.parseCacheControl)(a);return c=(0,t.applyDefaultRulesToCacheControlObject)(c),(0,r.cacheControlToString)(c)}e.parseAndSanitiseCacheControlHeader=i;function s(a,c,u){return Math.max(c,Math.min(a,u))}e.ensureBetween=s;function o(a){return a*60}}}),require_cache=__commonJS({"../dx-common-lib/lib/cache/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=e&&e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(require_parseAndSanitiseCacheControlHeader(),e),r(require_parseCacheControl(),e),r(require_applyDefaultRulesToCacheControlObject(),e),r(require_cacheControlToString(),e)}}),require_v1=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/v1.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})}}),require_JobV1=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/JobV1.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})}}),require_manifestModels=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/manifestModels.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__setModuleDefault||(Object.create?function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}:function(i,s){i.default=s}),n=e&&e.__importStar||function(i){if(i&&i.__esModule)return i;var s={};if(i!=null)for(var o in i)o!=="default"&&Object.prototype.hasOwnProperty.call(i,o)&&t(s,i,o);return r(s,i),s};Object.defineProperty(e,"__esModule",{value:!0}),e.JobV1=e.v1=void 0,e.v1=n(require_v1()),e.JobV1=n(require_JobV1())}}),require_v12=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/v1.json"(e,t){t.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namespace of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}}}),require_JobV12=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/JobV1.json"(e,t){t.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"JobManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},name:{type:"string",description:"Name of the job",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the job"},description:{type:"string",description:"Description of the job"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},timeout:{type:"number",description:"Timeout in seconds before a job is stopped (min 5s, max 8h)",minimum:5,maximum:28800},concurrency:{type:"number",description:"The number of these jobs that can be run at once",minimum:1},functions:{type:"array",minItems:0,items:{title:"JobFunction",description:"Job function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"}},required:["name","entry","input"]}}},required:["name","displayName","description","version","functions","$schema","mainFunction","concurrency","timeout"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}}}),require_manifestSchemas=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/manifestSchemas.js"(e){"use strict";var t=e&&e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.JobV1=e.v1=void 0;var r=t(require_v12());e.v1=r.default;var n=t(require_JobV12());e.JobV1=n.default}}),require_formattedText=__commonJS({"../dx-json-schema-lib/lib/formatted-text/v1/formattedText.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})}}),require_formattedTextModels=__commonJS({"../dx-json-schema-lib/lib/formatted-text/v1/formattedTextModels.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__setModuleDefault||(Object.create?function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}:function(i,s){i.default=s}),n=e&&e.__importStar||function(i){if(i&&i.__esModule)return i;var s={};if(i!=null)for(var o in i)o!=="default"&&Object.prototype.hasOwnProperty.call(i,o)&&t(s,i,o);return r(s,i),s};Object.defineProperty(e,"__esModule",{value:!0}),e.v1=void 0,e.v1=n(require_formattedText())}}),require_formattedText2=__commonJS({"../dx-json-schema-lib/lib/formatted-text/v1/formattedText.json"(e,t){t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/TextNode"},{$ref:"#/definitions/ComponentNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{title:"FormattedNodeFontProperties",type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}}},required:["type","tag","children"]},ComponentNode:{type:"object",additionalProperties:!1,properties:{type:{const:"component"},componentId:{type:"string"},componentSet:{type:"string"},contentItem:{type:"object",title:"ContentItemReference",properties:{id:{type:"string"}},required:[]}},required:["type","componentSet","componentId"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"}},required:["type","matrixDomain","matrixAssetId"]}}}}}),require_formattedTextSchemas=__commonJS({"../dx-json-schema-lib/lib/formatted-text/v1/formattedTextSchemas.js"(e){"use strict";var t=e&&e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.v1=void 0;var r=t(require_formattedText2());e.v1=r.default}}),require_jsonQuery=__commonJS({"../../node_modules/@sagold/json-query/dist/jsonQuery.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof exports=="object"?exports.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:exports,()=>(()=>{var __webpack_modules__={604:function(e){typeof self<"u",e.exports=(()=>{"use strict";var t={d:(E,C)=>{for(var M in C)t.o(C,M)&&!t.o(E,M)&&Object.defineProperty(E,M,{enumerable:!0,get:C[M]})},o:(E,C)=>Object.prototype.hasOwnProperty.call(E,C),r:E=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})}},r={};function n(E){return E==="#"||E===""||Array.isArray(E)&&E.length===0||!1}t.r(r),t.d(r,{default:()=>A,get:()=>d,isRoot:()=>n,join:()=>R,remove:()=>F,removeUndefinedItems:()=>S,set:()=>y,split:()=>l});let i=/~1/g,s=/~0/g,o=/\/+/g,a=/(^[#/]*|\/+$)/g;function c(E){return E.replace(i,"/").replace(s,"~")}function u(E){return c(decodeURIComponent(E))}function l(E){if(E==null||typeof E!="string"||n(E))return Array.isArray(E)?E:[];let C=E.indexOf("#")>=0?u:c,M=(E=(E=E.replace(o,"/")).replace(a,"")).split("/");for(let D=0,V=M.length;D<V;D+=1)M[D]=C(M[D]);return M}function d(E,C,M){if(C==null||E==null)return M;if(n(C))return E;let D=p(E,l(C));return D===void 0?M:D}function p(E,C){let M=C.shift();if(E!==void 0)return M!==void 0?p(E[M],C):E}let m=/^\[.*\]$/,f=/^\[(.+)\]$/;function v(E,C){return E==="__proto__"||E=="constructor"&&C.length>0&&C[0]=="prototype"}function y(E,C,M){if(C==null)return E;let D=l(C);if(D.length===0)return E;E==null&&(E=m.test(D[0])?[]:{});let V,Y,oe=E;for(;D.length>1;)V=D.shift(),Y=m.test(D[0]),v(V,D)||(oe=g(oe,V,Y));return V=D.pop(),b(oe,V,M),E}function b(E,C,M){let D,V=C.match(f);C==="[]"&&Array.isArray(E)?E.push(M):V?(D=V.pop(),E[D]=M):E[C]=M}function g(E,C,M){if(E[C]!=null)return E[C];let D=M?[]:{};return b(E,C,D),D}function S(E){let C=0,M=0;for(;C+M<E.length;)E[C+M]===void 0&&(M+=1),E[C]=E[C+M],C+=1;return E.length=E.length-M,E}function F(E,C,M){let D=l(C),V=D.pop(),Y=d(E,D);return Y&&delete Y[V],Array.isArray(Y)&&M!==!0&&S(Y),E}let j=/\/+/g,P=/~/g,T=/\//g;function k(E,C){if(E.length===0)return C?"#":"";for(let M=0,D=E.length;M<D;M+=1)E[M]=E[M].replace(P,"~0").replace(T,"~1"),C&&(E[M]=encodeURIComponent(E[M]));return((C?"#/":"/")+E.join("/")).replace(j,"/")}function R(E,...C){let M=[];if(Array.isArray(E))return k(E,arguments[1]===!0);let D=arguments[arguments.length-1],V=typeof D=="boolean"?D:E&&E[0]==="#";for(let oe=0,L=arguments.length;oe<L;oe+=1)M.push.apply(M,l(arguments[oe]));let Y=[];for(let oe=0,L=M.length;oe<L;oe+=1)if(M[oe]===".."){if(Y.length===0)return V?"#":"";Y.pop()}else Y.push(M[oe]);return k(Y,V)}let A={get:d,set:y,remove:F,join:R,split:l,splitLast:function(E){let C=l(E);if(C.length===0)return typeof E=="string"&&E[0]==="#"?["#",C[0]]:["",void 0];if(C.length===1)return E[0]==="#"?["#",C[0]]:["",C[0]];let M=C.pop();return[R(C,E[0]==="#"),M]},isRoot:n,removeUndefinedItems:S};return r})()},723:(e,t,r)=>{"use strict";let n=r(802);var i;(function(s){s.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],s.defaultParser=new n.Parser(s.RULES,{debug:!1});let o=/^(!|&)/,a=/(\?|\+|\*)$/,c=/^%/;function u(g,S){if(typeof g=="string"){if(o.test(g))return"";if(c.test(g)){let F=a.exec(g),j=F?F[0]+" ":"";return function(T,k){let R=n.findRuleByName(T,k);return R&&R.bnf.length==1&&R.bnf[0].length==1&&(R.bnf[0][0]instanceof RegExp||R.bnf[0][0][0]=='"'||R.bnf[0][0][0]=="'")}(g,S)?l(g,S)+j:"("+l(g,S)+")"+j}return g}return g.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function l(g,S){let F=n.findRuleByName(g,S);return F?F.bnf.map(j=>function(P,T){return P.map(k=>u(k,T)).join(" ")}(j,S)).join(" | "):"RULE_NOT_FOUND {"+g+"}"}function d(g){let S=[];return g.grammarRules.forEach(F=>{if(!/^%/.test(F.name)){let j=F.recover?" /* { recoverUntil="+F.recover+" } */":"";S.push(F.name+" ::= "+l(F.name,g)+j)}}),S.join(`
|
|
207
|
+
`))}_onEvent(b,g){function S(F){b==="error"&&!this.transports.includes(g)&&this.add(g),this.emit(b,F,g)}g["__winston"+b]||(g["__winston"+b]=S.bind(this),g.on(b,g["__winston"+b]))}_addDefaultMeta(b){this.defaultMeta&&Object.assign(b,this.defaultMeta)}};function y(b,g){let S=b[g];return!S&&S!==0?null:S}Object.defineProperty(v.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:b}=this._readableState;return Array.isArray(b)?b:[b].filter(Boolean)}}),t.exports=v}}),require_create_logger=__commonJS({"../../node_modules/winston/lib/winston/create-logger.js"(e,t){"use strict";var{LEVEL:r}=require_triple_beam(),n=require_config4(),i=require_logger2(),s=require_node2()("winston:create-logger");function o(a){return"is"+a.charAt(0).toUpperCase()+a.slice(1)+"Enabled"}t.exports=function(a={}){a.levels=a.levels||n.npm.levels;class c extends i{constructor(d){super(d)}}let u=new c(a);return Object.keys(a.levels).forEach(function(l){if(s('Define prototype method for "%s"',l),l==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}c.prototype[l]=function(...d){let p=this||u;if(d.length===1){let[m]=d,f=m&&m.message&&m||{message:m};return f.level=f[r]=l,p._addDefaultMeta(f),p.write(f),this||u}return d.length===0?(p.log(l,""),p):p.log(l,...d)},c.prototype[o(l)]=function(){return(this||u).isLevelEnabled(l)}}),u}}}),require_container=__commonJS({"../../node_modules/winston/lib/winston/container.js"(e,t){"use strict";var r=require_create_logger();t.exports=class{constructor(i={}){this.loggers=new Map,this.options=i}add(i,s){if(!this.loggers.has(i)){s=Object.assign({},s||this.options);let o=s.transports||this.options.transports;s.transports=o?o.slice():[];let a=r(s);a.on("close",()=>this._delete(i)),this.loggers.set(i,a)}return this.loggers.get(i)}get(i,s){return this.add(i,s)}has(i){return!!this.loggers.has(i)}close(i){if(i)return this._removeLogger(i);this.loggers.forEach((s,o)=>this._removeLogger(o))}_removeLogger(i){if(!this.loggers.has(i))return;this.loggers.get(i).close(),this._delete(i)}_delete(i){this.loggers.delete(i)}}}}),require_winston=__commonJS({"../../node_modules/winston/lib/winston.js"(e){"use strict";var t=require_logform(),{warn:r}=require_common2();e.version=require_package5().version,e.transports=require_transports(),e.config=require_config4(),e.addColors=t.levels,e.format=t.format,e.createLogger=require_create_logger(),e.ExceptionHandler=require_exception_handler(),e.RejectionHandler=require_rejection_handler(),e.Container=require_container(),e.Transport=require_winston_transport(),e.loggers=new e.Container;var n=e.createLogger();Object.keys(e.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(i=>e[i]=(...s)=>n[i](...s)),Object.defineProperty(e,"level",{get(){return n.level},set(i){n.level=i}}),Object.defineProperty(e,"exceptions",{get(){return n.exceptions}}),["exitOnError"].forEach(i=>{Object.defineProperty(e,i,{get(){return n[i]},set(s){n[i]=s}})}),Object.defineProperty(e,"default",{get(){return{exceptionHandlers:n.exceptionHandlers,rejectionHandlers:n.rejectionHandlers,transports:n.transports}}}),r.deprecated(e,"setLevels"),r.forFunctions(e,"useFormat",["cli"]),r.forProperties(e,"useFormat",["padLevels","stripColors"]),r.forFunctions(e,"deprecated",["addRewriter","addFilter","clone","extend"]),r.forProperties(e,"deprecated",["emitErrs","levelLength"]),r.moved(e,"createLogger","Logger")}}),require_formatters=__commonJS({"../dx-logger-lib/lib/formatters.js"(e){"use strict";var t=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.getHumanFormat=e.errorFormatting=e.getJsonFormat=void 0;var r=t(require_winston());function n(){return r.default.format.combine(r.default.format.errors(),r.default.format.json(),r.default.format.timestamp({alias:"time"}))}e.getJsonFormat=n,e.errorFormatting=r.default.format.printf(s=>`${s.timestamp} ${s.level}: ${s.stack||s.message}`);function i(){return r.default.format.combine(r.default.format.colorize(),r.default.format.timestamp(),r.default.format.errors({stack:!0}),e.errorFormatting)}e.getHumanFormat=i}}),require_lib4=__commonJS({"../dx-logger-lib/lib/index.js"(e){"use strict";var t=e&&e.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLogger=e.Logger=void 0;var r=t(require_winston()),n=require_formatters(),i=require_winston();Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return i.Logger}});function s(o){var a;let c=o.format==="human"?(0,n.getHumanFormat)():(0,n.getJsonFormat)();return r.default.createLogger({defaultMeta:{...o.meta,name:o.name},format:c,transports:[new r.default.transports.Console({silent:(a=o.silent)!==null&&a!==void 0?a:process.env.NODE_ENV==="test"})]})}e.getLogger=s}}),require_CloudflareApiKeyService=__commonJS({"../dx-common-lib/lib/api-key-validation/CloudflareApiKeyService.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CloudflareApiKeyService=void 0;var t=require_dist_cjs51(),r=require_UnAuthenticatedRequestError(),n=require_lib4(),i={"matrix-keys":[],"inter-service-keys":[]},s,o=7*24*3600*1e3,a=class{constructor(c,u){this.secretName=c,this.secretsClient=new t.SecretsManagerClient({region:"ap-southeast-2"}),u||(u=(0,n.getLogger)({name:"CloudflareApiKeyService"})),this.logger=u}matrixKeyIsValid(c,u){var l;if(i["matrix-keys"].length==0)throw new r.UnAuthenticatedRequestError("No api keys to check against");return i["matrix-keys"].includes(c)?(this.logger.info("Request authenticated using legacy Matrix API key",{url:u.url,userAgent:(l=u.headers)===null||l===void 0?void 0:l["user-agent"]}),!0):!1}interServiceKeyIsValid(c){if(i["inter-service-keys"].length==0)throw new r.UnAuthenticatedRequestError("No inter service api keys to check against");return i["inter-service-keys"].includes(c)}async getValidApiKeys(){let c;try{c=await this.secretsClient.send(new t.GetSecretValueCommand({SecretId:this.secretName}))}catch(u){throw console.error(u),new Error("Failed to request api key from aws"+u.message)}try{if(!c.SecretString)throw new Error("cloudflare api key SecretString undefined");let u=JSON.parse(c.SecretString);if(u["matrix-keys"]&&u["inter-service-keys"])return u;throw new Error("api keys retrieved and decoded successfully but contained no values")}catch{throw new Error("failed to decode cloudflare api key values")}}async refreshApiKeys(){this.logger.info("refreshing keys"),i=await this.getValidApiKeys(),this.logger.info(`found ${i["matrix-keys"].length} valid matrix keys`),this.logger.info(`found ${i["inter-service-keys"].length} valid inter service keys`),s||(s=setInterval(async()=>{await this.refreshApiKeys()},o))}getInterServiceKeys(){return i["inter-service-keys"]}};e.CloudflareApiKeyService=a}}),require_DevelopmentApiKeyService=__commonJS({"../dx-common-lib/lib/api-key-validation/DevelopmentApiKeyService.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DevelopmentApiKeyService=void 0;var t=require_lib4(),r=class{constructor(n){this.logger=n||(0,t.getLogger)({name:"DevelopmentApiKeyService"})}matrixKeyIsValid(n,i){var s;return this.logger.info("Request authenticated using legacy Matrix API key",{url:i.url,userAgent:(s=i.headers)===null||s===void 0?void 0:s["user-agent"]}),!0}interServiceKeyIsValid(n){return Boolean(n&&this.getInterServiceKeys().includes(n))}getInterServiceKeys(){return["inter-service-api-key"]}};e.DevelopmentApiKeyService=r}}),require_getApiKeyService=__commonJS({"../dx-common-lib/lib/api-key-validation/getApiKeyService.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getApiKeyService=void 0;var t=require_util(),r=require_CloudflareApiKeyService(),n=require_DevelopmentApiKeyService();function i(s){let o=(0,t.getNodeEnv)();switch(o){case"development":return new n.DevelopmentApiKeyService;case"production":if(s==null)throw new Error("invalid production state, need to have deploymentEnvironment and squiz region set");return new r.CloudflareApiKeyService(`dx-${s.deploymentEnvironment}-${s.squizRegion}-cmp-cloudflare-keys`);default:(0,t.never)(o)}}e.getApiKeyService=i}}),require_applyDefaultRulesToCacheControlObject=__commonJS({"../dx-common-lib/lib/cache/applyDefaultRulesToCacheControlObject.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyDefaultRulesToCacheControlObject=void 0;var t=require_parseAndSanitiseCacheControlHeader();function r(n){let i={...n};return i["max-age"]!==void 0&&(i["max-age"]=(0,t.ensureBetween)(i["max-age"],t.MIN_CACHE_SECONDS,t.MAX_CACHE_SECONDS)),i["s-maxage"]!==void 0&&(i["s-maxage"]=(0,t.ensureBetween)(i["s-maxage"],t.MIN_CACHE_SECONDS,t.MAX_CACHE_SECONDS)),i["min-fresh"]!==void 0&&(i["min-fresh"]=(0,t.ensureBetween)(i["min-fresh"],t.MIN_CACHE_SECONDS,t.MAX_CACHE_SECONDS)),delete i["no-store"],delete i["no-cache"],i}e.applyDefaultRulesToCacheControlObject=r}}),require_cacheControlToString=__commonJS({"../dx-common-lib/lib/cache/cacheControlToString.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cacheControlToString=void 0;function t(r){let n=[];for(let i of Object.keys(r)){let s=r[i];typeof s=="boolean"&&s===!0?n.push(i):(typeof s=="number"?s=s.toString():typeof s=="string"&&(s=`"${s}"`),n.push(`${i}=${s}`))}return n.join(", ")}e.cacheControlToString=t}}),require_parseCacheControl=__commonJS({"../dx-common-lib/lib/cache/parseCacheControl.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseCacheControl=void 0;function t(i){let s=i.split(/,(?=(?:[^"]|"[^"]*")*$)/),o={};for(let a of s){let[c,u]=a.split("="),l=c.trim(),d=u!==void 0?u.trim():void 0,p=r(d),m=n(p,l);o[l]=m}return o}e.parseCacheControl=t;function r(i){return i===void 0?i:i[0]==='"'&&i[i.length-1]==='"'?i.substring(1,i.length-1):i}function n(i,s){if(s==="max-age"||s==="s-maxage"||s==="min-fresh"||s==="stale-while-revalidate"||s==="stale-if-error")if(i){let o=parseInt(i,10);return isNaN(o)?i||!0:o}else return 0;return i===void 0?!0:i}}}),require_parseAndSanitiseCacheControlHeader=__commonJS({"../dx-common-lib/lib/cache/parseAndSanitiseCacheControlHeader.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ensureBetween=e.parseAndSanitiseCacheControlHeader=e.DEFAULT_CACHE_CONTROL_HEADER=e.MAX_CACHE_SECONDS=e.MIN_CACHE_SECONDS=void 0;var t=require_applyDefaultRulesToCacheControlObject(),r=require_cacheControlToString(),n=require_parseCacheControl();e.MIN_CACHE_SECONDS=30,e.MAX_CACHE_SECONDS=o(30),e.DEFAULT_CACHE_CONTROL_HEADER=(0,r.cacheControlToString)({public:!0,"max-age":o(30)});function i(a){if(!a)return e.DEFAULT_CACHE_CONTROL_HEADER;let c=(0,n.parseCacheControl)(a);return c=(0,t.applyDefaultRulesToCacheControlObject)(c),(0,r.cacheControlToString)(c)}e.parseAndSanitiseCacheControlHeader=i;function s(a,c,u){return Math.max(c,Math.min(a,u))}e.ensureBetween=s;function o(a){return a*60}}}),require_cache=__commonJS({"../dx-common-lib/lib/cache/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=e&&e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(require_parseAndSanitiseCacheControlHeader(),e),r(require_parseCacheControl(),e),r(require_applyDefaultRulesToCacheControlObject(),e),r(require_cacheControlToString(),e)}}),require_v1=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/v1.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})}}),require_JobV1=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/JobV1.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})}}),require_manifestModels=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/manifestModels.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__setModuleDefault||(Object.create?function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}:function(i,s){i.default=s}),n=e&&e.__importStar||function(i){if(i&&i.__esModule)return i;var s={};if(i!=null)for(var o in i)o!=="default"&&Object.prototype.hasOwnProperty.call(i,o)&&t(s,i,o);return r(s,i),s};Object.defineProperty(e,"__esModule",{value:!0}),e.JobV1=e.v1=void 0,e.v1=n(require_v1()),e.JobV1=n(require_JobV1())}}),require_v12=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/v1.json"(e,t){t.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namespace of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}}}),require_JobV12=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/JobV1.json"(e,t){t.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"JobManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},name:{type:"string",description:"Name of the job",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the job"},description:{type:"string",description:"Description of the job"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},timeout:{type:"number",description:"Timeout in seconds before a job is stopped (min 10min, max 8h)",minimum:600,maximum:28800},concurrency:{type:"number",description:"The number of these jobs that can be run at once",minimum:1},functions:{type:"array",minItems:0,items:{title:"JobFunction",description:"Job function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"}},required:["name","entry","input"]}}},required:["name","displayName","description","version","functions","$schema","mainFunction","concurrency","timeout"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}}}),require_manifestSchemas=__commonJS({"../dx-json-schema-lib/lib/manifest/v1/manifestSchemas.js"(e){"use strict";var t=e&&e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.JobV1=e.v1=void 0;var r=t(require_v12());e.v1=r.default;var n=t(require_JobV12());e.JobV1=n.default}}),require_formattedText=__commonJS({"../dx-json-schema-lib/lib/formatted-text/v1/formattedText.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})}}),require_formattedTextModels=__commonJS({"../dx-json-schema-lib/lib/formatted-text/v1/formattedTextModels.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__setModuleDefault||(Object.create?function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}:function(i,s){i.default=s}),n=e&&e.__importStar||function(i){if(i&&i.__esModule)return i;var s={};if(i!=null)for(var o in i)o!=="default"&&Object.prototype.hasOwnProperty.call(i,o)&&t(s,i,o);return r(s,i),s};Object.defineProperty(e,"__esModule",{value:!0}),e.v1=void 0,e.v1=n(require_formattedText())}}),require_formattedText2=__commonJS({"../dx-json-schema-lib/lib/formatted-text/v1/formattedText.json"(e,t){t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/TextNode"},{$ref:"#/definitions/ComponentNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{title:"FormattedNodeFontProperties",type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}}},required:["type","tag","children"]},ComponentNode:{type:"object",additionalProperties:!1,properties:{type:{const:"component"},componentId:{type:"string"},componentSet:{type:"string"},contentItem:{type:"object",title:"ContentItemReference",properties:{id:{type:"string"}},required:[]}},required:["type","componentSet","componentId"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"}},required:["type","matrixDomain","matrixAssetId"]}}}}}),require_formattedTextSchemas=__commonJS({"../dx-json-schema-lib/lib/formatted-text/v1/formattedTextSchemas.js"(e){"use strict";var t=e&&e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.v1=void 0;var r=t(require_formattedText2());e.v1=r.default}}),require_jsonQuery=__commonJS({"../../node_modules/@sagold/json-query/dist/jsonQuery.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof exports=="object"?exports.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:exports,()=>(()=>{var __webpack_modules__={604:function(e){typeof self<"u",e.exports=(()=>{"use strict";var t={d:(E,C)=>{for(var M in C)t.o(C,M)&&!t.o(E,M)&&Object.defineProperty(E,M,{enumerable:!0,get:C[M]})},o:(E,C)=>Object.prototype.hasOwnProperty.call(E,C),r:E=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})}},r={};function n(E){return E==="#"||E===""||Array.isArray(E)&&E.length===0||!1}t.r(r),t.d(r,{default:()=>A,get:()=>d,isRoot:()=>n,join:()=>R,remove:()=>F,removeUndefinedItems:()=>S,set:()=>y,split:()=>l});let i=/~1/g,s=/~0/g,o=/\/+/g,a=/(^[#/]*|\/+$)/g;function c(E){return E.replace(i,"/").replace(s,"~")}function u(E){return c(decodeURIComponent(E))}function l(E){if(E==null||typeof E!="string"||n(E))return Array.isArray(E)?E:[];let C=E.indexOf("#")>=0?u:c,M=(E=(E=E.replace(o,"/")).replace(a,"")).split("/");for(let D=0,V=M.length;D<V;D+=1)M[D]=C(M[D]);return M}function d(E,C,M){if(C==null||E==null)return M;if(n(C))return E;let D=p(E,l(C));return D===void 0?M:D}function p(E,C){let M=C.shift();if(E!==void 0)return M!==void 0?p(E[M],C):E}let m=/^\[.*\]$/,f=/^\[(.+)\]$/;function v(E,C){return E==="__proto__"||E=="constructor"&&C.length>0&&C[0]=="prototype"}function y(E,C,M){if(C==null)return E;let D=l(C);if(D.length===0)return E;E==null&&(E=m.test(D[0])?[]:{});let V,Y,oe=E;for(;D.length>1;)V=D.shift(),Y=m.test(D[0]),v(V,D)||(oe=g(oe,V,Y));return V=D.pop(),b(oe,V,M),E}function b(E,C,M){let D,V=C.match(f);C==="[]"&&Array.isArray(E)?E.push(M):V?(D=V.pop(),E[D]=M):E[C]=M}function g(E,C,M){if(E[C]!=null)return E[C];let D=M?[]:{};return b(E,C,D),D}function S(E){let C=0,M=0;for(;C+M<E.length;)E[C+M]===void 0&&(M+=1),E[C]=E[C+M],C+=1;return E.length=E.length-M,E}function F(E,C,M){let D=l(C),V=D.pop(),Y=d(E,D);return Y&&delete Y[V],Array.isArray(Y)&&M!==!0&&S(Y),E}let j=/\/+/g,P=/~/g,T=/\//g;function k(E,C){if(E.length===0)return C?"#":"";for(let M=0,D=E.length;M<D;M+=1)E[M]=E[M].replace(P,"~0").replace(T,"~1"),C&&(E[M]=encodeURIComponent(E[M]));return((C?"#/":"/")+E.join("/")).replace(j,"/")}function R(E,...C){let M=[];if(Array.isArray(E))return k(E,arguments[1]===!0);let D=arguments[arguments.length-1],V=typeof D=="boolean"?D:E&&E[0]==="#";for(let oe=0,L=arguments.length;oe<L;oe+=1)M.push.apply(M,l(arguments[oe]));let Y=[];for(let oe=0,L=M.length;oe<L;oe+=1)if(M[oe]===".."){if(Y.length===0)return V?"#":"";Y.pop()}else Y.push(M[oe]);return k(Y,V)}let A={get:d,set:y,remove:F,join:R,split:l,splitLast:function(E){let C=l(E);if(C.length===0)return typeof E=="string"&&E[0]==="#"?["#",C[0]]:["",void 0];if(C.length===1)return E[0]==="#"?["#",C[0]]:["",C[0]];let M=C.pop();return[R(C,E[0]==="#"),M]},isRoot:n,removeUndefinedItems:S};return r})()},723:(e,t,r)=>{"use strict";let n=r(802);var i;(function(s){s.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],s.defaultParser=new n.Parser(s.RULES,{debug:!1});let o=/^(!|&)/,a=/(\?|\+|\*)$/,c=/^%/;function u(g,S){if(typeof g=="string"){if(o.test(g))return"";if(c.test(g)){let F=a.exec(g),j=F?F[0]+" ":"";return function(T,k){let R=n.findRuleByName(T,k);return R&&R.bnf.length==1&&R.bnf[0].length==1&&(R.bnf[0][0]instanceof RegExp||R.bnf[0][0][0]=='"'||R.bnf[0][0][0]=="'")}(g,S)?l(g,S)+j:"("+l(g,S)+")"+j}return g}return g.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function l(g,S){let F=n.findRuleByName(g,S);return F?F.bnf.map(j=>function(P,T){return P.map(k=>u(k,T)).join(" ")}(j,S)).join(" | "):"RULE_NOT_FOUND {"+g+"}"}function d(g){let S=[];return g.grammarRules.forEach(F=>{if(!/^%/.test(F.name)){let j=F.recover?" /* { recoverUntil="+F.recover+" } */":"";S.push(F.name+" ::= "+l(F.name,g)+j)}}),S.join(`
|
|
208
208
|
`)}s.emit=d;let p=0;function m(g){return new RegExp(g.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function f(g,S,F){let j=null,P=[];return S.children.forEach((T,k)=>{T.type=="Minus"&&function(A,E){throw console.log("reberia restar "+E+" a "+A),new Error("Difference not supported yet")}(j,T);let R=S.children[k+1];switch(R=R&&R.type=="PrimaryDecoration"&&R.text||"",T.type){case"SubItem":let A="%"+(F+p++);v(g,T,A),P.push(""+A+R);break;case"NCName":case"StringLiteral":P.push(""+T.text+R);break;case"CharCode":case"CharClass":if(R){let E={name:"%"+(F+p++),bnf:[[m(T.text)]]};g.push(E),P.push(""+E.name+R)}else P.push(m(T.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+T.type+" -> "+JSON.stringify(T.text))}j=T}),P}function v(g,S,F){let j=S.children.filter(k=>k.type=="SequenceOrDifference").map(k=>f(g,k,F)),P={name:F,bnf:j},T=null;j.forEach(k=>{T=T||k.recover,delete k.recover}),F.indexOf("%")==0&&(P.fragment=!0),T&&(P.recover=T),g.push(P)}function y(g,S=s.defaultParser){let F=S.getAST(g);if(!F)throw new Error("Could not parse "+g);if(F.errors&&F.errors.length)throw F.errors[0];let j=[];return F.children.filter(P=>P.type=="Production").map(P=>{let T=P.children.filter(k=>k.type=="NCName")[0].text;v(j,P,T)}),j}s.getRules=y,s.Transform=function(g,S=s.defaultParser){return y(g.join(""),S)};class b extends n.Parser{constructor(S,F){super(y(S,F&&F.debugRulesParser===!0?new n.Parser(s.RULES,{debug:!0}):s.defaultParser),F)}emitSource(){return d(this)}}s.Parser=b})(i||(i={})),t.Z=i},802:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Parser=exports.findRuleByName=exports.parseRuleName=exports.escapeRegExp=exports.readToken=void 0;let UPPER_SNAKE_RE=/^[A-Z0-9_]+$/,decorationRE=/(\?|\+|\*)$/,preDecorationRE=/^(@|&|!)/,WS_RULE="WS",TokenError_1=__webpack_require__(239);function readToken(e,t){let r=t.exec(e);return r&&r.index==0?r[0].length==0&&t.source.length>0?null:{type:null,text:r[0],rest:e.substr(r[0].length),start:0,end:r[0].length-1,fullText:r[0],errors:[],children:[],parent:null}:null}function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function fixRest(e){e.rest="",e.children&&e.children.forEach(t=>fixRest(t))}function fixPositions(e,t){e.start+=t,e.end+=t,e.children&&e.children.forEach(r=>fixPositions(r,e.start))}function agregateErrors(e,t){t.errors&&t.errors.length&&t.errors.forEach(r=>e.push(r)),t.children&&t.children.forEach(r=>agregateErrors(e,r))}function parseRuleName(e){let t=decorationRE.exec(e),r=preDecorationRE.exec(e),n=t&&t[0]||"",i=r&&r[0]||"",s={raw:e,name:e.replace(decorationRE,"").replace(preDecorationRE,""),isOptional:n=="?"||n=="*",allowRepetition:n=="+"||n=="*",atLeastOne:n=="+",lookupPositive:i=="&",lookupNegative:i=="!",pinned:i=="@",lookup:!1,isLiteral:!1};return s.isLiteral=s.name[0]=="'"||s.name[0]=='"',s.lookup=s.lookupNegative||s.lookupPositive,s}function findRuleByName(e,t){let r=parseRuleName(e);return t.cachedRules[r.name]||null}function stripRules(e,t){if(e.children){let r=e.children.filter(n=>n.type&&t.test(n.type));for(let n=0;n<r.length;n++){let i=e.children.indexOf(r[n]);i!=-1&&e.children.splice(i,1)}e.children.forEach(n=>stripRules(n,t))}}exports.readToken=readToken,exports.escapeRegExp=escapeRegExp,exports.parseRuleName=parseRuleName,exports.findRuleByName=findRuleByName;let ignoreMissingRules=["EOF"];class Parser{constructor(e,t){this.grammarRules=e,this.options=t,this.cachedRules={},this.debug=!!t&&t.debug===!0;let r=[],n=[];if(e.forEach(i=>{let s=parseRuleName(i.name);if(s.name in this.cachedRules)r.push("Duplicated rule "+s.name);else{if(this.cachedRules[s.name]=i,i.bnf&&i.bnf.length)i.bnf.forEach(o=>{if(typeof o[0]=="string"&&parseRuleName(o[0]).name==i.name){let a="Left recursion is not allowed, rule: "+i.name;r.indexOf(a)==-1&&r.push(a)}o.forEach(a=>{if(typeof a=="string"){let c=parseRuleName(a);c.isLiteral||n.indexOf(c.name)!=-1||ignoreMissingRules.indexOf(c.name)!=-1||n.push(c.name)}})});else{let o="Missing rule content, rule: "+i.name;r.indexOf(o)==-1&&r.push(o)}WS_RULE==i.name&&(i.implicitWs=!1),i.implicitWs&&n.indexOf(WS_RULE)==-1&&n.push(WS_RULE),i.recover&&n.indexOf(i.recover)==-1&&n.push(i.recover)}}),n.forEach(i=>{i in this.cachedRules||r.push("Missing rule "+i)}),r.length)throw new Error(r.join(`
|
|
209
209
|
`))}getAST(e,t){t||(t=this.grammarRules.filter(n=>!n.fragment&&n.name.indexOf("%")!=0)[0].name);let r=this.parse(e,t);if(r){agregateErrors(r.errors,r),fixPositions(r,0),stripRules(r,/^%/),this.options&&this.options.keepUpperRules||stripRules(r,UPPER_SNAKE_RE);let n=r.rest;n&&new TokenError_1.TokenError(`Unexpected end of input:
|
|
210
210
|
`+n,r),fixRest(r),r.rest=n}return r}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(txt,target,recursion=0){let out=null,type=parseRuleName(target),expr,printable=this.debug&&!UPPER_SNAKE_RE.test(type.name);printable&&console.log(new Array(recursion).join("\u2502 ")+"Trying to get "+target+" from "+JSON.stringify(txt.split(`
|
|
@@ -539,7 +539,7 @@ archiver/index.js:
|
|
|
539
539
|
*/
|
|
540
540
|
/**
|
|
541
541
|
* @title @squiz/content-api
|
|
542
|
-
* @version 1.
|
|
542
|
+
* @version 1.42.0
|
|
543
543
|
* @license ISC
|
|
544
544
|
* @baseUrl /
|
|
545
545
|
* @contact
|