@tocca-systems/twp-cli 0.115.0 → 0.117.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/CHANGELOG.public.md +10 -0
- package/README.md +14 -0
- package/dist/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/{agent-loop-5IBBUKPF.js → agent-loop-5SMJG7CB.js} +15 -12
- package/dist/{api-command-XHXLX45I.js → api-command-OF6D2Y36.js} +2 -2
- package/dist/{app-H6WJRVDR.js → app-G5PY25EA.js} +3 -3
- package/dist/{capacity-list-command-W3HOC5YB.js → capacity-list-command-EUU3H5ZE.js} +1 -1
- package/dist/{chunk-YNZZRPI3.js → chunk-36EIV45C.js} +1 -1
- package/dist/chunk-56LNKTKM.js +4 -0
- package/dist/{chunk-GFLGXGWE.js → chunk-F5QDUPQO.js} +1 -1
- package/dist/{chunk-VVOPXTGC.js → chunk-FFRQGBMA.js} +1 -1
- package/dist/{chunk-5R5Z6KHV.js → chunk-FHWNKVGK.js} +2 -2
- package/dist/chunk-HDTQIFEZ.js +13 -0
- package/dist/chunk-LKWVPL64.js +4 -0
- package/dist/chunk-RILZ457A.js +30 -0
- package/dist/cli.js +13 -8
- package/dist/{commands-CIMVQEMO.js → commands-OXPHECT2.js} +7 -7
- package/dist/{commands-WNPM6734.js → commands-P77EIMBU.js} +1 -1
- package/dist/{completion-RLEEOJMU.js → completion-3FLCVV73.js} +1 -1
- package/dist/dist-B4FAEXU4.js +120 -0
- package/dist/{media-JDLTK23Z.js → media-5UU6VILF.js} +2 -2
- package/dist/ojt-F53MIJS4.js +4 -0
- package/dist/{query-XEOVFI4D.js → query-J76QIXWR.js} +1 -1
- package/dist/{registry-TAPAIGQV.js → registry-A7WTKMXM.js} +1 -1
- package/dist/{run-ISFJYA2U.js → run-AOZ4DCJZ.js} +2 -2
- package/dist/{runner-command-POVZMRJ5.js → runner-command-YVY25WNU.js} +1 -1
- package/dist/{skill-check-2XYES4X3.js → skill-check-HL67H4KC.js} +1 -1
- package/dist/{skill-manage-command-QEZ5SI3A.js → skill-manage-command-HGLXVSJB.js} +2 -2
- package/dist/{status-command-LBTN3UWE.js → status-command-XGAFTFTW.js} +2 -2
- package/dist/{task-FLIYESKS.js → task-OHQ7BTOP.js} +21 -23
- package/dist/{teams-HGOGRVEL.js → teams-BOYIQMLW.js} +8 -7
- package/dist/{trigger-command-TQCKGHGL.js → trigger-command-QUWGCSXO.js} +1 -1
- package/dist/{user-6ACQM4GJ.js → user-PJRISUPH.js} +43 -28
- package/package.json +1 -1
- package/dist/chunk-AAABT3AX.js +0 -4
- package/dist/chunk-BBV5NLQZ.js +0 -13
- package/dist/dist-HZIZTJ4O.js +0 -93
|
@@ -4,7 +4,7 @@ import{stableJson}from"./chunk-76WVQ45F.js";import{reasonOf,unwrap}from"./chunk-
|
|
|
4
4
|
deps.api,opts,io);case"show":return await show(deps.api,opts,io);case"push":return await push(deps.api,opts,io);case"delete":return await remove(deps.api,opts,io);case"history":return await history(deps.api,opts,io);case"release":return await release(deps.api,opts,io)}}catch(e){if(e instanceof UsageError){io.err(`${e.message}
|
|
5
5
|
${e.hint?`${e.hint}
|
|
6
6
|
`:""}`);return EXIT_USAGE}throw e}}async function formatOf(opts,io){const{resolveOutputFormat}=await import("./format-X65HXAAU.js");const format=resolveOutputFormat({...opts.output!==void 0?{flag:opts.output}:{},isTty:io.isTty});if(format===null||!FORMATS.includes(format)){throw new UsageError(`trigger ${opts.op} \u306E --output \u306B\u300C${opts.output??""}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`\u6307\u5B9A\u3067\u304D\u308B\u306E\u306F ${FORMATS.join(" / ")} \u3067\u3059`)}
|
|
7
|
-
return format}async function emit(value,opts,format,io){const{evaluateQuery}=await import("./query-
|
|
7
|
+
return format}async function emit(value,opts,format,io){const{evaluateQuery}=await import("./query-J76QIXWR.js");const{renderOutput}=await import("./render-I6U5PEYR.js");const selected=opts.query===void 0?value:await evaluateQuery(opts.query,value);const text2=renderOutput(selected,format);io.out(text2.endsWith("\n")?text2:`${text2}
|
|
8
8
|
`)}async function list(api,opts,io){const format=await formatOf(opts,io);const triggers=await fetchTriggers(api,io.err);if(typeof triggers==="number")return triggers;const sorted=[...triggers].sort((a,b)=>str(a["id"]).localeCompare(str(b["id"])));if(format==="json"){await emit(sorted,opts,format,io);return EXIT_OK}io.err(`\u6761\u4EF6\u30C8\u30EA\u30AC\u30FC ${sorted.length} \u4EF6
|
|
9
9
|
`);if(opts.query===void 0&&sorted.length===0)return EXIT_OK;await emit(sorted.map(summaryRow),opts,format,io);return EXIT_OK}function summaryRow(t){const match=obj(t["match"]);const threshold=obj(t["threshold"]);const action=obj(t["action"]);const skills=Array.isArray(match["skills"])?match["skills"].map(String).join(","):"";const codes=Array.isArray(match["outcome_codes"])?match["outcome_codes"].map(String).join(","):"";return{id:str(t["id"]),enabled:t["enabled"]===false?"\u7121\u52B9":"\u6709\u52B9",
|
|
10
10
|
name:str(t["name"]),skills,outcome_codes:codes,condition:`${text(threshold["count"])}\u56DE/${text(threshold["window_hours"])}h${match["require_state_unchanged"]===false?"":"\u30FB\u72B6\u614B\u4E0D\u5909"}`,action:`${str(action["skill"])}${str(action["args"])!==""?` ${str(action["args"])}`:""}\uFF08${str(action["priority"])}\uFF09`,block_source:action["block_source"]===true?"\u3042\u308A":"\u306A\u3057",revision:t["revision"]??""}}async function show(api,opts,io){const id=requireId(opts);const format=await formatOf(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{infoNote}from"./chunk-TYO6THPW.js";import{FISCAL_YEAR_FLAG,fiscalYear,skillNames}from"./chunk-B6VOXDMC.js";import{ASSIGNED_PROJECT_COLUMNS,assignedProjectItems}from"./chunk-SEFV7AQB.js";import{LICENSE_FEATURE_NAMES,levelHoldsSeat,permissionMovesSeat,readLicenses}from"./chunk-HGM6DDYN.js";import{CONCURRENCY,exportOperation,mapPool,pacedSender}from"./chunk-ZFSQJAYZ.js";import"./chunk-Q3B65OFC.js";import"./chunk-FBTOIECJ.js";
|
|
4
|
-
issued}from"./chunk-6H5TPSXU.js";import{checkUploadQuota}from"./chunk-V64CGX7V.js";import{readCsvFileText}from"./chunk-QLENN5DD.js";import"./chunk-RMFLTSOV.js";import"./chunk-L4THNX4M.js";import"./chunk-KPLC3UP7.js";import{USER_REF_FLAG,USER_REF_HELP,prepareUser,userPath}from"./chunk-UVCJXHWN.js";import{createFlags,fieldBody,hasAnyField,resolveRefFields,updateFlags}from"./chunk-IOVZDBAD.js";import"./chunk-EXT4AIDF.js";
|
|
5
|
-
isoDate,isoDateValue}from"./chunk-JJSBBWJ5.js";import"./chunk-HEH3PUW2.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-VGT2EGH6.js";import{DEPARTMENTS_PATH,ORG_MASTER_LIMIT,POSITIONS_PATH}from"./chunk-A7MM5WSC.js";import{ResolveError,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import{ApiError}from"./chunk-JA5A6UJ2.js";import"./chunk-MMVXE2CJ.js";import"./chunk-SBRTBKEZ.js";
|
|
6
|
-
LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger,shellQuote}from"./chunk-MI6HVYR2.js";import{requireResolved,singleRef,withResolved}from"./chunk-PS5QFKHB.js";import{isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import{NotLoggedInError,SessionExpiredError}from"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";
|
|
7
|
-
import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs2 from"fs";var ASSIGNMENT_COLUMNS=["id","department_name","position_name","start_date","end_date","is_primary","is_current","is_approval_route","effective_status"];function assignmentRows(body){const response=isRecord(body)&&"response"in body?body["response"]:body;const list=isRecord(response)?response["list"]:void 0;if(!Array.isArray(list)){throw new ApiResponseError("\u6240\u5C5E\u4E00\u89A7\u306E\u5FDC\u7B54\u306B list \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
3
|
+
import{infoNote}from"./chunk-TYO6THPW.js";import{FISCAL_YEAR_FLAG,fiscalYear,skillNames}from"./chunk-B6VOXDMC.js";import{OJT_ADMIN_NOTE}from"./chunk-RILZ457A.js";import{ASSIGNED_PROJECT_COLUMNS,assignedProjectItems}from"./chunk-SEFV7AQB.js";import{LICENSE_FEATURE_NAMES,levelHoldsSeat,permissionMovesSeat,readLicenses}from"./chunk-HGM6DDYN.js";import{CONCURRENCY,exportOperation,mapPool,pacedSender}from"./chunk-ZFSQJAYZ.js";import"./chunk-Q3B65OFC.js";import"./chunk-FBTOIECJ.js";
|
|
4
|
+
import{inspectLocalFile,isCommitted,issued}from"./chunk-6H5TPSXU.js";import{checkUploadQuota}from"./chunk-V64CGX7V.js";import{readCsvFileText}from"./chunk-QLENN5DD.js";import"./chunk-RMFLTSOV.js";import"./chunk-L4THNX4M.js";import"./chunk-KPLC3UP7.js";import{USER_REF_FLAG,USER_REF_HELP,prepareUser,userPath}from"./chunk-UVCJXHWN.js";import{createFlags,fieldBody,hasAnyField,resolveRefFields,updateFlags}from"./chunk-IOVZDBAD.js";import"./chunk-EXT4AIDF.js";
|
|
5
|
+
import{booleanText,boundedText,isoDate,isoDateValue}from"./chunk-JJSBBWJ5.js";import"./chunk-HEH3PUW2.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-VGT2EGH6.js";import{DEPARTMENTS_PATH,ORG_MASTER_LIMIT,POSITIONS_PATH}from"./chunk-A7MM5WSC.js";import{ResolveError,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import{ApiError}from"./chunk-JA5A6UJ2.js";import"./chunk-MMVXE2CJ.js";import"./chunk-SBRTBKEZ.js";
|
|
6
|
+
import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger,shellQuote}from"./chunk-MI6HVYR2.js";import{requireResolved,singleRef,withResolved}from"./chunk-PS5QFKHB.js";import{isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import{NotLoggedInError,SessionExpiredError}from"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";
|
|
7
|
+
import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs2 from"fs";var ASSIGNMENT_COLUMNS=["id","department_name","position_name","start_date","end_date","is_primary","is_current","is_approval_route","effective_status"];function assignmentRows(body){const response=isRecord(body)&&"response"in body?body["response"]:body;const list=isRecord(response)?response["list"]:void 0;if(!Array.isArray(list)){throw new ApiResponseError("\u6240\u5C5E\u4E00\u89A7\u306E\u5FDC\u7B54\u306B list \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
8
8
|
return list}async function nameMap(ctx,path2,label2){try{const body=await ctx.send({method:"GET",path:path2,query:{limit:ORG_MASTER_LIMIT}});const list=isRecord(body)?body["list"]:void 0;if(!Array.isArray(list))throw new Error(`${label2}\u4E00\u89A7\u306E\u5FDC\u7B54\u306B list \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093`);const count=isRecord(body)?body["count"]:void 0;if(typeof count==="number"&&count>list.length){ctx.warn(`${label2}\u4E00\u89A7\u304C ${count} \u4EF6\u4E2D ${list.length} \
|
|
9
9
|
\u4EF6\u3067\u5207\u308A\u8A70\u3081\u3089\u308C\u305F\u305F\u3081\u3001\u4E00\u90E8\u306E${label2}\u540D\u306F\u7A7A\u6B04\u3067\u3059\u3002ID \u306F --output json \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`)}const map={};for(const row of list){if(isRecord(row)&&typeof row["id"]==="string"&&typeof row["name"]==="string"){map[row["id"]]=row["name"]}}return map}catch(err){ctx.warn(`${label2}\u540D\u3092\u53D6\u5F97\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001${label2}\u540D\u306E\u5217\u306F\u7A7A\u6B04\u3067\u3059\uFF08${err.
|
|
10
10
|
message}\uFF09\u3002ID \u306F --output json \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`);return{}}}function assignmentPlan(input){const suffix=input.flags.has("--current")?"/assignments/current":"/assignments";return{method:"GET",path:`/api/v2/organization/users/${userPath(input,suffix)}`}}var listOperation={name:"list",summary:"\u30E6\u30FC\u30B6\u30FC\u306E\u6240\u5C5E\u306E\u5C65\u6B74\u3092\u4E00\u89A7\u3059\u308B",usage:"twp user assignment list <\u30E6\u30FC\u30B6\u30FC> [--current]",
|
|
@@ -205,10 +205,11 @@ body,"\u62DB\u5F85\u306E\u518D\u9001")},{name:"delete",summary:"\u62DB\u5F85\u30
|
|
|
205
205
|
\u53D6\u308A\u6D88\u3057\u305F\u62DB\u5F85\u306F\u5143\u306B\u623B\u305B\u307E\u305B\u3093\u3002\u3082\u3046\u4E00\u5EA6\u62DB\u5F85\u3059\u308B\u3068\u304D\u306F twp user invite create \u3092\u4F7F\u3044\u307E\u3059\u3002`,destructive:true,forbidden:FORBIDDEN2,flags:[INVITE_REF_FLAG],prepare:input=>prepareInvite(input,"twp user invite delete help"),plan:input=>refPlan(input,"DELETE"),plannedNotes:refNotes,async execute(input,ctx){return ctx.send({method:"DELETE",path:invitePath(await tokenFor(input,
|
|
206
206
|
ctx))})},summarize:body=>successAck(body,"\u62DB\u5F85\u306E\u53D6\u6D88"),raw:body=>successAck(body,"\u62DB\u5F85\u306E\u53D6\u6D88")}]};var FORBIDDEN3="\u7D44\u7E54\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002twp user permission \u306F\u7D44\u7E54\u7BA1\u7406\u8005\u3060\u3051\u304C\u4F7F\u3048\u307E\u3059";var UPDATE_USAGE="twp user permission update <\u30E6\u30FC\u30B6\u30FC> --feature <\u6A5F\u80FD> --level <\u30EC\u30D9\u30EB> | twp user permission update <\u30E6\u30FC\u30B6\u30FC> --feature <\u6A5F\u80FD>=<\u30EC\u30D9\u30EB> [--feature \u2026] | twp user permission update --file <CSV>";var UPDATE_HELP="\
|
|
207
207
|
twp user permission update help";var LIST_USAGE="twp user permission list <\u30E6\u30FC\u30B6\u30FC>";var CSV_MAX_BYTES2=1024*1024;var CSV_HEADERS=new Set(["user","\u30E6\u30FC\u30B6\u30FC","email","\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"]);var REFLECT_NOTE="\u672C\u4EBA\u306E\u753B\u9762\u30FBAPI \u306B\u52B9\u304F\u307E\u3067\u6700\u59275\u5206\u307B\u3069\u304B\u304B\u308A\u307E\u3059\uFF08\u30ED\u30B0\u30A4\u30F3\u4E2D\u306E\u30C8\u30FC\u30AF\u30F3\u306B\u8F09\u3063\u305F\u6A29\u9650\u306F\u4E00\u5B9A\u6642\u9593\u3054\u3068\u306B\u8AAD\u307F\u76F4\u3055\u308C\u307E\u3059\u3002\u30B5\u30FC\u30D0\u306E\u8A2D\u5B9A\u306B\u3088\u308A\u6700\u957730\u5206\uFF09\u3002";
|
|
208
|
-
var FEATURE_FLAG={name:"--feature",summary:"\u5909\u3048\u308B\u6A5F\u80FD\uFF08\u30B3\u30FC\u30C9\u304B\u8868\u793A\u540D\u3002<\u6A5F\u80FD>=<\u30EC\u30D9\u30EB> \u306E\u5F62\u306A\u3089\u7E70\u308A\u8FD4\u3057\u6307\u5B9A\u3067\u304D\u308B\uFF09",takesValue:true,placeholder:"<\u6A5F\u80FD[=\u30EC\u30D9\u30EB]>",repeatable:true};var LEVEL_FLAG={name:"--level",summary:"\
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
var FEATURE_FLAG={name:"--feature",summary:"\u5909\u3048\u308B\u6A5F\u80FD\uFF08\u30B3\u30FC\u30C9\u304B\u8868\u793A\u540D\u3002<\u6A5F\u80FD>=<\u30EC\u30D9\u30EB> \u306E\u5F62\u306A\u3089\u7E70\u308A\u8FD4\u3057\u6307\u5B9A\u3067\u304D\u308B\u3002ojt \u3092 admin \u306B\u3057\u3066\u3082 OJT\u7BA1\u7406\u8005\u306B\u306F\u306A\u3089\u306A\u3044\uFF1Dtwp ojt admin grant\uFF09",takesValue:true,placeholder:"<\u6A5F\u80FD[=\u30EC\u30D9\u30EB]>",repeatable:true};var LEVEL_FLAG={name:"--level",summary:"\
|
|
209
|
+
\u5909\u66F4\u5F8C\u306E\u30EC\u30D9\u30EB\uFF08none / member / admin \u7B49\u3002\u6A5F\u80FD\u3054\u3068\u306B\u9055\u3046\uFF09",takesValue:true,placeholder:"<\u30EC\u30D9\u30EB>"};var OJT_FEATURE="ojt";var OJT_FEATURE_NOTE=`\u6A5F\u80FD\u6A29\u9650\u306E ojt \u3067\u306F OJT\u7BA1\u7406\u8005\u306B\u306A\u308A\u307E\u305B\u3093\u3002
|
|
210
|
+
${OJT_ADMIN_NOTE}`;var FILE_FLAG2={name:"--file",summary:"\u4E00\u62EC\u3067\u5909\u3048\u308B CSV\uFF08\u30E6\u30FC\u30B6\u30FC, \u6A5F\u80FD, \u30EC\u30D9\u30EB\uFF09",takesValue:true,placeholder:"<CSV>"};async function featureDefs(ctx){try{return await ctx.resolver.featurePermissions()}catch(err){if(err instanceof ResolveError&&err.status===403)throw new ResolveError(`${FORBIDDEN3}\uFF08${err.message}\uFF09`,403);throw err}}function featureDef(value,defs){const trimmed=value.trim();const byCode=defs.
|
|
211
|
+
get(trimmed.toLowerCase());if(byCode!==void 0)return byCode;const byName=new Map;for(const def of defs.values())if(def.label===trimmed)byName.set(def.code,def);for(const[code,name]of Object.entries(LICENSE_FEATURE_NAMES)){const def=defs.get(code);if(name===trimmed&&def!==void 0)byName.set(code,def)}if(byName.size>1){throw new UsageError(`\u6A5F\u80FD\u300C${trimmed}\u300D\u306B\u5F53\u305F\u308B\u6A5F\u80FD\u304C\u8907\u6570\u3042\u308A\u307E\u3059: ${[...byName.keys()].join(" / ")}`,"\u6A5F\u80FD\u30B3\u30FC\u30C9\u3067\u6307\u5B9A\u3057\u3066\
|
|
212
|
+
\u304F\u3060\u3055\u3044\u3002")}const named=[...byName.values()][0];if(named!==void 0)return named;throw new UsageError(`\u6A5F\u80FD\u300C${trimmed===""?"\uFF08\u7A7A\uFF09":trimmed}\u300D\u304C\u5206\u304B\u308A\u307E\u305B\u3093`,"\u6A5F\u80FD\u30B3\u30FC\u30C9\uFF08wiki_management \u7B49\uFF09\u304B\u753B\u9762\u306E\u8868\u793A\u540D\uFF08Wiki\u7BA1\u7406 \u7B49\uFF09\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u4E00\u89A7\u306F twp user permission list <\u30E6\u30FC\u30B6\u30FC> \u3067\u898B\u3089\u308C\u307E\u3059\u3002")}
|
|
212
213
|
function levelOf(value,def){const level=value.trim().toLowerCase();if(!def.levels.includes(level)){throw new UsageError(`${def.label}\uFF08${def.code}\uFF09\u306B\u300C${value.trim()===""?"\uFF08\u7A7A\uFF09":value.trim()}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`${def.label} \u306B\u6307\u5B9A\u3067\u304D\u308B\u306E\u306F ${def.levels.join(" / ")} \u3067\u3059\u3002`)}return level}function parsePermissionCsv(text){const rows=[];const errors=[];const seen=new Map;let headerChecked=false;
|
|
213
214
|
text.replace(/^\uFEFF/,"").split(/\r?\n/).forEach((raw,index)=>{const line=index+1;if(raw.trim()===""||raw.trim().startsWith("#"))return;const cells=splitCsvLine(raw);if(!headerChecked){headerChecked=true;if(CSV_HEADERS.has((cells[0]??"").toLowerCase()))return}if(cells.length!==3){errors.push(`${line} \u884C\u76EE: \u5217\u304C ${cells.length} \u500B\u3042\u308A\u307E\u3059\uFF08\u30E6\u30FC\u30B6\u30FC, \u6A5F\u80FD, \u30EC\u30D9\u30EB \u306E3\u5217\u306B\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`);
|
|
214
215
|
return}const[user,feature,level]=cells;const missing=[user===""?"\u30E6\u30FC\u30B6\u30FC":null,feature===""?"\u6A5F\u80FD":null,level===""?"\u30EC\u30D9\u30EB":null].filter(item=>item!==null);if(missing.length>0){errors.push(`${line} \u884C\u76EE: ${missing.join("\u30FB")}\u304C\u7A7A\u3067\u3059`);return}const key=`${user.toLowerCase()}\0${feature.toLowerCase()}`;const first=seen.get(key);if(first!==void 0){errors.push(`${line} \u884C\u76EE: ${user} \u306E ${feature} \u306F ${first} \u884C\u76EE\u3068\u91CD\u8907\u3057\u3066\u3044\u307E\u3059`);
|
|
@@ -234,15 +235,15 @@ items,available);const unknownSeats=[...new Set(items.filter(item=>item.effect==
|
|
|
234
235
|
for(const item of items){const who=item.userName!==null&&item.userName!==item.user?`${item.userName}\uFF08${item.user}\uFF09`:item.user;notes.push(` ${where(item)}${who} ${item.featureLabel}: ${item.from} \u2192 ${item.level}\uFF08${EFFECT_TEXT[item.effect]}\uFF09`)}const seatLicensed=new Set(usage.map(([code])=>code));for(const[feature,row]of usage){const mine=items.filter(item=>item.feature===feature);const delta=mine.filter(item=>item.effect==="release").length-mine.filter(item=>item.effect===
|
|
235
236
|
"assign").length;if(delta!==0&&row.available!==null){notes.push(`\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u7A7A\u304D: ${mine[0]?.featureLabel??feature} ${row.available} \u2192 ${row.available+delta}`)}}const unmoved=[...new Set(items.filter(item=>item.effect!=="unchanged"&&seatLicensed.has(item.feature)&&!permissionMovesSeat(item.feature)).map(item=>item.featureLabel))];if(unmoved.length>0){notes.push(`${unmoved.join("\u30FB")} \u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u5BFE\u8C61\u3067\u3059\u304C\u3001\u30B5\u30FC\u30D0\u306F\u6A29\u9650\u306E\u5909\u66F4\u3067\u30E9\u30A4\u30BB\u30F3\u30B9\u3092\u5272\u308A\u5F53\u3066\u3082\u89E3\u9664\u3082\u3057\u307E\u305B\u3093\uFF08\u753B\u9762\u304B\u3089\u5909\u3048\u305F\u5834\u5408\u3082\u540C\u3058\u3067\u3059\uFF09\u3002`)}
|
|
236
237
|
if(unknownSeats.length>0){notes.push(`${unknownSeats.join("\u30FB")} \u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u7A7A\u304D\u3092\u8AAD\u3081\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u7A7A\u304D\u306E\u4E8B\u524D\u691C\u67FB\u3092\u3057\u3066\u3044\u307E\u305B\u3093\uFF08\u8DB3\u308A\u306A\u3051\u308C\u3070\u30B5\u30FC\u30D0\u304C\u65AD\u308A\u307E\u3059\uFF09\u3002`)}if(items.some(item=>item.effect==="kept"&&item.level==="none")){notes.push("\u300C\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u5272\u5F53\u306F\u6B8B\u308B\u300D\u306E\u884C\u306F\u3001\u6A29\u9650\u3092 none \u306B\u3057\u3066\u3082\u5272\u5F53\u304C\u5916\u308C\u307E\u305B\u3093\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u8981\u3089\u306A\u3044\u30EC\u30D9\u30EB\
|
|
237
|
-
\u304B\u3089\u306E\u5909\u66F4\u306A\u306E\u3067\u3001\u30B5\u30FC\u30D0\u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u3092\u52D5\u304B\u3057\u307E\u305B\u3093\uFF09\u3002")}const planned={items,notes};PLANNED.set(input,planned);return planned}function isUpdateBody(body){return isRecord(body)&&body["permissionUpdate"]===true&&Array.isArray(body["done"])}function writeAck(body){if(!isRecord(body)||body["result"]!==true){throw new ApiResponseError(
|
|
238
|
-
const rest={...body};delete rest["result"];return rest}function revertCommand(userId,feature,level){return`twp user permission update ${shellQuote(userId)} --feature ${shellQuote(feature)} --level ${shellQuote(level)}`}function revertLines(done){return done.filter(item=>item.effect!==
|
|
239
|
-
license_errors"];if(Array.isArray(licenseErrors)&&licenseErrors.length>0)return licenseErrors.map(String).join(" ")}return err.message}async function runUpdate(input,ctx){const{items}=await planChanges(input,ctx);const send=pacedSender(ctx);const done=[];for(const[index,item]of items.
|
|
240
|
-
"\u3053\u306E\u4EF6\u306F\u66F8\u304D\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002":`\u66F8\u304D\u8FBC\u307E\u308C\u305F\u304B\u3069\u3046\u304B\u5206\u304B\u308A\u307E\u305B\u3093\u3002twp user permission list ${shellQuote(item.userId)} \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002`;
|
|
241
|
-
user} ${item.featureLabel} \u3067\u6B62\u307E\u308A\u307E\u3057\u305F\uFF08${items.length} \u4EF6\u4E2D \u6210\u529F ${done.length} \u4EF6\u30FB\u5931\u6557 1 \u4EF6\u30FB\u672A\u9001\u4FE1 ${unsent.length} \u4EF6\uFF09\u3002`,` \u5931\u6557: ${where(item)}${item.user} ${item.featureLabel}\uFF08${reasonOf(
|
|
242
|
-
` \u672A\u9001\u4FE1: ${unsent.map(u=>`${where(u)}${u.user} ${u.featureLabel}`).join(" / ")}`];const reverts=revertLines(done);if(reverts.length>0)lines.push("\u6210\u529F\u3057\u305F\u4EF6\u3092\u5143\u306B\u623B\u3059\u306B\u306F:",...reverts);lines.push(done.length===0?"\u3069\u306E\u4EF6\u3082\u5909\u3048\u3066\u3044\u307E\u305B\u3093\u3002\u539F\
|
|
243
|
-
\u304D\u306F\u3001\u6210\u529F\u3057\u305F\u884C\u3092 CSV \u304B\u3089\u9664\u3044\u3066\u304B\u3089\u6253\u3061\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002");ctx.warn(lines.join("\n"));if(done.length===0||!rejected)throw err;throw new ApiRejectedError(`\u6A5F\u80FD\u6A29\u9650\u306E\u5909\u66F4\u306F\u5B8C\u4E86\u3057\u3066\u3044\u307E\u305B\u3093\uFF08\u6210\u529F ${done.
|
|
244
|
-
line,user:item.user,userId:item.userId,feature:item.feature,featureLabel:item.featureLabel,from:item.from,to:item.level,effect:item.effect,response})}return{permissionUpdate:true,done}}function updateDone(body){if(!isUpdateBody(body))throw new ApiResponseError("\u6A5F\u80FD\u6A29\u9650\u306E\u5909\u66F4\u306E\u7D50\u679C\u3092\u7D44\u307F\u7ACB\u3066\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u5185\u90E8\u30A8\u30E9\u30FC\uFF09\u3002");
|
|
245
|
-
|
|
238
|
+
\u304B\u3089\u306E\u5909\u66F4\u306A\u306E\u3067\u3001\u30B5\u30FC\u30D0\u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u3092\u52D5\u304B\u3057\u307E\u305B\u3093\uFF09\u3002")}if(items.some(item=>item.feature===OJT_FEATURE))notes.push(OJT_FEATURE_NOTE);const planned={items,notes};PLANNED.set(input,planned);return planned}function isUpdateBody(body){return isRecord(body)&&body["permissionUpdate"]===true&&Array.isArray(body["done"])}function writeAck(body){if(!isRecord(body)||body["result"]!==true){throw new ApiResponseError(
|
|
239
|
+
"\u6A5F\u80FD\u6A29\u9650\u306E\u66F4\u65B0\u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}const rest={...body};delete rest["result"];return rest}function revertCommand(userId,feature,level){return`twp user permission update ${shellQuote(userId)} --feature ${shellQuote(feature)} --level ${shellQuote(level)}`}function revertLines(done){return done.filter(item=>item.effect!==
|
|
240
|
+
"unchanged").map(item=>` ${revertCommand(item.userId,item.feature,item.from)}${item.line===null?"":` # ${item.line} \u884C\u76EE`}`)}function reasonOf(err){if(err instanceof ApiError){const licenseErrors=err.body?.["license_errors"];if(Array.isArray(licenseErrors)&&licenseErrors.length>0)return licenseErrors.map(String).join(" ")}return err.message}async function runUpdate(input,ctx){const{items}=await planChanges(input,ctx);const send=pacedSender(ctx);const done=[];for(const[index,item]of items.
|
|
241
|
+
entries()){let response;try{response=writeAck(await send(rowPlan2(item)))}catch(err){const unsent=items.slice(index+1);const rejected=err instanceof ApiError&&REJECTED_BEFORE_WRITE.has(err.status);const written=rejected?"\u3053\u306E\u4EF6\u306F\u66F8\u304D\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002":`\u66F8\u304D\u8FBC\u307E\u308C\u305F\u304B\u3069\u3046\u304B\u5206\u304B\u308A\u307E\u305B\u3093\u3002twp user permission list ${shellQuote(item.userId)} \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002`;
|
|
242
|
+
if(items.length===1){if(!rejected)ctx.warn(`${item.featureLabel} \u306E\u5909\u66F4: ${written}`);throw err}const lines=[`\u6A5F\u80FD\u6A29\u9650\u306E\u5909\u66F4\u306F ${where(item)}${item.user} ${item.featureLabel} \u3067\u6B62\u307E\u308A\u307E\u3057\u305F\uFF08${items.length} \u4EF6\u4E2D \u6210\u529F ${done.length} \u4EF6\u30FB\u5931\u6557 1 \u4EF6\u30FB\u672A\u9001\u4FE1 ${unsent.length} \u4EF6\uFF09\u3002`,` \u5931\u6557: ${where(item)}${item.user} ${item.featureLabel}\uFF08${reasonOf(
|
|
243
|
+
err)}\uFF09${written}`,done.length===0?" \u6210\u529F: \u306A\u3057":` \u6210\u529F: ${done.map(d=>`${where(d)}${d.user} ${d.featureLabel}`).join(" / ")}`,unsent.length===0?" \u672A\u9001\u4FE1: \u306A\u3057":` \u672A\u9001\u4FE1: ${unsent.map(u=>`${where(u)}${u.user} ${u.featureLabel}`).join(" / ")}`];const reverts=revertLines(done);if(reverts.length>0)lines.push("\u6210\u529F\u3057\u305F\u4EF6\u3092\u5143\u306B\u623B\u3059\u306B\u306F:",...reverts);lines.push(done.length===0?"\u3069\u306E\u4EF6\u3082\u5909\u3048\u3066\u3044\u307E\u305B\u3093\u3002\u539F\
|
|
244
|
+
\u56E0\u3092\u53D6\u308A\u9664\u3044\u3066\u304B\u3089\u540C\u3058\u6307\u5B9A\u3092\u3082\u3046\u4E00\u5EA6\u6D41\u305B\u307E\u3059\u3002":"\u7D9A\u304D\u3092\u6D41\u3059\u3068\u304D\u306F\u3001\u6210\u529F\u3057\u305F\u884C\u3092 CSV \u304B\u3089\u9664\u3044\u3066\u304B\u3089\u6253\u3061\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002");ctx.warn(lines.join("\n"));if(done.length===0||!rejected)throw err;throw new ApiRejectedError(`\u6A5F\u80FD\u6A29\u9650\u306E\u5909\u66F4\u306F\u5B8C\u4E86\u3057\u3066\u3044\u307E\u305B\u3093\uFF08\u6210\u529F ${done.
|
|
245
|
+
length} \u4EF6\u30FB\u5931\u6557 1 \u4EF6\u30FB\u672A\u9001\u4FE1 ${unsent.length} \u4EF6\uFF09\u3002`)}done.push({line:item.line,user:item.user,userId:item.userId,feature:item.feature,featureLabel:item.featureLabel,from:item.from,to:item.level,effect:item.effect,response})}return{permissionUpdate:true,done}}function updateDone(body){if(!isUpdateBody(body))throw new ApiResponseError("\u6A5F\u80FD\u6A29\u9650\u306E\u5909\u66F4\u306E\u7D50\u679C\u3092\u7D44\u307F\u7ACB\u3066\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u5185\u90E8\u30A8\u30E9\u30FC\uFF09\u3002");
|
|
246
|
+
return body.done}var updateOperation2={name:"update",summary:"\u6A5F\u80FD\u6A29\u9650\u3092\u5909\u3048\u308B\uFF081\u4EBA\u30FBCSV \u4E00\u62EC\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u5272\u5F53\u30FB\u89E3\u9664\u306F\u30B5\u30FC\u30D0\u304C\u9023\u52D5\u30FB\u7D44\u7E54\u7BA1\u7406\u8005\u306E\u307F\uFF09",usage:UPDATE_USAGE,description:`\u753B\u9762\u306E\u300C\u7D44\u7E54\u7BA1\u7406 > \u30E6\u30FC\u30B6\u30FC\u300D\u306E\u6A5F\u80FD\u6A29\u9650\u3068\u540C\u3058\u5909\u66F4\u3092\u3057\u307E\u3059\uFF08\u540C\u3058 API \u3092\u4F7F\u3044\u307E\u3059\uFF09\u3002
|
|
246
247
|
\u6A5F\u80FD\u306F\u30B3\u30FC\u30C9\uFF08wiki_management\uFF09\u304B\u753B\u9762\u306E\u8868\u793A\u540D\uFF08Wiki\u7BA1\u7406\uFF09\u3067\u3001\u30EC\u30D9\u30EB\u306F\u305D\u306E\u6A5F\u80FD\u304C\u53D6\u308C\u308B\u5024
|
|
247
248
|
\uFF08none / member / admin\u3001none / viewer / editor / admin \u7B49\uFF09\u3067\u6307\u5B9A\u3057\u307E\u3059\u3002\u53D6\u308C\u306A\u3044\u7D44\u307F\u5408\u308F\u305B\u306F\u9001\u308B\u524D\u306B\u6B62\u3081\u307E\u3059\u3002
|
|
248
249
|
\u6A5F\u80FD\u3054\u3068\u306B\u53D6\u308C\u308B\u30EC\u30D9\u30EB\u306F twp user permission list <\u30E6\u30FC\u30B6\u30FC> \u306E levels \u5217\u3067\u898B\u3089\u308C\u307E\u3059\u3002
|
|
@@ -270,13 +271,15 @@ te",summary:"\u6A5F\u80FD\u6A29\u9650\u3092\u5909\u3048\u308B\uFF081\u4EBA\u30FB
|
|
|
270
271
|
\u9001\u4FE1\u306F1\u4EF6\uFF081\u4EBA\u306E1\u6A5F\u80FD\uFF09\u305A\u3064\u3067\u3001\u5931\u6557\u3057\u305F\u3089\u305D\u3053\u3067\u6B62\u3081\u3001\u6210\u529F\u30FB\u5931\u6557\u30FB\u672A\u9001\u4FE1\u306E\u4EF6\u3068\u3001\u6210\u529F\u3057\u305F\u4EF6\u3092\u5143\u306B\u623B\u3059\u30B3\u30DE\u30F3\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
|
|
271
272
|
${REFLECT_NOTE}
|
|
272
273
|
|
|
274
|
+
OJT\uFF08--feature ojt\uFF09\u306B\u3064\u3044\u3066: ${OJT_FEATURE_NOTE}
|
|
275
|
+
|
|
273
276
|
`+USER_REF_HELP,forbidden:FORBIDDEN3,flags:[USER_REF_FLAG,FEATURE_FLAG,LEVEL_FLAG,FILE_FLAG2],prepare:prepareUpdate,plan:input=>rowPlan2(permissionRows(input)[0]),plannedNotes(input){const rows=permissionRows(input);const lines=["\u3053\u306E\u524D\u306B\u3001\u4ECA\u306E\u6A29\u9650\u30FB\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u5272\u5F53\u30FB\u7A7A\u304D\u3092 GET \u3057\u307E\u3059\uFF08\u8AAD\u307F\u53D6\u308A\u3060\u3051\uFF09\u3002"];if(rows.length>1)lines.push(`${rows.length} \u4EF6\u30921\u4EF6\u305A\u3064 PUT \u3057\u307E\u3059\
|
|
274
277
|
\uFF08--dry-run \u306B\u51FA\u308B\u8981\u6C42\u306F1\u4EF6\u76EE\u306E\u5206\u3067\u3059\uFF09\u3002`);return lines},async preview(input,ctx){return{notes:(await planChanges(input,ctx)).notes,warnings:[]}},execute:runUpdate,summarize:body=>updateDone(body).map(item=>({line:item.line,user:item.user,feature_name:item.featureLabel,from:item.from,to:item.to,license:EFFECT_TEXT[item.effect]})),raw:body=>updateDone(body).map(item=>({line:item.line,user_id:item.userId,feature_code:item.feature,from_level:item.
|
|
275
|
-
from,to_level:item.to,license_change:item.effect,response:item.response})),notes(body){const done=updateDone(body);const notes=[`${done.length} \u4EF6\u306E\u6A5F\u80FD\u6A29\u9650\u3092\u5909\u3048\u307E\u3057\u305F\u3002${REFLECT_NOTE}`];const reverts=revertLines(done);if(reverts.length>0)notes.push(["\u5143\u306B\u623B\u3059\u306B\u306F:",...reverts].join("\n"));return notes},failures:body=>updateDone(body).flatMap(item=>{
|
|
276
|
-
{target:`${where(item)}${item.user} ${item.featureLabel}`,error:new ApiRejectedError(`\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6CE8\u610F: ${texts.join(" / ")}`)}]})};function licenseWarnings(response){const warnings=response["license_warnings"];if(!Array.isArray(warnings))return[];return warnings.map(warning=>isRecord(warning)?String(warning["message"]??warning["feature_label"]??warning["feature"]??""):String(warning))}var LIST_COLUMNS2=[
|
|
277
|
-
|
|
278
|
-
null;const rows=defs.map(def=>{const license=byFeature.get(def.code);const enabled=detail[`tenant_${def.code}_enabled`];return{feature_code:def.code,feature_name:def.label,level:str(detail[`${def.code}_level`]),levels:def.levels.join("/"),tenant_enabled:typeof enabled==="boolean"?enabled:null,license_assigned:license!==void 0,license_level:str(license?.["permission_level"]),license_assigned_at:str(license?.["assigned_at"])}});for(const[code,
|
|
279
|
-
code===code))continue;rows.push({feature_code:code,feature_name:LICENSE_FEATURE_NAMES[code]??code,level:null,levels:null,tenant_enabled:null,license_assigned:true,license_level:str(license["permission_level"]),license_assigned_at:str(license["assigned_at"])})}return rows}function listBody(body){if(!isRecord(body)||body["permissionList"]!==true||!Array.isArray(body["rows"])){throw new ApiResponseError("\u6A5F\u80FD\u6A29\u9650\u306E\u4E00\u89A7\u3092\u7D44\u307F\u7ACB\u3066\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u5185\u90E8\u30A8\u30E9\u30FC\uFF09\u3002")}
|
|
278
|
+
from,to_level:item.to,license_change:item.effect,response:item.response})),notes(body){const done=updateDone(body);const notes=[`${done.length} \u4EF6\u306E\u6A5F\u80FD\u6A29\u9650\u3092\u5909\u3048\u307E\u3057\u305F\u3002${REFLECT_NOTE}`];const reverts=revertLines(done);if(reverts.length>0)notes.push(["\u5143\u306B\u623B\u3059\u306B\u306F:",...reverts].join("\n"));if(done.some(item=>item.feature===OJT_FEATURE))notes.push(OJT_FEATURE_NOTE);return notes},failures:body=>updateDone(body).flatMap(item=>{
|
|
279
|
+
const texts=licenseWarnings(item.response);return texts.length===0?[]:[{target:`${where(item)}${item.user} ${item.featureLabel}`,error:new ApiRejectedError(`\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6CE8\u610F: ${texts.join(" / ")}`)}]})};function licenseWarnings(response){const warnings=response["license_warnings"];if(!Array.isArray(warnings))return[];return warnings.map(warning=>isRecord(warning)?String(warning["message"]??warning["feature_label"]??warning["feature"]??""):String(warning))}var LIST_COLUMNS2=[
|
|
280
|
+
"feature_name","feature_code","level","levels","tenant_enabled","license_assigned","license_level"];function listRows2(defs,detail,licenses){if(!isRecord(detail)||typeof detail["user_id"]!=="string"){throw new ApiResponseError("\u30E6\u30FC\u30B6\u30FC\u8A73\u7D30\u306E\u5FDC\u7B54\u306B user_id \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}const byFeature=new Map(licenses.map(row=>[String(row["feature_code"]??""),row]));
|
|
281
|
+
const str=value=>typeof value==="string"&&value!==""?value:null;const rows=defs.map(def=>{const license=byFeature.get(def.code);const enabled=detail[`tenant_${def.code}_enabled`];return{feature_code:def.code,feature_name:def.label,level:str(detail[`${def.code}_level`]),levels:def.levels.join("/"),tenant_enabled:typeof enabled==="boolean"?enabled:null,license_assigned:license!==void 0,license_level:str(license?.["permission_level"]),license_assigned_at:str(license?.["assigned_at"])}});for(const[code,
|
|
282
|
+
license]of byFeature){if(code===""||defs.some(def=>def.code===code))continue;rows.push({feature_code:code,feature_name:LICENSE_FEATURE_NAMES[code]??code,level:null,levels:null,tenant_enabled:null,license_assigned:true,license_level:str(license["permission_level"]),license_assigned_at:str(license["assigned_at"])})}return rows}function listBody(body){if(!isRecord(body)||body["permissionList"]!==true||!Array.isArray(body["rows"])){throw new ApiResponseError("\u6A5F\u80FD\u6A29\u9650\u306E\u4E00\u89A7\u3092\u7D44\u307F\u7ACB\u3066\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u5185\u90E8\u30A8\u30E9\u30FC\uFF09\u3002")}
|
|
280
283
|
return body["rows"]}var listOperation2={name:"list",summary:"1\u4EBA\u306E\u6A5F\u80FD\u6A29\u9650\u3068\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u5272\u5F53\u3092\u4E26\u3079\u308B\uFF08\u7D44\u7E54\u7BA1\u7406\u8005\u306E\u307F\uFF09",usage:LIST_USAGE,description:"\u6A5F\u80FD\u3054\u3068\u306B\u3001\u3044\u307E\u306E\u30EC\u30D9\u30EB\uFF08level\uFF09\u30FB\u53D6\u308C\u308B\u30EC\u30D9\u30EB\uFF08levels\uFF09\u30FB\u30C6\u30CA\u30F3\u30C8\u3067\u6709\u52B9\u304B\uFF08tenant_enabled\uFF09\u30FB\n\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u5272\u5F53\u306E\u6709\u7121\u3068\u305D\u306E\u30EC\u30D9\u30EB\uFF08license_assigned / license_level\uFF09\u30921\u884C\u305A\u3064\u51FA\u3057\u307E\u3059\u3002\n\u6A29\u9650\u304C none \u306A\u306E\u306B\u5272\u5F53\u304C\u6B8B\u3063\u3066\u3044\u308B\u6A5F\u80FD\u306F\u3001\u6A29\u9650\u3092\u5909\u3048\u3066\u3082\u5272\u5F53\u304C\u5916\u308C\u306A\u3044\u3053\u3068\u304C\u3042\u308A\u307E\u3059\uFF08twp user permission update help\uFF09\u3002\n--output json \u3067\u306F\u5272\u5F53\u65E5\uFF08license_assigne\
|
|
281
284
|
d_at\uFF09\u3082\u51FA\u307E\u3059\u3002\n\n"+USER_REF_HELP,forbidden:FORBIDDEN3,flags:[USER_REF_FLAG],async prepare(input,ctx){const resolved=await prepareUser(input,ctx,LIST_USAGE);const defs=await featureDefs(ctx);return withResolved(resolved,{defs:JSON.stringify([...defs.values()])})},plan:input=>({method:"GET",path:userPathOf(requireResolved(input,"userId"))}),plannedNotes:()=>["\u3053\u306E\u3042\u3068\u3001\u3053\u306E\u30E6\u30FC\u30B6\u30FC\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u5272\u5F53\u3092 GET \u3057\u307E\u3059\uFF08\u8AAD\u307F\u53D6\u308A\u3060\u3051\uFF09\u3002"],
|
|
282
285
|
async execute(input,ctx){const userId=requireResolved(input,"userId");const detail=await ctx.send({method:"GET",path:userPathOf(userId)});const licenses=licenseList(await ctx.send({method:"GET",path:`/api/v2/licenses/users/${encodeURIComponent(userId)}`}));const defs=JSON.parse(requireResolved(input,"defs"));return{permissionList:true,rows:listRows2(defs,detail,licenses)}},summarize:body=>listBody(body).map(row=>pick(row,LIST_COLUMNS2)),raw:body=>listBody(body),notes(body){const stale=listBody(body).
|
|
@@ -293,11 +296,23 @@ wanted.push({feature:def.code,featureLabel:def.label,level})}const current=await
|
|
|
293
296
|
body["defaultUpdate"]!==true||!Array.isArray(body["changes"])){throw new ApiResponseError("\u65E2\u5B9A\u306E\u6A5F\u80FD\u6A29\u9650\u306E\u5909\u66F4\u306E\u7D50\u679C\u3092\u7D44\u307F\u7ACB\u3066\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u5185\u90E8\u30A8\u30E9\u30FC\uFF09\u3002")}return body}async function runUpdate2(input,ctx){const plan=updatePlan(input);const response=await ctx.send(plan);if(!isRecord(response)||response["result"]!==true){throw new ApiResponseError("\u65E2\u5B9A\u306E\u6A5F\u80FD\u6A29\u9650\u306E\u66F4\
|
|
294
297
|
\u65B0\u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}const saved=isRecord(response["default_feature_permissions"])?response["default_feature_permissions"]:{};const savedOf=feature=>typeof saved[feature]==="string"?saved[feature]:null;const changes=changesOf(input);const sent=plan.body;const drifted=Object.entries(sent).filter(([feature,level])=>!changes.some(change=>change.
|
|
295
298
|
feature===feature)&&savedOf(feature)!==level).map(([feature,level])=>({feature,sent:level,saved:savedOf(feature)}));return{defaultUpdate:true,changes:changes.map(change=>({...change,saved:savedOf(change.feature)})),drifted,response}}var updateOperation3={name:"update",summary:"\u65E2\u5B9A\u306E\u6A5F\u80FD\u6A29\u9650\u3092\u5909\u3048\u308B\uFF08\u6307\u5B9A\u3057\u306A\u3044\u6A5F\u80FD\u306F\u3044\u307E\u306E\u5024\u306E\u307E\u307E\u30FB\u7D44\u7E54\u7BA1\u7406\u8005\u306E\u307F\uFF09",usage:UPDATE_USAGE2,
|
|
296
|
-
description
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
299
|
+
description:`\u753B\u9762\u306E\u300C\u30C6\u30CA\u30F3\u30C8\u8A2D\u5B9A > \u8A8D\u8A3C\u9023\u643A\u300D\u306E\u300C\u30E6\u30FC\u30B6\u30FC\u4F5C\u6210\u6642\u30C7\u30D5\u30A9\u30EB\u30C8\u5229\u7528\u6A5F\u80FD\u300D\u3068\u540C\u3058\u5909\u66F4\u3092\u3057\u307E\u3059\uFF08\u540C\u3058 API \u3092\u4F7F\u3044\u307E\u3059\uFF09\u3002
|
|
300
|
+
\u6A5F\u80FD\u306F\u30B3\u30FC\u30C9\uFF08wiki_management\uFF09\u304B\u753B\u9762\u306E\u8868\u793A\u540D\uFF08Wiki\u7BA1\u7406\uFF09\u3067\u3001\u30EC\u30D9\u30EB\u306F\u305D\u306E\u6A5F\u80FD\u304C\u53D6\u308C\u308B\u5024\u3067\u6307\u5B9A\u3057\u307E\u3059\u3002
|
|
301
|
+
\u53D6\u308C\u308B\u30EC\u30D9\u30EB\u306F twp user default-permission list \u306E levels \u5217\u3067\u898B\u3089\u308C\u307E\u3059\u3002\u53D6\u308C\u306A\u3044\u7D44\u307F\u5408\u308F\u305B\u306F\u9001\u308B\u524D\u306B\u6B62\u3081\u307E\u3059\u3002
|
|
302
|
+
|
|
303
|
+
twp user default-permission update --feature wiki_management --level viewer
|
|
304
|
+
twp user default-permission update --feature inquiry=member --feature workflow=none
|
|
305
|
+
|
|
306
|
+
\u30B5\u30FC\u30D0\u306E API \u306F\u5168\u6A5F\u80FD\u3092\u307E\u3068\u3081\u3066\u7F6E\u304D\u63DB\u3048\u308B\u305F\u3081\u3001\u3044\u307E\u306E\u65E2\u5B9A\u3092\u8AAD\u3093\u3067\u304B\u3089\u3001\u6307\u5B9A\u3057\u305F\u6A5F\u80FD\u3060\u3051\u3092\u5DEE\u3057\u66FF\u3048\u3066\u5168\u6A5F\u80FD\u3092\u9001\u308A\u307E\u3059\u3002
|
|
307
|
+
\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u6A5F\u80FD\u306E\u65E2\u5B9A\u306F\u5909\u308F\u308A\u307E\u305B\u3093\u3002\u9001\u308B\u524D\u306B\u300C\u3069\u306E\u6A5F\u80FD\u304C\u4F55\u304B\u3089\u4F55\u3078\u300D\u3092 stderr \u306B\u51FA\u3057\u307E\u3059\uFF08--dry-run \u306F\u3053\u3053\u3067\u6B62\u307E\u308A\u3001
|
|
308
|
+
\u9001\u308B\u672C\u6587\u306E\u5168\u4F53\u3092\u51FA\u3057\u307E\u3059\uFF09\u3002\u9001\u3063\u305F\u3042\u3068\u306F\u30B5\u30FC\u30D0\u304C\u4FDD\u5B58\u3057\u305F\u5024\u3092\u5168\u6A5F\u80FD\u3067\u78BA\u304B\u3081\u3001\u5143\u306B\u623B\u3059\u30B3\u30DE\u30F3\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
|
|
309
|
+
\u8AAD\u3093\u3067\u304B\u3089\u9001\u308B\u307E\u3067\u306E\u9593\u306B\u5225\u306E\u7BA1\u7406\u8005\u304C\u753B\u9762\u3067\u5909\u3048\u305F\u5024\u306F\u3001\u8AAD\u3093\u3060\u6642\u70B9\u306E\u5024\u3067\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\uFF08\u30B5\u30FC\u30D0\u306B\u7AF6\u5408\u306E\u691C\u51FA\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002
|
|
310
|
+
|
|
311
|
+
${SCOPE_NOTE}
|
|
312
|
+
|
|
313
|
+
OJT\uFF08--feature ojt\uFF09\u306B\u3064\u3044\u3066: ${OJT_FEATURE_NOTE}`,forbidden:FORBIDDEN4,flags:[FEATURE_FLAG,LEVEL_FLAG],prepare:prepareUpdate2,plan:updatePlan,plannedNotes:()=>["\u3044\u307E\u306E\u65E2\u5B9A\u306F GET \u6E08\u307F\u3067\u3059\uFF08\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u6A5F\u80FD\u306F\u305D\u306E\u5024\u306E\u307E\u307E\u9001\u308A\u307E\u3059\uFF09\u3002"],async preview(input){const notes=changesOf(input).map(change=>change.from===change.to?`${change.featureLabel}\
|
|
314
|
+
\uFF08${change.feature}\uFF09: ${change.to} \u306E\u307E\u307E\uFF08\u65E2\u306B\u3053\u306E\u5024\u3067\u3059\uFF09`:`${change.featureLabel}\uFF08${change.feature}\uFF09: ${change.from} \u2192 ${change.to}`);notes.push(SCOPE_NOTE);if(changesOf(input).some(change=>change.feature===OJT_FEATURE))notes.push(OJT_FEATURE_NOTE);return{notes,warnings:[]}},execute:runUpdate2,summarize:body=>updateBody(body).changes.map(change=>({feature_name:change.featureLabel,feature_code:change.feature,from:change.from,
|
|
315
|
+
to:change.saved??"(\u4E0D\u660E)"})),raw:body=>updateBody(body).changes.map(change=>({feature_code:change.feature,from_level:change.from,to_level:change.to,saved_level:change.saved})),notes(body){const notes=[];const revert=revertCommand2(updateBody(body).changes);if(revert!==null)notes.push(`\u5143\u306B\u623B\u3059\u306B\u306F:
|
|
301
316
|
${revert}`);return notes},failures:body=>{const{changes,drifted}=updateBody(body);return[...changes.filter(change=>change.saved!==change.to).map(change=>({target:`${change.featureLabel}\uFF08${change.feature}\uFF09`,error:new ApiRejectedError(`${change.to} \u3092\u9001\u308A\u307E\u3057\u305F\u304C\u3001\u30B5\u30FC\u30D0\u304C\u4FDD\u5B58\u3057\u305F\u5024\u306F ${change.saved??"\uFF08\u5FDC\u7B54\u306B\u7121\u3057\uFF09"} \u3067\u3059\u3002twp user default-permission list \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002`)})),
|
|
302
317
|
...drifted.map(item=>({target:item.feature,error:new ApiRejectedError(`\u6307\u5B9A\u3057\u3066\u3044\u306A\u3044\u6A5F\u80FD\u306E\u65E2\u5B9A\u304C\u5909\u308F\u308A\u307E\u3057\u305F\uFF08${item.sent} \u3092\u9001\u308A\u307E\u3057\u305F\u304C\u3001\u4FDD\u5B58\u3055\u308C\u305F\u5024\u306F ${item.saved??"\uFF08\u5FDC\u7B54\u306B\u7121\u3057\uFF09"} \u3067\u3059\uFF09\u3002twp user default-permission update --feature ${shellQuote(`${item.feature}=${item.sent}`)} \u3067\u623B\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}))]}};
|
|
303
318
|
var userDefaultPermissionResource={name:"default-permission",summary:"\u65B0\u3057\u304F\u5165\u308B\u4EBA\u306B\u4ED8\u304F\u65E2\u5B9A\u306E\u6A5F\u80FD\u6A29\u9650\uFF08\u53C2\u7167\u30FB\u5909\u66F4\u3002\u65E2\u5B58\u30E6\u30FC\u30B6\u30FC\u306F\u5909\u308F\u3089\u306A\u3044\uFF09",operations:[listOperation3,updateOperation3]};var FORBIDDEN_POLICY="\u7D44\u7E54\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002twp user auth-policy \u306F\u7D44\u7E54\u7BA1\u7406\u8005\u3060\u3051\u304C\u4F7F\u3048\u307E\u3059";var FORBIDDEN_LOCK="\u7D44\u7E54\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002twp user account-lock \u306F\u7D44\u7E54\u7BA1\u7406\u8005\u3060\u3051\u304C\u4F7F\u3048\u307E\u3059";var POLICY_PATH="/api/v2/admin/tenant/auth-policy";var LOCK_PATH="/api/v2/admin/tenant/\
|
package/package.json
CHANGED
package/dist/chunk-AAABT3AX.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
var DOMAIN_NAMES=["agent","agent-loop","ai-review-reason","analysis","announcement","api-key","attendance","audit-log","backlog","budget","business-hours","business-place","company","content","contract","corporate","customer","department","deposit","estimate","evaluation","expense","faq","fiscal-year","goal-sheet","holiday","inquiry","invoice","job-title","knowledge","leave","license","login-history","media","meeting","note","notification","onedrive","outlook","payee","position","project","prosp\
|
|
4
|
-
ect","purchase","qualification","receivable","redmine","report","role-template","rounding-setting","seal-impression","search","secret","segment","shift","skill","staffing-board","storage","supplier-payment","support","task","teams","user","user-contract-type","user-group","wiki","workchange","worker-agent","workflow"];function isDomainName(value){return value!==void 0&&DOMAIN_NAMES.includes(value)}var HELP_TOKEN="help";var API_TOKEN="api";export{DOMAIN_NAMES,isDomainName,HELP_TOKEN,API_TOKEN};
|
package/dist/chunk-BBV5NLQZ.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
var LOADERS={agent:async()=>(await import("./agent-2BNIUX2U.js")).agentDomain,"agent-loop":async()=>(await import("./agent-loop-5IBBUKPF.js")).agentLoopDomain,"ai-review-reason":async()=>(await import("./sales-ai-review-2RBOUUYJ.js")).aiReviewReasonDomain,analysis:async()=>(await import("./analysis-IZJ7OGBS.js")).analysisDomain,announcement:async()=>(await import("./announcement-6FE7ZS4Z.js")).announcementDomain,"api-key":async()=>(await import("./api-key-TRRJUKYE.js")).apiKeyDomain,attendance:async()=>(await import("./attendance-correct-2KTCXVJX.js")).
|
|
4
|
-
attendanceDomainWithRecords,"audit-log":async()=>(await import("./audit-log-ZGK7IVLD.js")).auditLogDomain,backlog:async()=>(await import("./backlog-3WLFVEBA.js")).backlogDomain,budget:async()=>(await import("./budget-NA2SD5YD.js")).budgetDomain,"business-hours":async()=>(await import("./business-hours-37MRL53C.js")).businessHoursDomain,"business-place":async()=>(await import("./sales-master-SGT73CHC.js")).businessPlaceDomain,company:async()=>(await import("./company-GYE4NSYY.js")).companyDomain,
|
|
5
|
-
content:async()=>(await import("./content-JB6P46IF.js")).contentDomain,contract:async()=>(await import("./contract-J7IPD2IT.js")).contractDomain,corporate:async()=>(await import("./corporate-2QRAGFZ4.js")).corporateDomain,customer:async()=>(await import("./company-GYE4NSYY.js")).customerDomain,department:async()=>(await import("./department-PJOH2MXZ.js")).departmentDomain,deposit:async()=>(await import("./deposit-BBDYJVOG.js")).depositDomain,estimate:async()=>(await import("./estimate-MDCQUAIA.js")).
|
|
6
|
-
estimateDomain,evaluation:async()=>(await import("./evaluation-BVIVVRAX.js")).evaluationDomain,expense:async()=>(await import("./expense-MQPJVLVB.js")).expenseDomain,faq:async()=>(await import("./faq-MBW7SLC6.js")).faqDomain,"fiscal-year":async()=>(await import("./fiscal-year-4GC3CLDB.js")).fiscalYearDomain,holiday:async()=>(await import("./holiday-GTYFPTAI.js")).holidayDomain,"goal-sheet":async()=>(await import("./evaluation-BVIVVRAX.js")).goalSheetDomain,inquiry:async()=>(await import("./inquiry-QECSQJWD.js")).
|
|
7
|
-
inquiryDomain,invoice:async()=>(await import("./invoice-7PVEO7WG.js")).invoiceDomain,"job-title":async()=>(await import("./job-title-T3EVIB5D.js")).jobTitleDomain,knowledge:async()=>(await import("./domain-knowledge-G4NBJGWD.js")).knowledgeDomain,leave:async()=>(await import("./leave-WBZRI7ZO.js")).leaveDomain,license:async()=>(await import("./license-AMXSVUUX.js")).licenseDomain,"login-history":async()=>(await import("./login-history-ZF2QVJ4S.js")).loginHistoryDomain,media:async()=>(await import("./media-JDLTK23Z.js")).
|
|
8
|
-
mediaDomain,meeting:async()=>(await import("./knowledge-5ZKO6N5X.js")).meetingDomain,note:async()=>(await import("./knowledge-5ZKO6N5X.js")).noteDomain,notification:async()=>(await import("./notification-WVJ6V2UN.js")).notificationDomain,onedrive:async()=>(await import("./onedrive-Z43D26SJ.js")).onedriveDomain,outlook:async()=>(await import("./outlook-U4XXFMC3.js")).outlookDomain,payee:async()=>(await import("./sales-master-SGT73CHC.js")).payeeDomain,position:async()=>(await import("./position-U56E7GX6.js")).
|
|
9
|
-
positionDomain,project:async()=>(await import("./project-YAFIKH4Z.js")).projectDomain,prospect:async()=>(await import("./prospect-ROAE2JQ6.js")).prospectDomain,purchase:async()=>(await import("./purchase-T3QS3EPW.js")).purchaseDomain,qualification:async()=>(await import("./skill-HA3DBVJ3.js")).qualificationDomain,receivable:async()=>(await import("./receivable-QGNV2FT7.js")).receivableDomain,redmine:async()=>(await import("./redmine-GTHXTKKD.js")).redmineDomain,report:async()=>(await import("./report-TCFRJYL6.js")).
|
|
10
|
-
reportDomain,"role-template":async()=>(await import("./evaluation-BVIVVRAX.js")).roleTemplateDomain,"rounding-setting":async()=>(await import("./sales-numbering-GLWL3NOI.js")).roundingSettingDomain,"seal-impression":async()=>(await import("./sales-master-SGT73CHC.js")).sealImpressionDomain,search:async()=>(await import("./search-JP77X4JS.js")).searchDomain,secret:async()=>(await import("./secret-P42JCOI4.js")).secretDomain,segment:async()=>(await import("./segment-ZTWVP32K.js")).segmentDomain,
|
|
11
|
-
shift:async()=>(await import("./attendance-lists-OIF5KYDQ.js")).shiftDomain,skill:async()=>(await import("./skill-HA3DBVJ3.js")).skillDomain,"staffing-board":async()=>(await import("./staffing-board-PORZDQBF.js")).staffingBoardDomain,storage:async()=>(await import("./storage-AQDCEBDJ.js")).storageDomain,"supplier-payment":async()=>(await import("./supplier-payment-FCIATDMY.js")).supplierPaymentDomain,support:async()=>(await import("./support-ZSYBBO52.js")).supportDomain,task:async()=>(await import("./task-FLIYESKS.js")).
|
|
12
|
-
taskDomain,teams:async()=>(await import("./teams-HGOGRVEL.js")).teamsDomain,user:async()=>(await import("./user-6ACQM4GJ.js")).userDomain,"user-contract-type":async()=>(await import("./user-contract-type-I4KTAIZ3.js")).userContractTypeDomain,"user-group":async()=>(await import("./user-group-44DPCXVC.js")).userGroupDomain,wiki:async()=>(await import("./knowledge-5ZKO6N5X.js")).wikiDomain,workchange:async()=>(await import("./attendance-lists-OIF5KYDQ.js")).workchangeDomain,"worker-agent":async()=>(await import("./worker-agent-56PJ6YTR.js")).
|
|
13
|
-
workerAgentDomain,workflow:async()=>(await import("./workflow-ZWRPMTBR.js")).workflowDomain};async function loadDomain(name){return LOADERS[name]()}export{loadDomain};
|
package/dist/dist-HZIZTJ4O.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import"./chunk-VSJBJXZO.js";var isObject=obj=>{return obj!==null&&Object.prototype.toString.call(obj)==="[object Object]"};var strictDeepEqual=(first,second)=>{if(first===second){return true}if(typeof first!==typeof second){return false}if(Array.isArray(first)&&Array.isArray(second)){if(first.length!==second.length){return false}for(let i=0;i<first.length;i+=1){if(!strictDeepEqual(first[i],second[i])){return false}}return true}if(isObject(first)&&isObject(second)){const firstEntries=Object.entries(first);const secondKeys=new Set(
|
|
4
|
-
Object.keys(second));if(firstEntries.length!==secondKeys.size){return false}for(const[key,value]of firstEntries){if(!strictDeepEqual(value,second[key])){return false}secondKeys.delete(key)}return secondKeys.size===0}return false};var isFalse=obj=>{if(obj===null||obj===void 0||obj===false){return true}if(typeof obj==="string"){return obj===""}if(typeof obj==="object"){if(Array.isArray(obj)){return obj.length===0}if(obj===null){return true}return Object.keys(obj).length===0}return false};var isAlpha=ch=>{
|
|
5
|
-
return ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch==="_"};var isNum=ch=>{return ch>="0"&&ch<="9"||ch==="-"};var isAlphaNum=ch=>{return ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch>="0"&&ch<="9"||ch==="_"};var ensureInteger=value=>{if(!(typeof value==="number")||Math.floor(value)!==value){throw new Error("invalid-value: expecting an integer.")}return value};var ensurePositiveInteger=value=>{if(!(typeof value==="number")||value<0||Math.floor(value)!==value){throw new Error("invalid-value: expecting a non-neg\
|
|
6
|
-
ative integer.")}return value};var ensureNumbers=(...operands)=>{for(let i=0;i<operands.length;i++){if(operands[i]===null||operands[i]===void 0){throw new Error("not-a-number: undefined")}if(typeof operands[i]!=="number"){throw new Error("not-a-number")}}};var notZero=n=>{n=+n;if(!n){throw new Error("not-a-number: divide by zero")}return n};var add=(left,right)=>{ensureNumbers(left,right);const result=left+right;return result};var sub=(left,right)=>{ensureNumbers(left,right);const result=left-right;
|
|
7
|
-
return result};var mul=(left,right)=>{ensureNumbers(left,right);const result=left*right;return result};var divide=(left,right)=>{ensureNumbers(left,right);const result=left/notZero(right);return result};var div=(left,right)=>{ensureNumbers(left,right);const result=Math.floor(left/notZero(right));return result};var mod=(left,right)=>{ensureNumbers(left,right);const result=left%right;return result};var findFirst=(subject,sub2,start,end)=>{if(!subject||!sub2){return null}start=Math.max(ensureInteger(
|
|
8
|
-
start=start||0),0);end=Math.min(ensureInteger(end=end||subject.length),subject.length);const offset=subject.slice(start,end).indexOf(sub2);return offset===-1?null:offset+start};var findLast=(subject,sub2,start,end)=>{if(!subject||!sub2){return null}start=Math.max(ensureInteger(start=start||0),0);end=Math.min(ensureInteger(end=end||subject.length),subject.length);const offset=subject.slice(start,end).lastIndexOf(sub2);const result=offset===-1?null:offset+start;return result};var lower=subject=>subject.
|
|
9
|
-
toLowerCase();var ensurePadFuncParams=(name,width,padding)=>{padding=padding||" ";if(padding.length>1){throw new Error(`invalid value, ${name} expects its 'pad' parameter to be a valid string with a single codepoint`)}ensurePositiveInteger(width);return padding};var padLeft=(subject,width,padding)=>{padding=ensurePadFuncParams("pad_left",width,padding);return subject&&subject.padStart(width,padding)||""};var padRight=(subject,width,padding)=>{padding=ensurePadFuncParams("pad_right",width,padding);
|
|
10
|
-
return subject&&subject.padEnd(width,padding)||""};var replace=(subject,string,by,count)=>{if(count===0){return subject}if(!count){return subject.split(string).join(by)}ensurePositiveInteger(count);[...Array(count).keys()].map(()=>subject=subject.replace(string,by));return subject};var split=(subject,search2,count)=>{if(subject.length==0&&search2.length===0){return[]}if(count===null||count===void 0){return subject.split(search2)}ensurePositiveInteger(count);if(count===0){return[subject]}const split2=subject.
|
|
11
|
-
split(search2);return[...split2.slice(0,count),split2.slice(count).join(search2)]};var trim=(subject,chars)=>{return trimLeft(trimRight(subject,chars),chars)};var trimLeft=(subject,chars)=>{return trimImpl(subject,list=>new RegExp(`^[${list}]*(.*?)`),chars)};var trimRight=(subject,chars)=>{return trimImpl(subject,list=>new RegExp(`(.*?)[${list}]*$`),chars)};var trimImpl=(subject,regExper,chars)=>{const pattern=chars?chars.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"):"\\s\x85";return subject.replace(regExper(
|
|
12
|
-
pattern),"$1")};var upper=subject=>subject.toUpperCase();var basicTokens={"(":"Lparen",")":"Rparen","*":"Star",",":"Comma",".":"Dot",":":"Colon","@":"Current","]":"Rbracket","{":"Lbrace","}":"Rbrace","+":"Plus","%":"Modulo","?":"Question","\u2212":"Minus","\xD7":"Multiply","\xF7":"Divide"};var operatorStartToken={"!":true,"<":true,"=":true,">":true,"&":true,"|":true,"/":true};var skipChars={" ":true,"\n":true,"\r":true," ":true};var StreamLexer=class{_current=0;_enable_legacy_literals=false;tokenize(stream,options){
|
|
13
|
-
const tokens=[];this._current=0;this._enable_legacy_literals=options?.enable_legacy_literals||false;let start;let identifier;let token;while(this._current<stream.length){if(isAlpha(stream[this._current])){start=this._current;identifier=this.consumeUnquotedIdentifier(stream);tokens.push({start,type:"UnquotedIdentifier",value:identifier})}else if(basicTokens[stream[this._current]]!==void 0){tokens.push({start:this._current,type:basicTokens[stream[this._current]],value:stream[this._current]});this.
|
|
14
|
-
_current+=1}else if(stream[this._current]==="$"){start=this._current;if(this._current+1<stream.length&&isAlpha(stream[this._current+1])){this._current+=1;identifier=this.consumeUnquotedIdentifier(stream);tokens.push({start,type:"Variable",value:identifier})}else{tokens.push({start,type:"Root",value:stream[this._current]});this._current+=1}}else if(stream[this._current]==="-"){if(this._current+1<stream.length&&isNum(stream[this._current+1])){const token2=this.consumeNumber(stream);token2&&tokens.
|
|
15
|
-
push(token2)}else{const token2={start:this._current,type:"Minus",value:"-"};tokens.push(token2);this._current+=1}}else if(isNum(stream[this._current])){token=this.consumeNumber(stream);tokens.push(token)}else if(stream[this._current]==="["){token=this.consumeLBracket(stream);tokens.push(token)}else if(stream[this._current]==='"'){start=this._current;identifier=this.consumeQuotedIdentifier(stream);tokens.push({start,type:"QuotedIdentifier",value:identifier})}else if(stream[this._current]===`'`){start=
|
|
16
|
-
this._current;identifier=this.consumeRawStringLiteral(stream);tokens.push({start,type:"Literal",value:identifier})}else if(stream[this._current]==="`"){start=this._current;const literal=this.consumeLiteral(stream);tokens.push({start,type:"Literal",value:literal})}else if(operatorStartToken[stream[this._current]]!==void 0){token=this.consumeOperator(stream);token&&tokens.push(token)}else if(skipChars[stream[this._current]]!==void 0){this._current+=1}else{const error=new Error(`Syntax error: unkno\
|
|
17
|
-
wn character: ${stream[this._current]}`);error.name="LexerError";throw error}}return tokens}consumeUnquotedIdentifier(stream){const start=this._current;this._current+=1;while(this._current<stream.length&&isAlphaNum(stream[this._current])){this._current+=1}return stream.slice(start,this._current)}consumeQuotedIdentifier(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(stream[this._current]!=='"'&&this._current<maxLength){let current=this._current;if(stream[current]===
|
|
18
|
-
"\\"&&(stream[current+1]==="\\"||stream[current+1]==='"')){current+=2}else{current+=1}this._current=current}this._current+=1;const[value,ok]=this.parseJSON(stream.slice(start,this._current));if(!ok){const error=new Error(`syntax: unexpected end of JSON input`);error.name="LexerError";throw error}return value}consumeRawStringLiteral(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(stream[this._current]!==`'`&&this._current<maxLength){let current=this._current;
|
|
19
|
-
if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]===`'`)){current+=2}else{current+=1}this._current=current}this._current+=1;const literal=stream.slice(start+1,this._current-1);return replace(replace(literal,`\\\\`,`\\`),`\\'`,`'`)}consumeNumber(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(isNum(stream[this._current])&&this._current<maxLength){this._current+=1}const value=parseInt(stream.slice(start,this._current),10);return{start,value,
|
|
20
|
-
type:"Number"}}consumeLBracket(stream){const start=this._current;this._current+=1;if(stream[this._current]==="?"){this._current+=1;return{start,type:"Filter",value:"[?"}}if(stream[this._current]==="]"){this._current+=1;return{start,type:"Flatten",value:"[]"}}return{start,type:"Lbracket",value:"["}}consumeOrElse(stream,peek,token,orElse){const start=this._current;this._current+=1;if(this._current<stream.length&&stream[this._current]===peek){this._current+=1;return{start,type:orElse,value:stream.slice(
|
|
21
|
-
start,this._current)}}return{start,type:token,value:stream[start]}}consumeOperator(stream){const start=this._current;const startingChar=stream[start];switch(startingChar){case"!":return this.consumeOrElse(stream,"=","Not","NE");case"<":return this.consumeOrElse(stream,"=","LT","LTE");case">":return this.consumeOrElse(stream,"=","GT","GTE");case"=":return this.consumeOrElse(stream,"=","Assign","EQ");case"&":return this.consumeOrElse(stream,"&","Expref","And");case"|":return this.consumeOrElse(stream,
|
|
22
|
-
"|","Pipe","Or");case"/":return this.consumeOrElse(stream,"/","Divide","Div")}}consumeLiteral(stream){this._current+=1;const start=this._current;const maxLength=stream.length;while(stream[this._current]!=="`"&&this._current<maxLength){let current=this._current;if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]==="`")){current+=2}else{current+=1}this._current=current}let literalString=stream.slice(start,this._current).trimStart();literalString=literalString.replace("\\`","`");
|
|
23
|
-
let literal=null;let ok=false;if(this.looksLikeJSON(literalString)){[literal,ok]=this.parseJSON(literalString)}if(!ok&&this._enable_legacy_literals){[literal,ok]=this.parseJSON(`"${literalString}"`)}if(!ok){const error=new Error(`Syntax error: unexpected end of JSON input or invalid format for a JSON literal: ${stream[this._current]}`);error.name="LexerError";throw error}this._current+=1;return literal}looksLikeJSON(literalString){const startingChars='[{"';const jsonLiterals=["true","false","nul\
|
|
24
|
-
l"];const numberLooking="-0123456789";if(literalString===""){return false}if(startingChars.includes(literalString[0])){return true}if(jsonLiterals.includes(literalString)){return true}if(numberLooking.includes(literalString[0])){const[_,ok]=this.parseJSON(literalString);return ok}return false}parseJSON(text){try{const json=JSON.parse(text);return[json,true]}catch{return[null,false]}}};var Lexer=new StreamLexer;var Lexer_default=Lexer;var bindingPower={["EOF"]:0,["Variable"]:0,["UnquotedIdentifie\
|
|
25
|
-
r"]:0,["QuotedIdentifier"]:0,["Rbracket"]:0,["Rparen"]:0,["Comma"]:0,["Rbrace"]:0,["Number"]:0,["Current"]:0,["Expref"]:0,["Root"]:0,["Assign"]:1,["Pipe"]:1,["Question"]:2,["Or"]:3,["And"]:4,["EQ"]:5,["GT"]:5,["LT"]:5,["GTE"]:5,["LTE"]:5,["NE"]:5,["Minus"]:6,["Plus"]:6,["Div"]:7,["Divide"]:7,["Modulo"]:7,["Multiply"]:7,["Flatten"]:9,["Star"]:20,["Filter"]:21,["Dot"]:40,["Not"]:45,["Lbrace"]:50,["Lbracket"]:55,["Lparen"]:60};var TokenParser=class _TokenParser{index=0;tokens=[];parse(expression,options){
|
|
26
|
-
this.loadTokens(expression,options||{enable_legacy_literals:false});this.index=0;const ast=this.expression(0);if(this.lookahead(0)!=="EOF"){const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error: unexpected token type: ${token.type}, value: ${token.value}`)}return ast}loadTokens(expression,options){this.tokens=Lexer_default.tokenize(expression,options);this.tokens.push({type:"EOF",value:"",start:expression.length})}expression(rbp){const leftToken=this.lookaheadToken(0);this.advance();
|
|
27
|
-
let left=this.nud(leftToken);let currentTokenType=this.lookahead(0);while(rbp<bindingPower[currentTokenType]){this.advance();left=this.led(currentTokenType,left);currentTokenType=this.lookahead(0)}return left}lookahead(offset){return this.tokens[this.index+offset].type}lookaheadToken(offset){return this.tokens[this.index+offset]}advance(){this.index+=1}nud(token){switch(token.type){case"Variable":return{type:"Variable",name:token.value};case"Literal":return{type:"Literal",value:token.value};case"\
|
|
28
|
-
UnquotedIdentifier":{if(_TokenParser.isKeyword(token,"let")&&this.lookahead(0)==="Variable"){return this.parseLetExpression()}else{return{type:"Field",name:token.value}}}case"QuotedIdentifier":if(this.lookahead(0)==="Lparen"){throw new Error("Syntax error: quoted identifier not allowed for function names.")}else{return{type:"Field",name:token.value}}case"Not":{const child=this.expression(bindingPower.Not);return{type:"NotExpression",child}}case"Minus":{const child=this.expression(bindingPower.Minus);
|
|
29
|
-
return{type:"Unary",operator:token.type,operand:child}}case"Plus":{const child=this.expression(bindingPower.Plus);return{type:"Unary",operator:token.type,operand:child}}case"Star":{const left={type:"Identity"};return{type:"ValueProjection",left,right:this.parseProjectionRHS(bindingPower.Star)}}case"Filter":return this.led(token.type,{type:"Identity"});case"Lbrace":return this.parseMultiselectHash();case"Flatten":{const left={type:"Flatten",child:{type:"Identity"}};const right=this.parseProjectionRHS(
|
|
30
|
-
bindingPower.Flatten);return{type:"Projection",left,right}}case"Lbracket":{if(this.lookahead(0)==="Number"||this.lookahead(0)==="Colon"){const right=this.parseIndexExpression();return this.projectIfSlice({type:"Identity"},right)}if(this.lookahead(0)==="Star"&&this.lookahead(1)==="Rbracket"){this.advance();this.advance();const right=this.parseProjectionRHS(bindingPower.Star);return{left:{type:"Identity"},right,type:"Projection"}}return this.parseMultiselectList()}case"Current":return{type:"Curren\
|
|
31
|
-
t"};case"Root":return{type:"Root"};case"Expref":{const child=this.expression(bindingPower.Expref);return{type:"ExpressionReference",child}}case"Lparen":{const expression=this.expression(0);this.match("Rparen");return expression}default:this.errorToken(token)}}led(tokenName,left){switch(tokenName){case"Question":{const trueExpr=this.expression(0);this.match("Colon");const falseExpr=this.expression(0);return{type:"Ternary",condition:left,trueExpr,falseExpr}}case"Dot":{const rbp=bindingPower.Dot;if(this.
|
|
32
|
-
lookahead(0)!=="Star"){const right2=this.parseDotRHS(rbp);return{type:"Subexpression",left,right:right2}}this.advance();const right=this.parseProjectionRHS(rbp);return{type:"ValueProjection",left,right}}case"Pipe":{const right=this.expression(bindingPower.Pipe);return{type:"Pipe",left,right}}case"Or":{const right=this.expression(bindingPower.Or);return{type:"OrExpression",left,right}}case"And":{const right=this.expression(bindingPower.And);return{type:"AndExpression",left,right}}case"Lparen":{if(left.
|
|
33
|
-
type!=="Field"){throw new Error("Syntax error: expected a Field node")}const name=left.name;const args=this.parseCommaSeparatedExpressionsUntilToken("Rparen");const node={name,type:"Function",children:args};return node}case"Filter":{const condition=this.expression(0);this.match("Rbracket");const right=this.lookahead(0)==="Flatten"?{type:"Identity"}:this.parseProjectionRHS(bindingPower.Filter);return{type:"FilterProjection",left,right,condition}}case"Flatten":{const leftNode={type:"Flatten",child:left};
|
|
34
|
-
const right=this.parseProjectionRHS(bindingPower.Flatten);return{type:"Projection",left:leftNode,right}}case"Assign":{const leftNode=left;const right=this.expression(0);return{type:"Binding",variable:leftNode.name,reference:right}}case"EQ":case"NE":case"GT":case"GTE":case"LT":case"LTE":return this.parseComparator(left,tokenName);case"Plus":case"Minus":case"Multiply":case"Star":case"Divide":case"Modulo":case"Div":return this.parseArithmetic(left,tokenName);case"Lbracket":{const token=this.lookaheadToken(
|
|
35
|
-
0);if(token.type==="Number"||token.type==="Colon"){const right2=this.parseIndexExpression();return this.projectIfSlice(left,right2)}this.match("Star");this.match("Rbracket");const right=this.parseProjectionRHS(bindingPower.Star);return{type:"Projection",left,right}}default:return this.errorToken(this.lookaheadToken(0))}}static isKeyword(token,keyword){return token.type==="UnquotedIdentifier"&&token.value===keyword}match(tokenType){if(this.lookahead(0)===tokenType){this.advance();return}else{const token=this.
|
|
36
|
-
lookaheadToken(0);this.errorToken(token,`Syntax error: expected ${tokenType}, got: ${token.type}`)}}errorToken(token,message=""){const error=new Error(message||`Syntax error: invalid token (${token.type}): "${token.value}"`);error.name="ParserError";throw error}parseIndexExpression(){if(this.lookahead(0)==="Colon"||this.lookahead(1)==="Colon"){return this.parseSliceExpression()}const value=Number(this.lookaheadToken(0).value);this.advance();this.match("Rbracket");return{type:"Index",value}}projectIfSlice(left,right){
|
|
37
|
-
const indexExpr={type:"IndexExpression",left,right};if(right.type==="Slice"){return{left:indexExpr,right:this.parseProjectionRHS(bindingPower.Star),type:"Projection"}}return indexExpr}parseSliceExpression(){const parts=[null,null,null];let index=0;let current=this.lookaheadToken(0);while(current.type!="Rbracket"&&index<3){if(current.type==="Colon"){index++;if(index===3){this.errorToken(this.lookaheadToken(0),"Syntax error, too many colons in slice expression")}this.advance()}else if(current.type===
|
|
38
|
-
"Number"){const part=this.lookaheadToken(0).value;parts[index]=part;this.advance()}else{const next=this.lookaheadToken(0);this.errorToken(next,`Syntax error, unexpected token: ${next.value}(${next.type})`)}current=this.lookaheadToken(0)}this.match("Rbracket");const[start,stop,step]=parts;return{type:"Slice",start,stop,step}}parseLetExpression(){const separated=this.parseCommaSeparatedExpressionsUntilKeyword("in");const expression=this.expression(0);const bindings=separated.map(binding=>binding);
|
|
39
|
-
return{type:"LetExpression",bindings,expression}}parseCommaSeparatedExpressionsUntilKeyword(keyword){return this.parseCommaSeparatedExpressionsUntil(()=>{return _TokenParser.isKeyword(this.lookaheadToken(0),keyword)},()=>{this.advance()})}parseCommaSeparatedExpressionsUntilToken(token){return this.parseCommaSeparatedExpressionsUntil(()=>{return this.lookahead(0)===token},()=>{return this.match(token)})}parseCommaSeparatedExpressionsUntil(isEndToken,matchEndToken){const args=[];let expression;while(!isEndToken()){
|
|
40
|
-
expression=this.expression(0);if(this.lookahead(0)==="Comma"){this.match("Comma")}args.push(expression)}matchEndToken();return args}parseComparator(left,comparator){const right=this.expression(bindingPower[comparator]);return{type:"Comparator",name:comparator,left,right}}parseArithmetic(left,operator){const right=this.expression(bindingPower[operator]);return{type:"Arithmetic",operator,left,right}}parseDotRHS(rbp){const lookahead=this.lookahead(0);const exprTokens=["UnquotedIdentifier","QuotedId\
|
|
41
|
-
entifier","Star"];if(exprTokens.includes(lookahead)){return this.expression(rbp)}if(lookahead==="Lbracket"){this.match("Lbracket");return this.parseMultiselectList()}if(lookahead==="Lbrace"){this.match("Lbrace");return this.parseMultiselectHash()}const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}parseProjectionRHS(rbp){if(bindingPower[this.lookahead(0)]<10){return{type:"Identity"}}if(this.lookahead(0)==="Lbracket"){return this.
|
|
42
|
-
expression(rbp)}if(this.lookahead(0)==="Filter"){return this.expression(rbp)}if(this.lookahead(0)==="Dot"){this.match("Dot");return this.parseDotRHS(rbp)}const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}parseMultiselectList(){const expressions=[];while(this.lookahead(0)!=="Rbracket"){const expression=this.expression(0);expressions.push(expression);if(this.lookahead(0)==="Comma"){this.match("Comma");if(this.lookahead(0)==="R\
|
|
43
|
-
bracket"){throw new Error("Syntax error: unexpected token Rbracket")}}}this.match("Rbracket");return{type:"MultiSelectList",children:expressions}}parseMultiselectHash(){const pairs=[];const identifierTypes=["UnquotedIdentifier","QuotedIdentifier"];let keyToken;let keyName;let value;for(;;){keyToken=this.lookaheadToken(0);if(!identifierTypes.includes(keyToken.type)){throw new Error(`Syntax error: expecting an identifier token, got: ${keyToken.type}`)}keyName=keyToken.value;this.advance();this.match(
|
|
44
|
-
"Colon");value=this.expression(0);pairs.push({value,type:"KeyValuePair",name:keyName});if(this.lookahead(0)==="Comma"){this.match("Comma")}else if(this.lookahead(0)==="Rbrace"){this.match("Rbrace");break}}return{type:"MultiSelectHash",children:pairs}}};var Parser=new TokenParser;var Parser_default=Parser;var Text=class _Text{_text;constructor(text){this._text=text}get string(){return this._text}get length(){return this.codePoints.length}compareTo(other){return _Text.compare(this,new _Text(other))}static get comparer(){
|
|
45
|
-
const stringComparer=(left,right)=>{return new _Text(left).compareTo(right)};return stringComparer}static compare(left,right){const leftCp=left.codePoints;const rightCp=right.codePoints;for(let index=0;index<Math.min(leftCp.length,rightCp.length);index++){if(leftCp[index]===rightCp[index]){continue}return leftCp[index]-rightCp[index]>0?1:-1}return leftCp.length-rightCp.length>0?1:-1}reverse(){return String.fromCodePoint(...this.codePoints.reverse())}get codePoints(){const array=[...this._text].map(
|
|
46
|
-
s=>s.codePointAt(0));return array}};var createMathFunction=mathFn=>([value])=>mathFn(value);var createStringFunction=stringFn=>([subject])=>stringFn(subject);var createObjectFunction=objFn=>([obj])=>objFn(obj);var Runtime=class{_interpreter;_functionTable;_customFunctions=new Set;TYPE_NAME_TABLE=Object.freeze({[0]:"number",[1]:"any",[2]:"string",[3]:"array",[4]:"object",[5]:"boolean",[6]:"expression",[7]:"null",[8]:"Array<number>",[10]:"Array<object>",[9]:"Array<string>",[11]:"Array<Array<any>>"});constructor(interpreter){
|
|
47
|
-
this._interpreter=interpreter;this._functionTable=this.buildFunctionTable()}buildFunctionTable(){return{abs:{_func:createMathFunction(Math.abs),_signature:[{types:[0]}]},ceil:{_func:createMathFunction(Math.ceil),_signature:[{types:[0]}]},floor:{_func:createMathFunction(Math.floor),_signature:[{types:[0]}]},lower:{_func:createStringFunction(lower),_signature:[{types:[2]}]},upper:{_func:createStringFunction(upper),_signature:[{types:[2]}]},keys:{_func:createObjectFunction(Object.keys),_signature:[
|
|
48
|
-
{types:[4]}]},values:{_func:createObjectFunction(Object.values),_signature:[{types:[4]}]},avg:{_func:this.functionAvg,_signature:[{types:[8]}]},contains:{_func:this.functionContains,_signature:[{types:[2,3]},{types:[1]}]},ends_with:{_func:this.functionEndsWith,_signature:[{types:[2]},{types:[2]}]},find_first:{_func:this.functionFindFirst,_signature:[{types:[2]},{types:[2]},{types:[0],optional:true},{types:[0],optional:true}]},find_last:{_func:this.functionFindLast,_signature:[{types:[2]},{types:[
|
|
49
|
-
2]},{types:[0],optional:true},{types:[0],optional:true}]},from_items:{_func:this.functionFromItems,_signature:[{types:[11]}]},group_by:{_func:this.functionGroupBy,_signature:[{types:[3]},{types:[6]}]},items:{_func:this.functionItems,_signature:[{types:[4]}]},join:{_func:this.functionJoin,_signature:[{types:[2]},{types:[9]}]},length:{_func:this.functionLength,_signature:[{types:[2,3,4]}]},map:{_func:this.functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this.functionMax,_signature:[{types:[
|
|
50
|
-
8,9]}]},max_by:{_func:this.functionMaxBy,_signature:[{types:[3]},{types:[6]}]},merge:{_func:this.functionMerge,_signature:[{types:[4],variadic:true}]},min:{_func:this.functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this.functionMinBy,_signature:[{types:[3]},{types:[6]}]},not_null:{_func:this.functionNotNull,_signature:[{types:[1],variadic:true}]},pad_left:{_func:this.functionPadLeft,_signature:[{types:[2]},{types:[0]},{types:[2],optional:true}]},pad_right:{_func:this.functionPadRight,_signature:[
|
|
51
|
-
{types:[2]},{types:[0]},{types:[2],optional:true}]},replace:{_func:this.functionReplace,_signature:[{types:[2]},{types:[2]},{types:[2]},{types:[0],optional:true}]},reverse:{_func:this.functionReverse,_signature:[{types:[2,3]}]},sort:{_func:this.functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this.functionSortBy,_signature:[{types:[3]},{types:[6]}]},split:{_func:this.functionSplit,_signature:[{types:[2]},{types:[2]},{types:[0],optional:true}]},starts_with:{_func:this.functionStartsWith,_signature:[
|
|
52
|
-
{types:[2]},{types:[2]}]},sum:{_func:this.functionSum,_signature:[{types:[8]}]},to_array:{_func:this.functionToArray,_signature:[{types:[1]}]},to_number:{_func:this.functionToNumber,_signature:[{types:[1]}]},to_string:{_func:this.functionToString,_signature:[{types:[1]}]},trim:{_func:this.functionTrim,_signature:[{types:[2]},{types:[2],optional:true}]},trim_left:{_func:this.functionTrimLeft,_signature:[{types:[2]},{types:[2],optional:true}]},trim_right:{_func:this.functionTrimRight,_signature:[{
|
|
53
|
-
types:[2]},{types:[2],optional:true}]},type:{_func:this.functionType,_signature:[{types:[1]}]},zip:{_func:this.functionZip,_signature:[{types:[3],variadic:true}]}}}registerFunction(name,customFunction,signature,options){const result=this._registerInternal(name,customFunction,signature,options);if(!result.success){throw new Error(result.message)}}_registerInternal(name,customFunction,signature,options={}){if(!name||typeof name!=="string"||name.trim()===""){return{success:false,reason:"invalid-nam\
|
|
54
|
-
e",message:"Function name must be a non-empty string"}}try{this.validateInputSignatures(name,signature)}catch(error){return{success:false,reason:"invalid-signature",message:error instanceof Error?error.message:"Invalid function signature"}}const{override=false,warn=false}=options;const exists=name in this._functionTable;if(exists&&!override){return{success:false,reason:"already-exists",message:`Function already defined: ${name}(). Use { override: true } to replace it.`}}if(exists&&override&&warn){
|
|
55
|
-
console.warn(`Warning: Overriding existing function: ${name}()`)}this._functionTable[name]={_func:customFunction.bind(this),_signature:signature};this._customFunctions.add(name);const message=exists?`Function ${name}() overridden successfully`:`Function ${name}() registered successfully`;return{success:true,message}}register(name,customFunction,signature,options={}){return this._registerInternal(name,customFunction,signature,options)}unregister(name){if(!this._customFunctions.has(name)){return false}
|
|
56
|
-
delete this._functionTable[name];this._customFunctions.delete(name);return true}isRegistered(name){return name in this._functionTable}getRegistered(){return Object.keys(this._functionTable)}getCustomFunctions(){return Array.from(this._customFunctions)}clearCustomFunctions(){for(const name of this._customFunctions){delete this._functionTable[name]}this._customFunctions.clear()}callFunction(name,resolvedArgs){const functionEntry=this._functionTable[name];if(functionEntry===void 0){throw new Error(
|
|
57
|
-
`Unknown function: ${name}()`)}this.validateArgs(name,resolvedArgs,functionEntry._signature);return functionEntry._func.call(this,resolvedArgs)}validateInputSignatures(name,signature){for(let i=0;i<signature.length;i+=1){if("variadic"in signature[i]&&i!==signature.length-1){throw new Error(`Invalid arity: ${name}() 'variadic' argument ${i+1} must occur last`)}}}validateArgs(name,args,signature){this.validateInputSignatures(name,signature);this.validateArity(name,args,signature);this.validateTypes(
|
|
58
|
-
name,args,signature)}validateArity(name,args,signature){const numberOfRequiredArgs=signature.filter(argSignature=>!(argSignature.optional??false)).length;const lastArgIsVariadic=signature[signature.length-1]?.variadic??false;const tooFewArgs=args.length<numberOfRequiredArgs;const tooManyArgs=args.length>signature.length;if(lastArgIsVariadic&&tooFewArgs||!lastArgIsVariadic&&(tooFewArgs||tooManyArgs)){const tooFewModifier=tooFewArgs&&(!lastArgIsVariadic&&numberOfRequiredArgs>1||lastArgIsVariadic)?
|
|
59
|
-
"at least ":"";const pluralized=signature.length>1;throw new Error(`Invalid arity: ${name}() takes ${tooFewModifier}${numberOfRequiredArgs} argument${pluralized&&"s"||""} but received ${args.length}`)}}validateTypes(name,args,signature){for(let i=0;i<signature.length;i+=1){const currentSpec=signature[i].types;const actualType=this.getTypeName(args[i]);if(actualType===void 0){continue}const typeMatched=currentSpec.some(expectedType=>this.typeMatches(actualType,expectedType,args[i]));if(!typeMatched){
|
|
60
|
-
const expected=currentSpec.map(typeId=>this.TYPE_NAME_TABLE[typeId]).join(" | ");throw new Error(`Invalid type: ${name}() expected argument ${i+1} to be type (${expected}) but received type ${this.TYPE_NAME_TABLE[actualType]} instead.`)}}}typeMatches(actual,expected,argValue){if(expected===1){return true}if(expected===9||expected===8||expected===10||expected===11||expected===3){if(expected===3){return actual===3}if(actual===3){let subtype;if(expected===8){subtype=0}else if(expected===10){subtype=
|
|
61
|
-
4}else if(expected===9){subtype=2}else if(expected===11){subtype=3}const array=argValue;for(let i=0;i<array.length;i+=1){const typeName=this.getTypeName(array[i]);if(typeName!==void 0&&subtype!==void 0&&!this.typeMatches(typeName,subtype,array[i])){return false}}return true}}else{return actual===expected}return false}getTypeName(obj){if(obj===null){return 7}if(typeof obj==="string"){return 2}if(typeof obj==="number"){return 0}if(typeof obj==="boolean"){return 5}if(Array.isArray(obj)){return 3}if(typeof obj===
|
|
62
|
-
"object"){if(obj.expref){return 6}return 4}return}createKeyFunction(exprefNode,allowedTypes){const interpreter=this._interpreter;const keyFunc=x=>{const current=interpreter.visit(exprefNode,x);if(!allowedTypes.includes(this.getTypeName(current))){const msg=`Invalid type: expected one of (${allowedTypes.map(t=>this.TYPE_NAME_TABLE[t]).join(" | ")}), received ${this.TYPE_NAME_TABLE[this.getTypeName(current)]}`;throw new Error(msg)}return current};return keyFunc}functionAvg=([inputArray])=>{if(!inputArray||
|
|
63
|
-
inputArray.length==0){return null}let sum=0;for(let i=0;i<inputArray.length;i+=1){sum+=inputArray[i]}return sum/inputArray.length};functionContains=([searchable,searchValue])=>{if(Array.isArray(searchable)){const array=searchable;return array.includes(searchValue)}if(typeof searchable==="string"){const text=searchable;if(typeof searchValue==="string"){return text.includes(searchValue)}}return null};functionEndsWith=resolvedArgs=>{const[searchStr,suffix]=resolvedArgs;return searchStr.includes(suffix,
|
|
64
|
-
searchStr.length-suffix.length)};functionFindFirst=this.createFindFunction(findFirst);functionFindLast=this.createFindFunction(findLast);createFindFunction(findFn){return resolvedArgs=>{const subject=resolvedArgs[0];const search2=resolvedArgs[1];const start=resolvedArgs.length>2?resolvedArgs[2]:void 0;const end=resolvedArgs.length>3?resolvedArgs[3]:void 0;return findFn(subject,search2,start,end)}}functionFromItems=([array])=>{array.map(pair=>{if(pair.length!=2||typeof pair[0]!=="string"){throw new Error(
|
|
65
|
-
"invalid value, each array must contain two elements, a pair of string and value")}});return Object.fromEntries(array)};functionGroupBy=([array,exprefNode])=>{const keyFunction=this.createKeyFunction(exprefNode,[2]);return array.reduce((acc,cur)=>{const k=keyFunction(cur??{});const target=acc[k]=acc[k]||[];target.push(cur);return acc},{})};functionItems=([inputValue])=>{return Object.entries(inputValue)};functionJoin=resolvedArgs=>{const[joinChar,listJoin]=resolvedArgs;return listJoin.join(joinChar)};functionLength=([
|
|
66
|
-
inputValue])=>{if(typeof inputValue==="string"){return new Text(inputValue).length}if(Array.isArray(inputValue)){return inputValue.length}return Object.keys(inputValue).length};functionMap=([exprefNode,elements])=>{if(!this._interpreter){return[]}const mapped=[];const interpreter=this._interpreter;for(let i=0;i<elements.length;i+=1){mapped.push(interpreter.visit(exprefNode,elements[i]))}return mapped};functionMax=([inputValue])=>{if(!inputValue.length){return null}const typeName=this.getTypeName(
|
|
67
|
-
inputValue[0]);if(typeName===0){return Math.max(...inputValue)}const elements=inputValue;let maxElement=elements[0];for(let i=1;i<elements.length;i+=1){if(maxElement.localeCompare(elements[i])<0){maxElement=elements[i]}}return maxElement};functionMaxBy=resolvedArgs=>{const exprefNode=resolvedArgs[1];const resolvedArray=resolvedArgs[0];const keyFunction=this.createKeyFunction(exprefNode,[0,2]);let maxNumber=-Infinity;let maxRecord;let current;for(let i=0;i<resolvedArray.length;i+=1){current=keyFunction&&
|
|
68
|
-
keyFunction(resolvedArray[i]);if(current!==void 0&¤t>maxNumber){maxNumber=current;maxRecord=resolvedArray[i]}}return maxRecord||null};functionMerge=resolvedArgs=>{let merged={};for(let i=0;i<resolvedArgs.length;i+=1){const current=resolvedArgs[i];merged=Object.assign(merged,current)}return merged};functionMin=([inputValue])=>{if(!inputValue.length){return null}const typeName=this.getTypeName(inputValue[0]);if(typeName===0){return Math.min(...inputValue)}const elements=inputValue;let minElement=elements[0];
|
|
69
|
-
for(let i=1;i<elements.length;i+=1){if(elements[i].localeCompare(minElement)<0){minElement=elements[i]}}return minElement};functionMinBy=resolvedArgs=>{const exprefNode=resolvedArgs[1];const resolvedArray=resolvedArgs[0];const keyFunction=this.createKeyFunction(exprefNode,[0,2]);let minNumber=Infinity;let minRecord;let current;for(let i=0;i<resolvedArray.length;i+=1){current=keyFunction&&keyFunction(resolvedArray[i]);if(current!==void 0&¤t<minNumber){minNumber=current;minRecord=resolvedArray[i]}}
|
|
70
|
-
return minRecord||null};functionNotNull=resolvedArgs=>{for(let i=0;i<resolvedArgs.length;i+=1){if(this.getTypeName(resolvedArgs[i])!==7){return resolvedArgs[i]}}return null};functionPadLeft=this.createPadFunction(padLeft);functionPadRight=this.createPadFunction(padRight);createPadFunction(padFn){return resolvedArgs=>{const subject=resolvedArgs[0];const width=resolvedArgs[1];const padding=resolvedArgs.length>2?resolvedArgs[2]:void 0;return padFn(subject,width,padding)}}functionReplace=resolvedArgs=>{
|
|
71
|
-
const subject=resolvedArgs[0];const string=resolvedArgs[1];const by=resolvedArgs[2];return replace(subject,string,by,resolvedArgs.length>3?resolvedArgs[3]:void 0)};functionSplit=resolvedArgs=>{const subject=resolvedArgs[0];const search2=resolvedArgs[1];return split(subject,search2,resolvedArgs.length>2?resolvedArgs[2]:void 0)};functionReverse=([inputValue])=>{const typeName=this.getTypeName(inputValue);if(typeName===2){return new Text(inputValue).reverse()}const reversedArray=inputValue.slice(0);
|
|
72
|
-
reversedArray.reverse();return reversedArray};functionSort=([inputValue])=>{if(inputValue.length==0){return inputValue}if(typeof inputValue[0]==="string"){return[...inputValue].sort(Text.comparer)}return[...inputValue].sort()};functionSortBy=resolvedArgs=>{const sortedArray=resolvedArgs[0].slice(0);if(sortedArray.length===0){return sortedArray}const interpreter=this._interpreter;const exprefNode=resolvedArgs[1];const requiredType=this.getTypeName(interpreter.visit(exprefNode,sortedArray[0]));if(requiredType!==
|
|
73
|
-
void 0&&![0,2].includes(requiredType)){throw new Error(`Invalid type: unexpected type (${this.TYPE_NAME_TABLE[requiredType]})`)}function throwInvalidTypeError(rt,item){throw new Error(`Invalid type: expected (${rt.TYPE_NAME_TABLE[requiredType]}), received ${rt.TYPE_NAME_TABLE[rt.getTypeName(item)]}`)}return sortedArray.sort((a,b)=>{const exprA=interpreter.visit(exprefNode,a);const exprB=interpreter.visit(exprefNode,b);if(this.getTypeName(exprA)!==requiredType){throwInvalidTypeError(this,exprA)}else if(this.
|
|
74
|
-
getTypeName(exprB)!==requiredType){throwInvalidTypeError(this,exprB)}if(requiredType===2){return Text.comparer(exprA,exprB)}return exprA-exprB})};functionStartsWith=([searchable,searchStr])=>{return searchable.startsWith(searchStr)};functionSum=([inputValue])=>{return inputValue.reduce((x,y)=>x+y,0)};functionToArray=([inputValue])=>{if(this.getTypeName(inputValue)===3){return inputValue}return[inputValue]};functionToNumber=([inputValue])=>{const typeName=this.getTypeName(inputValue);let convertedValue;
|
|
75
|
-
if(typeName===0){return inputValue}if(typeName===2){convertedValue=+inputValue;if(!isNaN(convertedValue)){return convertedValue}}return null};functionToString=([inputValue])=>{if(this.getTypeName(inputValue)===2){return inputValue}return JSON.stringify(inputValue)};functionTrim=this.createTrimFunction(trim);functionTrimLeft=this.createTrimFunction(trimLeft);functionTrimRight=this.createTrimFunction(trimRight);createTrimFunction(trimFn){return resolvedArgs=>{const subject=resolvedArgs[0];const chars=resolvedArgs.
|
|
76
|
-
length>1?resolvedArgs[1]:void 0;return trimFn(subject,chars)}}functionType=([inputValue])=>{switch(this.getTypeName(inputValue)){case 0:return"number";case 2:return"string";case 3:return"array";case 4:return"object";case 5:return"boolean";case 7:return"null";default:throw new Error("invalid-type")}};functionZip=array=>{const length=Math.min(...array.map(arr=>arr.length));const result=Array(length).fill(null).map((_,index)=>array.map(arr=>arr[index]));return result}};var ScopeChain=class _ScopeChain{inner=void 0;data={};get currentScopeData(){
|
|
77
|
-
return this.data}withScope(data){const outer=new _ScopeChain;outer.inner=this;outer.data=data;return outer}getValue(identifier){if(Object.prototype.hasOwnProperty.call(this.data,identifier)){return this.data[identifier]}if(this.inner){return this.inner.getValue(identifier)}return null}};var emptyScopeChain=new ScopeChain;var TreeInterpreter=class _TreeInterpreter{runtime;_rootValue=null;_scope;constructor(){this.runtime=new Runtime(this);this._scope=new ScopeChain}withScope(scope){const interpreter=new _TreeInterpreter;
|
|
78
|
-
interpreter.runtime._functionTable=this.runtime._functionTable;interpreter._rootValue=this._rootValue;interpreter._scope=this._scope.withScope(scope);return interpreter}search(node,value){this._rootValue=value;this._scope=emptyScopeChain;return this.visit(node,value)}visit(node,value){switch(node.type){case"Ternary":{const condition=this.visit(node.condition,value);if(!isFalse(condition)){return this.visit(node.trueExpr,value)}return this.visit(node.falseExpr,value)}case"Field":const identifier=node.
|
|
79
|
-
name;if(value===null||typeof value!=="object"||Array.isArray(value)){return null}return value[identifier]??null;case"LetExpression":{const{bindings,expression}=node;let scope={};bindings.forEach(binding=>{const reference=this.visit(binding,value);scope={...scope,...reference}});return this.withScope(scope).visit(expression,value)}case"Binding":{const{variable,reference}=node;const result=this.visit(reference,value);return{[variable]:result}}case"Variable":{const variable=node.name;if(!this._scope.
|
|
80
|
-
getValue(variable)&&!Object.prototype.hasOwnProperty.call(this._scope.currentScopeData,variable)){throw new Error(`Error referencing undefined variable ${variable}`)}return this._scope.getValue(variable)}case"IndexExpression":return this.visit(node.right,this.visit(node.left,value));case"Subexpression":{const result=this.visit(node.left,value);return result!=null?this.visit(node.right,result)??null:null}case"Index":{if(!Array.isArray(value)){return null}const index=node.value<0?value.length+node.
|
|
81
|
-
value:node.value;return value[index]??null}case"Slice":{if(!Array.isArray(value)&&typeof value!=="string"){return null}const{start,stop,step}=this.computeSliceParams(value.length,node);if(typeof value==="string"){const chars=[...value];const sliced=this.slice(chars,start,stop,step);return sliced.join("")}else{return this.slice(value,start,stop,step)}}case"Projection":{const{left,right}=node;let allowString=false;if(left.type==="IndexExpression"&&left.right.type==="Slice"){allowString=true}const base=this.
|
|
82
|
-
visit(left,value);if(allowString&&typeof base==="string"){return this.visit(right,base)}if(!Array.isArray(base)){return null}const collected=[];for(const elem of base){const current=this.visit(right,elem);if(current!==null){collected.push(current)}}return collected}case"ValueProjection":{const{left,right}=node;const base=this.visit(left,value);if(base===null||typeof base!=="object"||Array.isArray(base)){return null}const collected=[];const values=Object.values(base);for(const elem of values){const current=this.
|
|
83
|
-
visit(right,elem);if(current!==null){collected.push(current)}}return collected}case"FilterProjection":{const{left,right,condition}=node;const base=this.visit(left,value);if(!Array.isArray(base)){return null}const results=[];for(const elem of base){const matched=this.visit(condition,elem);if(isFalse(matched)){continue}const result=this.visit(right,elem);if(result!==null){results.push(result)}}return results}case"Arithmetic":{const first=this.visit(node.left,value);const second=this.visit(node.right,
|
|
84
|
-
value);switch(node.operator){case"Plus":return add(first,second);case"Minus":return sub(first,second);case"Multiply":case"Star":return mul(first,second);case"Divide":return divide(first,second);case"Modulo":return mod(first,second);case"Div":return div(first,second);default:throw new Error(`Syntax error: unknown arithmetic operator: ${node.operator}`)}}case"Unary":{const operand=this.visit(node.operand,value);switch(node.operator){case"Plus":ensureNumbers(operand);return operand;case"Minus":ensureNumbers(
|
|
85
|
-
operand);return-operand;default:throw new Error(`Syntax error: unknown arithmetic operator: ${node.operator}`)}}case"Comparator":{const first=this.visit(node.left,value);const second=this.visit(node.right,value);switch(node.name){case"EQ":return strictDeepEqual(first,second);case"NE":return!strictDeepEqual(first,second)}if(typeof first!=="number"||typeof second!=="number"){return null}switch(node.name){case"GT":return first>second;case"GTE":return first>=second;case"LT":return first<second;case"\
|
|
86
|
-
LTE":return first<=second}}case"Flatten":{const original=this.visit(node.child,value);return Array.isArray(original)?original.flat():null}case"Root":return this._rootValue;case"MultiSelectList":{const collected=[];for(const child of node.children){collected.push(this.visit(child,value))}return collected}case"MultiSelectHash":{const collected={};for(const child of node.children){collected[child.name]=this.visit(child.value,value)}return collected}case"OrExpression":{const result=this.visit(node.left,
|
|
87
|
-
value);if(isFalse(result)){return this.visit(node.right,value)}return result}case"AndExpression":{const result=this.visit(node.left,value);if(isFalse(result)){return result}return this.visit(node.right,value)}case"NotExpression":return isFalse(this.visit(node.child,value));case"Literal":return node.value;case"Pipe":return this.visit(node.right,this.visit(node.left,value));case"Function":{const args=[];for(const child of node.children){args.push(this.visit(child,value))}return this.runtime.callFunction(
|
|
88
|
-
node.name,args)}case"ExpressionReference":return{expref:true,...node.child};case"Current":case"Identity":return value}}computeSliceParams(arrayLength,sliceNode){let{start,stop,step}=sliceNode;if(step===null){step=1}else if(step===0){const error=new Error("Invalid value: slice step cannot be 0");error.name="RuntimeError";throw error}start=start===null?step<0?arrayLength-1:0:this.capSliceRange(arrayLength,start,step);stop=stop===null?step<0?-1:arrayLength:this.capSliceRange(arrayLength,stop,step);
|
|
89
|
-
return{start,stop,step}}capSliceRange(arrayLength,actualValue,step){let nextActualValue=actualValue;if(nextActualValue<0){nextActualValue+=arrayLength;if(nextActualValue<0){nextActualValue=step<0?-1:0}}else if(nextActualValue>=arrayLength){nextActualValue=step<0?arrayLength-1:arrayLength}return nextActualValue}slice(collection,start,end,step){const result=[];if(step>0){for(let i=start;i<end;i+=step){result.push(collection[i])}}else{for(let i=start;i>end;i+=step){result.push(collection[i])}}return result}};
|
|
90
|
-
var TreeInterpreterInstance=new TreeInterpreter;var TreeInterpreter_default=TreeInterpreterInstance;var TYPE_ANY=1;var TYPE_ARRAY=3;var TYPE_ARRAY_ARRAY=11;var TYPE_ARRAY_NUMBER=8;var TYPE_ARRAY_OBJECT=10;var TYPE_ARRAY_STRING=9;var TYPE_BOOLEAN=5;var TYPE_EXPREF=6;var TYPE_NULL=7;var TYPE_NUMBER=0;var TYPE_OBJECT=4;var TYPE_STRING=2;function compile(expression,options){const nodeTree=Parser_default.parse(expression,options);return nodeTree}function tokenize(expression,options){return Lexer_default.
|
|
91
|
-
tokenize(expression,options)}var registerFunction=(functionName,customFunction,signature,options)=>{TreeInterpreter_default.runtime.registerFunction(functionName,customFunction,signature,options)};var register=(name,customFunction,signature,options)=>{return TreeInterpreter_default.runtime.register(name,customFunction,signature,options)};var unregisterFunction=name=>{return TreeInterpreter_default.runtime.unregister(name)};var isRegistered=name=>{return TreeInterpreter_default.runtime.isRegistered(
|
|
92
|
-
name)};var getRegisteredFunctions=()=>{return TreeInterpreter_default.runtime.getRegistered()};var getCustomFunctions=()=>{return TreeInterpreter_default.runtime.getCustomFunctions()};var clearCustomFunctions=()=>{TreeInterpreter_default.runtime.clearCustomFunctions()};function search(data,expression,options){const nodeTree=Parser_default.parse(expression,options);return TreeInterpreter_default.search(nodeTree,data)}function Scope(){return new ScopeChain}var TreeInterpreter2=TreeInterpreter_default;
|
|
93
|
-
var jmespath={compile,registerFunction,register,unregisterFunction,isRegistered,getRegisteredFunctions,getCustomFunctions,clearCustomFunctions,search,tokenize,TreeInterpreter:TreeInterpreter2,TYPE_ANY,TYPE_ARRAY_NUMBER,TYPE_ARRAY_STRING,TYPE_ARRAY,TYPE_BOOLEAN,TYPE_EXPREF,TYPE_NULL,TYPE_NUMBER,TYPE_OBJECT,TYPE_STRING};export{Scope,TYPE_ANY,TYPE_ARRAY,TYPE_ARRAY_ARRAY,TYPE_ARRAY_NUMBER,TYPE_ARRAY_OBJECT,TYPE_ARRAY_STRING,TYPE_BOOLEAN,TYPE_EXPREF,TYPE_NULL,TYPE_NUMBER,TYPE_OBJECT,TYPE_STRING,TreeInterpreter2 as TreeInterpreter,clearCustomFunctions,compile,jmespath as default,getCustomFunctions,getRegisteredFunctions,isRegistered,jmespath,register,registerFunction,search,tokenize,unregisterFunction};
|