@treasuredata/tdx 0.26.3 → 0.26.4
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/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/describe.js +1 -1
- package/dist/commands/engage-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/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-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/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-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/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/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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +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/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/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/personalization.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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.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/tree-formatter.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/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.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/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.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/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +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
|
-
const
|
|
1
|
+
const a110_0xed72ad=a110_0xe241;(function(_0x224003,_0x32ed17){const _0x82250f=a110_0xe241,_0x91fbf=_0x224003();while(!![]){try{const _0x4611ee=parseInt(_0x82250f(0x1f9))/0x1+parseInt(_0x82250f(0x1f1))/0x2+-parseInt(_0x82250f(0x200))/0x3+parseInt(_0x82250f(0x1eb))/0x4+-parseInt(_0x82250f(0x1e6))/0x5*(parseInt(_0x82250f(0x1f3))/0x6)+-parseInt(_0x82250f(0x1d8))/0x7+parseInt(_0x82250f(0x1d7))/0x8;if(_0x4611ee===_0x32ed17)break;else _0x91fbf['push'](_0x91fbf['shift']());}catch(_0x3b89d3){_0x91fbf['push'](_0x91fbf['shift']());}}}(a110_0x13f7,0xa1d06));export const DEFAULT_TIME_RANGE=a110_0xed72ad(0x207);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x3c636b,_0xffe122,_0xab735b){const _0x1eaa13=a110_0xed72ad,_0x46d9a5=_0xab735b&&_0xab735b[_0x1eaa13(0x1e4)]>0x0?_0xab735b[_0x1eaa13(0x1f5)](',\x20'):'*';return _0x1eaa13(0x1fb)+_0x46d9a5+_0x1eaa13(0x1f7)+_0x3c636b+'.'+_0xffe122+_0x1eaa13(0x1df);}export function generateMasterCountSQL(_0x573ff9){const _0x56fdfc=a110_0xed72ad,{database:_0x12e676,table:_0x4b23f1}=_0x573ff9[_0x56fdfc(0x211)];return _0x56fdfc(0x1d9)+_0x12e676+'.'+_0x4b23f1;}function a110_0xe241(_0x2ef8c2,_0x1094ee){_0x2ef8c2=_0x2ef8c2-0x1d7;const _0x13f7b0=a110_0x13f7();let _0xe24161=_0x13f7b0[_0x2ef8c2];return _0xe24161;}export function generateMasterSampleSQL(_0x16c861,_0x5dbd7a=0x5){const _0x26befb=a110_0xed72ad,{database:_0x44c47d,table:_0x2cb85c}=_0x16c861[_0x26befb(0x211)];return'SELECT\x20*\x20FROM\x20'+_0x44c47d+'.'+_0x2cb85c+'\x20LIMIT\x20'+_0x5dbd7a;}export function generateAttributeCoverageSQL(_0x40d2f7,_0x2b082f){const _0x45f030=a110_0xed72ad,_0x341661=_0x40d2f7[_0x45f030(0x211)];return(_0x45f030(0x1e1)+_0x341661[_0x45f030(0x20d)]+'.'+_0x341661[_0x45f030(0x1ee)]+_0x45f030(0x1ec)+_0x2b082f[_0x45f030(0x1dc)][_0x45f030(0x20d)]+'.'+_0x2b082f[_0x45f030(0x1dc)]['table']+_0x45f030(0x203)+_0x2b082f[_0x45f030(0x1f5)][_0x45f030(0x1db)]+_0x45f030(0x20e)+_0x2b082f[_0x45f030(0x1f5)][_0x45f030(0x1e0)]+_0x45f030(0x202)+_0x2b082f['join'][_0x45f030(0x1e0)]+_0x45f030(0x1e3))[_0x45f030(0x20f)]();}export function generateBehaviorStatsSQL(_0x3d8273,_0xef24f0,_0x4a64ca=DEFAULT_TIME_RANGE){const _0x48be72=a110_0xed72ad,_0x3b5cee=_0x3d8273[_0x48be72(0x211)];return('\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.'+_0xef24f0[_0x48be72(0x1f5)]['parent_key']+_0x48be72(0x206)+_0x3b5cee[_0x48be72(0x20d)]+'.'+_0x3b5cee[_0x48be72(0x1ee)]+'\x20m\x0aJOIN\x20'+_0xef24f0[_0x48be72(0x1dc)][_0x48be72(0x20d)]+'.'+_0xef24f0[_0x48be72(0x1dc)][_0x48be72(0x1ee)]+_0x48be72(0x209)+_0xef24f0[_0x48be72(0x1f5)][_0x48be72(0x1db)]+'\x20=\x20b.'+_0xef24f0[_0x48be72(0x1f5)][_0x48be72(0x1e0)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x4a64ca+_0x48be72(0x1ed))[_0x48be72(0x20f)]();}export function generateAttributeSampleSQL(_0x267a0a,_0x133d14,_0x33e9aa=0x5){const _0x27d84a=a110_0xed72ad,_0x5396ff=_0x267a0a['master'],_0x54908d=_0x133d14['join'][_0x27d84a(0x1db)],_0x257a1e=_0x133d14['columns']['map'](_0x56f882=>'a.'+_0x56f882[_0x27d84a(0x208)])[_0x27d84a(0x1f5)](',\x20');return(_0x27d84a(0x210)+_0x54908d+',\x20'+_0x257a1e+_0x27d84a(0x204)+_0x5396ff['database']+'.'+_0x5396ff[_0x27d84a(0x1ee)]+_0x27d84a(0x1f6)+_0x133d14[_0x27d84a(0x1dc)][_0x27d84a(0x20d)]+'.'+_0x133d14[_0x27d84a(0x1dc)][_0x27d84a(0x1ee)]+_0x27d84a(0x203)+_0x133d14[_0x27d84a(0x1f5)][_0x27d84a(0x1db)]+_0x27d84a(0x20e)+_0x133d14[_0x27d84a(0x1f5)][_0x27d84a(0x1e0)]+'\x0aLIMIT\x20'+_0x33e9aa+'\x0a')[_0x27d84a(0x20f)]();}export function generateBehaviorSampleSQL(_0x139e52,_0x126f8b,_0x3c505a=0x5,_0x341b8b=DEFAULT_TIME_RANGE){const _0x3e91bd=a110_0xed72ad,_0x47cb45=_0x139e52['master'],_0x3fbff8=_0x126f8b[_0x3e91bd(0x1f5)][_0x3e91bd(0x1db)];let _0x4713cf;if(_0x126f8b[_0x3e91bd(0x1ef)])_0x4713cf=_0x3e91bd(0x1fc);else _0x126f8b[_0x3e91bd(0x1f2)]&&_0x126f8b[_0x3e91bd(0x1f2)][_0x3e91bd(0x1e4)]>0x0?_0x4713cf=_0x126f8b['columns']['map'](_0x215f9f=>'b.'+_0x215f9f[_0x3e91bd(0x208)])[_0x3e91bd(0x1f5)](',\x20'):_0x4713cf=_0x3e91bd(0x1fc);return(_0x3e91bd(0x210)+_0x3fbff8+',\x20'+_0x4713cf+_0x3e91bd(0x204)+_0x47cb45[_0x3e91bd(0x20d)]+'.'+_0x47cb45[_0x3e91bd(0x1ee)]+_0x3e91bd(0x1f6)+_0x126f8b[_0x3e91bd(0x1dc)][_0x3e91bd(0x20d)]+'.'+_0x126f8b[_0x3e91bd(0x1dc)][_0x3e91bd(0x1ee)]+_0x3e91bd(0x209)+_0x126f8b[_0x3e91bd(0x1f5)][_0x3e91bd(0x1db)]+_0x3e91bd(0x1f4)+_0x126f8b[_0x3e91bd(0x1f5)]['child_key']+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x341b8b+_0x3e91bd(0x1e7)+_0x3c505a+'\x0a')[_0x3e91bd(0x20f)]();}function quoteIdentifier(_0x173559){const _0x566de1=a110_0xed72ad;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/['test'](_0x173559))return'\x22'+_0x173559[_0x566de1(0x1da)](/"/g,'\x22\x22')+'\x22';return _0x173559;}export function generateEnrichedSQL(_0x2dfed4,_0xb0116d=0x5){const _0x167d44=a110_0xed72ad,_0x57064b=_0x2dfed4[_0x167d44(0x211)],_0x3f56c2=_0x2dfed4['attributes']||[];if(_0x3f56c2[_0x167d44(0x1e4)]===0x0)return _0x167d44(0x205)+_0x57064b['database']+'.'+_0x57064b['table']+_0x167d44(0x20a)+_0xb0116d;const _0x38235e=[_0x167d44(0x1ea)],_0x24df76=[];return _0x3f56c2['forEach']((_0x139746,_0x470a0c)=>{const _0x240b84=_0x167d44,_0x3c0e5f='a'+_0x470a0c;_0x139746[_0x240b84(0x1f2)][_0x240b84(0x1fd)](_0x3fe550=>{const _0xd8dcdb=_0x240b84,_0x4cb9b9=quoteIdentifier(_0x3fe550[_0xd8dcdb(0x1fe)]||_0x3fe550['column']);_0x38235e['push'](_0x3c0e5f+'.'+_0x3fe550['column']+_0xd8dcdb(0x20c)+_0x4cb9b9);}),_0x24df76[_0x240b84(0x1ff)](_0x240b84(0x1e5)+_0x139746[_0x240b84(0x1dc)][_0x240b84(0x20d)]+'.'+_0x139746['source'][_0x240b84(0x1ee)]+'\x20'+_0x3c0e5f+_0x240b84(0x1e2)+_0x139746[_0x240b84(0x1f5)][_0x240b84(0x1db)]+_0x240b84(0x1dd)+_0x3c0e5f+'.'+_0x139746['join'][_0x240b84(0x1e0)]);}),(_0x167d44(0x212)+_0x38235e[_0x167d44(0x1f5)](',\x20')+_0x167d44(0x204)+_0x57064b['database']+'.'+_0x57064b[_0x167d44(0x1ee)]+_0x167d44(0x1fa)+_0x24df76['join']('\x0a')+'\x0aLIMIT\x20'+_0xb0116d+'\x0a')[_0x167d44(0x20f)]();}export function generateAttributeSchemaSQL(_0x14c8f7,_0x203729){const _0x3c64e4=a110_0xed72ad,_0x156ba7=_0x14c8f7[_0x3c64e4(0x211)],_0x479147=_0x203729['join'][_0x3c64e4(0x1db)],_0x50ad32=_0x203729[_0x3c64e4(0x1f2)][_0x3c64e4(0x1de)](_0x267878=>'a.'+_0x267878[_0x3c64e4(0x208)])[_0x3c64e4(0x1f5)](',\x20');return(_0x3c64e4(0x210)+_0x479147+',\x20'+_0x50ad32+'\x0aFROM\x20'+_0x156ba7[_0x3c64e4(0x20d)]+'.'+_0x156ba7[_0x3c64e4(0x1ee)]+_0x3c64e4(0x1f6)+_0x203729['source'][_0x3c64e4(0x20d)]+'.'+_0x203729[_0x3c64e4(0x1dc)][_0x3c64e4(0x1ee)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x203729[_0x3c64e4(0x1f5)][_0x3c64e4(0x1db)]+_0x3c64e4(0x20e)+_0x203729['join'][_0x3c64e4(0x1e0)]+_0x3c64e4(0x1e8))[_0x3c64e4(0x20f)]();}export function generateBehaviorSchemaSQL(_0x260660,_0x4bbcab){const _0x37fd82=a110_0xed72ad,_0x14c46e=_0x260660['master'],_0x35461f=_0x4bbcab[_0x37fd82(0x1f5)]['parent_key'];let _0x5a44c4;if(_0x4bbcab[_0x37fd82(0x1ef)])_0x5a44c4=_0x37fd82(0x1fc);else _0x4bbcab[_0x37fd82(0x1f2)]&&_0x4bbcab[_0x37fd82(0x1f2)][_0x37fd82(0x1e4)]>0x0?_0x5a44c4=_0x4bbcab[_0x37fd82(0x1f2)][_0x37fd82(0x1de)](_0x19b7dd=>'b.'+_0x19b7dd[_0x37fd82(0x208)])[_0x37fd82(0x1f5)](',\x20'):_0x5a44c4=_0x37fd82(0x1fc);return('\x0aSELECT\x20m.'+_0x35461f+',\x20'+_0x5a44c4+_0x37fd82(0x204)+_0x14c46e[_0x37fd82(0x20d)]+'.'+_0x14c46e['table']+'\x20m\x0aJOIN\x20'+_0x4bbcab[_0x37fd82(0x1dc)][_0x37fd82(0x20d)]+'.'+_0x4bbcab[_0x37fd82(0x1dc)][_0x37fd82(0x1ee)]+_0x37fd82(0x209)+_0x4bbcab[_0x37fd82(0x1f5)][_0x37fd82(0x1db)]+_0x37fd82(0x1f4)+_0x4bbcab['join'][_0x37fd82(0x1e0)]+_0x37fd82(0x1e8))[_0x37fd82(0x20f)]();}function a110_0x13f7(){const _0x22a75f=['toLowerCase','341905eaInyu','\x20m\x0a','SELECT\x20','b.*','forEach','label','push','577575TJuwtu','behaviors','\x0aWHERE\x20a.','\x20a\x0a\x20\x20ON\x20m.','\x0aFROM\x20','SELECT\x20*\x20FROM\x20',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','-1d','column','\x20b\x0a\x20\x20ON\x20m.','\x20LIMIT\x20','find','\x20AS\x20','database','\x20=\x20a.','trim','\x0aSELECT\x20m.','master','\x0aSELECT\x20','407592rboQZo','166418eyBIBd','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','replace','parent_key','source','\x20=\x20','map','\x20LIMIT\x200','child_key','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x0a\x20\x20ON\x20m.','\x20IS\x20NOT\x20NULL\x0a','length','LEFT\x20JOIN\x20','2140SZTCys','\x27)\x0aLIMIT\x20','\x0aLIMIT\x200\x0a','(all\x20columns)','m.*','933052QKUFnS','\x20m\x0aLEFT\x20JOIN\x20','\x27)\x0a','table','all_columns','name','2574896nGeYVE','columns','14502YPnoUa','\x20=\x20b.','join','\x20m\x0aJOIN\x20','\x20FROM\x20'];a110_0x13f7=function(){return _0x22a75f;};return a110_0x13f7();}export function getAttributeColumns(_0x59fd75){const _0x3656f0=a110_0xed72ad;return _0x59fd75[_0x3656f0(0x1f2)]['map'](_0x178e65=>({'label':_0x178e65['label']||_0x178e65[_0x3656f0(0x208)],'column':_0x178e65[_0x3656f0(0x208)]}));}export function getBehaviorColumns(_0x86826e){const _0x300d32=a110_0xed72ad;if(_0x86826e[_0x300d32(0x1ef)])return[{'label':_0x300d32(0x1e9),'column':'*'}];if(_0x86826e[_0x300d32(0x1f2)]&&_0x86826e[_0x300d32(0x1f2)][_0x300d32(0x1e4)]>0x0)return _0x86826e['columns']['map'](_0x12f25c=>({'label':_0x12f25c[_0x300d32(0x1fe)]||_0x12f25c[_0x300d32(0x208)],'column':_0x12f25c['column']}));return[{'label':_0x300d32(0x1e9),'column':'*'}];}export function findAttributeByName(_0x1c8484,_0x1dbdf6){const _0x572c79=a110_0xed72ad;return _0x1c8484['attributes']?.[_0x572c79(0x20b)](_0x11b4e2=>_0x11b4e2[_0x572c79(0x1f0)]['toLowerCase']()===_0x1dbdf6[_0x572c79(0x1f8)]());}export function findBehaviorByName(_0x178967,_0x252c3a){const _0x22296c=a110_0xed72ad;return _0x178967[_0x22296c(0x201)]?.['find'](_0x5c5412=>_0x5c5412[_0x22296c(0x1f0)][_0x22296c(0x1f8)]()===_0x252c3a['toLowerCase']());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x295d71,_0x2c5794){const _0x5207aa=a111_0x4dfa,_0x56c141=_0x295d71();while(!![]){try{const _0xf0ff4b=parseInt(_0x5207aa(0x1bc))/0x1*(parseInt(_0x5207aa(0x1e1))/0x2)+-parseInt(_0x5207aa(0x1be))/0x3*(-parseInt(_0x5207aa(0x19a))/0x4)+-parseInt(_0x5207aa(0x1db))/0x5+-parseInt(_0x5207aa(0x199))/0x6*(parseInt(_0x5207aa(0x1cc))/0x7)+-parseInt(_0x5207aa(0x1c9))/0x8+parseInt(_0x5207aa(0x1b6))/0x9*(parseInt(_0x5207aa(0x1cd))/0xa)+parseInt(_0x5207aa(0x195))/0xb*(parseInt(_0x5207aa(0x1cb))/0xc);if(_0xf0ff4b===_0x2c5794)break;else _0x56c141['push'](_0x56c141['shift']());}catch(_0xaae876){_0x56c141['push'](_0x56c141['shift']());}}}(a111_0x4809,0x4e1d4));import*as a111_0xadfd85 from'yaml';function a111_0x4dfa(_0x55f1a7,_0xc79905){_0x55f1a7=_0x55f1a7-0x17e;const _0x4809cc=a111_0x4809();let _0x4dfae8=_0x4809cc[_0x55f1a7];return _0x4dfae8;}function formatScheduleTime(_0x1b0262){const _0xb382b7=a111_0x4dfa;if(typeof _0x1b0262===_0xb382b7(0x1ce)){const _0x9fce63=Math['floor'](_0x1b0262);return String(_0x9fce63)['padStart'](0x2,'0')+_0xb382b7(0x18a);}if(typeof _0x1b0262===_0xb382b7(0x194)){if(/^\d{2}:\d{2}:\d{2}$/[_0xb382b7(0x17f)](_0x1b0262))return _0x1b0262;if(/^\d{1,2}:\d{2}$/[_0xb382b7(0x17f)](_0x1b0262)){const [_0x49de12,_0x4a663c]=_0x1b0262[_0xb382b7(0x1d0)](':');return _0x49de12[_0xb382b7(0x1e7)](0x2,'0')+':'+_0x4a663c+_0xb382b7(0x1c5);}const _0x4d2d9b=parseInt(_0x1b0262,0xa);if(!isNaN(_0x4d2d9b)&&_0x1b0262[_0xb382b7(0x1ed)](/^\d+$/))return String(_0x4d2d9b)['padStart'](0x2,'0')+_0xb382b7(0x18a);return _0x1b0262;}return String(_0x1b0262);}export function apiToDef(_0x520ffa){const _0x27f54b=a111_0x4dfa,_0x5ebfe4={'database':_0x520ffa[_0x27f54b(0x18e)]?.[_0x27f54b(0x1da)]||'','table':_0x520ffa['master']?.[_0x27f54b(0x183)]||''};_0x520ffa[_0x27f54b(0x1df)]&&_0x520ffa[_0x27f54b(0x1df)][_0x27f54b(0x1c0)]>0x0&&(_0x5ebfe4[_0x27f54b(0x18d)]=_0x520ffa[_0x27f54b(0x1df)][_0x27f54b(0x1a0)](_0xc01ff1=>({'column':_0xc01ff1['columnName'],'values':_0xc01ff1[_0x27f54b(0x180)]})));let _0x29f4a5;_0x520ffa[_0x27f54b(0x189)]&&_0x520ffa[_0x27f54b(0x189)]!==_0x27f54b(0x19c)&&(_0x29f4a5={'type':_0x520ffa[_0x27f54b(0x189)]},_0x520ffa[_0x27f54b(0x1c3)]&&(_0x29f4a5[_0x27f54b(0x187)]=formatScheduleTime(_0x520ffa[_0x27f54b(0x1c3)])),_0x520ffa['timezone']&&(_0x29f4a5[_0x27f54b(0x1c6)]=_0x520ffa[_0x27f54b(0x1c6)]));let _0x2bed94;(_0x520ffa[_0x27f54b(0x1ac)]||_0x520ffa[_0x27f54b(0x1bf)]||_0x520ffa[_0x27f54b(0x1b8)])&&(_0x2bed94={},_0x520ffa[_0x27f54b(0x1ac)]&&(_0x2bed94[_0x27f54b(0x1c4)]=_0x520ffa[_0x27f54b(0x1ac)]),_0x520ffa[_0x27f54b(0x1bf)]&&(_0x2bed94[_0x27f54b(0x1d4)]=_0x520ffa[_0x27f54b(0x1bf)]),_0x520ffa[_0x27f54b(0x1b8)]&&(_0x2bed94[_0x27f54b(0x1d6)]=_0x520ffa['prestoPoolName']));const _0x290027=_0x520ffa['attributes']&&_0x520ffa[_0x27f54b(0x1d8)][_0x27f54b(0x1c0)]>0x0?groupAttributesBySource(_0x520ffa[_0x27f54b(0x1d8)]):undefined,_0x103c2c=_0x520ffa['behaviors']&&_0x520ffa[_0x27f54b(0x1c2)][_0x27f54b(0x1c0)]>0x0?_0x520ffa[_0x27f54b(0x1c2)][_0x27f54b(0x1a0)](convertApiBehaviorToYaml):undefined;let _0xad8a43;_0x520ffa[_0x27f54b(0x1ec)]&&(_0xad8a43={'name':_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x1a9)],'source':{'database':_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x1da)],'table':_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x183)]},'join':{'parent_key':_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x1ab)],'child_key':_0x520ffa['customerGroup'][_0x27f54b(0x1a4)]}},_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x1ee)]&&_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x1ee)][_0x27f54b(0x1c0)]>0x0&&(_0xad8a43[_0x27f54b(0x1d8)]=groupAttributesBySource(_0x520ffa[_0x27f54b(0x1ec)]['customerGroupAttributes'])),_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x1d7)]&&_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x1d7)]['length']>0x0&&(_0xad8a43['behaviors']=_0x520ffa[_0x27f54b(0x1ec)][_0x27f54b(0x1d7)]['map'](convertApiBehaviorToYaml)));const _0x54a6d3={'name':_0x520ffa[_0x27f54b(0x1a9)],..._0x520ffa[_0x27f54b(0x1e4)]&&{'description':_0x520ffa[_0x27f54b(0x1e4)]},'master':_0x5ebfe4,..._0x29f4a5&&{'schedule':_0x29f4a5},..._0x2bed94&&{'engine':_0x2bed94},..._0x290027&&{'attributes':_0x290027},..._0x103c2c&&{'behaviors':_0x103c2c},..._0xad8a43&&{'customer_group':_0xad8a43}};return _0x54a6d3;}function groupAttributesBySource(_0x4a6cee){const _0x2e4830=a111_0x4dfa,_0x367ca5=new Map();for(const _0x37cd5c of _0x4a6cee){const _0x284449=_0x37cd5c[_0x2e4830(0x1da)]+'.'+_0x37cd5c[_0x2e4830(0x183)]+'.'+_0x37cd5c[_0x2e4830(0x1ab)]+'.'+_0x37cd5c['foreignKey'];!_0x367ca5[_0x2e4830(0x191)](_0x284449)&&_0x367ca5[_0x2e4830(0x1b1)](_0x284449,[]),_0x367ca5[_0x2e4830(0x1ae)](_0x284449)['push'](_0x37cd5c);}const _0x120ad0=[];for(const [,_0x4e0b9b]of _0x367ca5){const _0x1f62f8=_0x4e0b9b[0x0],_0x5b5b92=_0x1f62f8[_0x2e4830(0x1a3)]||_0x1f62f8[_0x2e4830(0x183)];_0x120ad0[_0x2e4830(0x1a5)]({'name':_0x5b5b92,'source':{'database':_0x1f62f8[_0x2e4830(0x1da)],'table':_0x1f62f8[_0x2e4830(0x183)]},'join':{'parent_key':_0x1f62f8[_0x2e4830(0x1ab)],'child_key':_0x1f62f8[_0x2e4830(0x1a4)]},'columns':_0x4e0b9b['map'](_0x50924f=>{const _0x3ab94e=_0x2e4830,_0x3aa10a={'column':_0x50924f[_0x3ab94e(0x1a1)],'type':_0x50924f[_0x3ab94e(0x1b7)]};return _0x50924f[_0x3ab94e(0x1a9)]!==_0x50924f[_0x3ab94e(0x1a1)]&&(_0x3aa10a[_0x3ab94e(0x1e6)]=_0x50924f[_0x3ab94e(0x1a9)]),_0x3aa10a;})});}return _0x120ad0;}function a111_0x4809(){const _0x5da278=['padStart','database','events_table','column_name','realtime.events[','customerGroup','match','customerGroupAttributes','customer_group','isRealtime','test','rightValues','schedule:','primary_key','parentTableName','table','values','realtime:','time','realtime','scheduleType',':00:00','join','all_columns','filters','master',']:\x20Missing\x20required\x20field\x20\x27name\x27','schema','has','YAML\x20config\x20missing\x20required\x20field:\x20master','):\x20Invalid\x20type\x20\x27','string','7359fSCqmh',']\x20(','behaviors:','allColumns','5256fxwWYP','253780rgIiYm','stringify','none','realtime.attributes[','YAML\x20config\x20missing\x20required\x20field:\x20master.database','attribute_table','map','parentColumn','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','groupingName','foreignKey','push','engine','schedule','master:','name','engine:','parentKey','workflowHiveOnly','daily','get','YAML\x20config\x20missing\x20required\x20field:\x20master.table','parent_key','set','personalization_services[','parse','\x27.\x20Must\x20be\x20one\x20of:\x20','isArray','9rjBHTV','type','prestoPoolName','forEach','source','id_stitching','1594CwoCaz','UTC','3GQgMKS','hivePoolName','length','03:00','behaviors','scheduleOption','hive_only',':00','timezone','single','user_id','1810416iSeiVL','replace','13788JxVGrN','3290ohAafS','4572210tDeVzP','number','events','split','customer_id','Parent\x20segment\x20description','Example\x20Attributes','hive_pool','child_key','trino_pool','customerGroupBehaviors','attributes','columns','parentDatabaseName','2063315ZexSrf','list','personalization_services','defaultTimeFilterEnabled','audienceFilters','default_time_filter','102copcGl','column','customer_group:','description','includes','label'];a111_0x4809=function(){return _0x5da278;};return a111_0x4809();}function convertApiBehaviorToYaml(_0xfd8993){const _0x3330a5=a111_0x4dfa,_0x406570={'name':_0xfd8993[_0x3330a5(0x1a9)],'source':{'database':_0xfd8993[_0x3330a5(0x1da)],'table':_0xfd8993[_0x3330a5(0x183)]},'join':{'parent_key':_0xfd8993['parentKey'],'child_key':_0xfd8993[_0x3330a5(0x1a4)]}};if(_0xfd8993[_0x3330a5(0x198)])_0x406570[_0x3330a5(0x18c)]=!![];else _0xfd8993[_0x3330a5(0x190)]&&_0xfd8993[_0x3330a5(0x190)][_0x3330a5(0x1c0)]>0x0&&(_0x406570[_0x3330a5(0x1d9)]=_0xfd8993[_0x3330a5(0x190)][_0x3330a5(0x1a0)](_0x30bc6e=>{const _0x561733=_0x3330a5,_0x13c0d5={'column':_0x30bc6e[_0x561733(0x1a1)],'type':_0x30bc6e[_0x561733(0x1b7)]};return _0x30bc6e[_0x561733(0x1a9)]!==_0x30bc6e[_0x561733(0x1a1)]&&(_0x13c0d5[_0x561733(0x1e6)]=_0x30bc6e[_0x561733(0x1a9)]),_0x13c0d5;}));return _0xfd8993[_0x3330a5(0x1de)]&&(_0x406570[_0x3330a5(0x1e0)]=_0xfd8993[_0x3330a5(0x1de)]),_0xfd8993[_0x3330a5(0x17e)]&&(_0x406570[_0x3330a5(0x188)]=_0xfd8993['isRealtime']),_0x406570;}export function defToApi(_0x1f7424){const _0x2bf215=a111_0x4dfa,_0x550d66={'name':_0x1f7424[_0x2bf215(0x1a9)],'master':{'parentDatabaseName':_0x1f7424[_0x2bf215(0x18e)][_0x2bf215(0x1e8)],'parentTableName':_0x1f7424['master'][_0x2bf215(0x184)]}};_0x1f7424[_0x2bf215(0x1e4)]&&(_0x550d66[_0x2bf215(0x1e4)]=_0x1f7424[_0x2bf215(0x1e4)]);_0x1f7424[_0x2bf215(0x18e)][_0x2bf215(0x18d)]&&_0x1f7424[_0x2bf215(0x18e)][_0x2bf215(0x18d)][_0x2bf215(0x1c0)]>0x0&&(_0x550d66['audienceFilters']=_0x1f7424[_0x2bf215(0x18e)][_0x2bf215(0x18d)][_0x2bf215(0x1a0)](_0x163129=>({'columnName':_0x163129['column'],'rightValues':_0x163129[_0x2bf215(0x185)]})));_0x1f7424[_0x2bf215(0x1a7)]&&(_0x550d66['scheduleType']=_0x1f7424[_0x2bf215(0x1a7)][_0x2bf215(0x1b7)],_0x1f7424[_0x2bf215(0x1a7)][_0x2bf215(0x187)]&&(_0x550d66[_0x2bf215(0x1c3)]=_0x1f7424[_0x2bf215(0x1a7)][_0x2bf215(0x187)]),_0x1f7424[_0x2bf215(0x1a7)][_0x2bf215(0x1c6)]&&(_0x550d66[_0x2bf215(0x1c6)]=_0x1f7424[_0x2bf215(0x1a7)][_0x2bf215(0x1c6)]));_0x1f7424[_0x2bf215(0x1a6)]&&(_0x1f7424[_0x2bf215(0x1a6)][_0x2bf215(0x1c4)]!==undefined&&(_0x550d66[_0x2bf215(0x1ac)]=_0x1f7424[_0x2bf215(0x1a6)][_0x2bf215(0x1c4)]),_0x1f7424[_0x2bf215(0x1a6)]['hive_pool']!==undefined&&(_0x550d66[_0x2bf215(0x1bf)]=_0x1f7424[_0x2bf215(0x1a6)][_0x2bf215(0x1d4)]),_0x1f7424[_0x2bf215(0x1a6)][_0x2bf215(0x1d6)]!==undefined&&(_0x550d66['prestoPoolName']=_0x1f7424[_0x2bf215(0x1a6)][_0x2bf215(0x1d6)]));_0x1f7424['attributes']&&_0x1f7424[_0x2bf215(0x1d8)][_0x2bf215(0x1c0)]>0x0&&(_0x550d66[_0x2bf215(0x1d8)]=flattenAttributeGroups(_0x1f7424[_0x2bf215(0x1d8)]));_0x1f7424['behaviors']&&_0x1f7424[_0x2bf215(0x1c2)][_0x2bf215(0x1c0)]>0x0&&(_0x550d66[_0x2bf215(0x1c2)]=_0x1f7424[_0x2bf215(0x1c2)]['map'](convertDefBehaviorToApi));if(_0x1f7424[_0x2bf215(0x1ef)]){const _0x545362=_0x1f7424['customer_group'];_0x550d66['customerGroup']={'name':_0x545362[_0x2bf215(0x1a9)],'parentDatabaseName':_0x545362['source'][_0x2bf215(0x1e8)],'parentTableName':_0x545362[_0x2bf215(0x1ba)][_0x2bf215(0x184)],'parentKey':_0x545362[_0x2bf215(0x18b)][_0x2bf215(0x1b0)],'foreignKey':_0x545362[_0x2bf215(0x18b)]['child_key']},_0x545362[_0x2bf215(0x1d8)]&&_0x545362['attributes']['length']>0x0&&(_0x550d66[_0x2bf215(0x1ec)]['customerGroupAttributes']=flattenAttributeGroups(_0x545362['attributes'])[_0x2bf215(0x1a0)](_0x96d5ed=>({'name':_0x96d5ed[_0x2bf215(0x1a9)],'type':_0x96d5ed[_0x2bf215(0x1b7)],'parentDatabaseName':_0x96d5ed['parentDatabaseName'],'parentTableName':_0x96d5ed['parentTableName'],'parentColumn':_0x96d5ed[_0x2bf215(0x1a1)],'parentKey':_0x96d5ed[_0x2bf215(0x1ab)],'foreignKey':_0x96d5ed[_0x2bf215(0x1a4)]}))),_0x545362['behaviors']&&_0x545362[_0x2bf215(0x1c2)][_0x2bf215(0x1c0)]>0x0&&(_0x550d66['customerGroup'][_0x2bf215(0x1d7)]=_0x545362[_0x2bf215(0x1c2)]['map'](_0x462f8b=>({'name':_0x462f8b['name'],'parentDatabaseName':_0x462f8b[_0x2bf215(0x1ba)][_0x2bf215(0x1e8)],'parentTableName':_0x462f8b[_0x2bf215(0x1ba)]['table'],'parentKey':_0x462f8b['join']['parent_key'],'foreignKey':_0x462f8b[_0x2bf215(0x18b)][_0x2bf215(0x1d5)],'allColumns':_0x462f8b['all_columns'],'schema':_0x462f8b['columns']?.['map'](_0x39fa35=>({'name':_0x39fa35[_0x2bf215(0x1e6)]||_0x39fa35[_0x2bf215(0x1e2)],'type':_0x39fa35[_0x2bf215(0x1b7)],'parentColumn':_0x39fa35[_0x2bf215(0x1e2)]}))})));}return _0x550d66;}function flattenAttributeGroups(_0x33a263){const _0x1942ab=a111_0x4dfa,_0x3b6bb8=[];for(const _0x2bebaa of _0x33a263){for(const _0x1c984c of _0x2bebaa[_0x1942ab(0x1d9)]){_0x3b6bb8[_0x1942ab(0x1a5)]({'name':_0x1c984c[_0x1942ab(0x1e6)]||_0x1c984c[_0x1942ab(0x1e2)],'type':_0x1c984c[_0x1942ab(0x1b7)],'parentDatabaseName':_0x2bebaa['source']['database'],'parentTableName':_0x2bebaa[_0x1942ab(0x1ba)][_0x1942ab(0x184)],'parentColumn':_0x1c984c['column'],'parentKey':_0x2bebaa[_0x1942ab(0x18b)][_0x1942ab(0x1b0)],'foreignKey':_0x2bebaa[_0x1942ab(0x18b)][_0x1942ab(0x1d5)],'groupingName':_0x2bebaa[_0x1942ab(0x1a9)]});}}return _0x3b6bb8;}function convertDefBehaviorToApi(_0x30150f){const _0x3b09b1=a111_0x4dfa,_0xf43af5={'name':_0x30150f[_0x3b09b1(0x1a9)],'parentDatabaseName':_0x30150f[_0x3b09b1(0x1ba)][_0x3b09b1(0x1e8)],'parentTableName':_0x30150f['source'][_0x3b09b1(0x184)],'parentKey':_0x30150f[_0x3b09b1(0x18b)][_0x3b09b1(0x1b0)],'foreignKey':_0x30150f[_0x3b09b1(0x18b)][_0x3b09b1(0x1d5)]};if(_0x30150f[_0x3b09b1(0x18c)])_0xf43af5[_0x3b09b1(0x198)]=!![];else _0x30150f[_0x3b09b1(0x1d9)]&&_0x30150f[_0x3b09b1(0x1d9)][_0x3b09b1(0x1c0)]>0x0&&(_0xf43af5['schema']=_0x30150f[_0x3b09b1(0x1d9)][_0x3b09b1(0x1a0)](_0x3af4ca=>({'name':_0x3af4ca['label']||_0x3af4ca[_0x3b09b1(0x1e2)],'type':_0x3af4ca[_0x3b09b1(0x1b7)],'parentColumn':_0x3af4ca['column']})));return _0x30150f[_0x3b09b1(0x1e0)]!==undefined&&(_0xf43af5['defaultTimeFilterEnabled']=_0x30150f[_0x3b09b1(0x1e0)]),_0x30150f['realtime']!==undefined&&(_0xf43af5[_0x3b09b1(0x17e)]=_0x30150f[_0x3b09b1(0x188)]),_0xf43af5;}export function serializeDef(_0x5758ef){const _0x4d8239=a111_0x4dfa,_0x4b4138=JSON['parse'](JSON[_0x4d8239(0x19b)](_0x5758ef)),_0x3d1ca3=a111_0xadfd85['stringify'](_0x4b4138,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x414642=[_0x4d8239(0x1a8),_0x4d8239(0x181),_0x4d8239(0x1aa),'attributes:',_0x4d8239(0x197),_0x4d8239(0x1e3),_0x4d8239(0x186),'personalization_services:'];let _0x6d3219=_0x3d1ca3;for(const _0x5b31fb of _0x414642){_0x6d3219=_0x6d3219[_0x4d8239(0x1ca)](new RegExp('^('+_0x5b31fb+')','m'),(_0x3eb69b,_0x3ab1a5,_0x2af6ef)=>{if(_0x2af6ef===0x0||_0x6d3219[_0x2af6ef-0x1]==='\x0a'&&_0x6d3219[_0x2af6ef-0x2]==='\x0a')return _0x3ab1a5;return'\x0a'+_0x3ab1a5;});}return _0x6d3219;}export function parseDef(_0x2406d7){const _0x11fc8d=a111_0x4dfa,_0xb70fbf=a111_0xadfd85[_0x11fc8d(0x1b3)](_0x2406d7);if(!_0xb70fbf[_0x11fc8d(0x1a9)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0xb70fbf[_0x11fc8d(0x18e)])throw new Error(_0x11fc8d(0x192));if(!_0xb70fbf[_0x11fc8d(0x18e)]['database'])throw new Error(_0x11fc8d(0x19e));if(!_0xb70fbf[_0x11fc8d(0x18e)]['table'])throw new Error(_0x11fc8d(0x1af));return _0xb70fbf[_0x11fc8d(0x188)]&&validateRealtimeSection(_0xb70fbf['realtime']),_0xb70fbf[_0x11fc8d(0x1dd)]&&validatePersonalizationServices(_0xb70fbf[_0x11fc8d(0x1dd)]),_0xb70fbf;}function validateRealtimeSection(_0x592a1f){const _0x553496=a111_0x4dfa,_0x4f5d53=[_0x553496(0x1c7),'counter',_0x553496(0x1b1),'ordered_set',_0x553496(0x1dc),'imported_batch'];_0x592a1f[_0x553496(0x1cf)]&&Array[_0x553496(0x1b5)](_0x592a1f[_0x553496(0x1cf)])&&_0x592a1f[_0x553496(0x1cf)][_0x553496(0x1b9)]((_0x219343,_0x37a45f)=>{const _0x44b6f7=_0x553496;if(!_0x219343[_0x44b6f7(0x1a9)])throw new Error(_0x44b6f7(0x1eb)+_0x37a45f+_0x44b6f7(0x18f));});_0x592a1f[_0x553496(0x1d8)]&&Array[_0x553496(0x1b5)](_0x592a1f[_0x553496(0x1d8)])&&_0x592a1f['attributes'][_0x553496(0x1b9)]((_0x202688,_0x1c2839)=>{const _0x3bc7ef=_0x553496;if(!_0x202688[_0x3bc7ef(0x1a9)])throw new Error(_0x3bc7ef(0x19d)+_0x1c2839+_0x3bc7ef(0x18f));if(_0x202688[_0x3bc7ef(0x1b7)]&&!_0x4f5d53[_0x3bc7ef(0x1e5)](_0x202688[_0x3bc7ef(0x1b7)]))throw new Error('realtime.attributes['+_0x1c2839+_0x3bc7ef(0x196)+_0x202688[_0x3bc7ef(0x1a9)]+_0x3bc7ef(0x193)+_0x202688['type']+_0x3bc7ef(0x1b4)+_0x4f5d53[_0x3bc7ef(0x18b)](',\x20'));});if(_0x592a1f[_0x553496(0x1bb)]){if(!_0x592a1f[_0x553496(0x1bb)][_0x553496(0x182)])throw new Error(_0x553496(0x1a2));}}function validatePersonalizationServices(_0x35e52c){const _0xa3a75c=a111_0x4dfa;if(!Array[_0xa3a75c(0x1b5)](_0x35e52c))throw new Error('personalization_services\x20must\x20be\x20an\x20array');_0x35e52c[_0xa3a75c(0x1b9)]((_0xe5e32a,_0x4b0efb)=>{const _0x4af748=_0xa3a75c;if(!_0xe5e32a[_0x4af748(0x1a9)])throw new Error(_0x4af748(0x1b2)+_0x4b0efb+']:\x20Missing\x20required\x20field\x20\x27name\x27');});}export function generateTemplate(_0x3c4be6,_0x489a66,_0x181e8a){const _0x126832=a111_0x4dfa,_0x2f8b8a={'name':_0x3c4be6,'description':_0x126832(0x1d2),'master':{'database':_0x489a66,'table':_0x181e8a},'schedule':{'type':_0x126832(0x1ad),'time':_0x126832(0x1c1),'timezone':_0x126832(0x1bd)},'attributes':[{'name':_0x126832(0x1d3),'source':{'database':_0x489a66,'table':_0x126832(0x19f)},'join':{'parent_key':'id','child_key':_0x126832(0x1d1)},'columns':[{'column':_0x126832(0x1ea),'label':'Display\x20Name','type':_0x126832(0x194)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x489a66,'table':_0x126832(0x1e9)},'join':{'parent_key':_0x126832(0x1c8),'child_key':_0x126832(0x1d1)},'all_columns':!![]}]};return serializeDef(_0x2f8b8a);}
|
|
1
|
+
(function(_0x41ab1c,_0x25fd4d){const _0xf9adc7=a111_0xd97b,_0x3a7904=_0x41ab1c();while(!![]){try{const _0xa7cd55=parseInt(_0xf9adc7(0xa5))/0x1*(parseInt(_0xf9adc7(0xd0))/0x2)+parseInt(_0xf9adc7(0xbe))/0x3*(parseInt(_0xf9adc7(0xc5))/0x4)+-parseInt(_0xf9adc7(0xbc))/0x5*(-parseInt(_0xf9adc7(0xa1))/0x6)+-parseInt(_0xf9adc7(0xce))/0x7*(parseInt(_0xf9adc7(0xcb))/0x8)+parseInt(_0xf9adc7(0x105))/0x9*(parseInt(_0xf9adc7(0xa0))/0xa)+parseInt(_0xf9adc7(0x10e))/0xb*(parseInt(_0xf9adc7(0x10c))/0xc)+parseInt(_0xf9adc7(0xe9))/0xd*(-parseInt(_0xf9adc7(0xf5))/0xe);if(_0xa7cd55===_0x25fd4d)break;else _0x3a7904['push'](_0x3a7904['shift']());}catch(_0x32692b){_0x3a7904['push'](_0x3a7904['shift']());}}}(a111_0x2ccc,0x42410));import*as a111_0x5459bf from'yaml';function formatScheduleTime(_0x228077){const _0x3f2e87=a111_0xd97b;if(typeof _0x228077==='number'){const _0x2ea985=Math[_0x3f2e87(0xd4)](_0x228077);return String(_0x2ea985)[_0x3f2e87(0xe8)](0x2,'0')+_0x3f2e87(0xa9);}if(typeof _0x228077==='string'){if(/^\d{2}:\d{2}:\d{2}$/[_0x3f2e87(0x111)](_0x228077))return _0x228077;if(/^\d{1,2}:\d{2}$/[_0x3f2e87(0x111)](_0x228077)){const [_0x3048d6,_0x34017b]=_0x228077[_0x3f2e87(0xaa)](':');return _0x3048d6['padStart'](0x2,'0')+':'+_0x34017b+':00';}const _0x5468c3=parseInt(_0x228077,0xa);if(!isNaN(_0x5468c3)&&_0x228077[_0x3f2e87(0xdf)](/^\d+$/))return String(_0x5468c3)['padStart'](0x2,'0')+':00:00';return _0x228077;}return String(_0x228077);}function a111_0x2ccc(){const _0x3efcba=['customer_group:','groupingName','database','realtime:','prestoPoolName','master','join','source','schema','YAML\x20config\x20missing\x20required\x20field:\x20master','realtime','personalization_services','type','single','customer_group','name','45QippJy','table','60nMfPuB','stringify','customerGroupAttributes','YAML\x20config\x20missing\x20required\x20field:\x20name','):\x20Invalid\x20type\x20\x27','events','engine','64744kfuunw','id_stitching','audienceFilters','schedule:','timezone','Example\x20Attributes','8KvXMgq','counter','description','223895zWnQND','personalization_services[','315122TZhVEG','column_name','set','string','floor','null','forEach','Display\x20Name','customerGroup','parentColumn','list','realtime.attributes[','all_columns','behaviors','get','match','master:','column','parent_key','behaviors:','03:00','length','isArray','engine:','padStart','832qRuhhL','default_time_filter','imported_batch','push','values','isRealtime','\x27.\x20Must\x20be\x20one\x20of:\x20','realtime.events[','parentDatabaseName','personalization_services:','scheduleType','trino_pool','177604bFqmal','schedule',']:\x20Missing\x20required\x20field\x20\x27name\x27','parentTableName','child_key','columnName','customer_id','hive_only','allColumns','YAML\x20config\x20missing\x20required\x20field:\x20master.table','personalization_services\x20must\x20be\x20an\x20array','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','label','customerGroupBehaviors','hivePoolName','primary_key','18NhXxyV','rightValues','attributes','YAML\x20config\x20missing\x20required\x20field:\x20master.database','daily','parse','scheduleOption','3468APZOZS','none','8074aKRurV','Parent\x20segment\x20description','Example\x20Events','test',']\x20(','hive_pool','parentKey','filters','columns','user_id','84200iyxLCg','270012aBRZgu','events_table','foreignKey','time','1hSwqWT','attribute_table','defaultTimeFilterEnabled','map',':00:00','split','workflowHiveOnly'];a111_0x2ccc=function(){return _0x3efcba;};return a111_0x2ccc();}export function apiToDef(_0xf2bbc2){const _0x5404bf=a111_0xd97b,_0x2730df={'database':_0xf2bbc2[_0x5404bf(0xb1)]?.['parentDatabaseName']||'','table':_0xf2bbc2['master']?.[_0x5404bf(0xf8)]||''};_0xf2bbc2[_0x5404bf(0xc7)]&&_0xf2bbc2['audienceFilters'][_0x5404bf(0xe5)]>0x0&&(_0x2730df[_0x5404bf(0x9d)]=_0xf2bbc2['audienceFilters'][_0x5404bf(0xa8)](_0x539501=>({'column':_0x539501[_0x5404bf(0xfa)],'values':_0x539501[_0x5404bf(0x106)]})));let _0x201762;_0xf2bbc2[_0x5404bf(0xf3)]&&_0xf2bbc2['scheduleType']!==_0x5404bf(0x10d)&&(_0x201762={'type':_0xf2bbc2[_0x5404bf(0xf3)]},_0xf2bbc2[_0x5404bf(0x10b)]&&(_0x201762[_0x5404bf(0xa4)]=formatScheduleTime(_0xf2bbc2[_0x5404bf(0x10b)])),_0xf2bbc2[_0x5404bf(0xc9)]&&(_0x201762['timezone']=_0xf2bbc2[_0x5404bf(0xc9)]));let _0x28c9aa;(_0xf2bbc2[_0x5404bf(0xab)]||_0xf2bbc2['hivePoolName']||_0xf2bbc2['prestoPoolName'])&&(_0x28c9aa={},_0xf2bbc2[_0x5404bf(0xab)]&&(_0x28c9aa[_0x5404bf(0xfc)]=_0xf2bbc2[_0x5404bf(0xab)]),_0xf2bbc2['hivePoolName']&&(_0x28c9aa[_0x5404bf(0x9b)]=_0xf2bbc2[_0x5404bf(0x103)]),_0xf2bbc2[_0x5404bf(0xb0)]&&(_0x28c9aa[_0x5404bf(0xf4)]=_0xf2bbc2[_0x5404bf(0xb0)]));const _0x489486=_0xf2bbc2['attributes']&&_0xf2bbc2[_0x5404bf(0x107)][_0x5404bf(0xe5)]>0x0?groupAttributesBySource(_0xf2bbc2[_0x5404bf(0x107)]):undefined,_0x489618=_0xf2bbc2[_0x5404bf(0xdd)]&&_0xf2bbc2[_0x5404bf(0xdd)][_0x5404bf(0xe5)]>0x0?_0xf2bbc2['behaviors'][_0x5404bf(0xa8)](convertApiBehaviorToYaml):undefined;let _0xb3ae83;_0xf2bbc2[_0x5404bf(0xd8)]&&(_0xb3ae83={'name':_0xf2bbc2[_0x5404bf(0xd8)][_0x5404bf(0xbb)],'source':{'database':_0xf2bbc2[_0x5404bf(0xd8)][_0x5404bf(0xf1)],'table':_0xf2bbc2['customerGroup']['parentTableName']},'join':{'parent_key':_0xf2bbc2[_0x5404bf(0xd8)]['parentKey'],'child_key':_0xf2bbc2[_0x5404bf(0xd8)][_0x5404bf(0xa3)]}},_0xf2bbc2[_0x5404bf(0xd8)][_0x5404bf(0xc0)]&&_0xf2bbc2[_0x5404bf(0xd8)][_0x5404bf(0xc0)][_0x5404bf(0xe5)]>0x0&&(_0xb3ae83[_0x5404bf(0x107)]=groupAttributesBySource(_0xf2bbc2[_0x5404bf(0xd8)][_0x5404bf(0xc0)])),_0xf2bbc2['customerGroup']['customerGroupBehaviors']&&_0xf2bbc2['customerGroup'][_0x5404bf(0x102)]['length']>0x0&&(_0xb3ae83[_0x5404bf(0xdd)]=_0xf2bbc2[_0x5404bf(0xd8)]['customerGroupBehaviors'][_0x5404bf(0xa8)](convertApiBehaviorToYaml)));const _0x114435={'name':_0xf2bbc2['name'],..._0xf2bbc2['description']&&{'description':_0xf2bbc2['description']},'master':_0x2730df,..._0x201762&&{'schedule':_0x201762},..._0x28c9aa&&{'engine':_0x28c9aa},..._0x489486&&{'attributes':_0x489486},..._0x489618&&{'behaviors':_0x489618},..._0xb3ae83&&{'customer_group':_0xb3ae83}};return _0x114435;}function groupAttributesBySource(_0x2d2f30){const _0x493ff0=a111_0xd97b,_0x2d21fc=new Map();for(const _0x31d337 of _0x2d2f30){const _0x777e54=_0x31d337[_0x493ff0(0xf1)]+'.'+_0x31d337[_0x493ff0(0xf8)]+'.'+_0x31d337[_0x493ff0(0x9c)]+'.'+_0x31d337['foreignKey'];!_0x2d21fc['has'](_0x777e54)&&_0x2d21fc[_0x493ff0(0xd2)](_0x777e54,[]),_0x2d21fc[_0x493ff0(0xde)](_0x777e54)[_0x493ff0(0xec)](_0x31d337);}const _0x8e6ef6=[];for(const [,_0xbd00b4]of _0x2d21fc){const _0x451ef7=_0xbd00b4[0x0],_0x2d8251=_0x451ef7[_0x493ff0(0xad)]||_0x451ef7[_0x493ff0(0xf8)];_0x8e6ef6['push']({'name':_0x2d8251,'source':{'database':_0x451ef7[_0x493ff0(0xf1)],'table':_0x451ef7[_0x493ff0(0xf8)]},'join':{'parent_key':_0x451ef7[_0x493ff0(0x9c)],'child_key':_0x451ef7['foreignKey']},'columns':_0xbd00b4[_0x493ff0(0xa8)](_0x46b0ed=>{const _0x284c26=_0x493ff0,_0x443ea2={'column':_0x46b0ed['parentColumn'],'type':_0x46b0ed[_0x284c26(0xb8)]};return _0x46b0ed[_0x284c26(0xbb)]!==_0x46b0ed[_0x284c26(0xd9)]&&(_0x443ea2[_0x284c26(0x101)]=_0x46b0ed[_0x284c26(0xbb)]),_0x443ea2;})});}return _0x8e6ef6;}function convertApiBehaviorToYaml(_0x647600){const _0x5aabd5=a111_0xd97b,_0x584895={'name':_0x647600[_0x5aabd5(0xbb)],'source':{'database':_0x647600['parentDatabaseName'],'table':_0x647600[_0x5aabd5(0xf8)]},'join':{'parent_key':_0x647600[_0x5aabd5(0x9c)],'child_key':_0x647600['foreignKey']}};if(_0x647600[_0x5aabd5(0xfd)])_0x584895[_0x5aabd5(0xdc)]=!![];else _0x647600[_0x5aabd5(0xb4)]&&_0x647600[_0x5aabd5(0xb4)][_0x5aabd5(0xe5)]>0x0&&(_0x584895[_0x5aabd5(0x9e)]=_0x647600[_0x5aabd5(0xb4)]['map'](_0x5100c2=>{const _0x35816c=_0x5aabd5,_0x14a753={'column':_0x5100c2[_0x35816c(0xd9)],'type':_0x5100c2[_0x35816c(0xb8)]};return _0x5100c2[_0x35816c(0xbb)]!==_0x5100c2[_0x35816c(0xd9)]&&(_0x14a753[_0x35816c(0x101)]=_0x5100c2[_0x35816c(0xbb)]),_0x14a753;}));return _0x647600[_0x5aabd5(0xa7)]&&(_0x584895[_0x5aabd5(0xea)]=_0x647600[_0x5aabd5(0xa7)]),_0x647600[_0x5aabd5(0xee)]&&(_0x584895[_0x5aabd5(0xb6)]=_0x647600[_0x5aabd5(0xee)]),_0x584895;}export function defToApi(_0x204408){const _0x5219ec=a111_0xd97b,_0x2e9991={'name':_0x204408['name'],'master':{'parentDatabaseName':_0x204408[_0x5219ec(0xb1)][_0x5219ec(0xae)],'parentTableName':_0x204408[_0x5219ec(0xb1)][_0x5219ec(0xbd)]}};_0x204408[_0x5219ec(0xcd)]&&(_0x2e9991[_0x5219ec(0xcd)]=_0x204408[_0x5219ec(0xcd)]);_0x204408['master'][_0x5219ec(0x9d)]&&_0x204408[_0x5219ec(0xb1)][_0x5219ec(0x9d)]['length']>0x0&&(_0x2e9991[_0x5219ec(0xc7)]=_0x204408['master']['filters'][_0x5219ec(0xa8)](_0x28157b=>({'columnName':_0x28157b['column'],'rightValues':_0x28157b[_0x5219ec(0xed)]})));_0x204408[_0x5219ec(0xf6)]&&(_0x2e9991[_0x5219ec(0xf3)]=_0x204408[_0x5219ec(0xf6)][_0x5219ec(0xb8)],_0x204408[_0x5219ec(0xf6)]['time']&&(_0x2e9991[_0x5219ec(0x10b)]=_0x204408[_0x5219ec(0xf6)][_0x5219ec(0xa4)]),_0x204408[_0x5219ec(0xf6)]['timezone']&&(_0x2e9991[_0x5219ec(0xc9)]=_0x204408[_0x5219ec(0xf6)][_0x5219ec(0xc9)]));_0x204408['engine']&&(_0x204408[_0x5219ec(0xc4)][_0x5219ec(0xfc)]!==undefined&&(_0x2e9991[_0x5219ec(0xab)]=_0x204408[_0x5219ec(0xc4)]['hive_only']),_0x204408[_0x5219ec(0xc4)][_0x5219ec(0x9b)]!==undefined&&(_0x2e9991['hivePoolName']=_0x204408['engine'][_0x5219ec(0x9b)]),_0x204408[_0x5219ec(0xc4)]['trino_pool']!==undefined&&(_0x2e9991[_0x5219ec(0xb0)]=_0x204408[_0x5219ec(0xc4)][_0x5219ec(0xf4)]));_0x204408[_0x5219ec(0x107)]&&_0x204408[_0x5219ec(0x107)][_0x5219ec(0xe5)]>0x0&&(_0x2e9991[_0x5219ec(0x107)]=flattenAttributeGroups(_0x204408['attributes']));_0x204408[_0x5219ec(0xdd)]&&_0x204408['behaviors'][_0x5219ec(0xe5)]>0x0&&(_0x2e9991[_0x5219ec(0xdd)]=_0x204408['behaviors'][_0x5219ec(0xa8)](convertDefBehaviorToApi));if(_0x204408[_0x5219ec(0xba)]){const _0x336265=_0x204408[_0x5219ec(0xba)];_0x2e9991[_0x5219ec(0xd8)]={'name':_0x336265[_0x5219ec(0xbb)],'parentDatabaseName':_0x336265['source'][_0x5219ec(0xae)],'parentTableName':_0x336265[_0x5219ec(0xb3)][_0x5219ec(0xbd)],'parentKey':_0x336265[_0x5219ec(0xb2)][_0x5219ec(0xe2)],'foreignKey':_0x336265[_0x5219ec(0xb2)][_0x5219ec(0xf9)]},_0x336265[_0x5219ec(0x107)]&&_0x336265[_0x5219ec(0x107)][_0x5219ec(0xe5)]>0x0&&(_0x2e9991[_0x5219ec(0xd8)][_0x5219ec(0xc0)]=flattenAttributeGroups(_0x336265[_0x5219ec(0x107)])[_0x5219ec(0xa8)](_0x3e8d4c=>({'name':_0x3e8d4c[_0x5219ec(0xbb)],'type':_0x3e8d4c[_0x5219ec(0xb8)],'parentDatabaseName':_0x3e8d4c[_0x5219ec(0xf1)],'parentTableName':_0x3e8d4c[_0x5219ec(0xf8)],'parentColumn':_0x3e8d4c[_0x5219ec(0xd9)],'parentKey':_0x3e8d4c['parentKey'],'foreignKey':_0x3e8d4c[_0x5219ec(0xa3)]}))),_0x336265[_0x5219ec(0xdd)]&&_0x336265[_0x5219ec(0xdd)][_0x5219ec(0xe5)]>0x0&&(_0x2e9991[_0x5219ec(0xd8)]['customerGroupBehaviors']=_0x336265[_0x5219ec(0xdd)][_0x5219ec(0xa8)](_0x275e93=>({'name':_0x275e93[_0x5219ec(0xbb)],'parentDatabaseName':_0x275e93[_0x5219ec(0xb3)][_0x5219ec(0xae)],'parentTableName':_0x275e93[_0x5219ec(0xb3)][_0x5219ec(0xbd)],'parentKey':_0x275e93[_0x5219ec(0xb2)][_0x5219ec(0xe2)],'foreignKey':_0x275e93[_0x5219ec(0xb2)]['child_key'],'allColumns':_0x275e93[_0x5219ec(0xdc)],'schema':_0x275e93[_0x5219ec(0x9e)]?.[_0x5219ec(0xa8)](_0x5d1f82=>({'name':_0x5d1f82[_0x5219ec(0x101)]||_0x5d1f82[_0x5219ec(0xe1)],'type':_0x5d1f82['type'],'parentColumn':_0x5d1f82['column']}))})));}return _0x2e9991;}function flattenAttributeGroups(_0x10793e){const _0x5099a9=a111_0xd97b,_0x1defb1=[];for(const _0x499890 of _0x10793e){for(const _0x34ad58 of _0x499890['columns']){_0x1defb1['push']({'name':_0x34ad58['label']||_0x34ad58[_0x5099a9(0xe1)],'type':_0x34ad58[_0x5099a9(0xb8)],'parentDatabaseName':_0x499890[_0x5099a9(0xb3)][_0x5099a9(0xae)],'parentTableName':_0x499890[_0x5099a9(0xb3)][_0x5099a9(0xbd)],'parentColumn':_0x34ad58[_0x5099a9(0xe1)],'parentKey':_0x499890[_0x5099a9(0xb2)][_0x5099a9(0xe2)],'foreignKey':_0x499890[_0x5099a9(0xb2)][_0x5099a9(0xf9)],'groupingName':_0x499890[_0x5099a9(0xbb)]});}}return _0x1defb1;}function convertDefBehaviorToApi(_0x334538){const _0x957a9=a111_0xd97b,_0x1ca3c5={'name':_0x334538[_0x957a9(0xbb)],'parentDatabaseName':_0x334538[_0x957a9(0xb3)]['database'],'parentTableName':_0x334538[_0x957a9(0xb3)][_0x957a9(0xbd)],'parentKey':_0x334538[_0x957a9(0xb2)][_0x957a9(0xe2)],'foreignKey':_0x334538['join'][_0x957a9(0xf9)]};if(_0x334538[_0x957a9(0xdc)])_0x1ca3c5[_0x957a9(0xfd)]=!![];else _0x334538[_0x957a9(0x9e)]&&_0x334538[_0x957a9(0x9e)]['length']>0x0&&(_0x1ca3c5[_0x957a9(0xb4)]=_0x334538[_0x957a9(0x9e)][_0x957a9(0xa8)](_0x19849c=>({'name':_0x19849c[_0x957a9(0x101)]||_0x19849c[_0x957a9(0xe1)],'type':_0x19849c[_0x957a9(0xb8)],'parentColumn':_0x19849c[_0x957a9(0xe1)]})));return _0x334538[_0x957a9(0xea)]!==undefined&&(_0x1ca3c5[_0x957a9(0xa7)]=_0x334538[_0x957a9(0xea)]),_0x334538[_0x957a9(0xb6)]!==undefined&&(_0x1ca3c5[_0x957a9(0xee)]=_0x334538[_0x957a9(0xb6)]),_0x1ca3c5;}export function serializeDef(_0x44f08b){const _0x81eecf=a111_0xd97b,_0x1d9a9b=JSON['parse'](JSON[_0x81eecf(0xbf)](_0x44f08b)),_0x301db3=a111_0x5459bf[_0x81eecf(0xbf)](_0x1d9a9b,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x81eecf(0xd5)}),_0x575cc=[_0x81eecf(0xe0),_0x81eecf(0xc8),_0x81eecf(0xe7),'attributes:',_0x81eecf(0xe3),_0x81eecf(0xac),_0x81eecf(0xaf),_0x81eecf(0xf2)];let _0x2abfbd=_0x301db3;for(const _0x11a930 of _0x575cc){_0x2abfbd=_0x2abfbd['replace'](new RegExp('^('+_0x11a930+')','m'),(_0x52e51d,_0x620cd5,_0x3107a6)=>{if(_0x3107a6===0x0||_0x2abfbd[_0x3107a6-0x1]==='\x0a'&&_0x2abfbd[_0x3107a6-0x2]==='\x0a')return _0x620cd5;return'\x0a'+_0x620cd5;});}return _0x2abfbd;}export function parseDef(_0x4c8073){const _0x1fb944=a111_0xd97b,_0x1a7d5c=a111_0x5459bf[_0x1fb944(0x10a)](_0x4c8073);if(!_0x1a7d5c[_0x1fb944(0xbb)])throw new Error(_0x1fb944(0xc1));if(!_0x1a7d5c[_0x1fb944(0xb1)])throw new Error(_0x1fb944(0xb5));if(!_0x1a7d5c['master'][_0x1fb944(0xae)])throw new Error(_0x1fb944(0x108));if(!_0x1a7d5c[_0x1fb944(0xb1)][_0x1fb944(0xbd)])throw new Error(_0x1fb944(0xfe));return _0x1a7d5c[_0x1fb944(0xb6)]&&validateRealtimeSection(_0x1a7d5c[_0x1fb944(0xb6)]),_0x1a7d5c[_0x1fb944(0xb7)]&&validatePersonalizationServices(_0x1a7d5c['personalization_services']),_0x1a7d5c;}function validateRealtimeSection(_0x171c7d){const _0xceac38=a111_0xd97b,_0x2311ef=[_0xceac38(0xb9),_0xceac38(0xcc),_0xceac38(0xd2),'ordered_set',_0xceac38(0xda),_0xceac38(0xeb)];_0x171c7d[_0xceac38(0xc3)]&&Array[_0xceac38(0xe6)](_0x171c7d[_0xceac38(0xc3)])&&_0x171c7d['events']['forEach']((_0x306188,_0x347a35)=>{const _0x3a91b8=_0xceac38;if(!_0x306188[_0x3a91b8(0xbb)])throw new Error(_0x3a91b8(0xf0)+_0x347a35+_0x3a91b8(0xf7));});_0x171c7d[_0xceac38(0x107)]&&Array[_0xceac38(0xe6)](_0x171c7d[_0xceac38(0x107)])&&_0x171c7d[_0xceac38(0x107)][_0xceac38(0xd6)]((_0x24941e,_0x4db90c)=>{const _0x34053d=_0xceac38;if(!_0x24941e[_0x34053d(0xbb)])throw new Error(_0x34053d(0xdb)+_0x4db90c+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x24941e[_0x34053d(0xb8)]&&!_0x2311ef['includes'](_0x24941e[_0x34053d(0xb8)]))throw new Error(_0x34053d(0xdb)+_0x4db90c+_0x34053d(0x9a)+_0x24941e['name']+_0x34053d(0xc2)+_0x24941e['type']+_0x34053d(0xef)+_0x2311ef['join'](',\x20'));});if(_0x171c7d[_0xceac38(0xc6)]){if(!_0x171c7d['id_stitching'][_0xceac38(0x104)])throw new Error(_0xceac38(0x100));}}function validatePersonalizationServices(_0x16e95e){const _0x19047f=a111_0xd97b;if(!Array[_0x19047f(0xe6)](_0x16e95e))throw new Error(_0x19047f(0xff));_0x16e95e[_0x19047f(0xd6)]((_0x8b7a19,_0x5cbf6e)=>{const _0x24a0a7=_0x19047f;if(!_0x8b7a19['name'])throw new Error(_0x24a0a7(0xcf)+_0x5cbf6e+_0x24a0a7(0xf7));});}function a111_0xd97b(_0x4d6af5,_0x2fef50){_0x4d6af5=_0x4d6af5-0x9a;const _0x2ccc8c=a111_0x2ccc();let _0xd97bf5=_0x2ccc8c[_0x4d6af5];return _0xd97bf5;}export function generateTemplate(_0x22bbb9,_0x4e388a,_0x2f0b06){const _0x41baf3=a111_0xd97b,_0x5395a9={'name':_0x22bbb9,'description':_0x41baf3(0x10f),'master':{'database':_0x4e388a,'table':_0x2f0b06},'schedule':{'type':_0x41baf3(0x109),'time':_0x41baf3(0xe4),'timezone':'UTC'},'attributes':[{'name':_0x41baf3(0xca),'source':{'database':_0x4e388a,'table':_0x41baf3(0xa6)},'join':{'parent_key':'id','child_key':_0x41baf3(0xfb)},'columns':[{'column':_0x41baf3(0xd1),'label':_0x41baf3(0xd7),'type':_0x41baf3(0xd3)}]}],'behaviors':[{'name':_0x41baf3(0x110),'source':{'database':_0x4e388a,'table':_0x41baf3(0xa2)},'join':{'parent_key':_0x41baf3(0x9f),'child_key':_0x41baf3(0xfb)},'all_columns':!![]}]};return serializeDef(_0x5395a9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x35bd45,_0x4a6b20){const _0x5b0e7a=a112_0x3e91,_0x16b17d=_0x35bd45();while(!![]){try{const _0x40945e=parseInt(_0x5b0e7a(0x1cb))/0x1+parseInt(_0x5b0e7a(0x1e1))/0x2+parseInt(_0x5b0e7a(0x1dd))/0x3*(parseInt(_0x5b0e7a(0x1c1))/0x4)+-parseInt(_0x5b0e7a(0x1d5))/0x5*(parseInt(_0x5b0e7a(0x1b4))/0x6)+-parseInt(_0x5b0e7a(0x1c2))/0x7+-parseInt(_0x5b0e7a(0x1d4))/0x8*(-parseInt(_0x5b0e7a(0x1d6))/0x9)+parseInt(_0x5b0e7a(0x1b9))/0xa*(-parseInt(_0x5b0e7a(0x1e5))/0xb);if(_0x40945e===_0x4a6b20)break;else _0x16b17d['push'](_0x16b17d['shift']());}catch(_0x31dbd9){_0x16b17d['push'](_0x16b17d['shift']());}}}(a112_0x2e45,0x6dda8));import a112_0x369d16 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';function a112_0x3e91(_0x3e9557,_0x559127){_0x3e9557=_0x3e9557-0x1ab;const _0x2e45c1=a112_0x2e45();let _0x3e9141=_0x2e45c1[_0x3e9557];return _0x3e9141;}import{journeyResponseToDef,toYamlString as a112_0x2a1531,normalizeJourneyDef,parseYamlString as a112_0x1be214}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x49d9bb,_0x5dd787,_0x1fc0a8){const _0x3982f5=a112_0x3e91,_0x45e228=a112_0x369d16['relative'](_0x1fc0a8,_0x49d9bb);if(existsSync(_0x49d9bb)){const _0x2bb36e=readFileSync(_0x49d9bb,_0x3982f5(0x1ca)),_0x17c4dd=generateDiff(_0x2bb36e,_0x5dd787),_0x2264fd=hasChanges(_0x17c4dd);return{'relativePath':_0x45e228,'absolutePath':_0x49d9bb,'content':_0x5dd787,'isNew':![],'hasChanges':_0x2264fd,'diff':_0x2264fd?formatDiffWithColors(_0x17c4dd):undefined};}return{'relativePath':_0x45e228,'absolutePath':_0x49d9bb,'content':_0x5dd787,'isNew':!![],'hasChanges':![]};}function a112_0x2e45(){const _0x113a36=['getJourney','has','activation_','slice','kind','activationParams','createdAt','51252RoAMXt','1699628YalhvA','Resolving\x20parent\x20segment','Fetching\x20activations','values','hasChanges','add','isNew','folderId','utf-8','810710PmisRI','versionNumber','.yml','segmentFolderId','sort','Fetching\x20segments,\x20folders,\x20and\x20journeys','getSegment','Warning:\x20Journey\x20','push','16GjGAit','5BKnAYV','1303047fZUWAk','get','name','state','update','set','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','171rrGBGK','journey','reduce','Processing\x20journey:\x20','1562606kfLwmz','buildIdToEmailMap','data','getActivation','18283595GkwriG','Fetching\x20users\x20and\x20connections','paused','journeyBundleName','targetResourceName','length','segment','Fetching\x20parent\x20segment\x20info','join','toLowerCase','listSegments','listJourneysWithDetailsFromParentSegment','description','attributes','relationships','from','1542066LZZdBV','all','filter','map','rule','10CJAsiA'];a112_0x2e45=function(){return _0x113a36;};return a112_0x2e45();}function getUniqueFileName(_0x9cf766,_0x4dbc5c,_0x569eef){const _0xa3f10=a112_0x3e91,_0x161198=_0x9cf766+':'+_0x4dbc5c,_0x9232fb=_0x569eef[_0xa3f10(0x1d7)](_0x161198)||0x0;_0x569eef['set'](_0x161198,_0x9232fb+0x1);if(_0x9232fb===0x0)return _0x4dbc5c;return _0x4dbc5c+'_'+(_0x9232fb+0x1);}export async function pullSegments(_0x377d8f,_0xc019e7,_0x3f8f47={}){const _0x56d3ca=a112_0x3e91,{targetDir:_0x22970c,progress:_0x11f4a7}=_0x3f8f47;_0x11f4a7?.[_0x56d3ca(0x1da)](_0x56d3ca(0x1c3));const _0x3e822a=await _0x377d8f[_0x56d3ca(0x1eb)]['resolveParentId'](_0xc019e7);_0x11f4a7?.['update'](_0x56d3ca(0x1ab));const _0x1ed5ba=await _0x377d8f[_0x56d3ca(0x1eb)]['getParent'](_0x3e822a),_0x2c1c2e=_0x1ed5ba['attributes'][_0x56d3ca(0x1d8)];_0x11f4a7?.[_0x56d3ca(0x1da)](_0x56d3ca(0x1d0));const [_0x2fdefc,_0x50cd3e,_0xbbde21]=await Promise[_0x56d3ca(0x1b5)]([_0x377d8f[_0x56d3ca(0x1eb)][_0x56d3ca(0x1ae)](_0x3e822a),_0x377d8f[_0x56d3ca(0x1eb)]['listFolders'](_0x3e822a),_0x377d8f[_0x56d3ca(0x1de)][_0x56d3ca(0x1af)](_0x3e822a,{'includeAllVersions':!![]})]),{journeys:_0x3f537b,activationStepsById:_0x13c171}=_0xbbde21,_0x36ea01=new Map();for(const _0x5a6a93 of _0x3f537b){_0x36ea01['set'](_0x5a6a93['id'],_0x5a6a93);}const _0x108b9a=_0x3f537b[_0x56d3ca(0x1b7)](_0x4fdf8c=>({'id':_0x4fdf8c['id'],'name':_0x4fdf8c[_0x56d3ca(0x1b1)]['name'],'journeyBundleName':_0x4fdf8c[_0x56d3ca(0x1b1)]['journeyBundleName']||'','journeyBundleId':_0x4fdf8c['attributes']['journeyBundleId']||'','versionNumber':_0x4fdf8c['attributes'][_0x56d3ca(0x1cc)],'description':_0x4fdf8c[_0x56d3ca(0x1b1)][_0x56d3ca(0x1b0)],'state':_0x4fdf8c[_0x56d3ca(0x1b1)][_0x56d3ca(0x1d9)],'paused':_0x4fdf8c[_0x56d3ca(0x1b1)][_0x56d3ca(0x1e7)],'audienceId':_0x4fdf8c[_0x56d3ca(0x1b1)]['audienceId'],'folderId':_0x4fdf8c[_0x56d3ca(0x1b2)]?.['parentFolder']?.[_0x56d3ca(0x1e3)]?.['id'],'createdAt':_0x4fdf8c['attributes'][_0x56d3ca(0x1c0)],'updatedAt':_0x4fdf8c['attributes']['updatedAt']})),_0x2401b4=buildFolderIdToPathMap(_0x50cd3e),_0x178d5e=_0x22970c||'segments/'+sanitizeFileName(_0x2c1c2e);_0x11f4a7?.[_0x56d3ca(0x1da)](_0x56d3ca(0x1c4));const _0x504361=new Map();await batchAsync(_0x2fdefc,async _0x276b19=>{const _0x48ec82=_0x56d3ca,_0x47ccff=await _0x377d8f[_0x48ec82(0x1eb)]['listActivations'](_0x3e822a,_0x276b19['id']);_0x504361['set'](_0x276b19['id'],_0x47ccff);}),_0x11f4a7?.[_0x56d3ca(0x1da)](_0x56d3ca(0x1e6));const [_0x4efe4c,_0x293d99]=await Promise[_0x56d3ca(0x1b5)]([_0x377d8f['user'][_0x56d3ca(0x1e2)](),_0x377d8f['connection']['buildIdToNameMap']()]),_0x3df0cf=[],_0x1bef12=new Map(),_0x512433=a112_0x369d16[_0x56d3ca(0x1ac)](_0x178d5e,'tdx.json'),_0x1583d6=createTdxConfigContent(_0x2c1c2e);_0x3df0cf['push'](prepareFile(_0x512433,_0x1583d6,_0x178d5e));const _0x536deb=new Map();for(const _0x47ad6b of _0x2fdefc){_0x536deb[_0x56d3ca(0x1db)](_0x47ad6b['id'],_0x47ad6b);}let _0x3e88a8=_0x2fdefc;if(_0x3f8f47[_0x56d3ca(0x1e9)]){const _0x29c447=_0x2fdefc[_0x56d3ca(0x1b6)](_0x2e9725=>_0x2e9725[_0x56d3ca(0x1d8)]['toLowerCase']()===_0x3f8f47[_0x56d3ca(0x1e9)][_0x56d3ca(0x1ad)]());_0x29c447[_0x56d3ca(0x1ea)]>0x0&&(_0x3e88a8=_0x29c447);}_0x11f4a7?.['update']('Processing\x20segments');for(const _0x31cd71 of _0x3e88a8){if(_0x31cd71[_0x56d3ca(0x1be)]===SEGMENT_KIND_JOURNEY)continue;const _0x143212=_0x31cd71[_0x56d3ca(0x1ce)]?_0x2401b4['get'](_0x31cd71['segmentFolderId'])||'':'',_0x182149=_0x504361[_0x56d3ca(0x1d7)](_0x31cd71['id'])||[],_0x2dd288=segmentWithActivationsToYaml(_0x31cd71,_0x182149,undefined,_0x4efe4c,_0x293d99),_0x205db0=_0x143212?a112_0x369d16['join'](_0x178d5e,_0x143212):_0x178d5e,_0x2580d8=sanitizeFileName(_0x31cd71[_0x56d3ca(0x1d8)]),_0x3a6c12=getUniqueFileName(_0x205db0,_0x2580d8,_0x1bef12),_0x3b4a32=a112_0x369d16['join'](_0x205db0,_0x3a6c12+_0x56d3ca(0x1cd)),_0x4db1e5=segmentToYamlString(_0x2dd288);_0x3df0cf[_0x56d3ca(0x1d3)](prepareFile(_0x3b4a32,_0x4db1e5,_0x178d5e));}const _0x27c580=new Map();for(const _0x4f7417 of _0x108b9a){const _0x8ae92c=_0x4f7417['journeyBundleId'];!_0x27c580[_0x56d3ca(0x1bb)](_0x8ae92c)&&_0x27c580[_0x56d3ca(0x1db)](_0x8ae92c,[]),_0x27c580['get'](_0x8ae92c)[_0x56d3ca(0x1d3)](_0x4f7417);}for(const _0x58eb2a of _0x27c580[_0x56d3ca(0x1c5)]()){_0x58eb2a[_0x56d3ca(0x1cf)]((_0xbf8181,_0x53f5c5)=>(_0xbf8181[_0x56d3ca(0x1cc)]||0x0)-(_0x53f5c5[_0x56d3ca(0x1cc)]||0x0));}if(_0x3f8f47[_0x56d3ca(0x1e9)]){const _0x285d46=new Map();for(const [_0x584e66,_0x1911dc]of _0x27c580){const _0x4a08f2=_0x1911dc[0x0][_0x56d3ca(0x1e8)];if(_0x4a08f2[_0x56d3ca(0x1ad)]()===_0x3f8f47[_0x56d3ca(0x1e9)][_0x56d3ca(0x1ad)]()){_0x285d46[_0x56d3ca(0x1db)](_0x584e66,_0x1911dc);break;}}_0x27c580['clear']();for(const [_0x22d3ff,_0x4278b8]of _0x285d46){_0x27c580[_0x56d3ca(0x1db)](_0x22d3ff,_0x4278b8);}}if(_0x27c580['size']>0x0){_0x11f4a7?.[_0x56d3ca(0x1da)]('Processing\x20journeys');const _0x5e8528=Array[_0x56d3ca(0x1b3)](_0x27c580[_0x56d3ca(0x1c5)]()),_0x1f84bc=0x5,{createYamlContext:_0x353986}=createYamlContextForBundle(_0x377d8f,_0x536deb,_0x4efe4c,_0x293d99,_0x13c171,_0x36ea01);for(let _0x2825b4=0x0;_0x2825b4<_0x5e8528[_0x56d3ca(0x1ea)];_0x2825b4+=_0x1f84bc){const _0x584f04=_0x5e8528[_0x56d3ca(0x1bd)](_0x2825b4,_0x2825b4+_0x1f84bc),_0x1c4291=await Promise['all'](_0x584f04['map'](async _0x49e35e=>{const _0xc95a29=_0x56d3ca,_0x406a2d=_0x49e35e[0x0],_0x561bf1=_0x406a2d[_0xc95a29(0x1e8)];_0x11f4a7?.[_0xc95a29(0x1da)](_0xc95a29(0x1e0)+_0x561bf1);const _0x57da73=_0x406a2d[_0xc95a29(0x1c9)]?_0x2401b4[_0xc95a29(0x1d7)](_0x406a2d[_0xc95a29(0x1c9)])||'':'',_0x370be8=_0x57da73?a112_0x369d16[_0xc95a29(0x1ac)](_0x178d5e,_0x57da73):_0x178d5e,_0x54ccdf=sanitizeFileName(_0x561bf1),_0x5e67ce=a112_0x369d16[_0xc95a29(0x1ac)](_0x370be8,_0x54ccdf+'.yml');let _0x3723ad;if(existsSync(_0x5e67ce))try{const _0x415ba1=readFileSync(_0x5e67ce,'utf-8'),_0x40dceb=a112_0x1be214(_0x415ba1);_0x3723ad=buildLocalRuleToNameMappingFromJourney(_0x40dceb);}catch{}const _0x1611ca=[];for(const _0x4142a1 of _0x49e35e){const _0x3f1d9f=_0x36ea01[_0xc95a29(0x1d7)](_0x4142a1['id']);if(!_0x3f1d9f){_0x11f4a7?.[_0xc95a29(0x1da)](_0xc95a29(0x1d2)+_0x4142a1['id']+_0xc95a29(0x1dc));continue;}const _0x2fc2e1=_0x3f1d9f[_0xc95a29(0x1b1)]?.['audienceId'],_0x518265=_0x353986(_0x4142a1['id'],_0x2fc2e1),_0x4496b5=await journeyResponseToDef(_0x3f1d9f,_0x518265);_0x1611ca[_0xc95a29(0x1d3)]({'item':_0x4142a1,'yaml':_0x4496b5});}const _0x533744=buildMergedJourneyDef(_0x1611ca,_0x3723ad);return{'bundleName':_0x561bf1,'folderPath':_0x57da73,'finalYaml':_0x533744};}));for(const {bundleName:_0x28dc15,folderPath:_0x1967a4,finalYaml:_0xcfcb72}of _0x1c4291){const _0x1b864d=normalizeJourneyDef(_0xcfcb72),_0x5e4e04=a112_0x2a1531(_0x1b864d),_0x133317=_0x1967a4?a112_0x369d16[_0x56d3ca(0x1ac)](_0x178d5e,_0x1967a4):_0x178d5e,_0x49a2be=sanitizeFileName(_0x28dc15),_0x30b1bb=getUniqueFileName(_0x133317,_0x49a2be,_0x1bef12),_0x5ba12c=a112_0x369d16[_0x56d3ca(0x1ac)](_0x133317,_0x30b1bb+_0x56d3ca(0x1cd));_0x3df0cf[_0x56d3ca(0x1d3)](prepareFile(_0x5ba12c,_0x5e4e04,_0x178d5e));}}}const _0xfe9b00=Array[_0x56d3ca(0x1b3)](_0x504361[_0x56d3ca(0x1c5)]())[_0x56d3ca(0x1df)]((_0x2031bf,_0x2b3f14)=>_0x2031bf+_0x2b3f14[_0x56d3ca(0x1ea)],0x0),_0xd1933f=_0x3e88a8[_0x56d3ca(0x1b6)](_0x52c083=>_0x52c083[_0x56d3ca(0x1be)]!==SEGMENT_KIND_JOURNEY),_0x349ccd=_0x3df0cf[_0x56d3ca(0x1b6)](_0x37c5e7=>_0x37c5e7[_0x56d3ca(0x1c8)])[_0x56d3ca(0x1ea)],_0x6f9192=_0x3df0cf[_0x56d3ca(0x1b6)](_0x46516d=>!_0x46516d['isNew']&&_0x46516d[_0x56d3ca(0x1c6)])['length'],_0x1daaac=_0x3df0cf[_0x56d3ca(0x1b6)](_0x4210e7=>!_0x4210e7['isNew']&&!_0x4210e7[_0x56d3ca(0x1c6)])[_0x56d3ca(0x1ea)],_0x3b2dc9=Array[_0x56d3ca(0x1b3)](_0x27c580[_0x56d3ca(0x1c5)]())[_0x56d3ca(0x1df)]((_0x13f6f4,_0x4f2772)=>_0x13f6f4+_0x4f2772[_0x56d3ca(0x1ea)],0x0);return{'parentName':_0x2c1c2e,'parentId':_0x3e822a,'targetDir':_0x178d5e,'files':_0x3df0cf,'counts':{'segments':_0xd1933f[_0x56d3ca(0x1ea)],'journeys':_0x27c580['size'],'journeyVersions':_0x3b2dc9,'activations':_0xfe9b00},'newFiles':_0x349ccd,'changedFiles':_0x6f9192,'unchangedFiles':_0x1daaac};}function createYamlContextForBundle(_0x58c1fc,_0x12fb60,_0x3fc9f2,_0x40e81e,_0x5bea6f,_0x27506e){const _0x5518a2=new Set(),_0x29ed0b=new Map(),_0x18d4b1=new Map(),_0x2352b1=createJumpTargetCache(),_0x35f28e=async(_0x4fcf78,_0x3e70f5)=>{const _0x436e76=a112_0x3e91,_0x791a25=_0x29ed0b['get'](_0x4fcf78);if(_0x791a25!==undefined)return _0x791a25;if(!_0x3e70f5)return _0x4fcf78;try{let _0xb55ce8=_0x12fb60[_0x436e76(0x1d7)](_0x4fcf78);!_0xb55ce8&&(_0xb55ce8=await _0x58c1fc[_0x436e76(0x1eb)][_0x436e76(0x1d1)](_0x3e70f5,_0x4fcf78),_0x12fb60['set'](_0x4fcf78,_0xb55ce8));const _0x51b3ba=generateJourneyLocalName(_0xb55ce8[_0x436e76(0x1d8)]),_0x2485e2=_0xb55ce8[_0x436e76(0x1be)]===SEGMENT_KIND_JOURNEY&&_0x51b3ba!==undefined;if(_0x2485e2&&_0x51b3ba){let _0x726a5e=_0x51b3ba,_0x26a412=0x2;while(_0x5518a2[_0x436e76(0x1bb)](_0x726a5e)){_0x726a5e=_0x51b3ba+'_'+_0x26a412,_0x26a412++;}return _0x5518a2[_0x436e76(0x1c7)](_0x726a5e),_0x29ed0b[_0x436e76(0x1db)](_0x4fcf78,_0x726a5e),_0x726a5e;}return _0xb55ce8[_0x436e76(0x1d8)];}catch{return _0x4fcf78;}},_0x5d242d=(_0xbec762,_0x165a74)=>({'resolveSegment':async _0x3b38c3=>{const _0x467e71=a112_0x3e91,_0x308fc7=_0x29ed0b[_0x467e71(0x1d7)](_0x3b38c3);if(_0x308fc7!==undefined)return{'name':_0x308fc7,'isJourneyLocal':!![]};if(!_0x165a74)return{'name':_0x3b38c3,'isJourneyLocal':![]};try{let _0x1467f0=_0x12fb60[_0x467e71(0x1d7)](_0x3b38c3);!_0x1467f0&&(_0x1467f0=await _0x58c1fc[_0x467e71(0x1eb)][_0x467e71(0x1d1)](_0x165a74,_0x3b38c3),_0x12fb60[_0x467e71(0x1db)](_0x3b38c3,_0x1467f0));const _0x5df175=generateJourneyLocalName(_0x1467f0[_0x467e71(0x1d8)]),_0x4c8300=_0x1467f0['kind']===SEGMENT_KIND_JOURNEY&&_0x5df175!==undefined,_0x520dd3=await _0x35f28e(_0x3b38c3,_0x165a74);let _0xcb22d4;if(_0x4c8300&&_0x1467f0[_0x467e71(0x1b8)]){const _0x4330ff=await segmentResponseToDef(_0x1467f0,{'resolveSegmentName':_0x4e53c1=>_0x35f28e(_0x4e53c1,_0x165a74)});_0xcb22d4={'description':_0x1467f0[_0x467e71(0x1b0)],'rule':_0x4330ff[_0x467e71(0x1b8)]};}return{'name':_0x520dd3,'isJourneyLocal':_0x4c8300,'definition':_0xcb22d4};}catch{return{'name':_0x3b38c3,'isJourneyLocal':![]};}},'resolveActivation':async _0x4c7115=>{const _0x4f2ea9=a112_0x3e91,_0x50bc13=_0x18d4b1[_0x4f2ea9(0x1d7)](_0x4c7115);if(_0x50bc13!==undefined)return{'name':_0x50bc13,'isJourneyLocal':!![]};try{let _0x4057a3=_0x5bea6f[_0x4f2ea9(0x1d7)](_0x4c7115);!_0x4057a3&&(_0x4057a3=await _0x58c1fc[_0x4f2ea9(0x1de)][_0x4f2ea9(0x1e4)](_0xbec762,_0x4c7115));const _0x3ede1e=_0x4057a3[_0x4f2ea9(0x1b1)][_0x4f2ea9(0x1bf)][_0x4f2ea9(0x1d8)]||_0x4c7115,_0x2b36fc=sanitizeYamlKey(_0x3ede1e)||_0x4f2ea9(0x1bc)+_0x4c7115,_0x390277=_0x2b36fc;_0x18d4b1[_0x4f2ea9(0x1db)](_0x4c7115,_0x390277);const _0x6b3007=journeyActivationStepToYaml(_0x4057a3,_0x3fc9f2,_0x40e81e);return{'name':_0x390277,'isJourneyLocal':!![],'definition':_0x6b3007};}catch{return{'name':_0x4c7115,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2ea137,_0x581dc2)=>resolveJumpTarget(_0x2ea137,_0x581dc2,_0x2352b1,async _0x3aa83d=>{const _0x3c2970=a112_0x3e91,_0x4c4621=_0x27506e[_0x3c2970(0x1d7)](_0x3aa83d);if(_0x4c4621)return _0x4c4621;return _0x58c1fc[_0x3c2970(0x1de)][_0x3c2970(0x1ba)](_0x3aa83d);})});return{'createYamlContext':_0x5d242d};}
|
|
1
|
+
(function(_0xb8bd28,_0x2c6c02){const _0x3e0629=a112_0x3ab3,_0xcb3c31=_0xb8bd28();while(!![]){try{const _0x436b0e=-parseInt(_0x3e0629(0x1f7))/0x1+-parseInt(_0x3e0629(0x1db))/0x2*(parseInt(_0x3e0629(0x1df))/0x3)+-parseInt(_0x3e0629(0x1e6))/0x4+parseInt(_0x3e0629(0x207))/0x5*(-parseInt(_0x3e0629(0x1c9))/0x6)+parseInt(_0x3e0629(0x1fe))/0x7*(parseInt(_0x3e0629(0x1ee))/0x8)+parseInt(_0x3e0629(0x1dd))/0x9*(-parseInt(_0x3e0629(0x1c8))/0xa)+parseInt(_0x3e0629(0x1dc))/0xb;if(_0x436b0e===_0x2c6c02)break;else _0xcb3c31['push'](_0xcb3c31['shift']());}catch(_0x44745a){_0xcb3c31['push'](_0xcb3c31['shift']());}}}(a112_0x3b99,0xcd486));import a112_0x121e14 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a112_0x30db2a,normalizeJourneyDef,parseYamlString as a112_0x32bb98}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x4b90e0,_0x98c78f,_0x335edd){const _0xb5a42f=a112_0x3ab3,_0x2801ad=a112_0x121e14[_0xb5a42f(0x1c2)](_0x335edd,_0x4b90e0);if(existsSync(_0x4b90e0)){const _0x42888d=readFileSync(_0x4b90e0,_0xb5a42f(0x1c4)),_0x292675=generateDiff(_0x42888d,_0x98c78f),_0x24af68=hasChanges(_0x292675);return{'relativePath':_0x2801ad,'absolutePath':_0x4b90e0,'content':_0x98c78f,'isNew':![],'hasChanges':_0x24af68,'diff':_0x24af68?formatDiffWithColors(_0x292675):undefined};}return{'relativePath':_0x2801ad,'absolutePath':_0x4b90e0,'content':_0x98c78f,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x35e7c3,_0x453b37,_0x30047c){const _0x299510=a112_0x3ab3,_0x21b75c=_0x35e7c3+':'+_0x453b37,_0x31b6e1=_0x30047c[_0x299510(0x1c5)](_0x21b75c)||0x0;_0x30047c[_0x299510(0x1e2)](_0x21b75c,_0x31b6e1+0x1);if(_0x31b6e1===0x0)return _0x453b37;return _0x453b37+'_'+(_0x31b6e1+0x1);}export async function pullSegments(_0x133595,_0x1e3174,_0x257349={}){const _0x3dad3e=a112_0x3ab3,{targetDir:_0x2c55fd,progress:_0x3514e7}=_0x257349;_0x3514e7?.[_0x3dad3e(0x1e5)](_0x3dad3e(0x1ce));const _0x20c857=await _0x133595[_0x3dad3e(0x1e0)][_0x3dad3e(0x202)](_0x1e3174);_0x3514e7?.['update'](_0x3dad3e(0x201));const _0x2e22a4=await _0x133595[_0x3dad3e(0x1e0)][_0x3dad3e(0x1fa)](_0x20c857),_0x691f93=_0x2e22a4[_0x3dad3e(0x1d0)][_0x3dad3e(0x204)];_0x3514e7?.[_0x3dad3e(0x1e5)]('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x3f6ac6,_0x4e060a,_0x116bcf]=await Promise['all']([_0x133595[_0x3dad3e(0x1e0)][_0x3dad3e(0x1d8)](_0x20c857),_0x133595[_0x3dad3e(0x1e0)][_0x3dad3e(0x1cd)](_0x20c857),_0x133595[_0x3dad3e(0x1ed)][_0x3dad3e(0x1f2)](_0x20c857,{'includeAllVersions':!![]})]),{journeys:_0x366162,activationStepsById:_0x3d14b5}=_0x116bcf,_0x3e8231=new Map();for(const _0x2550e7 of _0x366162){_0x3e8231[_0x3dad3e(0x1e2)](_0x2550e7['id'],_0x2550e7);}const _0x1ec289=_0x366162[_0x3dad3e(0x1d2)](_0x38c941=>({'id':_0x38c941['id'],'name':_0x38c941[_0x3dad3e(0x1d0)][_0x3dad3e(0x204)],'journeyBundleName':_0x38c941['attributes'][_0x3dad3e(0x200)]||'','journeyBundleId':_0x38c941[_0x3dad3e(0x1d0)][_0x3dad3e(0x1d1)]||'','versionNumber':_0x38c941[_0x3dad3e(0x1d0)][_0x3dad3e(0x1f4)],'description':_0x38c941[_0x3dad3e(0x1d0)]['description'],'state':_0x38c941[_0x3dad3e(0x1d0)]['state'],'paused':_0x38c941[_0x3dad3e(0x1d0)][_0x3dad3e(0x1f0)],'audienceId':_0x38c941[_0x3dad3e(0x1d0)]['audienceId'],'folderId':_0x38c941[_0x3dad3e(0x1e3)]?.[_0x3dad3e(0x1cb)]?.[_0x3dad3e(0x1f1)]?.['id'],'createdAt':_0x38c941[_0x3dad3e(0x1d0)][_0x3dad3e(0x1fb)],'updatedAt':_0x38c941['attributes'][_0x3dad3e(0x1ef)]})),_0x4bd1e4=buildFolderIdToPathMap(_0x4e060a),_0x322df9=_0x2c55fd||_0x3dad3e(0x1f8)+sanitizeFileName(_0x691f93);_0x3514e7?.[_0x3dad3e(0x1e5)](_0x3dad3e(0x1f3));const _0x431da6=new Map();await batchAsync(_0x3f6ac6,async _0x701a9a=>{const _0x7a5f8a=_0x3dad3e,_0x57bdc1=await _0x133595[_0x7a5f8a(0x1e0)][_0x7a5f8a(0x1c3)](_0x20c857,_0x701a9a['id']);_0x431da6[_0x7a5f8a(0x1e2)](_0x701a9a['id'],_0x57bdc1);}),_0x3514e7?.[_0x3dad3e(0x1e5)](_0x3dad3e(0x1de));const [_0x16dab8,_0x65a7f7]=await Promise[_0x3dad3e(0x1ca)]([_0x133595[_0x3dad3e(0x1cc)][_0x3dad3e(0x1cf)](),_0x133595[_0x3dad3e(0x1d9)]['buildIdToNameMap']()]),_0x1964b5=[],_0x495218=new Map(),_0x2c9c6a=a112_0x121e14[_0x3dad3e(0x205)](_0x322df9,_0x3dad3e(0x1d3)),_0x542b1b=createTdxConfigContent(_0x691f93);_0x1964b5[_0x3dad3e(0x1e1)](prepareFile(_0x2c9c6a,_0x542b1b,_0x322df9));const _0x321031=new Map();for(const _0x2ae633 of _0x3f6ac6){_0x321031[_0x3dad3e(0x1e2)](_0x2ae633['id'],_0x2ae633);}let _0x3ff585=_0x3f6ac6;if(_0x257349[_0x3dad3e(0x1ec)]){const _0x1cfa09=_0x3f6ac6['filter'](_0x1207a6=>_0x1207a6['name']['toLowerCase']()===_0x257349['targetResourceName']['toLowerCase']());_0x1cfa09[_0x3dad3e(0x1c6)]>0x0&&(_0x3ff585=_0x1cfa09);}_0x3514e7?.[_0x3dad3e(0x1e5)](_0x3dad3e(0x1c0));for(const _0x13b992 of _0x3ff585){if(_0x13b992['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x30baf5=_0x13b992[_0x3dad3e(0x1e4)]?_0x4bd1e4[_0x3dad3e(0x1c5)](_0x13b992[_0x3dad3e(0x1e4)])||'':'',_0x5543fa=_0x431da6['get'](_0x13b992['id'])||[],_0x2a3654=segmentWithActivationsToYaml(_0x13b992,_0x5543fa,undefined,_0x16dab8,_0x65a7f7),_0x25d723=_0x30baf5?a112_0x121e14['join'](_0x322df9,_0x30baf5):_0x322df9,_0x223d3f=sanitizeFileName(_0x13b992[_0x3dad3e(0x204)]),_0x150c9c=getUniqueFileName(_0x25d723,_0x223d3f,_0x495218),_0x5cca7a=a112_0x121e14['join'](_0x25d723,_0x150c9c+'.yml'),_0x81f562=segmentToYamlString(_0x2a3654);_0x1964b5['push'](prepareFile(_0x5cca7a,_0x81f562,_0x322df9));}const _0x5676a7=new Map();for(const _0x34c3fb of _0x1ec289){const _0x485734=_0x34c3fb[_0x3dad3e(0x1d1)];!_0x5676a7['has'](_0x485734)&&_0x5676a7[_0x3dad3e(0x1e2)](_0x485734,[]),_0x5676a7[_0x3dad3e(0x1c5)](_0x485734)[_0x3dad3e(0x1e1)](_0x34c3fb);}for(const _0x2ae159 of _0x5676a7[_0x3dad3e(0x1c1)]()){_0x2ae159[_0x3dad3e(0x1fd)]((_0xaa3807,_0x409b80)=>(_0xaa3807[_0x3dad3e(0x1f4)]||0x0)-(_0x409b80[_0x3dad3e(0x1f4)]||0x0));}if(_0x257349[_0x3dad3e(0x1ec)]){const _0x102224=new Map();for(const [_0x24a189,_0x2060e5]of _0x5676a7){const _0x34c53b=_0x2060e5[0x0][_0x3dad3e(0x200)];if(_0x34c53b[_0x3dad3e(0x203)]()===_0x257349[_0x3dad3e(0x1ec)]['toLowerCase']()){_0x102224[_0x3dad3e(0x1e2)](_0x24a189,_0x2060e5);break;}}_0x5676a7['clear']();for(const [_0x328da0,_0x5152c1]of _0x102224){_0x5676a7['set'](_0x328da0,_0x5152c1);}}if(_0x5676a7[_0x3dad3e(0x1fc)]>0x0){_0x3514e7?.[_0x3dad3e(0x1e5)]('Processing\x20journeys');const _0x218060=Array['from'](_0x5676a7['values']()),_0x1f6471=0x5,{createYamlContext:_0x32be67}=createYamlContextForBundle(_0x133595,_0x321031,_0x16dab8,_0x65a7f7,_0x3d14b5,_0x3e8231);for(let _0x292c8f=0x0;_0x292c8f<_0x218060[_0x3dad3e(0x1c6)];_0x292c8f+=_0x1f6471){const _0xedd992=_0x218060[_0x3dad3e(0x1f9)](_0x292c8f,_0x292c8f+_0x1f6471),_0x3b8edb=await Promise[_0x3dad3e(0x1ca)](_0xedd992['map'](async _0x18379f=>{const _0x18c01b=_0x3dad3e,_0x497182=_0x18379f[0x0],_0x3aefad=_0x497182[_0x18c01b(0x200)];_0x3514e7?.[_0x18c01b(0x1e5)]('Processing\x20journey:\x20'+_0x3aefad);const _0x45006d=_0x497182[_0x18c01b(0x1e7)]?_0x4bd1e4[_0x18c01b(0x1c5)](_0x497182[_0x18c01b(0x1e7)])||'':'',_0x51694f=_0x45006d?a112_0x121e14[_0x18c01b(0x205)](_0x322df9,_0x45006d):_0x322df9,_0x1485a6=sanitizeFileName(_0x3aefad),_0x23b72c=a112_0x121e14[_0x18c01b(0x205)](_0x51694f,_0x1485a6+'.yml');let _0x5c3d23;if(existsSync(_0x23b72c))try{const _0x4ac516=readFileSync(_0x23b72c,_0x18c01b(0x1c4)),_0x130c3e=a112_0x32bb98(_0x4ac516);_0x5c3d23=buildLocalRuleToNameMappingFromJourney(_0x130c3e);}catch{}const _0x215822=[];for(const _0xb64cd of _0x18379f){const _0x38488d=_0x3e8231[_0x18c01b(0x1c5)](_0xb64cd['id']);if(!_0x38488d){_0x3514e7?.[_0x18c01b(0x1e5)]('Warning:\x20Journey\x20'+_0xb64cd['id']+_0x18c01b(0x1ff));continue;}const _0x570d96=_0x38488d[_0x18c01b(0x1d0)]?.['audienceId'],_0x177f17=_0x32be67(_0xb64cd['id'],_0x570d96),_0x45fb80=await journeyResponseToDef(_0x38488d,_0x177f17);_0x215822[_0x18c01b(0x1e1)]({'item':_0xb64cd,'yaml':_0x45fb80});}const _0x3df0b3=buildMergedJourneyDef(_0x215822,_0x5c3d23);return{'bundleName':_0x3aefad,'folderPath':_0x45006d,'finalYaml':_0x3df0b3};}));for(const {bundleName:_0x4f6c4b,folderPath:_0x2babcc,finalYaml:_0x3f7a20}of _0x3b8edb){const _0x19636b=normalizeJourneyDef(_0x3f7a20),_0x30903c=a112_0x30db2a(_0x19636b),_0x41d9cf=_0x2babcc?a112_0x121e14[_0x3dad3e(0x205)](_0x322df9,_0x2babcc):_0x322df9,_0x10d56c=sanitizeFileName(_0x4f6c4b),_0x3ac2a4=getUniqueFileName(_0x41d9cf,_0x10d56c,_0x495218),_0x5402e4=a112_0x121e14[_0x3dad3e(0x205)](_0x41d9cf,_0x3ac2a4+'.yml');_0x1964b5[_0x3dad3e(0x1e1)](prepareFile(_0x5402e4,_0x30903c,_0x322df9));}}}const _0x1f3ff0=Array[_0x3dad3e(0x1eb)](_0x431da6[_0x3dad3e(0x1c1)]())['reduce']((_0x3ee124,_0x4389a4)=>_0x3ee124+_0x4389a4['length'],0x0),_0x3eb964=_0x3ff585[_0x3dad3e(0x1e9)](_0x2e689c=>_0x2e689c['kind']!==SEGMENT_KIND_JOURNEY),_0x39feb2=_0x1964b5['filter'](_0x139f18=>_0x139f18[_0x3dad3e(0x1d5)])[_0x3dad3e(0x1c6)],_0x2e5fbe=_0x1964b5[_0x3dad3e(0x1e9)](_0x3d1406=>!_0x3d1406[_0x3dad3e(0x1d5)]&&_0x3d1406[_0x3dad3e(0x1d6)])[_0x3dad3e(0x1c6)],_0x5c0711=_0x1964b5[_0x3dad3e(0x1e9)](_0x515daf=>!_0x515daf[_0x3dad3e(0x1d5)]&&!_0x515daf['hasChanges'])[_0x3dad3e(0x1c6)],_0x5ef018=Array[_0x3dad3e(0x1eb)](_0x5676a7[_0x3dad3e(0x1c1)]())['reduce']((_0x3d7e9a,_0xaa4933)=>_0x3d7e9a+_0xaa4933['length'],0x0);return{'parentName':_0x691f93,'parentId':_0x20c857,'targetDir':_0x322df9,'files':_0x1964b5,'counts':{'segments':_0x3eb964[_0x3dad3e(0x1c6)],'journeys':_0x5676a7[_0x3dad3e(0x1fc)],'journeyVersions':_0x5ef018,'activations':_0x1f3ff0},'newFiles':_0x39feb2,'changedFiles':_0x2e5fbe,'unchangedFiles':_0x5c0711};}function createYamlContextForBundle(_0x275eeb,_0xb49b00,_0x464d33,_0x2e9ef4,_0x3c557c,_0x586983){const _0x23cd16=new Set(),_0x272f40=new Map(),_0x2a710a=new Map(),_0xad0845=createJumpTargetCache(),_0x149e3a=async(_0x30c545,_0x38cf36)=>{const _0x333633=a112_0x3ab3,_0x4c5465=_0x272f40[_0x333633(0x1c5)](_0x30c545);if(_0x4c5465!==undefined)return _0x4c5465;if(!_0x38cf36)return _0x30c545;try{let _0x5cba2c=_0xb49b00[_0x333633(0x1c5)](_0x30c545);!_0x5cba2c&&(_0x5cba2c=await _0x275eeb[_0x333633(0x1e0)]['getSegment'](_0x38cf36,_0x30c545),_0xb49b00['set'](_0x30c545,_0x5cba2c));const _0x26adcc=generateJourneyLocalName(_0x5cba2c[_0x333633(0x204)]),_0x5d23a5=_0x5cba2c[_0x333633(0x1f5)]===SEGMENT_KIND_JOURNEY&&_0x26adcc!==undefined;if(_0x5d23a5&&_0x26adcc){let _0x5aa711=_0x26adcc,_0x233eaf=0x2;while(_0x23cd16[_0x333633(0x1da)](_0x5aa711)){_0x5aa711=_0x26adcc+'_'+_0x233eaf,_0x233eaf++;}return _0x23cd16[_0x333633(0x1f6)](_0x5aa711),_0x272f40[_0x333633(0x1e2)](_0x30c545,_0x5aa711),_0x5aa711;}return _0x5cba2c[_0x333633(0x204)];}catch{return _0x30c545;}},_0x2159cf=(_0x991b14,_0x4c09dd)=>({'resolveSegment':async _0x74af9b=>{const _0x2ca71d=a112_0x3ab3,_0x165cc9=_0x272f40['get'](_0x74af9b);if(_0x165cc9!==undefined)return{'name':_0x165cc9,'isJourneyLocal':!![]};if(!_0x4c09dd)return{'name':_0x74af9b,'isJourneyLocal':![]};try{let _0x35d1d5=_0xb49b00[_0x2ca71d(0x1c5)](_0x74af9b);!_0x35d1d5&&(_0x35d1d5=await _0x275eeb[_0x2ca71d(0x1e0)][_0x2ca71d(0x1e8)](_0x4c09dd,_0x74af9b),_0xb49b00[_0x2ca71d(0x1e2)](_0x74af9b,_0x35d1d5));const _0xb73974=generateJourneyLocalName(_0x35d1d5[_0x2ca71d(0x204)]),_0xf654d3=_0x35d1d5['kind']===SEGMENT_KIND_JOURNEY&&_0xb73974!==undefined,_0x2991a4=await _0x149e3a(_0x74af9b,_0x4c09dd);let _0x9c079b;if(_0xf654d3&&_0x35d1d5[_0x2ca71d(0x1ea)]){const _0xc9de84=await segmentResponseToDef(_0x35d1d5,{'resolveSegmentName':_0x3e5c23=>_0x149e3a(_0x3e5c23,_0x4c09dd)});_0x9c079b={'description':_0x35d1d5['description'],'rule':_0xc9de84[_0x2ca71d(0x1ea)]};}return{'name':_0x2991a4,'isJourneyLocal':_0xf654d3,'definition':_0x9c079b};}catch{return{'name':_0x74af9b,'isJourneyLocal':![]};}},'resolveActivation':async _0x2891ef=>{const _0x148634=a112_0x3ab3,_0x455ca2=_0x2a710a['get'](_0x2891ef);if(_0x455ca2!==undefined)return{'name':_0x455ca2,'isJourneyLocal':!![]};try{let _0x103c88=_0x3c557c[_0x148634(0x1c5)](_0x2891ef);!_0x103c88&&(_0x103c88=await _0x275eeb[_0x148634(0x1ed)][_0x148634(0x1d7)](_0x991b14,_0x2891ef));const _0x56b5e2=_0x103c88[_0x148634(0x1d0)][_0x148634(0x206)]['name']||_0x2891ef,_0x2e0b94=sanitizeYamlKey(_0x56b5e2)||_0x148634(0x1c7)+_0x2891ef,_0xe32c95=_0x2e0b94;_0x2a710a[_0x148634(0x1e2)](_0x2891ef,_0xe32c95);const _0x1e284f=journeyActivationStepToYaml(_0x103c88,_0x464d33,_0x2e9ef4);return{'name':_0xe32c95,'isJourneyLocal':!![],'definition':_0x1e284f};}catch{return{'name':_0x2891ef,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x48d9d1,_0xd342bf)=>resolveJumpTarget(_0x48d9d1,_0xd342bf,_0xad0845,async _0x4ea498=>{const _0x3bfc85=a112_0x3ab3,_0x137b43=_0x586983['get'](_0x4ea498);if(_0x137b43)return _0x137b43;return _0x275eeb[_0x3bfc85(0x1ed)][_0x3bfc85(0x1d4)](_0x4ea498);})});return{'createYamlContext':_0x2159cf};}function a112_0x3ab3(_0x8b1a10,_0x48e4ef){_0x8b1a10=_0x8b1a10-0x1c0;const _0x3b99ef=a112_0x3b99();let _0x3ab318=_0x3b99ef[_0x8b1a10];return _0x3ab318;}function a112_0x3b99(){const _0x266c4f=['journeyBundleName','Fetching\x20parent\x20segment\x20info','resolveParentId','toLowerCase','name','join','activationParams','45eKcdhP','Processing\x20segments','values','relative','listActivations','utf-8','get','length','activation_','409130PgEfVY','301836Ixemoq','all','parentFolder','user','listFolders','Resolving\x20parent\x20segment','buildIdToEmailMap','attributes','journeyBundleId','map','tdx.json','getJourney','isNew','hasChanges','getActivation','listSegments','connection','has','583130BcibDt','40868102JorscX','234GXmhmT','Fetching\x20users\x20and\x20connections','6MUmmrm','segment','push','set','relationships','segmentFolderId','update','5197832KuPRqK','folderId','getSegment','filter','rule','from','targetResourceName','journey','2504ovQVYR','updatedAt','paused','data','listJourneysWithDetailsFromParentSegment','Fetching\x20activations','versionNumber','kind','add','414677XUbxHH','segments/','slice','getParent','createdAt','size','sort','21007KqODUM','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping'];a112_0x3b99=function(){return _0x266c4f;};return a112_0x3b99();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a113_0x46ff4f=a113_0x41dd;function a113_0x33e3(){const _0x4188dc=['utf-8','tdx.sdk.push-recovery','22764080ujiWfL','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','2276rrUgZb','stringify','9418934AhjEjo','version','.tmp','journeyName','3378rBdjNz','warn','6553864ZBtKxb','2890eZhAuI','.push-recovery.json','code','4680nHMyRS','debug','toISOString','segments','9XBrtwc','2007930BbWLiY','ENOENT','21352fZiwoZ','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'];a113_0x33e3=function(){return _0x4188dc;};return a113_0x33e3();}(function(_0x521fc9,_0x345cbd){const _0x1e314c=a113_0x41dd,_0x1e4fd7=_0x521fc9();while(!![]){try{const _0x434090=-parseInt(_0x1e314c(0xbf))/0x1*(-parseInt(_0x1e314c(0xaf))/0x2)+-parseInt(_0x1e314c(0xc0))/0x3+parseInt(_0x1e314c(0xb7))/0x4+-parseInt(_0x1e314c(0xb8))/0x5*(-parseInt(_0x1e314c(0xb5))/0x6)+-parseInt(_0x1e314c(0xb1))/0x7+-parseInt(_0x1e314c(0xa9))/0x8*(parseInt(_0x1e314c(0xbb))/0x9)+parseInt(_0x1e314c(0xad))/0xa;if(_0x434090===_0x345cbd)break;else _0x1e4fd7['push'](_0x1e4fd7['shift']());}catch(_0xdefd99){_0x1e4fd7['push'](_0x1e4fd7['shift']());}}}(a113_0x33e3,0xcefa2));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a113_0x487c70 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a113_0x46ff4f(0xac));function a113_0x41dd(_0x651b79,_0x54e82d){_0x651b79=_0x651b79-0xa8;const _0x33e347=a113_0x33e3();let _0x41dd57=_0x33e347[_0x651b79];return _0x41dd57;}export function getPushRecoveryPath(_0x3c3d3a){const _0x43bd19=a113_0x46ff4f,_0x5d56a9=a113_0x487c70['dirname'](_0x3c3d3a),_0x1a3d76=a113_0x487c70['basename'](_0x3c3d3a);return a113_0x487c70['join'](_0x5d56a9,'.'+_0x1a3d76+_0x43bd19(0xb9));}export function readPushRecovery(_0x31eb17){const _0x31c90b=a113_0x46ff4f,_0xc29bb6=getPushRecoveryPath(_0x31eb17);if(!existsSync(_0xc29bb6))return undefined;try{const _0x2e8362=readFileSync(_0xc29bb6,_0x31c90b(0xab)),_0x22e565=JSON['parse'](_0x2e8362);if(_0x22e565?.[_0x31c90b(0xb2)]!==0x1||typeof _0x22e565[_0x31c90b(0xb4)]!=='string')return undefined;return _0x22e565;}catch(_0x1a7a85){return _0x1a7a85 instanceof SyntaxError?logger[_0x31c90b(0xbc)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x1a7a85):logger[_0x31c90b(0xb6)](_0x31c90b(0xae)+_0x1a7a85),undefined;}}export function writePushRecovery(_0x1a5054,_0x12d4b8){const _0x599f60=a113_0x46ff4f,_0x171827=getPushRecoveryPath(_0x1a5054),_0x14aabc=_0x171827+_0x599f60(0xb3);writeFileSync(_0x14aabc,JSON[_0x599f60(0xb0)](_0x12d4b8,null,0x2)+'\x0a',_0x599f60(0xab)),renameSync(_0x14aabc,_0x171827);}export function deletePushRecovery(_0x31d72b){const _0x46b571=a113_0x46ff4f,_0x1b16ec=getPushRecoveryPath(_0x31d72b);try{unlinkSync(_0x1b16ec);}catch(_0xc98d2f){_0xc98d2f[_0x46b571(0xba)]!==_0x46b571(0xa8)&&logger['debug'](_0x46b571(0xaa)+_0xc98d2f);}}export function saveSegmentToPushRecovery(_0x365c26,_0x1f17d6,_0x339bfb,_0x1998de){const _0x1e568b=a113_0x46ff4f,_0x18f554=readPushRecovery(_0x365c26),_0x50ccaa=_0x18f554?.[_0x1e568b(0xb4)]===_0x1f17d6?{..._0x18f554,'updatedAt':new Date()[_0x1e568b(0xbd)]()}:{'version':0x1,'journeyName':_0x1f17d6,'updatedAt':new Date()[_0x1e568b(0xbd)](),'segments':{}};_0x50ccaa[_0x1e568b(0xbe)][_0x339bfb]=_0x1998de,writePushRecovery(_0x365c26,_0x50ccaa);}
|