@lovrabet/lovrabet-cli 2.3.12 → 2.3.13-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/metric/contract.d.ts +8 -0
- package/lib/commands/metric/contract.js +1 -0
- package/lib/commands/metric/definition.d.ts +35 -0
- package/lib/commands/metric/definition.js +1 -0
- package/lib/commands/metric/detail.d.ts +2 -0
- package/lib/commands/metric/detail.js +1 -0
- package/lib/commands/metric/exec.d.ts +2 -0
- package/lib/commands/metric/exec.js +1 -0
- package/lib/commands/metric/index.d.ts +1 -0
- package/lib/commands/metric/index.js +1 -0
- package/lib/commands/metric/list.d.ts +2 -0
- package/lib/commands/metric/list.js +1 -0
- package/lib/commands/metric/shared.d.ts +17 -0
- package/lib/commands/metric/shared.js +1 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +4 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +5 -2
- package/skills/lovrabet/SKILL.md +12 -4
- package/skills/lovrabet/guides/app-resolution.md +2 -0
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +2 -0
- package/skills/lovrabet/guides/development-intent-handoff.md +19 -3
- package/skills/lovrabet/guides/metric-consumption.md +134 -0
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +2 -0
- package/skills/lovrabet/references/lovrabet-auth.md +4 -0
- package/skills/lovrabet/references/lovrabet-schedule-workflow.md +16 -0
- package/skills/lovrabet/references/lovrabet-skill-authoring.md +27 -0
- package/skills/lovrabet-report-generation/SKILL.md +28 -0
- package/skills/lovrabet-report-generation/references/business-skill-reuse.md +19 -0
- package/skills/lovrabet-report-generation/references/quality-checks.md +16 -0
- package/skills/lovrabet-report-generation/references/report-workflow.md +42 -0
- package/skills/lovrabet-report-generation/templates/report-outline.md +10 -0
- package/skills/lovrabet.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x27942b=a39_0x2e5b;function a39_0x2e5b(_0xa45ee4,_0x557065){_0xa45ee4=_0xa45ee4-0x168;const _0x3dd211=a39_0x3dd2();let _0x2e5be1=_0x3dd211[_0xa45ee4];return _0x2e5be1;}function a39_0x3dd2(){const _0x1b3c23=['warn','details','error','keys','en-US','command','View\x20command\x20history\x20logs','\x20\x20\x20Time:\x20','read','*\x20No\x20logs\x20found','1466846pJAWUv','459PqDdNJ','893298VDiPRB','1541904jaSVnw','5OiuNJh','12vXKrnj','3051288YWdNXE','length','readLogs','206888xDRWkj','\x20\x20\x20Duration:\x20','level','65130JXlZqX','log','250560UXbvRc','forEach','timestamp','toLocaleString','duration'];a39_0x3dd2=function(){return _0x1b3c23;};return a39_0x3dd2();}(function(_0x5523c3,_0x8bc96f){const _0x4ce23b=a39_0x2e5b,_0x5ceaa6=_0x5523c3();while(!![]){try{const _0x4632e8=-parseInt(_0x4ce23b(0x180))/0x1+parseInt(_0x4ce23b(0x172))/0x2+-parseInt(_0x4ce23b(0x177))/0x3*(-parseInt(_0x4ce23b(0x17b))/0x4)+-parseInt(_0x4ce23b(0x176))/0x5*(parseInt(_0x4ce23b(0x174))/0x6)+-parseInt(_0x4ce23b(0x175))/0x7+parseInt(_0x4ce23b(0x178))/0x8+-parseInt(_0x4ce23b(0x173))/0x9*(parseInt(_0x4ce23b(0x17e))/0xa);if(_0x4632e8===_0x8bc96f)break;else _0x5ceaa6['push'](_0x5ceaa6['shift']());}catch(_0x3afbf6){_0x5ceaa6['push'](_0x5ceaa6['shift']());}}}(a39_0x3dd2,0x5a4b4));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x439f95){const _0x3b1457=a39_0x2e5b;if(_0x439f95[_0x3b1457(0x179)]===0x0){console['log'](_0x3b1457(0x171));return;}console['log']('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x439f95[_0x3b1457(0x181)]((_0x5a5d5e,_0x2d1ee3)=>{const _0x4a209e=_0x3b1457,_0x135a9a=new Date(_0x5a5d5e[_0x4a209e(0x182)])[_0x4a209e(0x183)](_0x4a209e(0x16c)),_0x4c8e06=_0x5a5d5e[_0x4a209e(0x17d)]==='success'?'√':_0x5a5d5e[_0x4a209e(0x17d)]===_0x4a209e(0x16a)?'×':_0x5a5d5e[_0x4a209e(0x17d)]===_0x4a209e(0x168)?'!':'i';console[_0x4a209e(0x17f)](_0x2d1ee3+0x1+'.\x20'+_0x4c8e06+'\x20['+_0x5a5d5e[_0x4a209e(0x16d)]+']\x20'+_0x5a5d5e['message']),console['log'](_0x4a209e(0x16f)+_0x135a9a),_0x5a5d5e['duration']&&console['log'](_0x4a209e(0x17c)+_0x5a5d5e[_0x4a209e(0x184)]+'ms'),_0x5a5d5e['details']&&Object[_0x4a209e(0x16b)](_0x5a5d5e[_0x4a209e(0x169)])[_0x4a209e(0x179)]>0x0&&console[_0x4a209e(0x17f)]('\x20\x20\x20Details:\x20'+JSON['stringify'](_0x5a5d5e[_0x4a209e(0x169)],null,0x2)),console[_0x4a209e(0x17f)]('');});}export const logsDefinitions=[{'service':'logs','command':'show','description':a39_0x27942b(0x16e),'risk':a39_0x27942b(0x170),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x598527){const _0x5c936a=a39_0x27942b;return printLogs(logger[_0x5c936a(0x17a)]()),{'ok':!![]};}}];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ValidateFunction } from 'ajv';
|
|
2
|
+
export declare function parseMetricJson(text: string): unknown;
|
|
3
|
+
export declare function compileMetricContract(value: unknown): {
|
|
4
|
+
input: import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
5
|
+
output: import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
6
|
+
};
|
|
7
|
+
export declare function assertMetricInput(validate: ValidateFunction, value: unknown): asserts value is Record<string, unknown>;
|
|
8
|
+
export declare function assertMetricOutput(validate: ValidateFunction, value: unknown): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a40_0xf180(){const _0xd1c7e4=['object','Metric\x20inputSchema\x20must\x20declare\x20type:\x20object.','type','push','entries','Metric\x20contract\x20requires\x20inputSchema\x20and\x20outputSchema,\x20with\x20optional\x20examples\x20only.','apiError','isSafeInteger','Metric\x20JSON\x20must\x20not\x20contain\x20duplicate\x20object\x20keys.','validation','outputSchema','$async','Asynchronous\x20schemas\x20are\x20not\x20supported.','length','examples','input','938204OsVwwx','1180SybafX','\x20requires\x20input\x20and\x20output\x20only.','compile','Metric\x20output:\x20','pop','keyExpected','304568wIcmiO','keys','values','some','10aiJWkI','695792XGIUvl','schema\x20compilation\x20failed','includes','has','message','instancePath','Metric\x20output\x20is\x20missing.','Represent\x20larger\x20integers\x20as\x20decimal\x20strings\x20in\x20the\x20schema,\x20examples\x20and\x20endpoint\x20payloads.','4741VUBafd','number','isInteger','382792efRhHW','add','errors','63hAUGmO','Metric\x20example\x20','parse','isArray','1358TZKFKZ','Metric\x20input\x20must\x20be\x20a\x20JSON\x20object.','inputSchema','default','482331WmGuXf','hasOwn','output','10236bVqZAh'];a40_0xf180=function(){return _0xd1c7e4;};return a40_0xf180();}const a40_0x461bad=a40_0x11b9;(function(_0x42dca7,_0x5afb3c){const _0x155453=a40_0x11b9,_0x22538f=_0x42dca7();while(!![]){try{const _0x238d8d=parseInt(_0x155453(0x1f5))/0x1+-parseInt(_0x155453(0x1ea))/0x2+parseInt(_0x155453(0x1ca))/0x3+-parseInt(_0x155453(0x1de))/0x4*(parseInt(_0x155453(0x1e9))/0x5)+-parseInt(_0x155453(0x1cd))/0x6*(-parseInt(_0x155453(0x1c6))/0x7)+-parseInt(_0x155453(0x1e5))/0x8*(-parseInt(_0x155453(0x1f8))/0x9)+-parseInt(_0x155453(0x1df))/0xa*(parseInt(_0x155453(0x1f2))/0xb);if(_0x238d8d===_0x5afb3c)break;else _0x22538f['push'](_0x22538f['shift']());}catch(_0x54e886){_0x22538f['push'](_0x22538f['shift']());}}}(a40_0xf180,0x42b16));import{Ajv2020}from'ajv/dist/2020.js';import a40_0xaec25c from'ajv-formats';import{CliError,CliErrors}from'../../errors.js';function object(_0x1df3b2){const _0x5cdfd6=a40_0x11b9;return _0x1df3b2!==null&&typeof _0x1df3b2===_0x5cdfd6(0x1ce)&&!Array[_0x5cdfd6(0x1c5)](_0x1df3b2);}function a40_0x11b9(_0x28aafd,_0x5d1c46){_0x28aafd=_0x28aafd-0x1c5;const _0xf18059=a40_0xf180();let _0x11b9a0=_0xf18059[_0x28aafd];return _0x11b9a0;}function assertMetricNumbers(_0x1b5df1,_0x3a8bd8=CliErrors[a40_0x461bad(0x1d7)]){const _0x43b0fb=a40_0x461bad;if(typeof _0x1b5df1===_0x43b0fb(0x1f3)&&(!Number['isFinite'](_0x1b5df1)||Number[_0x43b0fb(0x1f4)](_0x1b5df1)&&!Number[_0x43b0fb(0x1d5)](_0x1b5df1)))throw _0x3a8bd8('Metric\x20JSON\x20numbers\x20must\x20be\x20finite\x20and\x20integers\x20must\x20be\x20within\x20the\x20safe\x20integer\x20range.',_0x43b0fb(0x1f1));if(_0x1b5df1!==null&&typeof _0x1b5df1===_0x43b0fb(0x1ce)){for(const _0x5667f2 of Object[_0x43b0fb(0x1e7)](_0x1b5df1))assertMetricNumbers(_0x5667f2,_0x3a8bd8);}}export function parseMetricJson(_0x3db903){const _0x23ed88=a40_0x461bad;try{const _0x564c41=JSON[_0x23ed88(0x1fa)](_0x3db903);assertMetricNumbers(_0x564c41);const _0x30956b=[];for(const [_0x31c9fd]of _0x3db903['matchAll'](/"(?:\\[\s\S]|[^"\\])*"|[{}\[\],]/g)){const _0x36a994=_0x30956b[_0x30956b[_0x23ed88(0x1db)]-0x1];if(_0x31c9fd==='{')_0x30956b[_0x23ed88(0x1d1)]({'keys':new Set(),'keyExpected':!![]});else{if(_0x31c9fd==='[')_0x30956b['push'](null);else{if(_0x31c9fd==='}'||_0x31c9fd===']')_0x30956b[_0x23ed88(0x1e3)]();else{if(_0x31c9fd===','){if(_0x36a994)_0x36a994[_0x23ed88(0x1e4)]=!![];}else{if(_0x36a994?.[_0x23ed88(0x1e4)]){const _0x54caf1=JSON['parse'](_0x31c9fd);if(_0x36a994[_0x23ed88(0x1e6)][_0x23ed88(0x1ed)](_0x54caf1))throw CliErrors['validation'](_0x23ed88(0x1d6));_0x36a994[_0x23ed88(0x1e6)][_0x23ed88(0x1f6)](_0x54caf1),_0x36a994['keyExpected']=![];}}}}}}return _0x564c41;}catch(_0x8b590){if(_0x8b590 instanceof CliError)throw _0x8b590;throw CliErrors['validation']('Cannot\x20parse\x20a\x20valid\x20metric\x20JSON\x20document.');}}export function compileMetricContract(_0x5981df){const _0x5cabc6=a40_0x461bad;assertMetricNumbers(_0x5981df);if(!object(_0x5981df)||!Object[_0x5cabc6(0x1cb)](_0x5981df,_0x5cabc6(0x1c8))||!Object[_0x5cabc6(0x1cb)](_0x5981df,_0x5cabc6(0x1d8))||Object['keys'](_0x5981df)[_0x5cabc6(0x1e8)](_0x4f8625=>![_0x5cabc6(0x1c8),_0x5cabc6(0x1d8),_0x5cabc6(0x1dc)]['includes'](_0x4f8625)))throw CliErrors[_0x5cabc6(0x1d7)](_0x5cabc6(0x1d3));const _0x41f086=(_0x4ec921,_0x5351bc)=>{const _0x32938d=_0x5cabc6;if(!object(_0x4ec921))throw CliErrors['validation'](_0x5351bc+'\x20must\x20be\x20a\x20JSON\x20Schema\x20object.');try{const _0x304afd=new Ajv2020({'strict':!![],'allErrors':![],'coerceTypes':![],'useDefaults':![],'removeAdditional':![]});a40_0xaec25c[_0x32938d(0x1c9)](_0x304afd);const _0x9476c8=_0x304afd[_0x32938d(0x1e1)](_0x4ec921);if('$async'in _0x9476c8&&_0x9476c8[_0x32938d(0x1d9)])throw new Error(_0x32938d(0x1da));return _0x9476c8;}catch(_0x1cfe04){throw CliErrors[_0x32938d(0x1d7)]('Invalid\x20metric\x20'+_0x5351bc+':\x20'+(_0x1cfe04 instanceof Error?_0x1cfe04[_0x32938d(0x1ee)]:_0x32938d(0x1eb)),'Use\x20synchronous\x20JSON\x20Schema\x202020-12\x20with\x20local\x20fragment\x20references;\x20remote\x20schemas\x20are\x20not\x20loaded.');}};if(!object(_0x5981df[_0x5cabc6(0x1c8)])||_0x5981df[_0x5cabc6(0x1c8)][_0x5cabc6(0x1d0)]!==_0x5cabc6(0x1ce))throw CliErrors['validation'](_0x5cabc6(0x1cf));const _0x5d3925=_0x41f086(_0x5981df[_0x5cabc6(0x1c8)],_0x5cabc6(0x1c8)),_0x32f6bf=_0x41f086(_0x5981df[_0x5cabc6(0x1d8)],'outputSchema');if(_0x5981df[_0x5cabc6(0x1dc)]!==undefined){if(!Array[_0x5cabc6(0x1c5)](_0x5981df[_0x5cabc6(0x1dc)]))throw CliErrors[_0x5cabc6(0x1d7)]('Metric\x20contract\x20examples\x20must\x20be\x20an\x20array.');for(const [_0x4f5f19,_0x4ba0e4]of _0x5981df['examples'][_0x5cabc6(0x1d2)]()){if(!object(_0x4ba0e4)||!Object[_0x5cabc6(0x1cb)](_0x4ba0e4,_0x5cabc6(0x1dd))||!Object['hasOwn'](_0x4ba0e4,'output')||Object['keys'](_0x4ba0e4)[_0x5cabc6(0x1e8)](_0x1dd462=>![_0x5cabc6(0x1dd),_0x5cabc6(0x1cc)][_0x5cabc6(0x1ec)](_0x1dd462)))throw CliErrors[_0x5cabc6(0x1d7)](_0x5cabc6(0x1f9)+_0x4f5f19+_0x5cabc6(0x1e0));assertMetricInput(_0x5d3925,_0x4ba0e4[_0x5cabc6(0x1dd)]);if(!_0x32f6bf(_0x4ba0e4[_0x5cabc6(0x1cc)]))throw CliErrors[_0x5cabc6(0x1d7)](_0x5cabc6(0x1f9)+_0x4f5f19+'\x20output:\x20'+validationMessage(_0x32f6bf));}}return{'input':_0x5d3925,'output':_0x32f6bf};}function validationMessage(_0x186ea9){const _0x21237e=a40_0x461bad,_0x2c2623=_0x186ea9[_0x21237e(0x1f7)]?.[0x0];return _0x2c2623?(_0x2c2623[_0x21237e(0x1ef)]||'/')+'\x20'+_0x2c2623['message']:'does\x20not\x20match\x20its\x20schema';}export function assertMetricInput(_0x34f166,_0xc3d016){const _0x48fb5a=a40_0x461bad;if(!object(_0xc3d016))throw CliErrors[_0x48fb5a(0x1d7)](_0x48fb5a(0x1c7));assertMetricNumbers(_0xc3d016);if(!_0x34f166(_0xc3d016))throw CliErrors['validation']('Metric\x20input:\x20'+validationMessage(_0x34f166));}export function assertMetricOutput(_0x450ea6,_0x51fe8e){const _0x333b0c=a40_0x461bad;if(_0x51fe8e===undefined)throw CliErrors[_0x333b0c(0x1d4)](_0x333b0c(0x1f0));assertMetricNumbers(_0x51fe8e,CliErrors[_0x333b0c(0x1d4)]);if(!_0x450ea6(_0x51fe8e))throw CliErrors['apiError'](_0x333b0c(0x1e2)+validationMessage(_0x450ea6));}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface MetricEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
displayName?: string;
|
|
5
|
+
categoryPath?: string[];
|
|
6
|
+
unit: string;
|
|
7
|
+
contract: unknown;
|
|
8
|
+
target: {
|
|
9
|
+
appCode: string;
|
|
10
|
+
} & ({
|
|
11
|
+
kind: 'sql';
|
|
12
|
+
sqlCode: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'bff';
|
|
15
|
+
functionName: string;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export declare function validateMetricEntry(entry: unknown, path?: string): MetricEntry;
|
|
19
|
+
/** The canonical metric name is the app-config key; never add or strip a prefix. */
|
|
20
|
+
export declare function validateMetricName(name: string): string;
|
|
21
|
+
export declare function validateMetricDefinition(value: unknown, appCode?: string, name?: string): {
|
|
22
|
+
metric: MetricEntry;
|
|
23
|
+
contract: {
|
|
24
|
+
input: import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
25
|
+
output: import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** Assemble only the split storage format; metadata cannot be overridden by value. */
|
|
29
|
+
export declare function readStoredMetric(record: {
|
|
30
|
+
appCode: string;
|
|
31
|
+
key: string;
|
|
32
|
+
tags?: string | null;
|
|
33
|
+
description?: string | null;
|
|
34
|
+
value?: string | null;
|
|
35
|
+
}, appCode: string, name?: string): MetricEntry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a41_0x334e(){const _0x102e23=['apiError','355188YjBZfo','20FjTeqg','categoryPath','820760wGBXLQ','1480178lrxSOM','kind','name','82210HhvuSV','Expected\x20an\x20object.','includes','9XdNPPl','unit','Required\x20field\x20is\x20missing.','.target.sqlCode','METRIC','length','string','Expected\x20a\x20SQL\x20code\x20in\x20xxxxxxxx-xxxxxxxx\x20hexadecimal\x20format.','metric','Metric\x20value\x20must\x20contain\x20only\x20the\x20metric\x20payload,\x20without\x20app-config\x20metadata.','Unknown\x20field.','target','4251itAQuE','validation','.categoryPath[','255943Ckqbnn','sql','.target','key','Invalid\x20metric\x20app-config\x20record.','.target.kind','bff','Expected\x20a\x20category\x20path\x20with\x20one\x20or\x20two\x20levels.','object','test','value','668IPQnpD','entries','24AbFQmK','Expected\x20a\x20non-empty\x20string\x20without\x20leading\x20or\x20trailing\x20whitespace.','.target.','2JrUkUr','Expected\x20sql\x20or\x20bff.','isArray','displayName','.name','trim','.displayName','hasOwn','tags','1240327dqLgrg','description','appCode','regex'];a41_0x334e=function(){return _0x102e23;};return a41_0x334e();}const a41_0x392517=a41_0x53a6;function a41_0x53a6(_0x54b3a4,_0x4ea313){_0x54b3a4=_0x54b3a4-0xe8;const _0x334ec8=a41_0x334e();let _0x53a6cb=_0x334ec8[_0x54b3a4];return _0x53a6cb;}(function(_0x303e1b,_0x2a7bb4){const _0x1d7db1=a41_0x53a6,_0x389f3f=_0x303e1b();while(!![]){try{const _0x2f657b=parseInt(_0x1d7db1(0xea))/0x1*(parseInt(_0x1d7db1(0xfa))/0x2)+-parseInt(_0x1d7db1(0x11e))/0x3*(parseInt(_0x1d7db1(0xf5))/0x4)+-parseInt(_0x1d7db1(0x109))/0x5*(-parseInt(_0x1d7db1(0x108))/0x6)+-parseInt(_0x1d7db1(0x10c))/0x7+-parseInt(_0x1d7db1(0x10b))/0x8+parseInt(_0x1d7db1(0x112))/0x9*(-parseInt(_0x1d7db1(0x10f))/0xa)+parseInt(_0x1d7db1(0x103))/0xb*(parseInt(_0x1d7db1(0xf7))/0xc);if(_0x2f657b===_0x2a7bb4)break;else _0x389f3f['push'](_0x389f3f['shift']());}catch(_0x199eda){_0x389f3f['push'](_0x389f3f['shift']());}}}(a41_0x334e,0x26e6c));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{compileMetricContract,parseMetricJson}from'./contract.js';function invalid(_0x10d7c5,_0x288e5e){const _0x4f714f=a41_0x53a6;throw CliErrors[_0x4f714f(0xe8)](_0x10d7c5+':\x20'+_0x288e5e,'Correct\x20the\x20metric\x20definition\x20before\x20execution.');}function object(_0x6e13a1,_0x3da78e,_0xadb56d,_0x3e152e=[]){const _0x4bbffd=a41_0x53a6;if(!_0x6e13a1||typeof _0x6e13a1!==_0x4bbffd(0xf2)||Array[_0x4bbffd(0xfc)](_0x6e13a1))invalid(_0xadb56d,'Expected\x20an\x20object.');const _0x5ba7b5=_0x6e13a1;for(const _0x45bf9b of _0x3da78e){if(!Object[_0x4bbffd(0x101)](_0x5ba7b5,_0x45bf9b))invalid(_0xadb56d+'.'+_0x45bf9b,_0x4bbffd(0x114));}for(const _0x413c48 of Object['keys'](_0x5ba7b5)){if(!_0x3da78e[_0x4bbffd(0x111)](_0x413c48)&&!_0x3e152e[_0x4bbffd(0x111)](_0x413c48))invalid(_0xadb56d+'.'+_0x413c48,_0x4bbffd(0x11c));}return _0x5ba7b5;}function text(_0x629bd6,_0x452f4f){const _0x5122f8=a41_0x53a6;return(typeof _0x629bd6!=='string'||!_0x629bd6[_0x5122f8(0xff)]()||_0x629bd6!==_0x629bd6[_0x5122f8(0xff)]())&&invalid(_0x452f4f,_0x5122f8(0xf8)),_0x629bd6;}export function validateMetricEntry(_0x2edf38,_0x5c7d5e=a41_0x392517(0x11a)){const _0x2faacf=a41_0x392517,_0x4531af=object(_0x2edf38,[_0x2faacf(0x10e),'description',_0x2faacf(0x113),'target','contract'],_0x5c7d5e,[_0x2faacf(0xfd),_0x2faacf(0x10a)]);if(Object[_0x2faacf(0x101)](_0x4531af,'displayName'))text(_0x4531af['displayName'],_0x5c7d5e+_0x2faacf(0x100));if(Object['hasOwn'](_0x4531af,'categoryPath')){const _0x343705=_0x4531af['categoryPath'];(!Array[_0x2faacf(0xfc)](_0x343705)||_0x343705[_0x2faacf(0x117)]<0x1||_0x343705[_0x2faacf(0x117)]>0x2)&&invalid(_0x5c7d5e+'.categoryPath',_0x2faacf(0xf1));for(const [_0x43bafc,_0x2007d3]of _0x343705[_0x2faacf(0xf6)]())text(_0x2007d3,_0x5c7d5e+_0x2faacf(0xe9)+_0x43bafc+']');}validateMetricName(text(_0x4531af['name'],_0x5c7d5e+_0x2faacf(0xfe)));for(const _0x2eedf2 of[_0x2faacf(0x104),_0x2faacf(0x113)])text(_0x4531af[_0x2eedf2],_0x5c7d5e+'.'+_0x2eedf2);const _0x10c4af=_0x4531af[_0x2faacf(0x11d)];if(!_0x10c4af||typeof _0x10c4af!==_0x2faacf(0xf2)||Array[_0x2faacf(0xfc)](_0x10c4af))invalid(_0x5c7d5e+_0x2faacf(0xec),_0x2faacf(0x110));const _0x13d882=_0x10c4af['kind'];if(_0x13d882!==_0x2faacf(0xeb)&&_0x13d882!==_0x2faacf(0xf0))invalid(_0x5c7d5e+_0x2faacf(0xef),_0x2faacf(0xfb));const _0x3752d2=_0x13d882==='sql'?'sqlCode':'functionName',_0x425b75=object(_0x10c4af,[_0x2faacf(0x10d),_0x2faacf(0x105),_0x3752d2],_0x5c7d5e+_0x2faacf(0xec)),_0x29f2a0=text(_0x425b75[_0x2faacf(0x105)],_0x5c7d5e+'.target.appCode'),_0x2507e0=text(_0x425b75[_0x3752d2],_0x5c7d5e+_0x2faacf(0xf9)+_0x3752d2);return _0x13d882==='sql'&&!SQLCODE_FLAG['pattern'][_0x2faacf(0x106)][_0x2faacf(0xf3)](_0x2507e0)&&invalid(_0x5c7d5e+_0x2faacf(0x115),_0x2faacf(0x119)),_0x4531af;}export function validateMetricName(_0x5d7784){const _0x184e16=a41_0x392517;if(!/^metrics\.[a-z][a-z0-9_-]*$/[_0x184e16(0xf3)](_0x5d7784)||_0x5d7784!==_0x5d7784['trim']()||_0x5d7784['length']>0x100)throw CliErrors['validation']('Metric\x20name\x20must\x20be\x20a\x20metrics.<identifier>\x20key\x20of\x20at\x20most\x20256\x20characters.');return _0x5d7784;}export function validateMetricDefinition(_0x16bd82,_0x4dec41,_0x4cdd29){const _0x23d114=a41_0x392517,_0x8dec94=validateMetricEntry(_0x16bd82);if(_0x4dec41!==undefined&&_0x8dec94['target'][_0x23d114(0x105)]!==_0x4dec41||_0x4cdd29!==undefined&&_0x8dec94[_0x23d114(0x10e)]!==_0x4cdd29)throw CliErrors[_0x23d114(0xe8)]('Metric\x20identity\x20does\x20not\x20match\x20the\x20selected\x20app\x20and\x20name.');const _0x93bb26=compileMetricContract(_0x8dec94['contract']);return{'metric':_0x8dec94,'contract':_0x93bb26};}export function readStoredMetric(_0x52312a,_0x120866,_0x2dd6c4){const _0x2bb0cd=a41_0x392517;if(!_0x52312a||typeof _0x52312a!=='object'||Array[_0x2bb0cd(0xfc)](_0x52312a)||_0x52312a[_0x2bb0cd(0x105)]!==_0x120866||_0x52312a[_0x2bb0cd(0x102)]!==_0x2bb0cd(0x116)||typeof _0x52312a['value']!==_0x2bb0cd(0x118)||typeof _0x52312a[_0x2bb0cd(0xed)]!==_0x2bb0cd(0x118))throw CliErrors[_0x2bb0cd(0x107)](_0x2bb0cd(0xee));const _0x18393a=_0x52312a[_0x2bb0cd(0xed)],_0xd22ffb=parseMetricJson(_0x52312a[_0x2bb0cd(0xf4)]);if(!_0xd22ffb||typeof _0xd22ffb!==_0x2bb0cd(0xf2)||Array[_0x2bb0cd(0xfc)](_0xd22ffb)||['name',_0x2bb0cd(0x104),'tags']['some'](_0x49512d=>Object[_0x2bb0cd(0x101)](_0xd22ffb,_0x49512d)))throw CliErrors[_0x2bb0cd(0x107)](_0x2bb0cd(0x11b));return validateMetricDefinition({..._0xd22ffb,'name':_0x18393a,'description':_0x52312a[_0x2bb0cd(0x104)]},_0x120866,_0x2dd6c4)['metric'];}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a42_0x5883(){const _0x4e88ab=['6lAlPve','3621567uAoEVZ','1154670mucpzA','143bvUOFH','read','30PjJgPH','603236rSLEJN','4185632UDXCtJ','str','2291590dfxPpG','name','appCode','7321167DEPGjL','Read\x20and\x20validate\x20one\x20application\x20metric\x20definition\x20without\x20executing\x20it','3VUpTSy','detail','868862xypYpD'];a42_0x5883=function(){return _0x4e88ab;};return a42_0x5883();}const a42_0x4332c1=a42_0x405a;(function(_0x3a8db1,_0x841ab2){const _0x516b5e=a42_0x405a,_0x37469d=_0x3a8db1();while(!![]){try{const _0x576120=parseInt(_0x516b5e(0xbe))/0x1*(parseInt(_0x516b5e(0xc0))/0x2)+-parseInt(_0x516b5e(0xc2))/0x3+-parseInt(_0x516b5e(0xb6))/0x4*(parseInt(_0x516b5e(0xb5))/0x5)+-parseInt(_0x516b5e(0xc1))/0x6*(parseInt(_0x516b5e(0xb9))/0x7)+-parseInt(_0x516b5e(0xb7))/0x8+parseInt(_0x516b5e(0xbc))/0x9+-parseInt(_0x516b5e(0xc3))/0xa*(-parseInt(_0x516b5e(0xc4))/0xb);if(_0x576120===_0x841ab2)break;else _0x37469d['push'](_0x37469d['shift']());}catch(_0x6ff65b){_0x37469d['push'](_0x37469d['shift']());}}}(a42_0x5883,0x9ff6a));import{loadApplicationMetric,METRIC_NAME_FLAG}from'./shared.js';function a42_0x405a(_0x570dfc,_0x230b96){_0x570dfc=_0x570dfc-0xb5;const _0x588330=a42_0x5883();let _0x405a2e=_0x588330[_0x570dfc];return _0x405a2e;}export const metricDetail={'service':'metric','command':a42_0x4332c1(0xbf),'risk':a42_0x4332c1(0xc5),'description':a42_0x4332c1(0xbd),'flags':[METRIC_NAME_FLAG],async 'execute'(_0x305c2b){const _0x11bc7f=a42_0x4332c1,{metric:_0x4e61b4}=await loadApplicationMetric(_0x305c2b[_0x11bc7f(0xbb)],_0x305c2b[_0x11bc7f(0xb8)](_0x11bc7f(0xba)));return{'ok':!![],'data':_0x4e61b4};}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a43_0x1f328f=a43_0x32a1;(function(_0x6ab1dc,_0x495d11){const _0x569276=a43_0x32a1,_0x163d24=_0x6ab1dc();while(!![]){try{const _0x1d846b=parseInt(_0x569276(0x1e9))/0x1*(parseInt(_0x569276(0x1ee))/0x2)+-parseInt(_0x569276(0x1f4))/0x3+parseInt(_0x569276(0x1e1))/0x4*(parseInt(_0x569276(0x1f3))/0x5)+-parseInt(_0x569276(0x1e3))/0x6+-parseInt(_0x569276(0x1e4))/0x7*(parseInt(_0x569276(0x1f0))/0x8)+-parseInt(_0x569276(0x1eb))/0x9+parseInt(_0x569276(0x1fe))/0xa*(parseInt(_0x569276(0x1ea))/0xb);if(_0x1d846b===_0x495d11)break;else _0x163d24['push'](_0x163d24['shift']());}catch(_0x2d48f3){_0x163d24['push'](_0x163d24['shift']());}}}(a43_0x2f82,0x8843f));import{executeSdkSql,executeSdkBff}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';function a43_0x2f82(){const _0x35cb94=['params','validation','exec','99083eMRokQ','30261MqbPxF','79911mIKGRC','Inputs\x20validated\x20against\x20the\x20current\x20definition.\x20No\x20SQL/BFF\x20was\x20executed;\x20output\x20and\x20execution\x20access\x20remain\x20unverified.','values','2eEehCD','str','8fhiUFO','execResult','execSuccess','11755uxuQAE','3095328MtzXUt','Execute\x20an\x20application\x20metric\x20with\x20input\x20and\x20output\x20JSON\x20Schema\x20validation','input','sql','apiError','kind','number','SQL\x20metric\x20parameters\x20must\x20be\x20strings\x20or\x20finite\x20numbers.','some','isFinite','9090jqLhWn','read','name','JSON\x20input\x20object\x20matching\x20the\x20metric\x20contract','target','metric','string','/client/sql/execute','sqlCode','1068FzWhfi','output','5852538HvBzLX','4572666TpTlmS','appCode'];a43_0x2f82=function(){return _0x35cb94;};return a43_0x2f82();}import{assertMetricInput,assertMetricOutput,parseMetricJson}from'./contract.js';import{loadApplicationMetric,metricFailure,METRIC_NAME_FLAG}from'./shared.js';function a43_0x32a1(_0x435431,_0x59d777){_0x435431=_0x435431-0x1da;const _0x2f82a8=a43_0x2f82();let _0x32a117=_0x2f82a8[_0x435431];return _0x32a117;}async function prepare(_0x3f8fac){const _0x45c5b0=a43_0x32a1,{metric:_0x5cb28c,contract:_0x4060c8}=await loadApplicationMetric(_0x3f8fac[_0x45c5b0(0x1e5)],_0x3f8fac[_0x45c5b0(0x1ef)](_0x45c5b0(0x1da)));try{const _0x45c80f=parseMetricJson(_0x3f8fac['str'](_0x45c5b0(0x1e6)));assertMetricInput(_0x4060c8[_0x45c5b0(0x1f6)],_0x45c80f);if(_0x5cb28c[_0x45c5b0(0x1dc)][_0x45c5b0(0x1f9)]===_0x45c5b0(0x1f7)){if(Object[_0x45c5b0(0x1ed)](_0x45c80f)[_0x45c5b0(0x1fc)](_0x44050f=>typeof _0x44050f!==_0x45c5b0(0x1de)&&(typeof _0x44050f!==_0x45c5b0(0x1fa)||!Number[_0x45c5b0(0x1fd)](_0x44050f))))throw CliErrors[_0x45c5b0(0x1e7)](_0x45c5b0(0x1fb));}return{'metric':_0x5cb28c,'contract':_0x4060c8,'params':_0x45c80f};}catch(_0x4a427d){throw metricFailure(_0x4a427d,_0x3f8fac['appCode'],_0x5cb28c[_0x45c5b0(0x1da)],'input-validation');}}export const metricExec={'service':a43_0x1f328f(0x1dd),'command':a43_0x1f328f(0x1e8),'risk':a43_0x1f328f(0x1ff),'description':a43_0x1f328f(0x1f5),'flags':[METRIC_NAME_FLAG,{'name':a43_0x1f328f(0x1e6),'type':'string','required':!![],'description':a43_0x1f328f(0x1db)}],async 'dryRun'(_0x21d74d){const _0x4eef51=a43_0x1f328f,{metric:_0x5546c6}=await prepare(_0x21d74d);return{'method':'POST','url':_0x5546c6[_0x4eef51(0x1dc)]['kind']===_0x4eef51(0x1f7)?_0x4eef51(0x1df):'/client/bff/excute/'+encodeURIComponent(_0x21d74d[_0x4eef51(0x1e5)])+'/'+encodeURIComponent(_0x5546c6[_0x4eef51(0x1dc)]['functionName']),'data':{'name':_0x5546c6[_0x4eef51(0x1da)],'appCode':_0x21d74d[_0x4eef51(0x1e5)],'target':_0x5546c6['target'],'inputValidated':!![],'executionVerified':![]},'description':_0x4eef51(0x1ec)};},async 'execute'(_0x21a630){const _0x5a1df6=a43_0x1f328f,{metric:_0x31d02f,contract:_0x56c97d,params:_0x2611eb}=await prepare(_0x21a630);let _0x11fa89;try{if(_0x31d02f[_0x5a1df6(0x1dc)][_0x5a1df6(0x1f9)]===_0x5a1df6(0x1f7)){const _0x232e01=await executeSdkSql(_0x31d02f[_0x5a1df6(0x1dc)][_0x5a1df6(0x1e0)],_0x2611eb);if(!_0x232e01||typeof _0x232e01!=='object'||Array['isArray'](_0x232e01)||_0x232e01[_0x5a1df6(0x1f2)]!==!![])throw CliErrors[_0x5a1df6(0x1f8)]('Metric\x20SQL\x20execution\x20failed\x20or\x20returned\x20an\x20invalid\x20execution\x20status.');if(!Array['isArray'](_0x232e01['execResult']))throw CliErrors[_0x5a1df6(0x1f8)]('Metric\x20SQL\x20execution\x20did\x20not\x20return\x20a\x20result\x20array.');_0x11fa89=_0x232e01[_0x5a1df6(0x1f1)];}else _0x11fa89=await executeSdkBff(_0x31d02f['target']['functionName'],_0x2611eb);}catch(_0x9338a4){throw metricFailure(_0x9338a4,_0x21a630[_0x5a1df6(0x1e5)],_0x31d02f[_0x5a1df6(0x1da)],'execution');}try{assertMetricOutput(_0x56c97d[_0x5a1df6(0x1e2)],_0x11fa89);}catch(_0x4d9e75){throw metricFailure(_0x4d9e75,_0x21a630[_0x5a1df6(0x1e5)],_0x31d02f[_0x5a1df6(0x1da)],'output-validation');}return{'ok':!![],'data':{'name':_0x31d02f['name'],'appCode':_0x21a630['appCode'],'result':_0x11fa89,'validated':!![]}};}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const metricDefinitions: import("../../framework/types.js").CommandDefinition[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a44_0x5167(_0x5076d0,_0x337905){_0x5076d0=_0x5076d0-0xf7;const _0x192a7a=a44_0x192a();let _0x51672a=_0x192a7a[_0x5076d0];return _0x51672a;}(function(_0x1bc3e0,_0x4723bf){const _0x248d1e=a44_0x5167,_0x2f6653=_0x1bc3e0();while(!![]){try{const _0x50494b=parseInt(_0x248d1e(0xfd))/0x1+-parseInt(_0x248d1e(0xfe))/0x2+-parseInt(_0x248d1e(0xfc))/0x3+-parseInt(_0x248d1e(0x100))/0x4*(-parseInt(_0x248d1e(0xf9))/0x5)+-parseInt(_0x248d1e(0x101))/0x6*(parseInt(_0x248d1e(0xf8))/0x7)+-parseInt(_0x248d1e(0xff))/0x8*(parseInt(_0x248d1e(0xfb))/0x9)+parseInt(_0x248d1e(0xf7))/0xa*(parseInt(_0x248d1e(0xfa))/0xb);if(_0x50494b===_0x4723bf)break;else _0x2f6653['push'](_0x2f6653['shift']());}catch(_0x5c3e05){_0x2f6653['push'](_0x2f6653['shift']());}}}(a44_0x192a,0x3eef2));import{metricExec}from'./exec.js';function a44_0x192a(){const _0xe73571=['1452366WPqczB','75306gNlqvg','476054fKZtxy','74078vTXoOz','16nAufwE','4qaIDiK','3055746tqQbrt','190XbJOsI','7GZsJJU','1387655OiqZqL','230637pXnFkJ'];a44_0x192a=function(){return _0xe73571;};return a44_0x192a();}import{metricDetail}from'./detail.js';import{metricList}from'./list.js';export const metricDefinitions=[metricList,metricDetail,metricExec];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a45_0x11fbe3=a45_0x5287;function a45_0x5287(_0x338c45,_0x1ce432){_0x338c45=_0x338c45-0x155;const _0x329b8e=a45_0x329b();let _0x5287b0=_0x329b8e[_0x338c45];return _0x5287b0;}(function(_0x35430b,_0x4c458a){const _0x576eda=a45_0x5287,_0x62ce23=_0x35430b();while(!![]){try{const _0x341de3=-parseInt(_0x576eda(0x157))/0x1*(-parseInt(_0x576eda(0x171))/0x2)+-parseInt(_0x576eda(0x163))/0x3+parseInt(_0x576eda(0x167))/0x4*(parseInt(_0x576eda(0x158))/0x5)+-parseInt(_0x576eda(0x170))/0x6+-parseInt(_0x576eda(0x16a))/0x7*(parseInt(_0x576eda(0x16d))/0x8)+parseInt(_0x576eda(0x162))/0x9+-parseInt(_0x576eda(0x15a))/0xa*(-parseInt(_0x576eda(0x156))/0xb);if(_0x341de3===_0x4c458a)break;else _0x62ce23['push'](_0x62ce23['shift']());}catch(_0x1668fe){_0x62ce23['push'](_0x62ce23['shift']());}}}(a45_0x329b,0x40ec9));function a45_0x329b(){const _0x4f7179=['map','message','List\x20application\x20metric\x20summaries,\x20optionally\x20filtering\x20keys\x20or\x20descriptions\x20by\x20keyword','has','string','code','read','4171140PWRJhl','1190799RuBvEX','add','trim','appCode','752300kbLLVn','metric','Case-insensitive\x20literal\x20substring\x20of\x20the\x20config\x20key\x20or\x20description','14jqEVnc','name','exitCode','422216IvDQHd','list','length','2540040TdXYdo','2AFKkdM','sort','2722049lazFMB','292762IRfQAm','5ZmVClE','key','10dLRjdM'];a45_0x329b=function(){return _0x4f7179;};return a45_0x329b();}import{listRuntimeMetricConfigs}from'../../core/api-client.js';import{CliError,CliErrors}from'../../errors.js';import{readStoredMetric}from'./definition.js';export const metricList={'service':a45_0x11fbe3(0x168),'command':a45_0x11fbe3(0x16e),'risk':a45_0x11fbe3(0x161),'description':a45_0x11fbe3(0x15d),'flags':[{'name':a45_0x11fbe3(0x159),'type':a45_0x11fbe3(0x15f),'description':a45_0x11fbe3(0x169)}],async 'execute'(_0x557340){const _0x510d39=a45_0x11fbe3,_0x1d237d=_0x557340['str'](_0x510d39(0x159))[_0x510d39(0x165)](),_0x57978b=await listRuntimeMetricConfigs(_0x557340['appCode'],_0x1d237d||undefined),_0x2f0d25=new Set(),_0x1b8727=_0x57978b[_0x510d39(0x15b)](_0x235294=>{const _0x401b63=_0x510d39;try{const _0xe4e99f=readStoredMetric(_0x235294,_0x557340[_0x401b63(0x166)]);if(_0x2f0d25[_0x401b63(0x15e)](_0xe4e99f[_0x401b63(0x16b)]))throw CliErrors['validation']('Metric\x20identity\x20is\x20mismatched\x20or\x20duplicated.');_0x2f0d25[_0x401b63(0x164)](_0xe4e99f[_0x401b63(0x16b)]);const {name:_0x2818b4,description:_0x297bc1,displayName:_0x5afa1c,categoryPath:_0x198a47,unit:_0x1f6a60}=_0xe4e99f;return{'name':_0x2818b4,'description':_0x297bc1,..._0x5afa1c===undefined?{}:{'displayName':_0x5afa1c},..._0x198a47===undefined?{}:{'categoryPath':_0x198a47},'unit':_0x1f6a60};}catch(_0x9bb0ad){if(_0x9bb0ad instanceof CliError)throw new CliError(_0x9bb0ad[_0x401b63(0x160)],_0x9bb0ad[_0x401b63(0x16c)],'Invalid\x20metric\x20definition:\x20'+(_0x235294?.['key']??'(unknown)'),_0x9bb0ad[_0x401b63(0x15c)]);throw _0x9bb0ad;}}),_0x4a419e=_0x1b8727[_0x510d39(0x155)]((_0x32beaf,_0x25e674)=>_0x32beaf['name']<_0x25e674[_0x510d39(0x16b)]?-0x1:_0x32beaf[_0x510d39(0x16b)]>_0x25e674[_0x510d39(0x16b)]?0x1:0x0);return{'ok':!![],'data':{'appCode':_0x557340['appCode'],'count':_0x4a419e[_0x510d39(0x16f)],'metrics':_0x4a419e}};}};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type MetricStage = 'definition-read' | 'definition-validation' | 'input-validation' | 'execution' | 'output-validation';
|
|
2
|
+
/** Reuse the runner's error classification; add context, never request/result values. */
|
|
3
|
+
export declare function metricFailure(error: unknown, appCode: string, name: string, stage: MetricStage): unknown;
|
|
4
|
+
export declare const METRIC_NAME_FLAG: {
|
|
5
|
+
readonly name: "name";
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
readonly required: true;
|
|
8
|
+
readonly description: "Exact full metric name (e.g. metrics.paid_order_count); use name, not displayName";
|
|
9
|
+
};
|
|
10
|
+
export declare function loadApplicationMetric(appCode: string, name: string): Promise<{
|
|
11
|
+
metric: import("./definition.js").MetricEntry;
|
|
12
|
+
contract: {
|
|
13
|
+
input: import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
14
|
+
output: import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a46_0x5667a2=a46_0x10c1;function a46_0x132e(){const _0x3fa07c=['Exact\x20full\x20metric\x20name\x20(e.g.\x20metrics.paid_order_count);\x20use\x20name,\x20not\x20displayName','1166981EqNXIs','exitCode','765HGQIgs','getOwnPropertyDescriptors','7uDXhRD','join','code','7999536NapjTI','name','message','1068654QoxANN','5980644iZHcnR','definition-validation','hint','3298448qJdRiT','2164425unJgFh','filter','stringify','string',';\x20name:\x20',';\x20app:\x20','5308ynMSnD','metricDefinition','Metric\x20stage:\x20','object'];a46_0x132e=function(){return _0x3fa07c;};return a46_0x132e();}function a46_0x10c1(_0x18a9f8,_0x24c908){_0x18a9f8=_0x18a9f8-0x173;const _0x132e49=a46_0x132e();let _0x10c1ad=_0x132e49[_0x18a9f8];return _0x10c1ad;}(function(_0x15fbd8,_0x36df68){const _0x3ea1d2=a46_0x10c1,_0x6306e2=_0x15fbd8();while(!![]){try{const _0x4884db=parseInt(_0x3ea1d2(0x17a))/0x1+parseInt(_0x3ea1d2(0x175))/0x2*(parseInt(_0x3ea1d2(0x17c))/0x3)+parseInt(_0x3ea1d2(0x188))/0x4+-parseInt(_0x3ea1d2(0x189))/0x5+parseInt(_0x3ea1d2(0x184))/0x6*(parseInt(_0x3ea1d2(0x17e))/0x7)+-parseInt(_0x3ea1d2(0x181))/0x8+-parseInt(_0x3ea1d2(0x185))/0x9;if(_0x4884db===_0x36df68)break;else _0x6306e2['push'](_0x6306e2['shift']());}catch(_0x56b4f5){_0x6306e2['push'](_0x6306e2['shift']());}}}(a46_0x132e,0xb6e49));import{getRuntimeMetricDetail}from'../../core/api-client.js';import{validateMetricName,validateMetricDefinition}from'./definition.js';import{CliError}from'../../errors.js';import{mapUserFacingExecuteError}from'../../framework/runner-error.js';export function metricFailure(_0x1ada80,_0x1cd213,_0x3b5b04,_0x2191e6){const _0x59d97c=a46_0x10c1,_0x122b5b=mapUserFacingExecuteError(_0x1ada80);if(!(_0x122b5b instanceof CliError))return _0x122b5b;const _0x5e9beb=_0x59d97c(0x177)+_0x2191e6+_0x59d97c(0x174)+JSON[_0x59d97c(0x18b)](_0x1cd213)+_0x59d97c(0x173)+JSON[_0x59d97c(0x18b)](_0x3b5b04)+'.',_0x4b3618=Object[_0x59d97c(0x17d)](_0x122b5b);return Object['defineProperties'](new CliError(_0x122b5b[_0x59d97c(0x180)],_0x122b5b[_0x59d97c(0x17b)],_0x122b5b[_0x59d97c(0x183)]),{..._0x4b3618,'hint':{..._0x4b3618[_0x59d97c(0x187)],'value':[_0x5e9beb,_0x122b5b[_0x59d97c(0x187)]][_0x59d97c(0x18a)](Boolean)[_0x59d97c(0x17f)]('\x20')}});}export const METRIC_NAME_FLAG={'name':a46_0x5667a2(0x182),'type':a46_0x5667a2(0x18c),'required':!![],'description':a46_0x5667a2(0x179)};export async function loadApplicationMetric(_0x1a42a4,_0x377a8c){const _0x4ed25a=a46_0x5667a2;validateMetricName(_0x377a8c);let _0x5839c5;try{_0x5839c5=await getRuntimeMetricDetail(_0x1a42a4,_0x377a8c);}catch(_0x3cfbb0){throw metricFailure(_0x3cfbb0,_0x1a42a4,_0x377a8c,'definition-read');}try{const _0x41edee=_0x5839c5&&typeof _0x5839c5===_0x4ed25a(0x178)&&_0x4ed25a(0x176)in _0x5839c5?_0x5839c5[_0x4ed25a(0x176)]:undefined;return validateMetricDefinition(_0x41edee,_0x1a42a4,_0x377a8c);}catch(_0xacbce){throw metricFailure(_0xacbce,_0x1a42a4,_0x377a8c,_0x4ed25a(0x186));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a47_0x2f69(){const _0x1f4a60=['4246302csdkoG','12SgvIyd','notification','EMAIL','string','read','5NzYqqB','1XlyWOc','1256590DoOZbV','appCode','11Qmjwgr','1781462eLroTJ','config-list','1016kKlqbJ','\x20notification\x20config(s)','map','144UBJrsj','Found\x20','59444uOGuAr','29589820TOCjmZ','7664409udJkkk','length','90366KfnHaT','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','type'];a47_0x2f69=function(){return _0x1f4a60;};return a47_0x2f69();}const a47_0x2a5f65=a47_0x1dc7;(function(_0x3c7511,_0x4d54ba){const _0x433a26=a47_0x1dc7,_0xd41d16=_0x3c7511();while(!![]){try{const _0x28ad0c=parseInt(_0x433a26(0x1e4))/0x1*(-parseInt(_0x433a26(0x1e8))/0x2)+parseInt(_0x433a26(0x1da))/0x3*(parseInt(_0x433a26(0x1d4))/0x4)+-parseInt(_0x433a26(0x1e3))/0x5*(-parseInt(_0x433a26(0x1dd))/0x6)+parseInt(_0x433a26(0x1d6))/0x7*(parseInt(_0x433a26(0x1d1))/0x8)+parseInt(_0x433a26(0x1d8))/0x9+parseInt(_0x433a26(0x1e5))/0xa*(parseInt(_0x433a26(0x1e7))/0xb)+parseInt(_0x433a26(0x1de))/0xc*(-parseInt(_0x433a26(0x1d7))/0xd);if(_0x28ad0c===_0x4d54ba)break;else _0xd41d16['push'](_0xd41d16['shift']());}catch(_0x210160){_0xd41d16['push'](_0xd41d16['shift']());}}}(a47_0x2f69,0xa6416));function a47_0x1dc7(_0x1bc8c8,_0x5dade2){_0x1bc8c8=_0x1bc8c8-0x1d1;const _0x2f6943=a47_0x2f69();let _0x1dc7c4=_0x2f6943[_0x1bc8c8];return _0x1dc7c4;}import{listNotificationChannelConfigs}from'../../core/api-client.js';import{NOTIFICATION_CHANNEL_TYPES,projectNotificationListConfig,readNotificationChannelType}from'../../commands/notification/shared.js';export const notificationConfigList={'service':a47_0x2a5f65(0x1df),'command':a47_0x2a5f65(0x1e9),'description':a47_0x2a5f65(0x1db),'risk':a47_0x2a5f65(0x1e2),'flags':[{'name':a47_0x2a5f65(0x1dc),'type':a47_0x2a5f65(0x1e1),'description':'Notification\x20channel\x20type','enum':NOTIFICATION_CHANNEL_TYPES,'default':a47_0x2a5f65(0x1e0)}],async 'validate'(_0x1dd8a1){readNotificationChannelType(_0x1dd8a1);},async 'execute'(_0x2c853e){const _0x54ebc2=a47_0x2a5f65,_0x2dc83c=readNotificationChannelType(_0x2c853e),_0x1f92c7=await listNotificationChannelConfigs(_0x2c853e[_0x54ebc2(0x1e6)],_0x2dc83c),_0x40652d=_0x1f92c7[_0x54ebc2(0x1d3)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x2c853e[_0x54ebc2(0x1e6)],'channelType':_0x2dc83c,'count':_0x40652d[_0x54ebc2(0x1d9)],'configs':_0x40652d},'message':_0x54ebc2(0x1d5)+_0x40652d[_0x54ebc2(0x1d9)]+'\x20'+_0x2dc83c+_0x54ebc2(0x1d2)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2e2c1b,_0x5464f8){const _0x58e75e=a48_0x4d21,_0x1a5b00=_0x2e2c1b();while(!![]){try{const _0x48ce3e=-parseInt(_0x58e75e(0xd1))/0x1+-parseInt(_0x58e75e(0xcc))/0x2*(-parseInt(_0x58e75e(0xc6))/0x3)+-parseInt(_0x58e75e(0xc8))/0x4+-parseInt(_0x58e75e(0xce))/0x5*(-parseInt(_0x58e75e(0xd0))/0x6)+-parseInt(_0x58e75e(0xcd))/0x7*(-parseInt(_0x58e75e(0xc7))/0x8)+-parseInt(_0x58e75e(0xc9))/0x9*(-parseInt(_0x58e75e(0xcf))/0xa)+parseInt(_0x58e75e(0xcb))/0xb*(parseInt(_0x58e75e(0xca))/0xc);if(_0x48ce3e===_0x5464f8)break;else _0x1a5b00['push'](_0x1a5b00['shift']());}catch(_0x4310af){_0x1a5b00['push'](_0x1a5b00['shift']());}}}(a48_0x58ce,0xb9942));import{notificationConfigList}from'../../commands/notification/config-list.js';function a48_0x4d21(_0x1f4039,_0x1acfc3){_0x1f4039=_0x1f4039-0xc6;const _0x58cedf=a48_0x58ce();let _0x4d217a=_0x58cedf[_0x1f4039];return _0x4d217a;}export const notificationDefinitions=[notificationConfigList];function a48_0x58ce(){const _0x3516c2=['670eRzHph','6GADtfm','730660TYZtoI','1900569NlPvxl','664136TemeKo','6074872IByqjB','48951rJNuxv','4650480lwSQuK','11oSofcX','4CrTYoX','70wndPIz','801695xKgNwD'];a48_0x58ce=function(){return _0x3516c2;};return a48_0x58ce();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x12061d=a49_0x2786;(function(_0x22055f,_0x230225){const _0x2d523f=a49_0x2786,_0x3023a7=_0x22055f();while(!![]){try{const _0x2ec05b=parseInt(_0x2d523f(0x1e9))/0x1+parseInt(_0x2d523f(0x1f3))/0x2+parseInt(_0x2d523f(0x1f2))/0x3*(-parseInt(_0x2d523f(0x1e3))/0x4)+parseInt(_0x2d523f(0x1e6))/0x5+-parseInt(_0x2d523f(0x1e7))/0x6+parseInt(_0x2d523f(0x1e4))/0x7+parseInt(_0x2d523f(0x1e0))/0x8*(-parseInt(_0x2d523f(0x1f0))/0x9);if(_0x2ec05b===_0x230225)break;else _0x3023a7['push'](_0x3023a7['shift']());}catch(_0x571199){_0x3023a7['push'](_0x3023a7['shift']());}}}(a49_0x2f1c,0xc5068));import{CliErrors}from'../../errors.js';export const NOTIFICATION_CHANNEL_TYPES=[a49_0x12061d(0x1e1),'FEISHU',a49_0x12061d(0x1f7),'WECOM',a49_0x12061d(0x1ef)];export function readNotificationChannelType(_0x1a0877){const _0x4eea40=a49_0x12061d,_0x5c0d33=_0x1a0877[_0x4eea40(0x1f6)]('type')[_0x4eea40(0x1eb)]()||_0x4eea40(0x1e1);if(!NOTIFICATION_CHANNEL_TYPES['includes'](_0x5c0d33))throw CliErrors[_0x4eea40(0x1e8)](_0x4eea40(0x1ea)+_0x5c0d33,_0x4eea40(0x1ee)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');return _0x5c0d33;}export function projectNotificationListConfig(_0x19fbd3,_0x3257a6){const _0x242765=a49_0x12061d,_0x54f414=requireResponseObject(_0x19fbd3,_0x3257a6);return{'configCode':requireResponseString(_0x54f414[_0x242765(0x1ed)],_0x242765(0x1ed),_0x3257a6),'configName':requireResponseString(_0x54f414['configName'],_0x242765(0x1ec),_0x3257a6),'channelType':requireResponseString(_0x54f414[_0x242765(0x1f4)],_0x242765(0x1f4),_0x3257a6),'description':normalizeNullableString(_0x54f414[_0x242765(0x1f1)])};}function a49_0x2f1c(){const _0x6892c6=['24KhWEEN','EMAIL','\x20must\x20be\x20an\x20object.','76whKglk','1681792iPqjTL','\x20is\x20missing\x20required\x20field\x20\x22','4944925Pjvpui','7043916sXfmTw','validation','1303596mqGxJZ','Invalid\x20--type:\x20','trim','configName','configCode','Allowed\x20values:\x20','WEBHOOK','212886EOupEa','description','252552mXCeBE','2237246tkaCyx','channelType','Invalid\x20notification\x20config\x20response.','str','DINGTALK','apiError','Item\x20'];a49_0x2f1c=function(){return _0x6892c6;};return a49_0x2f1c();}function a49_0x2786(_0x141e74,_0x14d68a){_0x141e74=_0x141e74-0x1de;const _0x2f1c1f=a49_0x2f1c();let _0x2786d3=_0x2f1c1f[_0x141e74];return _0x2786d3;}function requireResponseObject(_0x1e18f5,_0x232e1d){const _0x4b3075=a49_0x12061d;if(typeof _0x1e18f5!=='object'||_0x1e18f5===null||Array['isArray'](_0x1e18f5))throw CliErrors[_0x4b3075(0x1de)]('Invalid\x20notification\x20config\x20response.',_0x4b3075(0x1df)+(_0x232e1d+0x1)+_0x4b3075(0x1e2));return _0x1e18f5;}function requireResponseString(_0x123636,_0x5c8f70,_0x27acd3){const _0x32ad11=a49_0x12061d;if(typeof _0x123636!=='string'||!_0x123636[_0x32ad11(0x1eb)]())throw CliErrors[_0x32ad11(0x1de)](_0x32ad11(0x1f5),_0x32ad11(0x1df)+(_0x27acd3+0x1)+_0x32ad11(0x1e5)+_0x5c8f70+'\x22.');return _0x123636[_0x32ad11(0x1eb)]();}function normalizeNullableString(_0x262385){const _0xeea21e=a49_0x12061d;return typeof _0x262385==='string'&&_0x262385[_0xeea21e(0x1eb)]()?_0x262385[_0xeea21e(0x1eb)]():null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x5c3d6e=a50_0x3371;(function(_0x35dd30,_0x2b7b7f){const _0x165f60=a50_0x3371,_0x1aec59=_0x35dd30();while(!![]){try{const _0x4a8cab=-parseInt(_0x165f60(0x141))/0x1*(parseInt(_0x165f60(0x15f))/0x2)+parseInt(_0x165f60(0x159))/0x3+-parseInt(_0x165f60(0x143))/0x4*(parseInt(_0x165f60(0x140))/0x5)+-parseInt(_0x165f60(0x137))/0x6+-parseInt(_0x165f60(0x12d))/0x7+parseInt(_0x165f60(0x14f))/0x8+parseInt(_0x165f60(0x153))/0x9;if(_0x4a8cab===_0x2b7b7f)break;else _0x1aec59['push'](_0x1aec59['shift']());}catch(_0x5c408d){_0x1aec59['push'](_0x1aec59['shift']());}}}(a50_0x5d48,0xd0f2a));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a50_0x5c3d6e(0x136),'general',a50_0x5c3d6e(0x132),a50_0x5c3d6e(0x14e)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':a50_0x5c3d6e(0x161),'form':'Table','idCard':a50_0x5c3d6e(0x160)},SCENE_FLAG={'name':'scene','type':a50_0x5c3d6e(0x14b),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a50_0x5c3d6e(0x138)},IMAGE_FILE_FLAG={'name':'image-file','type':a50_0x5c3d6e(0x14b),'description':a50_0x5c3d6e(0x154)},IMAGE_URL_FLAG={'name':'image-url','type':a50_0x5c3d6e(0x14b),'description':a50_0x5c3d6e(0x139)};function normalizeScene(_0x7747ac){const _0x481eed=a50_0x5c3d6e,_0x26ea49=_0x7747ac[_0x481eed(0x135)]()[_0x481eed(0x145)]();if(_0x26ea49===_0x481eed(0x13b))return _0x481eed(0x14e);if(_0x26ea49==='invoice'||_0x26ea49==='general'||_0x26ea49===_0x481eed(0x132))return _0x26ea49;throw CliErrors['validation'](_0x481eed(0x15d)+_0x7747ac+_0x481eed(0x12e)+SUPPORTED_SCENES[_0x481eed(0x144)](',\x20'));}function a50_0x5d48(){const _0x4232e3=['POST','File\x20URL\x20response\x20missing\x20fileUrl.','5217611yyzjXB','.\x20Supported\x20scenes:\x20','build','appCode','scene','form','filePath','/client/queryFileUrl','trim','invoice','1782630YcebdM','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','Publicly\x20accessible\x20image\x20or\x20file\x20URL','Preview:\x20recognize\x20','idcard','imageUrl','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','/client/uploadFile','image-file','1105SSOFyr','818354jByBon','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','24256OadRoQ','join','toLowerCase','body','File\x20upload\x20response\x20missing\x20filePath.','<filePath\x20returned\x20by\x20/client/uploadFile>','apiError','validation','string','recognize','/client/ocr','idCard','7370576LeoUrt','description','\x20OCR','ocr','19603872kXvrmP','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','str','read','path','2871888UDJzTn','length','image-url','count','Unsupported\x20OCR\x20scene:\x20','fileName','2ftcEdu','IdCard','General'];a50_0x5d48=function(){return _0x4232e3;};return a50_0x5d48();}function selectedInputs(_0xb041d6){const _0x475381=a50_0x5c3d6e,_0x5087ea=_0xb041d6[_0x475381(0x156)](_0x475381(0x13f))[_0x475381(0x135)](),_0x5e3540=_0xb041d6[_0x475381(0x156)](_0x475381(0x15b))['trim']();return{'imageFile':_0x5087ea,'imageUrl':_0x5e3540,'count':[_0x5087ea,_0x5e3540]['filter'](Boolean)[_0x475381(0x15a)]};}function validateInputSelection(_0x92a3b5){const _0x34fff6=a50_0x5c3d6e,_0x166971=selectedInputs(_0x92a3b5);if(_0x166971[_0x34fff6(0x15c)]!==0x1)throw CliErrors[_0x34fff6(0x14a)](_0x34fff6(0x155));return _0x166971;}function withScene(_0x3009b3,_0x45ed98,_0x22074f){const _0x59c652=a50_0x5c3d6e;return{..._0x3009b3,'scene':_0x45ed98,..._0x22074f?{'sourceFile':{'fileName':_0x22074f[_0x59c652(0x15e)],'filePath':_0x22074f[_0x59c652(0x133)]}}:{}};}function a50_0x3371(_0x3b04c3,_0x572934){_0x3b04c3=_0x3b04c3-0x12c;const _0x5d48f9=a50_0x5d48();let _0x337185=_0x5d48f9[_0x3b04c3];return _0x337185;}const ocrRecognize={'service':a50_0x5c3d6e(0x152),'command':a50_0x5c3d6e(0x14c),'description':'Extract\x20text\x20and\x20structured\x20fields\x20from\x20voucher-style\x20business\x20documents;\x20not\x20for\x20general\x20image\x20understanding','risk':a50_0x5c3d6e(0x157),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0xe2426c){const _0x2a5d0b=a50_0x5c3d6e,_0x33bcb3=normalizeScene(_0xe2426c['str'](_0x2a5d0b(0x131))),_0x1578a1=SCENE_TO_LEGACY_TYPE[_0x33bcb3],_0x54ab8b=validateInputSelection(_0xe2426c);if(_0x54ab8b[_0x2a5d0b(0x13c)])return dryRun(_0x2a5d0b(0x162),'/client/ocr')[_0x2a5d0b(0x146)]({'appCode':_0xe2426c['appCode'],'url':_0x54ab8b[_0x2a5d0b(0x13c)],'type':_0x1578a1})[_0x2a5d0b(0x150)](_0x2a5d0b(0x13a)+_0x33bcb3+'\x20OCR\x20from\x20URL')[_0x2a5d0b(0x12f)]();const _0x338cc5=requireRuntimeUploadFile(_0x54ab8b['imageFile'],'image-file');return dryRun('POST',_0x2a5d0b(0x13e))[_0x2a5d0b(0x146)]({'steps':[{'method':_0x2a5d0b(0x162),'url':_0x2a5d0b(0x13e),'body':{'appCode':_0xe2426c[_0x2a5d0b(0x130)],'multipart':{'file':_0x338cc5}}},{'method':_0x2a5d0b(0x162),'url':_0x2a5d0b(0x134),'body':{'filePath':_0x2a5d0b(0x148),'downloadFlag':![]}},{'method':'POST','url':_0x2a5d0b(0x14d),'body':{'appCode':_0xe2426c[_0x2a5d0b(0x130)],'url':_0x2a5d0b(0x142),'type':_0x1578a1}}]})['description'](_0x2a5d0b(0x13d)+_0x33bcb3+_0x2a5d0b(0x151))['build']();},async 'execute'(_0x3fd3bc){const _0x13d57e=a50_0x5c3d6e,_0x1b7a30=normalizeScene(_0x3fd3bc['str'](_0x13d57e(0x131))),_0x3499d1=SCENE_TO_LEGACY_TYPE[_0x1b7a30],_0x697d4f=validateInputSelection(_0x3fd3bc);if(_0x697d4f[_0x13d57e(0x13c)]){const _0xb0de8a=await recognizeRuntimeOcr(_0x3fd3bc[_0x13d57e(0x130)],{'url':_0x697d4f[_0x13d57e(0x13c)],'type':_0x3499d1});return{'ok':!![],'data':withScene(_0xb0de8a,_0x1b7a30)};}const _0x14151c=requireRuntimeUploadFile(_0x697d4f['imageFile'],_0x13d57e(0x13f)),_0x514c3d=await uploadRuntimeFile(_0x3fd3bc[_0x13d57e(0x130)],_0x14151c[_0x13d57e(0x158)]);if(!_0x514c3d[_0x13d57e(0x133)])throw CliErrors[_0x13d57e(0x149)](_0x13d57e(0x147));const _0x41bce0=await queryRuntimeFileUrl(_0x514c3d['filePath'],{'download':![]});if(!_0x41bce0['fileUrl'])throw CliErrors[_0x13d57e(0x149)](_0x13d57e(0x12c));const _0xa8cf24=await recognizeRuntimeOcr(_0x3fd3bc[_0x13d57e(0x130)],{'url':_0x41bce0['fileUrl'],'type':_0x3499d1});return{'ok':!![],'data':withScene(_0xa8cf24,_0x1b7a30,_0x514c3d)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a51_0x37bf0f=a51_0x2549;function a51_0x2549(_0x132261,_0x7c7da){_0x132261=_0x132261-0x1b2;const _0x8ce4c8=a51_0x8ce4();let _0x2549d9=_0x8ce4c8[_0x132261];return _0x2549d9;}(function(_0x368ad2,_0x518bbe){const _0x50aa24=a51_0x2549,_0x1f5b26=_0x368ad2();while(!![]){try{const _0x4c71e9=parseInt(_0x50aa24(0x1bf))/0x1*(-parseInt(_0x50aa24(0x1b5))/0x2)+parseInt(_0x50aa24(0x1bc))/0x3*(-parseInt(_0x50aa24(0x1be))/0x4)+parseInt(_0x50aa24(0x1c4))/0x5*(parseInt(_0x50aa24(0x1b9))/0x6)+parseInt(_0x50aa24(0x1b2))/0x7+-parseInt(_0x50aa24(0x1c3))/0x8*(parseInt(_0x50aa24(0x1c1))/0x9)+-parseInt(_0x50aa24(0x1b4))/0xa*(parseInt(_0x50aa24(0x1bb))/0xb)+parseInt(_0x50aa24(0x1b6))/0xc;if(_0x4c71e9===_0x518bbe)break;else _0x1f5b26['push'](_0x1f5b26['shift']());}catch(_0x32a304){_0x1f5b26['push'](_0x1f5b26['shift']());}}}(a51_0x8ce4,0xc9d68));import{listRuntimeDatasetPermits,listRuntimeDatasetRolePermits}from'../../core/api-client.js';function a51_0x8ce4(){const _0x335f2f=['281127ZArVYr','roleType','70VUGqmG','22ZTGkgT','48692820MSblqS','str','runtime','32052NhArWX','read','1251998pGicbS','3ZnfSTJ','roleName','3545204jKLFDX','120936TvcNJT','role','117UnrVok','string','296744nTEkPQ','210YqpOBk','dataset-get','appCode','permit'];a51_0x8ce4=function(){return _0x335f2f;};return a51_0x8ce4();}import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';export const permitDatasetGet={'service':a51_0x37bf0f(0x1c7),'command':a51_0x37bf0f(0x1c5),'description':'Show\x20runtime\x20dataset\x20permissions,\x20optionally\x20evaluated\x20for\x20one\x20role','risk':a51_0x37bf0f(0x1ba),'flags':[{'name':a51_0x37bf0f(0x1c0),'type':a51_0x37bf0f(0x1c2),'description':'Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name'}],async 'execute'(_0x442ffa){const _0x49cbd6=a51_0x37bf0f,_0x324b15=_0x442ffa[_0x49cbd6(0x1b7)](_0x49cbd6(0x1c0))['trim']();if(!_0x324b15)return{'ok':!![],'data':{'scope':_0x49cbd6(0x1b8),'datasets':await listRuntimeDatasetRolePermits(_0x442ffa['appCode'])}};const _0x22525a=await resolveRuntimeRoleRef(_0x442ffa[_0x49cbd6(0x1c6)],_0x324b15);return{'ok':!![],'data':{'scope':_0x49cbd6(0x1b8),'role':{'id':_0x22525a['id'],'roleName':_0x22525a[_0x49cbd6(0x1bd)],'roleType':_0x22525a[_0x49cbd6(0x1b3)]},'datasets':await listRuntimeDatasetPermits(_0x442ffa[_0x49cbd6(0x1c6)],_0x22525a['id'])}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x51fdd4=a52_0x3042;(function(_0x429a1d,_0x2cc26f){const _0x326228=a52_0x3042,_0x4301c5=_0x429a1d();while(!![]){try{const _0xd21689=-parseInt(_0x326228(0xd0))/0x1+-parseInt(_0x326228(0xc4))/0x2+parseInt(_0x326228(0xd6))/0x3*(parseInt(_0x326228(0xe7))/0x4)+parseInt(_0x326228(0xe3))/0x5*(parseInt(_0x326228(0xdd))/0x6)+-parseInt(_0x326228(0xec))/0x7*(-parseInt(_0x326228(0xdb))/0x8)+parseInt(_0x326228(0xcd))/0x9+-parseInt(_0x326228(0xd1))/0xa;if(_0xd21689===_0x2cc26f)break;else _0x4301c5['push'](_0x4301c5['shift']());}catch(_0x4cf7cd){_0x4301c5['push'](_0x4301c5['shift']());}}}(a52_0xdd6c,0x9a155));import{listRuntimeDatasetRolePermits,listRuntimePermitRoles,saveRuntimeDatasetRolePermits}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';function a52_0xdd6c(){const _0x2c279f=['dataset-set','changed','description','7PFQKSo','includes','bool','POST','datasetCodes','operation','datasets','join','DATA_UPDATE','DATA_DELETE','--actions','push','DATA_DETAIL','/client/permit/resource/batch-save-dataset','find','\x20was\x20not\x20found.','1026532qfEfrM','Comma-separated\x20runtime\x20dataset\x20codes','\x20selected\x20runtime\x20dataset\x20actions','Grants\x20or\x20revokes\x20the\x20target\x20role\x20permission\x20for\x20the\x20given\x20dataset\x20actions.\x20Data\x20operations\x20for\x20users\x20in\x20that\x20role\x20will\x20change.','string','dataset-','grant','after','Grant\x20or\x20revoke\x20selected\x20runtime\x20dataset\x20actions\x20for\x20one\x20role','6950484IUkzje','build','role','1230275uYaZzK','10151610SUCloa','permit','dataPermitList','rolePermit','appCode','470343zQJFBJ','validation','toUpperCase','actions','Dataset\x20','4664248glbAED','map','24mrLiyc','DATA_CREATE','filter','length','Preview:\x20','DATA_EXPORT','975340lgePcy','str','revoke','\x20for\x20role\x20','32deNKTC','resourceName'];a52_0xdd6c=function(){return _0x2c279f;};return a52_0xdd6c();}import{applyRuntimeRolePermission,assertGrantOrRevoke,assertRuntimePermissionManager,assertRuntimePermitRoleConfigurable,GRANT_FLAG,REVOKE_FLAG,ROLE_REF_FLAG,runtimePermitWriteResult,splitRefs}from'../../commands/permit/shared.js';const DATA_ACTIONS=[a52_0x51fdd4(0xde),a52_0x51fdd4(0xbc),a52_0x51fdd4(0xbd),a52_0x51fdd4(0xc0),a52_0x51fdd4(0xe2),'DATA_ROW'],DATASETS_FLAG={'name':a52_0x51fdd4(0xf2),'type':'string','required':!![],'description':a52_0x51fdd4(0xc5)},ACTIONS_FLAG={'name':a52_0x51fdd4(0xd9),'type':a52_0x51fdd4(0xc8),'required':!![],'description':'Comma-separated\x20actions:\x20'+DATA_ACTIONS[a52_0x51fdd4(0xbb)](',\x20')};async function prepare(_0x3f862a){const _0x37a66c=a52_0x51fdd4;await assertRuntimePermissionManager(_0x3f862a[_0x37a66c(0xd5)]);const _0xd4963b=assertGrantOrRevoke(_0x3f862a[_0x37a66c(0xee)](_0x37a66c(0xca)),_0x3f862a[_0x37a66c(0xee)](_0x37a66c(0xe5))),_0x511f9c=await resolveRuntimeRoleRef(_0x3f862a[_0x37a66c(0xd5)],_0x3f862a[_0x37a66c(0xe4)]('role'));assertRuntimePermitRoleConfigurable(_0x511f9c);const _0x606822=splitRefs(_0x3f862a[_0x37a66c(0xe4)]('datasets'),'--datasets'),_0x17b219=[...new Set(splitRefs(_0x3f862a[_0x37a66c(0xe4)](_0x37a66c(0xd9)),_0x37a66c(0xbe))[_0x37a66c(0xdc)](_0x2b6b93=>_0x2b6b93[_0x37a66c(0xd8)]()))],_0x570489=_0x17b219[_0x37a66c(0xdf)](_0x560bfa=>!DATA_ACTIONS[_0x37a66c(0xed)](_0x560bfa));if(_0x570489['length']>0x0)throw CliErrors[_0x37a66c(0xd7)]('Invalid\x20dataset\x20actions:\x20'+_0x570489[_0x37a66c(0xbb)](',\x20')+'.');const _0x452e21=await listRuntimeDatasetRolePermits(_0x3f862a[_0x37a66c(0xd5)]),_0x755b20=await listRuntimePermitRoles(_0x3f862a[_0x37a66c(0xd5)]),_0x3ea0b8=[],_0x535524=[],_0xff47a0=[],_0x2255f2=[];for(const _0x1b53fb of _0x606822){const _0x269c65=_0x452e21[_0x37a66c(0xc2)](_0x3a446e=>_0x3a446e['datasetCode']===_0x1b53fb);if(!_0x269c65)throw CliErrors[_0x37a66c(0xd7)]('Runtime\x20dataset\x20'+_0x1b53fb+_0x37a66c(0xc3));for(const _0x119f96 of _0x17b219){const _0x8fbfb5=_0x269c65[_0x37a66c(0xd3)]?.['find'](_0x2cdfc1=>_0x2cdfc1['resourceType']===_0x119f96);if(!_0x8fbfb5)throw CliErrors[_0x37a66c(0xd7)](_0x37a66c(0xda)+_0x1b53fb+'\x20does\x20not\x20expose\x20'+_0x119f96+'.');const _0x1e4956=applyRuntimeRolePermission(_0x8fbfb5['rolePermit'],_0x511f9c,_0x755b20,_0xd4963b);_0x535524[_0x37a66c(0xbf)]({'datasetCode':_0x1b53fb,'resourceType':_0x119f96,'rolePermit':_0x8fbfb5[_0x37a66c(0xd4)]}),_0xff47a0[_0x37a66c(0xbf)]({'datasetCode':_0x1b53fb,'resourceType':_0x119f96,'rolePermit':_0x1e4956['roles']}),_0x1e4956[_0x37a66c(0xea)]?_0x3ea0b8[_0x37a66c(0xbf)]({..._0x8fbfb5['permitId']!=null?{'id':_0x8fbfb5['permitId']}:{},'appCode':_0x3f862a[_0x37a66c(0xd5)],'resourceCode':_0x1b53fb,'resourceType':_0x119f96,'resourceName':_0x8fbfb5[_0x37a66c(0xe8)],'rolePermit':_0x1e4956['roles']}):_0x2255f2[_0x37a66c(0xbf)](_0x1b53fb+'/'+_0x119f96+'\x20already\x20reflects\x20'+_0xd4963b+_0x37a66c(0xe6)+_0x511f9c['id']+'.');}}return{'operation':_0xd4963b,'role':_0x511f9c,'datasetCodes':_0x606822,'actions':_0x17b219,'permitList':_0x3ea0b8,'before':_0x535524,'after':_0xff47a0,'warnings':_0x2255f2};}function a52_0x3042(_0xdd23f0,_0x2be81d){_0xdd23f0=_0xdd23f0-0xbb;const _0xdd6c06=a52_0xdd6c();let _0x304259=_0xdd6c06[_0xdd23f0];return _0x304259;}export const permitDatasetSet={'service':a52_0x51fdd4(0xd2),'command':a52_0x51fdd4(0xe9),'description':a52_0x51fdd4(0xcc),'risk':'high-risk-write','confirmationDescription':a52_0x51fdd4(0xc7),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,DATASETS_FLAG,ACTIONS_FLAG],async 'validate'(_0x31686c){const _0x368148=a52_0x51fdd4;assertGrantOrRevoke(_0x31686c[_0x368148(0xee)](_0x368148(0xca)),_0x31686c[_0x368148(0xee)](_0x368148(0xe5)));},async 'dryRun'(_0x13decf){const _0x281ab2=a52_0x51fdd4,_0x2a661f=await prepare(_0x13decf);return dryRun('POST',_0x281ab2(0xc1))['body']({'appCode':_0x13decf[_0x281ab2(0xd5)],'permitList':_0x2a661f['permitList']})[_0x281ab2(0xeb)](_0x281ab2(0xe1)+_0x2a661f['operation']+_0x281ab2(0xc6))[_0x281ab2(0xce)]();},async 'execute'(_0x12896d){const _0x466252=a52_0x51fdd4,_0x390be3=await prepare(_0x12896d);return _0x390be3['permitList'][_0x466252(0xe0)]>0x0&&await saveRuntimeDatasetRolePermits(_0x12896d[_0x466252(0xd5)],_0x390be3['permitList']),{'ok':!![],'data':runtimePermitWriteResult(_0x466252(0xc9)+_0x390be3[_0x466252(0xf1)],{'roleId':_0x390be3[_0x466252(0xcf)]['id'],'datasetCodes':_0x390be3[_0x466252(0xf0)],'actions':_0x390be3[_0x466252(0xd9)]},_0x390be3['before'],_0x390be3[_0x466252(0xcb)],{'method':_0x466252(0xef),'path':'/client/permit/resource/batch-save-dataset'},_0x390be3['warnings'])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55b56e,_0xd17ec){const _0x2c1d55=a53_0x1336,_0x3ed1f6=_0x55b56e();while(!![]){try{const _0x5a5739=-parseInt(_0x2c1d55(0x111))/0x1*(-parseInt(_0x2c1d55(0x115))/0x2)+-parseInt(_0x2c1d55(0x114))/0x3+parseInt(_0x2c1d55(0x10e))/0x4*(-parseInt(_0x2c1d55(0x10f))/0x5)+-parseInt(_0x2c1d55(0x112))/0x6+parseInt(_0x2c1d55(0x113))/0x7+-parseInt(_0x2c1d55(0x110))/0x8+parseInt(_0x2c1d55(0x116))/0x9;if(_0x5a5739===_0xd17ec)break;else _0x3ed1f6['push'](_0x3ed1f6['shift']());}catch(_0x17fc4a){_0x3ed1f6['push'](_0x3ed1f6['shift']());}}}(a53_0x1866,0x7833d));import{permitPageGet}from'../../commands/permit/page-get.js';import{permitPageSet}from'../../commands/permit/page-set.js';import{permitRoleMenus}from'../../commands/permit/role-menus.js';function a53_0x1336(_0x5e0503,_0xdcec34){_0x5e0503=_0x5e0503-0x10e;const _0x1866dd=a53_0x1866();let _0x1336f6=_0x1866dd[_0x5e0503];return _0x1336f6;}import{permitRoleMenusSet}from'../../commands/permit/role-menus-set.js';import{permitDatasetGet}from'../../commands/permit/dataset-get.js';function a53_0x1866(){const _0x55b5b2=['5828TDIEXI','2885CcjgVw','5043160joLDIk','1fqxgWc','1125282sbnXdI','3507987tOVnWX','1967196YUFfuY','343654JDEfJk','19203696OsQgzg'];a53_0x1866=function(){return _0x55b5b2;};return a53_0x1866();}import{permitDatasetSet}from'../../commands/permit/dataset-set.js';export const permitDefinitions=[permitPageGet,permitPageSet,permitRoleMenus,permitRoleMenusSet,permitDatasetGet,permitDatasetSet];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a54_0x3fc6(_0x245331,_0x400ada){_0x245331=_0x245331-0x13a;const _0x58e78a=a54_0x58e7();let _0x3fc65b=_0x58e78a[_0x245331];return _0x3fc65b;}const a54_0x583285=a54_0x3fc6;function a54_0x58e7(){const _0x5956de=['Get\x20runtime\x20page\x20permission\x20slots\x20by\x20menu\x20ID','6PkQoJx','289260oXmTpN','read','980OrHsGC','runtime','1795EQubyx','1151742ZiQQvE','permit','296cEskWs','8571899UFxPPv','542926SEzWFH','69366zMhkVi','553807gDqYlw','12812BLNnYe','menu-id'];a54_0x58e7=function(){return _0x5956de;};return a54_0x58e7();}(function(_0x34fc08,_0x23d2f2){const _0x57dfdb=a54_0x3fc6,_0x257ac6=_0x34fc08();while(!![]){try{const _0x547890=parseInt(_0x57dfdb(0x143))/0x1+parseInt(_0x57dfdb(0x141))/0x2*(parseInt(_0x57dfdb(0x147))/0x3)+parseInt(_0x57dfdb(0x144))/0x4*(parseInt(_0x57dfdb(0x13c))/0x5)+parseInt(_0x57dfdb(0x13d))/0x6+-parseInt(_0x57dfdb(0x140))/0x7+parseInt(_0x57dfdb(0x13f))/0x8*(-parseInt(_0x57dfdb(0x148))/0x9)+-parseInt(_0x57dfdb(0x13a))/0xa*(-parseInt(_0x57dfdb(0x142))/0xb);if(_0x547890===_0x23d2f2)break;else _0x257ac6['push'](_0x257ac6['shift']());}catch(_0x48b994){_0x257ac6['push'](_0x257ac6['shift']());}}}(a54_0x58e7,0x9cf02));import{getRuntimePagePermit}from'../../core/api-client.js';import{MENU_ID_FLAG,projectRuntimePagePermit}from'../../commands/permit/shared.js';export const permitPageGet={'service':a54_0x583285(0x13e),'command':'page-get','description':a54_0x583285(0x146),'risk':a54_0x583285(0x149),'flags':[MENU_ID_FLAG],async 'execute'(_0x5b0e82){const _0x180e36=a54_0x583285,_0x351ece=await getRuntimePagePermit(_0x5b0e82['num'](_0x180e36(0x145)));return{'ok':!![],'data':{'scope':_0x180e36(0x13b),'page':projectRuntimePagePermit(_0x351ece)}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x28228c=a55_0x47ca;(function(_0x45d957,_0x477f28){const _0x8b8120=a55_0x47ca,_0x36bf62=_0x45d957();while(!![]){try{const _0x5e66fd=-parseInt(_0x8b8120(0xd3))/0x1*(parseInt(_0x8b8120(0xe9))/0x2)+parseInt(_0x8b8120(0xe8))/0x3+-parseInt(_0x8b8120(0xdb))/0x4*(parseInt(_0x8b8120(0xf2))/0x5)+-parseInt(_0x8b8120(0xf0))/0x6+-parseInt(_0x8b8120(0xe0))/0x7*(-parseInt(_0x8b8120(0xe6))/0x8)+parseInt(_0x8b8120(0xe2))/0x9+parseInt(_0x8b8120(0xd5))/0xa*(parseInt(_0x8b8120(0xdf))/0xb);if(_0x5e66fd===_0x477f28)break;else _0x36bf62['push'](_0x36bf62['shift']());}catch(_0x3d3787){_0x36bf62['push'](_0x36bf62['shift']());}}}(a55_0x4e07,0x582d2));import{getRuntimePagePermit,saveRuntimePagePermit}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a55_0x47ca(_0x2060b5,_0x7e1988){_0x2060b5=_0x2060b5-0xd3;const _0x4e07de=a55_0x4e07();let _0x47ca59=_0x4e07de[_0x2060b5];return _0x47ca59;}import{dryRun}from'../../framework/dryrun.js';import{assertRuntimePermissionManager,MENU_ID_FLAG,PAGE_ROLE_FLAGS,PAGE_SLOT_SPECS,projectRuntimePagePermit,resolveRuntimePermitRoles,runtimePermitWriteResult,splitRefs}from'../../commands/permit/shared.js';async function prepare(_0x3a1014){const _0x43131d=a55_0x47ca;await assertRuntimePermissionManager(_0x3a1014['appCode']);const _0x5065c4=_0x3a1014[_0x43131d(0xf3)](_0x43131d(0xd6)),_0x1781cd=await getRuntimePagePermit(_0x5065c4);if(_0x1781cd[_0x43131d(0xd9)]&&_0x1781cd[_0x43131d(0xd9)]!==_0x3a1014[_0x43131d(0xd9)])throw CliErrors['validation'](_0x43131d(0xe5)+_0x5065c4+_0x43131d(0xeb)+_0x3a1014['appCode']+'.');const _0x580b31=structuredClone(_0x1781cd),_0x14ea1b=[];for(const _0x14aad4 of PAGE_SLOT_SPECS){if(_0x3a1014[_0x43131d(0xda)](_0x14aad4[_0x43131d(0xda)])===undefined)continue;const _0x50880d=_0x1781cd[_0x14aad4[_0x43131d(0xe3)]];if(!_0x50880d)throw CliErrors[_0x43131d(0xf4)]('Page\x20menu\x20'+_0x5065c4+_0x43131d(0xf1)+_0x14aad4['key']+'.');_0x50880d[_0x43131d(0xe7)]=await resolveRuntimePermitRoles(_0x3a1014[_0x43131d(0xd9)],splitRefs(_0x3a1014['str'](_0x14aad4[_0x43131d(0xda)]),'--'+_0x14aad4['flag']),_0x14aad4['allowSelf']),_0x14ea1b[_0x43131d(0xdd)](_0x14aad4[_0x43131d(0xe3)]);}if(_0x14ea1b['length']===0x0)throw CliErrors[_0x43131d(0xf4)](_0x43131d(0xd4));return{'menuId':_0x5065c4,'page':_0x1781cd,'before':_0x580b31,'slots':_0x14ea1b};}export const permitPageSet={'service':'permit','command':a55_0x28228c(0xde),'description':'Set\x20selected\x20runtime\x20page\x20permission\x20slots','risk':a55_0x28228c(0xf5),'confirmationDescription':'Changes\x20role\x20permission\x20slots\x20on\x20the\x20given\x20runtime\x20page.\x20Unauthorized\x20users\x20may\x20be\x20unable\x20to\x20view\x20the\x20page\x20or\x20run\x20data\x20operations.','flags':[MENU_ID_FLAG,...PAGE_ROLE_FLAGS],async 'dryRun'(_0x28ce00){const _0x388f42=a55_0x28228c,_0x50b901=await prepare(_0x28ce00);return dryRun(_0x388f42(0xea),_0x388f42(0xef))[_0x388f42(0xd7)](_0x50b901[_0x388f42(0xd8)])[_0x388f42(0xe1)](_0x388f42(0xee)+_0x50b901['slots']['join'](',\x20'))[_0x388f42(0xe4)]();},async 'execute'(_0x1e9b60){const _0x461fe9=a55_0x28228c,_0x2c62ba=await prepare(_0x1e9b60),_0x50c3cc=await saveRuntimePagePermit(_0x2c62ba[_0x461fe9(0xd8)]);return{'ok':!![],'data':runtimePermitWriteResult(_0x461fe9(0xde),{'menuId':_0x2c62ba[_0x461fe9(0xec)],'slots':_0x2c62ba[_0x461fe9(0xed)]},projectRuntimePagePermit(_0x2c62ba[_0x461fe9(0xdc)]),projectRuntimePagePermit(_0x50c3cc),{'method':_0x461fe9(0xea),'path':_0x461fe9(0xef)})};}};function a55_0x4e07(){const _0x27442b=['33srMKvw','493234WMNBRo','description','6227064WqOBcd','key','build','Menu\x20','48WMKkKE','rolePermit','1150344jKOBCN','891454AyLIqd','POST','\x20does\x20not\x20belong\x20to\x20app\x20','menuId','slots','Preview:\x20update\x20page\x20permission\x20slots\x20','/client/permit/page/save','3623640WVanuA','\x20does\x20not\x20expose\x20','465KfFvsc','num','validation','high-risk-write','1MOGOYp','Pass\x20at\x20least\x20one\x20page\x20role\x20flag\x20to\x20update.','1596040vRePBw','menu-id','body','page','appCode','flag','24348NksiSi','before','push','page-set'];a55_0x4e07=function(){return _0x27442b;};return a55_0x4e07();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a56_0x4d24(_0x316b9c,_0xc56f7b){_0x316b9c=_0x316b9c-0xb2;const _0x1439e9=a56_0x1439();let _0x4d2459=_0x1439e9[_0x316b9c];return _0x4d2459;}function a56_0x1439(){const _0x3b84d8=['menus','POST','permitList','role-menus-set','map','Grants\x20or\x20revokes\x20the\x20target\x20role\x20access\x20to\x20the\x20given\x20runtime\x20menus.\x20Menu\x20visibility\x20for\x20users\x20in\x20that\x20role\x20will\x20change.','appCode','body','isSafeInteger','684354LOLyYs','push','/client/permit/resource/batch-save-menu','500766sonUMO','bool','Comma-separated\x20runtime\x20menu\x20IDs','Preview:\x20','Runtime\x20menu\x20','str','warnings','4740372ACDcxx','high-risk-write','grant','272214zxKTom','after','menu-','\x20selected\x20runtime\x20menus','rolePermit','operation','validation','1096yoeDQU','description','595494BldRBn','revoke','roles','role','--menus','Grant\x20or\x20revoke\x20selected\x20runtime\x20menus\x20for\x20one\x20role','20ghpvEE','permit','441520DmVQpz','5817iiIBeT','\x20was\x20not\x20found.','\x20for\x20role\x20','changed','find'];a56_0x1439=function(){return _0x3b84d8;};return a56_0x1439();}const a56_0x202e7b=a56_0x4d24;(function(_0xb708de,_0x1bad52){const _0x1a90cd=a56_0x4d24,_0x2ca953=_0xb708de();while(!![]){try{const _0x31f2dc=-parseInt(_0x1a90cd(0xd2))/0x1+-parseInt(_0x1a90cd(0xdb))/0x2+-parseInt(_0x1a90cd(0xc8))/0x3+parseInt(_0x1a90cd(0xb6))/0x4+-parseInt(_0x1a90cd(0xb4))/0x5*(-parseInt(_0x1a90cd(0xc5))/0x6)+-parseInt(_0x1a90cd(0xb7))/0x7*(parseInt(_0x1a90cd(0xd9))/0x8)+parseInt(_0x1a90cd(0xcf))/0x9;if(_0x31f2dc===_0x1bad52)break;else _0x2ca953['push'](_0x2ca953['shift']());}catch(_0x3737e2){_0x2ca953['push'](_0x2ca953['shift']());}}}(a56_0x1439,0x3b3a2));import{listRuntimeMenuRolePermits,listRuntimePermitRoles,saveRuntimeMenuRolePermits}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{applyRuntimeRolePermission,assertGrantOrRevoke,assertRuntimePermissionManager,assertRuntimePermitRoleConfigurable,flattenRuntimeMenuRolePermits,GRANT_FLAG,menuPermitDto,REVOKE_FLAG,ROLE_REF_FLAG,runtimePermitWriteResult,splitRefs}from'../../commands/permit/shared.js';const MENUS_FLAG={'name':'menus','type':'string','required':!![],'description':a56_0x202e7b(0xca)};async function prepare(_0x16f277){const _0x36d68d=a56_0x202e7b;await assertRuntimePermissionManager(_0x16f277[_0x36d68d(0xc2)]);const _0x30194d=assertGrantOrRevoke(_0x16f277[_0x36d68d(0xc9)](_0x36d68d(0xd1)),_0x16f277['bool'](_0x36d68d(0xdc))),_0x2ed278=await resolveRuntimeRoleRef(_0x16f277['appCode'],_0x16f277[_0x36d68d(0xcd)](_0x36d68d(0xde)));assertRuntimePermitRoleConfigurable(_0x2ed278);const _0x47b3aa=[...new Set(splitRefs(_0x16f277[_0x36d68d(0xcd)](_0x36d68d(0xbc)),_0x36d68d(0xb2))[_0x36d68d(0xc0)](_0x17953f=>{const _0x419d03=_0x36d68d,_0x3bb95b=Number(_0x17953f);if(!/^\d+$/['test'](_0x17953f)||!Number[_0x419d03(0xc4)](_0x3bb95b)||_0x3bb95b<=0x0)throw CliErrors[_0x419d03(0xd8)]('Invalid\x20runtime\x20menu\x20ID:\x20'+_0x17953f+'.');return _0x3bb95b;}))],_0x54f7d2=flattenRuntimeMenuRolePermits(await listRuntimeMenuRolePermits(_0x16f277[_0x36d68d(0xc2)])),_0x36ab12=await listRuntimePermitRoles(_0x16f277[_0x36d68d(0xc2)]),_0x1a3021=[],_0x3c7667=[],_0x43d46c=[],_0x4588d6=[];for(const _0xa027c of _0x47b3aa){const _0x19c9c7=_0x54f7d2[_0x36d68d(0xbb)](_0x552b99=>_0x552b99['id']===_0xa027c);if(!_0x19c9c7)throw CliErrors[_0x36d68d(0xd8)](_0x36d68d(0xcc)+_0xa027c+_0x36d68d(0xb8));const _0x18ff3a=applyRuntimeRolePermission(_0x19c9c7[_0x36d68d(0xd6)],_0x2ed278,_0x36ab12,_0x30194d);_0x3c7667[_0x36d68d(0xc6)]({'menuId':_0xa027c,'rolePermit':_0x19c9c7[_0x36d68d(0xd6)]}),_0x43d46c[_0x36d68d(0xc6)]({'menuId':_0xa027c,'rolePermit':_0x18ff3a[_0x36d68d(0xdd)]});if(_0x18ff3a[_0x36d68d(0xba)])_0x1a3021[_0x36d68d(0xc6)](menuPermitDto(_0x16f277[_0x36d68d(0xc2)],_0x19c9c7,_0x18ff3a['roles']));else _0x4588d6[_0x36d68d(0xc6)](_0x36d68d(0xcc)+_0xa027c+'\x20already\x20reflects\x20'+_0x30194d+_0x36d68d(0xb9)+_0x2ed278['id']+'.');}return{'operation':_0x30194d,'role':_0x2ed278,'menuIds':_0x47b3aa,'permitList':_0x1a3021,'before':_0x3c7667,'after':_0x43d46c,'warnings':_0x4588d6};}export const permitRoleMenusSet={'service':a56_0x202e7b(0xb5),'command':a56_0x202e7b(0xbf),'description':a56_0x202e7b(0xb3),'risk':a56_0x202e7b(0xd0),'confirmationDescription':a56_0x202e7b(0xc1),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG],async 'validate'(_0x5a2877){const _0x1db674=a56_0x202e7b;assertGrantOrRevoke(_0x5a2877[_0x1db674(0xc9)](_0x1db674(0xd1)),_0x5a2877['bool']('revoke'));},async 'dryRun'(_0x19f39b){const _0x18b195=a56_0x202e7b,_0x126f4c=await prepare(_0x19f39b);return dryRun(_0x18b195(0xbd),_0x18b195(0xc7))[_0x18b195(0xc3)]({'appCode':_0x19f39b[_0x18b195(0xc2)],'permitList':_0x126f4c[_0x18b195(0xbe)]})[_0x18b195(0xda)](_0x18b195(0xcb)+_0x126f4c[_0x18b195(0xd7)]+_0x18b195(0xd5))['build']();},async 'execute'(_0x2579b5){const _0x4df684=a56_0x202e7b,_0x4df676=await prepare(_0x2579b5);return _0x4df676[_0x4df684(0xbe)]['length']>0x0&&await saveRuntimeMenuRolePermits(_0x2579b5[_0x4df684(0xc2)],_0x4df676['permitList']),{'ok':!![],'data':runtimePermitWriteResult(_0x4df684(0xd4)+_0x4df676['operation'],{'roleId':_0x4df676[_0x4df684(0xde)]['id'],'menuIds':_0x4df676['menuIds']},_0x4df676['before'],_0x4df676[_0x4df684(0xd3)],{'method':_0x4df684(0xbd),'path':_0x4df684(0xc7)},_0x4df676[_0x4df684(0xce)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a57_0x1aa5(_0x182ebb,_0x4c0e09){_0x182ebb=_0x182ebb-0x1c8;const _0xc91b34=a57_0xc91b();let _0x1aa58d=_0xc91b34[_0x182ebb];return _0x1aa58d;}function a57_0xc91b(){const _0x33d5ec=['runtime','1276091qBysPO','30432GSMczB','3691356cvSvxa','144513fgIeLz','role-menus','12795888ymUpak','104OyUbfW','439219khlTzD','290UMbUMR','3HbSosD','read','role','appCode','930jYwXYv','str','1300236JNahrQ'];a57_0xc91b=function(){return _0x33d5ec;};return a57_0xc91b();}const a57_0x4a0490=a57_0x1aa5;(function(_0x4a38cb,_0x59b6df){const _0x26afc3=a57_0x1aa5,_0x5c3ca5=_0x4a38cb();while(!![]){try{const _0x1cee82=parseInt(_0x26afc3(0x1cd))/0x1+parseInt(_0x26afc3(0x1cb))/0x2+-parseInt(_0x26afc3(0x1d6))/0x3*(parseInt(_0x26afc3(0x1cf))/0x4)+parseInt(_0x26afc3(0x1c9))/0x5*(-parseInt(_0x26afc3(0x1ce))/0x6)+parseInt(_0x26afc3(0x1d2))/0x7+-parseInt(_0x26afc3(0x1d3))/0x8*(-parseInt(_0x26afc3(0x1d0))/0x9)+-parseInt(_0x26afc3(0x1d5))/0xa*(parseInt(_0x26afc3(0x1d4))/0xb);if(_0x1cee82===_0x59b6df)break;else _0x5c3ca5['push'](_0x5c3ca5['shift']());}catch(_0x111727){_0x5c3ca5['push'](_0x5c3ca5['shift']());}}}(a57_0xc91b,0xe530a));import{getRuntimeRoleMenuResources}from'../../core/api-client.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{ROLE_REF_FLAG}from'../../commands/permit/shared.js';export const permitRoleMenus={'service':'permit','command':a57_0x4a0490(0x1d1),'description':'Show\x20evaluated\x20runtime\x20menu\x20access\x20for\x20one\x20role','risk':a57_0x4a0490(0x1d7),'flags':[ROLE_REF_FLAG],async 'execute'(_0x234d6e){const _0x4ccd97=a57_0x4a0490,_0x2e1dd7=await resolveRuntimeRoleRef(_0x234d6e['appCode'],_0x234d6e[_0x4ccd97(0x1ca)](_0x4ccd97(0x1d8))),_0x1bb706=await getRuntimeRoleMenuResources(_0x234d6e[_0x4ccd97(0x1c8)],_0x2e1dd7['id']);return{'ok':!![],'data':{'scope':_0x4ccd97(0x1cc),'role':{'id':_0x2e1dd7['id'],'roleName':_0x2e1dd7['roleName'],'roleType':_0x2e1dd7['roleType']},'menus':_0x1bb706}};}};
|