@treasuredata/tdx 2026.3.3 → 2026.3.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/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/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/upgrade-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/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.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.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/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/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/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/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/paginate.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/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/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
|
-
(function(
|
|
1
|
+
(function(_0x499fa0,_0x789172){const _0x35ad9c=a120_0x518a,_0x59d15b=_0x499fa0();while(!![]){try{const _0x3d9573=-parseInt(_0x35ad9c(0xe2))/0x1+parseInt(_0x35ad9c(0xe9))/0x2+-parseInt(_0x35ad9c(0xe3))/0x3*(-parseInt(_0x35ad9c(0xe4))/0x4)+-parseInt(_0x35ad9c(0xea))/0x5*(parseInt(_0x35ad9c(0xe8))/0x6)+parseInt(_0x35ad9c(0xe1))/0x7*(-parseInt(_0x35ad9c(0xed))/0x8)+-parseInt(_0x35ad9c(0xf6))/0x9*(-parseInt(_0x35ad9c(0xec))/0xa)+parseInt(_0x35ad9c(0xf3))/0xb*(parseInt(_0x35ad9c(0xf4))/0xc);if(_0x3d9573===_0x789172)break;else _0x59d15b['push'](_0x59d15b['shift']());}catch(_0x15629e){_0x59d15b['push'](_0x59d15b['shift']());}}}(a120_0x4e30,0x257a9));export const MODEL_PRICING={'claude-opus-4-6':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'claude-opus-4-5-20251101':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'opus':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'claude-sonnet-4-5-20250929':{'inputPricePerMTok':0x3,'outputPricePerMTok':0xf,'cacheWritePricePerMTok':3.75,'cacheReadPricePerMTok':0.3},'sonnet':{'inputPricePerMTok':0x3,'outputPricePerMTok':0xf,'cacheWritePricePerMTok':3.75,'cacheReadPricePerMTok':0.3},'claude-haiku-4-5-20251001':{'inputPricePerMTok':0x1,'outputPricePerMTok':0x5,'cacheWritePricePerMTok':1.25,'cacheReadPricePerMTok':0.1},'haiku':{'inputPricePerMTok':0x1,'outputPricePerMTok':0x5,'cacheWritePricePerMTok':1.25,'cacheReadPricePerMTok':0.1}};function a120_0x4e30(){const _0x16dc3d=['2033488rOktMX','Opus\x204.5','4.6','4-5','Opus\x204','Haiku\x204.5','3641649WzfpxS','12dxVKbY','sonnet','603inRsvL','haiku','default','opus','includes','inputPricePerMTok','toLowerCase','Haiku\x204','4.5','7vFPCQO','131166kXRwqz','6oClrHt','369116eKqwLh','Claude','toLocaleString','cacheReadPricePerMTok','198ZexUVJ','132732lkGfZj','29780OSRsaC','cacheWritePricePerMTok','22900rJSRNA'];a120_0x4e30=function(){return _0x16dc3d;};return a120_0x4e30();}export const EXTENDED_CONTEXT_PRICING={'inputPricePerMTok':0x6,'outputPricePerMTok':22.5,'cacheWritePricePerMTok':7.5,'cacheReadPricePerMTok':0.6};function a120_0x518a(_0x2e8da3,_0x24d753){_0x2e8da3=_0x2e8da3-0xdd;const _0x4e30e7=a120_0x4e30();let _0x518ac2=_0x4e30e7[_0x2e8da3];return _0x518ac2;}export const USD_PER_AI_CREDIT=54.24;export const CONTEXT_LIMITS={'sonnet':0x30d40,'haiku':0x30d40,'opus':0x30d40,'default':0x30d40};export function getModelPricing(_0x6c130b){const _0x49d54d=a120_0x518a;if(MODEL_PRICING[_0x6c130b])return MODEL_PRICING[_0x6c130b];const _0x2a049b=_0x6c130b['toLowerCase']();if(_0x2a049b[_0x49d54d(0xfa)](_0x49d54d(0xf9)))return MODEL_PRICING[_0x49d54d(0xf9)];if(_0x2a049b['includes'](_0x49d54d(0xf5)))return MODEL_PRICING[_0x49d54d(0xf5)];if(_0x2a049b[_0x49d54d(0xfa)](_0x49d54d(0xf7)))return MODEL_PRICING[_0x49d54d(0xf7)];return MODEL_PRICING[_0x49d54d(0xf5)];}export function calculateTokenCost(_0x150f9b,_0x50c87f,_0x2ca58f,_0x283825,_0x164e62){const _0x4aea99=a120_0x518a,_0x35781f=0xf4240;return _0x150f9b*_0x164e62[_0x4aea99(0xdd)]/_0x35781f+_0x50c87f*_0x164e62['outputPricePerMTok']/_0x35781f+_0x2ca58f*_0x164e62[_0x4aea99(0xeb)]/_0x35781f+_0x283825*_0x164e62[_0x4aea99(0xe7)]/_0x35781f;}export function usdToAiCredits(_0x1b7ca0){return _0x1b7ca0/USD_PER_AI_CREDIT;}export function calculateCreditsFromTokens(_0x32f78d,_0x2d3737,_0x4f8d32,_0x56876f,_0x18b84e){const _0x33569d=getModelPricing(_0x18b84e),_0x410a72=calculateTokenCost(_0x32f78d,_0x2d3737,_0x4f8d32,_0x56876f,_0x33569d);return usdToAiCredits(_0x410a72);}export function getContextLimit(_0x12cf51){const _0x4a4970=a120_0x518a,_0x4adb18=_0x12cf51[_0x4a4970(0xde)]();if(_0x4adb18[_0x4a4970(0xfa)](_0x4a4970(0xf5)))return CONTEXT_LIMITS['sonnet'];if(_0x4adb18[_0x4a4970(0xfa)]('haiku'))return CONTEXT_LIMITS[_0x4a4970(0xf7)];if(_0x4adb18[_0x4a4970(0xfa)](_0x4a4970(0xf9)))return CONTEXT_LIMITS[_0x4a4970(0xf9)];return CONTEXT_LIMITS[_0x4a4970(0xf8)];}export function getModelDisplayName(_0x2ac548){const _0x173878=a120_0x518a,_0x5896c8=_0x2ac548[_0x173878(0xde)]();if(_0x5896c8[_0x173878(0xfa)](_0x173878(0xf5))){if(_0x5896c8[_0x173878(0xfa)]('4-5')||_0x5896c8[_0x173878(0xfa)](_0x173878(0xe0)))return'Sonnet\x204.5';return'Sonnet\x204';}if(_0x5896c8[_0x173878(0xfa)](_0x173878(0xf7))){if(_0x5896c8[_0x173878(0xfa)](_0x173878(0xf0))||_0x5896c8[_0x173878(0xfa)](_0x173878(0xe0)))return _0x173878(0xf2);return _0x173878(0xdf);}if(_0x5896c8[_0x173878(0xfa)](_0x173878(0xf9))){if(_0x5896c8[_0x173878(0xfa)]('4-6')||_0x5896c8[_0x173878(0xfa)](_0x173878(0xef)))return'Opus\x204.6';if(_0x5896c8[_0x173878(0xfa)](_0x173878(0xf0))||_0x5896c8['includes']('4.5'))return _0x173878(0xee);return _0x173878(0xf1);}return _0x173878(0xe5);}export function formatTokenCount(_0x3e1dc2){const _0x2c7ec5=a120_0x518a;return _0x3e1dc2[_0x2c7ec5(0xe6)]('en-US');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a121_0x15abb7=a121_0x4186;(function(_0x51e2de,_0x54ff93){const _0x424d0c=a121_0x4186,_0x4bd6d6=_0x51e2de();while(!![]){try{const _0x41988d=-parseInt(_0x424d0c(0x101))/0x1+parseInt(_0x424d0c(0x11b))/0x2*(-parseInt(_0x424d0c(0x119))/0x3)+-parseInt(_0x424d0c(0x106))/0x4*(parseInt(_0x424d0c(0x104))/0x5)+-parseInt(_0x424d0c(0x102))/0x6+-parseInt(_0x424d0c(0x115))/0x7*(parseInt(_0x424d0c(0x117))/0x8)+parseInt(_0x424d0c(0x10a))/0x9*(-parseInt(_0x424d0c(0x111))/0xa)+parseInt(_0x424d0c(0x10f))/0xb;if(_0x41988d===_0x54ff93)break;else _0x4bd6d6['push'](_0x4bd6d6['shift']());}catch(_0x5c5c51){_0x4bd6d6['push'](_0x4bd6d6['shift']());}}}(a121_0x411e,0x76398));function a121_0x411e(){const _0x252418=['application/json','158607lcsZsx','1464624TQmfhl','GET','85sDQqMz','application/vnd.treasuredata.v1+json','200780iMsKHH','proxy','/realtime_personalization_services?page[size]=100','cdp','590022miPduq','request','/audiences/','get','create','36214629YCjXfY','update','50WCOxZz','DELETE','delete','/realtime_personalization_services','35bsRXJf','data','1462472GdiJwr','POST','3UQpwWz','site','620260RvzzRH','isArray','httpClient','list','apiKey','/realtime_personalization_services/'];a121_0x411e=function(){return _0x252418;};return a121_0x411e();}import{HTTPClient}from'./client/http-client.js';function a121_0x4186(_0x4ad945,_0x31ea8f){_0x4ad945=_0x4ad945-0x101;const _0x411e36=a121_0x411e();let _0x4186f3=_0x411e36[_0x4ad945];return _0x4186f3;}import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';export class PersonalizationSDK{[a121_0x15abb7(0x11d)];constructor(_0xb66ac0){const _0x3d5258=a121_0x15abb7,_0x59f7db=getEndpoint(_0xb66ac0[_0x3d5258(0x11a)],_0x3d5258(0x109)),_0x3dc213=toHeaderRecord(getAuthHeaders(_0xb66ac0['site'],_0xb66ac0[_0x3d5258(0x11f)],_0xb66ac0['accessToken']));this[_0x3d5258(0x11d)]=new HTTPClient(_0x59f7db,{..._0x3dc213,'Accept':_0x3d5258(0x105),'Content-Type':_0x3d5258(0x121)},{'proxy':_0xb66ac0[_0x3d5258(0x107)]});}async[a121_0x15abb7(0x11e)](_0x3e7e1e){const _0x10d0b6=a121_0x15abb7,_0x48ca20=await this[_0x10d0b6(0x11d)]['request'](_0x10d0b6(0x103),_0x10d0b6(0x10c)+_0x3e7e1e+_0x10d0b6(0x108));return Array[_0x10d0b6(0x11c)](_0x48ca20)?_0x48ca20:_0x48ca20[_0x10d0b6(0x116)]||[];}async[a121_0x15abb7(0x10d)](_0x30f7c3,_0x3c405b){const _0x50c9c0=a121_0x15abb7,_0xdfe0b7=await this[_0x50c9c0(0x11d)]['request'](_0x50c9c0(0x103),_0x50c9c0(0x10c)+_0x30f7c3+_0x50c9c0(0x120)+_0x3c405b);return _0xdfe0b7||{};}async[a121_0x15abb7(0x10e)](_0x14b3b1,_0x3cb862){const _0x56621c=a121_0x15abb7,_0x54d1c3=await this[_0x56621c(0x11d)][_0x56621c(0x10b)](_0x56621c(0x118),_0x56621c(0x10c)+_0x14b3b1+_0x56621c(0x114),{'body':_0x3cb862});return _0x54d1c3||{};}async[a121_0x15abb7(0x110)](_0x573820,_0x44c62c,_0x4c171a){const _0x3224d0=a121_0x15abb7,_0x3519dc=await this[_0x3224d0(0x11d)]['request']('PUT',_0x3224d0(0x10c)+_0x573820+_0x3224d0(0x120)+_0x44c62c,{'body':_0x4c171a});return _0x3519dc||{};}async[a121_0x15abb7(0x113)](_0x503071,_0x3b5813){const _0x132cab=a121_0x15abb7;await this['httpClient'][_0x132cab(0x10b)](_0x132cab(0x112),_0x132cab(0x10c)+_0x503071+_0x132cab(0x120)+_0x3b5813);}}
|
package/dist/sdk/query/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a122_0x25ba97=a122_0x5eaf;function a122_0xbe00(){const _0x55f99c=['Provide\x20SQL\x20via\x20argument\x20or\x20use\x20--file\x20option.','130285bmaTNX','\x0aORDER\x20BY\x20table_name\x0aLIMIT\x20','SQL\x20query\x20is\x20required','\x0a\x20\x20AND\x20schema_name\x20LIKE\x20','\x0a\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20column_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20data_type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20is_nullable\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.columns\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','Database\x20pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','SELECT\x20*\x20FROM\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20ordinal_position\x0a\x20\x20\x20\x20','835569tfhmnm','268339hUUbpV','MISSING_ARGUMENT','isInteger','229998xLOYZb','\x20LIMIT\x20','6GgmbLM','Provide\x20a\x20valid\x20database\x20name\x20or\x20omit\x20to\x20list\x20tables\x20from\x20all\x20databases.','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_schema\x20AS\x20database_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20the\x20pattern\x20to\x20list\x20all\x20databases.','data','Limit\x20must\x20be\x20a\x20positive\x20integer','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20to\x20search\x20all\x20databases.','695559bMRLyq','INVALID_ARGUMENT','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22user_*\x22)\x20or\x20omit\x20to\x20list\x20all\x20tables.','listTables','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','\x20ESCAPE\x20\x27\x5c\x27','trinoApiClient','length','trim','describeTable','Usage:\x20tdx\x20show\x20<database.table>','Table\x20name\x20is\x20required','Database\x20name\x20is\x20required','\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','1864JWJatP','\x0aORDER\x20BY\x20database_name\x0aLIMIT\x20','Provide\x20a\x20positive\x20number\x20for\x20limit\x20(e.g.,\x20100).','execute','\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20','Use\x20--limit\x20<number>\x20to\x20specify\x20row\x20limit\x20(must\x20be\x20positive).','slice','\x0a\x20\x20\x20\x20','executeQuery','\x0a\x20\x20AND\x20table_name\x20LIKE\x20','Usage:\x20tdx\x20describe\x20<database.table>','87840ADeklf','Limit\x20must\x20be\x20a\x20positive\x20number','7091DgIGUu','4OydRsj','Database\x20name\x20cannot\x20be\x20empty\x20or\x20whitespace-only'];a122_0xbe00=function(){return _0x55f99c;};return a122_0xbe00();}function a122_0x5eaf(_0x19d324,_0x577a48){_0x19d324=_0x19d324-0xa3;const _0xbe002f=a122_0xbe00();let _0x5eaff2=_0xbe002f[_0x19d324];return _0x5eaff2;}(function(_0xdf61bc,_0x2acc3c){const _0x32f66b=a122_0x5eaf,_0x12169c=_0xdf61bc();while(!![]){try{const _0x4ef629=parseInt(_0x32f66b(0xa6))/0x1+-parseInt(_0x32f66b(0xa9))/0x2+parseInt(_0x32f66b(0xb2))/0x3*(parseInt(_0x32f66b(0xce))/0x4)+-parseInt(_0x32f66b(0xd1))/0x5*(parseInt(_0x32f66b(0xab))/0x6)+-parseInt(_0x32f66b(0xcd))/0x7*(parseInt(_0x32f66b(0xc0))/0x8)+parseInt(_0x32f66b(0xa5))/0x9+parseInt(_0x32f66b(0xcb))/0xa;if(_0x4ef629===_0x2acc3c)break;else _0x12169c['push'](_0x12169c['shift']());}catch(_0x3426b4){_0x12169c['push'](_0x12169c['shift']());}}}(a122_0xbe00,0x36ddc));import{TrinoApiClient}from'../client/trino-api-client.js';import{escapeStringLiteral,buildLikePattern}from'../../utils/string-utils.js';import{SDKError,ErrorCode}from'../errors.js';import{DEFAULT_LISTING_LIMIT}from'../../core/constants.js';export class QuerySDK{[a122_0x25ba97(0xb8)];constructor(_0x1a1643){this['trinoApiClient']=new TrinoApiClient(_0x1a1643);}async[a122_0x25ba97(0xc3)](_0x4cefff,_0x5675ad){const _0x627ff=a122_0x25ba97;if(!_0x4cefff||_0x4cefff[_0x627ff(0xba)]()['length']===0x0)throw new SDKError(ErrorCode[_0x627ff(0xa7)],_0x627ff(0xd3),undefined,{'helpText':_0x627ff(0xd0)});return await this['trinoApiClient'][_0x627ff(0xc8)](_0x4cefff,_0x5675ad);}async['listDatabases'](_0x37bc02,_0x37507a=DEFAULT_LISTING_LIMIT){const _0x6de9bc=a122_0x25ba97;if(_0x37bc02!==undefined&&_0x37bc02[_0x6de9bc(0xba)]()[_0x6de9bc(0xb9)]===0x0)throw new SDKError(ErrorCode[_0x6de9bc(0xb3)],_0x6de9bc(0xb6),undefined,{'helpText':_0x6de9bc(0xae)});if(_0x37507a<=0x0)throw new SDKError(ErrorCode[_0x6de9bc(0xb3)],_0x6de9bc(0xcc),undefined,{'helpText':_0x6de9bc(0xc2)});let _0x3a768f='\x0a\x20\x20\x20\x20\x20\x20SELECT\x20schema_name\x20AS\x20database_name\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20';_0x37bc02&&(_0x3a768f+=_0x6de9bc(0xd4)+buildLikePattern(_0x37bc02)+'\x20ESCAPE\x20\x27\x5c\x27');_0x3a768f+=_0x6de9bc(0xc1)+_0x37507a;const _0x53cc7d=await this['trinoApiClient']['executeQuery'](_0x3a768f[_0x6de9bc(0xba)]());return _0x53cc7d[_0x6de9bc(0xaf)];}async[a122_0x25ba97(0xb5)](_0x3d7fc4,_0x25fb6c,_0x4776af,_0xb3a53c=DEFAULT_LISTING_LIMIT){const _0x377826=a122_0x25ba97;if(_0x3d7fc4!==undefined&&_0x3d7fc4[_0x377826(0xba)]()[_0x377826(0xb9)]===0x0)throw new SDKError(ErrorCode[_0x377826(0xb3)],_0x377826(0xcf),undefined,{'helpText':_0x377826(0xac)});if(_0x25fb6c!==undefined&&_0x25fb6c[_0x377826(0xba)]()[_0x377826(0xb9)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only',undefined,{'helpText':_0x377826(0xb4)});if(_0x4776af!==undefined&&_0x4776af[_0x377826(0xba)]()[_0x377826(0xb9)]===0x0)throw new SDKError(ErrorCode[_0x377826(0xb3)],_0x377826(0xd6),undefined,{'helpText':_0x377826(0xb1)});if(_0xb3a53c<=0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x377826(0xcc),undefined,{'helpText':_0x377826(0xc2)});let _0x3c9747;_0x3d7fc4?(_0x3c9747=_0x377826(0xa3)+escapeStringLiteral(_0x3d7fc4)+'\x0a\x20\x20\x20\x20\x20\x20',_0x25fb6c&&(_0x3c9747+=_0x377826(0xc9)+buildLikePattern(_0x25fb6c)+'\x20ESCAPE\x20\x27\x5c\x27'),_0x3c9747+=_0x377826(0xd2)+_0xb3a53c):(_0x3c9747=_0x377826(0xad),_0x4776af&&(_0x3c9747+='\x0a\x20\x20AND\x20table_schema\x20LIKE\x20'+buildLikePattern(_0x4776af)+_0x377826(0xb7)),_0x25fb6c&&(_0x3c9747+=_0x377826(0xc9)+buildLikePattern(_0x25fb6c)+_0x377826(0xb7)),_0x3c9747+='\x0aORDER\x20BY\x20database_name,\x20table_name\x0aLIMIT\x20'+_0xb3a53c);const _0x1a7b28=await this[_0x377826(0xb8)][_0x377826(0xc8)](_0x3c9747[_0x377826(0xba)]());return _0x1a7b28['data'];}async['validateDatabase'](_0x2c9beb){const _0x3fef77=a122_0x25ba97,_0xbc28c8=('\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20schema_name\x20=\x20'+escapeStringLiteral(_0x2c9beb)+_0x3fef77(0xc7))['trim'](),_0x43591d=await this[_0x3fef77(0xb8)][_0x3fef77(0xc8)](_0xbc28c8);return _0x43591d[_0x3fef77(0xaf)][_0x3fef77(0xb9)]>0x0;}async['validateTable'](_0x348414,_0x2c051a){const _0x25de2b=a122_0x25ba97,_0x4878c4=(_0x25de2b(0xbf)+escapeStringLiteral(_0x348414)+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20'+escapeStringLiteral(_0x2c051a)+_0x25de2b(0xc7))[_0x25de2b(0xba)](),_0x2a52e7=await this['trinoApiClient'][_0x25de2b(0xc8)](_0x4878c4);return _0x2a52e7[_0x25de2b(0xaf)][_0x25de2b(0xb9)]>0x0;}async[a122_0x25ba97(0xbb)](_0x83c08a,_0x3f337a){const _0x86db41=a122_0x25ba97;if(!_0x83c08a||_0x83c08a['trim']()[_0x86db41(0xb9)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x86db41(0xbe),undefined,{'helpText':_0x86db41(0xca)});if(!_0x3f337a||_0x3f337a['trim']()[_0x86db41(0xb9)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x86db41(0xbd),undefined,{'helpText':_0x86db41(0xca)});const _0x90af7e=(_0x86db41(0xd5)+escapeStringLiteral(_0x83c08a)+_0x86db41(0xc4)+escapeStringLiteral(_0x3f337a)+_0x86db41(0xa4))[_0x86db41(0xba)](),_0x47a394=await this['trinoApiClient'][_0x86db41(0xc8)](_0x90af7e);return _0x47a394[_0x86db41(0xaf)];}async['showTable'](_0x588d59,_0xe22d85,_0x45144f=0x28,_0x44f8c9){const _0x4b1602=a122_0x25ba97;if(!_0x588d59||_0x588d59[_0x4b1602(0xba)]()[_0x4b1602(0xb9)]===0x0)throw new SDKError(ErrorCode[_0x4b1602(0xa7)],_0x4b1602(0xbe),undefined,{'helpText':_0x4b1602(0xbc)});if(!_0xe22d85||_0xe22d85[_0x4b1602(0xba)]()[_0x4b1602(0xb9)]===0x0)throw new SDKError(ErrorCode[_0x4b1602(0xa7)],_0x4b1602(0xbd),undefined,{'helpText':'Usage:\x20tdx\x20show\x20<database.table>'});if(!Number[_0x4b1602(0xa8)](_0x45144f)||_0x45144f<=0x0)throw new SDKError(ErrorCode[_0x4b1602(0xb3)],_0x4b1602(0xb0),undefined,{'helpText':_0x4b1602(0xc5)});const _0x598e6e=escapeStringLiteral(_0x588d59)[_0x4b1602(0xc6)](0x1,-0x1)+'.'+escapeStringLiteral(_0xe22d85)[_0x4b1602(0xc6)](0x1,-0x1),_0x2464ba=_0x4b1602(0xd7)+_0x598e6e+_0x4b1602(0xaa)+_0x45144f,_0x10d546=await this[_0x4b1602(0xb8)][_0x4b1602(0xc8)](_0x2464ba,{'catalog':_0x44f8c9,'schema':_0x588d59});return _0x10d546;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xe0014a,_0x4e8853){const _0x1ea3b4=a123_0x39aa,_0x230fb4=_0xe0014a();while(!![]){try{const _0x699504=parseInt(_0x1ea3b4(0xf6))/0x1*(parseInt(_0x1ea3b4(0x101))/0x2)+-parseInt(_0x1ea3b4(0x105))/0x3+parseInt(_0x1ea3b4(0xef))/0x4+parseInt(_0x1ea3b4(0x108))/0x5+-parseInt(_0x1ea3b4(0x103))/0x6+-parseInt(_0x1ea3b4(0xfd))/0x7+parseInt(_0x1ea3b4(0x106))/0x8*(parseInt(_0x1ea3b4(0xee))/0x9);if(_0x699504===_0x4e8853)break;else _0x230fb4['push'](_0x230fb4['shift']());}catch(_0x3b055f){_0x230fb4['push'](_0x230fb4['shift']());}}}(a123_0x29e7,0xcbf43));import{createInterface}from'readline';import{readFileContent}from'../../utils/file-reader.js';function a123_0x29e7(){const _0x1b6d21=['length','5194020lUZKXL','map','2970LbKOQD','8VrwqzE','line','640380myxhap','8085069EPxFRA','6198176nTgimb','error','filter','isTTY','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','stdin\x20','trim','1HnwhEw','File\x20\x27','replace','test','push','toLowerCase','join','9517571pedZdS','stdin','Content\x20contains\x20no\x20SQL\x20statements','close','971494pFzNBU'];a123_0x29e7=function(){return _0x1b6d21;};return a123_0x29e7();}export function stripSqlComments(_0x8eca38){const _0x2af5c7=a123_0x39aa;let _0xf1efbd=_0x8eca38[_0x2af5c7(0xf8)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0xf1efbd=_0xf1efbd[_0x2af5c7(0xf8)](/--.*$/gm,''),_0xf1efbd[_0x2af5c7(0xf5)]();}function isEscaped(_0x51a178,_0x44d88b){let _0x2abee3=0x0;for(let _0x1e96ea=_0x44d88b-0x1;_0x1e96ea>=0x0&&_0x51a178[_0x1e96ea]==='\x5c';_0x1e96ea--){_0x2abee3++;}return _0x2abee3%0x2===0x1;}function a123_0x39aa(_0x342cbd,_0xa7d0b3){_0x342cbd=_0x342cbd-0xee;const _0x29e768=a123_0x29e7();let _0x39aae0=_0x29e768[_0x342cbd];return _0x39aae0;}export function splitSqlStatements(_0xfac49b){const _0x42bf6c=a123_0x39aa,_0x5bd127=stripSqlComments(_0xfac49b);if(!_0x5bd127)throw new Error(_0x42bf6c(0xff));const _0x3c0d3b=[];let _0x17b17b='',_0xa28e23=![],_0x375947=![],_0x10c077=![];for(let _0x189c2b=0x0;_0x189c2b<_0xfac49b['length'];_0x189c2b++){const _0x52ca64=_0xfac49b[_0x189c2b];if(_0x52ca64==='\x27'&&!isEscaped(_0xfac49b,_0x189c2b)&&!_0x375947&&!_0x10c077)_0xa28e23=!_0xa28e23;else{if(_0x52ca64==='\x22'&&!isEscaped(_0xfac49b,_0x189c2b)&&!_0xa28e23&&!_0x10c077)_0x375947=!_0x375947;else _0x52ca64==='`'&&!isEscaped(_0xfac49b,_0x189c2b)&&!_0xa28e23&&!_0x375947&&(_0x10c077=!_0x10c077);}if(_0x52ca64===';'&&!_0xa28e23&&!_0x375947&&!_0x10c077){const _0x1a2804=_0x17b17b[_0x42bf6c(0xf5)]();_0x1a2804&&_0x3c0d3b['push'](_0x1a2804),_0x17b17b='';}else _0x17b17b+=_0x52ca64;}const _0x44b902=_0x17b17b['trim']();_0x44b902&&_0x3c0d3b[_0x42bf6c(0xfa)](_0x44b902);const _0x4c8202=_0x3c0d3b[_0x42bf6c(0x104)](_0xbc74bb=>_0xbc74bb['trim']())[_0x42bf6c(0xf1)](_0x395810=>{const _0x374a25=stripSqlComments(_0x395810);return _0x374a25['length']>0x0;});if(_0x4c8202[_0x42bf6c(0x102)]===0x0)throw new Error('Content\x20contains\x20no\x20SQL\x20statements');return _0x4c8202;}export function readSqlStatementsFromFile(_0xe83d2b){const _0x391ffe=a123_0x39aa,_0x5ed826=readFileContent(_0xe83d2b);try{return splitSqlStatements(_0x5ed826);}catch(_0x3a4efa){throw new Error(_0x391ffe(0xf7)+_0xe83d2b+'\x27\x20'+_0x3a4efa['message'][_0x391ffe(0xfb)]());}}export async function readStdinContent(){const _0x4872a9=a123_0x39aa;if(process[_0x4872a9(0xfe)][_0x4872a9(0xf2)])throw new Error(_0x4872a9(0xf3));return new Promise((_0x14a077,_0x19156b)=>{const _0x1907ad=_0x4872a9,_0x460868=[],_0x326345=createInterface({'input':process[_0x1907ad(0xfe)],'terminal':![]});_0x326345['on'](_0x1907ad(0x107),_0x402a66=>{const _0x476859=_0x1907ad;_0x460868[_0x476859(0xfa)](_0x402a66);}),_0x326345['on'](_0x1907ad(0x100),()=>{const _0x1943da=_0x1907ad;_0x14a077(_0x460868[_0x1943da(0xfc)]('\x0a'));}),_0x326345['on'](_0x1907ad(0xf0),_0x2e2a2e=>{_0x326345['close'](),_0x19156b(new Error('Error\x20reading\x20from\x20stdin:\x20'+_0x2e2a2e['message']));});});}export async function readSqlStatementsFromStdin(){const _0x1d5a69=a123_0x39aa,_0x115f37=await readStdinContent();try{return splitSqlStatements(_0x115f37);}catch(_0x25c15a){throw new Error(_0x1d5a69(0xf4)+_0x25c15a['message']['toLowerCase']());}}export function isSqlFilePath(_0x38dffd){const _0x4c1a98=a123_0x39aa;return/\w\.sql$/[_0x4c1a98(0xf9)](_0x38dffd);}
|
package/dist/sdk/realtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a124_0x49ce1f=a124_0x9899;function a124_0x9899(_0x3db2be,_0x4e26c4){_0x3db2be=_0x3db2be-0xc2;const _0x5ee965=a124_0x5ee9();let _0x98997c=_0x5ee965[_0x3db2be];return _0x98997c;}(function(_0x2ffdfc,_0x2b2220){const _0x1f79ff=a124_0x9899,_0x307e37=_0x2ffdfc();while(!![]){try{const _0x2986b6=parseInt(_0x1f79ff(0xe1))/0x1*(parseInt(_0x1f79ff(0xe5))/0x2)+parseInt(_0x1f79ff(0xc4))/0x3*(-parseInt(_0x1f79ff(0xe0))/0x4)+parseInt(_0x1f79ff(0xcc))/0x5+-parseInt(_0x1f79ff(0xcb))/0x6*(-parseInt(_0x1f79ff(0xc9))/0x7)+-parseInt(_0x1f79ff(0xeb))/0x8*(parseInt(_0x1f79ff(0xda))/0x9)+-parseInt(_0x1f79ff(0xdc))/0xa*(parseInt(_0x1f79ff(0xd2))/0xb)+parseInt(_0x1f79ff(0xea))/0xc*(-parseInt(_0x1f79ff(0xe7))/0xd);if(_0x2986b6===_0x2b2220)break;else _0x307e37['push'](_0x307e37['shift']());}catch(_0x142c45){_0x307e37['push'](_0x307e37['shift']());}}}(a124_0x5ee9,0x5af92));import{HTTPClient}from'./client/http-client.js';import{CDPApiClient}from'./client/cdp-api-client.js';import{getEndpoint}from'./client/endpoints.js';function a124_0x5ee9(){const _0x5d3728=['228844iYnoaK','1QUetSd','length','httpClient','map','1468182APDyPt','name','250497SiDQTP','scheduleType','attributes','156nbuTgP','447976RJPmyV','listParentSegments','disabled','all','15LPBswi','updatedAt','keys','/realtime_setting','application/json','28AvumwY','cdp','543948DRrAYC','479320zLPxuV','PUT','getStatus','apiKey','object','/audiences/','653631ILMBiA','cdpClient','enabled','isEnabled','updateConfig','GET','site','list','36oEBcTR','request','10UfMYcA','application/vnd.treasuredata.v1+json','getParentSegment','accessToken'];a124_0x5ee9=function(){return _0x5d3728;};return a124_0x5ee9();}import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';export class RealtimeSDK{[a124_0x49ce1f(0xe3)];['cdpClient'];constructor(_0x1772af){const _0x5cd063=a124_0x49ce1f,_0x3cf6da=getEndpoint(_0x1772af[_0x5cd063(0xd8)],_0x5cd063(0xca)),_0x53fd0f=toHeaderRecord(getAuthHeaders(_0x1772af[_0x5cd063(0xd8)],_0x1772af[_0x5cd063(0xcf)],_0x1772af[_0x5cd063(0xdf)]));this[_0x5cd063(0xe3)]=new HTTPClient(_0x3cf6da,{..._0x53fd0f,'Accept':_0x5cd063(0xdd),'Content-Type':_0x5cd063(0xc8)},{'proxy':_0x1772af['proxy']}),this[_0x5cd063(0xd3)]=new CDPApiClient(_0x1772af);}async[a124_0x49ce1f(0xd5)](_0xdd2962){const _0x10ee2f=a124_0x49ce1f;try{const _0x2fd3cf=await this['httpClient']['request'](_0x10ee2f(0xd7),'/audiences/'+_0xdd2962+_0x10ee2f(0xc7));return _0x2fd3cf!==null;}catch{return![];}}async[a124_0x49ce1f(0xce)](_0x302b6f){const _0x4464b9=a124_0x49ce1f,_0xae8e65=await this[_0x4464b9(0xd3)][_0x4464b9(0xde)](_0x302b6f);let _0x2a9495=![],_0x13a549=![];try{const _0x16974d=await this[_0x4464b9(0xe3)][_0x4464b9(0xdb)](_0x4464b9(0xd7),_0x4464b9(0xd1)+_0x302b6f+_0x4464b9(0xc7));_0x2a9495=!![],_0x13a549=!!(_0x16974d&&typeof _0x16974d===_0x4464b9(0xd0)&&Object[_0x4464b9(0xc6)](_0x16974d)[_0x4464b9(0xe2)]>0x0);}catch{_0x2a9495=![],_0x13a549=![];}return{'parent_segment_id':_0x302b6f,'parent_segment_name':_0xae8e65[_0x4464b9(0xe9)][_0x4464b9(0xe6)],'realtime_enabled':_0x2a9495,'realtime_config_exists':_0x13a549,'status':_0x2a9495?_0x4464b9(0xd4):_0x4464b9(0xc2)};}async['getConfig'](_0x1df553){const _0x1b9654=a124_0x49ce1f,_0x95d705=await this[_0x1b9654(0xe3)][_0x1b9654(0xdb)]('GET','/audiences/'+_0x1df553+_0x1b9654(0xc7));return _0x95d705||{};}async[a124_0x49ce1f(0xd6)](_0x2410c0,_0x328d96){const _0x510d3f=a124_0x49ce1f,_0x5bffb2=await this['httpClient'][_0x510d3f(0xdb)](_0x510d3f(0xcd),_0x510d3f(0xd1)+_0x2410c0+_0x510d3f(0xc7),{'body':_0x328d96});return _0x5bffb2||{};}async[a124_0x49ce1f(0xd9)](){const _0xd47132=a124_0x49ce1f,_0x52b7d2=await this[_0xd47132(0xd3)][_0xd47132(0xec)](),_0x3ed859=await Promise[_0xd47132(0xc3)](_0x52b7d2[_0xd47132(0xe4)](async _0x269a16=>{const _0x45d2e5=_0xd47132,_0x9bcc99=await this[_0x45d2e5(0xd5)](_0x269a16['id']);return{'id':_0x269a16['id'],'name':_0x269a16[_0x45d2e5(0xe9)]['name'],'population':_0x269a16['attributes']['population'],'realtime_enabled':_0x9bcc99,'schedule_type':_0x269a16[_0x45d2e5(0xe9)][_0x45d2e5(0xe8)],'updated_at':_0x269a16[_0x45d2e5(0xe9)][_0x45d2e5(0xc5)]};}));return _0x3ed859;}}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a125_0x34a2a7=a125_0x1631;(function(_0x46ed9e,_0x5a1a54){const _0x18f99b=a125_0x1631,_0x20fa54=_0x46ed9e();while(!![]){try{const _0xb387bd=parseInt(_0x18f99b(0x110))/0x1+parseInt(_0x18f99b(0xfc))/0x2+parseInt(_0x18f99b(0x108))/0x3+-parseInt(_0x18f99b(0x10f))/0x4+parseInt(_0x18f99b(0xf1))/0x5*(parseInt(_0x18f99b(0x109))/0x6)+-parseInt(_0x18f99b(0x119))/0x7+-parseInt(_0x18f99b(0xf6))/0x8;if(_0xb387bd===_0x5a1a54)break;else _0x20fa54['push'](_0x20fa54['shift']());}catch(_0x39ffca){_0x20fa54['push'](_0x20fa54['shift']());}}}(a125_0x1813,0x951f2));function a125_0x1631(_0x11e234,_0x11b58e){_0x11e234=_0x11e234-0xf1;const _0x1813d2=a125_0x1813();let _0x163155=_0x1813d2[_0x11e234];return _0x163155;}import{TDApiClient}from'./client/td-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function normalizeTimestamp(_0x1dc758){const _0x1658e8=a125_0x1631;if(!_0x1dc758)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/[_0x1658e8(0x128)](_0x1dc758))return _0x1dc758;return _0x1dc758['replace'](_0x1658e8(0xfd),'Z')[_0x1658e8(0xf7)]('\x20','T');}function a125_0x1813(){const _0x472f22=['Database\x20is\x20required','has_next_page','floor','client','update','Type\x20is\x20required','test','type','runSchedule','5OaPXad','slice','pattern','length','Invalid\x20time\x20format:\x20','8083632TFvsRG','replace','map','Schedule\x20not\x20found:\x20','find','query','2180972phBhYG','\x20UTC','num','push','getScheduleHistory','create','show','Schedule\x20name\x20is\x20required','\x5c$&','run','string','history','3275316QYXWdk','6502080LlBWJt','INVALID_ARGUMENT','filter','now','updated_at','desc','3380372JFQKbD','83749BrSljf','end_at','time','Query\x20is\x20required','listQueries','NOT_FOUND','list','getTime','deleteSchedule','6183366dWWsMo','created_at','name','queries','limit','listSchedules','scheduled','cron','database'];a125_0x1813=function(){return _0x472f22;};return a125_0x1813();}export class ScheduleSDK{['client'];constructor(_0x44e28c){const _0x2391de=a125_0x1631;this[_0x2391de(0x125)]=new TDApiClient(_0x44e28c);}async[a125_0x34a2a7(0x116)](_0x3b2067){const _0x274872=a125_0x34a2a7,_0x155687=await this[_0x274872(0x125)][_0x274872(0x11e)](),_0x5a1133=_0x155687[_0x274872(0xf8)](_0x56c021=>({..._0x56c021,'created_at':normalizeTimestamp(_0x56c021[_0x274872(0x11a)])??_0x56c021['created_at']}));if(_0x3b2067?.[_0x274872(0x11d)]&&_0x3b2067[_0x274872(0x11d)]>0x0)return _0x5a1133[_0x274872(0xf2)](0x0,_0x3b2067[_0x274872(0x11d)]);return _0x5a1133;}async[a125_0x34a2a7(0x114)](_0x282702){const _0x26dda0=a125_0x34a2a7,_0x31a486=0x64,_0x5e6aa9=_0x282702?.['limit'],_0x2f5512=[];let _0x424540=!![],_0x3e5ad4,_0x3ea138,_0x41be0f;if(_0x282702?.[_0x26dda0(0xf3)]){const _0x4dff46=_0x282702['pattern'][_0x26dda0(0xf7)](/[.+^${}()|[\]\\]/g,_0x26dda0(0x104)),_0xd2bf74=_0x4dff46[_0x26dda0(0xf7)](/\*/g,'.*')['replace'](/\?/g,'.');_0x41be0f=new RegExp('^'+_0xd2bf74+'$','i');}while(_0x424540&&(!_0x5e6aa9||_0x2f5512[_0x26dda0(0xf4)]<_0x5e6aa9)){const _0x45568b=await this['client']['listQueries']({'anchor_column':_0x26dda0(0x10d),'sort_direction':_0x26dda0(0x10e),'page_size':_0x31a486,'anchor_id':_0x3e5ad4,'anchor_value':_0x3ea138});let _0x10aa6e=_0x45568b[_0x26dda0(0x11c)];_0x282702?.[_0x26dda0(0x11f)]&&(_0x10aa6e=_0x10aa6e[_0x26dda0(0x10b)](_0x1a7ae8=>_0x1a7ae8[_0x26dda0(0x120)]!==null));_0x41be0f&&(_0x10aa6e=_0x10aa6e[_0x26dda0(0x10b)](_0x414e1f=>_0x414e1f[_0x26dda0(0x11b)]&&_0x41be0f['test'](_0x414e1f[_0x26dda0(0x11b)])));_0x2f5512[_0x26dda0(0xff)](..._0x10aa6e),_0x424540=_0x45568b['pagination'][_0x26dda0(0x123)];if(_0x424540&&_0x45568b['queries'][_0x26dda0(0xf4)]>0x0){const _0x3b29c1=_0x45568b[_0x26dda0(0x11c)][_0x45568b[_0x26dda0(0x11c)][_0x26dda0(0xf4)]-0x1];_0x3e5ad4=_0x3b29c1['id'],_0x3ea138=_0x3b29c1[_0x26dda0(0x10d)];}}const _0x2082c2=_0x5e6aa9?_0x2f5512['slice'](0x0,_0x5e6aa9):_0x2f5512;return{'queries':_0x2082c2,'pagination':{'has_next_page':_0x424540||(_0x5e6aa9?_0x2f5512[_0x26dda0(0xf4)]>_0x5e6aa9:![])}};}async[a125_0x34a2a7(0x102)](_0x1e44ad){const _0x33266b=a125_0x34a2a7,_0x15d0e4=await this[_0x33266b(0x125)]['listSchedules'](),_0x345ea8=_0x15d0e4[_0x33266b(0xfa)](_0x4999ec=>_0x4999ec['name']===_0x1e44ad);if(!_0x345ea8)throw new SDKError(ErrorCode[_0x33266b(0x115)],_0x33266b(0xf9)+_0x1e44ad);return{..._0x345ea8,'created_at':normalizeTimestamp(_0x345ea8[_0x33266b(0x11a)])??_0x345ea8[_0x33266b(0x11a)]};}async[a125_0x34a2a7(0x101)](_0x5f1331,_0x48df8f){const _0x215bb4=a125_0x34a2a7;if(!_0x5f1331)throw new SDKError(ErrorCode[_0x215bb4(0x10a)],_0x215bb4(0x103));if(!_0x48df8f[_0x215bb4(0x121)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x215bb4(0x122));if(!_0x48df8f[_0x215bb4(0xfb)])throw new SDKError(ErrorCode[_0x215bb4(0x10a)],_0x215bb4(0x113));if(!_0x48df8f[_0x215bb4(0x129)])throw new SDKError(ErrorCode[_0x215bb4(0x10a)],_0x215bb4(0x127));return await this[_0x215bb4(0x125)]['createSchedule'](_0x5f1331,_0x48df8f);}async[a125_0x34a2a7(0x126)](_0x5c059c,_0x3a64e6){const _0x397340=a125_0x34a2a7;if(!_0x5c059c)throw new SDKError(ErrorCode[_0x397340(0x10a)],_0x397340(0x103));return await this[_0x397340(0x125)]['updateSchedule'](_0x5c059c,_0x3a64e6);}async['delete'](_0xa6806a){const _0x3d3109=a125_0x34a2a7;if(!_0xa6806a)throw new SDKError(ErrorCode[_0x3d3109(0x10a)],_0x3d3109(0x103));return await this['client'][_0x3d3109(0x118)](_0xa6806a);}async[a125_0x34a2a7(0x105)](_0x2756b2,_0x5bd1bd){const _0x2bd844=a125_0x34a2a7;if(!_0x2756b2)throw new SDKError(ErrorCode[_0x2bd844(0x10a)],_0x2bd844(0x103));let _0x2acc24;if(_0x5bd1bd?.[_0x2bd844(0x112)]){const _0x1be79a=typeof _0x5bd1bd[_0x2bd844(0x112)]===_0x2bd844(0x106)?new Date(_0x5bd1bd[_0x2bd844(0x112)]):_0x5bd1bd[_0x2bd844(0x112)];if(isNaN(_0x1be79a['getTime']()))throw new SDKError(ErrorCode[_0x2bd844(0x10a)],_0x2bd844(0xf5)+_0x5bd1bd[_0x2bd844(0x112)]);_0x2acc24=Math[_0x2bd844(0x124)](_0x1be79a[_0x2bd844(0x117)]()/0x3e8);}else _0x2acc24=Math[_0x2bd844(0x124)](Date[_0x2bd844(0x10c)]()/0x3e8);if(_0x5bd1bd?.[_0x2bd844(0xfe)]!==undefined){if(_0x5bd1bd[_0x2bd844(0xfe)]<0x1||_0x5bd1bd[_0x2bd844(0xfe)]>0xa)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'num\x20must\x20be\x20between\x201\x20and\x2010');}return await this[_0x2bd844(0x125)][_0x2bd844(0x12a)](_0x2756b2,_0x2acc24,_0x5bd1bd?.[_0x2bd844(0xfe)]);}async[a125_0x34a2a7(0x107)](_0x4ecae0,_0x227915){const _0xddc2bc=a125_0x34a2a7;if(!_0x4ecae0)throw new SDKError(ErrorCode[_0xddc2bc(0x10a)],_0xddc2bc(0x103));const _0x2ac1d3=await this['client'][_0xddc2bc(0x100)](_0x4ecae0,_0x227915);return{..._0x2ac1d3,'history':_0x2ac1d3[_0xddc2bc(0x107)][_0xddc2bc(0xf8)](_0x49c85f=>({..._0x49c85f,'created_at':normalizeTimestamp(_0x49c85f[_0xddc2bc(0x11a)]),'start_at':normalizeTimestamp(_0x49c85f['start_at']),'end_at':normalizeTimestamp(_0x49c85f[_0xddc2bc(0x111)])}))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a126_0x2cb009=a126_0xf51e;(function(_0x850f55,_0x280433){const _0x40946d=a126_0xf51e,_0x273d9e=_0x850f55();while(!![]){try{const _0x226218=-parseInt(_0x40946d(0x1c9))/0x1+-parseInt(_0x40946d(0x1e8))/0x2*(parseInt(_0x40946d(0x1f8))/0x3)+-parseInt(_0x40946d(0x1de))/0x4+-parseInt(_0x40946d(0x1da))/0x5*(-parseInt(_0x40946d(0x24a))/0x6)+-parseInt(_0x40946d(0x1b8))/0x7*(-parseInt(_0x40946d(0x216))/0x8)+-parseInt(_0x40946d(0x20b))/0x9*(parseInt(_0x40946d(0x1ba))/0xa)+-parseInt(_0x40946d(0x248))/0xb*(-parseInt(_0x40946d(0x1b7))/0xc);if(_0x226218===_0x280433)break;else _0x273d9e['push'](_0x273d9e['shift']());}catch(_0x2b8f81){_0x273d9e['push'](_0x273d9e['shift']());}}}(a126_0x2754,0xeeafa));import*as a126_0x4958e2 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';function filterRuleAsRuleDef(_0x245685){return _0x245685;}function ruleDefAsFilterRule(_0x26fceb){return _0x26fceb;}export function segmentResponseToDefSync(_0x288f5e,_0x17efb3){const _0x2a9d3e=a126_0xf51e,_0x3edb31=_0x288f5e[_0x2a9d3e(0x1c2)]&&'type'in _0x288f5e[_0x2a9d3e(0x1c2)]&&_0x288f5e['rule'][_0x2a9d3e(0x1c3)];return{'type':'segment','name':_0x288f5e[_0x2a9d3e(0x237)],..._0x288f5e[_0x2a9d3e(0x232)]&&{'description':_0x288f5e['description']},..._0x17efb3&&{'folder':_0x17efb3},..._0x3edb31&&{'rule':apiRuleToYaml(_0x288f5e[_0x2a9d3e(0x1c2)])},..._0x288f5e[_0x2a9d3e(0x1f4)]!==undefined&&{'kind':_0x288f5e[_0x2a9d3e(0x1f4)]===0x0?_0x2a9d3e(0x1e9):_0x288f5e[_0x2a9d3e(0x1f4)]===0x1?_0x2a9d3e(0x212):_0x2a9d3e(0x215)},..._0x288f5e['isVisible']!==undefined&&{'visible':_0x288f5e[_0x2a9d3e(0x23a)]}};}export async function segmentResponseToDef(_0x2788b4,_0x2f170d,_0x56e112){const _0x46844a=a126_0xf51e,_0x41159a=segmentResponseToDefSync(_0x2788b4,_0x56e112);if(!_0x2f170d||!_0x2f170d[_0x46844a(0x1b6)])return _0x41159a;return _0x41159a['rule']&&(_0x41159a[_0x46844a(0x1c2)]=await resolveRuleSegmentRefs(_0x41159a[_0x46844a(0x1c2)],_0x2f170d[_0x46844a(0x1b6)])),_0x41159a;}export function apiRuleToYaml(_0xd120fa){const _0xd8712f=a126_0xf51e,_0x169d39=(_0xd120fa[_0xd8712f(0x1dc)]||[])[_0xd8712f(0x1be)](apiConditionToYaml);if(_0x169d39[_0xd8712f(0x21c)]===0x1&&!_0xd120fa[_0xd8712f(0x232)]&&_0xd8712f(0x1c3)in _0x169d39[0x0]&&(_0x169d39[0x0][_0xd8712f(0x1c3)]===_0xd8712f(0x210)||_0x169d39[0x0][_0xd8712f(0x1c3)]==='Or')){const _0x2f1daa=_0x169d39[0x0];if(_0x2f1daa['type']===_0xd120fa[_0xd8712f(0x1c3)]&&_0x2f1daa[_0xd8712f(0x1dc)])return{'type':_0xd120fa[_0xd8712f(0x1c3)],'conditions':_0x2f1daa[_0xd8712f(0x1dc)],..._0x2f1daa[_0xd8712f(0x232)]&&{'description':_0x2f1daa['description']}};}return{'type':_0xd120fa[_0xd8712f(0x1c3)],'conditions':_0x169d39,..._0xd120fa[_0xd8712f(0x232)]&&{'description':_0xd120fa['description']}};}export async function resolveRuleSegmentRefs(_0x13f602,_0x2d983d){const _0x22f39e=a126_0xf51e;return transformRuleSegmentRefs(_0x13f602,_0x2d983d,_0x47b827=>/^\d+$/[_0x22f39e(0x200)](_0x47b827));}async function transformConditionSegmentRefs(_0x2cb2ed,_0x326cf0,_0x5527b2,_0x51f6c6){const _0x28554a=a126_0xf51e;if(_0x28554a(0x1e6)in _0x2cb2ed&&(_0x2cb2ed[_0x28554a(0x1c3)]==='include'||_0x2cb2ed[_0x28554a(0x1c3)]===_0x28554a(0x1c4))){const _0x28b348=_0x2cb2ed;if(_0x5527b2(_0x28b348['segment']))return{..._0x28b348,'segment':await _0x326cf0(_0x28b348['segment'])};return _0x2cb2ed;}if('conditions'in _0x2cb2ed&&_0x2cb2ed[_0x28554a(0x1dc)]){const _0x490e32=_0x2cb2ed,_0x349e42=await Promise[_0x28554a(0x1fb)](_0x490e32['conditions'][_0x28554a(0x1be)](_0x25c551=>transformConditionSegmentRefs(_0x25c551,_0x326cf0,_0x5527b2,_0x51f6c6)));return{..._0x490e32,'conditions':_0x349e42};}if(_0x28554a(0x1ea)in _0x2cb2ed&&_0x2cb2ed[_0x28554a(0x1ea)]){const _0xa9fc16=_0x2cb2ed,_0x486f13=await _0x51f6c6(filterRuleAsRuleDef(_0xa9fc16[_0x28554a(0x1ea)]),_0x326cf0);return{..._0xa9fc16,'filter':ruleDefAsFilterRule(_0x486f13)};}return _0x2cb2ed;}function a126_0x2754(){const _0x3c0c5d=['set','funnel_stage','48fTTPKR','push','column','emailToIdMap','run_after_journey_refresh','Column','length','has','any','folder','notifyOn','visible','attribute_name','include','from','get','source','every','emailRecipients','aggregation','valid','operator','formatting','timezone','groupingColumns','Reference','rightValue','joinStrategy','description','CONNECTOR_SCHEMA_NOT_FOUND','activations','Unknown\x20connection:\x20','allColumns','name','activationTemplateId','Count','isVisible','errors','repeatUnit','Invalid\x20connector_config\x20for\x20activation\x20\x22','start_at','object','string','replace','entries','add','parse','reverse','attribute','min','496298zdkROl','forEach','48AujJAT','CountDistinct','TimeWithinPast','schedule','orderColumn','orderBy','TimeRange','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','First','startAt','repeat_frequency','join_row','limit','resolveSegmentName','696LcFCtw','1990303IMKWeH','values','2677910rbpuxj','maxValue','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','activation_template_id','map','New\x20Segment','attributes','\x0a\x0aAvailable\x20fields:\x0a','rule','type','exclude','getSchema','leftValue','duration','syndicationBehavior','1209161ymGccv','Last','rule:','CONNECTOR_INVALID_CONFIG','\x22:\x0a','end_on','connector_config','endOn','conditions[','].attribute\x20cannot\x20be\x20empty.\x0a','segmentFolderId','connection','INVALID_ARGUMENT','keys','repeat_sub_frequency','minValue','max','429265mzCqcm','runAfterJourneyRefresh','conditions','sort','3630300rwIyFT','repeat_unit','localeCompare','__UNRESOLVED__','rightValues','Equal','localRuleToName','stringify','segment','arrayMatching','55846dxJKkB','batch','filter','ruleHashToName','null','value','activationParams','all_columns','code','connectorConfig','connector_config\x20for\x20activation\x20\x22','toLowerCase','kind','joinRow','email_recipients','Segment\x20description','177jpRTkJ','join_strategy','notify_on','all','behaviorTableName','Value','isArray','warn','test','behavior','repeatSubFrequency','behavior_table','scheduleType','connectionNameToIdMap','visibility','repeatFrequency','warnings','Unknown\x20email\x20recipient:\x20','Connector:\x20','9pEydAv','columns','not','unit','connectionNameToTypeMap','And','usedNames','realtime','notification'];a126_0x2754=function(){return _0x3c0c5d;};return a126_0x2754();}async function transformRuleSegmentRefs(_0x322a95,_0x2c79e6,_0xeb8305){const _0x178a5c=a126_0xf51e,_0x6ea8b2=(_0x18197a,_0x16da4f)=>transformRuleSegmentRefs(_0x18197a,_0x16da4f,_0xeb8305),_0x3e3307=await Promise['all'](_0x322a95[_0x178a5c(0x1dc)][_0x178a5c(0x1be)](_0x13f66c=>transformConditionSegmentRefs(_0x13f66c,_0x2c79e6,_0xeb8305,_0x6ea8b2)));return{..._0x322a95,'conditions':_0x3e3307};}export async function resolveRuleSegmentIds(_0x3c6b43,_0x38666f){const _0x3f5829=a126_0xf51e;return transformRuleSegmentRefs(_0x3c6b43,_0x38666f,_0x3ce338=>!/^\d+$/[_0x3f5829(0x200)](_0x3ce338));}function isBehaviorApiCondition(_0x3fd89a){const _0x162036=a126_0xf51e;if(!_0x3fd89a[_0x162036(0x1c6)]?.[_0x162036(0x226)]?.[_0x162036(0x237)])return![];return!![];}function apiConditionToYaml(_0x29d1d4){const _0x3fc1de=a126_0xf51e;if(_0x29d1d4['type']===_0x3fc1de(0x210)||_0x29d1d4['type']==='Or'){if(_0x29d1d4[_0x3fc1de(0x1dc)]){const _0x28bd95=_0x29d1d4[_0x3fc1de(0x1dc)][_0x3fc1de(0x1be)](apiConditionToYaml);if(_0x28bd95[_0x3fc1de(0x21c)]===0x1&&!_0x29d1d4[_0x3fc1de(0x232)])return _0x28bd95[0x0];return{'type':_0x29d1d4[_0x3fc1de(0x1c3)],'conditions':_0x28bd95,..._0x29d1d4[_0x3fc1de(0x232)]&&{'description':_0x29d1d4[_0x3fc1de(0x232)]}};}}if(_0x29d1d4[_0x3fc1de(0x1c3)]===_0x3fc1de(0x1fd)&&_0x29d1d4[_0x3fc1de(0x1c6)]&&_0x29d1d4[_0x3fc1de(0x22b)]){const _0x274f59=_0x29d1d4[_0x3fc1de(0x1c6)][_0x3fc1de(0x229)]?buildAggregationDefFromApi(_0x29d1d4['leftValue'][_0x3fc1de(0x229)]):undefined;if(isBehaviorApiCondition(_0x29d1d4)){const _0x2e0c77=_0x29d1d4[_0x3fc1de(0x1c6)][_0x3fc1de(0x226)]['name'];return{'type':'Behavior','attribute':_0x2e0c77,'operator':apiOperatorToYaml(_0x29d1d4['operator']),..._0x29d1d4[_0x3fc1de(0x1e7)]&&_0x29d1d4[_0x3fc1de(0x1e7)]!==_0x3fc1de(0x21e)?{'arrayMatching':_0x29d1d4[_0x3fc1de(0x1e7)]}:{},..._0x29d1d4[_0x3fc1de(0x1c4)]?{'exclude':_0x29d1d4['exclude']}:{},..._0x274f59?{'aggregation':_0x274f59}:{},'source':_0x2e0c77,..._0x29d1d4[_0x3fc1de(0x1c6)]['filter']?{'filter':apiRuleToYaml(_0x29d1d4[_0x3fc1de(0x1c6)][_0x3fc1de(0x1ea)])}:{},..._0x29d1d4['limit']!==undefined&&_0x29d1d4[_0x3fc1de(0x1b5)]!==null?{'limit':_0x29d1d4[_0x3fc1de(0x1b5)]}:{}};}return{'type':_0x3fc1de(0x1fd),'attribute':_0x29d1d4[_0x3fc1de(0x1c6)][_0x3fc1de(0x237)]||'','operator':apiOperatorToYaml(_0x29d1d4[_0x3fc1de(0x22b)]),..._0x29d1d4[_0x3fc1de(0x1e7)]&&_0x29d1d4['arrayMatching']!==_0x3fc1de(0x21e)?{'arrayMatching':_0x29d1d4['arrayMatching']}:{},..._0x29d1d4[_0x3fc1de(0x1c4)]?{'exclude':_0x29d1d4['exclude']}:{},..._0x274f59?{'aggregation':_0x274f59}:{},..._0x29d1d4[_0x3fc1de(0x1c6)][_0x3fc1de(0x1ea)]?{'filter':apiRuleToYaml(_0x29d1d4[_0x3fc1de(0x1c6)]['filter'])}:{},..._0x29d1d4[_0x3fc1de(0x1b5)]!==undefined&&_0x29d1d4[_0x3fc1de(0x1b5)]!==null?{'limit':_0x29d1d4['limit']}:{}};}if(_0x29d1d4[_0x3fc1de(0x1c3)]===_0x3fc1de(0x21b)&&_0x29d1d4[_0x3fc1de(0x218)]&&_0x29d1d4[_0x3fc1de(0x22b)])return{'type':_0x3fc1de(0x21b),'column':_0x29d1d4['column'],'operator':apiOperatorToYaml(_0x29d1d4['operator'])};if(_0x29d1d4['type']===_0x3fc1de(0x22f)&&_0x29d1d4['id'])return{'type':_0x29d1d4[_0x3fc1de(0x1c4)]?_0x3fc1de(0x1c4):'include','segment':_0x29d1d4['id']};return{'type':_0x3fc1de(0x210),'conditions':[]};}function isTemporalOperator(_0x27b7c4){const _0x23d729=a126_0xf51e;return _0x27b7c4===_0x23d729(0x24c)||_0x27b7c4==='TimeWithinNext';}function isBetweenOperator(_0x1d6b38){return _0x1d6b38==='Between';}function getEffectiveValue(_0x3a3647){const _0x396faf=a126_0xf51e,_0x4b6307=_0x3a3647[_0x396faf(0x1b9)];return _0x3a3647[_0x396faf(0x1ed)]??_0x4b6307;}function parseNumericValue(_0x11d8e3){if(typeof _0x11d8e3==='object'&&_0x11d8e3!==null)return _0x11d8e3;if(_0x11d8e3==='')return _0x11d8e3;const _0x4c609e=Number(_0x11d8e3);return Number['isFinite'](_0x4c609e)?_0x4c609e:_0x11d8e3;}function apiOperatorToYaml(_0x23688c){const _0x1061b9=a126_0xf51e;if(isBetweenOperator(_0x23688c[_0x1061b9(0x1c3)]))return{'type':mapApiOperatorType(_0x23688c['type']),..._0x23688c[_0x1061b9(0x20d)]!==undefined&&{'not':_0x23688c[_0x1061b9(0x20d)]},..._0x23688c[_0x1061b9(0x1d8)]!==undefined&&{'min':parseNumericValue(_0x23688c[_0x1061b9(0x1d8)])},..._0x23688c[_0x1061b9(0x1bb)]!==undefined&&{'max':parseNumericValue(_0x23688c[_0x1061b9(0x1bb)])}};if(_0x23688c['type']===_0x1061b9(0x250))return{'type':_0x1061b9(0x250),..._0x23688c[_0x1061b9(0x20d)]!==undefined&&{'not':_0x23688c[_0x1061b9(0x20d)]},..._0x23688c[_0x1061b9(0x1c7)]!==undefined&&{'duration':_0x23688c[_0x1061b9(0x1c7)]},..._0x23688c[_0x1061b9(0x224)]!==undefined&&{'from':_0x23688c[_0x1061b9(0x224)]},..._0x23688c[_0x1061b9(0x245)]!==undefined&&{'reverse':_0x23688c[_0x1061b9(0x245)]}};let _0x978f1d;if(_0x23688c['rightValues']&&_0x23688c[_0x1061b9(0x1e2)][_0x1061b9(0x21c)]>0x0)_0x978f1d=_0x23688c['rightValues'];else{if(_0x23688c[_0x1061b9(0x230)]!==undefined)_0x978f1d=_0x23688c[_0x1061b9(0x230)];else isTemporalOperator(_0x23688c[_0x1061b9(0x1c3)])&&_0x23688c['value']!==undefined&&(_0x978f1d=_0x23688c['value']);}return{'type':mapApiOperatorType(_0x23688c[_0x1061b9(0x1c3)]),..._0x23688c[_0x1061b9(0x20d)]!==undefined&&{'not':_0x23688c[_0x1061b9(0x20d)]},..._0x978f1d!==undefined&&{'value':_0x978f1d},..._0x23688c[_0x1061b9(0x20e)]!==undefined&&{'unit':_0x23688c[_0x1061b9(0x20e)]}};}function mapApiOperatorType(_0x54b8b0){return _0x54b8b0;}export function segmentDefToCreateRequest(_0x59ce9e,_0x10c1d9){const _0x46d85f=a126_0xf51e,_0x516024={'name':_0x59ce9e[_0x46d85f(0x237)]};return _0x59ce9e[_0x46d85f(0x232)]&&(_0x516024['description']=_0x59ce9e['description']),_0x59ce9e['rule']&&(_0x516024[_0x46d85f(0x1c2)]=yamlRuleToApi(_0x59ce9e[_0x46d85f(0x1c2)])),_0x59ce9e['kind']&&(_0x516024[_0x46d85f(0x1f4)]=_0x59ce9e['kind']==='batch'?0x0:_0x59ce9e['kind']===_0x46d85f(0x212)?0x1:0x2),_0x59ce9e[_0x46d85f(0x221)]!==undefined&&(_0x516024[_0x46d85f(0x23a)]=_0x59ce9e[_0x46d85f(0x221)]),_0x10c1d9&&(_0x516024[_0x46d85f(0x1d3)]=_0x10c1d9),_0x516024;}export function segmentDefToUpdateRequest(_0x5b8e9d){const _0x2c275e=a126_0xf51e,_0x459913={'name':_0x5b8e9d[_0x2c275e(0x237)]};return _0x5b8e9d[_0x2c275e(0x232)]!==undefined&&(_0x459913[_0x2c275e(0x232)]=_0x5b8e9d[_0x2c275e(0x232)]),_0x5b8e9d[_0x2c275e(0x1c2)]&&(_0x459913[_0x2c275e(0x1c2)]=yamlRuleToApi(_0x5b8e9d['rule'])),_0x5b8e9d[_0x2c275e(0x1f4)]&&(_0x459913['kind']=_0x5b8e9d[_0x2c275e(0x1f4)]==='batch'?0x0:_0x5b8e9d['kind']==='realtime'?0x1:0x2),_0x459913;}export function yamlRuleToApi(_0x26a1d5,_0x58e98a=![]){const _0x1bfd47=a126_0xf51e,_0x392211=_0x26a1d5[_0x1bfd47(0x1dc)][_0x1bfd47(0x1be)](yamlConditionToApi);if(_0x58e98a){const _0x20c715=_0x392211[_0x1bfd47(0x227)](_0x33be9d=>_0x33be9d[_0x1bfd47(0x1c3)]===_0x1bfd47(0x210)||_0x33be9d[_0x1bfd47(0x1c3)]==='Or');if(!_0x20c715&&_0x392211['length']>0x0)return{'type':_0x26a1d5[_0x1bfd47(0x1c3)],'conditions':[{'type':'And','description':_0x26a1d5['description']||'','conditions':_0x392211}]};}return{'type':_0x26a1d5[_0x1bfd47(0x1c3)],'conditions':_0x392211,..._0x26a1d5[_0x1bfd47(0x232)]&&{'description':_0x26a1d5[_0x1bfd47(0x232)]}};}function yamlConditionToApi(_0x4d4079){const _0x240f72=a126_0xf51e;if(_0x240f72(0x1e6)in _0x4d4079&&(_0x4d4079['type']===_0x240f72(0x223)||_0x4d4079[_0x240f72(0x1c3)]===_0x240f72(0x1c4))){const _0x2870e5=_0x4d4079;return{'type':_0x240f72(0x22f),'id':_0x2870e5['segment'],'exclude':_0x2870e5[_0x240f72(0x1c3)]===_0x240f72(0x1c4)};}if(_0x240f72(0x1c3)in _0x4d4079&&(_0x4d4079['type']===_0x240f72(0x210)||_0x4d4079['type']==='Or')){const _0x1cf261=_0x4d4079;return{'type':_0x1cf261[_0x240f72(0x1c3)],'conditions':_0x1cf261[_0x240f72(0x1dc)][_0x240f72(0x1be)](yamlConditionToApi),..._0x1cf261[_0x240f72(0x232)]&&{'description':_0x1cf261[_0x240f72(0x232)]}};}if(_0x240f72(0x218)in _0x4d4079&&_0x4d4079['type']===_0x240f72(0x21b)){const _0x5dd801=_0x4d4079;return{'type':_0x240f72(0x21b),'column':_0x5dd801[_0x240f72(0x218)],'operator':yamlOperatorToApi(_0x5dd801[_0x240f72(0x22b)])};}const _0x145f90=_0x4d4079,_0x370e83={'type':_0x240f72(0x1fd),'leftValue':buildLeftValue(_0x145f90),'operator':yamlOperatorToApi(_0x145f90[_0x240f72(0x22b)]),'exclude':_0x145f90['exclude']??![],'arrayMatching':_0x145f90[_0x240f72(0x1e7)]??'any'};return _0x145f90[_0x240f72(0x1b5)]!==undefined&&(_0x370e83[_0x240f72(0x1b5)]=_0x145f90[_0x240f72(0x1b5)]),_0x370e83;}function buildAggregationDefFromApi(_0x456125){const _0x1d3106=a126_0xf51e,_0xa7c09d=_0x456125[_0x1d3106(0x1c3)];if(_0xa7c09d===_0x1d3106(0x24b))return{'type':_0xa7c09d,'columns':_0x456125[_0x1d3106(0x20c)]??[]};if(_0xa7c09d==='First'||_0xa7c09d===_0x1d3106(0x1ca))return{'type':_0xa7c09d,'column':_0x456125[_0x1d3106(0x218)]??'','orderColumn':_0x456125[_0x1d3106(0x24e)]??'',..._0x456125[_0x1d3106(0x22e)]&&{'groupingColumns':_0x456125[_0x1d3106(0x22e)]}};if(_0xa7c09d===_0x1d3106(0x239))return{'type':_0xa7c09d,..._0x456125[_0x1d3106(0x22e)]&&{'groupingColumns':_0x456125[_0x1d3106(0x22e)]}};return{'type':_0xa7c09d,'column':_0x456125[_0x1d3106(0x218)]??'',..._0x456125['groupingColumns']&&{'groupingColumns':_0x456125['groupingColumns']}};}function buildLeftValue(_0x249277){const _0x5f722e=a126_0xf51e,_0x273247={};_0x249277['attribute']&&(_0x273247[_0x5f722e(0x237)]=_0x249277['attribute']);if(_0x249277[_0x5f722e(0x229)]){const _0x25ea4d=_0x249277[_0x5f722e(0x229)];if(_0x25ea4d['type']==='CountDistinct')_0x273247[_0x5f722e(0x229)]={'type':_0x5f722e(0x24b),'columns':_0x25ea4d[_0x5f722e(0x20c)]};else{if(_0x25ea4d[_0x5f722e(0x1c3)]===_0x5f722e(0x1b1)||_0x25ea4d[_0x5f722e(0x1c3)]==='Last')_0x273247['aggregation']={'type':_0x25ea4d[_0x5f722e(0x1c3)],'column':_0x25ea4d[_0x5f722e(0x218)],'orderColumn':_0x25ea4d['orderColumn'],..._0x25ea4d[_0x5f722e(0x22e)]&&{'groupingColumns':_0x25ea4d[_0x5f722e(0x22e)]}};else _0x25ea4d[_0x5f722e(0x1c3)]===_0x5f722e(0x239)?_0x273247[_0x5f722e(0x229)]={'type':_0x5f722e(0x239),..._0x25ea4d[_0x5f722e(0x22e)]&&{'groupingColumns':_0x25ea4d[_0x5f722e(0x22e)]}}:_0x273247['aggregation']={'type':_0x25ea4d[_0x5f722e(0x1c3)],'column':_0x25ea4d[_0x5f722e(0x218)],..._0x25ea4d[_0x5f722e(0x22e)]&&{'groupingColumns':_0x25ea4d[_0x5f722e(0x22e)]}};}}return _0x249277['source']&&(_0x273247[_0x5f722e(0x226)]={'name':_0x249277['source']}),_0x249277[_0x5f722e(0x1ea)]&&(_0x273247[_0x5f722e(0x1ea)]=yamlRuleToApi(filterRuleAsRuleDef(_0x249277[_0x5f722e(0x1ea)]))),_0x273247;}function yamlOperatorToApi(_0x8132ff){const _0x466ecd=a126_0xf51e,_0x5271db={'type':mapYamlOperatorType(_0x8132ff[_0x466ecd(0x1c3)]),'not':_0x8132ff['not']??![]};if(isBetweenOperator(_0x8132ff[_0x466ecd(0x1c3)]))return _0x8132ff[_0x466ecd(0x247)]!==undefined&&(_0x5271db['minValue']=typeof _0x8132ff[_0x466ecd(0x247)]==='object'?_0x8132ff[_0x466ecd(0x247)]:String(_0x8132ff[_0x466ecd(0x247)])),_0x8132ff[_0x466ecd(0x1d9)]!==undefined&&(_0x5271db[_0x466ecd(0x1bb)]=typeof _0x8132ff[_0x466ecd(0x1d9)]===_0x466ecd(0x23f)?_0x8132ff['max']:String(_0x8132ff[_0x466ecd(0x1d9)])),_0x5271db;if(_0x8132ff[_0x466ecd(0x1c3)]===_0x466ecd(0x250))return _0x8132ff[_0x466ecd(0x1c7)]&&(_0x5271db['duration']=_0x8132ff[_0x466ecd(0x1c7)]),_0x8132ff['from']&&(_0x5271db[_0x466ecd(0x224)]=_0x8132ff[_0x466ecd(0x224)]),_0x8132ff['reverse']!==undefined&&(_0x5271db[_0x466ecd(0x245)]=_0x8132ff[_0x466ecd(0x245)]),_0x5271db;const _0x3a54d8=getEffectiveValue(_0x8132ff);if(_0x3a54d8!==undefined){if(Array[_0x466ecd(0x1fe)](_0x3a54d8))_0x5271db[_0x466ecd(0x1e2)]=_0x3a54d8;else isTemporalOperator(_0x8132ff[_0x466ecd(0x1c3)])?_0x5271db[_0x466ecd(0x1ed)]=_0x3a54d8:_0x5271db['rightValue']=_0x3a54d8;}return _0x8132ff[_0x466ecd(0x20e)]&&(_0x5271db[_0x466ecd(0x20e)]=_0x8132ff[_0x466ecd(0x20e)]),_0x5271db;}function mapYamlOperatorType(_0x530625){return _0x530625;}export function toYamlString(_0x316af4){const _0x29f88d=a126_0xf51e,_0x259546=JSON['parse'](JSON['stringify'](_0x316af4)),_0x4d9a39=a126_0x4958e2[_0x29f88d(0x1e5)](_0x259546,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x29f88d(0x1ec)}),_0x2ac80d=['rule:'];let _0x58d93c=_0x4d9a39;for(const _0x19266f of _0x2ac80d){_0x58d93c=_0x58d93c[_0x29f88d(0x241)](new RegExp('^('+_0x19266f+')','m'),(_0x9042de,_0x466c9f,_0x2ff933)=>{if(_0x2ff933===0x0||_0x58d93c[_0x2ff933-0x1]==='\x0a'&&_0x58d93c[_0x2ff933-0x2]==='\x0a')return _0x466c9f;return'\x0a'+_0x466c9f;});}return _0x58d93c;}export function parseYamlString(_0x5f48eb){return parseSegmentYamlFile(_0x5f48eb);}export function isSegmentYaml(_0x4e81ce){const _0x16220e=a126_0xf51e;if(typeof _0x4e81ce!==_0x16220e(0x23f)||_0x4e81ce===null)return![];const _0x3c3396=_0x4e81ce;return _0x3c3396[_0x16220e(0x1c3)]==='segment'||_0x3c3396[_0x16220e(0x1c3)]===undefined;}export function generateTemplate(_0x5d4de4=a126_0x2cb009(0x1bf)){const _0x315d40=a126_0x2cb009,_0x1c4a9b={'type':'segment','name':_0x5d4de4,'description':_0x315d40(0x1f7),'rule':{'type':_0x315d40(0x210),'conditions':[{'type':_0x315d40(0x1fd),'attribute':_0x315d40(0x222),'operator':{'type':_0x315d40(0x1e3),'value':'value'}}]}};return toYamlString(_0x1c4a9b);}export function segmentToYamlString(_0x15eec7){const _0x224121=a126_0x2cb009,_0x5bb7a3=JSON[_0x224121(0x244)](JSON[_0x224121(0x1e5)](_0x15eec7)),_0x4dbc04=a126_0x4958e2['stringify'](_0x5bb7a3,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x48e984=[_0x224121(0x1cb),'activations:'];let _0x598aaf=_0x4dbc04;for(const _0xd42cf6 of _0x48e984){_0x598aaf=_0x598aaf[_0x224121(0x241)](new RegExp('^('+_0xd42cf6+')','m'),(_0x46c77f,_0x2e0ac2,_0x2f7ef6)=>{if(_0x2f7ef6===0x0||_0x598aaf[_0x2f7ef6-0x1]==='\x0a'&&_0x598aaf[_0x2f7ef6-0x2]==='\x0a')return _0x2e0ac2;return'\x0a'+_0x2e0ac2;});}return _0x598aaf;}export function parseSegmentYamlFile(_0x103983){return safeParseYaml(_0x103983,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x39df20){const _0x297f9d=a126_0x2cb009;return{'type':_0x297f9d(0x1e6),'name':_0x39df20[_0x297f9d(0x237)],..._0x39df20['description']!==undefined&&{'description':_0x39df20[_0x297f9d(0x232)]},..._0x39df20[_0x297f9d(0x21f)]!==undefined&&{'folder':_0x39df20[_0x297f9d(0x21f)]},..._0x39df20[_0x297f9d(0x1c2)]&&{'rule':normalizeRule(_0x39df20['rule'])},..._0x39df20['kind']!==undefined&&{'kind':_0x39df20[_0x297f9d(0x1f4)]},..._0x39df20['visible']!==undefined&&{'visible':_0x39df20['visible']},..._0x39df20[_0x297f9d(0x234)]&&{'activations':_0x39df20[_0x297f9d(0x234)]['map'](normalizeActivation)}};}export function normalizeRule(_0x56627c){const _0x22d9c6=a126_0x2cb009;return{'type':_0x56627c[_0x22d9c6(0x1c3)],'conditions':_0x56627c[_0x22d9c6(0x1dc)][_0x22d9c6(0x1be)](normalizeCondition),..._0x56627c['description']!==undefined&&{'description':_0x56627c[_0x22d9c6(0x232)]}};}function normalizeCondition(_0x8c9aa4){const _0x25c610=a126_0x2cb009;if('segment'in _0x8c9aa4&&(_0x8c9aa4[_0x25c610(0x1c3)]===_0x25c610(0x223)||_0x8c9aa4['type']==='exclude')){const _0x41a91a=_0x8c9aa4;return{'type':_0x41a91a['type'],'segment':_0x41a91a[_0x25c610(0x1e6)]};}if(_0x25c610(0x1c3)in _0x8c9aa4&&(_0x8c9aa4[_0x25c610(0x1c3)]===_0x25c610(0x210)||_0x8c9aa4[_0x25c610(0x1c3)]==='Or')){const _0x2444c4=_0x8c9aa4;return{'type':_0x2444c4['type'],'conditions':_0x2444c4[_0x25c610(0x1dc)][_0x25c610(0x1be)](normalizeCondition),..._0x2444c4[_0x25c610(0x232)]!==undefined&&{'description':_0x2444c4[_0x25c610(0x232)]}};}if(_0x25c610(0x218)in _0x8c9aa4&&_0x8c9aa4[_0x25c610(0x1c3)]===_0x25c610(0x21b)){const _0x3872a6=_0x8c9aa4;return{'type':'Column','column':_0x3872a6['column'],'operator':normalizeOperator(_0x3872a6['operator'])};}const _0x4619d1=_0x8c9aa4;return{'type':_0x25c610(0x1fd),'attribute':_0x4619d1[_0x25c610(0x246)],'operator':normalizeOperator(_0x4619d1['operator']),..._0x4619d1['arrayMatching']!==undefined&&{'arrayMatching':_0x4619d1[_0x25c610(0x1e7)]},..._0x4619d1[_0x25c610(0x1c4)]!==undefined&&{'exclude':_0x4619d1[_0x25c610(0x1c4)]},..._0x4619d1[_0x25c610(0x229)]!==undefined&&{'aggregation':_0x4619d1[_0x25c610(0x229)]},..._0x4619d1[_0x25c610(0x226)]!==undefined&&{'source':_0x4619d1[_0x25c610(0x226)]},..._0x4619d1[_0x25c610(0x1ea)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x4619d1[_0x25c610(0x1ea)])))},..._0x4619d1[_0x25c610(0x1b5)]!==undefined&&{'limit':_0x4619d1[_0x25c610(0x1b5)]}};}function normalizeOperator(_0x115f60){const _0x9bcbc4=a126_0x2cb009;if(isBetweenOperator(_0x115f60[_0x9bcbc4(0x1c3)]))return{'type':_0x115f60['type'],..._0x115f60[_0x9bcbc4(0x20d)]!==undefined&&{'not':_0x115f60['not']},..._0x115f60[_0x9bcbc4(0x247)]!==undefined&&{'min':_0x115f60[_0x9bcbc4(0x247)]},..._0x115f60[_0x9bcbc4(0x1d9)]!==undefined&&{'max':_0x115f60['max']}};const _0x16d023=getEffectiveValue(_0x115f60);return{'type':_0x115f60[_0x9bcbc4(0x1c3)],..._0x115f60[_0x9bcbc4(0x20d)]!==undefined&&{'not':_0x115f60['not']},..._0x16d023!==undefined&&{'value':_0x16d023},..._0x115f60[_0x9bcbc4(0x20e)]!==undefined&&{'unit':_0x115f60[_0x9bcbc4(0x20e)]},..._0x115f60['duration']!==undefined&&{'duration':_0x115f60[_0x9bcbc4(0x1c7)]},..._0x115f60[_0x9bcbc4(0x224)]!==undefined&&{'from':_0x115f60[_0x9bcbc4(0x224)]},..._0x115f60[_0x9bcbc4(0x245)]!==undefined&&{'reverse':_0x115f60['reverse']}};}function normalizeActivation(_0x20051b){const _0x502df1=a126_0x2cb009;return{'name':_0x20051b[_0x502df1(0x237)],'connection':_0x20051b[_0x502df1(0x1d4)],..._0x20051b[_0x502df1(0x232)]!==undefined&&{'description':_0x20051b[_0x502df1(0x232)]},..._0x20051b[_0x502df1(0x1ef)]!==undefined&&{'all_columns':_0x20051b[_0x502df1(0x1ef)]},..._0x20051b[_0x502df1(0x20c)]!==undefined&&{'columns':_0x20051b[_0x502df1(0x20c)]},..._0x20051b['behavior']!==undefined&&{'behavior':_0x20051b[_0x502df1(0x201)]},..._0x20051b[_0x502df1(0x24d)]!==undefined&&{'schedule':_0x20051b[_0x502df1(0x24d)]},..._0x20051b['notification']!==undefined&&{'notification':_0x20051b[_0x502df1(0x213)]},..._0x20051b['connector_config']!==undefined&&{'connector_config':_0x20051b['connector_config']},..._0x20051b[_0x502df1(0x1bd)]!==undefined&&{'activation_template_id':_0x20051b[_0x502df1(0x1bd)]}};}export function activationResponseToDef(_0x21c32a,_0x34806c,_0x5f068e){const _0x4141b1=a126_0x2cb009,_0x44098b=_0x21c32a['connectionId']||'',_0x1fa174=_0x5f068e?.[_0x4141b1(0x225)](_0x44098b)??_0x44098b,_0x8c207c={'name':_0x21c32a[_0x4141b1(0x237)],'connection':_0x1fa174};_0x21c32a[_0x4141b1(0x232)]&&(_0x8c207c['description']=_0x21c32a['description']);let _0x343bc9=[];_0x21c32a[_0x4141b1(0x20c)]&&_0x21c32a[_0x4141b1(0x20c)][_0x4141b1(0x21c)]>0x0&&(_0x343bc9=_0x21c32a[_0x4141b1(0x20c)][_0x4141b1(0x1ea)](_0x5f4b12=>_0x5f4b12&&_0x5f4b12[_0x4141b1(0x237)])['map'](_0x1538bb=>{const _0xd9342b=_0x4141b1;if(_0x1538bb[_0xd9342b(0x1c3)]||_0x1538bb[_0xd9342b(0x206)])return{'name':_0x1538bb[_0xd9342b(0x237)],..._0x1538bb[_0xd9342b(0x1c3)]&&{'type':_0x1538bb['type']},..._0x1538bb[_0xd9342b(0x206)]&&{'visibility':_0x1538bb[_0xd9342b(0x206)]}};return _0x1538bb[_0xd9342b(0x237)];}));_0x343bc9[_0x4141b1(0x21c)]>0x0&&(_0x8c207c['columns']=_0x343bc9);_0x21c32a[_0x4141b1(0x236)]!==undefined&&(_0x21c32a['allColumns']===![]&&_0x343bc9[_0x4141b1(0x21c)]===0x0?_0x8c207c[_0x4141b1(0x1ef)]=!![]:_0x8c207c[_0x4141b1(0x1ef)]=_0x21c32a['allColumns']);const _0x21a8cb={};let _0x3fa546=![];_0x21c32a[_0x4141b1(0x204)]&&(_0x21a8cb[_0x4141b1(0x1c3)]=_0x21c32a[_0x4141b1(0x204)],_0x3fa546=!![]);_0x21c32a['repeatUnit']&&(_0x21a8cb[_0x4141b1(0x1df)]=_0x21c32a[_0x4141b1(0x23c)],_0x3fa546=!![]);_0x21c32a[_0x4141b1(0x207)]!==undefined&&_0x21c32a[_0x4141b1(0x207)]!==null&&(_0x21a8cb[_0x4141b1(0x1b3)]=_0x21c32a[_0x4141b1(0x207)],_0x3fa546=!![]);_0x21c32a[_0x4141b1(0x202)]&&_0x21c32a[_0x4141b1(0x202)][_0x4141b1(0x21c)]>0x0&&(_0x21a8cb['repeat_sub_frequency']=_0x21c32a[_0x4141b1(0x202)],_0x3fa546=!![]);_0x21c32a[_0x4141b1(0x1b2)]!==undefined&&(_0x21a8cb['start_at']=_0x21c32a[_0x4141b1(0x1b2)],_0x3fa546=!![]);_0x21c32a['endOn']!==undefined&&(_0x21a8cb[_0x4141b1(0x1ce)]=_0x21c32a[_0x4141b1(0x1d0)],_0x3fa546=!![]);_0x21c32a['timezone']&&(_0x21a8cb[_0x4141b1(0x22d)]=_0x21c32a[_0x4141b1(0x22d)],_0x3fa546=!![]);_0x3fa546&&(_0x8c207c[_0x4141b1(0x24d)]=_0x21a8cb);(_0x21c32a['notifyOn']&&_0x21c32a[_0x4141b1(0x220)][_0x4141b1(0x21c)]>0x0||_0x21c32a[_0x4141b1(0x228)]&&_0x21c32a[_0x4141b1(0x228)]['length']>0x0)&&(_0x8c207c['notification']={},_0x21c32a['notifyOn']&&_0x21c32a['notifyOn'][_0x4141b1(0x21c)]>0x0&&(_0x8c207c[_0x4141b1(0x213)][_0x4141b1(0x1fa)]=_0x21c32a['notifyOn']),_0x21c32a[_0x4141b1(0x228)]&&_0x21c32a[_0x4141b1(0x228)][_0x4141b1(0x21c)]>0x0&&(_0x8c207c[_0x4141b1(0x213)][_0x4141b1(0x1f6)]=_0x21c32a[_0x4141b1(0x228)]['map'](_0x471c3f=>{const _0x60376b=_0x4141b1,_0x7f7493=_0x34806c?.[_0x60376b(0x225)](_0x471c3f);return _0x7f7493??String(_0x471c3f);})));_0x21c32a['connectorConfig']&&Object[_0x4141b1(0x1d6)](_0x21c32a[_0x4141b1(0x1f1)])[_0x4141b1(0x21c)]>0x0&&(_0x8c207c[_0x4141b1(0x1cf)]=normalizeConnectorConfigForYaml(_0x21c32a['connectorConfig']));_0x21c32a[_0x4141b1(0x238)]&&(_0x8c207c['activation_template_id']=_0x21c32a[_0x4141b1(0x238)]);if(_0x21c32a[_0x4141b1(0x1c8)]){const _0x386c6b={},_0x2a2849=_0x21c32a[_0x4141b1(0x1c8)];_0x2a2849['columns']&&_0x2a2849[_0x4141b1(0x20c)][_0x4141b1(0x21c)]>0x0&&(_0x386c6b[_0x4141b1(0x20c)]=_0x2a2849['columns'][_0x4141b1(0x1ea)](_0x323a1c=>_0x323a1c&&_0x323a1c[_0x4141b1(0x237)])[_0x4141b1(0x1be)](_0x4de1a5=>({'name':_0x4de1a5[_0x4141b1(0x237)],..._0x4de1a5[_0x4141b1(0x1c3)]&&{'type':_0x4de1a5[_0x4141b1(0x1c3)]},..._0x4de1a5[_0x4141b1(0x206)]&&{'visibility':_0x4de1a5[_0x4141b1(0x206)]}}))),_0x2a2849[_0x4141b1(0x1fc)]&&(_0x386c6b[_0x4141b1(0x203)]=_0x2a2849[_0x4141b1(0x1fc)]),_0x2a2849[_0x4141b1(0x1f5)]!==undefined&&(_0x386c6b[_0x4141b1(0x1b4)]=_0x2a2849[_0x4141b1(0x1f5)]),_0x2a2849[_0x4141b1(0x231)]&&(_0x386c6b[_0x4141b1(0x1f9)]=_0x2a2849[_0x4141b1(0x231)]),_0x2a2849[_0x4141b1(0x22c)]&&(_0x386c6b[_0x4141b1(0x22c)]=_0x2a2849[_0x4141b1(0x22c)]),_0x2a2849['orderBy']&&_0x2a2849[_0x4141b1(0x24f)][_0x4141b1(0x21c)]>0x0&&(_0x386c6b['order_by']=_0x2a2849[_0x4141b1(0x24f)]),Object[_0x4141b1(0x1d6)](_0x386c6b)['length']>0x0&&(_0x8c207c[_0x4141b1(0x201)]=_0x386c6b);}return _0x8c207c;}export function journeyActivationStepToYaml(_0x4e0db4,_0xe71c9e,_0x3c39a6){const _0x17f6d7=a126_0x2cb009,_0x15e667=_0x4e0db4[_0x17f6d7(0x1c0)][_0x17f6d7(0x1ee)],_0x50aebb=_0x15e667['connectionId']||'',_0x37aec1=_0x3c39a6?.[_0x17f6d7(0x225)](_0x50aebb)??_0x50aebb,_0x4191d6={'name':_0x15e667[_0x17f6d7(0x237)]||'','connection':_0x37aec1};_0x4e0db4[_0x17f6d7(0x1c0)][_0x17f6d7(0x1db)]&&(_0x4191d6[_0x17f6d7(0x21a)]=!![]);_0x15e667[_0x17f6d7(0x232)]&&(_0x4191d6[_0x17f6d7(0x232)]=_0x15e667['description']);let _0x40ab86=[];_0x15e667[_0x17f6d7(0x20c)]&&_0x15e667['columns'][_0x17f6d7(0x21c)]>0x0&&(_0x40ab86=_0x15e667['columns']['filter'](_0x405caa=>_0x405caa&&_0x405caa['name'])['map'](_0xbf07a9=>{const _0x2cdae9=_0x17f6d7;if(_0xbf07a9['type']||_0xbf07a9[_0x2cdae9(0x206)])return{'name':_0xbf07a9[_0x2cdae9(0x237)],..._0xbf07a9['type']&&{'type':_0xbf07a9['type']},..._0xbf07a9[_0x2cdae9(0x206)]&&{'visibility':_0xbf07a9['visibility']}};return _0xbf07a9['name'];}));_0x40ab86[_0x17f6d7(0x21c)]>0x0&&(_0x4191d6[_0x17f6d7(0x20c)]=_0x40ab86);_0x15e667[_0x17f6d7(0x236)]!==undefined&&(_0x15e667['allColumns']===![]&&_0x40ab86[_0x17f6d7(0x21c)]===0x0?_0x4191d6[_0x17f6d7(0x1ef)]=!![]:_0x4191d6['all_columns']=_0x15e667['allColumns']);const _0x1cf944={};let _0x445307=![];_0x15e667['scheduleType']&&(_0x1cf944[_0x17f6d7(0x1c3)]=_0x15e667[_0x17f6d7(0x204)],_0x445307=!![]);_0x15e667[_0x17f6d7(0x23c)]&&(_0x1cf944[_0x17f6d7(0x1df)]=_0x15e667[_0x17f6d7(0x23c)],_0x445307=!![]);_0x15e667[_0x17f6d7(0x207)]!==undefined&&_0x15e667[_0x17f6d7(0x207)]!==null&&(_0x1cf944[_0x17f6d7(0x1b3)]=_0x15e667[_0x17f6d7(0x207)],_0x445307=!![]);_0x15e667[_0x17f6d7(0x1b2)]!==undefined&&(_0x1cf944[_0x17f6d7(0x23e)]=_0x15e667[_0x17f6d7(0x1b2)],_0x445307=!![]);_0x15e667[_0x17f6d7(0x1d0)]!==undefined&&(_0x1cf944[_0x17f6d7(0x1ce)]=_0x15e667[_0x17f6d7(0x1d0)],_0x445307=!![]);_0x15e667[_0x17f6d7(0x22d)]&&(_0x1cf944[_0x17f6d7(0x22d)]=_0x15e667[_0x17f6d7(0x22d)],_0x445307=!![]);_0x445307&&(_0x4191d6[_0x17f6d7(0x24d)]=_0x1cf944);(_0x15e667['notifyOn']&&_0x15e667['notifyOn'][_0x17f6d7(0x21c)]>0x0||_0x15e667[_0x17f6d7(0x228)]&&_0x15e667[_0x17f6d7(0x228)][_0x17f6d7(0x21c)]>0x0)&&(_0x4191d6[_0x17f6d7(0x213)]={},_0x15e667[_0x17f6d7(0x220)]&&_0x15e667['notifyOn'][_0x17f6d7(0x21c)]>0x0&&(_0x4191d6['notification']['notify_on']=_0x15e667[_0x17f6d7(0x220)]),_0x15e667[_0x17f6d7(0x228)]&&_0x15e667['emailRecipients'][_0x17f6d7(0x21c)]>0x0&&(_0x4191d6[_0x17f6d7(0x213)]['email_recipients']=_0x15e667[_0x17f6d7(0x228)]['map'](_0x40350c=>{const _0x4c1ddd=_0x17f6d7,_0x5a46e6=_0xe71c9e?.[_0x4c1ddd(0x225)](_0x40350c);return _0x5a46e6??String(_0x40350c);})));_0x15e667['connectorConfig']&&Object['keys'](_0x15e667[_0x17f6d7(0x1f1)])['length']>0x0&&(_0x4191d6[_0x17f6d7(0x1cf)]=normalizeConnectorConfigForYaml(_0x15e667[_0x17f6d7(0x1f1)]));_0x15e667[_0x17f6d7(0x238)]&&(_0x4191d6[_0x17f6d7(0x1bd)]=_0x15e667[_0x17f6d7(0x238)]);if(_0x15e667[_0x17f6d7(0x1c8)]){const _0x4ad95f={},_0x419c4a=_0x15e667[_0x17f6d7(0x1c8)];_0x419c4a['columns']&&_0x419c4a[_0x17f6d7(0x20c)][_0x17f6d7(0x21c)]>0x0&&(_0x4ad95f[_0x17f6d7(0x20c)]=_0x419c4a[_0x17f6d7(0x20c)][_0x17f6d7(0x1ea)](_0xca518d=>_0xca518d&&_0xca518d[_0x17f6d7(0x237)])['map'](_0x44ad3e=>({'name':_0x44ad3e[_0x17f6d7(0x237)],..._0x44ad3e[_0x17f6d7(0x1c3)]&&{'type':_0x44ad3e['type']},..._0x44ad3e[_0x17f6d7(0x206)]&&{'visibility':_0x44ad3e[_0x17f6d7(0x206)]}}))),_0x419c4a['behaviorTableName']&&(_0x4ad95f['behavior_table']=_0x419c4a[_0x17f6d7(0x1fc)]),_0x419c4a[_0x17f6d7(0x1f5)]!==undefined&&(_0x4ad95f[_0x17f6d7(0x1b4)]=_0x419c4a[_0x17f6d7(0x1f5)]),_0x419c4a['joinStrategy']&&(_0x4ad95f[_0x17f6d7(0x1f9)]=_0x419c4a['joinStrategy']),_0x419c4a[_0x17f6d7(0x22c)]&&(_0x4ad95f['formatting']=_0x419c4a[_0x17f6d7(0x22c)]),_0x419c4a[_0x17f6d7(0x24f)]&&_0x419c4a[_0x17f6d7(0x24f)][_0x17f6d7(0x21c)]>0x0&&(_0x4ad95f['order_by']=_0x419c4a['orderBy']),Object[_0x17f6d7(0x1d6)](_0x4ad95f)[_0x17f6d7(0x21c)]>0x0&&(_0x4191d6[_0x17f6d7(0x201)]=_0x4ad95f);}return _0x4191d6;}export function segmentWithActivationsToYaml(_0x4694fd,_0x1e1c7c,_0x388bbd,_0x529203,_0x1dd19e){const _0x4e15d6=a126_0x2cb009,_0x186fb2=segmentResponseToDefSync(_0x4694fd,_0x388bbd);return _0x1e1c7c['length']>0x0&&(_0x186fb2[_0x4e15d6(0x234)]=_0x1e1c7c[_0x4e15d6(0x1be)](_0x495c84=>activationResponseToDef(_0x495c84,_0x529203,_0x1dd19e))),_0x186fb2;}function normalizeColumn(_0x470d9f){const _0x4c1c8e=a126_0x2cb009;if(typeof _0x470d9f===_0x4c1c8e(0x240))return{'name':_0x470d9f};return{'name':_0x470d9f[_0x4c1c8e(0x237)],..._0x470d9f[_0x4c1c8e(0x1c3)]&&{'type':_0x470d9f[_0x4c1c8e(0x1c3)]},..._0x470d9f[_0x4c1c8e(0x206)]&&{'visibility':_0x470d9f[_0x4c1c8e(0x206)]}};}export async function activationDefToCreateRequest(_0xaa0c6b,_0x55f134){const _0x1bec76=a126_0x2cb009,_0x58b9fb=_0x55f134?.[_0x1bec76(0x219)],_0x238df4=_0x55f134?.[_0x1bec76(0x205)],_0x51ea9d=_0xaa0c6b[_0x1bec76(0x1d4)];let _0x9fdc35;const _0x3f4504=parseInt(_0x51ea9d,0xa);if(!isNaN(_0x3f4504)&&String(_0x3f4504)===_0x51ea9d)_0x9fdc35=_0x3f4504;else{const _0x10fcec=_0x238df4?.[_0x1bec76(0x225)](_0x51ea9d);if(_0x10fcec===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x1bec76(0x235)+_0x51ea9d,undefined,{'helpText':_0x1bec76(0x1b0)});_0x9fdc35=_0x10fcec;}const _0x30a02c={'name':_0xaa0c6b[_0x1bec76(0x237)],'connectionId':_0x9fdc35};_0xaa0c6b['description']&&(_0x30a02c['description']=_0xaa0c6b[_0x1bec76(0x232)]);let _0xb90ec4=[];_0xaa0c6b['columns']&&_0xaa0c6b['columns'][_0x1bec76(0x21c)]>0x0&&(_0xb90ec4=_0xaa0c6b[_0x1bec76(0x20c)][_0x1bec76(0x1ea)](_0x33403f=>_0x33403f!=null)['map'](normalizeColumn));_0xb90ec4['length']>0x0&&(_0x30a02c[_0x1bec76(0x20c)]=_0xb90ec4);_0xaa0c6b[_0x1bec76(0x1ef)]!==undefined&&(_0xaa0c6b[_0x1bec76(0x1ef)]===![]&&_0xb90ec4[_0x1bec76(0x21c)]===0x0?_0x30a02c[_0x1bec76(0x236)]=!![]:_0x30a02c['allColumns']=_0xaa0c6b[_0x1bec76(0x1ef)]);if(_0xaa0c6b[_0x1bec76(0x24d)]){const _0x156579=_0xaa0c6b[_0x1bec76(0x24d)];_0x156579[_0x1bec76(0x1c3)]&&(_0x30a02c[_0x1bec76(0x204)]=_0x156579[_0x1bec76(0x1c3)]),_0x156579[_0x1bec76(0x1df)]&&(_0x30a02c[_0x1bec76(0x23c)]=_0x156579[_0x1bec76(0x1df)]),_0x156579[_0x1bec76(0x1b3)]!==undefined&&(_0x30a02c[_0x1bec76(0x207)]=_0x156579['repeat_frequency']),_0x156579['repeat_sub_frequency']&&(_0x30a02c['repeatSubFrequency']=_0x156579[_0x1bec76(0x1d7)]),_0x156579[_0x1bec76(0x23e)]!==undefined&&(_0x30a02c[_0x1bec76(0x1b2)]=_0x156579['start_at']),_0x156579[_0x1bec76(0x1ce)]!==undefined&&(_0x30a02c[_0x1bec76(0x1d0)]=_0x156579[_0x1bec76(0x1ce)]),_0x156579['timezone']&&(_0x30a02c[_0x1bec76(0x22d)]=_0x156579['timezone']);}_0xaa0c6b['notification']&&(_0xaa0c6b['notification'][_0x1bec76(0x1fa)]&&(_0x30a02c['notifyOn']=_0xaa0c6b[_0x1bec76(0x213)][_0x1bec76(0x1fa)]),_0xaa0c6b['notification'][_0x1bec76(0x1f6)]&&(_0x30a02c[_0x1bec76(0x228)]=_0xaa0c6b[_0x1bec76(0x213)][_0x1bec76(0x1f6)][_0x1bec76(0x1be)](_0x1dadc3=>{const _0x3eba79=_0x1bec76,_0x21968e=Number(_0x1dadc3);if(!isNaN(_0x21968e)&&String(_0x21968e)===_0x1dadc3)return _0x21968e;const _0x47baf4=_0x58b9fb?.[_0x3eba79(0x225)](_0x1dadc3[_0x3eba79(0x1f3)]());if(_0x47baf4===undefined)throw new SDKError(ErrorCode[_0x3eba79(0x1d5)],_0x3eba79(0x209)+_0x1dadc3+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x47baf4;})));if(_0xaa0c6b[_0x1bec76(0x1cf)]){const _0x412cef=_0x55f134?.[_0x1bec76(0x20f)]?.[_0x1bec76(0x225)](_0x51ea9d);if(_0x412cef&&_0x55f134?.[_0x1bec76(0x1c5)])try{const _0x64e513=await _0x55f134[_0x1bec76(0x1c5)](_0x412cef),_0x4a7ffa=validateConnectorConfig(_0xaa0c6b['connector_config'],_0x64e513);if(!_0x4a7ffa[_0x1bec76(0x22a)])throw new SDKError(ErrorCode[_0x1bec76(0x1cc)],_0x1bec76(0x23d)+_0xaa0c6b[_0x1bec76(0x237)]+_0x1bec76(0x1cd)+formatValidationErrors(_0x4a7ffa[_0x1bec76(0x23b)]),undefined,{'helpText':_0x1bec76(0x20a)+_0x412cef+_0x1bec76(0x1c1)+formatSchemaAsHelp(_0x64e513)});if(_0x4a7ffa[_0x1bec76(0x208)][_0x1bec76(0x21c)]>0x0){const _0x29ddfc=formatValidationWarnings(_0x4a7ffa[_0x1bec76(0x208)]);console[_0x1bec76(0x1ff)](_0x1bec76(0x1f2)+_0xaa0c6b[_0x1bec76(0x237)]+'\x22:\x0a'+_0x29ddfc);}_0x30a02c[_0x1bec76(0x1f1)]=transformConfigToLegacy(_0xaa0c6b[_0x1bec76(0x1cf)],_0x64e513);}catch(_0x2dd98a){if(_0x2dd98a instanceof SDKError&&_0x2dd98a[_0x1bec76(0x1f0)]===ErrorCode[_0x1bec76(0x233)])_0x30a02c[_0x1bec76(0x1f1)]=_0xaa0c6b[_0x1bec76(0x1cf)];else throw _0x2dd98a;}else _0x30a02c['connectorConfig']=_0xaa0c6b[_0x1bec76(0x1cf)];}_0xaa0c6b[_0x1bec76(0x1bd)]!==undefined&&(_0x30a02c[_0x1bec76(0x238)]=_0xaa0c6b[_0x1bec76(0x1bd)]);if(_0xaa0c6b[_0x1bec76(0x201)]){const _0x4cf9cc=_0xaa0c6b[_0x1bec76(0x201)],_0x485134={};if(_0x4cf9cc[_0x1bec76(0x20c)]&&_0x4cf9cc[_0x1bec76(0x20c)][_0x1bec76(0x21c)]>0x0){const _0x494c2b=_0x4cf9cc[_0x1bec76(0x20c)][_0x1bec76(0x1ea)](_0x559bd7=>_0x559bd7&&_0x559bd7[_0x1bec76(0x237)]);_0x494c2b[_0x1bec76(0x21c)]>0x0&&(_0x485134[_0x1bec76(0x20c)]=_0x494c2b);}_0x4cf9cc[_0x1bec76(0x203)]&&(_0x485134[_0x1bec76(0x1fc)]=_0x4cf9cc['behavior_table']),_0x4cf9cc[_0x1bec76(0x1b4)]!==undefined&&(_0x485134['joinRow']=_0x4cf9cc['join_row']),_0x4cf9cc[_0x1bec76(0x1f9)]&&(_0x485134['joinStrategy']=_0x4cf9cc[_0x1bec76(0x1f9)]),_0x4cf9cc['formatting']&&(_0x485134[_0x1bec76(0x22c)]=_0x4cf9cc[_0x1bec76(0x22c)]),_0x4cf9cc['order_by']&&(_0x485134[_0x1bec76(0x24f)]=_0x4cf9cc['order_by']),_0x30a02c[_0x1bec76(0x1c8)]=_0x485134;}return _0x30a02c;}export async function activationDefToUpdateRequest(_0x23c91a,_0x532ce1){return activationDefToCreateRequest(_0x23c91a,_0x532ce1);}export function deepSortObject(_0x2ea685){const _0x2ad61a=a126_0x2cb009;if(_0x2ea685===null||typeof _0x2ea685!==_0x2ad61a(0x23f))return _0x2ea685;if(Array[_0x2ad61a(0x1fe)](_0x2ea685))return _0x2ea685[_0x2ad61a(0x1be)](deepSortObject)[_0x2ad61a(0x1dd)]((_0xe0ec3,_0x4c646c)=>JSON[_0x2ad61a(0x1e5)](_0xe0ec3)[_0x2ad61a(0x1e0)](JSON[_0x2ad61a(0x1e5)](_0x4c646c)));const _0x599110={};for(const _0x5eb7f3 of Object[_0x2ad61a(0x1d6)](_0x2ea685)[_0x2ad61a(0x1dd)]()){_0x599110[_0x5eb7f3]=deepSortObject(_0x2ea685[_0x5eb7f3]);}return _0x599110;}export function serializeRule(_0x311557){const _0x3e865a=a126_0x2cb009;return JSON[_0x3e865a(0x1e5)](deepSortObject(_0x311557));}export function normalizeRuleForMatching(_0x18e7b2){return normalizeConditionsForMatching(_0x18e7b2);}function normalizeConditionsForMatching(_0x50e2f2){const _0x49d582=a126_0x2cb009;if(_0x50e2f2===null||typeof _0x50e2f2!==_0x49d582(0x23f))return _0x50e2f2;if(Array[_0x49d582(0x1fe)](_0x50e2f2))return _0x50e2f2['map'](normalizeConditionsForMatching);const _0x42ed79=_0x50e2f2;if((_0x42ed79[_0x49d582(0x1c3)]==='include'||_0x42ed79[_0x49d582(0x1c3)]===_0x49d582(0x1c4))&&typeof _0x42ed79[_0x49d582(0x1e6)]===_0x49d582(0x240))return{..._0x42ed79,'segment':'__SEGMENT_REF__'};const _0x403cd8={};for(const _0x5d7347 of Object[_0x49d582(0x1d6)](_0x42ed79)){_0x403cd8[_0x5d7347]=normalizeConditionsForMatching(_0x42ed79[_0x5d7347]);}return _0x403cd8;}export function serializeRuleForMatching(_0x46744b){const _0x218f19=a126_0x2cb009;return JSON[_0x218f19(0x1e5)](deepSortObject(normalizeRuleForMatching(_0x46744b)));}export function expandSegmentReferences(_0x49e59c,_0x415768,_0x45367f=new Set()){return expandConditions(_0x49e59c,_0x415768,_0x45367f);}function expandConditions(_0x251cdb,_0x5c81c4,_0x3c260b){const _0x1ee777=a126_0x2cb009;if(_0x251cdb===null||typeof _0x251cdb!==_0x1ee777(0x23f))return _0x251cdb;if(Array[_0x1ee777(0x1fe)](_0x251cdb))return _0x251cdb[_0x1ee777(0x1be)](_0x308e8e=>expandConditions(_0x308e8e,_0x5c81c4,_0x3c260b));const _0x24f034=_0x251cdb;if((_0x24f034[_0x1ee777(0x1c3)]===_0x1ee777(0x223)||_0x24f034[_0x1ee777(0x1c3)]===_0x1ee777(0x1c4))&&typeof _0x24f034[_0x1ee777(0x1e6)]===_0x1ee777(0x240)){const _0x36c8ad=_0x24f034[_0x1ee777(0x1e6)],_0x5a0f95=_0x5c81c4['get'](_0x36c8ad);if(_0x5a0f95&&!_0x3c260b[_0x1ee777(0x21d)](_0x36c8ad)){const _0x1da34f=new Set(_0x3c260b);_0x1da34f['add'](_0x36c8ad);const _0x519817=expandConditions(_0x5a0f95,_0x5c81c4,_0x1da34f);return{'type':_0x24f034[_0x1ee777(0x1c3)],'expanded_rule':_0x519817};}return{'type':_0x24f034[_0x1ee777(0x1c3)],'expanded_rule':_0x1ee777(0x1e1)};}const _0x3ee68e={};for(const _0x25ed4d of Object['keys'](_0x24f034)){_0x3ee68e[_0x25ed4d]=expandConditions(_0x24f034[_0x25ed4d],_0x5c81c4,_0x3c260b);}return _0x3ee68e;}export function serializeExpandedRule(_0x146646,_0x45cf19){const _0x60dba6=a126_0x2cb009,_0x39aaed=expandSegmentReferences(_0x146646,_0x45cf19);return JSON[_0x60dba6(0x1e5)](deepSortObject(_0x39aaed));}export function createSegmentNameContext(_0x202b14){const _0x5e2a4e=a126_0x2cb009,_0xb57fd=new Set(),_0x8dcafa=new Map(),_0x31de4d=new Map();if(_0x202b14)for(const [_0x371c44,_0x19522b]of Object[_0x5e2a4e(0x242)](_0x202b14)){if(_0x19522b[_0x5e2a4e(0x1c2)]){const _0x53ead9=serializeRule(_0x19522b[_0x5e2a4e(0x1c2)]);_0x31de4d['set'](_0x53ead9,_0x371c44),_0xb57fd[_0x5e2a4e(0x243)](_0x371c44);}}return{'usedNames':_0xb57fd,'ruleHashToName':_0x8dcafa,'localRuleToName':_0x202b14?_0x31de4d:undefined};}function a126_0xf51e(_0x201eab,_0x171311){_0x201eab=_0x201eab-0x1b0;const _0x275489=a126_0x2754();let _0xf51e04=_0x275489[_0x201eab];return _0xf51e04;}export function resolveSegmentName(_0x51a8bc,_0x4fa3a9,_0xd0bb08,_0x8c8363){const _0x1ca7df=a126_0x2cb009,_0xcfdef0=serializeRule(_0x4fa3a9);if(_0xd0bb08[_0x1ca7df(0x1e4)]){const _0x4a3e78=_0xd0bb08[_0x1ca7df(0x1e4)]['get'](_0xcfdef0);if(_0x4a3e78)return{'name':_0x4a3e78,'isDuplicate':![],'isLocalMatch':!![]};}const _0x99aa27=_0xd0bb08[_0x1ca7df(0x1eb)][_0x1ca7df(0x225)](_0xcfdef0);if(_0x99aa27)return{'name':_0x99aa27,'isDuplicate':!![],'isLocalMatch':![]};const _0x5a4021=_0x8c8363(_0x51a8bc);let _0x380340=_0x5a4021||_0x51a8bc,_0x5d78dc=_0x380340,_0x3f0596=0x2;while(_0xd0bb08['usedNames'][_0x1ca7df(0x21d)](_0x5d78dc)){_0x5d78dc=_0x380340+'_'+_0x3f0596,_0x3f0596++;}return _0xd0bb08[_0x1ca7df(0x211)][_0x1ca7df(0x243)](_0x5d78dc),_0xd0bb08[_0x1ca7df(0x1eb)][_0x1ca7df(0x214)](_0xcfdef0,_0x5d78dc),{'name':_0x5d78dc,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x1011c8){const _0x2047ce=[],_0x306fa9=_0x2bb78e=>{const _0x3f233d=a126_0xf51e;if(!_0x2bb78e||typeof _0x2bb78e!==_0x3f233d(0x23f))return;if(Array[_0x3f233d(0x1fe)](_0x2bb78e)){_0x2bb78e[_0x3f233d(0x249)](_0x306fa9);return;}const _0x55e8b8=_0x2bb78e;(_0x55e8b8['type']==='include'||_0x55e8b8[_0x3f233d(0x1c3)]===_0x3f233d(0x1c4))&&typeof _0x55e8b8['segment']===_0x3f233d(0x240)&&_0x2047ce[_0x3f233d(0x217)](_0x55e8b8[_0x3f233d(0x1e6)]);for(const _0x1d7a26 of Object[_0x3f233d(0x1b9)](_0x55e8b8)){_0x306fa9(_0x1d7a26);}};return _0x306fa9(_0x1011c8),_0x2047ce;}export function validateSegmentRule(_0x3a297e,_0x438440){const _0x26f1ee=a126_0x2cb009;if(!_0x438440||!_0x438440['conditions'])return;for(let _0x11ab9b=0x0;_0x11ab9b<_0x438440[_0x26f1ee(0x1dc)][_0x26f1ee(0x21c)];_0x11ab9b++){const _0x4925d6=_0x438440[_0x26f1ee(0x1dc)][_0x11ab9b];if('type'in _0x4925d6&&_0x4925d6[_0x26f1ee(0x1c3)]===_0x26f1ee(0x1fd)){const _0xd5da0f=_0x4925d6,_0x5db312=_0xd5da0f[_0x26f1ee(0x226)]||_0xd5da0f['aggregation'];if((!_0xd5da0f['attribute']||_0xd5da0f[_0x26f1ee(0x246)]==='')&&!_0x5db312)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x26f1ee(0x1bc)+_0x3a297e+'\x27:\x20'+(_0x26f1ee(0x1d1)+_0x11ab9b+_0x26f1ee(0x1d2))+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
|
|
1
|
+
const a126_0x15f653=a126_0x2ee4;(function(_0x4a5b42,_0x406600){const _0x399a9b=a126_0x2ee4,_0x2e3bb9=_0x4a5b42();while(!![]){try{const _0x32d4b7=-parseInt(_0x399a9b(0x251))/0x1+parseInt(_0x399a9b(0x220))/0x2+-parseInt(_0x399a9b(0x1e7))/0x3+-parseInt(_0x399a9b(0x1db))/0x4+-parseInt(_0x399a9b(0x20e))/0x5*(parseInt(_0x399a9b(0x240))/0x6)+-parseInt(_0x399a9b(0x211))/0x7*(parseInt(_0x399a9b(0x206))/0x8)+-parseInt(_0x399a9b(0x24a))/0x9*(-parseInt(_0x399a9b(0x1d8))/0xa);if(_0x32d4b7===_0x406600)break;else _0x2e3bb9['push'](_0x2e3bb9['shift']());}catch(_0x3ceefd){_0x2e3bb9['push'](_0x2e3bb9['shift']());}}}(a126_0x2d16,0xae4b8));import*as a126_0x3d8b8a from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';function filterRuleAsRuleDef(_0x4cbc78){return _0x4cbc78;}function ruleDefAsFilterRule(_0x3b2a2f){return _0x3b2a2f;}export function segmentResponseToDefSync(_0x3cc189,_0x54bdd9){const _0x1a69e3=a126_0x2ee4,_0x97b4e1=_0x3cc189['rule']&&'type'in _0x3cc189[_0x1a69e3(0x20b)]&&_0x3cc189['rule']['type'];return{'type':_0x1a69e3(0x201),'name':_0x3cc189[_0x1a69e3(0x228)],..._0x3cc189[_0x1a69e3(0x232)]&&{'description':_0x3cc189[_0x1a69e3(0x232)]},..._0x54bdd9&&{'folder':_0x54bdd9},..._0x97b4e1&&{'rule':apiRuleToYaml(_0x3cc189[_0x1a69e3(0x20b)])},..._0x3cc189[_0x1a69e3(0x239)]!==undefined&&{'kind':_0x3cc189[_0x1a69e3(0x239)]===0x0?'batch':_0x3cc189['kind']===0x1?_0x1a69e3(0x202):_0x1a69e3(0x226)},..._0x3cc189[_0x1a69e3(0x1c5)]!==undefined&&{'visible':_0x3cc189[_0x1a69e3(0x1c5)]}};}export async function segmentResponseToDef(_0x1d3d5c,_0x22331b,_0xe60596){const _0x23ad2d=a126_0x2ee4,_0xd0fb69=segmentResponseToDefSync(_0x1d3d5c,_0xe60596);if(!_0x22331b||!_0x22331b[_0x23ad2d(0x243)])return _0xd0fb69;return _0xd0fb69[_0x23ad2d(0x20b)]&&(_0xd0fb69[_0x23ad2d(0x20b)]=await resolveRuleSegmentRefs(_0xd0fb69['rule'],_0x22331b[_0x23ad2d(0x243)])),_0xd0fb69;}export function apiRuleToYaml(_0x318039){const _0x21841c=a126_0x2ee4,_0x3dda9b=(_0x318039[_0x21841c(0x23d)]||[])['map'](apiConditionToYaml);if(_0x3dda9b[_0x21841c(0x1df)]===0x1&&!_0x318039[_0x21841c(0x232)]&&_0x21841c(0x1e1)in _0x3dda9b[0x0]&&(_0x3dda9b[0x0]['type']===_0x21841c(0x22f)||_0x3dda9b[0x0][_0x21841c(0x1e1)]==='Or')){const _0x233e8a=_0x3dda9b[0x0];if(_0x233e8a[_0x21841c(0x1e1)]===_0x318039[_0x21841c(0x1e1)]&&_0x233e8a[_0x21841c(0x23d)])return{'type':_0x318039[_0x21841c(0x1e1)],'conditions':_0x233e8a[_0x21841c(0x23d)],..._0x233e8a[_0x21841c(0x232)]&&{'description':_0x233e8a['description']}};}return{'type':_0x318039['type'],'conditions':_0x3dda9b,..._0x318039[_0x21841c(0x232)]&&{'description':_0x318039['description']}};}export async function resolveRuleSegmentRefs(_0x52f5bb,_0x57a9db){const _0x4ca203=a126_0x2ee4;return transformRuleSegmentRefs(_0x52f5bb,_0x57a9db,_0x206361=>/^\d+$/[_0x4ca203(0x1c8)](_0x206361));}async function transformConditionSegmentRefs(_0x584b85,_0x33e964,_0x1af747,_0x2ef809){const _0x466697=a126_0x2ee4;if(_0x466697(0x201)in _0x584b85&&(_0x584b85[_0x466697(0x1e1)]==='include'||_0x584b85['type']==='exclude')){const _0x4c685c=_0x584b85;if(_0x1af747(_0x4c685c[_0x466697(0x201)]))return{..._0x4c685c,'segment':await _0x33e964(_0x4c685c[_0x466697(0x201)])};return _0x584b85;}if(_0x466697(0x23d)in _0x584b85&&_0x584b85[_0x466697(0x23d)]){const _0x1dfa61=_0x584b85,_0x2f8e8e=await Promise[_0x466697(0x1ca)](_0x1dfa61[_0x466697(0x23d)]['map'](_0x31ea1e=>transformConditionSegmentRefs(_0x31ea1e,_0x33e964,_0x1af747,_0x2ef809)));return{..._0x1dfa61,'conditions':_0x2f8e8e};}if('filter'in _0x584b85&&_0x584b85['filter']){const _0x265ed8=_0x584b85,_0x2abd40=await _0x2ef809(filterRuleAsRuleDef(_0x265ed8['filter']),_0x33e964);return{..._0x265ed8,'filter':ruleDefAsFilterRule(_0x2abd40)};}return _0x584b85;}async function transformRuleSegmentRefs(_0x529393,_0x3edb9a,_0x3e5779){const _0x3f79e6=a126_0x2ee4,_0x89fc70=(_0x4d0480,_0x2128b3)=>transformRuleSegmentRefs(_0x4d0480,_0x2128b3,_0x3e5779),_0x173054=await Promise[_0x3f79e6(0x1ca)](_0x529393[_0x3f79e6(0x23d)][_0x3f79e6(0x1e4)](_0x50a59f=>transformConditionSegmentRefs(_0x50a59f,_0x3edb9a,_0x3e5779,_0x89fc70)));return{..._0x529393,'conditions':_0x173054};}export async function resolveRuleSegmentIds(_0x3696d1,_0x1a9f4e){const _0xf77e32=a126_0x2ee4;return transformRuleSegmentRefs(_0x3696d1,_0x1a9f4e,_0x143414=>!/^\d+$/[_0xf77e32(0x1c8)](_0x143414));}function isBehaviorApiCondition(_0x4e850c){const _0x1b7c0b=a126_0x2ee4;if(!_0x4e850c[_0x1b7c0b(0x20f)]?.[_0x1b7c0b(0x1c1)]?.[_0x1b7c0b(0x228)])return![];return!![];}function apiConditionToYaml(_0x258ecc){const _0x21c61f=a126_0x2ee4;if(_0x258ecc['type']===_0x21c61f(0x22f)||_0x258ecc[_0x21c61f(0x1e1)]==='Or'){if(_0x258ecc[_0x21c61f(0x23d)]){const _0x14cfd0=_0x258ecc[_0x21c61f(0x23d)][_0x21c61f(0x1e4)](apiConditionToYaml);if(_0x14cfd0[_0x21c61f(0x1df)]===0x1&&!_0x258ecc[_0x21c61f(0x232)])return _0x14cfd0[0x0];return{'type':_0x258ecc['type'],'conditions':_0x14cfd0,..._0x258ecc[_0x21c61f(0x232)]&&{'description':_0x258ecc[_0x21c61f(0x232)]}};}}if(_0x258ecc[_0x21c61f(0x1e1)]===_0x21c61f(0x219)&&_0x258ecc[_0x21c61f(0x20f)]&&_0x258ecc[_0x21c61f(0x1d6)]){const _0x363de6=_0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x242)]?buildAggregationDefFromApi(_0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x242)]):undefined;if(isBehaviorApiCondition(_0x258ecc)){const _0x5fb2ad=_0x258ecc[_0x21c61f(0x20f)]['source'][_0x21c61f(0x228)];return{'type':_0x21c61f(0x24d),'attribute':_0x5fb2ad,'operator':apiOperatorToYaml(_0x258ecc[_0x21c61f(0x1d6)]),..._0x258ecc[_0x21c61f(0x1fc)]&&_0x258ecc['arrayMatching']!=='any'?{'arrayMatching':_0x258ecc[_0x21c61f(0x1fc)]}:{},..._0x258ecc['exclude']?{'exclude':_0x258ecc[_0x21c61f(0x23f)]}:{},..._0x363de6?{'aggregation':_0x363de6}:{},'source':_0x5fb2ad,..._0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x1f2)]?{'filter':apiRuleToYaml(_0x258ecc['leftValue'][_0x21c61f(0x1f2)])}:{},..._0x258ecc[_0x21c61f(0x1ff)]!==undefined&&_0x258ecc[_0x21c61f(0x1ff)]!==null?{'limit':_0x258ecc[_0x21c61f(0x1ff)]}:{}};}return{'type':_0x21c61f(0x219),'attribute':_0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x228)]||'','operator':apiOperatorToYaml(_0x258ecc[_0x21c61f(0x1d6)]),..._0x258ecc['arrayMatching']&&_0x258ecc['arrayMatching']!==_0x21c61f(0x230)?{'arrayMatching':_0x258ecc[_0x21c61f(0x1fc)]}:{},..._0x258ecc[_0x21c61f(0x23f)]?{'exclude':_0x258ecc[_0x21c61f(0x23f)]}:{},..._0x363de6?{'aggregation':_0x363de6}:{},..._0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x1f2)]?{'filter':apiRuleToYaml(_0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x1f2)])}:{},..._0x258ecc[_0x21c61f(0x1ff)]!==undefined&&_0x258ecc[_0x21c61f(0x1ff)]!==null?{'limit':_0x258ecc[_0x21c61f(0x1ff)]}:{}};}if(_0x258ecc[_0x21c61f(0x1e1)]==='Column'&&_0x258ecc[_0x21c61f(0x229)]&&_0x258ecc[_0x21c61f(0x1d6)])return{'type':'Column','column':_0x258ecc[_0x21c61f(0x229)],'operator':apiOperatorToYaml(_0x258ecc[_0x21c61f(0x1d6)])};if(_0x258ecc[_0x21c61f(0x1e1)]===_0x21c61f(0x215)&&_0x258ecc['id'])return{'type':_0x258ecc['exclude']?'exclude':'include','segment':_0x258ecc['id']};return{'type':_0x21c61f(0x22f),'conditions':[]};}function isTemporalOperator(_0x17c302){return _0x17c302==='TimeWithinPast'||_0x17c302==='TimeWithinNext';}function isBetweenOperator(_0x18cb46){return _0x18cb46==='Between';}function getEffectiveValue(_0x2dd125){const _0x5e62c5=a126_0x2ee4,_0x454fd4=_0x2dd125[_0x5e62c5(0x258)];return _0x2dd125['value']??_0x454fd4;}function parseNumericValue(_0x2158cf){const _0x1afc24=a126_0x2ee4;if(typeof _0x2158cf===_0x1afc24(0x1cc)&&_0x2158cf!==null)return _0x2158cf;if(_0x2158cf==='')return _0x2158cf;const _0x130df2=Number(_0x2158cf);return Number[_0x1afc24(0x214)](_0x130df2)?_0x130df2:_0x2158cf;}function apiOperatorToYaml(_0x2d2597){const _0x1b6fae=a126_0x2ee4;if(isBetweenOperator(_0x2d2597[_0x1b6fae(0x1e1)]))return{'type':mapApiOperatorType(_0x2d2597[_0x1b6fae(0x1e1)]),..._0x2d2597[_0x1b6fae(0x20d)]!==undefined&&{'not':_0x2d2597[_0x1b6fae(0x20d)]},..._0x2d2597[_0x1b6fae(0x1d4)]!==undefined&&{'min':parseNumericValue(_0x2d2597[_0x1b6fae(0x1d4)])},..._0x2d2597[_0x1b6fae(0x21b)]!==undefined&&{'max':parseNumericValue(_0x2d2597[_0x1b6fae(0x21b)])}};if(_0x2d2597[_0x1b6fae(0x1e1)]===_0x1b6fae(0x1cf))return{'type':'TimeRange',..._0x2d2597[_0x1b6fae(0x20d)]!==undefined&&{'not':_0x2d2597[_0x1b6fae(0x20d)]},..._0x2d2597[_0x1b6fae(0x1dc)]!==undefined&&{'duration':_0x2d2597[_0x1b6fae(0x1dc)]},..._0x2d2597['from']!==undefined&&{'from':_0x2d2597[_0x1b6fae(0x23a)]},..._0x2d2597[_0x1b6fae(0x1e9)]!==undefined&&{'reverse':_0x2d2597[_0x1b6fae(0x1e9)]}};let _0x197ee3;if(_0x2d2597[_0x1b6fae(0x1d0)]&&_0x2d2597[_0x1b6fae(0x1d0)][_0x1b6fae(0x1df)]>0x0)_0x197ee3=_0x2d2597['rightValues'];else{if(_0x2d2597[_0x1b6fae(0x245)]!==undefined)_0x197ee3=_0x2d2597[_0x1b6fae(0x245)];else isTemporalOperator(_0x2d2597[_0x1b6fae(0x1e1)])&&_0x2d2597[_0x1b6fae(0x231)]!==undefined&&(_0x197ee3=_0x2d2597['value']);}return{'type':mapApiOperatorType(_0x2d2597['type']),..._0x2d2597[_0x1b6fae(0x20d)]!==undefined&&{'not':_0x2d2597[_0x1b6fae(0x20d)]},..._0x197ee3!==undefined&&{'value':_0x197ee3},..._0x2d2597[_0x1b6fae(0x1f4)]!==undefined&&{'unit':_0x2d2597[_0x1b6fae(0x1f4)]}};}function mapApiOperatorType(_0x96f61f){return _0x96f61f;}export function segmentDefToCreateRequest(_0x21402b,_0x2544f2){const _0x51eb81=a126_0x2ee4,_0x53966b={'name':_0x21402b[_0x51eb81(0x228)]};return _0x21402b[_0x51eb81(0x232)]&&(_0x53966b[_0x51eb81(0x232)]=_0x21402b['description']),_0x21402b['rule']&&(_0x53966b[_0x51eb81(0x20b)]=yamlRuleToApi(_0x21402b[_0x51eb81(0x20b)])),_0x21402b[_0x51eb81(0x239)]&&(_0x53966b[_0x51eb81(0x239)]=_0x21402b[_0x51eb81(0x239)]===_0x51eb81(0x23c)?0x0:_0x21402b[_0x51eb81(0x239)]===_0x51eb81(0x202)?0x1:0x2),_0x21402b[_0x51eb81(0x1f9)]!==undefined&&(_0x53966b[_0x51eb81(0x1c5)]=_0x21402b[_0x51eb81(0x1f9)]),_0x2544f2&&(_0x53966b[_0x51eb81(0x1be)]=_0x2544f2),_0x53966b;}export function segmentDefToUpdateRequest(_0x178f25){const _0x511f64=a126_0x2ee4,_0xad165b={'name':_0x178f25['name']};return _0x178f25[_0x511f64(0x232)]!==undefined&&(_0xad165b[_0x511f64(0x232)]=_0x178f25['description']),_0x178f25[_0x511f64(0x20b)]&&(_0xad165b[_0x511f64(0x20b)]=yamlRuleToApi(_0x178f25[_0x511f64(0x20b)])),_0x178f25['kind']&&(_0xad165b['kind']=_0x178f25[_0x511f64(0x239)]==='batch'?0x0:_0x178f25[_0x511f64(0x239)]==='realtime'?0x1:0x2),_0xad165b;}export function yamlRuleToApi(_0x5ac634,_0x53a4c0=![]){const _0x3f38c3=a126_0x2ee4,_0x38b4c0=_0x5ac634['conditions'][_0x3f38c3(0x1e4)](yamlConditionToApi);if(_0x53a4c0){const _0x30aa5b=_0x38b4c0['every'](_0x553012=>_0x553012[_0x3f38c3(0x1e1)]===_0x3f38c3(0x22f)||_0x553012[_0x3f38c3(0x1e1)]==='Or');if(!_0x30aa5b&&_0x38b4c0['length']>0x0)return{'type':_0x5ac634['type'],'conditions':[{'type':'And','description':_0x5ac634[_0x3f38c3(0x232)]||'','conditions':_0x38b4c0}]};}return{'type':_0x5ac634[_0x3f38c3(0x1e1)],'conditions':_0x38b4c0,..._0x5ac634[_0x3f38c3(0x232)]&&{'description':_0x5ac634['description']}};}function yamlConditionToApi(_0x29cdbc){const _0x287c6a=a126_0x2ee4;if(_0x287c6a(0x201)in _0x29cdbc&&(_0x29cdbc[_0x287c6a(0x1e1)]==='include'||_0x29cdbc[_0x287c6a(0x1e1)]===_0x287c6a(0x23f))){const _0x1a936b=_0x29cdbc;return{'type':_0x287c6a(0x215),'id':_0x1a936b[_0x287c6a(0x201)],'exclude':_0x1a936b[_0x287c6a(0x1e1)]===_0x287c6a(0x23f)};}if(_0x287c6a(0x1e1)in _0x29cdbc&&(_0x29cdbc['type']===_0x287c6a(0x22f)||_0x29cdbc[_0x287c6a(0x1e1)]==='Or')){const _0x28bd2e=_0x29cdbc;return{'type':_0x28bd2e[_0x287c6a(0x1e1)],'conditions':_0x28bd2e['conditions'][_0x287c6a(0x1e4)](yamlConditionToApi),..._0x28bd2e['description']&&{'description':_0x28bd2e[_0x287c6a(0x232)]}};}if(_0x287c6a(0x229)in _0x29cdbc&&_0x29cdbc[_0x287c6a(0x1e1)]==='Column'){const _0x37a25a=_0x29cdbc;return{'type':'Column','column':_0x37a25a['column'],'operator':yamlOperatorToApi(_0x37a25a['operator'])};}const _0x482f0f=_0x29cdbc,_0x143e9d={'type':_0x287c6a(0x219),'leftValue':buildLeftValue(_0x482f0f),'operator':yamlOperatorToApi(_0x482f0f[_0x287c6a(0x1d6)]),'exclude':_0x482f0f[_0x287c6a(0x23f)]??![],'arrayMatching':_0x482f0f[_0x287c6a(0x1fc)]??_0x287c6a(0x230)};return _0x482f0f[_0x287c6a(0x1ff)]!==undefined&&(_0x143e9d[_0x287c6a(0x1ff)]=_0x482f0f['limit']),_0x143e9d;}function buildAggregationDefFromApi(_0x1afdcd){const _0x4fb46a=a126_0x2ee4,_0x3d6178=_0x1afdcd[_0x4fb46a(0x1e1)];if(_0x3d6178==='CountDistinct')return{'type':_0x3d6178,'columns':_0x1afdcd[_0x4fb46a(0x1f8)]??[]};if(_0x3d6178===_0x4fb46a(0x222)||_0x3d6178===_0x4fb46a(0x21a))return{'type':_0x3d6178,'column':_0x1afdcd['column']??'','orderColumn':_0x1afdcd[_0x4fb46a(0x20c)]??'',..._0x1afdcd[_0x4fb46a(0x1c9)]&&{'groupingColumns':_0x1afdcd[_0x4fb46a(0x1c9)]}};if(_0x3d6178===_0x4fb46a(0x224))return{'type':_0x3d6178,..._0x1afdcd[_0x4fb46a(0x1c9)]&&{'groupingColumns':_0x1afdcd['groupingColumns']}};return{'type':_0x3d6178,'column':_0x1afdcd[_0x4fb46a(0x229)]??'',..._0x1afdcd[_0x4fb46a(0x1c9)]&&{'groupingColumns':_0x1afdcd[_0x4fb46a(0x1c9)]}};}function buildLeftValue(_0x2b0f79){const _0x7fadde=a126_0x2ee4,_0x4151e9={};_0x2b0f79['attribute']&&(_0x4151e9[_0x7fadde(0x228)]=_0x2b0f79[_0x7fadde(0x1fa)]);if(_0x2b0f79['aggregation']){const _0x113cbe=_0x2b0f79[_0x7fadde(0x242)];if(_0x113cbe['type']===_0x7fadde(0x22d))_0x4151e9['aggregation']={'type':'CountDistinct','columns':_0x113cbe['columns']};else{if(_0x113cbe[_0x7fadde(0x1e1)]===_0x7fadde(0x222)||_0x113cbe['type']==='Last')_0x4151e9[_0x7fadde(0x242)]={'type':_0x113cbe[_0x7fadde(0x1e1)],'column':_0x113cbe[_0x7fadde(0x229)],'orderColumn':_0x113cbe[_0x7fadde(0x20c)],..._0x113cbe[_0x7fadde(0x1c9)]&&{'groupingColumns':_0x113cbe[_0x7fadde(0x1c9)]}};else _0x113cbe[_0x7fadde(0x1e1)]===_0x7fadde(0x224)?_0x4151e9[_0x7fadde(0x242)]={'type':_0x7fadde(0x224),..._0x113cbe['groupingColumns']&&{'groupingColumns':_0x113cbe[_0x7fadde(0x1c9)]}}:_0x4151e9[_0x7fadde(0x242)]={'type':_0x113cbe[_0x7fadde(0x1e1)],'column':_0x113cbe[_0x7fadde(0x229)],..._0x113cbe[_0x7fadde(0x1c9)]&&{'groupingColumns':_0x113cbe[_0x7fadde(0x1c9)]}};}}return _0x2b0f79['source']&&(_0x4151e9['source']={'name':_0x2b0f79['source']}),_0x2b0f79['filter']&&(_0x4151e9[_0x7fadde(0x1f2)]=yamlRuleToApi(filterRuleAsRuleDef(_0x2b0f79[_0x7fadde(0x1f2)]))),_0x4151e9;}function yamlOperatorToApi(_0x38461b){const _0x2db12b=a126_0x2ee4,_0x2b612d={'type':mapYamlOperatorType(_0x38461b[_0x2db12b(0x1e1)]),'not':_0x38461b[_0x2db12b(0x20d)]??![]};if(isBetweenOperator(_0x38461b[_0x2db12b(0x1e1)]))return _0x38461b[_0x2db12b(0x1ed)]!==undefined&&(_0x2b612d[_0x2db12b(0x1d4)]=typeof _0x38461b[_0x2db12b(0x1ed)]===_0x2db12b(0x1cc)?_0x38461b[_0x2db12b(0x1ed)]:String(_0x38461b[_0x2db12b(0x1ed)])),_0x38461b[_0x2db12b(0x23b)]!==undefined&&(_0x2b612d[_0x2db12b(0x21b)]=typeof _0x38461b[_0x2db12b(0x23b)]===_0x2db12b(0x1cc)?_0x38461b['max']:String(_0x38461b[_0x2db12b(0x23b)])),_0x2b612d;if(_0x38461b[_0x2db12b(0x1e1)]===_0x2db12b(0x1cf))return _0x38461b[_0x2db12b(0x1dc)]&&(_0x2b612d[_0x2db12b(0x1dc)]=_0x38461b[_0x2db12b(0x1dc)]),_0x38461b[_0x2db12b(0x23a)]&&(_0x2b612d[_0x2db12b(0x23a)]=_0x38461b[_0x2db12b(0x23a)]),_0x38461b['reverse']!==undefined&&(_0x2b612d[_0x2db12b(0x1e9)]=_0x38461b[_0x2db12b(0x1e9)]),_0x2b612d;const _0x2f7f1a=getEffectiveValue(_0x38461b);if(_0x2f7f1a!==undefined){if(Array[_0x2db12b(0x20a)](_0x2f7f1a))_0x2b612d[_0x2db12b(0x1d0)]=_0x2f7f1a;else isTemporalOperator(_0x38461b[_0x2db12b(0x1e1)])?_0x2b612d[_0x2db12b(0x231)]=_0x2f7f1a:_0x2b612d[_0x2db12b(0x245)]=_0x2f7f1a;}return _0x38461b[_0x2db12b(0x1f4)]&&(_0x2b612d[_0x2db12b(0x1f4)]=_0x38461b[_0x2db12b(0x1f4)]),_0x2b612d;}function mapYamlOperatorType(_0x4bbc3a){return _0x4bbc3a;}export function toYamlString(_0x81caf0){const _0x41c1a3=a126_0x2ee4,_0xfb02bb=JSON[_0x41c1a3(0x22c)](JSON['stringify'](_0x81caf0)),_0x58187d=a126_0x3d8b8a[_0x41c1a3(0x221)](_0xfb02bb,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x41c1a3(0x234)}),_0x1ea1b8=[_0x41c1a3(0x24b)];let _0x2ae882=_0x58187d;for(const _0x1b7675 of _0x1ea1b8){_0x2ae882=_0x2ae882['replace'](new RegExp('^('+_0x1b7675+')','m'),(_0x566176,_0x59fd64,_0x3e7788)=>{if(_0x3e7788===0x0||_0x2ae882[_0x3e7788-0x1]==='\x0a'&&_0x2ae882[_0x3e7788-0x2]==='\x0a')return _0x59fd64;return'\x0a'+_0x59fd64;});}return _0x2ae882;}function a126_0x2ee4(_0xca72e7,_0x2c841b){_0xca72e7=_0xca72e7-0x1be;const _0x2d1695=a126_0x2d16();let _0x2ee4c2=_0x2d1695[_0xca72e7];return _0x2ee4c2;}export function parseYamlString(_0x21b7b6){return parseSegmentYamlFile(_0x21b7b6);}export function isSegmentYaml(_0x18eefd){const _0x22954d=a126_0x2ee4;if(typeof _0x18eefd!==_0x22954d(0x1cc)||_0x18eefd===null)return![];const _0x1e794b=_0x18eefd;return _0x1e794b[_0x22954d(0x1e1)]===_0x22954d(0x201)||_0x1e794b[_0x22954d(0x1e1)]===undefined;}export function generateTemplate(_0x146f65=a126_0x15f653(0x22b)){const _0x52a9b9=a126_0x15f653,_0x1348c7={'type':'segment','name':_0x146f65,'description':'Segment\x20description','rule':{'type':_0x52a9b9(0x22f),'conditions':[{'type':_0x52a9b9(0x219),'attribute':_0x52a9b9(0x1c2),'operator':{'type':_0x52a9b9(0x237),'value':'value'}}]}};return toYamlString(_0x1348c7);}export function segmentToYamlString(_0x2fad6b){const _0x12ee02=a126_0x15f653,_0x448f57=JSON[_0x12ee02(0x22c)](JSON['stringify'](_0x2fad6b)),_0x409e73=a126_0x3d8b8a[_0x12ee02(0x221)](_0x448f57,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x12ee02(0x234)}),_0x23203e=[_0x12ee02(0x24b),_0x12ee02(0x227)];let _0x34df96=_0x409e73;for(const _0x1cc0bb of _0x23203e){_0x34df96=_0x34df96['replace'](new RegExp('^('+_0x1cc0bb+')','m'),(_0x4d84ac,_0x700801,_0x9fc301)=>{if(_0x9fc301===0x0||_0x34df96[_0x9fc301-0x1]==='\x0a'&&_0x34df96[_0x9fc301-0x2]==='\x0a')return _0x700801;return'\x0a'+_0x700801;});}return _0x34df96;}export function parseSegmentYamlFile(_0x40101b){return safeParseYaml(_0x40101b,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x3c501e){const _0x330608=a126_0x15f653;return{'type':_0x330608(0x201),'name':_0x3c501e[_0x330608(0x228)],..._0x3c501e[_0x330608(0x232)]!==undefined&&{'description':_0x3c501e[_0x330608(0x232)]},..._0x3c501e['folder']!==undefined&&{'folder':_0x3c501e[_0x330608(0x1fe)]},..._0x3c501e[_0x330608(0x20b)]&&{'rule':normalizeRule(_0x3c501e[_0x330608(0x20b)])},..._0x3c501e[_0x330608(0x239)]!==undefined&&{'kind':_0x3c501e[_0x330608(0x239)]},..._0x3c501e[_0x330608(0x1f9)]!==undefined&&{'visible':_0x3c501e[_0x330608(0x1f9)]},..._0x3c501e[_0x330608(0x257)]&&{'activations':_0x3c501e[_0x330608(0x257)][_0x330608(0x1e4)](normalizeActivation)}};}function a126_0x2d16(){const _0x1c0911=['schedule','warnings','segmentFolderId','keys','connectionId','source','attribute_name','notify_on','visibility','isVisible','end_on','run_after_journey_refresh','test','groupingColumns','all','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','object','connector_config\x20for\x20activation\x20\x22','repeatFrequency','TimeRange','rightValues','conditions[','orderBy','connectionNameToIdMap','minValue','repeat_sub_frequency','operator','push','12308900TClZAy','joinStrategy','all_columns','5566504oxYrfc','duration','code','repeatUnit','length','getSchema','type','\x0a\x0aAvailable\x20fields:\x0a','behavior','map','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Connector:\x20','1602012viGCVZ','emailToIdMap','reverse','joinRow','string','JOURNEY_SYNTAX_ERROR','min','notification','syndicationBehavior','startAt','timezone','filter','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','unit','order_by','sort','join_strategy','columns','visible','attribute','valid','arrayMatching','formatting','folder','limit','join_row','segment','realtime','connector_config','repeatSubFrequency','ruleHashToName','8ZeKNRj','localRuleToName','\x27:\x20','CONNECTOR_SCHEMA_NOT_FOUND','isArray','rule','orderColumn','not','1423805IkeWeI','leftValue','errors','7882301PKuOyj','include','runAfterJourneyRefresh','isFinite','Reference','usedNames','Unknown\x20email\x20recipient:\x20','\x22:\x0a','Value','Last','maxValue','email_recipients','set','behavior_table','Column','852252pozljH','stringify','First','scheduleType','Count','warn','funnel_stage','activations:','name','column','add','New\x20Segment','parse','CountDistinct','forEach','And','any','value','description','emailRecipients','null','activation_template_id','connection','Equal','start_at','kind','from','max','batch','conditions','connectorConfig','exclude','30Fxwmst','repeat_frequency','aggregation','resolveSegmentName','has','rightValue','endOn','entries','Unknown\x20connection:\x20','allColumns','45lCnbGz','rule:','repeat_unit','Behavior','].attribute\x20cannot\x20be\x20empty.\x0a','activationTemplateId','get','1391186dKHBtw','activationParams','INVALID_ARGUMENT','behaviorTableName','notifyOn','__UNRESOLVED__','activations','values'];a126_0x2d16=function(){return _0x1c0911;};return a126_0x2d16();}export function normalizeRule(_0x2243ae){const _0x5afd3e=a126_0x15f653;return{'type':_0x2243ae['type'],'conditions':_0x2243ae[_0x5afd3e(0x23d)][_0x5afd3e(0x1e4)](normalizeCondition),..._0x2243ae[_0x5afd3e(0x232)]!==undefined&&{'description':_0x2243ae[_0x5afd3e(0x232)]}};}function normalizeCondition(_0x55f08f){const _0x1257b8=a126_0x15f653;if(_0x1257b8(0x201)in _0x55f08f&&(_0x55f08f[_0x1257b8(0x1e1)]===_0x1257b8(0x212)||_0x55f08f['type']===_0x1257b8(0x23f))){const _0x33997a=_0x55f08f;return{'type':_0x33997a['type'],'segment':_0x33997a[_0x1257b8(0x201)]};}if(_0x1257b8(0x1e1)in _0x55f08f&&(_0x55f08f[_0x1257b8(0x1e1)]===_0x1257b8(0x22f)||_0x55f08f[_0x1257b8(0x1e1)]==='Or')){const _0x4e0a0e=_0x55f08f;return{'type':_0x4e0a0e[_0x1257b8(0x1e1)],'conditions':_0x4e0a0e[_0x1257b8(0x23d)][_0x1257b8(0x1e4)](normalizeCondition),..._0x4e0a0e['description']!==undefined&&{'description':_0x4e0a0e[_0x1257b8(0x232)]}};}if(_0x1257b8(0x229)in _0x55f08f&&_0x55f08f[_0x1257b8(0x1e1)]===_0x1257b8(0x21f)){const _0x53d5ad=_0x55f08f;return{'type':_0x1257b8(0x21f),'column':_0x53d5ad[_0x1257b8(0x229)],'operator':normalizeOperator(_0x53d5ad[_0x1257b8(0x1d6)])};}const _0x458b96=_0x55f08f;return{'type':_0x1257b8(0x219),'attribute':_0x458b96[_0x1257b8(0x1fa)],'operator':normalizeOperator(_0x458b96[_0x1257b8(0x1d6)]),..._0x458b96[_0x1257b8(0x1fc)]!==undefined&&{'arrayMatching':_0x458b96[_0x1257b8(0x1fc)]},..._0x458b96[_0x1257b8(0x23f)]!==undefined&&{'exclude':_0x458b96[_0x1257b8(0x23f)]},..._0x458b96[_0x1257b8(0x242)]!==undefined&&{'aggregation':_0x458b96[_0x1257b8(0x242)]},..._0x458b96[_0x1257b8(0x1c1)]!==undefined&&{'source':_0x458b96['source']},..._0x458b96[_0x1257b8(0x1f2)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x458b96[_0x1257b8(0x1f2)])))},..._0x458b96[_0x1257b8(0x1ff)]!==undefined&&{'limit':_0x458b96[_0x1257b8(0x1ff)]}};}function normalizeOperator(_0x4a64e5){const _0x229cc1=a126_0x15f653;if(isBetweenOperator(_0x4a64e5[_0x229cc1(0x1e1)]))return{'type':_0x4a64e5[_0x229cc1(0x1e1)],..._0x4a64e5['not']!==undefined&&{'not':_0x4a64e5['not']},..._0x4a64e5['min']!==undefined&&{'min':_0x4a64e5[_0x229cc1(0x1ed)]},..._0x4a64e5['max']!==undefined&&{'max':_0x4a64e5[_0x229cc1(0x23b)]}};const _0x637817=getEffectiveValue(_0x4a64e5);return{'type':_0x4a64e5['type'],..._0x4a64e5[_0x229cc1(0x20d)]!==undefined&&{'not':_0x4a64e5['not']},..._0x637817!==undefined&&{'value':_0x637817},..._0x4a64e5[_0x229cc1(0x1f4)]!==undefined&&{'unit':_0x4a64e5[_0x229cc1(0x1f4)]},..._0x4a64e5['duration']!==undefined&&{'duration':_0x4a64e5[_0x229cc1(0x1dc)]},..._0x4a64e5[_0x229cc1(0x23a)]!==undefined&&{'from':_0x4a64e5['from']},..._0x4a64e5[_0x229cc1(0x1e9)]!==undefined&&{'reverse':_0x4a64e5[_0x229cc1(0x1e9)]}};}function normalizeActivation(_0x31c205){const _0x2844b0=a126_0x15f653;return{'name':_0x31c205[_0x2844b0(0x228)],'connection':_0x31c205[_0x2844b0(0x236)],..._0x31c205[_0x2844b0(0x232)]!==undefined&&{'description':_0x31c205[_0x2844b0(0x232)]},..._0x31c205[_0x2844b0(0x1da)]!==undefined&&{'all_columns':_0x31c205[_0x2844b0(0x1da)]},..._0x31c205[_0x2844b0(0x1f8)]!==undefined&&{'columns':_0x31c205[_0x2844b0(0x1f8)]},..._0x31c205[_0x2844b0(0x1e3)]!==undefined&&{'behavior':_0x31c205[_0x2844b0(0x1e3)]},..._0x31c205['schedule']!==undefined&&{'schedule':_0x31c205[_0x2844b0(0x259)]},..._0x31c205[_0x2844b0(0x1ee)]!==undefined&&{'notification':_0x31c205['notification']},..._0x31c205['connector_config']!==undefined&&{'connector_config':_0x31c205[_0x2844b0(0x203)]},..._0x31c205['activation_template_id']!==undefined&&{'activation_template_id':_0x31c205[_0x2844b0(0x235)]}};}export function activationResponseToDef(_0x528168,_0x1b0d96,_0x42334b){const _0x4ba7c5=a126_0x15f653,_0x595ead=_0x528168[_0x4ba7c5(0x1c0)]||'',_0x4bed7e=_0x42334b?.['get'](_0x595ead)??_0x595ead,_0x3897e3={'name':_0x528168[_0x4ba7c5(0x228)],'connection':_0x4bed7e};_0x528168['description']&&(_0x3897e3['description']=_0x528168[_0x4ba7c5(0x232)]);let _0x3a3761=[];_0x528168[_0x4ba7c5(0x1f8)]&&_0x528168[_0x4ba7c5(0x1f8)]['length']>0x0&&(_0x3a3761=_0x528168['columns'][_0x4ba7c5(0x1f2)](_0x5b85ac=>_0x5b85ac&&_0x5b85ac[_0x4ba7c5(0x228)])[_0x4ba7c5(0x1e4)](_0xb75f26=>{const _0x153998=_0x4ba7c5;if(_0xb75f26[_0x153998(0x1e1)]||_0xb75f26[_0x153998(0x1c4)])return{'name':_0xb75f26[_0x153998(0x228)],..._0xb75f26[_0x153998(0x1e1)]&&{'type':_0xb75f26['type']},..._0xb75f26[_0x153998(0x1c4)]&&{'visibility':_0xb75f26[_0x153998(0x1c4)]}};return _0xb75f26['name'];}));_0x3a3761[_0x4ba7c5(0x1df)]>0x0&&(_0x3897e3[_0x4ba7c5(0x1f8)]=_0x3a3761);_0x528168[_0x4ba7c5(0x249)]!==undefined&&(_0x528168[_0x4ba7c5(0x249)]===![]&&_0x3a3761[_0x4ba7c5(0x1df)]===0x0?_0x3897e3[_0x4ba7c5(0x1da)]=!![]:_0x3897e3['all_columns']=_0x528168[_0x4ba7c5(0x249)]);const _0x4168ba={};let _0x83b09d=![];_0x528168[_0x4ba7c5(0x223)]&&(_0x4168ba[_0x4ba7c5(0x1e1)]=_0x528168[_0x4ba7c5(0x223)],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x1de)]&&(_0x4168ba['repeat_unit']=_0x528168['repeatUnit'],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x1ce)]!==undefined&&_0x528168['repeatFrequency']!==null&&(_0x4168ba[_0x4ba7c5(0x241)]=_0x528168[_0x4ba7c5(0x1ce)],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x204)]&&_0x528168[_0x4ba7c5(0x204)][_0x4ba7c5(0x1df)]>0x0&&(_0x4168ba[_0x4ba7c5(0x1d5)]=_0x528168['repeatSubFrequency'],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x1f0)]!==undefined&&(_0x4168ba[_0x4ba7c5(0x238)]=_0x528168[_0x4ba7c5(0x1f0)],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x246)]!==undefined&&(_0x4168ba['end_on']=_0x528168[_0x4ba7c5(0x246)],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x1f1)]&&(_0x4168ba[_0x4ba7c5(0x1f1)]=_0x528168['timezone'],_0x83b09d=!![]);_0x83b09d&&(_0x3897e3[_0x4ba7c5(0x259)]=_0x4168ba);(_0x528168[_0x4ba7c5(0x255)]&&_0x528168['notifyOn'][_0x4ba7c5(0x1df)]>0x0||_0x528168['emailRecipients']&&_0x528168[_0x4ba7c5(0x233)][_0x4ba7c5(0x1df)]>0x0)&&(_0x3897e3[_0x4ba7c5(0x1ee)]={},_0x528168[_0x4ba7c5(0x255)]&&_0x528168[_0x4ba7c5(0x255)]['length']>0x0&&(_0x3897e3[_0x4ba7c5(0x1ee)][_0x4ba7c5(0x1c3)]=_0x528168['notifyOn']),_0x528168[_0x4ba7c5(0x233)]&&_0x528168['emailRecipients']['length']>0x0&&(_0x3897e3[_0x4ba7c5(0x1ee)][_0x4ba7c5(0x21c)]=_0x528168[_0x4ba7c5(0x233)][_0x4ba7c5(0x1e4)](_0x612b2a=>{const _0x5a3123=_0x4ba7c5,_0x27511c=_0x1b0d96?.[_0x5a3123(0x250)](_0x612b2a);return _0x27511c??String(_0x612b2a);})));_0x528168[_0x4ba7c5(0x23e)]&&Object[_0x4ba7c5(0x1bf)](_0x528168[_0x4ba7c5(0x23e)])[_0x4ba7c5(0x1df)]>0x0&&(_0x3897e3[_0x4ba7c5(0x203)]=normalizeConnectorConfigForYaml(_0x528168[_0x4ba7c5(0x23e)]));_0x528168[_0x4ba7c5(0x24f)]&&(_0x3897e3['activation_template_id']=_0x528168[_0x4ba7c5(0x24f)]);if(_0x528168[_0x4ba7c5(0x1ef)]){const _0x2340a4={},_0x379244=_0x528168[_0x4ba7c5(0x1ef)];_0x379244['columns']&&_0x379244[_0x4ba7c5(0x1f8)]['length']>0x0&&(_0x2340a4['columns']=_0x379244['columns'][_0x4ba7c5(0x1f2)](_0xb5a498=>_0xb5a498&&_0xb5a498[_0x4ba7c5(0x228)])['map'](_0x1f1a3a=>({'name':_0x1f1a3a[_0x4ba7c5(0x228)],..._0x1f1a3a[_0x4ba7c5(0x1e1)]&&{'type':_0x1f1a3a[_0x4ba7c5(0x1e1)]},..._0x1f1a3a[_0x4ba7c5(0x1c4)]&&{'visibility':_0x1f1a3a[_0x4ba7c5(0x1c4)]}}))),_0x379244['behaviorTableName']&&(_0x2340a4[_0x4ba7c5(0x21e)]=_0x379244[_0x4ba7c5(0x254)]),_0x379244[_0x4ba7c5(0x1ea)]!==undefined&&(_0x2340a4['join_row']=_0x379244['joinRow']),_0x379244['joinStrategy']&&(_0x2340a4['join_strategy']=_0x379244[_0x4ba7c5(0x1d9)]),_0x379244['formatting']&&(_0x2340a4[_0x4ba7c5(0x1fd)]=_0x379244[_0x4ba7c5(0x1fd)]),_0x379244['orderBy']&&_0x379244[_0x4ba7c5(0x1d2)][_0x4ba7c5(0x1df)]>0x0&&(_0x2340a4['order_by']=_0x379244[_0x4ba7c5(0x1d2)]),Object['keys'](_0x2340a4)[_0x4ba7c5(0x1df)]>0x0&&(_0x3897e3[_0x4ba7c5(0x1e3)]=_0x2340a4);}return _0x3897e3;}export function journeyActivationStepToYaml(_0x578d67,_0x165096,_0x322e6c){const _0x42170e=a126_0x15f653,_0x47d0b1=_0x578d67['attributes'][_0x42170e(0x252)],_0x5e2271=_0x47d0b1['connectionId']||'',_0x2e585e=_0x322e6c?.[_0x42170e(0x250)](_0x5e2271)??_0x5e2271,_0xa620b3={'name':_0x47d0b1[_0x42170e(0x228)]||'','connection':_0x2e585e};_0x578d67['attributes'][_0x42170e(0x213)]&&(_0xa620b3[_0x42170e(0x1c7)]=!![]);_0x47d0b1['description']&&(_0xa620b3[_0x42170e(0x232)]=_0x47d0b1['description']);let _0x356ec7=[];_0x47d0b1[_0x42170e(0x1f8)]&&_0x47d0b1[_0x42170e(0x1f8)][_0x42170e(0x1df)]>0x0&&(_0x356ec7=_0x47d0b1['columns'][_0x42170e(0x1f2)](_0x255bc5=>_0x255bc5&&_0x255bc5[_0x42170e(0x228)])[_0x42170e(0x1e4)](_0x348b65=>{const _0x33bc23=_0x42170e;if(_0x348b65['type']||_0x348b65['visibility'])return{'name':_0x348b65[_0x33bc23(0x228)],..._0x348b65[_0x33bc23(0x1e1)]&&{'type':_0x348b65[_0x33bc23(0x1e1)]},..._0x348b65[_0x33bc23(0x1c4)]&&{'visibility':_0x348b65[_0x33bc23(0x1c4)]}};return _0x348b65['name'];}));_0x356ec7[_0x42170e(0x1df)]>0x0&&(_0xa620b3['columns']=_0x356ec7);_0x47d0b1['allColumns']!==undefined&&(_0x47d0b1[_0x42170e(0x249)]===![]&&_0x356ec7['length']===0x0?_0xa620b3[_0x42170e(0x1da)]=!![]:_0xa620b3[_0x42170e(0x1da)]=_0x47d0b1[_0x42170e(0x249)]);const _0x82f2d1={};let _0x1757f7=![];_0x47d0b1['scheduleType']&&(_0x82f2d1[_0x42170e(0x1e1)]=_0x47d0b1[_0x42170e(0x223)],_0x1757f7=!![]);_0x47d0b1[_0x42170e(0x1de)]&&(_0x82f2d1[_0x42170e(0x24c)]=_0x47d0b1[_0x42170e(0x1de)],_0x1757f7=!![]);_0x47d0b1['repeatFrequency']!==undefined&&_0x47d0b1[_0x42170e(0x1ce)]!==null&&(_0x82f2d1[_0x42170e(0x241)]=_0x47d0b1[_0x42170e(0x1ce)],_0x1757f7=!![]);_0x47d0b1[_0x42170e(0x1f0)]!==undefined&&(_0x82f2d1[_0x42170e(0x238)]=_0x47d0b1['startAt'],_0x1757f7=!![]);_0x47d0b1[_0x42170e(0x246)]!==undefined&&(_0x82f2d1[_0x42170e(0x1c6)]=_0x47d0b1[_0x42170e(0x246)],_0x1757f7=!![]);_0x47d0b1['timezone']&&(_0x82f2d1[_0x42170e(0x1f1)]=_0x47d0b1[_0x42170e(0x1f1)],_0x1757f7=!![]);_0x1757f7&&(_0xa620b3[_0x42170e(0x259)]=_0x82f2d1);(_0x47d0b1[_0x42170e(0x255)]&&_0x47d0b1['notifyOn']['length']>0x0||_0x47d0b1['emailRecipients']&&_0x47d0b1[_0x42170e(0x233)][_0x42170e(0x1df)]>0x0)&&(_0xa620b3[_0x42170e(0x1ee)]={},_0x47d0b1[_0x42170e(0x255)]&&_0x47d0b1[_0x42170e(0x255)]['length']>0x0&&(_0xa620b3[_0x42170e(0x1ee)][_0x42170e(0x1c3)]=_0x47d0b1[_0x42170e(0x255)]),_0x47d0b1[_0x42170e(0x233)]&&_0x47d0b1[_0x42170e(0x233)][_0x42170e(0x1df)]>0x0&&(_0xa620b3[_0x42170e(0x1ee)][_0x42170e(0x21c)]=_0x47d0b1[_0x42170e(0x233)][_0x42170e(0x1e4)](_0x22e588=>{const _0xd213eb=_0x42170e,_0x24cfad=_0x165096?.[_0xd213eb(0x250)](_0x22e588);return _0x24cfad??String(_0x22e588);})));_0x47d0b1[_0x42170e(0x23e)]&&Object[_0x42170e(0x1bf)](_0x47d0b1[_0x42170e(0x23e)])[_0x42170e(0x1df)]>0x0&&(_0xa620b3['connector_config']=normalizeConnectorConfigForYaml(_0x47d0b1[_0x42170e(0x23e)]));_0x47d0b1['activationTemplateId']&&(_0xa620b3[_0x42170e(0x235)]=_0x47d0b1['activationTemplateId']);if(_0x47d0b1[_0x42170e(0x1ef)]){const _0x263c53={},_0x13d179=_0x47d0b1[_0x42170e(0x1ef)];_0x13d179['columns']&&_0x13d179[_0x42170e(0x1f8)][_0x42170e(0x1df)]>0x0&&(_0x263c53[_0x42170e(0x1f8)]=_0x13d179[_0x42170e(0x1f8)][_0x42170e(0x1f2)](_0x463451=>_0x463451&&_0x463451['name'])[_0x42170e(0x1e4)](_0x35c4fc=>({'name':_0x35c4fc[_0x42170e(0x228)],..._0x35c4fc[_0x42170e(0x1e1)]&&{'type':_0x35c4fc[_0x42170e(0x1e1)]},..._0x35c4fc[_0x42170e(0x1c4)]&&{'visibility':_0x35c4fc[_0x42170e(0x1c4)]}}))),_0x13d179['behaviorTableName']&&(_0x263c53[_0x42170e(0x21e)]=_0x13d179[_0x42170e(0x254)]),_0x13d179['joinRow']!==undefined&&(_0x263c53[_0x42170e(0x200)]=_0x13d179[_0x42170e(0x1ea)]),_0x13d179[_0x42170e(0x1d9)]&&(_0x263c53[_0x42170e(0x1f7)]=_0x13d179[_0x42170e(0x1d9)]),_0x13d179[_0x42170e(0x1fd)]&&(_0x263c53[_0x42170e(0x1fd)]=_0x13d179[_0x42170e(0x1fd)]),_0x13d179['orderBy']&&_0x13d179[_0x42170e(0x1d2)][_0x42170e(0x1df)]>0x0&&(_0x263c53[_0x42170e(0x1f5)]=_0x13d179[_0x42170e(0x1d2)]),Object[_0x42170e(0x1bf)](_0x263c53)[_0x42170e(0x1df)]>0x0&&(_0xa620b3[_0x42170e(0x1e3)]=_0x263c53);}return _0xa620b3;}export function segmentWithActivationsToYaml(_0x4dd195,_0x41b30c,_0x19300a,_0x25b871,_0x590dcc){const _0xb00978=a126_0x15f653,_0x9415bf=segmentResponseToDefSync(_0x4dd195,_0x19300a);return _0x41b30c[_0xb00978(0x1df)]>0x0&&(_0x9415bf['activations']=_0x41b30c[_0xb00978(0x1e4)](_0x37f10a=>activationResponseToDef(_0x37f10a,_0x25b871,_0x590dcc))),_0x9415bf;}function normalizeColumn(_0x4f8038){const _0x334f14=a126_0x15f653;if(typeof _0x4f8038===_0x334f14(0x1eb))return{'name':_0x4f8038};return{'name':_0x4f8038[_0x334f14(0x228)],..._0x4f8038['type']&&{'type':_0x4f8038[_0x334f14(0x1e1)]},..._0x4f8038[_0x334f14(0x1c4)]&&{'visibility':_0x4f8038['visibility']}};}export async function activationDefToCreateRequest(_0x241a32,_0x509206){const _0x21349a=a126_0x15f653,_0x552a15=_0x509206?.[_0x21349a(0x1e8)],_0x5a9549=_0x509206?.[_0x21349a(0x1d3)],_0x7eba38=_0x241a32[_0x21349a(0x236)];let _0x5f3493;const _0x3568d2=parseInt(_0x7eba38,0xa);if(!isNaN(_0x3568d2)&&String(_0x3568d2)===_0x7eba38)_0x5f3493=_0x3568d2;else{const _0x468fb1=_0x5a9549?.[_0x21349a(0x250)](_0x7eba38);if(_0x468fb1===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x21349a(0x248)+_0x7eba38,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x5f3493=_0x468fb1;}const _0x2b0c16={'name':_0x241a32['name'],'connectionId':_0x5f3493};_0x241a32[_0x21349a(0x232)]&&(_0x2b0c16[_0x21349a(0x232)]=_0x241a32['description']);let _0x3a9382=[];_0x241a32[_0x21349a(0x1f8)]&&_0x241a32[_0x21349a(0x1f8)][_0x21349a(0x1df)]>0x0&&(_0x3a9382=_0x241a32[_0x21349a(0x1f8)][_0x21349a(0x1f2)](_0xbfbed=>_0xbfbed!=null)[_0x21349a(0x1e4)](normalizeColumn));_0x3a9382['length']>0x0&&(_0x2b0c16[_0x21349a(0x1f8)]=_0x3a9382);_0x241a32[_0x21349a(0x1da)]!==undefined&&(_0x241a32[_0x21349a(0x1da)]===![]&&_0x3a9382[_0x21349a(0x1df)]===0x0?_0x2b0c16[_0x21349a(0x249)]=!![]:_0x2b0c16[_0x21349a(0x249)]=_0x241a32[_0x21349a(0x1da)]);if(_0x241a32[_0x21349a(0x259)]){const _0x111af2=_0x241a32['schedule'];_0x111af2[_0x21349a(0x1e1)]&&(_0x2b0c16[_0x21349a(0x223)]=_0x111af2[_0x21349a(0x1e1)]),_0x111af2[_0x21349a(0x24c)]&&(_0x2b0c16['repeatUnit']=_0x111af2['repeat_unit']),_0x111af2['repeat_frequency']!==undefined&&(_0x2b0c16[_0x21349a(0x1ce)]=_0x111af2[_0x21349a(0x241)]),_0x111af2[_0x21349a(0x1d5)]&&(_0x2b0c16[_0x21349a(0x204)]=_0x111af2[_0x21349a(0x1d5)]),_0x111af2['start_at']!==undefined&&(_0x2b0c16[_0x21349a(0x1f0)]=_0x111af2[_0x21349a(0x238)]),_0x111af2['end_on']!==undefined&&(_0x2b0c16[_0x21349a(0x246)]=_0x111af2['end_on']),_0x111af2[_0x21349a(0x1f1)]&&(_0x2b0c16[_0x21349a(0x1f1)]=_0x111af2[_0x21349a(0x1f1)]);}_0x241a32[_0x21349a(0x1ee)]&&(_0x241a32[_0x21349a(0x1ee)][_0x21349a(0x1c3)]&&(_0x2b0c16['notifyOn']=_0x241a32[_0x21349a(0x1ee)][_0x21349a(0x1c3)]),_0x241a32[_0x21349a(0x1ee)][_0x21349a(0x21c)]&&(_0x2b0c16['emailRecipients']=_0x241a32[_0x21349a(0x1ee)][_0x21349a(0x21c)]['map'](_0x1683e0=>{const _0x257d84=_0x21349a,_0x23e6f7=Number(_0x1683e0);if(!isNaN(_0x23e6f7)&&String(_0x23e6f7)===_0x1683e0)return _0x23e6f7;const _0x3514bd=_0x552a15?.['get'](_0x1683e0['toLowerCase']());if(_0x3514bd===undefined)throw new SDKError(ErrorCode[_0x257d84(0x253)],_0x257d84(0x217)+_0x1683e0+_0x257d84(0x1cb));return _0x3514bd;})));if(_0x241a32[_0x21349a(0x203)]){const _0x2a940d=_0x509206?.['connectionNameToTypeMap']?.['get'](_0x7eba38);if(_0x2a940d&&_0x509206?.['getSchema'])try{const _0x5a9499=await _0x509206[_0x21349a(0x1e0)](_0x2a940d),_0x148bd5=validateConnectorConfig(_0x241a32[_0x21349a(0x203)],_0x5a9499);if(!_0x148bd5[_0x21349a(0x1fb)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x241a32[_0x21349a(0x228)]+_0x21349a(0x218)+formatValidationErrors(_0x148bd5[_0x21349a(0x210)]),undefined,{'helpText':_0x21349a(0x1e6)+_0x2a940d+_0x21349a(0x1e2)+formatSchemaAsHelp(_0x5a9499)});if(_0x148bd5['warnings'][_0x21349a(0x1df)]>0x0){const _0x53185a=formatValidationWarnings(_0x148bd5[_0x21349a(0x25a)]);console[_0x21349a(0x225)](_0x21349a(0x1cd)+_0x241a32[_0x21349a(0x228)]+'\x22:\x0a'+_0x53185a);}_0x2b0c16['connectorConfig']=transformConfigToLegacy(_0x241a32[_0x21349a(0x203)],_0x5a9499);}catch(_0x53904a){if(_0x53904a instanceof SDKError&&_0x53904a[_0x21349a(0x1dd)]===ErrorCode[_0x21349a(0x209)])_0x2b0c16[_0x21349a(0x23e)]=_0x241a32[_0x21349a(0x203)];else throw _0x53904a;}else _0x2b0c16[_0x21349a(0x23e)]=_0x241a32[_0x21349a(0x203)];}_0x241a32[_0x21349a(0x235)]!==undefined&&(_0x2b0c16['activationTemplateId']=_0x241a32[_0x21349a(0x235)]);if(_0x241a32[_0x21349a(0x1e3)]){const _0xbed615=_0x241a32[_0x21349a(0x1e3)],_0x3956ce={};if(_0xbed615[_0x21349a(0x1f8)]&&_0xbed615[_0x21349a(0x1f8)][_0x21349a(0x1df)]>0x0){const _0x1c8a94=_0xbed615['columns'][_0x21349a(0x1f2)](_0xe4d74d=>_0xe4d74d&&_0xe4d74d[_0x21349a(0x228)]);_0x1c8a94[_0x21349a(0x1df)]>0x0&&(_0x3956ce[_0x21349a(0x1f8)]=_0x1c8a94);}_0xbed615[_0x21349a(0x21e)]&&(_0x3956ce['behaviorTableName']=_0xbed615[_0x21349a(0x21e)]),_0xbed615[_0x21349a(0x200)]!==undefined&&(_0x3956ce[_0x21349a(0x1ea)]=_0xbed615['join_row']),_0xbed615['join_strategy']&&(_0x3956ce[_0x21349a(0x1d9)]=_0xbed615[_0x21349a(0x1f7)]),_0xbed615[_0x21349a(0x1fd)]&&(_0x3956ce[_0x21349a(0x1fd)]=_0xbed615[_0x21349a(0x1fd)]),_0xbed615[_0x21349a(0x1f5)]&&(_0x3956ce[_0x21349a(0x1d2)]=_0xbed615[_0x21349a(0x1f5)]),_0x2b0c16['syndicationBehavior']=_0x3956ce;}return _0x2b0c16;}export async function activationDefToUpdateRequest(_0x25f592,_0xf0f30c){return activationDefToCreateRequest(_0x25f592,_0xf0f30c);}export function deepSortObject(_0x5bdf83){const _0x4f558b=a126_0x15f653;if(_0x5bdf83===null||typeof _0x5bdf83!==_0x4f558b(0x1cc))return _0x5bdf83;if(Array['isArray'](_0x5bdf83))return _0x5bdf83[_0x4f558b(0x1e4)](deepSortObject)[_0x4f558b(0x1f6)]((_0x2e022f,_0x4337ff)=>JSON['stringify'](_0x2e022f)['localeCompare'](JSON[_0x4f558b(0x221)](_0x4337ff)));const _0x17f1a4={};for(const _0x2d9517 of Object['keys'](_0x5bdf83)[_0x4f558b(0x1f6)]()){_0x17f1a4[_0x2d9517]=deepSortObject(_0x5bdf83[_0x2d9517]);}return _0x17f1a4;}export function serializeRule(_0x4c5744){const _0x33a3c8=a126_0x15f653;return JSON[_0x33a3c8(0x221)](deepSortObject(_0x4c5744));}export function normalizeRuleForMatching(_0x299d67){return normalizeConditionsForMatching(_0x299d67);}function normalizeConditionsForMatching(_0x2d0887){const _0x2d5b0=a126_0x15f653;if(_0x2d0887===null||typeof _0x2d0887!==_0x2d5b0(0x1cc))return _0x2d0887;if(Array[_0x2d5b0(0x20a)](_0x2d0887))return _0x2d0887['map'](normalizeConditionsForMatching);const _0x491db3=_0x2d0887;if((_0x491db3[_0x2d5b0(0x1e1)]==='include'||_0x491db3['type']===_0x2d5b0(0x23f))&&typeof _0x491db3[_0x2d5b0(0x201)]==='string')return{..._0x491db3,'segment':'__SEGMENT_REF__'};const _0x5a72bd={};for(const _0x1ce280 of Object[_0x2d5b0(0x1bf)](_0x491db3)){_0x5a72bd[_0x1ce280]=normalizeConditionsForMatching(_0x491db3[_0x1ce280]);}return _0x5a72bd;}export function serializeRuleForMatching(_0x58bcac){const _0x1a92ff=a126_0x15f653;return JSON[_0x1a92ff(0x221)](deepSortObject(normalizeRuleForMatching(_0x58bcac)));}export function expandSegmentReferences(_0x220e04,_0x31dba2,_0x3c229d=new Set()){return expandConditions(_0x220e04,_0x31dba2,_0x3c229d);}function expandConditions(_0x5d91cc,_0x1b61cb,_0x262c41){const _0x13dd9a=a126_0x15f653;if(_0x5d91cc===null||typeof _0x5d91cc!=='object')return _0x5d91cc;if(Array[_0x13dd9a(0x20a)](_0x5d91cc))return _0x5d91cc['map'](_0x4616c7=>expandConditions(_0x4616c7,_0x1b61cb,_0x262c41));const _0xa968f5=_0x5d91cc;if((_0xa968f5[_0x13dd9a(0x1e1)]===_0x13dd9a(0x212)||_0xa968f5[_0x13dd9a(0x1e1)]===_0x13dd9a(0x23f))&&typeof _0xa968f5[_0x13dd9a(0x201)]===_0x13dd9a(0x1eb)){const _0x397477=_0xa968f5[_0x13dd9a(0x201)],_0x37b367=_0x1b61cb[_0x13dd9a(0x250)](_0x397477);if(_0x37b367&&!_0x262c41[_0x13dd9a(0x244)](_0x397477)){const _0x144bb8=new Set(_0x262c41);_0x144bb8[_0x13dd9a(0x22a)](_0x397477);const _0x58f626=expandConditions(_0x37b367,_0x1b61cb,_0x144bb8);return{'type':_0xa968f5[_0x13dd9a(0x1e1)],'expanded_rule':_0x58f626};}return{'type':_0xa968f5[_0x13dd9a(0x1e1)],'expanded_rule':_0x13dd9a(0x256)};}const _0x97f906={};for(const _0x2bb84d of Object[_0x13dd9a(0x1bf)](_0xa968f5)){_0x97f906[_0x2bb84d]=expandConditions(_0xa968f5[_0x2bb84d],_0x1b61cb,_0x262c41);}return _0x97f906;}export function serializeExpandedRule(_0x38cade,_0x232e06){const _0x5f3f93=expandSegmentReferences(_0x38cade,_0x232e06);return JSON['stringify'](deepSortObject(_0x5f3f93));}export function createSegmentNameContext(_0x33613e){const _0x13e2e7=a126_0x15f653,_0x5b34df=new Set(),_0x85b47d=new Map(),_0x2d935f=new Map();if(_0x33613e)for(const [_0x5e3d13,_0x33f439]of Object[_0x13e2e7(0x247)](_0x33613e)){if(_0x33f439[_0x13e2e7(0x20b)]){const _0x466151=serializeRule(_0x33f439[_0x13e2e7(0x20b)]);_0x2d935f[_0x13e2e7(0x21d)](_0x466151,_0x5e3d13),_0x5b34df[_0x13e2e7(0x22a)](_0x5e3d13);}}return{'usedNames':_0x5b34df,'ruleHashToName':_0x85b47d,'localRuleToName':_0x33613e?_0x2d935f:undefined};}export function resolveSegmentName(_0x1c65a8,_0x772e2b,_0x70b530,_0xe272de){const _0x25ebc5=a126_0x15f653,_0x512fef=serializeRule(_0x772e2b);if(_0x70b530[_0x25ebc5(0x207)]){const _0x16223c=_0x70b530['localRuleToName'][_0x25ebc5(0x250)](_0x512fef);if(_0x16223c)return{'name':_0x16223c,'isDuplicate':![],'isLocalMatch':!![]};}const _0x144bae=_0x70b530[_0x25ebc5(0x205)][_0x25ebc5(0x250)](_0x512fef);if(_0x144bae)return{'name':_0x144bae,'isDuplicate':!![],'isLocalMatch':![]};const _0x3b2508=_0xe272de(_0x1c65a8);let _0x5ae351=_0x3b2508||_0x1c65a8,_0x53e35a=_0x5ae351,_0x42b581=0x2;while(_0x70b530[_0x25ebc5(0x216)][_0x25ebc5(0x244)](_0x53e35a)){_0x53e35a=_0x5ae351+'_'+_0x42b581,_0x42b581++;}return _0x70b530[_0x25ebc5(0x216)][_0x25ebc5(0x22a)](_0x53e35a),_0x70b530['ruleHashToName'][_0x25ebc5(0x21d)](_0x512fef,_0x53e35a),{'name':_0x53e35a,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x22482a){const _0x363552=[],_0x4f144a=_0x5bcfdc=>{const _0x460b73=a126_0x2ee4;if(!_0x5bcfdc||typeof _0x5bcfdc!==_0x460b73(0x1cc))return;if(Array['isArray'](_0x5bcfdc)){_0x5bcfdc[_0x460b73(0x22e)](_0x4f144a);return;}const _0x23d060=_0x5bcfdc;(_0x23d060['type']==='include'||_0x23d060[_0x460b73(0x1e1)]===_0x460b73(0x23f))&&typeof _0x23d060[_0x460b73(0x201)]===_0x460b73(0x1eb)&&_0x363552[_0x460b73(0x1d7)](_0x23d060[_0x460b73(0x201)]);for(const _0x27489e of Object['values'](_0x23d060)){_0x4f144a(_0x27489e);}};return _0x4f144a(_0x22482a),_0x363552;}export function validateSegmentRule(_0x2d9e2a,_0x58c881){const _0x1f0237=a126_0x15f653;if(!_0x58c881||!_0x58c881[_0x1f0237(0x23d)])return;for(let _0x1cf689=0x0;_0x1cf689<_0x58c881['conditions']['length'];_0x1cf689++){const _0x3ab0fe=_0x58c881[_0x1f0237(0x23d)][_0x1cf689];if('type'in _0x3ab0fe&&_0x3ab0fe[_0x1f0237(0x1e1)]===_0x1f0237(0x219)){const _0x434a40=_0x3ab0fe,_0x1dd03b=_0x434a40[_0x1f0237(0x1c1)]||_0x434a40[_0x1f0237(0x242)];if((!_0x434a40[_0x1f0237(0x1fa)]||_0x434a40[_0x1f0237(0x1fa)]==='')&&!_0x1dd03b)throw new SDKError(ErrorCode[_0x1f0237(0x1ec)],_0x1f0237(0x1f3)+_0x2d9e2a+_0x1f0237(0x208)+(_0x1f0237(0x1d1)+_0x1cf689+_0x1f0237(0x24e))+_0x1f0237(0x1e5));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x500885,_0x360eab){const _0x1d1f7e=a127_0x44c9,_0x12b2c2=_0x500885();while(!![]){try{const _0x1d053=-parseInt(_0x1d1f7e(0x9e))/0x1*(-parseInt(_0x1d1f7e(0xa8))/0x2)+-parseInt(_0x1d1f7e(0xb0))/0x3*(parseInt(_0x1d1f7e(0x8f))/0x4)+parseInt(_0x1d1f7e(0x91))/0x5*(-parseInt(_0x1d1f7e(0xb4))/0x6)+parseInt(_0x1d1f7e(0xb1))/0x7+-parseInt(_0x1d1f7e(0xb7))/0x8+-parseInt(_0x1d1f7e(0x8a))/0x9*(parseInt(_0x1d1f7e(0xa4))/0xa)+parseInt(_0x1d1f7e(0x9f))/0xb*(parseInt(_0x1d1f7e(0xbd))/0xc);if(_0x1d053===_0x360eab)break;else _0x12b2c2['push'](_0x12b2c2['shift']());}catch(_0x2294c5){_0x12b2c2['push'](_0x12b2c2['shift']());}}}(a127_0x2eb3,0x34ffa));import a127_0x115d66 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x5d0898){const _0x4b6871=a127_0x44c9,_0x59adac=_0x5d0898[_0x4b6871(0x89)]['map'](_0x1d4ffa=>({'column_name':_0x1d4ffa[_0x4b6871(0xad)],'column_type':_0x1d4ffa[_0x4b6871(0xba)],'null':_0x4b6871(0xb8),'key':null,'default':null,'extra':null}));return{..._0x5d0898,'columns':[{'name':_0x4b6871(0xa7),'type':_0x4b6871(0xa1)},{'name':_0x4b6871(0x9d),'type':_0x4b6871(0xa1)},{'name':_0x4b6871(0x8b),'type':_0x4b6871(0xa1)},{'name':_0x4b6871(0x93),'type':_0x4b6871(0xa1)},{'name':'default','type':_0x4b6871(0xa1)},{'name':_0x4b6871(0x94),'type':_0x4b6871(0xa1)}],'data':_0x59adac};}export async function executeSchemaQuery(_0x26a2b5,_0x313a16,_0x186d92){const _0x2fc188=a127_0x44c9,_0x852297=_0x26a2b5[_0x2fc188(0x92)]()[_0x2fc188(0xa2)](/;+$/,''),_0x5e85df=_0x2fc188(0x9c)+_0x852297+_0x2fc188(0xa9);_0x186d92[_0x2fc188(0x8e)]&&console[_0x2fc188(0x96)](_0x2fc188(0xa3)+_0x5e85df);const _0x3690aa=await withProgressSpinner('Fetching\x20schema...',async _0x51c1dd=>{const _0xeb72f9=_0x2fc188,_0x16d227=await _0x313a16['query'][_0xeb72f9(0xa0)](_0x5e85df,{'catalog':'td','schema':'information_schema','onJobId':_0x4a5c44=>{const _0x237c37=_0xeb72f9;_0x51c1dd[_0x237c37(0xac)](_0x4a5c44);}});return _0x16d227;},{'verbose':_0x186d92[_0x2fc188(0x8e)]});return buildSchemaResult(_0x3690aa['data']);}function columnName(_0x58f34f){const _0x4a5726=a127_0x44c9;return _0x58f34f[_0x4a5726(0x9b)]||_0x58f34f['parentColumn']||_0x58f34f[_0x4a5726(0xad)];}function a127_0x2eb3(){const _0x1578d5=['key','extra','filter','error','Attributes','size','sort','some','matrixColumnName','SELECT\x20*\x20FROM\x20(\x0a','column_type','143747eXOlpV','2321scPhBH','execute','varchar','replace','Schema\x20query:\x0a','945020WKrETK','get','tableName','column_name','6dtJlfv','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','localeCompare','bold','setJobId','name','source','displayName','1122204nolAWL','324296HeynjF','dim','behaviorName','23694suvPWx','parentTableName','startsWith','2620296CMOEWW','YES','Behaviors','type','slice','\x20\x20\x20\x20','45060pkdgfk','behavior','attribute','cyan','fields','entries','columns','9MhPTzS','null','push','matrixTableName','verbose','4NmLXnc','set','325VewZQe','trim'];a127_0x2eb3=function(){return _0x1578d5;};return a127_0x2eb3();}function a127_0x44c9(_0x2e870c,_0xd2139c){_0x2e870c=_0x2e870c-0x89;const _0x2eb362=a127_0x2eb3();let _0x44c91c=_0x2eb362[_0x2e870c];return _0x44c91c;}function formatFieldLine(_0x313391,_0x1d49e3,_0x152067){const _0x446442=a127_0x44c9,_0x5abdbf=_0x313391!==_0x1d49e3?'\x20'+a127_0x115d66['dim']('('+_0x1d49e3+')'):'';return _0x446442(0xbc)+_0x313391+_0x5abdbf+':\x20'+a127_0x115d66[_0x446442(0xc0)](_0x152067);}function sortByColumnName(_0x38498d){const _0x5de61e=a127_0x44c9;return[..._0x38498d][_0x5de61e(0x99)]((_0x1a8348,_0x128703)=>columnName(_0x1a8348)['localeCompare'](columnName(_0x128703)));}export function displayFieldsHumanReadable(_0x1f2442,_0x56b27d){const _0x330e6c=a127_0x44c9,_0x1c5a87=_0x1f2442[_0x330e6c(0x95)](_0x3b6b83=>_0x3b6b83[_0x330e6c(0xae)]===_0x330e6c(0xbf)),_0x16fb64=_0x1f2442[_0x330e6c(0x95)](_0x504a38=>_0x504a38[_0x330e6c(0xae)]===_0x330e6c(0xbe)),_0x227420=new Map();for(const _0x1695f1 of _0x1c5a87){const _0xc58212=_0x1695f1['groupingName']||_0x1695f1[_0x330e6c(0xb5)]||'Unknown',_0x239d15=_0x227420[_0x330e6c(0xa5)](_0xc58212);_0x239d15?_0x239d15[_0x330e6c(0xc1)][_0x330e6c(0x8c)](_0x1695f1):_0x227420[_0x330e6c(0x90)](_0xc58212,{'displayName':_0xc58212,'tableName':_0x1695f1[_0x330e6c(0xb5)],'fields':[_0x1695f1]});}const _0x35fc21=new Map();for(const _0x4a704c of _0x16fb64){const _0x3efe62=_0x4a704c[_0x330e6c(0xb3)]||'Unknown',_0x19da0d=_0x35fc21[_0x330e6c(0xa5)](_0x3efe62)||[];_0x19da0d['push'](_0x4a704c),_0x35fc21['set'](_0x3efe62,_0x19da0d);}console['error']('\x0a'+a127_0x115d66[_0x330e6c(0xab)](_0x56b27d));if(_0x227420[_0x330e6c(0x98)]>0x0){console[_0x330e6c(0x96)]('\x0a'+a127_0x115d66[_0x330e6c(0xb2)](_0x330e6c(0x97)));const _0x5336f6=[..._0x227420[_0x330e6c(0xc2)]()][_0x330e6c(0x99)]((_0x3d4798,_0x290412)=>_0x3d4798[0x0][_0x330e6c(0xaa)](_0x290412[0x0]));for(const [,_0x423035]of _0x5336f6){const _0x2bdf8b=_0x423035[_0x330e6c(0xa6)]&&_0x423035[_0x330e6c(0xa6)]!==_0x423035[_0x330e6c(0xaf)]?'\x20'+a127_0x115d66[_0x330e6c(0xb2)]('('+_0x423035['tableName']+')'):'';console[_0x330e6c(0x96)]('\x20\x20'+a127_0x115d66[_0x330e6c(0xab)](_0x423035[_0x330e6c(0xaf)])+_0x2bdf8b);for(const _0x1c38f7 of sortByColumnName(_0x423035[_0x330e6c(0xc1)])){console[_0x330e6c(0x96)](formatFieldLine(columnName(_0x1c38f7),_0x1c38f7[_0x330e6c(0xad)],_0x1c38f7[_0x330e6c(0xba)]));}}}if(_0x35fc21['size']>0x0){console[_0x330e6c(0x96)]('\x0a'+a127_0x115d66[_0x330e6c(0xb2)](_0x330e6c(0xb9)));const _0x1c59b7=[..._0x35fc21[_0x330e6c(0xc2)]()][_0x330e6c(0x99)]((_0x372591,_0x316652)=>_0x372591[0x0]['localeCompare'](_0x316652[0x0]));for(const [_0x8f3eb7,_0x8d1eec]of _0x1c59b7){const _0x593f7d=_0x8d1eec[0x0],_0x80de64=_0x593f7d?.[_0x330e6c(0x8d)];if(_0x80de64){const _0x4a05c2=_0x80de64!==_0x8f3eb7?'\x20'+a127_0x115d66['dim']('('+_0x8f3eb7+')'):'';console['error']('\x20\x20'+a127_0x115d66[_0x330e6c(0xab)](_0x80de64)+_0x4a05c2);}else{const _0x2a1249=_0x593f7d?.[_0x330e6c(0xb5)]||'';console['error']('\x20\x20'+a127_0x115d66[_0x330e6c(0xab)](_0x8f3eb7)+(_0x2a1249?'\x20'+a127_0x115d66['dim']('('+_0x2a1249+')'):''));}for(const _0x32d00e of sortByColumnName(_0x8d1eec)){const _0x486cd7=_0x32d00e['name'][_0x330e6c(0xb6)](_0x8f3eb7+'.')?_0x32d00e[_0x330e6c(0xad)][_0x330e6c(0xbb)](_0x8f3eb7['length']+0x1):_0x32d00e['name'];console[_0x330e6c(0x96)](formatFieldLine(columnName(_0x32d00e),_0x486cd7,_0x32d00e['type']));}}}const _0x3646dc=_0x1f2442[_0x330e6c(0x9a)](_0x586745=>_0x586745[_0x330e6c(0x9b)]||_0x586745[_0x330e6c(0x8d)]);_0x3646dc&&(console[_0x330e6c(0x96)]('\x0a'+a127_0x115d66['dim']('Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).')),console[_0x330e6c(0x96)](a127_0x115d66[_0x330e6c(0xb2)]('\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.'))),console[_0x330e6c(0x96)]('');}
|