@treasuredata/tdx 2026.7.4 → 2026.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.d.ts.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-command.js.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.d.ts +47 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +6 -6
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cas.d.ts +5 -0
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/proxy-fetch.js.map +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5f380d,_0x3b23bf){const _0x2cbca9=a164_0x4e6e,_0x930661=_0x5f380d();while(!![]){try{const _0x433618=parseInt(_0x2cbca9(0x17e))/0x1+-parseInt(_0x2cbca9(0x184))/0x2+-parseInt(_0x2cbca9(0x151))/0x3+-parseInt(_0x2cbca9(0x169))/0x4*(-parseInt(_0x2cbca9(0x16d))/0x5)+parseInt(_0x2cbca9(0x15c))/0x6*(parseInt(_0x2cbca9(0x171))/0x7)+parseInt(_0x2cbca9(0x15e))/0x8*(-parseInt(_0x2cbca9(0x177))/0x9)+parseInt(_0x2cbca9(0x167))/0xa*(parseInt(_0x2cbca9(0x168))/0xb);if(_0x433618===_0x3b23bf)break;else _0x930661['push'](_0x930661['shift']());}catch(_0x3486db){_0x930661['push'](_0x930661['shift']());}}}(a164_0x3138,0x38a6b));import a164_0x2d4330 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';function a164_0x3138(){const _0x7258d9=['Not\x20a\x20YAML\x20file:\x20','journey','1284219pnDSNg','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','File\x20not\x20found:\x20','startsWith','segmentName','folderPath','error','34414TbtVVa','exists','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','resolve','cwd','resourceType','153572wrDazZ','message','invalid_yaml','parse','context','427125ivOydO','isFile','scopedFolderPath','type','parentSegment','replace','parent_segment','file_not_found','Parent\x20segment\x20not\x20specified','string','parent_name','1275528RYXhpc','match','24stWBcN','trim','segment','root','dirname','No\x20tdx.json\x20found\x20for\x20file:\x20','stat','no_config','includes','1850gAodPQ','8602iwLUCV','1100068NBrZei','no_parent','file','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','5aZXhCX','configDir','isScoped','directory','14cDCMuW','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','readFile','extname'];a164_0x3138=function(){return _0x7258d9;};return a164_0x3138();}export function isSuccessfulResolution(_0x547bf3){const _0x3691a4=a164_0x4e6e;return _0x547bf3['type']!==_0x3691a4(0x17d);}export function isScopedResolution(_0x479744){const _0x25cec5=a164_0x4e6e;return _0x479744[_0x25cec5(0x154)]===_0x25cec5(0x170)||_0x479744[_0x25cec5(0x154)]===_0x25cec5(0x16b)||_0x479744[_0x25cec5(0x154)]===_0x25cec5(0x188);}export function getScopedDetails(_0x1c8c38){const _0x106536=a164_0x4e6e;if(isScopedResolution(_0x1c8c38))return{'isScoped':_0x1c8c38['isScoped'],'scopedFolderPath':_0x1c8c38[_0x106536(0x153)]};return undefined;}async function findTdxConfigAsync(_0x1bf1d5,_0xc27c6){const _0x192dd2=a164_0x4e6e;let _0x38d128=a164_0x2d4330[_0x192dd2(0x181)](_0x1bf1d5);const _0x52dc74=a164_0x2d4330[_0x192dd2(0x187)](_0x38d128)[_0x192dd2(0x161)];while(_0x38d128!==_0x52dc74){const _0x139be0=a164_0x2d4330['join'](_0x38d128,'tdx.json');if(await _0xc27c6['exists'](_0x139be0))try{const _0x2ecdcd=await _0xc27c6[_0x192dd2(0x173)](_0x139be0),_0x50147d=JSON[_0x192dd2(0x187)](_0x2ecdcd);if(_0x50147d[_0x192dd2(0x157)]&&typeof _0x50147d[_0x192dd2(0x157)]===_0x192dd2(0x15a))return{'configPath':_0x139be0,'configDir':_0x38d128,'parentSegment':_0x50147d[_0x192dd2(0x157)]};}catch{}_0x38d128=a164_0x2d4330[_0x192dd2(0x162)](_0x38d128);}return null;}function calculateScopedPath(_0x1fc65d,_0x5e67cd){const _0x30d76c=a164_0x4e6e,_0x1c9cb1=a164_0x2d4330['relative'](_0x5e67cd,_0x1fc65d),_0x4921ac=_0x1c9cb1!==''&&_0x1c9cb1!=='.'&&!_0x1c9cb1[_0x30d76c(0x17a)]('..');return{'isScoped':_0x4921ac,'scopedFolderPath':_0x4921ac?_0x1c9cb1[_0x30d76c(0x156)](/\\/g,'/'):''};}function a164_0x4e6e(_0x177148,_0x382ce9){_0x177148=_0x177148-0x151;const _0x3138cc=a164_0x3138();let _0x4e6e4f=_0x3138cc[_0x177148];return _0x4e6e4f;}export async function resolveTarget(_0x439e7d){const _0x5eb414=a164_0x4e6e,{arg:_0x47abbe,contextParent:_0x2acf33,cwd:cwd=process[_0x5eb414(0x182)](),fs:fs=nodeFileSystem}=_0x439e7d;if(_0x47abbe&&isYamlFilePath(_0x47abbe))try{const _0xf3777e=await resolveYamlFilePath(_0x47abbe,fs),_0x5b445e=a164_0x2d4330[_0x5eb414(0x181)](_0x47abbe),_0x3f3d6d=a164_0x2d4330[_0x5eb414(0x162)](_0x5b445e),_0x60ef6a=await findTdxConfigAsync(_0x3f3d6d,fs);if(!_0x60ef6a){if(_0x2acf33){const _0x6156fe=a164_0x2d4330['dirname'](_0x5b445e);return{'type':_0x5eb414(0x16b),'parentName':_0x2acf33,'targetDir':_0x6156fe,'configRoot':_0x6156fe,'filePath':_0x5b445e,'resourceName':_0xf3777e[_0x5eb414(0x17b)],'folderPath':_0xf3777e[_0x5eb414(0x17c)],'resourceType':_0xf3777e[_0x5eb414(0x183)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':'no_config','message':_0x5eb414(0x163)+_0x47abbe,'arg':_0x47abbe,'helpText':_0x5eb414(0x172)};}const _0xabdd36=calculateScopedPath(_0x3f3d6d,_0x60ef6a[_0x5eb414(0x16e)]);return{'type':_0x5eb414(0x16b),'parentName':_0x60ef6a[_0x5eb414(0x155)],'targetDir':_0x60ef6a[_0x5eb414(0x16e)],'configRoot':_0x60ef6a[_0x5eb414(0x16e)],'filePath':_0x5b445e,'resourceName':_0xf3777e['segmentName'],'folderPath':_0xf3777e[_0x5eb414(0x17c)],'resourceType':_0xf3777e[_0x5eb414(0x183)],'isScoped':_0xabdd36[_0x5eb414(0x16f)],'scopedFolderPath':_0xabdd36[_0x5eb414(0x153)]};}catch(_0x448250){const _0x3acfa8=_0x448250 instanceof Error?_0x448250[_0x5eb414(0x185)]:String(_0x448250);if(_0x3acfa8[_0x5eb414(0x166)]('File\x20not\x20found'))return{'type':'error','errorCode':_0x5eb414(0x158),'message':_0x5eb414(0x179)+_0x47abbe,'arg':_0x47abbe};if(_0x3acfa8['includes']('No\x20tdx.json\x20found')){if(_0x2acf33){const _0x11c78a=a164_0x2d4330['resolve'](_0x47abbe);if(await fs[_0x5eb414(0x17f)](_0x11c78a)){const _0x3dd5a3=a164_0x2d4330[_0x5eb414(0x162)](_0x11c78a),_0x12e8c1=await fs[_0x5eb414(0x173)](_0x11c78a),_0x22b526=_0x12e8c1[_0x5eb414(0x15d)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x4e82b6=_0x12e8c1[_0x5eb414(0x15d)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x5c7e71=_0x22b526?_0x22b526[0x1][_0x5eb414(0x15f)]():a164_0x2d4330['basename'](_0x47abbe,a164_0x2d4330[_0x5eb414(0x174)](_0x47abbe)),_0x8fc085=_0x4e82b6&&_0x4e82b6[0x1][_0x5eb414(0x15f)]()===_0x5eb414(0x176)?_0x5eb414(0x176):_0x5eb414(0x160);return{'type':_0x5eb414(0x16b),'parentName':_0x2acf33,'targetDir':_0x3dd5a3,'configRoot':_0x3dd5a3,'filePath':_0x11c78a,'resourceName':_0x5c7e71,'folderPath':'','resourceType':_0x8fc085,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x5eb414(0x165),'message':_0x5eb414(0x163)+_0x47abbe,'arg':_0x47abbe,'helpText':_0x5eb414(0x172)};}return{'type':_0x5eb414(0x17d),'errorCode':_0x5eb414(0x186),'message':_0x3acfa8,'arg':_0x47abbe};}if(_0x47abbe){const _0x266b31=a164_0x2d4330[_0x5eb414(0x181)](cwd,_0x47abbe);let _0x471611=null;try{_0x471611=await fs[_0x5eb414(0x164)](_0x266b31);}catch{}if(_0x471611?.['isDirectory']()){const _0x3a1373=await findTdxConfigAsync(_0x266b31,fs);if(_0x3a1373){const _0x24bdb9=calculateScopedPath(_0x266b31,_0x3a1373[_0x5eb414(0x16e)]);return{'type':'directory','parentName':_0x3a1373[_0x5eb414(0x155)],'targetDir':_0x266b31,'configRoot':_0x3a1373[_0x5eb414(0x16e)],'isScoped':_0x24bdb9['isScoped'],'scopedFolderPath':_0x24bdb9[_0x5eb414(0x153)]};}if(_0x2acf33)return{'type':'directory','parentName':_0x2acf33,'targetDir':_0x266b31,'configRoot':_0x266b31,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x5eb414(0x165),'message':_0x5eb414(0x178)+_0x47abbe,'arg':_0x47abbe,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}if(_0x471611?.[_0x5eb414(0x152)]())return{'type':_0x5eb414(0x17d),'errorCode':_0x5eb414(0x186),'message':_0x5eb414(0x175)+_0x47abbe,'arg':_0x47abbe,'helpText':_0x5eb414(0x16c)};const _0x25b5dc=sanitizeFileName(_0x47abbe),_0x6ac686=getSegmentRootDir(_0x25b5dc,cwd);return{'type':_0x5eb414(0x15b),'parentName':_0x47abbe,'targetDir':_0x6ac686,'configRoot':_0x6ac686};}const _0x42a811=await findTdxConfigAsync(cwd,fs);if(_0x42a811){const _0x475ae0=calculateScopedPath(cwd,_0x42a811[_0x5eb414(0x16e)]);return{'type':'context','parentName':_0x42a811[_0x5eb414(0x155)],'targetDir':cwd,'configRoot':_0x42a811['configDir'],'isScoped':_0x475ae0[_0x5eb414(0x16f)],'scopedFolderPath':_0x475ae0['scopedFolderPath']};}if(_0x2acf33){const _0x570bf0=sanitizeFileName(_0x2acf33),_0x3a63ec=getSegmentRootDir(_0x570bf0,cwd);return{'type':_0x5eb414(0x188),'parentName':_0x2acf33,'targetDir':_0x3a63ec,'configRoot':_0x3a63ec,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5eb414(0x17d),'errorCode':_0x5eb414(0x16a),'message':_0x5eb414(0x159),'helpText':_0x5eb414(0x180)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x597a00=a165_0x22f2;(function(_0x355448,_0x18e9bc){const _0x4275b7=a165_0x22f2,_0x50c4a9=_0x355448();while(!![]){try{const _0xd2289=parseInt(_0x4275b7(0x194))/0x1+parseInt(_0x4275b7(0x19f))/0x2+parseInt(_0x4275b7(0x1a3))/0x3+parseInt(_0x4275b7(0x1a0))/0x4*(parseInt(_0x4275b7(0x196))/0x5)+parseInt(_0x4275b7(0x19a))/0x6*(parseInt(_0x4275b7(0x1a9))/0x7)+-parseInt(_0x4275b7(0x193))/0x8+-parseInt(_0x4275b7(0x1ad))/0x9;if(_0xd2289===_0x18e9bc)break;else _0x50c4a9['push'](_0x50c4a9['shift']());}catch(_0x54c338){_0x50c4a9['push'](_0x50c4a9['shift']());}}}(a165_0x3898,0x9f686));import{existsSync,readFileSync}from'fs';import a165_0x122793 from'path';const TDX_CONFIG_FILE=a165_0x597a00(0x1a1),SEGMENTS_DIR=a165_0x597a00(0x1ae);export function findTdxConfigPath(_0x3e9723=process['cwd']()){const _0x3a21a5=a165_0x597a00;let _0x522db7=a165_0x122793['resolve'](_0x3e9723);const _0x26b629=a165_0x122793['parse'](_0x522db7)['root'];while(_0x522db7!==_0x26b629){const _0x4de446=a165_0x122793[_0x3a21a5(0x19c)](_0x522db7,TDX_CONFIG_FILE);if(existsSync(_0x4de446))return _0x4de446;_0x522db7=a165_0x122793[_0x3a21a5(0x1a4)](_0x522db7);}return null;}function a165_0x3898(){const _0x442703=['startsWith','492350WfwKLK','1903364LDTIeV','tdx.json','string','637425xMsLxi','dirname','parse','engage_workspace','relative','Invalid\x20tdx.json:\x20expected\x20object','72548taZEfX','cwd','object','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','13948794IFuNVa','segments','5329688aVZnju','659748vMwOOr','resolve','5XeTVYy','stringify','parent_segment','Invalid\x20JSON\x20in\x20','738SlqQfP','replace','join','Invalid\x20tdx.json:\x20must\x20contain\x20\x27parent_segment\x27\x20or\x20\x27engage_workspace\x27\x20field'];a165_0x3898=function(){return _0x442703;};return a165_0x3898();}export function loadTdxConfig(_0x1504ea){const _0x27914d=a165_0x597a00,_0x555571=readFileSync(_0x1504ea,'utf-8');let _0x2976ae;try{_0x2976ae=JSON[_0x27914d(0x1a5)](_0x555571);}catch{throw new Error(_0x27914d(0x199)+_0x1504ea);}if(!_0x2976ae||typeof _0x2976ae!==_0x27914d(0x1ab))throw new Error(_0x27914d(0x1a8));const _0x296960=_0x2976ae,_0x592773=_0x296960['parent_segment']&&typeof _0x296960[_0x27914d(0x198)]===_0x27914d(0x1a2),_0x170dce=_0x296960[_0x27914d(0x1a6)]&&typeof _0x296960[_0x27914d(0x1a6)]===_0x27914d(0x1a2);if(!_0x592773&&!_0x170dce)throw new Error(_0x27914d(0x19d));const _0x1c3dfa={};return _0x592773&&(_0x1c3dfa[_0x27914d(0x198)]=_0x296960['parent_segment']),_0x170dce&&(_0x1c3dfa[_0x27914d(0x1a6)]=_0x296960['engage_workspace']),_0x1c3dfa;}export function findTdxConfig(_0x1709ed=process[a165_0x597a00(0x1aa)]()){const _0x2223b8=a165_0x597a00,_0x7b831e=findTdxConfigPath(_0x1709ed);if(!_0x7b831e)throw new Error(_0x2223b8(0x1ac));const _0x2edfbe=loadTdxConfig(_0x7b831e),_0x36867f=a165_0x122793[_0x2223b8(0x1a4)](_0x7b831e);return{'config':_0x2edfbe,'configPath':_0x7b831e,'configDir':_0x36867f};}export function tryFindTdxConfig(_0x369b61){try{return findTdxConfig(_0x369b61);}catch{return null;}}function a165_0x22f2(_0xaa1604,_0x1c5dae){_0xaa1604=_0xaa1604-0x193;const _0x389859=a165_0x3898();let _0x22f295=_0x389859[_0xaa1604];return _0x22f295;}export function getSegmentRootDir(_0x25553c,_0x49d0db=process[a165_0x597a00(0x1aa)]()){return a165_0x122793['join'](_0x49d0db,SEGMENTS_DIR,_0x25553c);}export function getTdxConfigPath(_0x53cd16,_0x27feca=process[a165_0x597a00(0x1aa)]()){const _0x15cb99=a165_0x597a00;return a165_0x122793[_0x15cb99(0x19c)](getSegmentRootDir(_0x53cd16,_0x27feca),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x500b34,_0x50c34){const _0x41c947=a165_0x597a00,_0x1fc8d3=a165_0x122793[_0x41c947(0x195)](_0x500b34),_0x31f2e2=a165_0x122793[_0x41c947(0x1a7)](_0x50c34,_0x1fc8d3);if(_0x31f2e2[_0x41c947(0x19e)]('..'))return'';return _0x31f2e2;}export function localPathToTdFolderPath(_0x3f3020){const _0x29cb26=a165_0x597a00,_0x40523c=a165_0x122793['dirname'](_0x3f3020);if(_0x40523c==='.'||_0x40523c==='')return'';return _0x40523c[_0x29cb26(0x19b)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x85d8ff,_0x1ffd05){if(!_0x85d8ff)return _0x1ffd05;return a165_0x122793['join'](_0x1ffd05,_0x85d8ff);}export function createTdxConfigContent(_0x5d8f7a){const _0xf2f37d=a165_0x597a00,_0x19ac8e={'parent_segment':_0x5d8f7a};return JSON[_0xf2f37d(0x197)](_0x19ac8e,null,0x2)+'\x0a';}export function createEngageTdxConfigContent(_0x2c3943){const _0x2aeed5=a165_0x597a00,_0x40153f={'engage_workspace':_0x2c3943};return JSON[_0x2aeed5(0x197)](_0x40153f,null,0x2)+'\x0a';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a166_0xf58e3e=a166_0x5db8;(function(_0x2b7ecd,_0x35f366){const _0x41a88f=a166_0x5db8,_0x35c3e8=_0x2b7ecd();while(!![]){try{const _0x145119=-parseInt(_0x41a88f(0xf9))/0x1+-parseInt(_0x41a88f(0xea))/0x2*(-parseInt(_0x41a88f(0xe8))/0x3)+parseInt(_0x41a88f(0xed))/0x4*(parseInt(_0x41a88f(0xf2))/0x5)+-parseInt(_0x41a88f(0xf3))/0x6*(parseInt(_0x41a88f(0xef))/0x7)+-parseInt(_0x41a88f(0xd4))/0x8+parseInt(_0x41a88f(0xde))/0x9+parseInt(_0x41a88f(0xf8))/0xa*(parseInt(_0x41a88f(0xdd))/0xb);if(_0x145119===_0x35f366)break;else _0x35c3e8['push'](_0x35c3e8['shift']());}catch(_0xe4bbdb){_0x35c3e8['push'](_0x35c3e8['shift']());}}}(a166_0x21f3,0x1c932));import{z}from'zod';export const ScheduleTypeSchema=z[a166_0xf58e3e(0xdf)]([a166_0xf58e3e(0xec),a166_0xf58e3e(0xe0),a166_0xf58e3e(0xf0),'weekly',a166_0xf58e3e(0xe1),a166_0xf58e3e(0xfa),'minutes_interval']);function a166_0x5db8(_0x237785,_0x599214){_0x237785=_0x237785-0xd3;const _0x21f339=a166_0x21f3();let _0x5db88c=_0x21f339[_0x237785];return _0x5db88c;}function a166_0x21f3(){const _0x397bf5=['203RgqbYm','daily','day','4295NcCwUU','7944bWINPt','Top-N','Connection\x20name\x20is\x20required','month','asc','350JYklki','56472paodls','cron','onSuccess','nullable','minute','masked','1872120NySKkJ','boolean','string','object','All','desc','First','once','optional','6281PjYvxv','324657fpXiQM','enum','hourly','monthly','number','Activation\x20name\x20is\x20required','cols','union','min','hour','27471jGymtP','clear','42PXmuld','array','none','920qNKwrG','rows'];a166_0x21f3=function(){return _0x397bf5;};return a166_0x21f3();}export const RepeatUnitSchema=z[a166_0xf58e3e(0xdf)]([a166_0xf58e3e(0xfd),a166_0xf58e3e(0xe7),a166_0xf58e3e(0xf1),'week',a166_0xf58e3e(0xf6),a166_0xf58e3e(0xdb),a166_0xf58e3e(0xec)]);export const ScheduleDefSchema=z['object']({'type':ScheduleTypeSchema[a166_0xf58e3e(0xdc)](),'repeat_unit':RepeatUnitSchema[a166_0xf58e3e(0xdc)](),'repeat_frequency':z[a166_0xf58e3e(0xe2)]()[a166_0xf58e3e(0xdc)](),'repeat_sub_frequency':z[a166_0xf58e3e(0xeb)](z[a166_0xf58e3e(0xe2)]())[a166_0xf58e3e(0xdc)](),'start_at':z[a166_0xf58e3e(0xd6)]()['nullable']()[a166_0xf58e3e(0xdc)](),'end_on':z[a166_0xf58e3e(0xd6)]()[a166_0xf58e3e(0xfc)]()['optional'](),'timezone':z[a166_0xf58e3e(0xd6)]()['optional']()});export const NotificationDefSchema=z[a166_0xf58e3e(0xd7)]({'notify_on':z[a166_0xf58e3e(0xeb)](z['enum']([a166_0xf58e3e(0xfb),'onFailure']))[a166_0xf58e3e(0xdc)](),'email_recipients':z[a166_0xf58e3e(0xeb)](z[a166_0xf58e3e(0xd6)]())[a166_0xf58e3e(0xdc)]()});export const ActivationColumnDefSchema=z[a166_0xf58e3e(0xe5)]([z[a166_0xf58e3e(0xd6)](),z[a166_0xf58e3e(0xd7)]({'name':z[a166_0xf58e3e(0xd6)](),'type':z[a166_0xf58e3e(0xd6)]()[a166_0xf58e3e(0xdc)](),'visibility':z['enum'](['clear',a166_0xf58e3e(0xd3)])[a166_0xf58e3e(0xdc)]()})]);export const ActivationBehaviorDefSchema=z[a166_0xf58e3e(0xd7)]({'columns':z[a166_0xf58e3e(0xeb)](z[a166_0xf58e3e(0xd7)]({'name':z[a166_0xf58e3e(0xd6)](),'type':z[a166_0xf58e3e(0xd6)]()[a166_0xf58e3e(0xdc)](),'visibility':z[a166_0xf58e3e(0xdf)]([a166_0xf58e3e(0xe9),a166_0xf58e3e(0xd3)])[a166_0xf58e3e(0xdc)]()}))['optional'](),'behavior_table':z['string']()[a166_0xf58e3e(0xdc)](),'join_row':z[a166_0xf58e3e(0xe2)]()['nullable']()['optional'](),'join_strategy':z[a166_0xf58e3e(0xdf)]([a166_0xf58e3e(0xd8),a166_0xf58e3e(0xda),'Last',a166_0xf58e3e(0xf4)])[a166_0xf58e3e(0xdc)](),'formatting':z[a166_0xf58e3e(0xdf)]([a166_0xf58e3e(0xee),a166_0xf58e3e(0xe4)])[a166_0xf58e3e(0xdc)](),'order_by':z['array'](z['object']({'key':z['string'](),'order':z[a166_0xf58e3e(0xdf)]([a166_0xf58e3e(0xf7),a166_0xf58e3e(0xd9)])}))[a166_0xf58e3e(0xdc)]()});export const ActivationDefSchema=z[a166_0xf58e3e(0xd7)]({'name':z['string']()[a166_0xf58e3e(0xe6)](0x1,a166_0xf58e3e(0xe3)),'description':z['string']()[a166_0xf58e3e(0xdc)](),'connection':z['string']()[a166_0xf58e3e(0xe6)](0x1,a166_0xf58e3e(0xf5)),'all_columns':z[a166_0xf58e3e(0xd5)]()['optional'](),'columns':z[a166_0xf58e3e(0xeb)](ActivationColumnDefSchema)['optional'](),'schedule':ScheduleDefSchema[a166_0xf58e3e(0xdc)](),'notification':NotificationDefSchema[a166_0xf58e3e(0xdc)](),'connector_config':z['record'](z['string'](),z['unknown']())[a166_0xf58e3e(0xdc)](),'activation_template_id':z['string']()[a166_0xf58e3e(0xfc)]()[a166_0xf58e3e(0xdc)](),'behavior':ActivationBehaviorDefSchema[a166_0xf58e3e(0xfc)]()['optional'](),'run_after_journey_refresh':z['boolean']()[a166_0xf58e3e(0xdc)](),'nested_workflow_project_name':z['string']()[a166_0xf58e3e(0xdc)](),'nested_workflow_name':z[a166_0xf58e3e(0xd6)]()['optional'](),'lock_enabled':z[a166_0xf58e3e(0xd5)]()[a166_0xf58e3e(0xdc)]()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a167_0x41c1(){var _0x2dbfd9=['9daNYqS','40616SlZhgB','106278vWANQe','2007rkpfxS','23658690TyDDrQ','91uwlghR','8805PHRRnT','229020BbrcQP','4860600iDYywX','3801020dkhOvD','1780JhQZDx'];a167_0x41c1=function(){return _0x2dbfd9;};return a167_0x41c1();}function a167_0x576e(_0xf156c,_0x403d37){_0xf156c=_0xf156c-0xb0;var _0x41c152=a167_0x41c1();var _0x576e40=_0x41c152[_0xf156c];return _0x576e40;}(function(_0x249830,_0x3f92bf){var _0x1ba30a=a167_0x576e,_0x2947a4=_0x249830();while(!![]){try{var _0x3b4209=parseInt(_0x1ba30a(0xb0))/0x1*(parseInt(_0x1ba30a(0xb7))/0x2)+parseInt(_0x1ba30a(0xb6))/0x3*(-parseInt(_0x1ba30a(0xba))/0x4)+parseInt(_0x1ba30a(0xb9))/0x5+-parseInt(_0x1ba30a(0xb2))/0x6*(parseInt(_0x1ba30a(0xb5))/0x7)+parseInt(_0x1ba30a(0xb1))/0x8*(-parseInt(_0x1ba30a(0xb3))/0x9)+-parseInt(_0x1ba30a(0xb8))/0xa+parseInt(_0x1ba30a(0xb4))/0xb;if(_0x3b4209===_0x3f92bf)break;else _0x2947a4['push'](_0x2947a4['shift']());}catch(_0x4a5c2e){_0x2947a4['push'](_0x2947a4['shift']());}}}(a167_0x41c1,0xc0241));export{JourneyStateTypeSchema,ReentryModeTypeSchema,WaitUnitTypeSchema,StepTypeValueSchema,EmbeddedSegmentDefSchema,CriteriaDefSchema,StepDefSchema,StageDefSchema,JourneyEntryDefSchema,JourneyDefSchema}from'./journey-schema.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a168_0x4a0dce=a168_0x284e;function a168_0x204d(){const _0x3c76ce=['4622yNhSqv','type','launched','week','876570XrOxGv','filter','discriminatedUnion','stages','11470194ASLObh','passthrough','reentry_unless_goal_achieved','606856kTCUAF','string','draft','array','ab_test','33JxhIAD','journey','record','7rmdGiW','reentry_always','refine','decision_point','end','activation','12364264UjRTyl','lazy','object','merge','13535470aJkgli','boolean','enum','jump','Journey\x20name\x20is\x20required','Journey\x20must\x20have\x20exactly\x20one\x20of:\x20journeys,\x20stages,\x20or\x20versions','min','length','55eYQlZW','3646566URkYde','literal','journeys','optional','simulation','number','versions'];a168_0x204d=function(){return _0x3c76ce;};return a168_0x204d();}(function(_0x3fa521,_0x3b89fb){const _0x3887ae=a168_0x284e,_0x276857=_0x3fa521();while(!![]){try{const _0x16017e=parseInt(_0x3887ae(0x155))/0x1*(-parseInt(_0x3887ae(0x16f))/0x2)+-parseInt(_0x3887ae(0x152))/0x3*(-parseInt(_0x3887ae(0x14d))/0x4)+parseInt(_0x3887ae(0x167))/0x5*(-parseInt(_0x3887ae(0x146))/0x6)+-parseInt(_0x3887ae(0x168))/0x7+parseInt(_0x3887ae(0x15b))/0x8+parseInt(_0x3887ae(0x14a))/0x9+-parseInt(_0x3887ae(0x15f))/0xa;if(_0x16017e===_0x3b89fb)break;else _0x276857['push'](_0x276857['shift']());}catch(_0x597a5f){_0x276857['push'](_0x276857['shift']());}}}(a168_0x204d,0xf1faa));import{z}from'zod';import{RuleDefSchema}from'./segment-schema.js';import{ActivationDefSchema}from'./activation-schema.js';export const JourneyStateTypeSchema=z[a168_0x4a0dce(0x161)]([a168_0x4a0dce(0x14f),a168_0x4a0dce(0x16c),a168_0x4a0dce(0x171)]);export const ReentryModeTypeSchema=z[a168_0x4a0dce(0x161)](['no_reentry',a168_0x4a0dce(0x14c),a168_0x4a0dce(0x156)]);export const WaitUnitTypeSchema=z[a168_0x4a0dce(0x161)](['day',a168_0x4a0dce(0x145)]);export const StepTypeValueSchema=z[a168_0x4a0dce(0x161)](['wait',a168_0x4a0dce(0x15a),a168_0x4a0dce(0x158),a168_0x4a0dce(0x151),'merge',a168_0x4a0dce(0x162),a168_0x4a0dce(0x159)]);export const EmbeddedSegmentDefSchema=z[a168_0x4a0dce(0x15d)]({'description':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'rule':RuleDefSchema});const JumpTargetDefSchema=z[a168_0x4a0dce(0x15d)]({'journey':z[a168_0x4a0dce(0x14e)](),'stage':z[a168_0x4a0dce(0x14e)](),'bundle_id':z[a168_0x4a0dce(0x14e)]()['optional']()});export const CriteriaDefSchema=z[a168_0x4a0dce(0x15d)]({'name':z['string'](),'description':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'segment':z['string'](),'target':JumpTargetDefSchema[a168_0x4a0dce(0x16b)]()});const WaitConditionTimeoutDefSchema=z[a168_0x4a0dce(0x15d)]({'duration':z[a168_0x4a0dce(0x16d)](),'unit':WaitUnitTypeSchema,'next':z[a168_0x4a0dce(0x14e)]()['optional']()}),WaitConditionDefSchema=z[a168_0x4a0dce(0x15d)]({'segment':z[a168_0x4a0dce(0x14e)](),'next':z['string']()['optional'](),'timeout':WaitConditionTimeoutDefSchema[a168_0x4a0dce(0x16b)]()}),WaitStepParamsDefSchema=z[a168_0x4a0dce(0x15d)]({'duration':z[a168_0x4a0dce(0x16d)]()[a168_0x4a0dce(0x16b)](),'unit':WaitUnitTypeSchema[a168_0x4a0dce(0x16b)](),'wait_until':z[a168_0x4a0dce(0x14e)]()['optional'](),'condition':WaitConditionDefSchema[a168_0x4a0dce(0x16b)](),'days_of_week':z[a168_0x4a0dce(0x150)](z[a168_0x4a0dce(0x14e)]())[a168_0x4a0dce(0x16b)]()}),StepBaseFields={'name':z[a168_0x4a0dce(0x14e)](),'uuid':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'next':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)]()},WaitStepDefSchema=z[a168_0x4a0dce(0x15d)]({...StepBaseFields,'type':z[a168_0x4a0dce(0x169)]('wait'),'with':WaitStepParamsDefSchema}),ActivationStepParamsDefSchema=z[a168_0x4a0dce(0x15d)]({'activation':z['string']()}),ActivationStepDefSchema=z['object']({...StepBaseFields,'type':z[a168_0x4a0dce(0x169)](a168_0x4a0dce(0x15a)),'with':ActivationStepParamsDefSchema}),DecisionBranchDefSchema=z['object']({'name':z['string'](),'segment':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'segment_id':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'excluded':z[a168_0x4a0dce(0x160)]()[a168_0x4a0dce(0x16b)](),'next':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)]()}),DecisionPointStepParamsDefSchema=z['object']({'branches':z[a168_0x4a0dce(0x150)](DecisionBranchDefSchema)}),DecisionPointStepDefSchema=z[a168_0x4a0dce(0x15d)]({...StepBaseFields,'type':z[a168_0x4a0dce(0x169)](a168_0x4a0dce(0x158)),'with':DecisionPointStepParamsDefSchema}),AbTestVariantDefSchema=z[a168_0x4a0dce(0x15d)]({'id':z['string']()[a168_0x4a0dce(0x16b)](),'name':z[a168_0x4a0dce(0x14e)](),'percentage':z[a168_0x4a0dce(0x16d)](),'next':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)]()}),AbTestStepParamsDefSchema=z[a168_0x4a0dce(0x15d)]({'variants':z[a168_0x4a0dce(0x150)](AbTestVariantDefSchema),'unique_id':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'customized_split':z[a168_0x4a0dce(0x160)]()[a168_0x4a0dce(0x16b)]()}),AbTestStepDefSchema=z[a168_0x4a0dce(0x15d)]({...StepBaseFields,'type':z[a168_0x4a0dce(0x169)]('ab_test'),'with':AbTestStepParamsDefSchema}),MergeStepDefSchema=z[a168_0x4a0dce(0x15d)]({...StepBaseFields,'type':z[a168_0x4a0dce(0x169)](a168_0x4a0dce(0x15e))}),JumpStepParamsDefSchema=z['object']({'target':JumpTargetDefSchema}),JumpStepDefSchema=z['object']({...StepBaseFields,'type':z[a168_0x4a0dce(0x169)](a168_0x4a0dce(0x162)),'with':JumpStepParamsDefSchema}),EndStepDefSchema=z[a168_0x4a0dce(0x15d)]({...StepBaseFields,'type':z[a168_0x4a0dce(0x169)]('end')})[a168_0x4a0dce(0x14b)]();export const StepDefSchema=z[a168_0x4a0dce(0x148)](a168_0x4a0dce(0x170),[WaitStepDefSchema,ActivationStepDefSchema,DecisionPointStepDefSchema,AbTestStepDefSchema,MergeStepDefSchema,JumpStepDefSchema,EndStepDefSchema]);export const StageDefSchema=z['object']({'name':z['string'](),'description':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'id':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'entry_criteria':CriteriaDefSchema['optional'](),'exit_criteria':z[a168_0x4a0dce(0x150)](CriteriaDefSchema)[a168_0x4a0dce(0x16b)](),'milestone':CriteriaDefSchema[a168_0x4a0dce(0x16b)](),'root_step':z[a168_0x4a0dce(0x14e)]()['optional'](),'steps':z[a168_0x4a0dce(0x150)](StepDefSchema)['optional']()});function a168_0x284e(_0x7ee26d,_0x356187){_0x7ee26d=_0x7ee26d-0x145;const _0x204d2c=a168_0x204d();let _0x284e8e=_0x204d2c[_0x7ee26d];return _0x284e8e;}export const JourneyEntryDefSchema=z[a168_0x4a0dce(0x15d)]({'name':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'version':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'state':JourneyStateTypeSchema[a168_0x4a0dce(0x16b)](),'latest':z[a168_0x4a0dce(0x160)]()[a168_0x4a0dce(0x16b)](),'stages':z[a168_0x4a0dce(0x150)](StageDefSchema),'id':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'version_number':z[a168_0x4a0dce(0x16d)]()[a168_0x4a0dce(0x16b)](),'goal':CriteriaDefSchema[a168_0x4a0dce(0x16b)](),'reentry':ReentryModeTypeSchema['optional']()});export const JourneyDefSchema=z[a168_0x4a0dce(0x15c)](()=>z[a168_0x4a0dce(0x15d)]({'type':z[a168_0x4a0dce(0x169)](a168_0x4a0dce(0x153)),'name':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x165)](0x1,a168_0x4a0dce(0x163)),'description':z['string']()[a168_0x4a0dce(0x16b)](),'bundle_id':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'bundle_name':z['string']()['optional'](),'folder_id':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'reentry':ReentryModeTypeSchema['optional'](),'allow_reentry':z[a168_0x4a0dce(0x160)]()[a168_0x4a0dce(0x16b)](),'goal':CriteriaDefSchema[a168_0x4a0dce(0x16b)](),'id':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'version':z[a168_0x4a0dce(0x14e)]()[a168_0x4a0dce(0x16b)](),'version_number':z[a168_0x4a0dce(0x16d)]()['optional'](),'stages':z[a168_0x4a0dce(0x150)](StageDefSchema)[a168_0x4a0dce(0x16b)](),'versions':z[a168_0x4a0dce(0x150)](JourneyEntryDefSchema)[a168_0x4a0dce(0x16b)](),'journeys':z[a168_0x4a0dce(0x150)](JourneyEntryDefSchema)[a168_0x4a0dce(0x16b)](),'segments':z[a168_0x4a0dce(0x154)](z[a168_0x4a0dce(0x14e)](),EmbeddedSegmentDefSchema)['optional'](),'activations':z[a168_0x4a0dce(0x154)](z[a168_0x4a0dce(0x14e)](),ActivationDefSchema)['optional']()})[a168_0x4a0dce(0x157)](_0x40adde=>{const _0x5d20a9=a168_0x4a0dce,_0x217e00=[_0x40adde[_0x5d20a9(0x16a)],_0x40adde[_0x5d20a9(0x149)],_0x40adde[_0x5d20a9(0x16e)]][_0x5d20a9(0x147)](_0x30477c=>Array['isArray'](_0x30477c)&&_0x30477c[_0x5d20a9(0x166)]>0x0)[_0x5d20a9(0x166)];return _0x217e00===0x1;},{'message':a168_0x4a0dce(0x164)}));const _syncCheck1=!![],_syncCheck2=!![];void _syncCheck1,void _syncCheck2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a170_0x4154(){var _0x23d56f=['70316NKCEwp','5252373oDOYrU','8450491udpPxc','846529TQTmaR','1671192YohBLN','205COQCow','1792984IZoIIy','8axRlMN','6276078WekmRi'];a170_0x4154=function(){return _0x23d56f;};return a170_0x4154();}(function(_0x1e0a83,_0x524f7a){var _0x39fa68=a170_0x3776,_0x2e9c7a=_0x1e0a83();while(!![]){try{var _0x260bc6=-parseInt(_0x39fa68(0x141))/0x1+parseInt(_0x39fa68(0x144))/0x2+parseInt(_0x39fa68(0x142))/0x3+parseInt(_0x39fa68(0x147))/0x4*(-parseInt(_0x39fa68(0x143))/0x5)+-parseInt(_0x39fa68(0x146))/0x6+parseInt(_0x39fa68(0x140))/0x7*(parseInt(_0x39fa68(0x145))/0x8)+parseInt(_0x39fa68(0x13f))/0x9;if(_0x260bc6===_0x524f7a)break;else _0x2e9c7a['push'](_0x2e9c7a['shift']());}catch(_0x232171){_0x2e9c7a['push'](_0x2e9c7a['shift']());}}}(a170_0x4154,0x9a12d));function a170_0x3776(_0x423603,_0xad266c){_0x423603=_0x423603-0x13f;var _0x415415=a170_0x4154();var _0x3776f4=_0x415415[_0x423603];return _0x3776f4;}export{OperatorTypeSchema,TimeUnitSchema,AggregationTypeSchema,ArrayMatchingSchema,OperatorDefSchema,AggregationDefSchema,TimeWindowDefSchema,FilterColumnConditionDefSchema,FilterRuleDefSchema,ValueConditionDefSchema,BehaviorConditionDefSchema,ColumnConditionDefSchema,CompositeConditionDefSchema,SegmentRefConditionDefSchema,ConditionDefSchema,RuleDefSchema,SegmentDefSchema}from'./segment-schema.js';export{ScheduleTypeSchema,RepeatUnitSchema,ScheduleDefSchema,NotificationDefSchema,ActivationColumnDefSchema,ActivationBehaviorDefSchema,ActivationDefSchema}from'./activation-schema.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a171_0x129a8d=a171_0x362c;(function(_0x498664,_0x54a9c8){const _0x224c0a=a171_0x362c,_0x520dcd=_0x498664();while(!![]){try{const _0x2aa2c5=-parseInt(_0x224c0a(0xc0))/0x1+-parseInt(_0x224c0a(0xa7))/0x2+parseInt(_0x224c0a(0xba))/0x3+parseInt(_0x224c0a(0xcd))/0x4*(parseInt(_0x224c0a(0xe2))/0x5)+-parseInt(_0x224c0a(0xb1))/0x6*(parseInt(_0x224c0a(0xca))/0x7)+-parseInt(_0x224c0a(0xa9))/0x8+parseInt(_0x224c0a(0xd0))/0x9*(parseInt(_0x224c0a(0xad))/0xa);if(_0x2aa2c5===_0x54a9c8)break;else _0x520dcd['push'](_0x520dcd['shift']());}catch(_0x3d4181){_0x520dcd['push'](_0x520dcd['shift']());}}}(a171_0x2c90,0xf3418));import{z}from'zod';export const OperatorTypeSchema=z['enum'](['Equal','Greater',a171_0x129a8d(0xb4),'GreaterEqual',a171_0x129a8d(0xd2),'In','Between',a171_0x129a8d(0xd4),a171_0x129a8d(0xa0),a171_0x129a8d(0xdb),'TimeWithinNext',a171_0x129a8d(0xd8),a171_0x129a8d(0xa2),a171_0x129a8d(0xc7),a171_0x129a8d(0xe4)]);export const TimeUnitSchema=z['enum'](['second','minute','hour',a171_0x129a8d(0xc1),a171_0x129a8d(0xb3),a171_0x129a8d(0xab),a171_0x129a8d(0xd6)]);export const AggregationTypeSchema=z[a171_0x129a8d(0xc8)]([a171_0x129a8d(0xdd),a171_0x129a8d(0xeb),'Average',a171_0x129a8d(0xc3),a171_0x129a8d(0xcf),a171_0x129a8d(0xc2),'First','Last']);const TemporalValueSchema=z[a171_0x129a8d(0xaf)]([z[a171_0x129a8d(0xe0)]({'timestamp':z[a171_0x129a8d(0xae)]()}),z[a171_0x129a8d(0xe0)]({'last':z[a171_0x129a8d(0xaf)]([z[a171_0x129a8d(0xcb)](),z[a171_0x129a8d(0xe6)](z[a171_0x129a8d(0xae)](),z[a171_0x129a8d(0xcb)]())]),'unit':z[a171_0x129a8d(0xae)]()})]),OperatorValueSchema=z['union']([z[a171_0x129a8d(0xae)](),z['number'](),z[a171_0x129a8d(0xa8)](),TemporalValueSchema,z[a171_0x129a8d(0xdc)](z[a171_0x129a8d(0xaf)]([z['string'](),z[a171_0x129a8d(0xcb)](),z['boolean']()]))]),OPERATORS_REQUIRING_VALUE=new Set(['Equal',a171_0x129a8d(0xda),'GreaterEqual',a171_0x129a8d(0xb4),'LessEqual','In',a171_0x129a8d(0xd8),'StartWith',a171_0x129a8d(0xc7),'Regexp','TimeWithinPast',a171_0x129a8d(0xea)]),OPERATORS_REQUIRING_UNIT=new Set([a171_0x129a8d(0xdb),'TimeWithinNext']);export const OperatorDefSchema=z['object']({'type':OperatorTypeSchema,'not':z[a171_0x129a8d(0xa8)]()[a171_0x129a8d(0xbd)](),'value':OperatorValueSchema[a171_0x129a8d(0xbd)](),'min':z[a171_0x129a8d(0xaf)]([z[a171_0x129a8d(0xcb)](),z[a171_0x129a8d(0xae)](),TemporalValueSchema])[a171_0x129a8d(0xbd)](),'max':z['union']([z[a171_0x129a8d(0xcb)](),z[a171_0x129a8d(0xae)](),TemporalValueSchema])[a171_0x129a8d(0xbd)](),'unit':TimeUnitSchema[a171_0x129a8d(0xbd)](),'duration':z['object']({'day':z[a171_0x129a8d(0xcb)]()['optional'](),'week':z['number']()[a171_0x129a8d(0xbd)](),'month':z['number']()[a171_0x129a8d(0xbd)](),'year':z['number']()[a171_0x129a8d(0xbd)](),'hour':z[a171_0x129a8d(0xcb)]()[a171_0x129a8d(0xbd)](),'minute':z[a171_0x129a8d(0xcb)]()[a171_0x129a8d(0xbd)](),'second':z['number']()[a171_0x129a8d(0xbd)]()})[a171_0x129a8d(0xbd)](),'from':z[a171_0x129a8d(0xe0)]({'last':z['union']([z[a171_0x129a8d(0xcb)](),z[a171_0x129a8d(0xae)]()]),'unit':TimeUnitSchema})[a171_0x129a8d(0xbd)](),'reverse':z[a171_0x129a8d(0xa8)]()['optional']()})['superRefine']((_0x44bd45,_0x1f1965)=>{const _0x5438ad=a171_0x129a8d;OPERATORS_REQUIRING_VALUE[_0x5438ad(0xcc)](_0x44bd45[_0x5438ad(0xe1)])&&(_0x44bd45[_0x5438ad(0xbb)]===undefined||_0x44bd45[_0x5438ad(0xbb)]===null)&&_0x1f1965[_0x5438ad(0xac)]({'code':'custom','message':_0x5438ad(0xb9)+_0x44bd45['type']+_0x5438ad(0xc9),'path':[_0x5438ad(0xbb)]}),_0x44bd45[_0x5438ad(0xe1)]==='Between'&&_0x44bd45[_0x5438ad(0xed)]===undefined&&_0x44bd45[_0x5438ad(0xdf)]===undefined&&_0x1f1965[_0x5438ad(0xac)]({'code':_0x5438ad(0xb8),'message':_0x5438ad(0xe9),'params':{'validationCode':_0x5438ad(0xce)}}),OPERATORS_REQUIRING_UNIT[_0x5438ad(0xcc)](_0x44bd45[_0x5438ad(0xe1)])&&_0x44bd45['value']!==undefined&&!_0x44bd45[_0x5438ad(0xb6)]&&_0x1f1965['addIssue']({'code':'custom','message':_0x5438ad(0xb9)+_0x44bd45['type']+_0x5438ad(0xd5),'path':[_0x5438ad(0xb6)],'params':{'validationCode':_0x5438ad(0xa5)}}),_0x44bd45[_0x5438ad(0xe1)]===_0x5438ad(0xe4)&&(!_0x44bd45[_0x5438ad(0xd3)]&&_0x1f1965['addIssue']({'code':_0x5438ad(0xb8),'message':_0x5438ad(0xe8),'path':[_0x5438ad(0xd3)]}),!_0x44bd45['from']&&_0x1f1965['addIssue']({'code':_0x5438ad(0xb8),'message':_0x5438ad(0xa4),'path':[_0x5438ad(0xb0)]}));});export const ArrayMatchingSchema=z[a171_0x129a8d(0xaf)]([z['literal'](a171_0x129a8d(0xc4)),z['literal'](a171_0x129a8d(0xee)),z['object']({'atLeast':z[a171_0x129a8d(0xcb)]()}),z[a171_0x129a8d(0xe0)]({'atMost':z[a171_0x129a8d(0xcb)]()}),z['object']({'exactly':z[a171_0x129a8d(0xcb)]()})]);export const AggregationDefSchema=z[a171_0x129a8d(0xc6)](a171_0x129a8d(0xe1),[z[a171_0x129a8d(0xe0)]({'type':z['enum']([a171_0x129a8d(0xeb),'Min',a171_0x129a8d(0xcf),a171_0x129a8d(0xbe)]),'column':z[a171_0x129a8d(0xae)](),'groupingColumns':z[a171_0x129a8d(0xdc)](z[a171_0x129a8d(0xae)]())['optional']()}),z[a171_0x129a8d(0xe0)]({'type':z[a171_0x129a8d(0xa1)]('Count'),'groupingColumns':z[a171_0x129a8d(0xdc)](z['string']())[a171_0x129a8d(0xbd)]()}),z[a171_0x129a8d(0xe0)]({'type':z[a171_0x129a8d(0xa1)]('CountDistinct'),'columns':z[a171_0x129a8d(0xdc)](z[a171_0x129a8d(0xae)]())}),z['object']({'type':z['enum']([a171_0x129a8d(0xe5),'Last']),'column':z[a171_0x129a8d(0xae)](),'orderColumn':z[a171_0x129a8d(0xae)](),'groupingColumns':z[a171_0x129a8d(0xdc)](z[a171_0x129a8d(0xae)]())['optional']()})]);export const TimeWindowDefSchema=z[a171_0x129a8d(0xe0)]({'duration':z[a171_0x129a8d(0xcb)](),'unit':TimeUnitSchema});const TIMESTAMP_OPERATORS=new Set([a171_0x129a8d(0xdb),a171_0x129a8d(0xea),a171_0x129a8d(0xe4)]);function a171_0x2c90(){const _0x21c21e=['year','Composite','Contain','Value','Greater','TimeWithinPast','array','Count','Behavior','max','object','type','335SijdVk','exclude','TimeRange','First','record','And','TimeRange\x20operator\x20requires\x20\x27duration\x27','Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','TimeWithinNext','Sum','Segment\x20name\x20is\x20required','min','all','IsNull','literal','StartWith','include','TimeRange\x20operator\x20requires\x20\x27from\x27','MISSING_TIME_UNIT','realtime','1847204HfJSrR','boolean','3242160zbeilr','Timestamp\x20column\x20only\x20supports\x20TimeWithinPast,\x20TimeWithinNext,\x20or\x20TimeRange\x20operators\x20(got\x20\x27','month','addIssue','33027770cMzTlv','string','union','from','3399468nAYeiC','Column','week','Less','lazy','unit','operator','custom','Operator\x20\x27','2541381bJqPnK','value','superRefine','optional','Average','\x27\x20is\x20only\x20valid\x20for\x20the\x20\x27timestamp\x27\x20column','741214tcxNSU','day','CountDistinct','Min','any','column','discriminatedUnion','EndWith','enum','\x27\x20requires\x20a\x20value','14ANvFKZ','number','has','2968hePgdv','MISSING_BETWEEN_BOUNDS','Max','9QKllWT','segment','LessEqual','duration','Regexp','\x27\x20requires\x20a\x20time\x20unit'];a171_0x2c90=function(){return _0x21c21e;};return a171_0x2c90();}export const FilterColumnConditionDefSchema=z[a171_0x129a8d(0xe0)]({'type':z['literal'](a171_0x129a8d(0xb2)),'column':z[a171_0x129a8d(0xae)](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema[a171_0x129a8d(0xbd)]()})[a171_0x129a8d(0xbc)]((_0x4669a1,_0x55747b)=>{const _0x541631=a171_0x129a8d,_0x125ffb=_0x4669a1[_0x541631(0xb7)][_0x541631(0xe1)];_0x4669a1[_0x541631(0xc5)]==='timestamp'?!TIMESTAMP_OPERATORS[_0x541631(0xcc)](_0x125ffb)&&_0x55747b[_0x541631(0xac)]({'code':_0x541631(0xb8),'message':_0x541631(0xaa)+_0x125ffb+'\x27)','path':[_0x541631(0xb7),_0x541631(0xe1)]}):TIMESTAMP_OPERATORS[_0x541631(0xcc)](_0x125ffb)&&_0x55747b['addIssue']({'code':_0x541631(0xb8),'message':_0x541631(0xb9)+_0x125ffb+_0x541631(0xbf),'path':['operator',_0x541631(0xe1)]});});export const FilterRuleDefSchema=z['object']({'type':z[a171_0x129a8d(0xa1)](a171_0x129a8d(0xe7)),'conditions':z[a171_0x129a8d(0xdc)](FilterColumnConditionDefSchema)});export const ValueConditionDefSchema=z[a171_0x129a8d(0xb5)](()=>z[a171_0x129a8d(0xe0)]({'type':z[a171_0x129a8d(0xa1)](a171_0x129a8d(0xd9)),'attribute':z['string'](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema[a171_0x129a8d(0xbd)](),'exclude':z[a171_0x129a8d(0xa8)]()[a171_0x129a8d(0xbd)](),'aggregation':AggregationDefSchema[a171_0x129a8d(0xbd)](),'source':z['string']()[a171_0x129a8d(0xbd)](),'filter':FilterRuleDefSchema[a171_0x129a8d(0xbd)](),'limit':z[a171_0x129a8d(0xcb)]()['optional']()}));export const BehaviorConditionDefSchema=z[a171_0x129a8d(0xb5)](()=>z[a171_0x129a8d(0xe0)]({'type':z[a171_0x129a8d(0xa1)](a171_0x129a8d(0xde)),'attribute':z['string'](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema[a171_0x129a8d(0xbd)](),'exclude':z['boolean']()['optional'](),'aggregation':AggregationDefSchema[a171_0x129a8d(0xbd)](),'source':z['string']()[a171_0x129a8d(0xbd)](),'filter':FilterRuleDefSchema[a171_0x129a8d(0xbd)](),'timeWindow':TimeWindowDefSchema['optional'](),'limit':z[a171_0x129a8d(0xcb)]()[a171_0x129a8d(0xbd)]()}));export const ColumnConditionDefSchema=z[a171_0x129a8d(0xe0)]({'type':z['literal'](a171_0x129a8d(0xb2)),'column':z['string'](),'operator':OperatorDefSchema});export const CompositeConditionDefSchema=z[a171_0x129a8d(0xb5)](()=>z['object']({'type':z[a171_0x129a8d(0xc8)](['And','Or',a171_0x129a8d(0xd7)]),'conditions':z[a171_0x129a8d(0xdc)](ConditionDefSchema),'description':z[a171_0x129a8d(0xae)]()[a171_0x129a8d(0xbd)](),'expr':z[a171_0x129a8d(0xae)]()['optional']()}));function a171_0x362c(_0x2424bc,_0x4dced6){_0x2424bc=_0x2424bc-0xa0;const _0x2c9047=a171_0x2c90();let _0x362c88=_0x2c9047[_0x2424bc];return _0x362c88;}export const SegmentRefConditionDefSchema=z[a171_0x129a8d(0xe0)]({'type':z[a171_0x129a8d(0xc8)]([a171_0x129a8d(0xa3),a171_0x129a8d(0xe3)]),'segment':z[a171_0x129a8d(0xae)]()['min'](0x1,'Segment\x20reference\x20must\x20not\x20be\x20empty')});export const ConditionDefSchema=z[a171_0x129a8d(0xb5)](()=>z[a171_0x129a8d(0xaf)]([ValueConditionDefSchema,BehaviorConditionDefSchema,ColumnConditionDefSchema,CompositeConditionDefSchema,SegmentRefConditionDefSchema]));export const RuleDefSchema=z[a171_0x129a8d(0xb5)](()=>z[a171_0x129a8d(0xe0)]({'type':z[a171_0x129a8d(0xc8)]([a171_0x129a8d(0xe7),'Or',a171_0x129a8d(0xd7)]),'conditions':z[a171_0x129a8d(0xdc)](ConditionDefSchema),'description':z[a171_0x129a8d(0xae)]()[a171_0x129a8d(0xbd)](),'expr':z['string']()[a171_0x129a8d(0xbd)]()}));export const SegmentDefSchema=z[a171_0x129a8d(0xe0)]({'type':z[a171_0x129a8d(0xa1)](a171_0x129a8d(0xd1))[a171_0x129a8d(0xbd)](),'name':z[a171_0x129a8d(0xae)]()[a171_0x129a8d(0xed)](0x1,a171_0x129a8d(0xec)),'description':z[a171_0x129a8d(0xae)]()[a171_0x129a8d(0xbd)](),'folder':z['string']()[a171_0x129a8d(0xbd)](),'rule':RuleDefSchema[a171_0x129a8d(0xbd)](),'kind':z[a171_0x129a8d(0xc8)](['batch',a171_0x129a8d(0xa6),'funnel_stage'])[a171_0x129a8d(0xbd)](),'visible':z[a171_0x129a8d(0xa8)]()[a171_0x129a8d(0xbd)](),'activations':z[a171_0x129a8d(0xdc)](z[a171_0x129a8d(0xc4)]())[a171_0x129a8d(0xbd)]()});const _syncCheck1=!![],_syncCheck2=!![];void _syncCheck1,void _syncCheck2;
|
|
1
|
+
const a171_0x171808=a171_0x2349;(function(_0x1f9748,_0x9cdc61){const _0x273439=a171_0x2349,_0x277ef1=_0x1f9748();while(!![]){try{const _0x21d832=-parseInt(_0x273439(0x160))/0x1+parseInt(_0x273439(0x194))/0x2+parseInt(_0x273439(0x17d))/0x3*(parseInt(_0x273439(0x164))/0x4)+parseInt(_0x273439(0x181))/0x5*(parseInt(_0x273439(0x18e))/0x6)+parseInt(_0x273439(0x16c))/0x7*(-parseInt(_0x273439(0x1a2))/0x8)+parseInt(_0x273439(0x1ab))/0x9+parseInt(_0x273439(0x19d))/0xa*(-parseInt(_0x273439(0x17c))/0xb);if(_0x21d832===_0x9cdc61)break;else _0x277ef1['push'](_0x277ef1['shift']());}catch(_0x5df272){_0x277ef1['push'](_0x277ef1['shift']());}}}(a171_0x5908,0xd4859));import{z}from'zod';export const OperatorTypeSchema=z[a171_0x171808(0x1ad)]([a171_0x171808(0x175),a171_0x171808(0x166),a171_0x171808(0x177),a171_0x171808(0x1a6),a171_0x171808(0x168),'In',a171_0x171808(0x182),a171_0x171808(0x190),'IsNull','TimeWithinPast','TimeWithinNext',a171_0x171808(0x197),'StartWith',a171_0x171808(0x159),a171_0x171808(0x18a)]);export const TimeUnitSchema=z[a171_0x171808(0x1ad)](['second',a171_0x171808(0x169),a171_0x171808(0x16d),a171_0x171808(0x174),a171_0x171808(0x191),'month',a171_0x171808(0x188)]);export const AggregationTypeSchema=z[a171_0x171808(0x1ad)](['Count',a171_0x171808(0x192),a171_0x171808(0x193),a171_0x171808(0x18b),a171_0x171808(0x15f),'CountDistinct',a171_0x171808(0x15d),'Last']);const TemporalValueSchema=z[a171_0x171808(0x187)]([z['object']({'timestamp':z[a171_0x171808(0x19c)]()}),z[a171_0x171808(0x15a)]({'last':z['union']([z['number'](),z[a171_0x171808(0x165)](z[a171_0x171808(0x19c)](),z[a171_0x171808(0x172)]())]),'unit':z[a171_0x171808(0x19c)]()})]),OperatorValueSchema=z['union']([z['string'](),z[a171_0x171808(0x172)](),z['boolean'](),TemporalValueSchema,z['array'](z[a171_0x171808(0x187)]([z[a171_0x171808(0x19c)](),z[a171_0x171808(0x172)](),z[a171_0x171808(0x15b)]()]))]),OPERATORS_REQUIRING_VALUE=new Set([a171_0x171808(0x175),a171_0x171808(0x166),a171_0x171808(0x1a6),a171_0x171808(0x177),a171_0x171808(0x168),'In',a171_0x171808(0x197),'StartWith',a171_0x171808(0x159),a171_0x171808(0x190),a171_0x171808(0x176),a171_0x171808(0x163)]),OPERATORS_REQUIRING_UNIT=new Set([a171_0x171808(0x176),'TimeWithinNext']);export const OperatorDefSchema=z[a171_0x171808(0x15a)]({'type':OperatorTypeSchema,'not':z[a171_0x171808(0x15b)]()[a171_0x171808(0x180)](),'value':OperatorValueSchema[a171_0x171808(0x180)](),'min':z['union']([z['number'](),z[a171_0x171808(0x19c)](),TemporalValueSchema])[a171_0x171808(0x180)](),'max':z[a171_0x171808(0x187)]([z['number'](),z[a171_0x171808(0x19c)](),TemporalValueSchema])[a171_0x171808(0x180)](),'unit':TimeUnitSchema[a171_0x171808(0x180)](),'duration':z[a171_0x171808(0x15a)]({'day':z['number']()[a171_0x171808(0x180)](),'week':z[a171_0x171808(0x172)]()[a171_0x171808(0x180)](),'month':z[a171_0x171808(0x172)]()['optional'](),'year':z[a171_0x171808(0x172)]()[a171_0x171808(0x180)](),'hour':z['number']()[a171_0x171808(0x180)](),'minute':z[a171_0x171808(0x172)]()['optional'](),'second':z['number']()['optional']()})[a171_0x171808(0x180)](),'from':z[a171_0x171808(0x15a)]({'last':z[a171_0x171808(0x187)]([z['number'](),z[a171_0x171808(0x19c)]()]),'unit':TimeUnitSchema})[a171_0x171808(0x180)](),'reverse':z['boolean']()[a171_0x171808(0x180)]()})[a171_0x171808(0x185)]((_0x4c3feb,_0x20081a)=>{const _0x2a2252=a171_0x171808;OPERATORS_REQUIRING_VALUE[_0x2a2252(0x1a3)](_0x4c3feb[_0x2a2252(0x1a7)])&&(_0x4c3feb[_0x2a2252(0x186)]===undefined||_0x4c3feb['value']===null)&&_0x20081a[_0x2a2252(0x183)]({'code':_0x2a2252(0x19e),'message':_0x2a2252(0x16b)+_0x4c3feb[_0x2a2252(0x1a7)]+_0x2a2252(0x19a),'path':[_0x2a2252(0x186)]}),_0x4c3feb['type']===_0x2a2252(0x182)&&_0x4c3feb[_0x2a2252(0x196)]===undefined&&_0x4c3feb[_0x2a2252(0x167)]===undefined&&_0x20081a['addIssue']({'code':'custom','message':_0x2a2252(0x170),'params':{'validationCode':_0x2a2252(0x162)}}),OPERATORS_REQUIRING_UNIT[_0x2a2252(0x1a3)](_0x4c3feb[_0x2a2252(0x1a7)])&&_0x4c3feb[_0x2a2252(0x186)]!==undefined&&!_0x4c3feb[_0x2a2252(0x18c)]&&_0x20081a[_0x2a2252(0x183)]({'code':_0x2a2252(0x19e),'message':_0x2a2252(0x16b)+_0x4c3feb[_0x2a2252(0x1a7)]+'\x27\x20requires\x20a\x20time\x20unit','path':[_0x2a2252(0x18c)],'params':{'validationCode':_0x2a2252(0x17f)}}),_0x4c3feb[_0x2a2252(0x1a7)]===_0x2a2252(0x18a)&&(!_0x4c3feb[_0x2a2252(0x15c)]&&_0x20081a[_0x2a2252(0x183)]({'code':'custom','message':_0x2a2252(0x16f),'path':[_0x2a2252(0x15c)]}),!_0x4c3feb[_0x2a2252(0x1a9)]&&_0x20081a[_0x2a2252(0x183)]({'code':_0x2a2252(0x19e),'message':_0x2a2252(0x16a),'path':[_0x2a2252(0x1a9)]}));});function a171_0x2349(_0x5dc9b8,_0x410e3a){_0x5dc9b8=_0x5dc9b8-0x159;const _0x5908bb=a171_0x5908();let _0x2349ad=_0x5908bb[_0x5dc9b8];return _0x2349ad;}export const ArrayMatchingSchema=z[a171_0x171808(0x187)]([z[a171_0x171808(0x17a)](a171_0x171808(0x1aa)),z['literal'](a171_0x171808(0x18f)),z[a171_0x171808(0x15a)]({'atLeast':z[a171_0x171808(0x172)]()}),z[a171_0x171808(0x15a)]({'atMost':z['number']()}),z[a171_0x171808(0x15a)]({'exactly':z[a171_0x171808(0x172)]()})]);export const AggregationDefSchema=z[a171_0x171808(0x179)]('type',[z[a171_0x171808(0x15a)]({'type':z['enum']([a171_0x171808(0x192),a171_0x171808(0x18b),a171_0x171808(0x15f),'Average']),'column':z[a171_0x171808(0x19c)](),'groupingColumns':z[a171_0x171808(0x17b)](z[a171_0x171808(0x19c)]())[a171_0x171808(0x180)]()}),z[a171_0x171808(0x15a)]({'type':z[a171_0x171808(0x17a)](a171_0x171808(0x1a5)),'groupingColumns':z['array'](z[a171_0x171808(0x19c)]())[a171_0x171808(0x180)]()}),z[a171_0x171808(0x15a)]({'type':z['literal'](a171_0x171808(0x199)),'columns':z['array'](z[a171_0x171808(0x19c)]())}),z['object']({'type':z[a171_0x171808(0x1ad)]([a171_0x171808(0x15d),a171_0x171808(0x198)]),'column':z['string'](),'orderColumn':z[a171_0x171808(0x19c)](),'groupingColumns':z[a171_0x171808(0x17b)](z[a171_0x171808(0x19c)]())[a171_0x171808(0x180)]()})]);export const TimeWindowDefSchema=z[a171_0x171808(0x15a)]({'duration':z[a171_0x171808(0x172)](),'unit':TimeUnitSchema});const TIMESTAMP_OPERATORS=new Set([a171_0x171808(0x176),a171_0x171808(0x163),'TimeRange']);export const FilterColumnConditionDefSchema=z[a171_0x171808(0x15a)]({'type':z['literal']('Column'),'column':z['string'](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema[a171_0x171808(0x180)]()})[a171_0x171808(0x185)]((_0x1b0549,_0x533658)=>{const _0x37120e=a171_0x171808,_0xbb8a6c=_0x1b0549[_0x37120e(0x15e)]['type'];_0x1b0549[_0x37120e(0x16e)]===_0x37120e(0x1a1)?!TIMESTAMP_OPERATORS['has'](_0xbb8a6c)&&_0x533658[_0x37120e(0x183)]({'code':_0x37120e(0x19e),'message':_0x37120e(0x171)+_0xbb8a6c+'\x27)','path':[_0x37120e(0x15e),_0x37120e(0x1a7)]}):TIMESTAMP_OPERATORS['has'](_0xbb8a6c)&&_0x533658[_0x37120e(0x183)]({'code':_0x37120e(0x19e),'message':_0x37120e(0x16b)+_0xbb8a6c+_0x37120e(0x189),'path':['operator',_0x37120e(0x1a7)]});});export const FilterRuleDefSchema=z[a171_0x171808(0x15a)]({'type':z['literal'](a171_0x171808(0x17e)),'conditions':z['array'](FilterColumnConditionDefSchema)});export const ValueConditionDefSchema=z[a171_0x171808(0x19b)](()=>z[a171_0x171808(0x15a)]({'type':z[a171_0x171808(0x17a)](a171_0x171808(0x1ac)),'attribute':z[a171_0x171808(0x19c)](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema[a171_0x171808(0x180)](),'exclude':z[a171_0x171808(0x15b)]()[a171_0x171808(0x180)](),'aggregation':AggregationDefSchema[a171_0x171808(0x180)](),'source':z[a171_0x171808(0x19c)]()['optional'](),'filter':FilterRuleDefSchema['optional'](),'limit':z['number']()[a171_0x171808(0x180)]()}));export const BehaviorConditionDefSchema=z[a171_0x171808(0x19b)](()=>z[a171_0x171808(0x15a)]({'type':z[a171_0x171808(0x17a)](a171_0x171808(0x184)),'attribute':z['string'](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema[a171_0x171808(0x180)](),'exclude':z[a171_0x171808(0x15b)]()[a171_0x171808(0x180)](),'aggregation':AggregationDefSchema[a171_0x171808(0x180)](),'source':z['string']()[a171_0x171808(0x180)](),'filter':FilterRuleDefSchema[a171_0x171808(0x180)](),'timeWindow':TimeWindowDefSchema[a171_0x171808(0x180)](),'limit':z[a171_0x171808(0x172)]()[a171_0x171808(0x180)]()}));function a171_0x5908(){const _0x3e100e=['\x27\x20is\x20only\x20valid\x20for\x20the\x20\x27timestamp\x27\x20column','TimeRange','Min','unit','segment','30VNxJov','all','Regexp','week','Sum','Average','2078398oruPHi','realtime','min','Contain','Last','CountDistinct','\x27\x20requires\x20a\x20value','lazy','string','1076690cMrByg','custom','Segment\x20name\x20is\x20required','Composite','timestamp','69016ganOeT','has','Column','Count','GreaterEqual','type','batch','from','any','6099192pxpiYZ','Value','enum','EndWith','object','boolean','duration','First','operator','Max','178054Tgwtvo','Segment\x20reference\x20must\x20not\x20be\x20empty','MISSING_BETWEEN_BOUNDS','TimeWithinNext','752YhWZOk','record','Greater','max','LessEqual','minute','TimeRange\x20operator\x20requires\x20\x27from\x27','Operator\x20\x27','140KcuFwg','hour','column','TimeRange\x20operator\x20requires\x20\x27duration\x27','Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','Timestamp\x20column\x20only\x20supports\x20TimeWithinPast,\x20TimeWithinNext,\x20or\x20TimeRange\x20operators\x20(got\x20\x27','number','include','day','Equal','TimeWithinPast','Less','funnel_stage','discriminatedUnion','literal','array','319TjpLgz','15072voPxeN','And','MISSING_TIME_UNIT','optional','1682085wTwGzO','Between','addIssue','Behavior','superRefine','value','union','year'];a171_0x5908=function(){return _0x3e100e;};return a171_0x5908();}export const ColumnConditionDefSchema=z[a171_0x171808(0x15a)]({'type':z['literal'](a171_0x171808(0x1a4)),'column':z[a171_0x171808(0x19c)](),'operator':OperatorDefSchema});export const CompositeConditionDefSchema=z[a171_0x171808(0x19b)](()=>z[a171_0x171808(0x15a)]({'type':z[a171_0x171808(0x1ad)]([a171_0x171808(0x17e),'Or',a171_0x171808(0x1a0)]),'conditions':z[a171_0x171808(0x17b)](ConditionDefSchema),'description':z[a171_0x171808(0x19c)]()[a171_0x171808(0x180)](),'expr':z['string']()[a171_0x171808(0x180)]()}));export const SegmentRefConditionDefSchema=z[a171_0x171808(0x15a)]({'type':z['enum']([a171_0x171808(0x173),'exclude']),'segment':z[a171_0x171808(0x19c)]()['min'](0x1,a171_0x171808(0x161))});export const ConditionDefSchema=z[a171_0x171808(0x19b)](()=>z[a171_0x171808(0x187)]([ValueConditionDefSchema,BehaviorConditionDefSchema,ColumnConditionDefSchema,CompositeConditionDefSchema,SegmentRefConditionDefSchema]));export const RuleDefSchema=z[a171_0x171808(0x19b)](()=>z[a171_0x171808(0x15a)]({'type':z['enum'](['And','Or','Composite']),'conditions':z[a171_0x171808(0x17b)](ConditionDefSchema),'description':z[a171_0x171808(0x19c)]()[a171_0x171808(0x180)](),'expr':z[a171_0x171808(0x19c)]()[a171_0x171808(0x180)]()}));export const SegmentDefSchema=z[a171_0x171808(0x15a)]({'type':z['literal'](a171_0x171808(0x18d))['optional'](),'name':z['string']()[a171_0x171808(0x196)](0x1,a171_0x171808(0x19f)),'description':z[a171_0x171808(0x19c)]()[a171_0x171808(0x180)](),'folder':z[a171_0x171808(0x19c)]()[a171_0x171808(0x180)](),'rule':RuleDefSchema[a171_0x171808(0x180)](),'kind':z['enum']([a171_0x171808(0x1a8),a171_0x171808(0x195),a171_0x171808(0x178)])[a171_0x171808(0x180)](),'visible':z[a171_0x171808(0x15b)]()['optional'](),'activations':z[a171_0x171808(0x17b)](z[a171_0x171808(0x1aa)]())[a171_0x171808(0x180)]()});const _syncCheck1=!![],_syncCheck2=!![];void _syncCheck1,void _syncCheck2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a172_0x1eb60c=a172_0x54ae;function a172_0x2596(){const _0x5379bb=['42728sefOxl','YAML\x20parse\x20error:\x20','result','template','push','type','campaign','filterType','63aWjdJf','error','length','object','3177620WtNTNk','skipped','segment','11790caQSFi','2560608oMYatp','22518nmtAvA','385rFipBq','772595VkYTWf','100008lkplzb','email','utf-8','YAML_PARSE_ERROR','valid','1003850obOxkO','message','relative','Failed\x20to\x20parse\x20YAML\x20file\x20(empty\x20or\x20invalid)','not\x20a\x20','warnings','journey','campaign_type','has'];a172_0x2596=function(){return _0x5379bb;};return a172_0x2596();}(function(_0x505bcd,_0x1934ef){const _0x19fe57=a172_0x54ae,_0x3287ff=_0x505bcd();while(!![]){try{const _0x1dfeb1=-parseInt(_0x19fe57(0x128))/0x1+parseInt(_0x19fe57(0x131))/0x2*(-parseInt(_0x19fe57(0x117))/0x3)+-parseInt(_0x19fe57(0x11b))/0x4+-parseInt(_0x19fe57(0x122))/0x5+-parseInt(_0x19fe57(0x11f))/0x6+-parseInt(_0x19fe57(0x121))/0x7*(-parseInt(_0x19fe57(0x123))/0x8)+-parseInt(_0x19fe57(0x120))/0x9*(-parseInt(_0x19fe57(0x11e))/0xa);if(_0x1dfeb1===_0x1934ef)break;else _0x3287ff['push'](_0x3287ff['shift']());}catch(_0x1c2fed){_0x3287ff['push'](_0x3287ff['shift']());}}}(a172_0x2596,0xc590b));import{readFileSync}from'fs';import*as a172_0x2ea033 from'path';import*as a172_0xbdbee8 from'yaml';import{validateSegmentDef}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';import{validateCampaignDef}from'../engage/campaign-validator.js';import{validateTemplateDef}from'../engage/template-validator.js';import{isJourneyDef}from'./journey-yaml.js';const VALID_CAMPAIGN_TYPES=new Set([a172_0x1eb60c(0x124),a172_0x1eb60c(0x135)]);export{isJourneyDef};export function isCampaignDef(_0x530f60){const _0x4186d7=a172_0x1eb60c;if(typeof _0x530f60!==_0x4186d7(0x11a)||_0x530f60===null)return![];const _0x111e91=_0x530f60,_0x1ba058=VALID_CAMPAIGN_TYPES[_0x4186d7(0x130)](_0x111e91[_0x4186d7(0x12f)]);if(_0x111e91['type']===_0x4186d7(0x115)&&_0x1ba058)return!![];if(_0x1ba058&&!_0x111e91[_0x4186d7(0x114)])return!![];return![];}export function isTemplateDef(_0x3aa217){const _0x5bfd50=a172_0x1eb60c;return typeof _0x3aa217===_0x5bfd50(0x11a)&&_0x3aa217!==null&&_0x5bfd50(0x114)in _0x3aa217&&_0x3aa217[_0x5bfd50(0x114)]==='template';}export function isValidationResult(_0x1f960b){const _0x4f2eab=a172_0x1eb60c;return!(_0x4f2eab(0x11c)in _0x1f960b);}export function createParseErrorResult(_0x4acb18,_0x4b17ac,_0x584c0f,_0x1d4404,_0x22ecfe=a172_0x1eb60c(0x11d)){const _0x3d8199=a172_0x1eb60c;return{'filePath':_0x4acb18,'relativePath':_0x4b17ac,'source':_0x584c0f,'result':{'valid':![],'errors':[{'level':_0x3d8199(0x118),'path':'','code':_0x3d8199(0x126),'message':_0x1d4404}],'warnings':[]},'fileType':_0x22ecfe};}export function validateYamlFile(_0x3c4b85,_0x5b8a38,_0x207d34={}){const _0x5c9f5b=a172_0x1eb60c,_0x32d44f=a172_0x2ea033[_0x5c9f5b(0x12a)](_0x5b8a38,_0x3c4b85)||a172_0x2ea033['basename'](_0x3c4b85);try{const _0x2e53cb=readFileSync(_0x3c4b85,_0x5c9f5b(0x125)),_0x1d9fb3=a172_0xbdbee8['parseDocument'](_0x2e53cb),_0x3344d5=_0x1d9fb3['toJSON']();if(!_0x3344d5)return createParseErrorResult(_0x3c4b85,_0x32d44f,_0x2e53cb,_0x5c9f5b(0x12b));let _0x477bf0;if(isJourneyDef(_0x3344d5,_0x3c4b85))_0x477bf0=_0x5c9f5b(0x12e);else{if(isCampaignDef(_0x3344d5))_0x477bf0=_0x5c9f5b(0x115);else isTemplateDef(_0x3344d5)?_0x477bf0=_0x5c9f5b(0x134):_0x477bf0=_0x5c9f5b(0x11d);}if(_0x207d34[_0x5c9f5b(0x116)]&&_0x477bf0!==_0x207d34[_0x5c9f5b(0x116)])return{'filePath':_0x3c4b85,'relativePath':_0x32d44f,'skipped':!![],'reason':_0x5c9f5b(0x12c)+_0x207d34[_0x5c9f5b(0x116)]};const _0x50cbed={'source':_0x2e53cb,'document':_0x1d9fb3};let _0x42a67d;if(_0x477bf0==='journey')_0x42a67d=validateJourneyDef(_0x3344d5,_0x50cbed);else{if(_0x477bf0==='campaign')_0x42a67d=validateCampaignDef(_0x3344d5,_0x50cbed);else _0x477bf0===_0x5c9f5b(0x134)?_0x42a67d=validateTemplateDef(_0x3344d5,_0x50cbed):_0x42a67d=validateSegmentDef(_0x3344d5,_0x50cbed);}return{'filePath':_0x3c4b85,'relativePath':_0x32d44f,'source':_0x2e53cb,'result':_0x42a67d,'fileType':_0x477bf0};}catch(_0x361675){const _0x441958=_0x361675 instanceof Error?_0x361675[_0x5c9f5b(0x129)]:String(_0x361675);return createParseErrorResult(_0x3c4b85,_0x32d44f,'',_0x5c9f5b(0x132)+_0x441958);}}function a172_0x54ae(_0x189b56,_0x561a4e){_0x189b56=_0x189b56-0x114;const _0x259690=a172_0x2596();let _0x54ae51=_0x259690[_0x189b56];return _0x54ae51;}export function validateYamlFiles(_0xb3d81f,_0x46fe76,_0x5d1760={}){return _0xb3d81f['map'](_0x3f3841=>validateYamlFile(_0x3f3841,_0x46fe76,_0x5d1760));}export function calculateSummary(_0x589291){const _0x50cbb1=a172_0x1eb60c;let _0x311bb3=0x0,_0x11c5e6=0x0,_0x1c7a59=0x0,_0x223a24=0x0;for(const _0x190945 of _0x589291){if(!isValidationResult(_0x190945)){_0x223a24++;continue;}_0x190945['result'][_0x50cbb1(0x127)]?_0x311bb3++:_0x11c5e6++,_0x1c7a59+=_0x190945[_0x50cbb1(0x133)][_0x50cbb1(0x12d)][_0x50cbb1(0x119)];}return{'validCount':_0x311bb3,'invalidCount':_0x11c5e6,'warningCount':_0x1c7a59,'skippedCount':_0x223a24,'hasErrors':_0x11c5e6>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b4b8a,_0x1a269a){const _0x166839=a173_0x1879,_0x30f229=_0x4b4b8a();while(!![]){try{const _0xaae80b=-parseInt(_0x166839(0x9f))/0x1*(parseInt(_0x166839(0xa7))/0x2)+-parseInt(_0x166839(0xb3))/0x3+parseInt(_0x166839(0xb7))/0x4*(parseInt(_0x166839(0xc3))/0x5)+parseInt(_0x166839(0xc4))/0x6*(parseInt(_0x166839(0x9d))/0x7)+parseInt(_0x166839(0xa2))/0x8*(-parseInt(_0x166839(0xbf))/0x9)+parseInt(_0x166839(0xaf))/0xa*(-parseInt(_0x166839(0xa0))/0xb)+parseInt(_0x166839(0xa5))/0xc;if(_0xaae80b===_0x1a269a)break;else _0x30f229['push'](_0x30f229['shift']());}catch(_0x99c54e){_0x30f229['push'](_0x30f229['shift']());}}}(a173_0x5e2e,0x4e7f9));import*as a173_0x444834 from'yaml';import a173_0x4dd895 from'chalk';export{validateSegmentDef,validateRuleDef}from'./segment-validator.js';function a173_0x1879(_0x2d6958,_0x44bf3f){_0x2d6958=_0x2d6958-0x97;const _0x5e2e2b=a173_0x5e2e();let _0x187994=_0x5e2e2b[_0x2d6958];return _0x187994;}export function getLocationFromPath(_0x1ed0c1,_0x3a12a6,_0x45a5ac){const _0x20526e=a173_0x1879;if(!_0x1ed0c1||!_0x3a12a6)return undefined;try{let _0x350c55=_0x1ed0c1[_0x20526e(0xc7)](_0x45a5ac,!![]),_0x6e621f=[..._0x45a5ac];while((!_0x350c55||typeof _0x350c55!==_0x20526e(0xa3)||!(_0x20526e(0xb6)in _0x350c55)||!_0x350c55['range'])&&_0x6e621f[_0x20526e(0xae)]>0x0){_0x6e621f[_0x20526e(0xa1)](),_0x350c55=_0x6e621f['length']>0x0?_0x1ed0c1[_0x20526e(0xc7)](_0x6e621f,!![]):_0x1ed0c1[_0x20526e(0xa8)];}if(!_0x350c55||typeof _0x350c55!==_0x20526e(0xa3)||!(_0x20526e(0xb6)in _0x350c55)||!_0x350c55[_0x20526e(0xb6)])return undefined;const [_0x487392]=_0x350c55[_0x20526e(0xb6)];return offsetToLocation(_0x3a12a6,_0x487392);}catch{return undefined;}}export function offsetToLocation(_0x56734d,_0x49c728){const _0x392254=a173_0x1879;let _0x422380=0x1,_0x3acf4d=0x1;for(let _0x56704e=0x0;_0x56704e<_0x49c728&&_0x56704e<_0x56734d[_0x392254(0xae)];_0x56704e++){_0x56734d[_0x56704e]==='\x0a'?(_0x422380++,_0x3acf4d=0x1):_0x3acf4d++;}return{'line':_0x422380,'column':_0x3acf4d,'offset':_0x49c728};}export function pathToArray(_0x192bb6){const _0x13bad0=a173_0x1879;if(!_0x192bb6)return[];return _0x192bb6['split']('.')[_0x13bad0(0x9c)](_0x15d287=>{const _0x4d0913=_0x15d287['match'](/^(\w+)\[(\d+)\]$/);if(_0x4d0913)return[_0x4d0913[0x1],parseInt(_0x4d0913[0x2],0xa)];return[_0x15d287];});}export function formatZodPath(_0x582835){const _0xedd0e=a173_0x1879;let _0xf6a5a3='';for(const _0x32f929 of _0x582835){if(typeof _0x32f929===_0xedd0e(0xb4))_0xf6a5a3+='['+_0x32f929+']';else{const _0x1581b8=String(_0x32f929);_0xf6a5a3+=_0xf6a5a3?'.'+_0x1581b8:_0x1581b8;}}return _0xf6a5a3;}export function flattenZodIssues(_0x4eb334){const _0xe0a81d=a173_0x1879,_0x3911ed=[];for(const _0x2d30d0 of _0x4eb334){if(_0x2d30d0[_0xe0a81d(0xba)]===_0xe0a81d(0xa6)&&_0xe0a81d(0xc1)in _0x2d30d0){const _0x529fd2=_0x2d30d0[_0xe0a81d(0xc1)];let _0x244829=_0x529fd2[0x0]||[];for(const _0x4ea322 of _0x529fd2){_0x4ea322[_0xe0a81d(0xae)]<_0x244829[_0xe0a81d(0xae)]&&(_0x244829=_0x4ea322);}const _0x4738bf=_0x244829[_0xe0a81d(0xab)](_0x28dc95=>({..._0x28dc95,'path':[..._0x2d30d0['path'],..._0x28dc95['path']]}));_0x3911ed[_0xe0a81d(0x9e)](...flattenZodIssues(_0x4738bf));}else _0x3911ed[_0xe0a81d(0x9e)](_0x2d30d0);}return _0x3911ed;}export function safeParseYaml(_0x304f23,_0x3abdd7){const _0xa9377c=a173_0x1879,_0x5dbe7c=a173_0x444834[_0xa9377c(0x98)](_0x304f23);if(!_0x5dbe7c||typeof _0x5dbe7c!==_0xa9377c(0xa3))throw new Error('Invalid\x20YAML:\x20expected\x20an\x20object');const _0x284e7e=_0x3abdd7['safeParse'](_0x5dbe7c);if(!_0x284e7e[_0xa9377c(0xc8)]){const _0xb55d01=_0x284e7e[_0xa9377c(0xc6)][_0xa9377c(0xaa)][0x0],_0x37f39b=formatZodPath(_0xb55d01[_0xa9377c(0xc5)]);throw new Error(_0x37f39b?_0xa9377c(0x97)+_0x37f39b+_0xa9377c(0xb0)+_0xb55d01['message']:_0xa9377c(0xad)+_0xb55d01[_0xa9377c(0xac)]);}return _0x284e7e[_0xa9377c(0xb2)];}export function formatIssueWithContext(_0x53c1e3,_0x2dd47c,_0x41b9e6){const _0x2e488b=a173_0x1879,_0x317b93=[],_0x4ebe49=_0x53c1e3[_0x2e488b(0xa9)]===_0x2e488b(0xc6),_0x1b98ee=_0x4ebe49?a173_0x4dd895[_0x2e488b(0x9b)]:a173_0x4dd895[_0x2e488b(0xbc)],_0x326f1a=_0x4ebe49?a173_0x4dd895['red']:a173_0x4dd895[_0x2e488b(0xbc)],_0x2ed7a9=_0x41b9e6?a173_0x4dd895[_0x2e488b(0x99)](_0x41b9e6+':'):'';if(_0x53c1e3[_0x2e488b(0xbb)]){const _0x47bb7d=a173_0x4dd895['cyan'](_0x53c1e3[_0x2e488b(0xbb)][_0x2e488b(0xbd)]+':'+_0x53c1e3[_0x2e488b(0xbb)][_0x2e488b(0xb8)]);_0x317b93[_0x2e488b(0x9e)](''+_0x2ed7a9+_0x47bb7d+':\x20'+_0x1b98ee(_0x53c1e3[_0x2e488b(0xa9)])+'\x20'+_0x326f1a('['+_0x53c1e3[_0x2e488b(0xba)]+']'));}else _0x317b93[_0x2e488b(0x9e)](''+_0x2ed7a9+a173_0x4dd895[_0x2e488b(0xb5)](_0x53c1e3[_0x2e488b(0xc5)])+':\x20'+_0x1b98ee(_0x53c1e3[_0x2e488b(0xa9)])+'\x20'+_0x326f1a('['+_0x53c1e3['code']+']'));_0x317b93[_0x2e488b(0x9e)](_0x53c1e3[_0x2e488b(0xac)]);if(_0x53c1e3['location']&&_0x2dd47c){const _0x2e1cd6=_0x2dd47c[_0x2e488b(0x9a)]('\x0a'),{line:_0x3af34b,column:_0x11e502}=_0x53c1e3[_0x2e488b(0xbb)],_0x539eab=Math[_0x2e488b(0xc2)](0x1,_0x3af34b-0x1),_0x3d33d2=Math[_0x2e488b(0xb9)](_0x2e1cd6[_0x2e488b(0xae)],_0x3af34b+0x1);_0x317b93[_0x2e488b(0x9e)]('');for(let _0x55cf38=_0x539eab;_0x55cf38<=_0x3d33d2;_0x55cf38++){const _0x2390b1=_0x2e1cd6[_0x55cf38-0x1]||'',_0x134e68=a173_0x4dd895[_0x2e488b(0xb5)](_0x55cf38[_0x2e488b(0xbe)]()[_0x2e488b(0xa4)](0x4)),_0x4ddc1f=a173_0x4dd895[_0x2e488b(0xb5)]('\x20|\x20');if(_0x55cf38===_0x3af34b){_0x317b93[_0x2e488b(0x9e)]('\x20\x20'+_0x134e68+_0x4ddc1f+_0x1b98ee(_0x2390b1));const _0x4eab1b='\x20'[_0x2e488b(0xc0)](0x4+0x3+_0x11e502-0x1);_0x317b93[_0x2e488b(0x9e)]('\x20\x20'+_0x4eab1b+_0x1b98ee('^'));}else _0x317b93[_0x2e488b(0x9e)]('\x20\x20'+_0x134e68+_0x4ddc1f+a173_0x4dd895['dim'](_0x2390b1));}}return _0x317b93['join']('\x0a');}function a173_0x5e2e(){const _0x319665=['level','issues','map','message','YAML\x20validation\x20error:\x20','length','20lAZPzI','\x27:\x20','join','data','95241YBRRzX','number','dim','range','76uuavrV','column','min','code','location','yellow','line','toString','5031YBCiAz','repeat','errors','max','94035arkaeE','408498SiLWge','path','error','getIn','success','YAML\x20validation\x20error\x20at\x20\x27','parse','cyan','split','red','flatMap','21tLIwpa','push','130852AuQZxJ','2126069WguMtr','pop','2184vUEohY','object','padStart','5540532gnGhiE','invalid_union','2XHuGfP','contents'];a173_0x5e2e=function(){return _0x319665;};return a173_0x5e2e();}export function formatValidationResult(_0x4375eb,_0x281115,_0x2694f6){const _0x3c1cdb=a173_0x1879,_0x14ff2c=[];for(const _0x3cf9a4 of _0x4375eb['errors']){_0x14ff2c[_0x3c1cdb(0x9e)](formatIssueWithContext(_0x3cf9a4,_0x281115,_0x2694f6)),_0x14ff2c[_0x3c1cdb(0x9e)]('');}for(const _0x308d67 of _0x4375eb['warnings']){_0x14ff2c[_0x3c1cdb(0x9e)](formatIssueWithContext(_0x308d67,_0x281115,_0x2694f6)),_0x14ff2c['push']('');}return _0x14ff2c[_0x3c1cdb(0xb1)]('\x0a');}
|