@treasuredata/tdx 0.29.2 → 0.29.3
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/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/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-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/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/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(_0x23af2d,_0x1958b9){const _0x2beb1a=a112_0x367f,_0x40963a=_0x23af2d();while(!![]){try{const _0x154004=parseInt(_0x2beb1a(0x1e3))/0x1*(-parseInt(_0x2beb1a(0x1e1))/0x2)+parseInt(_0x2beb1a(0x1ea))/0x3+parseInt(_0x2beb1a(0x1d5))/0x4*(parseInt(_0x2beb1a(0x1e9))/0x5)+-parseInt(_0x2beb1a(0x1db))/0x6+parseInt(_0x2beb1a(0x1e7))/0x7*(-parseInt(_0x2beb1a(0x1d4))/0x8)+parseInt(_0x2beb1a(0x1d8))/0x9+parseInt(_0x2beb1a(0x1dc))/0xa*(-parseInt(_0x2beb1a(0x1e5))/0xb);if(_0x154004===_0x1958b9)break;else _0x40963a['push'](_0x40963a['shift']());}catch(_0xb594b4){_0x40963a['push'](_0x40963a['shift']());}}}(a112_0x234a,0x757d0));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}};export const EXTENDED_CONTEXT_PRICING={'inputPricePerMTok':0x6,'outputPricePerMTok':22.5,'cacheWritePricePerMTok':7.5,'cacheReadPricePerMTok':0.6};export const USD_PER_AI_CREDIT=54.24;export const CONTEXT_LIMITS={'sonnet':0x30d40,'haiku':0x30d40,'opus':0x30d40,'default':0x30d40};export function getModelPricing(_0x3141c6){const _0x40662f=a112_0x367f;if(MODEL_PRICING[_0x3141c6])return MODEL_PRICING[_0x3141c6];const _0x293bc7=_0x3141c6['toLowerCase']();if(_0x293bc7[_0x40662f(0x1df)](_0x40662f(0x1d6)))return MODEL_PRICING[_0x40662f(0x1d6)];if(_0x293bc7[_0x40662f(0x1df)](_0x40662f(0x1e4)))return MODEL_PRICING[_0x40662f(0x1e4)];if(_0x293bc7[_0x40662f(0x1df)](_0x40662f(0x1d0)))return MODEL_PRICING['haiku'];return MODEL_PRICING[_0x40662f(0x1e4)];}export function calculateTokenCost(_0x5d88f5,_0x176440,_0x56b3de,_0x284c1c,_0x41ce28){const _0x3bffd9=a112_0x367f,_0x4b9ab6=0xf4240;return _0x5d88f5*_0x41ce28[_0x3bffd9(0x1d7)]/_0x4b9ab6+_0x176440*_0x41ce28[_0x3bffd9(0x1cf)]/_0x4b9ab6+_0x56b3de*_0x41ce28['cacheWritePricePerMTok']/_0x4b9ab6+_0x284c1c*_0x41ce28[_0x3bffd9(0x1d3)]/_0x4b9ab6;}export function usdToAiCredits(_0x20a40c){return _0x20a40c/USD_PER_AI_CREDIT;}function a112_0x367f(_0x25f2f4,_0x30018d){_0x25f2f4=_0x25f2f4-0x1cd;const _0x234ab9=a112_0x234a();let _0x367f36=_0x234ab9[_0x25f2f4];return _0x367f36;}function a112_0x234a(){const _0x40bf41=['Haiku\x204','includes','Claude','8866xwzyVR','Opus\x204','35AULpig','sonnet','6240047uuDigB','Haiku\x204.5','21eRRCiy','Opus\x204.5','249465AtljKQ','2775291KaJOPo','4.5','4-5','outputPricePerMTok','haiku','Sonnet\x204.5','toLowerCase','cacheReadPricePerMTok','1693688vCNarz','64hzOuWR','opus','inputPricePerMTok','2045664XKQTrL','4-6','toLocaleString','671304cUStPQ','10DtDXMu','Opus\x204.6'];a112_0x234a=function(){return _0x40bf41;};return a112_0x234a();}export function calculateCreditsFromTokens(_0x2b522f,_0x5c231a,_0x4a83ca,_0x3bc5fc,_0x3a8b5e){const _0x46b871=getModelPricing(_0x3a8b5e),_0x1ea6fe=calculateTokenCost(_0x2b522f,_0x5c231a,_0x4a83ca,_0x3bc5fc,_0x46b871);return usdToAiCredits(_0x1ea6fe);}export function getContextLimit(_0x3d5be5){const _0x20f9ff=a112_0x367f,_0x56b174=_0x3d5be5['toLowerCase']();if(_0x56b174[_0x20f9ff(0x1df)](_0x20f9ff(0x1e4)))return CONTEXT_LIMITS[_0x20f9ff(0x1e4)];if(_0x56b174[_0x20f9ff(0x1df)](_0x20f9ff(0x1d0)))return CONTEXT_LIMITS['haiku'];if(_0x56b174[_0x20f9ff(0x1df)](_0x20f9ff(0x1d6)))return CONTEXT_LIMITS[_0x20f9ff(0x1d6)];return CONTEXT_LIMITS['default'];}export function getModelDisplayName(_0x47607f){const _0x27f09b=a112_0x367f,_0x81856d=_0x47607f[_0x27f09b(0x1d2)]();if(_0x81856d['includes']('sonnet')){if(_0x81856d[_0x27f09b(0x1df)](_0x27f09b(0x1ce))||_0x81856d[_0x27f09b(0x1df)](_0x27f09b(0x1cd)))return _0x27f09b(0x1d1);return'Sonnet\x204';}if(_0x81856d['includes'](_0x27f09b(0x1d0))){if(_0x81856d[_0x27f09b(0x1df)](_0x27f09b(0x1ce))||_0x81856d['includes']('4.5'))return _0x27f09b(0x1e6);return _0x27f09b(0x1de);}if(_0x81856d['includes'](_0x27f09b(0x1d6))){if(_0x81856d[_0x27f09b(0x1df)](_0x27f09b(0x1d9))||_0x81856d[_0x27f09b(0x1df)]('4.6'))return _0x27f09b(0x1dd);if(_0x81856d[_0x27f09b(0x1df)]('4-5')||_0x81856d[_0x27f09b(0x1df)](_0x27f09b(0x1cd)))return _0x27f09b(0x1e8);return _0x27f09b(0x1e2);}return _0x27f09b(0x1e0);}export function formatTokenCount(_0x2e1c7e){const _0x589a85=a112_0x367f;return _0x2e1c7e[_0x589a85(0x1da)]('en-US');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a113_0x27e510=a113_0x4c93;(function(_0x3f929e,_0x4c278c){const _0x1ed993=a113_0x4c93,_0x1dbbf5=_0x3f929e();while(!![]){try{const _0x423b1c=-parseInt(_0x1ed993(0x1a9))/0x1*(-parseInt(_0x1ed993(0x1a8))/0x2)+-parseInt(_0x1ed993(0x1aa))/0x3*(-parseInt(_0x1ed993(0x1b6))/0x4)+parseInt(_0x1ed993(0x1b7))/0x5+-parseInt(_0x1ed993(0x1ae))/0x6*(parseInt(_0x1ed993(0x1b9))/0x7)+parseInt(_0x1ed993(0x1ac))/0x8*(-parseInt(_0x1ed993(0x1bf))/0x9)+parseInt(_0x1ed993(0x1b5))/0xa*(parseInt(_0x1ed993(0x1ad))/0xb)+-parseInt(_0x1ed993(0x1b2))/0xc;if(_0x423b1c===_0x4c278c)break;else _0x1dbbf5['push'](_0x1dbbf5['shift']());}catch(_0x46a961){_0x1dbbf5['push'](_0x1dbbf5['shift']());}}}(a113_0x2a0a,0x8c1bf));function a113_0x2a0a(){const _0x43b148=['25817Ubodek','348ievqPR','application/json','/realtime_personalization_services','POST','14480052OUnlKP','request','apiKey','3570ACBvgR','23280kESifr','610080PdGYYI','site','17255hSNRbK','application/vnd.treasuredata.v1+json','create','GET','/audiences/','/realtime_personalization_services/','171YjLHMm','httpClient','PUT','/realtime_personalization_services?page[size]=100','list','get','cdp','proxy','200020Xouvvn','7xSLPgx','159NWNScp','data','18904MRvqpG'];a113_0x2a0a=function(){return _0x43b148;};return a113_0x2a0a();}import{HTTPClient}from'./client/http-client.js';import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';function a113_0x4c93(_0x3a6e48,_0x56981b){_0x3a6e48=_0x3a6e48-0x1a3;const _0x2a0a5f=a113_0x2a0a();let _0x4c937a=_0x2a0a5f[_0x3a6e48];return _0x4c937a;}export class PersonalizationSDK{[a113_0x27e510(0x1c0)];constructor(_0x33f1e4){const _0xfd5df0=a113_0x27e510,_0x36a3ea=getEndpoint(_0x33f1e4['site'],_0xfd5df0(0x1a6)),_0x1ad6aa=toHeaderRecord(getAuthHeaders(_0x33f1e4[_0xfd5df0(0x1b8)],_0x33f1e4[_0xfd5df0(0x1b4)]));this['httpClient']=new HTTPClient(_0x36a3ea,{..._0x1ad6aa,'Accept':_0xfd5df0(0x1ba),'Content-Type':_0xfd5df0(0x1af)},{'proxy':_0x33f1e4[_0xfd5df0(0x1a7)]});}async[a113_0x27e510(0x1a4)](_0x2f8553){const _0x56a522=a113_0x27e510,_0x4f51c4=await this[_0x56a522(0x1c0)]['request'](_0x56a522(0x1bc),_0x56a522(0x1bd)+_0x2f8553+_0x56a522(0x1a3));return Array['isArray'](_0x4f51c4)?_0x4f51c4:_0x4f51c4[_0x56a522(0x1ab)]||[];}async[a113_0x27e510(0x1a5)](_0x4ed5c3,_0x468860){const _0x3f8928=a113_0x27e510,_0x296465=await this[_0x3f8928(0x1c0)][_0x3f8928(0x1b3)](_0x3f8928(0x1bc),_0x3f8928(0x1bd)+_0x4ed5c3+'/realtime_personalization_services/'+_0x468860);return _0x296465||{};}async[a113_0x27e510(0x1bb)](_0xb5722b,_0x5d15ae){const _0x134050=a113_0x27e510,_0x4add03=await this['httpClient'][_0x134050(0x1b3)](_0x134050(0x1b1),_0x134050(0x1bd)+_0xb5722b+_0x134050(0x1b0),{'body':_0x5d15ae});return _0x4add03||{};}async['update'](_0x4d6ad0,_0x587389,_0x18d214){const _0x458617=a113_0x27e510,_0x2af2e1=await this[_0x458617(0x1c0)]['request'](_0x458617(0x1c1),_0x458617(0x1bd)+_0x4d6ad0+_0x458617(0x1be)+_0x587389,{'body':_0x18d214});return _0x2af2e1||{};}async['delete'](_0x5a4778,_0xc5f88e){const _0xf6b74f=a113_0x27e510;await this['httpClient'][_0xf6b74f(0x1b3)]('DELETE',_0xf6b74f(0x1bd)+_0x5a4778+_0xf6b74f(0x1be)+_0xc5f88e);}}
|
package/dist/sdk/query/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a114_0x4449(){const _0x260f59=['52563hjzJut','Limit\x20must\x20be\x20a\x20positive\x20number','execute','786nHWuLG','\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\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','Provide\x20a\x20positive\x20number\x20for\x20limit\x20(e.g.,\x20100).','Provide\x20SQL\x20via\x20argument\x20or\x20use\x20--file\x20option.','11OTmmuo','isInteger','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','\x20LIMIT\x20','slice','585NrFLDW','4mXNxEK','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20the\x20pattern\x20to\x20list\x20all\x20databases.','\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','Table\x20name\x20is\x20required','describeTable','\x0aORDER\x20BY\x20database_name\x0aLIMIT\x20','\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','3680202VoHerD','\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','\x20ESCAPE\x20\x27\x5c\x27','MISSING_ARGUMENT','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22user_*\x22)\x20or\x20omit\x20to\x20list\x20all\x20tables.','listTables','length','\x0a\x20\x20\x20\x20\x20\x20','Database\x20name\x20cannot\x20be\x20empty\x20or\x20whitespace-only','INVALID_ARGUMENT','Provide\x20a\x20valid\x20database\x20name\x20or\x20omit\x20to\x20list\x20tables\x20from\x20all\x20databases.','\x0a\x20\x20AND\x20table_name\x20LIKE\x20','Usage:\x20tdx\x20describe\x20<database.table>','7116711FkedXr','13151484xcyUrY','\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','11105630DuVkTb','42liNxxt','Use\x20--limit\x20<number>\x20to\x20specify\x20row\x20limit\x20(must\x20be\x20positive).','trinoApiClient','2672asyBUA','\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','executeQuery','Database\x20pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','\x0aORDER\x20BY\x20table_name\x0aLIMIT\x20','Database\x20name\x20is\x20required','Usage:\x20tdx\x20show\x20<database.table>','SELECT\x20*\x20FROM\x20','\x0a\x20\x20\x20\x20','data','20395KyZHZD','trim'];a114_0x4449=function(){return _0x260f59;};return a114_0x4449();}const a114_0x4a39ee=a114_0x3927;(function(_0x2e9e5a,_0x2c40ae){const _0x809770=a114_0x3927,_0x4bb4ee=_0x2e9e5a();while(!![]){try{const _0x5b8e30=parseInt(_0x809770(0x194))/0x1*(parseInt(_0x809770(0x185))/0x2)+parseInt(_0x809770(0x1a9))/0x3*(parseInt(_0x809770(0x1a2))/0x4)+-parseInt(_0x809770(0x192))/0x5*(parseInt(_0x809770(0x197))/0x6)+-parseInt(_0x809770(0x181))/0x7+parseInt(_0x809770(0x188))/0x8*(-parseInt(_0x809770(0x1a1))/0x9)+-parseInt(_0x809770(0x184))/0xa*(-parseInt(_0x809770(0x19c))/0xb)+-parseInt(_0x809770(0x182))/0xc;if(_0x5b8e30===_0x2c40ae)break;else _0x4bb4ee['push'](_0x4bb4ee['shift']());}catch(_0x389529){_0x4bb4ee['push'](_0x4bb4ee['shift']());}}}(a114_0x4449,0xbc94f));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';function a114_0x3927(_0x445b0c,_0x5961f4){_0x445b0c=_0x445b0c-0x17b;const _0x4449d9=a114_0x4449();let _0x3927e5=_0x4449d9[_0x445b0c];return _0x3927e5;}export class QuerySDK{['trinoApiClient'];constructor(_0x15f210){const _0xaf0a1a=a114_0x3927;this[_0xaf0a1a(0x187)]=new TrinoApiClient(_0x15f210);}async[a114_0x4a39ee(0x196)](_0x247205,_0x41f20f){const _0x4f306a=a114_0x4a39ee;if(!_0x247205||_0x247205['trim']()[_0x4f306a(0x1af)]===0x0)throw new SDKError(ErrorCode[_0x4f306a(0x1ac)],'SQL\x20query\x20is\x20required',undefined,{'helpText':_0x4f306a(0x19b)});return await this['trinoApiClient'][_0x4f306a(0x18a)](_0x247205,_0x41f20f);}async['listDatabases'](_0x5a750e,_0x3e4361=DEFAULT_LISTING_LIMIT){const _0x57417f=a114_0x4a39ee;if(_0x5a750e!==undefined&&_0x5a750e[_0x57417f(0x193)]()[_0x57417f(0x1af)]===0x0)throw new SDKError(ErrorCode[_0x57417f(0x17d)],_0x57417f(0x19e),undefined,{'helpText':_0x57417f(0x1a3)});if(_0x3e4361<=0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x57417f(0x195),undefined,{'helpText':_0x57417f(0x19a)});let _0x4dbd22=_0x57417f(0x1a8);_0x5a750e&&(_0x4dbd22+='\x0a\x20\x20AND\x20schema_name\x20LIKE\x20'+buildLikePattern(_0x5a750e)+'\x20ESCAPE\x20\x27\x5c\x27');_0x4dbd22+=_0x57417f(0x1a7)+_0x3e4361;const _0x203f41=await this['trinoApiClient'][_0x57417f(0x18a)](_0x4dbd22[_0x57417f(0x193)]());return _0x203f41['data'];}async[a114_0x4a39ee(0x1ae)](_0x28db66,_0x253371,_0x2f92ec,_0x101479=DEFAULT_LISTING_LIMIT){const _0xe1492c=a114_0x4a39ee;if(_0x28db66!==undefined&&_0x28db66['trim']()['length']===0x0)throw new SDKError(ErrorCode[_0xe1492c(0x17d)],_0xe1492c(0x17c),undefined,{'helpText':_0xe1492c(0x17e)});if(_0x253371!==undefined&&_0x253371[_0xe1492c(0x193)]()[_0xe1492c(0x1af)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe1492c(0x19e),undefined,{'helpText':_0xe1492c(0x1ad)});if(_0x2f92ec!==undefined&&_0x2f92ec[_0xe1492c(0x193)]()[_0xe1492c(0x1af)]===0x0)throw new SDKError(ErrorCode[_0xe1492c(0x17d)],_0xe1492c(0x18b),undefined,{'helpText':'Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20to\x20search\x20all\x20databases.'});if(_0x101479<=0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe1492c(0x195),undefined,{'helpText':_0xe1492c(0x19a)});let _0x429bcc;_0x28db66?(_0x429bcc=_0xe1492c(0x1a4)+escapeStringLiteral(_0x28db66)+_0xe1492c(0x17b),_0x253371&&(_0x429bcc+=_0xe1492c(0x17f)+buildLikePattern(_0x253371)+_0xe1492c(0x1ab)),_0x429bcc+=_0xe1492c(0x18c)+_0x101479):(_0x429bcc=_0xe1492c(0x189),_0x2f92ec&&(_0x429bcc+='\x0a\x20\x20AND\x20table_schema\x20LIKE\x20'+buildLikePattern(_0x2f92ec)+_0xe1492c(0x1ab)),_0x253371&&(_0x429bcc+='\x0a\x20\x20AND\x20table_name\x20LIKE\x20'+buildLikePattern(_0x253371)+_0xe1492c(0x1ab)),_0x429bcc+='\x0aORDER\x20BY\x20database_name,\x20table_name\x0aLIMIT\x20'+_0x101479);const _0x10683a=await this[_0xe1492c(0x187)][_0xe1492c(0x18a)](_0x429bcc['trim']());return _0x10683a[_0xe1492c(0x191)];}async['validateDatabase'](_0x4b2e6f){const _0x207797=a114_0x4a39ee,_0x511a56=(_0x207797(0x183)+escapeStringLiteral(_0x4b2e6f)+_0x207797(0x190))[_0x207797(0x193)](),_0xbe118d=await this[_0x207797(0x187)]['executeQuery'](_0x511a56);return _0xbe118d[_0x207797(0x191)][_0x207797(0x1af)]>0x0;}async['validateTable'](_0x1e0dc6,_0xbe48dc){const _0x5935a7=a114_0x4a39ee,_0x3cb3ba=(_0x5935a7(0x1aa)+escapeStringLiteral(_0x1e0dc6)+_0x5935a7(0x198)+escapeStringLiteral(_0xbe48dc)+'\x0a\x20\x20\x20\x20')[_0x5935a7(0x193)](),_0x52378a=await this[_0x5935a7(0x187)]['executeQuery'](_0x3cb3ba);return _0x52378a[_0x5935a7(0x191)][_0x5935a7(0x1af)]>0x0;}async[a114_0x4a39ee(0x1a6)](_0x2e4ea4,_0x4d826a){const _0x355180=a114_0x4a39ee;if(!_0x2e4ea4||_0x2e4ea4[_0x355180(0x193)]()[_0x355180(0x1af)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'Database\x20name\x20is\x20required',undefined,{'helpText':_0x355180(0x180)});if(!_0x4d826a||_0x4d826a['trim']()['length']===0x0)throw new SDKError(ErrorCode[_0x355180(0x1ac)],_0x355180(0x1a5),undefined,{'helpText':'Usage:\x20tdx\x20describe\x20<database.table>'});const _0x5c788e=(_0x355180(0x199)+escapeStringLiteral(_0x2e4ea4)+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20'+escapeStringLiteral(_0x4d826a)+'\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20ordinal_position\x0a\x20\x20\x20\x20')[_0x355180(0x193)](),_0x16360c=await this[_0x355180(0x187)][_0x355180(0x18a)](_0x5c788e);return _0x16360c[_0x355180(0x191)];}async['showTable'](_0xbe3b50,_0x3cd5e4,_0x310b58=0x28,_0xfaa210){const _0x48856d=a114_0x4a39ee;if(!_0xbe3b50||_0xbe3b50[_0x48856d(0x193)]()[_0x48856d(0x1af)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x48856d(0x18d),undefined,{'helpText':_0x48856d(0x18e)});if(!_0x3cd5e4||_0x3cd5e4[_0x48856d(0x193)]()['length']===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x48856d(0x1a5),undefined,{'helpText':_0x48856d(0x18e)});if(!Number[_0x48856d(0x19d)](_0x310b58)||_0x310b58<=0x0)throw new SDKError(ErrorCode[_0x48856d(0x17d)],'Limit\x20must\x20be\x20a\x20positive\x20integer',undefined,{'helpText':_0x48856d(0x186)});const _0x5cf676=escapeStringLiteral(_0xbe3b50)['slice'](0x1,-0x1)+'.'+escapeStringLiteral(_0x3cd5e4)[_0x48856d(0x1a0)](0x1,-0x1),_0x2ab7ba=_0x48856d(0x18f)+_0x5cf676+_0x48856d(0x19f)+_0x310b58,_0x35b49b=await this[_0x48856d(0x187)]['executeQuery'](_0x2ab7ba,{'catalog':_0xfaa210,'schema':_0xbe3b50});return _0x35b49b;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x514837,_0xc9ad1a){const _0x23fc02=a115_0x57cd,_0x4925c4=_0x514837();while(!![]){try{const _0x49e76d=parseInt(_0x23fc02(0xa1))/0x1*(-parseInt(_0x23fc02(0xa4))/0x2)+parseInt(_0x23fc02(0xb1))/0x3*(parseInt(_0x23fc02(0x9d))/0x4)+parseInt(_0x23fc02(0xa6))/0x5+parseInt(_0x23fc02(0xaf))/0x6+-parseInt(_0x23fc02(0xa5))/0x7+parseInt(_0x23fc02(0x9f))/0x8*(parseInt(_0x23fc02(0x9a))/0x9)+-parseInt(_0x23fc02(0xa7))/0xa;if(_0x49e76d===_0xc9ad1a)break;else _0x4925c4['push'](_0x4925c4['shift']());}catch(_0x282f0a){_0x4925c4['push'](_0x4925c4['shift']());}}}(a115_0x59e0,0xac5db));import{createInterface}from'readline';import{readFileContent}from'../../utils/file-reader.js';export function stripSqlComments(_0x243a72){const _0x46b172=a115_0x57cd;let _0x95471f=_0x243a72[_0x46b172(0xae)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x95471f=_0x95471f[_0x46b172(0xae)](/--.*$/gm,''),_0x95471f[_0x46b172(0x9c)]();}function isEscaped(_0x15a5bd,_0x14e241){let _0x9a07d8=0x0;for(let _0x49229b=_0x14e241-0x1;_0x49229b>=0x0&&_0x15a5bd[_0x49229b]==='\x5c';_0x49229b--){_0x9a07d8++;}return _0x9a07d8%0x2===0x1;}export function splitSqlStatements(_0xd5d3b4){const _0x2c0132=a115_0x57cd,_0x51da3b=stripSqlComments(_0xd5d3b4);if(!_0x51da3b)throw new Error(_0x2c0132(0xb3));const _0xc2ffef=[];let _0x4116f7='',_0xb95664=![],_0x4362ff=![],_0x184909=![];for(let _0x491a27=0x0;_0x491a27<_0xd5d3b4['length'];_0x491a27++){const _0x4a72fb=_0xd5d3b4[_0x491a27];if(_0x4a72fb==='\x27'&&!isEscaped(_0xd5d3b4,_0x491a27)&&!_0x4362ff&&!_0x184909)_0xb95664=!_0xb95664;else{if(_0x4a72fb==='\x22'&&!isEscaped(_0xd5d3b4,_0x491a27)&&!_0xb95664&&!_0x184909)_0x4362ff=!_0x4362ff;else _0x4a72fb==='`'&&!isEscaped(_0xd5d3b4,_0x491a27)&&!_0xb95664&&!_0x4362ff&&(_0x184909=!_0x184909);}if(_0x4a72fb===';'&&!_0xb95664&&!_0x4362ff&&!_0x184909){const _0x169d48=_0x4116f7['trim']();_0x169d48&&_0xc2ffef['push'](_0x169d48),_0x4116f7='';}else _0x4116f7+=_0x4a72fb;}const _0x1a84d9=_0x4116f7[_0x2c0132(0x9c)]();_0x1a84d9&&_0xc2ffef['push'](_0x1a84d9);const _0x24c360=_0xc2ffef[_0x2c0132(0xab)](_0x2e63a1=>_0x2e63a1[_0x2c0132(0x9c)]())['filter'](_0xd2ba3f=>{const _0x5e6f3b=_0x2c0132,_0x2b24f6=stripSqlComments(_0xd2ba3f);return _0x2b24f6[_0x5e6f3b(0xb2)]>0x0;});if(_0x24c360[_0x2c0132(0xb2)]===0x0)throw new Error(_0x2c0132(0xb3));return _0x24c360;}function a115_0x59e0(){const _0x4e11ff=['1746kdIYWr','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','trim','60SCdCLC','toLowerCase','49832iPtGLi','isTTY','331ZVFGBv','line','close','2330XlAGDb','752143TPlyGq','3721840vSOSYp','20868280eovQjp','push','message','error','map','join','Error\x20reading\x20from\x20stdin:\x20','replace','3637434MTeTyQ','File\x20\x27','145374NWRGFv','length','Content\x20contains\x20no\x20SQL\x20statements'];a115_0x59e0=function(){return _0x4e11ff;};return a115_0x59e0();}export function readSqlStatementsFromFile(_0x3d57e2){const _0x5bcba7=a115_0x57cd,_0x34307d=readFileContent(_0x3d57e2);try{return splitSqlStatements(_0x34307d);}catch(_0x37f087){throw new Error(_0x5bcba7(0xb0)+_0x3d57e2+'\x27\x20'+_0x37f087[_0x5bcba7(0xa9)][_0x5bcba7(0x9e)]());}}export async function readStdinContent(){const _0x5b3564=a115_0x57cd;if(process['stdin'][_0x5b3564(0xa0)])throw new Error(_0x5b3564(0x9b));return new Promise((_0x39cbad,_0x3eb2fc)=>{const _0xdfa8dd=_0x5b3564,_0x4427f4=[],_0xd00ea9=createInterface({'input':process['stdin'],'terminal':![]});_0xd00ea9['on'](_0xdfa8dd(0xa2),_0x319018=>{const _0xfc158e=_0xdfa8dd;_0x4427f4[_0xfc158e(0xa8)](_0x319018);}),_0xd00ea9['on'](_0xdfa8dd(0xa3),()=>{const _0x17e4ee=_0xdfa8dd;_0x39cbad(_0x4427f4[_0x17e4ee(0xac)]('\x0a'));}),_0xd00ea9['on'](_0xdfa8dd(0xaa),_0x48607b=>{const _0x2b85d2=_0xdfa8dd;_0xd00ea9['close'](),_0x3eb2fc(new Error(_0x2b85d2(0xad)+_0x48607b[_0x2b85d2(0xa9)]));});});}export async function readSqlStatementsFromStdin(){const _0x3679c6=a115_0x57cd,_0x35f925=await readStdinContent();try{return splitSqlStatements(_0x35f925);}catch(_0x5bbf79){throw new Error('stdin\x20'+_0x5bbf79['message'][_0x3679c6(0x9e)]());}}function a115_0x57cd(_0x3676e3,_0x1bb76e){_0x3676e3=_0x3676e3-0x9a;const _0x59e09f=a115_0x59e0();let _0x57cd09=_0x59e09f[_0x3676e3];return _0x57cd09;}export function isSqlFilePath(_0x408686){return/\w\.sql$/['test'](_0x408686);}
|
package/dist/sdk/realtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a116_0x4019(_0x25b8ee,_0x32a4e1){_0x25b8ee=_0x25b8ee-0x157;const _0x4ca00e=a116_0x4ca0();let _0x401969=_0x4ca00e[_0x25b8ee];return _0x401969;}const a116_0x44d954=a116_0x4019;function a116_0x4ca0(){const _0xef6ea9=['GET','name','26898Uoqcov','getStatus','/audiences/','application/json','object','1419430JefUWD','1089510cvwOWA','map','scheduleType','attributes','apiKey','updateConfig','/realtime_setting','proxy','length','disabled','8914950sLvNOo','3474880JGjshC','getParentSegment','all','3PkggKv','list','1937724DoLJsJ','site','httpClient','getConfig','updatedAt','application/vnd.treasuredata.v1+json','keys','70AxmLYU','PUT','request','349500VEAWtU','listParentSegments','cdpClient'];a116_0x4ca0=function(){return _0xef6ea9;};return a116_0x4ca0();}(function(_0xbae5f6,_0x592f1a){const _0x4732a7=a116_0x4019,_0xb37405=_0xbae5f6();while(!![]){try{const _0x4fbdb9=-parseInt(_0x4732a7(0x17a))/0x1+parseInt(_0x4732a7(0x160))/0x2+-parseInt(_0x4732a7(0x16e))/0x3*(-parseInt(_0x4732a7(0x170))/0x4)+parseInt(_0x4732a7(0x15f))/0x5+-parseInt(_0x4732a7(0x15a))/0x6*(parseInt(_0x4732a7(0x177))/0x7)+parseInt(_0x4732a7(0x16b))/0x8+-parseInt(_0x4732a7(0x16a))/0x9;if(_0x4fbdb9===_0x592f1a)break;else _0xb37405['push'](_0xb37405['shift']());}catch(_0x24d4a0){_0xb37405['push'](_0xb37405['shift']());}}}(a116_0x4ca0,0x58838));import{HTTPClient}from'./client/http-client.js';import{CDPApiClient}from'./client/cdp-api-client.js';import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';export class RealtimeSDK{[a116_0x44d954(0x172)];[a116_0x44d954(0x157)];constructor(_0x1690da){const _0x494391=a116_0x44d954,_0x1f4e4e=getEndpoint(_0x1690da[_0x494391(0x171)],'cdp'),_0x2d7634=toHeaderRecord(getAuthHeaders(_0x1690da[_0x494391(0x171)],_0x1690da[_0x494391(0x164)]));this[_0x494391(0x172)]=new HTTPClient(_0x1f4e4e,{..._0x2d7634,'Accept':_0x494391(0x175),'Content-Type':_0x494391(0x15d)},{'proxy':_0x1690da[_0x494391(0x167)]}),this[_0x494391(0x157)]=new CDPApiClient(_0x1690da);}async['isEnabled'](_0x126173){const _0x4560ac=a116_0x44d954;try{const _0x2b651c=await this[_0x4560ac(0x172)][_0x4560ac(0x179)]('GET',_0x4560ac(0x15c)+_0x126173+'/realtime_setting');return _0x2b651c!==null;}catch{return![];}}async[a116_0x44d954(0x15b)](_0x110c85){const _0x1a87d6=a116_0x44d954,_0x51db6f=await this[_0x1a87d6(0x157)][_0x1a87d6(0x16c)](_0x110c85);let _0x2e3f02=![],_0x567f9a=![];try{const _0x55378=await this[_0x1a87d6(0x172)][_0x1a87d6(0x179)](_0x1a87d6(0x158),_0x1a87d6(0x15c)+_0x110c85+_0x1a87d6(0x166));_0x2e3f02=!![],_0x567f9a=!!(_0x55378&&typeof _0x55378===_0x1a87d6(0x15e)&&Object[_0x1a87d6(0x176)](_0x55378)[_0x1a87d6(0x168)]>0x0);}catch{_0x2e3f02=![],_0x567f9a=![];}return{'parent_segment_id':_0x110c85,'parent_segment_name':_0x51db6f[_0x1a87d6(0x163)]['name'],'realtime_enabled':_0x2e3f02,'realtime_config_exists':_0x567f9a,'status':_0x2e3f02?'enabled':_0x1a87d6(0x169)};}async[a116_0x44d954(0x173)](_0x4bffbc){const _0x521c71=a116_0x44d954,_0x50adb6=await this['httpClient']['request'](_0x521c71(0x158),_0x521c71(0x15c)+_0x4bffbc+'/realtime_setting');return _0x50adb6||{};}async[a116_0x44d954(0x165)](_0x4997a1,_0x4a5943){const _0xeb61e8=a116_0x44d954,_0x55e6f1=await this[_0xeb61e8(0x172)][_0xeb61e8(0x179)](_0xeb61e8(0x178),_0xeb61e8(0x15c)+_0x4997a1+_0xeb61e8(0x166),{'body':_0x4a5943});return _0x55e6f1||{};}async[a116_0x44d954(0x16f)](){const _0x27d379=a116_0x44d954,_0x550c1b=await this[_0x27d379(0x157)][_0x27d379(0x17b)](),_0x1ca298=await Promise[_0x27d379(0x16d)](_0x550c1b[_0x27d379(0x161)](async _0xf88dfe=>{const _0x18301e=_0x27d379,_0x29430a=await this['isEnabled'](_0xf88dfe['id']);return{'id':_0xf88dfe['id'],'name':_0xf88dfe[_0x18301e(0x163)][_0x18301e(0x159)],'population':_0xf88dfe[_0x18301e(0x163)]['population'],'realtime_enabled':_0x29430a,'schedule_type':_0xf88dfe[_0x18301e(0x163)][_0x18301e(0x162)],'updated_at':_0xf88dfe[_0x18301e(0x163)][_0x18301e(0x174)]};}));return _0x1ca298;}}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a117_0x102f6c=a117_0x8e4a;(function(_0x5ebab0,_0x1e177c){const _0x2fe2f2=a117_0x8e4a,_0x3c1491=_0x5ebab0();while(!![]){try{const _0x4762d9=parseInt(_0x2fe2f2(0xd3))/0x1+parseInt(_0x2fe2f2(0xf4))/0x2+-parseInt(_0x2fe2f2(0xcc))/0x3+-parseInt(_0x2fe2f2(0xed))/0x4*(-parseInt(_0x2fe2f2(0xf5))/0x5)+-parseInt(_0x2fe2f2(0xec))/0x6+parseInt(_0x2fe2f2(0xda))/0x7*(-parseInt(_0x2fe2f2(0xea))/0x8)+parseInt(_0x2fe2f2(0xca))/0x9*(parseInt(_0x2fe2f2(0xd1))/0xa);if(_0x4762d9===_0x1e177c)break;else _0x3c1491['push'](_0x3c1491['shift']());}catch(_0xb1d797){_0x3c1491['push'](_0x3c1491['shift']());}}}(a117_0x2193,0x492db));import{TDApiClient}from'./client/td-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function normalizeTimestamp(_0x478c5b){const _0x551259=a117_0x8e4a;if(!_0x478c5b)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/[_0x551259(0xe1)](_0x478c5b))return _0x478c5b;return _0x478c5b[_0x551259(0xf3)](_0x551259(0xeb),'Z')['replace']('\x20','T');}function a117_0x8e4a(_0x1de814,_0x2c48c2){_0x1de814=_0x1de814-0xc3;const _0x219354=a117_0x2193();let _0x8e4a0d=_0x219354[_0x1de814];return _0x8e4a0d;}function a117_0x2193(){const _0x17adc8=['Schedule\x20not\x20found:\x20','limit','test','pagination','find','getTime','getScheduleHistory','desc','Database\x20is\x20required','cron','map','720nBcaOv','\x20UTC','597708bnskwQ','44AWzvEZ','end_at','query','listSchedules','list','update','replace','548214QkLzOX','56965yGMPRF','string','createSchedule','push','listQueries','slice','name','run','client','Query\x20is\x20required','floor','updated_at','created_at','show','queries','19791qbBNXV','deleteSchedule','1654836lSXpkv','delete','\x5c$&','has_next_page','pattern','1950nNFxCX','length','378874qvRBTB','Schedule\x20name\x20is\x20required','create','history','num','Type\x20is\x20required','scheduled','19922qKgiFB','runSchedule','time','INVALID_ARGUMENT','filter'];a117_0x2193=function(){return _0x17adc8;};return a117_0x2193();}export class ScheduleSDK{[a117_0x102f6c(0xc3)];constructor(_0x179c7e){const _0x33e9f0=a117_0x102f6c;this[_0x33e9f0(0xc3)]=new TDApiClient(_0x179c7e);}async[a117_0x102f6c(0xf1)](_0x190651){const _0x105bf3=a117_0x102f6c,_0x57bf86=await this[_0x105bf3(0xc3)][_0x105bf3(0xf0)](),_0xfbf1ca=_0x57bf86[_0x105bf3(0xe9)](_0x37ad3c=>({..._0x37ad3c,'created_at':normalizeTimestamp(_0x37ad3c[_0x105bf3(0xc7)])??_0x37ad3c['created_at']}));if(_0x190651?.['limit']&&_0x190651[_0x105bf3(0xe0)]>0x0)return _0xfbf1ca[_0x105bf3(0xfa)](0x0,_0x190651[_0x105bf3(0xe0)]);return _0xfbf1ca;}async[a117_0x102f6c(0xf9)](_0x4078d8){const _0x4b1a2b=a117_0x102f6c,_0x544161=0x64,_0x40b5a1=_0x4078d8?.['limit'],_0x514de0=[];let _0x504642=!![],_0x56c0f4,_0x2d2802,_0x41c5f7;if(_0x4078d8?.[_0x4b1a2b(0xd0)]){const _0x11af5a=_0x4078d8['pattern'][_0x4b1a2b(0xf3)](/[.+^${}()|[\]\\]/g,_0x4b1a2b(0xce)),_0x4ff526=_0x11af5a['replace'](/\*/g,'.*')[_0x4b1a2b(0xf3)](/\?/g,'.');_0x41c5f7=new RegExp('^'+_0x4ff526+'$','i');}while(_0x504642&&(!_0x40b5a1||_0x514de0[_0x4b1a2b(0xd2)]<_0x40b5a1)){const _0x5b0970=await this['client']['listQueries']({'anchor_column':'updated_at','sort_direction':_0x4b1a2b(0xe6),'page_size':_0x544161,'anchor_id':_0x56c0f4,'anchor_value':_0x2d2802});let _0x133958=_0x5b0970['queries'];_0x4078d8?.[_0x4b1a2b(0xd9)]&&(_0x133958=_0x133958['filter'](_0x546b4f=>_0x546b4f[_0x4b1a2b(0xe8)]!==null));_0x41c5f7&&(_0x133958=_0x133958[_0x4b1a2b(0xde)](_0x422218=>_0x422218['name']&&_0x41c5f7[_0x4b1a2b(0xe1)](_0x422218[_0x4b1a2b(0xfb)])));_0x514de0[_0x4b1a2b(0xf8)](..._0x133958),_0x504642=_0x5b0970[_0x4b1a2b(0xe2)][_0x4b1a2b(0xcf)];if(_0x504642&&_0x5b0970['queries'][_0x4b1a2b(0xd2)]>0x0){const _0x5c21ba=_0x5b0970[_0x4b1a2b(0xc9)][_0x5b0970[_0x4b1a2b(0xc9)][_0x4b1a2b(0xd2)]-0x1];_0x56c0f4=_0x5c21ba['id'],_0x2d2802=_0x5c21ba[_0x4b1a2b(0xc6)];}}const _0x45e9b4=_0x40b5a1?_0x514de0[_0x4b1a2b(0xfa)](0x0,_0x40b5a1):_0x514de0;return{'queries':_0x45e9b4,'pagination':{'has_next_page':_0x504642||(_0x40b5a1?_0x514de0[_0x4b1a2b(0xd2)]>_0x40b5a1:![])}};}async[a117_0x102f6c(0xc8)](_0x10ce52){const _0x2c64c8=a117_0x102f6c,_0x71ff5f=await this[_0x2c64c8(0xc3)]['listSchedules'](),_0x4c151d=_0x71ff5f[_0x2c64c8(0xe3)](_0x54a634=>_0x54a634[_0x2c64c8(0xfb)]===_0x10ce52);if(!_0x4c151d)throw new SDKError(ErrorCode['NOT_FOUND'],_0x2c64c8(0xdf)+_0x10ce52);return{..._0x4c151d,'created_at':normalizeTimestamp(_0x4c151d[_0x2c64c8(0xc7)])??_0x4c151d['created_at']};}async[a117_0x102f6c(0xd5)](_0x5b83e1,_0x237229){const _0x4b78cf=a117_0x102f6c;if(!_0x5b83e1)throw new SDKError(ErrorCode[_0x4b78cf(0xdd)],_0x4b78cf(0xd4));if(!_0x237229['database'])throw new SDKError(ErrorCode[_0x4b78cf(0xdd)],_0x4b78cf(0xe7));if(!_0x237229[_0x4b78cf(0xef)])throw new SDKError(ErrorCode[_0x4b78cf(0xdd)],_0x4b78cf(0xc4));if(!_0x237229['type'])throw new SDKError(ErrorCode[_0x4b78cf(0xdd)],_0x4b78cf(0xd8));return await this['client'][_0x4b78cf(0xf7)](_0x5b83e1,_0x237229);}async[a117_0x102f6c(0xf2)](_0x5cd35f,_0x22074b){const _0x2284b9=a117_0x102f6c;if(!_0x5cd35f)throw new SDKError(ErrorCode[_0x2284b9(0xdd)],'Schedule\x20name\x20is\x20required');return await this[_0x2284b9(0xc3)]['updateSchedule'](_0x5cd35f,_0x22074b);}async[a117_0x102f6c(0xcd)](_0x5cf44b){const _0x46e188=a117_0x102f6c;if(!_0x5cf44b)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x46e188(0xd4));return await this['client'][_0x46e188(0xcb)](_0x5cf44b);}async[a117_0x102f6c(0xfc)](_0x2ad953,_0x5f0256){const _0xcc4c3f=a117_0x102f6c;if(!_0x2ad953)throw new SDKError(ErrorCode[_0xcc4c3f(0xdd)],_0xcc4c3f(0xd4));let _0x497cb6;if(_0x5f0256?.[_0xcc4c3f(0xdc)]){const _0x4927a5=typeof _0x5f0256[_0xcc4c3f(0xdc)]===_0xcc4c3f(0xf6)?new Date(_0x5f0256[_0xcc4c3f(0xdc)]):_0x5f0256[_0xcc4c3f(0xdc)];if(isNaN(_0x4927a5['getTime']()))throw new SDKError(ErrorCode[_0xcc4c3f(0xdd)],'Invalid\x20time\x20format:\x20'+_0x5f0256['time']);_0x497cb6=Math['floor'](_0x4927a5[_0xcc4c3f(0xe4)]()/0x3e8);}else _0x497cb6=Math[_0xcc4c3f(0xc5)](Date['now']()/0x3e8);if(_0x5f0256?.[_0xcc4c3f(0xd7)]!==undefined){if(_0x5f0256['num']<0x1||_0x5f0256[_0xcc4c3f(0xd7)]>0xa)throw new SDKError(ErrorCode[_0xcc4c3f(0xdd)],'num\x20must\x20be\x20between\x201\x20and\x2010');}return await this['client'][_0xcc4c3f(0xdb)](_0x2ad953,_0x497cb6,_0x5f0256?.[_0xcc4c3f(0xd7)]);}async['history'](_0x218b46,_0x388f96){const _0x5a2b15=a117_0x102f6c;if(!_0x218b46)throw new SDKError(ErrorCode[_0x5a2b15(0xdd)],_0x5a2b15(0xd4));const _0x3213d0=await this[_0x5a2b15(0xc3)][_0x5a2b15(0xe5)](_0x218b46,_0x388f96);return{..._0x3213d0,'history':_0x3213d0[_0x5a2b15(0xd6)][_0x5a2b15(0xe9)](_0x454308=>({..._0x454308,'created_at':normalizeTimestamp(_0x454308[_0x5a2b15(0xc7)]),'start_at':normalizeTimestamp(_0x454308['start_at']),'end_at':normalizeTimestamp(_0x454308[_0x5a2b15(0xee)])}))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a118_0x3538a0=a118_0x40da;(function(_0x5458f1,_0x3c1715){const _0x2ed899=a118_0x40da,_0x42185c=_0x5458f1();while(!![]){try{const _0x3a35b7=-parseInt(_0x2ed899(0x1ae))/0x1+-parseInt(_0x2ed899(0x1f2))/0x2+parseInt(_0x2ed899(0x1e4))/0x3*(parseInt(_0x2ed899(0x1cc))/0x4)+-parseInt(_0x2ed899(0x1da))/0x5*(parseInt(_0x2ed899(0x181))/0x6)+-parseInt(_0x2ed899(0x1b3))/0x7*(-parseInt(_0x2ed899(0x169))/0x8)+parseInt(_0x2ed899(0x195))/0x9*(-parseInt(_0x2ed899(0x168))/0xa)+parseInt(_0x2ed899(0x1a9))/0xb;if(_0x3a35b7===_0x3c1715)break;else _0x42185c['push'](_0x42185c['shift']());}catch(_0x549371){_0x42185c['push'](_0x42185c['shift']());}}}(a118_0x5ae8,0xefa04));import*as a118_0x53bcde 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(_0x5528ba){return _0x5528ba;}function ruleDefAsFilterRule(_0x4a762d){return _0x4a762d;}function a118_0x40da(_0x234685,_0x401d9b){_0x234685=_0x234685-0x15b;const _0x5ae8f4=a118_0x5ae8();let _0x40da73=_0x5ae8f4[_0x234685];return _0x40da73;}export function segmentResponseToDefSync(_0x3059de,_0x36b564){const _0x17424a=a118_0x40da,_0xccf180=_0x3059de[_0x17424a(0x19b)]&&'type'in _0x3059de[_0x17424a(0x19b)]&&_0x3059de['rule'][_0x17424a(0x18b)];return{'type':_0x17424a(0x193),'name':_0x3059de['name'],..._0x3059de[_0x17424a(0x1e6)]&&{'description':_0x3059de[_0x17424a(0x1e6)]},..._0x36b564&&{'folder':_0x36b564},..._0xccf180&&{'rule':apiRuleToYaml(_0x3059de[_0x17424a(0x19b)])},..._0x3059de['kind']!==undefined&&{'kind':_0x3059de['kind']===0x0?_0x17424a(0x1c4):_0x3059de['kind']===0x1?_0x17424a(0x16e):_0x17424a(0x178)},..._0x3059de['isVisible']!==undefined&&{'visible':_0x3059de[_0x17424a(0x1f3)]}};}export async function segmentResponseToDef(_0x26c942,_0x869200,_0x14f531){const _0x25f81f=a118_0x40da,_0x568a72=segmentResponseToDefSync(_0x26c942,_0x14f531);if(!_0x869200||!_0x869200[_0x25f81f(0x1df)])return _0x568a72;return _0x568a72['rule']&&(_0x568a72['rule']=await resolveRuleSegmentRefs(_0x568a72['rule'],_0x869200[_0x25f81f(0x1df)])),_0x568a72;}export function apiRuleToYaml(_0x240c2d){const _0x263604=a118_0x40da,_0x460716=(_0x240c2d[_0x263604(0x174)]||[])['map'](apiConditionToYaml);if(_0x460716['length']===0x1&&!_0x240c2d[_0x263604(0x1e6)]&&_0x263604(0x18b)in _0x460716[0x0]&&(_0x460716[0x0][_0x263604(0x18b)]===_0x263604(0x1d8)||_0x460716[0x0]['type']==='Or')){const _0x3237c5=_0x460716[0x0];if(_0x3237c5[_0x263604(0x18b)]===_0x240c2d['type']&&_0x3237c5[_0x263604(0x174)])return{'type':_0x240c2d[_0x263604(0x18b)],'conditions':_0x3237c5['conditions'],..._0x3237c5[_0x263604(0x1e6)]&&{'description':_0x3237c5[_0x263604(0x1e6)]}};}return{'type':_0x240c2d['type'],'conditions':_0x460716,..._0x240c2d[_0x263604(0x1e6)]&&{'description':_0x240c2d[_0x263604(0x1e6)]}};}export async function resolveRuleSegmentRefs(_0x47369f,_0xaa1781){return transformRuleSegmentRefs(_0x47369f,_0xaa1781,_0x2d565c=>/^\d+$/['test'](_0x2d565c));}async function transformConditionSegmentRefs(_0x29e719,_0x2fc0f9,_0x2c8f71,_0x52a04b){const _0x257df1=a118_0x40da;if(_0x257df1(0x193)in _0x29e719&&(_0x29e719[_0x257df1(0x18b)]===_0x257df1(0x1e8)||_0x29e719[_0x257df1(0x18b)]===_0x257df1(0x18e))){const _0x3a7e9e=_0x29e719;if(_0x2c8f71(_0x3a7e9e[_0x257df1(0x193)]))return{..._0x3a7e9e,'segment':await _0x2fc0f9(_0x3a7e9e['segment'])};return _0x29e719;}if(_0x257df1(0x174)in _0x29e719&&_0x29e719['conditions']){const _0x503a58=_0x29e719,_0x418cf9=await Promise['all'](_0x503a58[_0x257df1(0x174)][_0x257df1(0x1bb)](_0x3b9c60=>transformConditionSegmentRefs(_0x3b9c60,_0x2fc0f9,_0x2c8f71,_0x52a04b)));return{..._0x503a58,'conditions':_0x418cf9};}if('filter'in _0x29e719&&_0x29e719[_0x257df1(0x182)]){const _0x2b4efa=_0x29e719,_0x3006a6=await _0x52a04b(filterRuleAsRuleDef(_0x2b4efa[_0x257df1(0x182)]),_0x2fc0f9);return{..._0x2b4efa,'filter':ruleDefAsFilterRule(_0x3006a6)};}return _0x29e719;}async function transformRuleSegmentRefs(_0x5c44f9,_0x113ff7,_0x5bfda6){const _0x2e7a06=a118_0x40da,_0x1ca7aa=(_0x20de46,_0x150c74)=>transformRuleSegmentRefs(_0x20de46,_0x150c74,_0x5bfda6),_0x1ed2de=await Promise[_0x2e7a06(0x165)](_0x5c44f9[_0x2e7a06(0x174)]['map'](_0x2b1d55=>transformConditionSegmentRefs(_0x2b1d55,_0x113ff7,_0x5bfda6,_0x1ca7aa)));return{..._0x5c44f9,'conditions':_0x1ed2de};}export async function resolveRuleSegmentIds(_0x3e4eca,_0x4e35e){return transformRuleSegmentRefs(_0x3e4eca,_0x4e35e,_0xa63993=>!/^\d+$/['test'](_0xa63993));}function isBehaviorApiCondition(_0x40d693){const _0x40dce8=a118_0x40da;if(!_0x40d693[_0x40dce8(0x1b9)]?.[_0x40dce8(0x1db)]?.[_0x40dce8(0x1bc)])return![];return!![];}function apiConditionToYaml(_0x44bb54){const _0x4eb925=a118_0x40da;if(_0x44bb54['type']===_0x4eb925(0x1d8)||_0x44bb54[_0x4eb925(0x18b)]==='Or'){if(_0x44bb54[_0x4eb925(0x174)]){const _0x5a2130=_0x44bb54[_0x4eb925(0x174)]['map'](apiConditionToYaml);if(_0x5a2130[_0x4eb925(0x15f)]===0x1&&!_0x44bb54[_0x4eb925(0x1e6)])return _0x5a2130[0x0];return{'type':_0x44bb54[_0x4eb925(0x18b)],'conditions':_0x5a2130,..._0x44bb54[_0x4eb925(0x1e6)]&&{'description':_0x44bb54[_0x4eb925(0x1e6)]}};}}if(_0x44bb54[_0x4eb925(0x18b)]===_0x4eb925(0x172)&&_0x44bb54[_0x4eb925(0x1b9)]&&_0x44bb54['operator']){const _0x8b2626=_0x44bb54['leftValue'][_0x4eb925(0x192)]?buildAggregationDefFromApi(_0x44bb54[_0x4eb925(0x1b9)][_0x4eb925(0x192)]):undefined;if(isBehaviorApiCondition(_0x44bb54)){const _0x497dae=_0x44bb54[_0x4eb925(0x1b9)]['source']['name'];return{'type':_0x4eb925(0x180),'attribute':_0x497dae,'operator':apiOperatorToYaml(_0x44bb54[_0x4eb925(0x1ce)]),..._0x44bb54[_0x4eb925(0x1d0)]&&_0x44bb54[_0x4eb925(0x1d0)]!==_0x4eb925(0x1f9)?{'arrayMatching':_0x44bb54[_0x4eb925(0x1d0)]}:{},..._0x44bb54[_0x4eb925(0x18e)]?{'exclude':_0x44bb54[_0x4eb925(0x18e)]}:{},..._0x8b2626?{'aggregation':_0x8b2626}:{},'source':_0x497dae,..._0x44bb54[_0x4eb925(0x1b9)][_0x4eb925(0x182)]?{'filter':apiRuleToYaml(_0x44bb54[_0x4eb925(0x1b9)][_0x4eb925(0x182)])}:{},..._0x44bb54[_0x4eb925(0x171)]!==undefined&&_0x44bb54[_0x4eb925(0x171)]!==null?{'limit':_0x44bb54[_0x4eb925(0x171)]}:{}};}return{'type':'Value','attribute':_0x44bb54[_0x4eb925(0x1b9)][_0x4eb925(0x1bc)]||'','operator':apiOperatorToYaml(_0x44bb54[_0x4eb925(0x1ce)]),..._0x44bb54[_0x4eb925(0x1d0)]&&_0x44bb54[_0x4eb925(0x1d0)]!=='any'?{'arrayMatching':_0x44bb54[_0x4eb925(0x1d0)]}:{},..._0x44bb54[_0x4eb925(0x18e)]?{'exclude':_0x44bb54[_0x4eb925(0x18e)]}:{},..._0x8b2626?{'aggregation':_0x8b2626}:{},..._0x44bb54[_0x4eb925(0x1b9)][_0x4eb925(0x182)]?{'filter':apiRuleToYaml(_0x44bb54['leftValue']['filter'])}:{},..._0x44bb54[_0x4eb925(0x171)]!==undefined&&_0x44bb54[_0x4eb925(0x171)]!==null?{'limit':_0x44bb54[_0x4eb925(0x171)]}:{}};}if(_0x44bb54[_0x4eb925(0x18b)]===_0x4eb925(0x177)&&_0x44bb54[_0x4eb925(0x1ca)]&&_0x44bb54[_0x4eb925(0x1ce)])return{'type':_0x4eb925(0x177),'column':_0x44bb54['column'],'operator':apiOperatorToYaml(_0x44bb54['operator'])};if(_0x44bb54[_0x4eb925(0x18b)]===_0x4eb925(0x1f1)&&_0x44bb54['id'])return{'type':_0x44bb54[_0x4eb925(0x18e)]?_0x4eb925(0x18e):_0x4eb925(0x1e8),'segment':_0x44bb54['id']};return{'type':_0x4eb925(0x1d8),'conditions':[]};}function isTemporalOperator(_0x222e3b){const _0x10c62a=a118_0x40da;return _0x222e3b===_0x10c62a(0x1a1)||_0x222e3b==='TimeWithinNext';}function isBetweenOperator(_0x20b38d){return _0x20b38d==='Between';}function getEffectiveValue(_0x4814ea){const _0x185163=a118_0x40da,_0x45a602=_0x4814ea[_0x185163(0x1dd)];return _0x4814ea[_0x185163(0x1b6)]??_0x45a602;}function parseNumericValue(_0x57fbb3){const _0x483901=a118_0x40da;if(typeof _0x57fbb3===_0x483901(0x1c6)&&_0x57fbb3!==null)return _0x57fbb3;if(_0x57fbb3==='')return _0x57fbb3;const _0x6b6c59=Number(_0x57fbb3);return Number[_0x483901(0x15b)](_0x6b6c59)?_0x6b6c59:_0x57fbb3;}function apiOperatorToYaml(_0xacd6b0){const _0x327b07=a118_0x40da;if(isBetweenOperator(_0xacd6b0[_0x327b07(0x18b)]))return{'type':mapApiOperatorType(_0xacd6b0[_0x327b07(0x18b)]),..._0xacd6b0[_0x327b07(0x1a5)]!==undefined&&{'not':_0xacd6b0[_0x327b07(0x1a5)]},..._0xacd6b0['minValue']!==undefined&&{'min':parseNumericValue(_0xacd6b0[_0x327b07(0x1ea)])},..._0xacd6b0[_0x327b07(0x1c2)]!==undefined&&{'max':parseNumericValue(_0xacd6b0[_0x327b07(0x1c2)])}};if(_0xacd6b0[_0x327b07(0x18b)]==='TimeRange')return{'type':_0x327b07(0x197),..._0xacd6b0[_0x327b07(0x1a5)]!==undefined&&{'not':_0xacd6b0[_0x327b07(0x1a5)]},..._0xacd6b0[_0x327b07(0x163)]!==undefined&&{'duration':_0xacd6b0['duration']},..._0xacd6b0[_0x327b07(0x16a)]!==undefined&&{'from':_0xacd6b0['from']},..._0xacd6b0[_0x327b07(0x184)]!==undefined&&{'reverse':_0xacd6b0['reverse']}};let _0x58aba5;if(_0xacd6b0[_0x327b07(0x1eb)]&&_0xacd6b0[_0x327b07(0x1eb)][_0x327b07(0x15f)]>0x0)_0x58aba5=_0xacd6b0[_0x327b07(0x1eb)];else{if(_0xacd6b0[_0x327b07(0x166)]!==undefined)_0x58aba5=_0xacd6b0[_0x327b07(0x166)];else isTemporalOperator(_0xacd6b0['type'])&&_0xacd6b0[_0x327b07(0x1b6)]!==undefined&&(_0x58aba5=_0xacd6b0[_0x327b07(0x1b6)]);}return{'type':mapApiOperatorType(_0xacd6b0[_0x327b07(0x18b)]),..._0xacd6b0[_0x327b07(0x1a5)]!==undefined&&{'not':_0xacd6b0[_0x327b07(0x1a5)]},..._0x58aba5!==undefined&&{'value':_0x58aba5},..._0xacd6b0[_0x327b07(0x1e0)]!==undefined&&{'unit':_0xacd6b0[_0x327b07(0x1e0)]}};}function mapApiOperatorType(_0x689669){return _0x689669;}export function segmentDefToCreateRequest(_0x5efc4e,_0x1c1a0a){const _0x4a5ab5=a118_0x40da,_0xca1107={'name':_0x5efc4e[_0x4a5ab5(0x1bc)]};return _0x5efc4e[_0x4a5ab5(0x1e6)]&&(_0xca1107[_0x4a5ab5(0x1e6)]=_0x5efc4e[_0x4a5ab5(0x1e6)]),_0x5efc4e['rule']&&(_0xca1107[_0x4a5ab5(0x19b)]=yamlRuleToApi(_0x5efc4e[_0x4a5ab5(0x19b)])),_0x5efc4e['kind']&&(_0xca1107[_0x4a5ab5(0x160)]=_0x5efc4e[_0x4a5ab5(0x160)]===_0x4a5ab5(0x1c4)?0x0:_0x5efc4e[_0x4a5ab5(0x160)]===_0x4a5ab5(0x16e)?0x1:0x2),_0x5efc4e['visible']!==undefined&&(_0xca1107[_0x4a5ab5(0x1f3)]=_0x5efc4e['visible']),_0x1c1a0a&&(_0xca1107[_0x4a5ab5(0x19a)]=_0x1c1a0a),_0xca1107;}export function segmentDefToUpdateRequest(_0x279d5e){const _0x48b34f=a118_0x40da,_0x5311c9={'name':_0x279d5e[_0x48b34f(0x1bc)]};return _0x279d5e[_0x48b34f(0x1e6)]!==undefined&&(_0x5311c9[_0x48b34f(0x1e6)]=_0x279d5e['description']),_0x279d5e[_0x48b34f(0x19b)]&&(_0x5311c9[_0x48b34f(0x19b)]=yamlRuleToApi(_0x279d5e[_0x48b34f(0x19b)])),_0x279d5e[_0x48b34f(0x160)]&&(_0x5311c9[_0x48b34f(0x160)]=_0x279d5e[_0x48b34f(0x160)]==='batch'?0x0:_0x279d5e['kind']===_0x48b34f(0x16e)?0x1:0x2),_0x5311c9;}export function yamlRuleToApi(_0x2c0f5b,_0x3435ff=![]){const _0x18266a=a118_0x40da,_0x3014eb=_0x2c0f5b[_0x18266a(0x174)][_0x18266a(0x1bb)](yamlConditionToApi);if(_0x3435ff){const _0x48e5ef=_0x3014eb[_0x18266a(0x1a8)](_0x4e001e=>_0x4e001e[_0x18266a(0x18b)]===_0x18266a(0x1d8)||_0x4e001e['type']==='Or');if(!_0x48e5ef&&_0x3014eb[_0x18266a(0x15f)]>0x0)return{'type':_0x2c0f5b['type'],'conditions':[{'type':_0x18266a(0x1d8),'description':_0x2c0f5b['description']||'','conditions':_0x3014eb}]};}return{'type':_0x2c0f5b[_0x18266a(0x18b)],'conditions':_0x3014eb,..._0x2c0f5b[_0x18266a(0x1e6)]&&{'description':_0x2c0f5b[_0x18266a(0x1e6)]}};}function yamlConditionToApi(_0x3d9134){const _0x212995=a118_0x40da;if('segment'in _0x3d9134&&(_0x3d9134['type']===_0x212995(0x1e8)||_0x3d9134[_0x212995(0x18b)]===_0x212995(0x18e))){const _0x41137b=_0x3d9134;return{'type':_0x212995(0x1f1),'id':_0x41137b[_0x212995(0x193)],'exclude':_0x41137b[_0x212995(0x18b)]===_0x212995(0x18e)};}if(_0x212995(0x18b)in _0x3d9134&&(_0x3d9134[_0x212995(0x18b)]===_0x212995(0x1d8)||_0x3d9134['type']==='Or')){const _0x227063=_0x3d9134;return{'type':_0x227063[_0x212995(0x18b)],'conditions':_0x227063[_0x212995(0x174)]['map'](yamlConditionToApi),..._0x227063[_0x212995(0x1e6)]&&{'description':_0x227063[_0x212995(0x1e6)]}};}if(_0x212995(0x1ca)in _0x3d9134&&_0x3d9134['type']===_0x212995(0x177)){const _0x3d70b6=_0x3d9134;return{'type':_0x212995(0x177),'column':_0x3d70b6['column'],'operator':yamlOperatorToApi(_0x3d70b6['operator'])};}const _0x39b19a=_0x3d9134,_0x207530={'type':'Value','leftValue':buildLeftValue(_0x39b19a),'operator':yamlOperatorToApi(_0x39b19a[_0x212995(0x1ce)]),'exclude':_0x39b19a[_0x212995(0x18e)]??![],'arrayMatching':_0x39b19a['arrayMatching']??_0x212995(0x1f9)};return _0x39b19a[_0x212995(0x171)]!==undefined&&(_0x207530[_0x212995(0x171)]=_0x39b19a['limit']),_0x207530;}function buildAggregationDefFromApi(_0x1dbd1f){const _0xa71c34=a118_0x40da,_0x1563a3=_0x1dbd1f[_0xa71c34(0x18b)];if(_0x1563a3===_0xa71c34(0x1d6))return{'type':_0x1563a3,'columns':_0x1dbd1f[_0xa71c34(0x1a3)]??[]};if(_0x1563a3===_0xa71c34(0x1f7)||_0x1563a3===_0xa71c34(0x1cf))return{'type':_0x1563a3,'column':_0x1dbd1f[_0xa71c34(0x1ca)]??'','orderColumn':_0x1dbd1f['orderColumn']??'',..._0x1dbd1f['groupingColumns']&&{'groupingColumns':_0x1dbd1f['groupingColumns']}};if(_0x1563a3===_0xa71c34(0x198))return{'type':_0x1563a3,..._0x1dbd1f[_0xa71c34(0x173)]&&{'groupingColumns':_0x1dbd1f[_0xa71c34(0x173)]}};return{'type':_0x1563a3,'column':_0x1dbd1f[_0xa71c34(0x1ca)]??'',..._0x1dbd1f[_0xa71c34(0x173)]&&{'groupingColumns':_0x1dbd1f[_0xa71c34(0x173)]}};}function buildLeftValue(_0x28f738){const _0x5e5bbd=a118_0x40da,_0x55af95={};_0x28f738[_0x5e5bbd(0x1c3)]&&(_0x55af95[_0x5e5bbd(0x1bc)]=_0x28f738[_0x5e5bbd(0x1c3)]);if(_0x28f738['aggregation']){const _0x270818=_0x28f738[_0x5e5bbd(0x192)];if(_0x270818[_0x5e5bbd(0x18b)]===_0x5e5bbd(0x1d6))_0x55af95[_0x5e5bbd(0x192)]={'type':_0x5e5bbd(0x1d6),'columns':_0x270818[_0x5e5bbd(0x1a3)]};else{if(_0x270818[_0x5e5bbd(0x18b)]==='First'||_0x270818[_0x5e5bbd(0x18b)]===_0x5e5bbd(0x1cf))_0x55af95[_0x5e5bbd(0x192)]={'type':_0x270818[_0x5e5bbd(0x18b)],'column':_0x270818[_0x5e5bbd(0x1ca)],'orderColumn':_0x270818['orderColumn'],..._0x270818[_0x5e5bbd(0x173)]&&{'groupingColumns':_0x270818[_0x5e5bbd(0x173)]}};else _0x270818[_0x5e5bbd(0x18b)]===_0x5e5bbd(0x198)?_0x55af95[_0x5e5bbd(0x192)]={'type':'Count',..._0x270818['groupingColumns']&&{'groupingColumns':_0x270818[_0x5e5bbd(0x173)]}}:_0x55af95['aggregation']={'type':_0x270818[_0x5e5bbd(0x18b)],'column':_0x270818[_0x5e5bbd(0x1ca)],..._0x270818[_0x5e5bbd(0x173)]&&{'groupingColumns':_0x270818['groupingColumns']}};}}return _0x28f738[_0x5e5bbd(0x1db)]&&(_0x55af95['source']={'name':_0x28f738[_0x5e5bbd(0x1db)]}),_0x28f738[_0x5e5bbd(0x182)]&&(_0x55af95['filter']=yamlRuleToApi(filterRuleAsRuleDef(_0x28f738['filter']))),_0x55af95;}function a118_0x5ae8(){const _0xba7a08=['attribute_name','timezone','exclude','emailRecipients','email_recipients','activationParams','aggregation','segment','schedule','15485769ULyZpa','connector_config','TimeRange','Count','attributes','segmentFolderId','rule','null','runAfterJourneyRefresh','activations:','visibility','orderBy','TimeWithinPast','warnings','columns','conditions[','not','localRuleToName','activations','every','37036560haUZXq','endOn','warn','behavior_table','repeatFrequency','1195078GhfpPn','all_columns','join_row','start_at','folder','1956157xuHtYN','usedNames','toLowerCase','value','isArray','activation_template_id','leftValue','join_strategy','map','name','notifyOn','repeat_sub_frequency','\x22:\x0a','repeatUnit','Connector:\x20','maxValue','attribute','batch','CONNECTOR_INVALID_CONFIG','object','set','Segment\x20description','allColumns','column','__UNRESOLVED__','2659692onHVsi','startAt','operator','Last','arrayMatching','notify_on','__SEGMENT_REF__','connection','repeat_unit','keys','CountDistinct','connectionId','And','formatting','1995paCMwv','source','behaviorTableName','values','parse','resolveSegmentName','unit','notification','ruleHashToName','Unknown\x20connection:\x20','3KwpwOK','behavior','description','connector_config\x20for\x20activation\x20\x22','include','sort','minValue','rightValues','JOURNEY_SYNTAX_ERROR','errors','CONNECTION_NOT_FOUND','joinRow','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','Reference','1595696mKDZXA','isVisible','New\x20Segment','INVALID_ARGUMENT','repeat_frequency','First','replace','any','repeatSubFrequency','isFinite','push','visible','rule:','length','kind','max','add','duration','string','all','rightValue','min','10hKFHAT','24uHUKWP','from','connectionNameToTypeMap','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','get','realtime','end_on','code','limit','Value','groupingColumns','conditions','connectionNameToIdMap','joinStrategy','Column','funnel_stage','order_by','entries','activationTemplateId','].attribute\x20cannot\x20be\x20empty.\x0a','scheduleType','syndicationBehavior','forEach','Behavior','2634XGHcyy','filter','Unknown\x20email\x20recipient:\x20','reverse','Equal','getSchema','has','connectorConfig','localeCompare','stringify','type'];a118_0x5ae8=function(){return _0xba7a08;};return a118_0x5ae8();}function yamlOperatorToApi(_0x300e4c){const _0x144b81=a118_0x40da,_0x7cc9ba={'type':mapYamlOperatorType(_0x300e4c[_0x144b81(0x18b)]),'not':_0x300e4c[_0x144b81(0x1a5)]??![]};if(isBetweenOperator(_0x300e4c[_0x144b81(0x18b)]))return _0x300e4c[_0x144b81(0x167)]!==undefined&&(_0x7cc9ba[_0x144b81(0x1ea)]=typeof _0x300e4c[_0x144b81(0x167)]===_0x144b81(0x1c6)?_0x300e4c[_0x144b81(0x167)]:String(_0x300e4c[_0x144b81(0x167)])),_0x300e4c[_0x144b81(0x161)]!==undefined&&(_0x7cc9ba[_0x144b81(0x1c2)]=typeof _0x300e4c[_0x144b81(0x161)]===_0x144b81(0x1c6)?_0x300e4c[_0x144b81(0x161)]:String(_0x300e4c[_0x144b81(0x161)])),_0x7cc9ba;if(_0x300e4c[_0x144b81(0x18b)]===_0x144b81(0x197))return _0x300e4c[_0x144b81(0x163)]&&(_0x7cc9ba['duration']=_0x300e4c[_0x144b81(0x163)]),_0x300e4c[_0x144b81(0x16a)]&&(_0x7cc9ba[_0x144b81(0x16a)]=_0x300e4c[_0x144b81(0x16a)]),_0x300e4c[_0x144b81(0x184)]!==undefined&&(_0x7cc9ba[_0x144b81(0x184)]=_0x300e4c[_0x144b81(0x184)]),_0x7cc9ba;const _0x1059af=getEffectiveValue(_0x300e4c);if(_0x1059af!==undefined){if(Array['isArray'](_0x1059af))_0x7cc9ba[_0x144b81(0x1eb)]=_0x1059af;else isTemporalOperator(_0x300e4c[_0x144b81(0x18b)])?_0x7cc9ba[_0x144b81(0x1b6)]=_0x1059af:_0x7cc9ba[_0x144b81(0x166)]=_0x1059af;}return _0x300e4c['unit']&&(_0x7cc9ba['unit']=_0x300e4c[_0x144b81(0x1e0)]),_0x7cc9ba;}function mapYamlOperatorType(_0x37a027){return _0x37a027;}export function toYamlString(_0x5b0713){const _0x3bc3ee=a118_0x40da,_0x3e5bd5=JSON[_0x3bc3ee(0x1de)](JSON[_0x3bc3ee(0x18a)](_0x5b0713)),_0x2caf0a=a118_0x53bcde['stringify'](_0x3e5bd5,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3bc3ee(0x19c)}),_0x5b22f1=[_0x3bc3ee(0x15e)];let _0x5465ac=_0x2caf0a;for(const _0x5056cb of _0x5b22f1){_0x5465ac=_0x5465ac[_0x3bc3ee(0x1f8)](new RegExp('^('+_0x5056cb+')','m'),(_0x13ea83,_0x5443bd,_0x3a3c1d)=>{if(_0x3a3c1d===0x0||_0x5465ac[_0x3a3c1d-0x1]==='\x0a'&&_0x5465ac[_0x3a3c1d-0x2]==='\x0a')return _0x5443bd;return'\x0a'+_0x5443bd;});}return _0x5465ac;}export function parseYamlString(_0x32cf31){return parseSegmentYamlFile(_0x32cf31);}export function isSegmentYaml(_0x4cba0b){const _0x3cfd7d=a118_0x40da;if(typeof _0x4cba0b!==_0x3cfd7d(0x1c6)||_0x4cba0b===null)return![];const _0x280d24=_0x4cba0b;return _0x280d24[_0x3cfd7d(0x18b)]===_0x3cfd7d(0x193)||_0x280d24[_0x3cfd7d(0x18b)]===undefined;}export function generateTemplate(_0xf37d2f=a118_0x3538a0(0x1f4)){const _0x24ff88=a118_0x3538a0,_0x27fa37={'type':_0x24ff88(0x193),'name':_0xf37d2f,'description':_0x24ff88(0x1c8),'rule':{'type':'And','conditions':[{'type':_0x24ff88(0x172),'attribute':_0x24ff88(0x18c),'operator':{'type':_0x24ff88(0x185),'value':_0x24ff88(0x1b6)}}]}};return toYamlString(_0x27fa37);}export function segmentToYamlString(_0x4fa5da){const _0x48deb3=a118_0x3538a0,_0x35bcef=JSON[_0x48deb3(0x1de)](JSON[_0x48deb3(0x18a)](_0x4fa5da)),_0x432d2f=a118_0x53bcde[_0x48deb3(0x18a)](_0x35bcef,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x48deb3(0x19c)}),_0x307cb6=[_0x48deb3(0x15e),_0x48deb3(0x19e)];let _0x3c7b6e=_0x432d2f;for(const _0x1da895 of _0x307cb6){_0x3c7b6e=_0x3c7b6e['replace'](new RegExp('^('+_0x1da895+')','m'),(_0x2bb84d,_0x3bd57c,_0x6e6ee1)=>{if(_0x6e6ee1===0x0||_0x3c7b6e[_0x6e6ee1-0x1]==='\x0a'&&_0x3c7b6e[_0x6e6ee1-0x2]==='\x0a')return _0x3bd57c;return'\x0a'+_0x3bd57c;});}return _0x3c7b6e;}export function parseSegmentYamlFile(_0x42c985){return safeParseYaml(_0x42c985,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x229eba){const _0x55f91a=a118_0x3538a0;return{'type':_0x55f91a(0x193),'name':_0x229eba[_0x55f91a(0x1bc)],..._0x229eba['description']!==undefined&&{'description':_0x229eba[_0x55f91a(0x1e6)]},..._0x229eba[_0x55f91a(0x1b2)]!==undefined&&{'folder':_0x229eba[_0x55f91a(0x1b2)]},..._0x229eba['rule']&&{'rule':normalizeRule(_0x229eba[_0x55f91a(0x19b)])},..._0x229eba[_0x55f91a(0x160)]!==undefined&&{'kind':_0x229eba['kind']},..._0x229eba[_0x55f91a(0x15d)]!==undefined&&{'visible':_0x229eba[_0x55f91a(0x15d)]},..._0x229eba[_0x55f91a(0x1a7)]&&{'activations':_0x229eba[_0x55f91a(0x1a7)][_0x55f91a(0x1bb)](normalizeActivation)}};}export function normalizeRule(_0x4ffce3){const _0x5632c9=a118_0x3538a0;return{'type':_0x4ffce3['type'],'conditions':_0x4ffce3['conditions'][_0x5632c9(0x1bb)](normalizeCondition),..._0x4ffce3['description']!==undefined&&{'description':_0x4ffce3[_0x5632c9(0x1e6)]}};}function normalizeCondition(_0x54d05e){const _0x59f6c5=a118_0x3538a0;if(_0x59f6c5(0x193)in _0x54d05e&&(_0x54d05e[_0x59f6c5(0x18b)]==='include'||_0x54d05e['type']===_0x59f6c5(0x18e))){const _0x42e75a=_0x54d05e;return{'type':_0x42e75a[_0x59f6c5(0x18b)],'segment':_0x42e75a[_0x59f6c5(0x193)]};}if('type'in _0x54d05e&&(_0x54d05e['type']==='And'||_0x54d05e[_0x59f6c5(0x18b)]==='Or')){const _0x1efb33=_0x54d05e;return{'type':_0x1efb33['type'],'conditions':_0x1efb33[_0x59f6c5(0x174)][_0x59f6c5(0x1bb)](normalizeCondition),..._0x1efb33[_0x59f6c5(0x1e6)]!==undefined&&{'description':_0x1efb33[_0x59f6c5(0x1e6)]}};}if('column'in _0x54d05e&&_0x54d05e[_0x59f6c5(0x18b)]===_0x59f6c5(0x177)){const _0x88a10b=_0x54d05e;return{'type':'Column','column':_0x88a10b[_0x59f6c5(0x1ca)],'operator':normalizeOperator(_0x88a10b[_0x59f6c5(0x1ce)])};}const _0x18f270=_0x54d05e;return{'type':_0x59f6c5(0x172),'attribute':_0x18f270[_0x59f6c5(0x1c3)],'operator':normalizeOperator(_0x18f270[_0x59f6c5(0x1ce)]),..._0x18f270[_0x59f6c5(0x1d0)]!==undefined&&{'arrayMatching':_0x18f270[_0x59f6c5(0x1d0)]},..._0x18f270[_0x59f6c5(0x18e)]!==undefined&&{'exclude':_0x18f270[_0x59f6c5(0x18e)]},..._0x18f270[_0x59f6c5(0x192)]!==undefined&&{'aggregation':_0x18f270['aggregation']},..._0x18f270[_0x59f6c5(0x1db)]!==undefined&&{'source':_0x18f270[_0x59f6c5(0x1db)]},..._0x18f270['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x18f270[_0x59f6c5(0x182)])))},..._0x18f270[_0x59f6c5(0x171)]!==undefined&&{'limit':_0x18f270['limit']}};}function normalizeOperator(_0x3c0416){const _0x789b07=a118_0x3538a0;if(isBetweenOperator(_0x3c0416['type']))return{'type':_0x3c0416['type'],..._0x3c0416[_0x789b07(0x1a5)]!==undefined&&{'not':_0x3c0416['not']},..._0x3c0416[_0x789b07(0x167)]!==undefined&&{'min':_0x3c0416['min']},..._0x3c0416[_0x789b07(0x161)]!==undefined&&{'max':_0x3c0416['max']}};const _0x3c1269=getEffectiveValue(_0x3c0416);return{'type':_0x3c0416[_0x789b07(0x18b)],..._0x3c0416[_0x789b07(0x1a5)]!==undefined&&{'not':_0x3c0416[_0x789b07(0x1a5)]},..._0x3c1269!==undefined&&{'value':_0x3c1269},..._0x3c0416[_0x789b07(0x1e0)]!==undefined&&{'unit':_0x3c0416[_0x789b07(0x1e0)]},..._0x3c0416['duration']!==undefined&&{'duration':_0x3c0416[_0x789b07(0x163)]},..._0x3c0416[_0x789b07(0x16a)]!==undefined&&{'from':_0x3c0416['from']},..._0x3c0416[_0x789b07(0x184)]!==undefined&&{'reverse':_0x3c0416[_0x789b07(0x184)]}};}function normalizeActivation(_0x386304){const _0x163e36=a118_0x3538a0;return{'name':_0x386304[_0x163e36(0x1bc)],'connection':_0x386304[_0x163e36(0x1d3)],..._0x386304[_0x163e36(0x1e6)]!==undefined&&{'description':_0x386304['description']},..._0x386304[_0x163e36(0x1af)]!==undefined&&{'all_columns':_0x386304[_0x163e36(0x1af)]},..._0x386304[_0x163e36(0x1a3)]!==undefined&&{'columns':_0x386304['columns']},..._0x386304[_0x163e36(0x1e5)]!==undefined&&{'behavior':_0x386304['behavior']},..._0x386304[_0x163e36(0x194)]!==undefined&&{'schedule':_0x386304[_0x163e36(0x194)]},..._0x386304[_0x163e36(0x1e1)]!==undefined&&{'notification':_0x386304[_0x163e36(0x1e1)]},..._0x386304[_0x163e36(0x196)]!==undefined&&{'connector_config':_0x386304[_0x163e36(0x196)]},..._0x386304[_0x163e36(0x1b8)]!==undefined&&{'activation_template_id':_0x386304[_0x163e36(0x1b8)]}};}export function activationResponseToDef(_0x17d3bf,_0x25df4b,_0x14637a){const _0x19c7c9=a118_0x3538a0,_0x4e429e=_0x17d3bf[_0x19c7c9(0x1d7)]||'',_0x5f4e39=_0x14637a?.[_0x19c7c9(0x16d)](_0x4e429e)??_0x4e429e,_0x3c553b={'name':_0x17d3bf[_0x19c7c9(0x1bc)],'connection':_0x5f4e39};_0x17d3bf[_0x19c7c9(0x1e6)]&&(_0x3c553b[_0x19c7c9(0x1e6)]=_0x17d3bf[_0x19c7c9(0x1e6)]);let _0x3716c9=[];_0x17d3bf[_0x19c7c9(0x1a3)]&&_0x17d3bf[_0x19c7c9(0x1a3)][_0x19c7c9(0x15f)]>0x0&&(_0x3716c9=_0x17d3bf[_0x19c7c9(0x1a3)][_0x19c7c9(0x182)](_0x47ddfe=>_0x47ddfe&&_0x47ddfe['name'])[_0x19c7c9(0x1bb)](_0xc8bbdb=>{const _0x7a9513=_0x19c7c9;if(_0xc8bbdb[_0x7a9513(0x18b)]||_0xc8bbdb['visibility'])return{'name':_0xc8bbdb[_0x7a9513(0x1bc)],..._0xc8bbdb[_0x7a9513(0x18b)]&&{'type':_0xc8bbdb[_0x7a9513(0x18b)]},..._0xc8bbdb[_0x7a9513(0x19f)]&&{'visibility':_0xc8bbdb['visibility']}};return _0xc8bbdb[_0x7a9513(0x1bc)];}));_0x3716c9[_0x19c7c9(0x15f)]>0x0&&(_0x3c553b['columns']=_0x3716c9);_0x17d3bf[_0x19c7c9(0x1c9)]!==undefined&&(_0x17d3bf['allColumns']===![]&&_0x3716c9[_0x19c7c9(0x15f)]===0x0?_0x3c553b[_0x19c7c9(0x1af)]=!![]:_0x3c553b[_0x19c7c9(0x1af)]=_0x17d3bf[_0x19c7c9(0x1c9)]);const _0x4e7264={};let _0x3b9284=![];_0x17d3bf[_0x19c7c9(0x17d)]&&(_0x4e7264[_0x19c7c9(0x18b)]=_0x17d3bf[_0x19c7c9(0x17d)],_0x3b9284=!![]);_0x17d3bf[_0x19c7c9(0x1c0)]&&(_0x4e7264[_0x19c7c9(0x1d4)]=_0x17d3bf[_0x19c7c9(0x1c0)],_0x3b9284=!![]);_0x17d3bf[_0x19c7c9(0x1ad)]!==undefined&&_0x17d3bf[_0x19c7c9(0x1ad)]!==null&&(_0x4e7264[_0x19c7c9(0x1f6)]=_0x17d3bf['repeatFrequency'],_0x3b9284=!![]);_0x17d3bf[_0x19c7c9(0x1fa)]&&_0x17d3bf[_0x19c7c9(0x1fa)][_0x19c7c9(0x15f)]>0x0&&(_0x4e7264[_0x19c7c9(0x1be)]=_0x17d3bf[_0x19c7c9(0x1fa)],_0x3b9284=!![]);_0x17d3bf[_0x19c7c9(0x1cd)]!==undefined&&(_0x4e7264[_0x19c7c9(0x1b1)]=_0x17d3bf[_0x19c7c9(0x1cd)],_0x3b9284=!![]);_0x17d3bf[_0x19c7c9(0x1aa)]!==undefined&&(_0x4e7264['end_on']=_0x17d3bf['endOn'],_0x3b9284=!![]);_0x17d3bf['timezone']&&(_0x4e7264[_0x19c7c9(0x18d)]=_0x17d3bf['timezone'],_0x3b9284=!![]);_0x3b9284&&(_0x3c553b[_0x19c7c9(0x194)]=_0x4e7264);(_0x17d3bf['notifyOn']&&_0x17d3bf[_0x19c7c9(0x1bd)]['length']>0x0||_0x17d3bf[_0x19c7c9(0x18f)]&&_0x17d3bf[_0x19c7c9(0x18f)]['length']>0x0)&&(_0x3c553b[_0x19c7c9(0x1e1)]={},_0x17d3bf[_0x19c7c9(0x1bd)]&&_0x17d3bf[_0x19c7c9(0x1bd)][_0x19c7c9(0x15f)]>0x0&&(_0x3c553b[_0x19c7c9(0x1e1)]['notify_on']=_0x17d3bf[_0x19c7c9(0x1bd)]),_0x17d3bf[_0x19c7c9(0x18f)]&&_0x17d3bf[_0x19c7c9(0x18f)][_0x19c7c9(0x15f)]>0x0&&(_0x3c553b[_0x19c7c9(0x1e1)]['email_recipients']=_0x17d3bf[_0x19c7c9(0x18f)][_0x19c7c9(0x1bb)](_0x3482f6=>{const _0x4e0baf=_0x25df4b?.['get'](_0x3482f6);return _0x4e0baf??String(_0x3482f6);})));_0x17d3bf[_0x19c7c9(0x188)]&&Object[_0x19c7c9(0x1d5)](_0x17d3bf[_0x19c7c9(0x188)])[_0x19c7c9(0x15f)]>0x0&&(_0x3c553b[_0x19c7c9(0x196)]=normalizeConnectorConfigForYaml(_0x17d3bf[_0x19c7c9(0x188)]));_0x17d3bf['activationTemplateId']&&(_0x3c553b[_0x19c7c9(0x1b8)]=_0x17d3bf['activationTemplateId']);if(_0x17d3bf['syndicationBehavior']){const _0xd588f0={},_0x146858=_0x17d3bf[_0x19c7c9(0x17e)];_0x146858[_0x19c7c9(0x1a3)]&&_0x146858[_0x19c7c9(0x1a3)][_0x19c7c9(0x15f)]>0x0&&(_0xd588f0['columns']=_0x146858[_0x19c7c9(0x1a3)][_0x19c7c9(0x182)](_0x27145a=>_0x27145a&&_0x27145a[_0x19c7c9(0x1bc)])[_0x19c7c9(0x1bb)](_0x2e5f17=>({'name':_0x2e5f17[_0x19c7c9(0x1bc)],..._0x2e5f17[_0x19c7c9(0x18b)]&&{'type':_0x2e5f17[_0x19c7c9(0x18b)]},..._0x2e5f17['visibility']&&{'visibility':_0x2e5f17['visibility']}}))),_0x146858[_0x19c7c9(0x1dc)]&&(_0xd588f0[_0x19c7c9(0x1ac)]=_0x146858[_0x19c7c9(0x1dc)]),_0x146858[_0x19c7c9(0x1ef)]!==undefined&&(_0xd588f0[_0x19c7c9(0x1b0)]=_0x146858[_0x19c7c9(0x1ef)]),_0x146858[_0x19c7c9(0x176)]&&(_0xd588f0[_0x19c7c9(0x1ba)]=_0x146858['joinStrategy']),_0x146858['formatting']&&(_0xd588f0[_0x19c7c9(0x1d9)]=_0x146858['formatting']),_0x146858[_0x19c7c9(0x1a0)]&&_0x146858['orderBy'][_0x19c7c9(0x15f)]>0x0&&(_0xd588f0[_0x19c7c9(0x179)]=_0x146858['orderBy']),Object[_0x19c7c9(0x1d5)](_0xd588f0)[_0x19c7c9(0x15f)]>0x0&&(_0x3c553b[_0x19c7c9(0x1e5)]=_0xd588f0);}return _0x3c553b;}export function journeyActivationStepToYaml(_0x197944,_0x47c414,_0x163e61){const _0x5216f3=a118_0x3538a0,_0x5356d3=_0x197944[_0x5216f3(0x199)][_0x5216f3(0x191)],_0x1eed76=_0x5356d3[_0x5216f3(0x1d7)]||'',_0x29eec6=_0x163e61?.[_0x5216f3(0x16d)](_0x1eed76)??_0x1eed76,_0x32f3a7={'name':_0x5356d3['name']||'','connection':_0x29eec6};_0x197944['attributes'][_0x5216f3(0x19d)]&&(_0x32f3a7['run_after_journey_refresh']=!![]);_0x5356d3[_0x5216f3(0x1e6)]&&(_0x32f3a7[_0x5216f3(0x1e6)]=_0x5356d3['description']);let _0x416a8d=[];_0x5356d3[_0x5216f3(0x1a3)]&&_0x5356d3[_0x5216f3(0x1a3)][_0x5216f3(0x15f)]>0x0&&(_0x416a8d=_0x5356d3[_0x5216f3(0x1a3)][_0x5216f3(0x182)](_0x602b32=>_0x602b32&&_0x602b32['name'])[_0x5216f3(0x1bb)](_0x260d76=>{const _0xc4d82a=_0x5216f3;if(_0x260d76[_0xc4d82a(0x18b)]||_0x260d76[_0xc4d82a(0x19f)])return{'name':_0x260d76[_0xc4d82a(0x1bc)],..._0x260d76['type']&&{'type':_0x260d76[_0xc4d82a(0x18b)]},..._0x260d76[_0xc4d82a(0x19f)]&&{'visibility':_0x260d76[_0xc4d82a(0x19f)]}};return _0x260d76[_0xc4d82a(0x1bc)];}));_0x416a8d['length']>0x0&&(_0x32f3a7['columns']=_0x416a8d);_0x5356d3['allColumns']!==undefined&&(_0x5356d3[_0x5216f3(0x1c9)]===![]&&_0x416a8d[_0x5216f3(0x15f)]===0x0?_0x32f3a7['all_columns']=!![]:_0x32f3a7[_0x5216f3(0x1af)]=_0x5356d3[_0x5216f3(0x1c9)]);const _0x20935c={};let _0x2e6b81=![];_0x5356d3['scheduleType']&&(_0x20935c[_0x5216f3(0x18b)]=_0x5356d3[_0x5216f3(0x17d)],_0x2e6b81=!![]);_0x5356d3[_0x5216f3(0x1c0)]&&(_0x20935c['repeat_unit']=_0x5356d3[_0x5216f3(0x1c0)],_0x2e6b81=!![]);_0x5356d3[_0x5216f3(0x1ad)]!==undefined&&_0x5356d3['repeatFrequency']!==null&&(_0x20935c[_0x5216f3(0x1f6)]=_0x5356d3[_0x5216f3(0x1ad)],_0x2e6b81=!![]);_0x5356d3[_0x5216f3(0x1cd)]!==undefined&&(_0x20935c['start_at']=_0x5356d3[_0x5216f3(0x1cd)],_0x2e6b81=!![]);_0x5356d3[_0x5216f3(0x1aa)]!==undefined&&(_0x20935c[_0x5216f3(0x16f)]=_0x5356d3[_0x5216f3(0x1aa)],_0x2e6b81=!![]);_0x5356d3['timezone']&&(_0x20935c[_0x5216f3(0x18d)]=_0x5356d3[_0x5216f3(0x18d)],_0x2e6b81=!![]);_0x2e6b81&&(_0x32f3a7[_0x5216f3(0x194)]=_0x20935c);(_0x5356d3['notifyOn']&&_0x5356d3[_0x5216f3(0x1bd)][_0x5216f3(0x15f)]>0x0||_0x5356d3['emailRecipients']&&_0x5356d3[_0x5216f3(0x18f)]['length']>0x0)&&(_0x32f3a7[_0x5216f3(0x1e1)]={},_0x5356d3[_0x5216f3(0x1bd)]&&_0x5356d3[_0x5216f3(0x1bd)][_0x5216f3(0x15f)]>0x0&&(_0x32f3a7['notification']['notify_on']=_0x5356d3[_0x5216f3(0x1bd)]),_0x5356d3[_0x5216f3(0x18f)]&&_0x5356d3[_0x5216f3(0x18f)][_0x5216f3(0x15f)]>0x0&&(_0x32f3a7[_0x5216f3(0x1e1)][_0x5216f3(0x190)]=_0x5356d3[_0x5216f3(0x18f)][_0x5216f3(0x1bb)](_0x1e437a=>{const _0x5c30f5=_0x5216f3,_0x3547e5=_0x47c414?.[_0x5c30f5(0x16d)](_0x1e437a);return _0x3547e5??String(_0x1e437a);})));_0x5356d3[_0x5216f3(0x188)]&&Object[_0x5216f3(0x1d5)](_0x5356d3[_0x5216f3(0x188)])[_0x5216f3(0x15f)]>0x0&&(_0x32f3a7[_0x5216f3(0x196)]=normalizeConnectorConfigForYaml(_0x5356d3[_0x5216f3(0x188)]));_0x5356d3[_0x5216f3(0x17b)]&&(_0x32f3a7['activation_template_id']=_0x5356d3[_0x5216f3(0x17b)]);if(_0x5356d3[_0x5216f3(0x17e)]){const _0x1c7ff1={},_0x4bc310=_0x5356d3['syndicationBehavior'];_0x4bc310[_0x5216f3(0x1a3)]&&_0x4bc310[_0x5216f3(0x1a3)][_0x5216f3(0x15f)]>0x0&&(_0x1c7ff1[_0x5216f3(0x1a3)]=_0x4bc310[_0x5216f3(0x1a3)]['filter'](_0x1e1095=>_0x1e1095&&_0x1e1095[_0x5216f3(0x1bc)])[_0x5216f3(0x1bb)](_0x1c9276=>({'name':_0x1c9276[_0x5216f3(0x1bc)],..._0x1c9276[_0x5216f3(0x18b)]&&{'type':_0x1c9276[_0x5216f3(0x18b)]},..._0x1c9276[_0x5216f3(0x19f)]&&{'visibility':_0x1c9276[_0x5216f3(0x19f)]}}))),_0x4bc310[_0x5216f3(0x1dc)]&&(_0x1c7ff1['behavior_table']=_0x4bc310[_0x5216f3(0x1dc)]),_0x4bc310[_0x5216f3(0x1ef)]!==undefined&&(_0x1c7ff1[_0x5216f3(0x1b0)]=_0x4bc310[_0x5216f3(0x1ef)]),_0x4bc310[_0x5216f3(0x176)]&&(_0x1c7ff1[_0x5216f3(0x1ba)]=_0x4bc310[_0x5216f3(0x176)]),_0x4bc310[_0x5216f3(0x1d9)]&&(_0x1c7ff1['formatting']=_0x4bc310[_0x5216f3(0x1d9)]),_0x4bc310['orderBy']&&_0x4bc310['orderBy']['length']>0x0&&(_0x1c7ff1['order_by']=_0x4bc310[_0x5216f3(0x1a0)]),Object[_0x5216f3(0x1d5)](_0x1c7ff1)[_0x5216f3(0x15f)]>0x0&&(_0x32f3a7[_0x5216f3(0x1e5)]=_0x1c7ff1);}return _0x32f3a7;}export function segmentWithActivationsToYaml(_0x478cbc,_0x1ef867,_0x30e64a,_0xd80ed1,_0x5a26d9){const _0x235d29=a118_0x3538a0,_0x4d5b83=segmentResponseToDefSync(_0x478cbc,_0x30e64a);return _0x1ef867[_0x235d29(0x15f)]>0x0&&(_0x4d5b83[_0x235d29(0x1a7)]=_0x1ef867[_0x235d29(0x1bb)](_0x4ce4b5=>activationResponseToDef(_0x4ce4b5,_0xd80ed1,_0x5a26d9))),_0x4d5b83;}function normalizeColumn(_0x458744){const _0x560c93=a118_0x3538a0;if(typeof _0x458744===_0x560c93(0x164))return{'name':_0x458744};return{'name':_0x458744['name'],..._0x458744[_0x560c93(0x18b)]&&{'type':_0x458744['type']},..._0x458744[_0x560c93(0x19f)]&&{'visibility':_0x458744[_0x560c93(0x19f)]}};}export async function activationDefToCreateRequest(_0x4e545e,_0xee7e5e){const _0x4f085f=a118_0x3538a0,_0x4f4c95=_0xee7e5e?.['emailToIdMap'],_0x4bd9de=_0xee7e5e?.[_0x4f085f(0x175)],_0x25741a=_0x4e545e[_0x4f085f(0x1d3)];let _0x156230;const _0x14f767=parseInt(_0x25741a,0xa);if(!isNaN(_0x14f767)&&String(_0x14f767)===_0x25741a)_0x156230=_0x14f767;else{const _0x3cec70=_0x4bd9de?.[_0x4f085f(0x16d)](_0x25741a);if(_0x3cec70===undefined)throw new SDKError(ErrorCode[_0x4f085f(0x1ee)],_0x4f085f(0x1e3)+_0x25741a,undefined,{'helpText':_0x4f085f(0x1f0)});_0x156230=_0x3cec70;}const _0x220b6d={'name':_0x4e545e['name'],'connectionId':_0x156230};_0x4e545e[_0x4f085f(0x1e6)]&&(_0x220b6d['description']=_0x4e545e[_0x4f085f(0x1e6)]);let _0x3f0877=[];_0x4e545e[_0x4f085f(0x1a3)]&&_0x4e545e[_0x4f085f(0x1a3)][_0x4f085f(0x15f)]>0x0&&(_0x3f0877=_0x4e545e[_0x4f085f(0x1a3)][_0x4f085f(0x182)](_0x476823=>_0x476823!=null)['map'](normalizeColumn));_0x3f0877[_0x4f085f(0x15f)]>0x0&&(_0x220b6d[_0x4f085f(0x1a3)]=_0x3f0877);_0x4e545e[_0x4f085f(0x1af)]!==undefined&&(_0x4e545e['all_columns']===![]&&_0x3f0877['length']===0x0?_0x220b6d[_0x4f085f(0x1c9)]=!![]:_0x220b6d[_0x4f085f(0x1c9)]=_0x4e545e[_0x4f085f(0x1af)]);if(_0x4e545e[_0x4f085f(0x194)]){const _0x2bcd54=_0x4e545e[_0x4f085f(0x194)];_0x2bcd54[_0x4f085f(0x18b)]&&(_0x220b6d['scheduleType']=_0x2bcd54['type']),_0x2bcd54[_0x4f085f(0x1d4)]&&(_0x220b6d[_0x4f085f(0x1c0)]=_0x2bcd54[_0x4f085f(0x1d4)]),_0x2bcd54[_0x4f085f(0x1f6)]!==undefined&&(_0x220b6d[_0x4f085f(0x1ad)]=_0x2bcd54[_0x4f085f(0x1f6)]),_0x2bcd54['repeat_sub_frequency']&&(_0x220b6d[_0x4f085f(0x1fa)]=_0x2bcd54['repeat_sub_frequency']),_0x2bcd54['start_at']!==undefined&&(_0x220b6d[_0x4f085f(0x1cd)]=_0x2bcd54['start_at']),_0x2bcd54[_0x4f085f(0x16f)]!==undefined&&(_0x220b6d[_0x4f085f(0x1aa)]=_0x2bcd54[_0x4f085f(0x16f)]),_0x2bcd54['timezone']&&(_0x220b6d['timezone']=_0x2bcd54[_0x4f085f(0x18d)]);}_0x4e545e[_0x4f085f(0x1e1)]&&(_0x4e545e['notification'][_0x4f085f(0x1d1)]&&(_0x220b6d['notifyOn']=_0x4e545e[_0x4f085f(0x1e1)]['notify_on']),_0x4e545e[_0x4f085f(0x1e1)][_0x4f085f(0x190)]&&(_0x220b6d[_0x4f085f(0x18f)]=_0x4e545e[_0x4f085f(0x1e1)][_0x4f085f(0x190)][_0x4f085f(0x1bb)](_0x1e35cb=>{const _0xb3dd49=_0x4f085f,_0x401f86=Number(_0x1e35cb);if(!isNaN(_0x401f86)&&String(_0x401f86)===_0x1e35cb)return _0x401f86;const _0x35a166=_0x4f4c95?.['get'](_0x1e35cb[_0xb3dd49(0x1b5)]());if(_0x35a166===undefined)throw new SDKError(ErrorCode[_0xb3dd49(0x1f5)],_0xb3dd49(0x183)+_0x1e35cb+_0xb3dd49(0x16c));return _0x35a166;})));if(_0x4e545e['connector_config']){const _0x5dbc52=_0xee7e5e?.[_0x4f085f(0x16b)]?.[_0x4f085f(0x16d)](_0x25741a);if(_0x5dbc52&&_0xee7e5e?.['getSchema'])try{const _0x3e565e=await _0xee7e5e[_0x4f085f(0x186)](_0x5dbc52),_0x56cd81=validateConnectorConfig(_0x4e545e[_0x4f085f(0x196)],_0x3e565e);if(!_0x56cd81['valid'])throw new SDKError(ErrorCode[_0x4f085f(0x1c5)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x4e545e[_0x4f085f(0x1bc)]+_0x4f085f(0x1bf)+formatValidationErrors(_0x56cd81[_0x4f085f(0x1ed)]),undefined,{'helpText':_0x4f085f(0x1c1)+_0x5dbc52+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x3e565e)});if(_0x56cd81[_0x4f085f(0x1a2)][_0x4f085f(0x15f)]>0x0){const _0xeeecd0=formatValidationWarnings(_0x56cd81['warnings']);console[_0x4f085f(0x1ab)](_0x4f085f(0x1e7)+_0x4e545e[_0x4f085f(0x1bc)]+_0x4f085f(0x1bf)+_0xeeecd0);}_0x220b6d[_0x4f085f(0x188)]=transformConfigToLegacy(_0x4e545e[_0x4f085f(0x196)],_0x3e565e);}catch(_0x518a06){if(_0x518a06 instanceof SDKError&&_0x518a06[_0x4f085f(0x170)]===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x220b6d['connectorConfig']=_0x4e545e[_0x4f085f(0x196)];else throw _0x518a06;}else _0x220b6d[_0x4f085f(0x188)]=_0x4e545e[_0x4f085f(0x196)];}_0x4e545e[_0x4f085f(0x1b8)]!==undefined&&(_0x220b6d[_0x4f085f(0x17b)]=_0x4e545e[_0x4f085f(0x1b8)]);if(_0x4e545e['behavior']){const _0x470644=_0x4e545e[_0x4f085f(0x1e5)],_0x4f3382={};if(_0x470644[_0x4f085f(0x1a3)]&&_0x470644[_0x4f085f(0x1a3)][_0x4f085f(0x15f)]>0x0){const _0x196ca0=_0x470644[_0x4f085f(0x1a3)][_0x4f085f(0x182)](_0x1148ce=>_0x1148ce&&_0x1148ce['name']);_0x196ca0[_0x4f085f(0x15f)]>0x0&&(_0x4f3382[_0x4f085f(0x1a3)]=_0x196ca0);}_0x470644[_0x4f085f(0x1ac)]&&(_0x4f3382[_0x4f085f(0x1dc)]=_0x470644[_0x4f085f(0x1ac)]),_0x470644[_0x4f085f(0x1b0)]!==undefined&&(_0x4f3382[_0x4f085f(0x1ef)]=_0x470644[_0x4f085f(0x1b0)]),_0x470644['join_strategy']&&(_0x4f3382[_0x4f085f(0x176)]=_0x470644['join_strategy']),_0x470644[_0x4f085f(0x1d9)]&&(_0x4f3382[_0x4f085f(0x1d9)]=_0x470644['formatting']),_0x470644[_0x4f085f(0x179)]&&(_0x4f3382['orderBy']=_0x470644['order_by']),_0x220b6d[_0x4f085f(0x17e)]=_0x4f3382;}return _0x220b6d;}export async function activationDefToUpdateRequest(_0x2e1efc,_0x37a179){return activationDefToCreateRequest(_0x2e1efc,_0x37a179);}export function deepSortObject(_0x4bd467){const _0x1f7140=a118_0x3538a0;if(_0x4bd467===null||typeof _0x4bd467!==_0x1f7140(0x1c6))return _0x4bd467;if(Array[_0x1f7140(0x1b7)](_0x4bd467))return _0x4bd467[_0x1f7140(0x1bb)](deepSortObject)[_0x1f7140(0x1e9)]((_0x3c42ee,_0x2361e1)=>JSON[_0x1f7140(0x18a)](_0x3c42ee)[_0x1f7140(0x189)](JSON['stringify'](_0x2361e1)));const _0x338aa4={};for(const _0x44d089 of Object[_0x1f7140(0x1d5)](_0x4bd467)[_0x1f7140(0x1e9)]()){_0x338aa4[_0x44d089]=deepSortObject(_0x4bd467[_0x44d089]);}return _0x338aa4;}export function serializeRule(_0x1043fb){return JSON['stringify'](deepSortObject(_0x1043fb));}export function normalizeRuleForMatching(_0x2970b0){return normalizeConditionsForMatching(_0x2970b0);}function normalizeConditionsForMatching(_0x25a155){const _0x1226b9=a118_0x3538a0;if(_0x25a155===null||typeof _0x25a155!=='object')return _0x25a155;if(Array[_0x1226b9(0x1b7)](_0x25a155))return _0x25a155[_0x1226b9(0x1bb)](normalizeConditionsForMatching);const _0x299a5d=_0x25a155;if((_0x299a5d[_0x1226b9(0x18b)]==='include'||_0x299a5d[_0x1226b9(0x18b)]===_0x1226b9(0x18e))&&typeof _0x299a5d[_0x1226b9(0x193)]==='string')return{..._0x299a5d,'segment':_0x1226b9(0x1d2)};const _0x3e54b9={};for(const _0x441f49 of Object[_0x1226b9(0x1d5)](_0x299a5d)){_0x3e54b9[_0x441f49]=normalizeConditionsForMatching(_0x299a5d[_0x441f49]);}return _0x3e54b9;}export function serializeRuleForMatching(_0x33705d){const _0x8e7469=a118_0x3538a0;return JSON[_0x8e7469(0x18a)](deepSortObject(normalizeRuleForMatching(_0x33705d)));}export function expandSegmentReferences(_0x3932ce,_0x2fe5b9,_0x559111=new Set()){return expandConditions(_0x3932ce,_0x2fe5b9,_0x559111);}function expandConditions(_0x8587f0,_0x215249,_0x4381d4){const _0x3ed091=a118_0x3538a0;if(_0x8587f0===null||typeof _0x8587f0!==_0x3ed091(0x1c6))return _0x8587f0;if(Array['isArray'](_0x8587f0))return _0x8587f0[_0x3ed091(0x1bb)](_0x455f7b=>expandConditions(_0x455f7b,_0x215249,_0x4381d4));const _0x49bbdf=_0x8587f0;if((_0x49bbdf[_0x3ed091(0x18b)]===_0x3ed091(0x1e8)||_0x49bbdf[_0x3ed091(0x18b)]==='exclude')&&typeof _0x49bbdf[_0x3ed091(0x193)]===_0x3ed091(0x164)){const _0x139a52=_0x49bbdf[_0x3ed091(0x193)],_0x3b75be=_0x215249[_0x3ed091(0x16d)](_0x139a52);if(_0x3b75be&&!_0x4381d4[_0x3ed091(0x187)](_0x139a52)){const _0xc773f0=new Set(_0x4381d4);_0xc773f0[_0x3ed091(0x162)](_0x139a52);const _0x86d8f2=expandConditions(_0x3b75be,_0x215249,_0xc773f0);return{'type':_0x49bbdf[_0x3ed091(0x18b)],'expanded_rule':_0x86d8f2};}return{'type':_0x49bbdf['type'],'expanded_rule':_0x3ed091(0x1cb)};}const _0x3e3482={};for(const _0x2badfb of Object['keys'](_0x49bbdf)){_0x3e3482[_0x2badfb]=expandConditions(_0x49bbdf[_0x2badfb],_0x215249,_0x4381d4);}return _0x3e3482;}export function serializeExpandedRule(_0x352ea5,_0x218f09){const _0x43d5a4=expandSegmentReferences(_0x352ea5,_0x218f09);return JSON['stringify'](deepSortObject(_0x43d5a4));}export function createSegmentNameContext(_0x2c84d1){const _0x30cbe1=a118_0x3538a0,_0x142a09=new Set(),_0x460568=new Map(),_0x45b5a3=new Map();if(_0x2c84d1)for(const [_0x2cde9a,_0xd6aaa8]of Object[_0x30cbe1(0x17a)](_0x2c84d1)){if(_0xd6aaa8[_0x30cbe1(0x19b)]){const _0x1e4ee2=serializeRule(_0xd6aaa8['rule']);_0x45b5a3[_0x30cbe1(0x1c7)](_0x1e4ee2,_0x2cde9a),_0x142a09['add'](_0x2cde9a);}}return{'usedNames':_0x142a09,'ruleHashToName':_0x460568,'localRuleToName':_0x2c84d1?_0x45b5a3:undefined};}export function resolveSegmentName(_0x231633,_0x4e22f7,_0x463bcd,_0x4ec94e){const _0x324aed=a118_0x3538a0,_0x35970f=serializeRule(_0x4e22f7);if(_0x463bcd[_0x324aed(0x1a6)]){const _0x57c9cb=_0x463bcd[_0x324aed(0x1a6)][_0x324aed(0x16d)](_0x35970f);if(_0x57c9cb)return{'name':_0x57c9cb,'isDuplicate':![],'isLocalMatch':!![]};}const _0x2b457b=_0x463bcd[_0x324aed(0x1e2)]['get'](_0x35970f);if(_0x2b457b)return{'name':_0x2b457b,'isDuplicate':!![],'isLocalMatch':![]};const _0x209282=_0x4ec94e(_0x231633);let _0x3f0728=_0x209282||_0x231633,_0x5c85c6=_0x3f0728,_0x27e3d9=0x2;while(_0x463bcd['usedNames'][_0x324aed(0x187)](_0x5c85c6)){_0x5c85c6=_0x3f0728+'_'+_0x27e3d9,_0x27e3d9++;}return _0x463bcd[_0x324aed(0x1b4)]['add'](_0x5c85c6),_0x463bcd[_0x324aed(0x1e2)][_0x324aed(0x1c7)](_0x35970f,_0x5c85c6),{'name':_0x5c85c6,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x4b1113){const _0x2edc3a=[],_0x308093=_0x400089=>{const _0x34bb71=a118_0x40da;if(!_0x400089||typeof _0x400089!=='object')return;if(Array[_0x34bb71(0x1b7)](_0x400089)){_0x400089[_0x34bb71(0x17f)](_0x308093);return;}const _0x414e88=_0x400089;(_0x414e88[_0x34bb71(0x18b)]===_0x34bb71(0x1e8)||_0x414e88[_0x34bb71(0x18b)]===_0x34bb71(0x18e))&&typeof _0x414e88['segment']===_0x34bb71(0x164)&&_0x2edc3a[_0x34bb71(0x15c)](_0x414e88[_0x34bb71(0x193)]);for(const _0x3471ed of Object[_0x34bb71(0x1dd)](_0x414e88)){_0x308093(_0x3471ed);}};return _0x308093(_0x4b1113),_0x2edc3a;}export function validateSegmentRule(_0x17a646,_0x55a76e){const _0x696c7d=a118_0x3538a0;if(!_0x55a76e||!_0x55a76e['conditions'])return;for(let _0x1e2922=0x0;_0x1e2922<_0x55a76e['conditions']['length'];_0x1e2922++){const _0x19e2b4=_0x55a76e['conditions'][_0x1e2922];if(_0x696c7d(0x18b)in _0x19e2b4&&_0x19e2b4[_0x696c7d(0x18b)]==='Value'){const _0x3b5a00=_0x19e2b4,_0xc3cb05=_0x3b5a00['source']||_0x3b5a00[_0x696c7d(0x192)];if((!_0x3b5a00['attribute']||_0x3b5a00[_0x696c7d(0x1c3)]==='')&&!_0xc3cb05)throw new SDKError(ErrorCode[_0x696c7d(0x1ec)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x17a646+'\x27:\x20'+(_0x696c7d(0x1a4)+_0x1e2922+_0x696c7d(0x17c))+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
|
|
1
|
+
function a118_0x592a(){const _0x1da5d2=['schedule','push','add','joinRow','columns','__UNRESOLVED__','attributes','max','map','INVALID_ARGUMENT','].attribute\x20cannot\x20be\x20empty.\x0a','\x27:\x20','activation_template_id','operator','leftValue','connectionNameToIdMap','replace','repeat_unit','run_after_journey_refresh','visible','usedNames','Unknown\x20email\x20recipient:\x20','activationTemplateId','orderBy','isArray','Reference','ruleHashToName','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Column','First','end_on','TimeWithinNext','Segment\x20description','3011725QLjuzS','__SEGMENT_REF__','Between','formatting','behaviorTableName','realtime','Last','get','109710oexlXl','all_columns','notification','string','value','rule:','repeatSubFrequency','limit','rightValues','136fYqQae','connectorConfig','parse','runAfterJourneyRefresh','filter','errors','Behavior','order_by','segment','column','from','not','localeCompare','And','groupingColumns','stringify','isFinite','attribute','minValue','startAt','any','kind','repeat_sub_frequency','213043PftSfu','join_row','connection','email_recipients','resolveSegmentName','Count','aggregation','join_strategy','endOn','timezone','set','connectionId','reverse','name','activations:','values','repeatFrequency','duration','behavior','behavior_table','notifyOn','start_at','allColumns','conditions','TimeRange','localRuleToName','CONNECTOR_SCHEMA_NOT_FOUND','JOURNEY_SYNTAX_ERROR','repeat_frequency','rule','keys','Value','notify_on','attribute_name','syndicationBehavior','object','Connector:\x20','connector_config','rightValue','getSchema','type','min','toLowerCase','all','\x0a\x0aAvailable\x20fields:\x0a','segmentFolderId','1263620pyekAE','exclude','3fgFFXY','orderColumn','folder','test','arrayMatching','code','null','valid','activations','length','1021762jNmgtx','unit','2230620NYnmuD','repeatUnit','joinStrategy','description','connectionNameToTypeMap','emailRecipients','include','source','scheduleType','entries','maxValue','\x22:\x0a','CountDistinct','1158400VjTyDr','sort','batch','visibility','every','CONNECTION_NOT_FOUND','isVisible','activationParams'];a118_0x592a=function(){return _0x1da5d2;};return a118_0x592a();}(function(_0x815024,_0x545985){const _0x30cf55=a118_0xe18e,_0x47ba22=_0x815024();while(!![]){try{const _0x334ded=parseInt(_0x30cf55(0xf0))/0x1+parseInt(_0x30cf55(0x139))/0x2+-parseInt(_0x30cf55(0x120))/0x3*(parseInt(_0x30cf55(0x11e))/0x4)+parseInt(_0x30cf55(0x162))/0x5+-parseInt(_0x30cf55(0x12c))/0x6+-parseInt(_0x30cf55(0x12a))/0x7+-parseInt(_0x30cf55(0x173))/0x8*(parseInt(_0x30cf55(0x16a))/0x9);if(_0x334ded===_0x545985)break;else _0x47ba22['push'](_0x47ba22['shift']());}catch(_0x35743e){_0x47ba22['push'](_0x47ba22['shift']());}}}(a118_0x592a,0x565b5));import*as a118_0x5ccc9d 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(_0x20695e){return _0x20695e;}function ruleDefAsFilterRule(_0x3120e1){return _0x3120e1;}export function segmentResponseToDefSync(_0x51c2f4,_0x253b58){const _0x1af8f7=a118_0xe18e,_0x1d2d9c=_0x51c2f4[_0x1af8f7(0x10d)]&&_0x1af8f7(0x118)in _0x51c2f4[_0x1af8f7(0x10d)]&&_0x51c2f4['rule'][_0x1af8f7(0x118)];return{'type':_0x1af8f7(0x17b),'name':_0x51c2f4['name'],..._0x51c2f4[_0x1af8f7(0x12f)]&&{'description':_0x51c2f4[_0x1af8f7(0x12f)]},..._0x253b58&&{'folder':_0x253b58},..._0x1d2d9c&&{'rule':apiRuleToYaml(_0x51c2f4[_0x1af8f7(0x10d)])},..._0x51c2f4['kind']!==undefined&&{'kind':_0x51c2f4[_0x1af8f7(0xee)]===0x0?_0x1af8f7(0x13b):_0x51c2f4['kind']===0x1?_0x1af8f7(0x167):'funnel_stage'},..._0x51c2f4[_0x1af8f7(0x13f)]!==undefined&&{'visible':_0x51c2f4[_0x1af8f7(0x13f)]}};}export async function segmentResponseToDef(_0x4dba2d,_0xf58a6b,_0x21e456){const _0x528c0a=a118_0xe18e,_0x302a6a=segmentResponseToDefSync(_0x4dba2d,_0x21e456);if(!_0xf58a6b||!_0xf58a6b[_0x528c0a(0xf4)])return _0x302a6a;return _0x302a6a['rule']&&(_0x302a6a['rule']=await resolveRuleSegmentRefs(_0x302a6a['rule'],_0xf58a6b['resolveSegmentName'])),_0x302a6a;}export function apiRuleToYaml(_0x218f77){const _0x58f9e2=a118_0xe18e,_0x3a142e=(_0x218f77[_0x58f9e2(0x107)]||[])[_0x58f9e2(0x149)](apiConditionToYaml);if(_0x3a142e['length']===0x1&&!_0x218f77[_0x58f9e2(0x12f)]&&_0x58f9e2(0x118)in _0x3a142e[0x0]&&(_0x3a142e[0x0]['type']===_0x58f9e2(0x180)||_0x3a142e[0x0][_0x58f9e2(0x118)]==='Or')){const _0x3ae436=_0x3a142e[0x0];if(_0x3ae436[_0x58f9e2(0x118)]===_0x218f77['type']&&_0x3ae436['conditions'])return{'type':_0x218f77['type'],'conditions':_0x3ae436[_0x58f9e2(0x107)],..._0x3ae436[_0x58f9e2(0x12f)]&&{'description':_0x3ae436['description']}};}return{'type':_0x218f77[_0x58f9e2(0x118)],'conditions':_0x3a142e,..._0x218f77[_0x58f9e2(0x12f)]&&{'description':_0x218f77['description']}};}export async function resolveRuleSegmentRefs(_0x23bec1,_0x195f09){const _0x4d6d93=a118_0xe18e;return transformRuleSegmentRefs(_0x23bec1,_0x195f09,_0x152f4d=>/^\d+$/[_0x4d6d93(0x123)](_0x152f4d));}async function transformConditionSegmentRefs(_0x104e30,_0x23751c,_0x1b7a5d,_0x4a1f9f){const _0x22e7b7=a118_0xe18e;if(_0x22e7b7(0x17b)in _0x104e30&&(_0x104e30['type']==='include'||_0x104e30[_0x22e7b7(0x118)]===_0x22e7b7(0x11f))){const _0x392190=_0x104e30;if(_0x1b7a5d(_0x392190[_0x22e7b7(0x17b)]))return{..._0x392190,'segment':await _0x23751c(_0x392190[_0x22e7b7(0x17b)])};return _0x104e30;}if(_0x22e7b7(0x107)in _0x104e30&&_0x104e30['conditions']){const _0x20d878=_0x104e30,_0x428d39=await Promise[_0x22e7b7(0x11b)](_0x20d878['conditions'][_0x22e7b7(0x149)](_0x3a1026=>transformConditionSegmentRefs(_0x3a1026,_0x23751c,_0x1b7a5d,_0x4a1f9f)));return{..._0x20d878,'conditions':_0x428d39};}if(_0x22e7b7(0x177)in _0x104e30&&_0x104e30[_0x22e7b7(0x177)]){const _0x1b6d4a=_0x104e30,_0x627cb0=await _0x4a1f9f(filterRuleAsRuleDef(_0x1b6d4a[_0x22e7b7(0x177)]),_0x23751c);return{..._0x1b6d4a,'filter':ruleDefAsFilterRule(_0x627cb0)};}return _0x104e30;}async function transformRuleSegmentRefs(_0x29ef58,_0x13bf40,_0x4cd1bb){const _0x5f5057=a118_0xe18e,_0x3438e5=(_0x1a6bfa,_0x1d3c99)=>transformRuleSegmentRefs(_0x1a6bfa,_0x1d3c99,_0x4cd1bb),_0x3efed1=await Promise[_0x5f5057(0x11b)](_0x29ef58[_0x5f5057(0x107)]['map'](_0x25e060=>transformConditionSegmentRefs(_0x25e060,_0x13bf40,_0x4cd1bb,_0x3438e5)));return{..._0x29ef58,'conditions':_0x3efed1};}export async function resolveRuleSegmentIds(_0x3a8ea2,_0x407157){const _0x206c27=a118_0xe18e;return transformRuleSegmentRefs(_0x3a8ea2,_0x407157,_0xcc264b=>!/^\d+$/[_0x206c27(0x123)](_0xcc264b));}function isBehaviorApiCondition(_0x5707f2){const _0x46cda8=a118_0xe18e;if(!_0x5707f2[_0x46cda8(0x14f)]?.[_0x46cda8(0x133)]?.['name'])return![];return!![];}function apiConditionToYaml(_0x58ef25){const _0x4e9a5e=a118_0xe18e;if(_0x58ef25[_0x4e9a5e(0x118)]===_0x4e9a5e(0x180)||_0x58ef25[_0x4e9a5e(0x118)]==='Or'){if(_0x58ef25[_0x4e9a5e(0x107)]){const _0x48c10d=_0x58ef25[_0x4e9a5e(0x107)][_0x4e9a5e(0x149)](apiConditionToYaml);if(_0x48c10d[_0x4e9a5e(0x129)]===0x1&&!_0x58ef25[_0x4e9a5e(0x12f)])return _0x48c10d[0x0];return{'type':_0x58ef25[_0x4e9a5e(0x118)],'conditions':_0x48c10d,..._0x58ef25[_0x4e9a5e(0x12f)]&&{'description':_0x58ef25[_0x4e9a5e(0x12f)]}};}}if(_0x58ef25[_0x4e9a5e(0x118)]===_0x4e9a5e(0x10f)&&_0x58ef25[_0x4e9a5e(0x14f)]&&_0x58ef25[_0x4e9a5e(0x14e)]){const _0x36cb17=_0x58ef25[_0x4e9a5e(0x14f)][_0x4e9a5e(0xf6)]?buildAggregationDefFromApi(_0x58ef25[_0x4e9a5e(0x14f)][_0x4e9a5e(0xf6)]):undefined;if(isBehaviorApiCondition(_0x58ef25)){const _0x2f327c=_0x58ef25[_0x4e9a5e(0x14f)]['source']['name'];return{'type':_0x4e9a5e(0x179),'attribute':_0x2f327c,'operator':apiOperatorToYaml(_0x58ef25['operator']),..._0x58ef25['arrayMatching']&&_0x58ef25[_0x4e9a5e(0x124)]!==_0x4e9a5e(0xed)?{'arrayMatching':_0x58ef25[_0x4e9a5e(0x124)]}:{},..._0x58ef25['exclude']?{'exclude':_0x58ef25['exclude']}:{},..._0x36cb17?{'aggregation':_0x36cb17}:{},'source':_0x2f327c,..._0x58ef25['leftValue']['filter']?{'filter':apiRuleToYaml(_0x58ef25['leftValue'][_0x4e9a5e(0x177)])}:{},..._0x58ef25[_0x4e9a5e(0x171)]!==undefined&&_0x58ef25[_0x4e9a5e(0x171)]!==null?{'limit':_0x58ef25[_0x4e9a5e(0x171)]}:{}};}return{'type':_0x4e9a5e(0x10f),'attribute':_0x58ef25[_0x4e9a5e(0x14f)]['name']||'','operator':apiOperatorToYaml(_0x58ef25['operator']),..._0x58ef25[_0x4e9a5e(0x124)]&&_0x58ef25[_0x4e9a5e(0x124)]!==_0x4e9a5e(0xed)?{'arrayMatching':_0x58ef25[_0x4e9a5e(0x124)]}:{},..._0x58ef25[_0x4e9a5e(0x11f)]?{'exclude':_0x58ef25[_0x4e9a5e(0x11f)]}:{},..._0x36cb17?{'aggregation':_0x36cb17}:{},..._0x58ef25['leftValue'][_0x4e9a5e(0x177)]?{'filter':apiRuleToYaml(_0x58ef25[_0x4e9a5e(0x14f)][_0x4e9a5e(0x177)])}:{},..._0x58ef25[_0x4e9a5e(0x171)]!==undefined&&_0x58ef25[_0x4e9a5e(0x171)]!==null?{'limit':_0x58ef25[_0x4e9a5e(0x171)]}:{}};}if(_0x58ef25['type']==='Column'&&_0x58ef25[_0x4e9a5e(0x17c)]&&_0x58ef25[_0x4e9a5e(0x14e)])return{'type':'Column','column':_0x58ef25[_0x4e9a5e(0x17c)],'operator':apiOperatorToYaml(_0x58ef25[_0x4e9a5e(0x14e)])};if(_0x58ef25[_0x4e9a5e(0x118)]===_0x4e9a5e(0x15a)&&_0x58ef25['id'])return{'type':_0x58ef25[_0x4e9a5e(0x11f)]?_0x4e9a5e(0x11f):'include','segment':_0x58ef25['id']};return{'type':_0x4e9a5e(0x180),'conditions':[]};}function isTemporalOperator(_0xf1dc5b){const _0x134cc6=a118_0xe18e;return _0xf1dc5b==='TimeWithinPast'||_0xf1dc5b===_0x134cc6(0x160);}function isBetweenOperator(_0x3aaea3){const _0x47b866=a118_0xe18e;return _0x3aaea3===_0x47b866(0x164);}function getEffectiveValue(_0x3e2874){const _0x391ef1=a118_0xe18e,_0x3dba8b=_0x3e2874[_0x391ef1(0xff)];return _0x3e2874[_0x391ef1(0x16e)]??_0x3dba8b;}function parseNumericValue(_0x17d7d2){const _0x1725e2=a118_0xe18e;if(typeof _0x17d7d2===_0x1725e2(0x113)&&_0x17d7d2!==null)return _0x17d7d2;if(_0x17d7d2==='')return _0x17d7d2;const _0xfe20c0=Number(_0x17d7d2);return Number[_0x1725e2(0xe9)](_0xfe20c0)?_0xfe20c0:_0x17d7d2;}function apiOperatorToYaml(_0x5924f2){const _0x329231=a118_0xe18e;if(isBetweenOperator(_0x5924f2[_0x329231(0x118)]))return{'type':mapApiOperatorType(_0x5924f2[_0x329231(0x118)]),..._0x5924f2[_0x329231(0x17e)]!==undefined&&{'not':_0x5924f2['not']},..._0x5924f2['minValue']!==undefined&&{'min':parseNumericValue(_0x5924f2[_0x329231(0xeb)])},..._0x5924f2[_0x329231(0x136)]!==undefined&&{'max':parseNumericValue(_0x5924f2[_0x329231(0x136)])}};if(_0x5924f2['type']===_0x329231(0x108))return{'type':_0x329231(0x108),..._0x5924f2['not']!==undefined&&{'not':_0x5924f2[_0x329231(0x17e)]},..._0x5924f2[_0x329231(0x101)]!==undefined&&{'duration':_0x5924f2[_0x329231(0x101)]},..._0x5924f2[_0x329231(0x17d)]!==undefined&&{'from':_0x5924f2[_0x329231(0x17d)]},..._0x5924f2[_0x329231(0xfc)]!==undefined&&{'reverse':_0x5924f2[_0x329231(0xfc)]}};let _0x18853a;if(_0x5924f2[_0x329231(0x172)]&&_0x5924f2[_0x329231(0x172)]['length']>0x0)_0x18853a=_0x5924f2[_0x329231(0x172)];else{if(_0x5924f2[_0x329231(0x116)]!==undefined)_0x18853a=_0x5924f2[_0x329231(0x116)];else isTemporalOperator(_0x5924f2[_0x329231(0x118)])&&_0x5924f2[_0x329231(0x16e)]!==undefined&&(_0x18853a=_0x5924f2[_0x329231(0x16e)]);}return{'type':mapApiOperatorType(_0x5924f2['type']),..._0x5924f2[_0x329231(0x17e)]!==undefined&&{'not':_0x5924f2[_0x329231(0x17e)]},..._0x18853a!==undefined&&{'value':_0x18853a},..._0x5924f2[_0x329231(0x12b)]!==undefined&&{'unit':_0x5924f2[_0x329231(0x12b)]}};}function mapApiOperatorType(_0x43f239){return _0x43f239;}export function segmentDefToCreateRequest(_0x50cc16,_0x27e4e7){const _0x1320e6=a118_0xe18e,_0x3a123a={'name':_0x50cc16[_0x1320e6(0xfd)]};return _0x50cc16[_0x1320e6(0x12f)]&&(_0x3a123a['description']=_0x50cc16[_0x1320e6(0x12f)]),_0x50cc16[_0x1320e6(0x10d)]&&(_0x3a123a[_0x1320e6(0x10d)]=yamlRuleToApi(_0x50cc16[_0x1320e6(0x10d)])),_0x50cc16[_0x1320e6(0xee)]&&(_0x3a123a[_0x1320e6(0xee)]=_0x50cc16[_0x1320e6(0xee)]===_0x1320e6(0x13b)?0x0:_0x50cc16['kind']===_0x1320e6(0x167)?0x1:0x2),_0x50cc16['visible']!==undefined&&(_0x3a123a[_0x1320e6(0x13f)]=_0x50cc16[_0x1320e6(0x154)]),_0x27e4e7&&(_0x3a123a[_0x1320e6(0x11d)]=_0x27e4e7),_0x3a123a;}export function segmentDefToUpdateRequest(_0x1dc510){const _0x216c92=a118_0xe18e,_0x4a6bf6={'name':_0x1dc510[_0x216c92(0xfd)]};return _0x1dc510[_0x216c92(0x12f)]!==undefined&&(_0x4a6bf6[_0x216c92(0x12f)]=_0x1dc510[_0x216c92(0x12f)]),_0x1dc510[_0x216c92(0x10d)]&&(_0x4a6bf6['rule']=yamlRuleToApi(_0x1dc510[_0x216c92(0x10d)])),_0x1dc510[_0x216c92(0xee)]&&(_0x4a6bf6[_0x216c92(0xee)]=_0x1dc510['kind']==='batch'?0x0:_0x1dc510[_0x216c92(0xee)]==='realtime'?0x1:0x2),_0x4a6bf6;}export function yamlRuleToApi(_0x58fe1b,_0x579558=![]){const _0x4de27c=a118_0xe18e,_0x16c96d=_0x58fe1b[_0x4de27c(0x107)][_0x4de27c(0x149)](yamlConditionToApi);if(_0x579558){const _0x24397b=_0x16c96d[_0x4de27c(0x13d)](_0x2f4bcb=>_0x2f4bcb['type']===_0x4de27c(0x180)||_0x2f4bcb['type']==='Or');if(!_0x24397b&&_0x16c96d['length']>0x0)return{'type':_0x58fe1b[_0x4de27c(0x118)],'conditions':[{'type':'And','description':_0x58fe1b[_0x4de27c(0x12f)]||'','conditions':_0x16c96d}]};}return{'type':_0x58fe1b[_0x4de27c(0x118)],'conditions':_0x16c96d,..._0x58fe1b['description']&&{'description':_0x58fe1b[_0x4de27c(0x12f)]}};}function yamlConditionToApi(_0x2a8168){const _0x5a343c=a118_0xe18e;if(_0x5a343c(0x17b)in _0x2a8168&&(_0x2a8168[_0x5a343c(0x118)]==='include'||_0x2a8168[_0x5a343c(0x118)]===_0x5a343c(0x11f))){const _0x5cec47=_0x2a8168;return{'type':_0x5a343c(0x15a),'id':_0x5cec47[_0x5a343c(0x17b)],'exclude':_0x5cec47[_0x5a343c(0x118)]===_0x5a343c(0x11f)};}if('type'in _0x2a8168&&(_0x2a8168['type']===_0x5a343c(0x180)||_0x2a8168[_0x5a343c(0x118)]==='Or')){const _0x71403a=_0x2a8168;return{'type':_0x71403a[_0x5a343c(0x118)],'conditions':_0x71403a['conditions'][_0x5a343c(0x149)](yamlConditionToApi),..._0x71403a['description']&&{'description':_0x71403a['description']}};}if(_0x5a343c(0x17c)in _0x2a8168&&_0x2a8168['type']===_0x5a343c(0x15d)){const _0xe5d624=_0x2a8168;return{'type':_0x5a343c(0x15d),'column':_0xe5d624[_0x5a343c(0x17c)],'operator':yamlOperatorToApi(_0xe5d624[_0x5a343c(0x14e)])};}const _0x2cc1f5=_0x2a8168,_0x561657={'type':_0x5a343c(0x10f),'leftValue':buildLeftValue(_0x2cc1f5),'operator':yamlOperatorToApi(_0x2cc1f5[_0x5a343c(0x14e)]),'exclude':_0x2cc1f5['exclude']??![],'arrayMatching':_0x2cc1f5[_0x5a343c(0x124)]??'any'};return _0x2cc1f5[_0x5a343c(0x171)]!==undefined&&(_0x561657['limit']=_0x2cc1f5['limit']),_0x561657;}function buildAggregationDefFromApi(_0x37bd00){const _0x1211bb=a118_0xe18e,_0x5ba29e=_0x37bd00[_0x1211bb(0x118)];if(_0x5ba29e===_0x1211bb(0x138))return{'type':_0x5ba29e,'columns':_0x37bd00['columns']??[]};if(_0x5ba29e===_0x1211bb(0x15e)||_0x5ba29e===_0x1211bb(0x168))return{'type':_0x5ba29e,'column':_0x37bd00[_0x1211bb(0x17c)]??'','orderColumn':_0x37bd00['orderColumn']??'',..._0x37bd00['groupingColumns']&&{'groupingColumns':_0x37bd00[_0x1211bb(0x181)]}};if(_0x5ba29e===_0x1211bb(0xf5))return{'type':_0x5ba29e,..._0x37bd00[_0x1211bb(0x181)]&&{'groupingColumns':_0x37bd00[_0x1211bb(0x181)]}};return{'type':_0x5ba29e,'column':_0x37bd00['column']??'',..._0x37bd00[_0x1211bb(0x181)]&&{'groupingColumns':_0x37bd00[_0x1211bb(0x181)]}};}function buildLeftValue(_0x4b8830){const _0x424abc=a118_0xe18e,_0x4c37fa={};_0x4b8830[_0x424abc(0xea)]&&(_0x4c37fa[_0x424abc(0xfd)]=_0x4b8830[_0x424abc(0xea)]);if(_0x4b8830[_0x424abc(0xf6)]){const _0x59621d=_0x4b8830['aggregation'];if(_0x59621d['type']==='CountDistinct')_0x4c37fa['aggregation']={'type':_0x424abc(0x138),'columns':_0x59621d[_0x424abc(0x145)]};else{if(_0x59621d[_0x424abc(0x118)]===_0x424abc(0x15e)||_0x59621d[_0x424abc(0x118)]==='Last')_0x4c37fa[_0x424abc(0xf6)]={'type':_0x59621d[_0x424abc(0x118)],'column':_0x59621d[_0x424abc(0x17c)],'orderColumn':_0x59621d[_0x424abc(0x121)],..._0x59621d[_0x424abc(0x181)]&&{'groupingColumns':_0x59621d[_0x424abc(0x181)]}};else _0x59621d[_0x424abc(0x118)]==='Count'?_0x4c37fa[_0x424abc(0xf6)]={'type':_0x424abc(0xf5),..._0x59621d[_0x424abc(0x181)]&&{'groupingColumns':_0x59621d[_0x424abc(0x181)]}}:_0x4c37fa['aggregation']={'type':_0x59621d[_0x424abc(0x118)],'column':_0x59621d[_0x424abc(0x17c)],..._0x59621d['groupingColumns']&&{'groupingColumns':_0x59621d[_0x424abc(0x181)]}};}}return _0x4b8830['source']&&(_0x4c37fa[_0x424abc(0x133)]={'name':_0x4b8830[_0x424abc(0x133)]}),_0x4b8830['filter']&&(_0x4c37fa[_0x424abc(0x177)]=yamlRuleToApi(filterRuleAsRuleDef(_0x4b8830[_0x424abc(0x177)]))),_0x4c37fa;}function a118_0xe18e(_0x4482ba,_0x47f613){_0x4482ba=_0x4482ba-0xe9;const _0x592a18=a118_0x592a();let _0xe18ed4=_0x592a18[_0x4482ba];return _0xe18ed4;}function yamlOperatorToApi(_0x14fe32){const _0x5cc491=a118_0xe18e,_0x2d61cb={'type':mapYamlOperatorType(_0x14fe32[_0x5cc491(0x118)]),'not':_0x14fe32['not']??![]};if(isBetweenOperator(_0x14fe32[_0x5cc491(0x118)]))return _0x14fe32[_0x5cc491(0x119)]!==undefined&&(_0x2d61cb[_0x5cc491(0xeb)]=typeof _0x14fe32[_0x5cc491(0x119)]===_0x5cc491(0x113)?_0x14fe32[_0x5cc491(0x119)]:String(_0x14fe32['min'])),_0x14fe32['max']!==undefined&&(_0x2d61cb[_0x5cc491(0x136)]=typeof _0x14fe32[_0x5cc491(0x148)]===_0x5cc491(0x113)?_0x14fe32[_0x5cc491(0x148)]:String(_0x14fe32[_0x5cc491(0x148)])),_0x2d61cb;if(_0x14fe32[_0x5cc491(0x118)]==='TimeRange')return _0x14fe32[_0x5cc491(0x101)]&&(_0x2d61cb['duration']=_0x14fe32['duration']),_0x14fe32[_0x5cc491(0x17d)]&&(_0x2d61cb[_0x5cc491(0x17d)]=_0x14fe32[_0x5cc491(0x17d)]),_0x14fe32['reverse']!==undefined&&(_0x2d61cb[_0x5cc491(0xfc)]=_0x14fe32[_0x5cc491(0xfc)]),_0x2d61cb;const _0x18da16=getEffectiveValue(_0x14fe32);if(_0x18da16!==undefined){if(Array[_0x5cc491(0x159)](_0x18da16))_0x2d61cb[_0x5cc491(0x172)]=_0x18da16;else isTemporalOperator(_0x14fe32[_0x5cc491(0x118)])?_0x2d61cb[_0x5cc491(0x16e)]=_0x18da16:_0x2d61cb[_0x5cc491(0x116)]=_0x18da16;}return _0x14fe32[_0x5cc491(0x12b)]&&(_0x2d61cb[_0x5cc491(0x12b)]=_0x14fe32[_0x5cc491(0x12b)]),_0x2d61cb;}function mapYamlOperatorType(_0x1dc247){return _0x1dc247;}export function toYamlString(_0x5d765b){const _0x3fd645=a118_0xe18e,_0x56d528=JSON[_0x3fd645(0x175)](JSON[_0x3fd645(0x182)](_0x5d765b)),_0x5ba371=a118_0x5ccc9d['stringify'](_0x56d528,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3fd645(0x126)}),_0x52b056=['rule:'];let _0x5c3afa=_0x5ba371;for(const _0x1ead30 of _0x52b056){_0x5c3afa=_0x5c3afa[_0x3fd645(0x151)](new RegExp('^('+_0x1ead30+')','m'),(_0x1cac85,_0x1b6f9c,_0x7530f5)=>{if(_0x7530f5===0x0||_0x5c3afa[_0x7530f5-0x1]==='\x0a'&&_0x5c3afa[_0x7530f5-0x2]==='\x0a')return _0x1b6f9c;return'\x0a'+_0x1b6f9c;});}return _0x5c3afa;}export function parseYamlString(_0x49d4a0){return parseSegmentYamlFile(_0x49d4a0);}export function isSegmentYaml(_0x256c53){const _0x3b5a3f=a118_0xe18e;if(typeof _0x256c53!==_0x3b5a3f(0x113)||_0x256c53===null)return![];const _0x26507a=_0x256c53;return _0x26507a[_0x3b5a3f(0x118)]===_0x3b5a3f(0x17b)||_0x26507a['type']===undefined;}export function generateTemplate(_0x12104c='New\x20Segment'){const _0x9aac04=a118_0xe18e,_0x2e58ba={'type':_0x9aac04(0x17b),'name':_0x12104c,'description':_0x9aac04(0x161),'rule':{'type':_0x9aac04(0x180),'conditions':[{'type':_0x9aac04(0x10f),'attribute':_0x9aac04(0x111),'operator':{'type':'Equal','value':_0x9aac04(0x16e)}}]}};return toYamlString(_0x2e58ba);}export function segmentToYamlString(_0x2ba9c0){const _0x2eebfe=a118_0xe18e,_0x2a836e=JSON[_0x2eebfe(0x175)](JSON[_0x2eebfe(0x182)](_0x2ba9c0)),_0x4a4485=a118_0x5ccc9d[_0x2eebfe(0x182)](_0x2a836e,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x2eebfe(0x126)}),_0x11e30c=[_0x2eebfe(0x16f),_0x2eebfe(0xfe)];let _0x43f49e=_0x4a4485;for(const _0x354557 of _0x11e30c){_0x43f49e=_0x43f49e[_0x2eebfe(0x151)](new RegExp('^('+_0x354557+')','m'),(_0x485335,_0x12bc50,_0x5123cf)=>{if(_0x5123cf===0x0||_0x43f49e[_0x5123cf-0x1]==='\x0a'&&_0x43f49e[_0x5123cf-0x2]==='\x0a')return _0x12bc50;return'\x0a'+_0x12bc50;});}return _0x43f49e;}export function parseSegmentYamlFile(_0x4f7516){return safeParseYaml(_0x4f7516,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x121472){const _0x270627=a118_0xe18e;return{'type':'segment','name':_0x121472[_0x270627(0xfd)],..._0x121472[_0x270627(0x12f)]!==undefined&&{'description':_0x121472[_0x270627(0x12f)]},..._0x121472[_0x270627(0x122)]!==undefined&&{'folder':_0x121472[_0x270627(0x122)]},..._0x121472['rule']&&{'rule':normalizeRule(_0x121472[_0x270627(0x10d)])},..._0x121472[_0x270627(0xee)]!==undefined&&{'kind':_0x121472[_0x270627(0xee)]},..._0x121472['visible']!==undefined&&{'visible':_0x121472[_0x270627(0x154)]},..._0x121472['activations']&&{'activations':_0x121472[_0x270627(0x128)][_0x270627(0x149)](normalizeActivation)}};}export function normalizeRule(_0x490d9e){const _0x57e162=a118_0xe18e;return{'type':_0x490d9e[_0x57e162(0x118)],'conditions':_0x490d9e[_0x57e162(0x107)]['map'](normalizeCondition),..._0x490d9e['description']!==undefined&&{'description':_0x490d9e[_0x57e162(0x12f)]}};}function normalizeCondition(_0x5f3055){const _0x56067a=a118_0xe18e;if(_0x56067a(0x17b)in _0x5f3055&&(_0x5f3055[_0x56067a(0x118)]===_0x56067a(0x132)||_0x5f3055[_0x56067a(0x118)]==='exclude')){const _0x1c4e11=_0x5f3055;return{'type':_0x1c4e11[_0x56067a(0x118)],'segment':_0x1c4e11[_0x56067a(0x17b)]};}if(_0x56067a(0x118)in _0x5f3055&&(_0x5f3055[_0x56067a(0x118)]==='And'||_0x5f3055[_0x56067a(0x118)]==='Or')){const _0x4e1381=_0x5f3055;return{'type':_0x4e1381[_0x56067a(0x118)],'conditions':_0x4e1381['conditions'][_0x56067a(0x149)](normalizeCondition),..._0x4e1381[_0x56067a(0x12f)]!==undefined&&{'description':_0x4e1381[_0x56067a(0x12f)]}};}if(_0x56067a(0x17c)in _0x5f3055&&_0x5f3055[_0x56067a(0x118)]==='Column'){const _0x282f9a=_0x5f3055;return{'type':_0x56067a(0x15d),'column':_0x282f9a[_0x56067a(0x17c)],'operator':normalizeOperator(_0x282f9a[_0x56067a(0x14e)])};}const _0x503141=_0x5f3055;return{'type':_0x56067a(0x10f),'attribute':_0x503141[_0x56067a(0xea)],'operator':normalizeOperator(_0x503141[_0x56067a(0x14e)]),..._0x503141[_0x56067a(0x124)]!==undefined&&{'arrayMatching':_0x503141[_0x56067a(0x124)]},..._0x503141[_0x56067a(0x11f)]!==undefined&&{'exclude':_0x503141[_0x56067a(0x11f)]},..._0x503141[_0x56067a(0xf6)]!==undefined&&{'aggregation':_0x503141['aggregation']},..._0x503141[_0x56067a(0x133)]!==undefined&&{'source':_0x503141[_0x56067a(0x133)]},..._0x503141['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x503141[_0x56067a(0x177)])))},..._0x503141['limit']!==undefined&&{'limit':_0x503141[_0x56067a(0x171)]}};}function normalizeOperator(_0x5592d8){const _0xd3071a=a118_0xe18e;if(isBetweenOperator(_0x5592d8[_0xd3071a(0x118)]))return{'type':_0x5592d8[_0xd3071a(0x118)],..._0x5592d8['not']!==undefined&&{'not':_0x5592d8[_0xd3071a(0x17e)]},..._0x5592d8[_0xd3071a(0x119)]!==undefined&&{'min':_0x5592d8[_0xd3071a(0x119)]},..._0x5592d8[_0xd3071a(0x148)]!==undefined&&{'max':_0x5592d8[_0xd3071a(0x148)]}};const _0x45524c=getEffectiveValue(_0x5592d8);return{'type':_0x5592d8[_0xd3071a(0x118)],..._0x5592d8[_0xd3071a(0x17e)]!==undefined&&{'not':_0x5592d8[_0xd3071a(0x17e)]},..._0x45524c!==undefined&&{'value':_0x45524c},..._0x5592d8[_0xd3071a(0x12b)]!==undefined&&{'unit':_0x5592d8[_0xd3071a(0x12b)]},..._0x5592d8[_0xd3071a(0x101)]!==undefined&&{'duration':_0x5592d8['duration']},..._0x5592d8[_0xd3071a(0x17d)]!==undefined&&{'from':_0x5592d8[_0xd3071a(0x17d)]},..._0x5592d8[_0xd3071a(0xfc)]!==undefined&&{'reverse':_0x5592d8[_0xd3071a(0xfc)]}};}function normalizeActivation(_0x4b12f4){const _0x81b7ef=a118_0xe18e;return{'name':_0x4b12f4[_0x81b7ef(0xfd)],'connection':_0x4b12f4[_0x81b7ef(0xf2)],..._0x4b12f4[_0x81b7ef(0x12f)]!==undefined&&{'description':_0x4b12f4['description']},..._0x4b12f4[_0x81b7ef(0x16b)]!==undefined&&{'all_columns':_0x4b12f4[_0x81b7ef(0x16b)]},..._0x4b12f4[_0x81b7ef(0x145)]!==undefined&&{'columns':_0x4b12f4[_0x81b7ef(0x145)]},..._0x4b12f4[_0x81b7ef(0x102)]!==undefined&&{'behavior':_0x4b12f4[_0x81b7ef(0x102)]},..._0x4b12f4['schedule']!==undefined&&{'schedule':_0x4b12f4[_0x81b7ef(0x141)]},..._0x4b12f4[_0x81b7ef(0x16c)]!==undefined&&{'notification':_0x4b12f4[_0x81b7ef(0x16c)]},..._0x4b12f4[_0x81b7ef(0x115)]!==undefined&&{'connector_config':_0x4b12f4[_0x81b7ef(0x115)]},..._0x4b12f4[_0x81b7ef(0x14d)]!==undefined&&{'activation_template_id':_0x4b12f4[_0x81b7ef(0x14d)]}};}export function activationResponseToDef(_0x4b675c,_0x528f04,_0x13e1e1){const _0x14b521=a118_0xe18e,_0x397c3a=_0x4b675c[_0x14b521(0xfb)]||'',_0x3ec73c=_0x13e1e1?.[_0x14b521(0x169)](_0x397c3a)??_0x397c3a,_0x22be95={'name':_0x4b675c[_0x14b521(0xfd)],'connection':_0x3ec73c};_0x4b675c[_0x14b521(0x12f)]&&(_0x22be95[_0x14b521(0x12f)]=_0x4b675c[_0x14b521(0x12f)]);let _0x5bb19c=[];_0x4b675c[_0x14b521(0x145)]&&_0x4b675c[_0x14b521(0x145)][_0x14b521(0x129)]>0x0&&(_0x5bb19c=_0x4b675c[_0x14b521(0x145)][_0x14b521(0x177)](_0x323fdc=>_0x323fdc&&_0x323fdc[_0x14b521(0xfd)])[_0x14b521(0x149)](_0x5a76d5=>{const _0x13e10d=_0x14b521;if(_0x5a76d5[_0x13e10d(0x118)]||_0x5a76d5[_0x13e10d(0x13c)])return{'name':_0x5a76d5[_0x13e10d(0xfd)],..._0x5a76d5[_0x13e10d(0x118)]&&{'type':_0x5a76d5['type']},..._0x5a76d5[_0x13e10d(0x13c)]&&{'visibility':_0x5a76d5[_0x13e10d(0x13c)]}};return _0x5a76d5['name'];}));_0x5bb19c['length']>0x0&&(_0x22be95[_0x14b521(0x145)]=_0x5bb19c);_0x4b675c[_0x14b521(0x106)]!==undefined&&(_0x4b675c['allColumns']===![]&&_0x5bb19c[_0x14b521(0x129)]===0x0?_0x22be95[_0x14b521(0x16b)]=!![]:_0x22be95[_0x14b521(0x16b)]=_0x4b675c['allColumns']);const _0x4f56c0={};let _0x364835=![];_0x4b675c[_0x14b521(0x134)]&&(_0x4f56c0['type']=_0x4b675c[_0x14b521(0x134)],_0x364835=!![]);_0x4b675c[_0x14b521(0x12d)]&&(_0x4f56c0[_0x14b521(0x152)]=_0x4b675c[_0x14b521(0x12d)],_0x364835=!![]);_0x4b675c[_0x14b521(0x100)]!==undefined&&_0x4b675c[_0x14b521(0x100)]!==null&&(_0x4f56c0[_0x14b521(0x10c)]=_0x4b675c['repeatFrequency'],_0x364835=!![]);_0x4b675c[_0x14b521(0x170)]&&_0x4b675c['repeatSubFrequency']['length']>0x0&&(_0x4f56c0[_0x14b521(0xef)]=_0x4b675c[_0x14b521(0x170)],_0x364835=!![]);_0x4b675c[_0x14b521(0xec)]!==undefined&&(_0x4f56c0[_0x14b521(0x105)]=_0x4b675c[_0x14b521(0xec)],_0x364835=!![]);_0x4b675c[_0x14b521(0xf8)]!==undefined&&(_0x4f56c0[_0x14b521(0x15f)]=_0x4b675c[_0x14b521(0xf8)],_0x364835=!![]);_0x4b675c['timezone']&&(_0x4f56c0[_0x14b521(0xf9)]=_0x4b675c[_0x14b521(0xf9)],_0x364835=!![]);_0x364835&&(_0x22be95[_0x14b521(0x141)]=_0x4f56c0);(_0x4b675c[_0x14b521(0x104)]&&_0x4b675c['notifyOn'][_0x14b521(0x129)]>0x0||_0x4b675c[_0x14b521(0x131)]&&_0x4b675c[_0x14b521(0x131)]['length']>0x0)&&(_0x22be95['notification']={},_0x4b675c[_0x14b521(0x104)]&&_0x4b675c['notifyOn']['length']>0x0&&(_0x22be95[_0x14b521(0x16c)]['notify_on']=_0x4b675c[_0x14b521(0x104)]),_0x4b675c[_0x14b521(0x131)]&&_0x4b675c[_0x14b521(0x131)][_0x14b521(0x129)]>0x0&&(_0x22be95['notification'][_0x14b521(0xf3)]=_0x4b675c[_0x14b521(0x131)][_0x14b521(0x149)](_0x3acfed=>{const _0x1f83c0=_0x528f04?.['get'](_0x3acfed);return _0x1f83c0??String(_0x3acfed);})));_0x4b675c[_0x14b521(0x174)]&&Object['keys'](_0x4b675c[_0x14b521(0x174)])[_0x14b521(0x129)]>0x0&&(_0x22be95[_0x14b521(0x115)]=normalizeConnectorConfigForYaml(_0x4b675c[_0x14b521(0x174)]));_0x4b675c['activationTemplateId']&&(_0x22be95[_0x14b521(0x14d)]=_0x4b675c[_0x14b521(0x157)]);if(_0x4b675c[_0x14b521(0x112)]){const _0x1deccd={},_0x43d93e=_0x4b675c[_0x14b521(0x112)];_0x43d93e['columns']&&_0x43d93e['columns'][_0x14b521(0x129)]>0x0&&(_0x1deccd[_0x14b521(0x145)]=_0x43d93e['columns'][_0x14b521(0x177)](_0x4696a4=>_0x4696a4&&_0x4696a4[_0x14b521(0xfd)])['map'](_0x4f379a=>({'name':_0x4f379a[_0x14b521(0xfd)],..._0x4f379a[_0x14b521(0x118)]&&{'type':_0x4f379a[_0x14b521(0x118)]},..._0x4f379a[_0x14b521(0x13c)]&&{'visibility':_0x4f379a[_0x14b521(0x13c)]}}))),_0x43d93e[_0x14b521(0x166)]&&(_0x1deccd[_0x14b521(0x103)]=_0x43d93e[_0x14b521(0x166)]),_0x43d93e[_0x14b521(0x144)]!==undefined&&(_0x1deccd[_0x14b521(0xf1)]=_0x43d93e['joinRow']),_0x43d93e['joinStrategy']&&(_0x1deccd[_0x14b521(0xf7)]=_0x43d93e['joinStrategy']),_0x43d93e[_0x14b521(0x165)]&&(_0x1deccd[_0x14b521(0x165)]=_0x43d93e[_0x14b521(0x165)]),_0x43d93e['orderBy']&&_0x43d93e[_0x14b521(0x158)][_0x14b521(0x129)]>0x0&&(_0x1deccd[_0x14b521(0x17a)]=_0x43d93e[_0x14b521(0x158)]),Object['keys'](_0x1deccd)[_0x14b521(0x129)]>0x0&&(_0x22be95[_0x14b521(0x102)]=_0x1deccd);}return _0x22be95;}export function journeyActivationStepToYaml(_0x4a13a4,_0x4aaf00,_0xb0c290){const _0x349fff=a118_0xe18e,_0x15d3c5=_0x4a13a4[_0x349fff(0x147)][_0x349fff(0x140)],_0x35316e=_0x15d3c5[_0x349fff(0xfb)]||'',_0x5b0962=_0xb0c290?.[_0x349fff(0x169)](_0x35316e)??_0x35316e,_0x5be248={'name':_0x15d3c5[_0x349fff(0xfd)]||'','connection':_0x5b0962};_0x4a13a4['attributes'][_0x349fff(0x176)]&&(_0x5be248[_0x349fff(0x153)]=!![]);_0x15d3c5[_0x349fff(0x12f)]&&(_0x5be248[_0x349fff(0x12f)]=_0x15d3c5[_0x349fff(0x12f)]);let _0xa307f3=[];_0x15d3c5[_0x349fff(0x145)]&&_0x15d3c5[_0x349fff(0x145)][_0x349fff(0x129)]>0x0&&(_0xa307f3=_0x15d3c5[_0x349fff(0x145)][_0x349fff(0x177)](_0x56e6a8=>_0x56e6a8&&_0x56e6a8[_0x349fff(0xfd)])[_0x349fff(0x149)](_0x24f7cc=>{const _0x36824d=_0x349fff;if(_0x24f7cc[_0x36824d(0x118)]||_0x24f7cc[_0x36824d(0x13c)])return{'name':_0x24f7cc['name'],..._0x24f7cc[_0x36824d(0x118)]&&{'type':_0x24f7cc[_0x36824d(0x118)]},..._0x24f7cc['visibility']&&{'visibility':_0x24f7cc[_0x36824d(0x13c)]}};return _0x24f7cc[_0x36824d(0xfd)];}));_0xa307f3[_0x349fff(0x129)]>0x0&&(_0x5be248[_0x349fff(0x145)]=_0xa307f3);_0x15d3c5[_0x349fff(0x106)]!==undefined&&(_0x15d3c5[_0x349fff(0x106)]===![]&&_0xa307f3['length']===0x0?_0x5be248[_0x349fff(0x16b)]=!![]:_0x5be248['all_columns']=_0x15d3c5[_0x349fff(0x106)]);const _0x3d1260={};let _0x4e0b97=![];_0x15d3c5[_0x349fff(0x134)]&&(_0x3d1260['type']=_0x15d3c5[_0x349fff(0x134)],_0x4e0b97=!![]);_0x15d3c5[_0x349fff(0x12d)]&&(_0x3d1260['repeat_unit']=_0x15d3c5[_0x349fff(0x12d)],_0x4e0b97=!![]);_0x15d3c5[_0x349fff(0x100)]!==undefined&&_0x15d3c5[_0x349fff(0x100)]!==null&&(_0x3d1260[_0x349fff(0x10c)]=_0x15d3c5[_0x349fff(0x100)],_0x4e0b97=!![]);_0x15d3c5[_0x349fff(0xec)]!==undefined&&(_0x3d1260['start_at']=_0x15d3c5['startAt'],_0x4e0b97=!![]);_0x15d3c5[_0x349fff(0xf8)]!==undefined&&(_0x3d1260[_0x349fff(0x15f)]=_0x15d3c5[_0x349fff(0xf8)],_0x4e0b97=!![]);_0x15d3c5['timezone']&&(_0x3d1260[_0x349fff(0xf9)]=_0x15d3c5[_0x349fff(0xf9)],_0x4e0b97=!![]);_0x4e0b97&&(_0x5be248[_0x349fff(0x141)]=_0x3d1260);(_0x15d3c5[_0x349fff(0x104)]&&_0x15d3c5[_0x349fff(0x104)][_0x349fff(0x129)]>0x0||_0x15d3c5[_0x349fff(0x131)]&&_0x15d3c5[_0x349fff(0x131)][_0x349fff(0x129)]>0x0)&&(_0x5be248[_0x349fff(0x16c)]={},_0x15d3c5[_0x349fff(0x104)]&&_0x15d3c5['notifyOn'][_0x349fff(0x129)]>0x0&&(_0x5be248[_0x349fff(0x16c)][_0x349fff(0x110)]=_0x15d3c5[_0x349fff(0x104)]),_0x15d3c5[_0x349fff(0x131)]&&_0x15d3c5[_0x349fff(0x131)][_0x349fff(0x129)]>0x0&&(_0x5be248[_0x349fff(0x16c)][_0x349fff(0xf3)]=_0x15d3c5[_0x349fff(0x131)]['map'](_0x24a436=>{const _0x3b1449=_0x4aaf00?.['get'](_0x24a436);return _0x3b1449??String(_0x24a436);})));_0x15d3c5[_0x349fff(0x174)]&&Object['keys'](_0x15d3c5[_0x349fff(0x174)])[_0x349fff(0x129)]>0x0&&(_0x5be248[_0x349fff(0x115)]=normalizeConnectorConfigForYaml(_0x15d3c5['connectorConfig']));_0x15d3c5['activationTemplateId']&&(_0x5be248[_0x349fff(0x14d)]=_0x15d3c5['activationTemplateId']);if(_0x15d3c5[_0x349fff(0x112)]){const _0x40e755={},_0x1d5024=_0x15d3c5[_0x349fff(0x112)];_0x1d5024[_0x349fff(0x145)]&&_0x1d5024['columns'][_0x349fff(0x129)]>0x0&&(_0x40e755[_0x349fff(0x145)]=_0x1d5024[_0x349fff(0x145)][_0x349fff(0x177)](_0x240732=>_0x240732&&_0x240732[_0x349fff(0xfd)])[_0x349fff(0x149)](_0x2f7879=>({'name':_0x2f7879[_0x349fff(0xfd)],..._0x2f7879[_0x349fff(0x118)]&&{'type':_0x2f7879[_0x349fff(0x118)]},..._0x2f7879[_0x349fff(0x13c)]&&{'visibility':_0x2f7879['visibility']}}))),_0x1d5024[_0x349fff(0x166)]&&(_0x40e755[_0x349fff(0x103)]=_0x1d5024['behaviorTableName']),_0x1d5024[_0x349fff(0x144)]!==undefined&&(_0x40e755['join_row']=_0x1d5024[_0x349fff(0x144)]),_0x1d5024[_0x349fff(0x12e)]&&(_0x40e755[_0x349fff(0xf7)]=_0x1d5024[_0x349fff(0x12e)]),_0x1d5024[_0x349fff(0x165)]&&(_0x40e755[_0x349fff(0x165)]=_0x1d5024['formatting']),_0x1d5024[_0x349fff(0x158)]&&_0x1d5024[_0x349fff(0x158)][_0x349fff(0x129)]>0x0&&(_0x40e755['order_by']=_0x1d5024[_0x349fff(0x158)]),Object[_0x349fff(0x10e)](_0x40e755)[_0x349fff(0x129)]>0x0&&(_0x5be248[_0x349fff(0x102)]=_0x40e755);}return _0x5be248;}export function segmentWithActivationsToYaml(_0x5b0ec8,_0x297b45,_0x2cd37e,_0xd8c80d,_0x4868b5){const _0x316c2c=a118_0xe18e,_0x39aa52=segmentResponseToDefSync(_0x5b0ec8,_0x2cd37e);return _0x297b45['length']>0x0&&(_0x39aa52['activations']=_0x297b45[_0x316c2c(0x149)](_0x1947b8=>activationResponseToDef(_0x1947b8,_0xd8c80d,_0x4868b5))),_0x39aa52;}function normalizeColumn(_0x38b565){const _0x24faf3=a118_0xe18e;if(typeof _0x38b565==='string')return{'name':_0x38b565};return{'name':_0x38b565[_0x24faf3(0xfd)],..._0x38b565[_0x24faf3(0x118)]&&{'type':_0x38b565[_0x24faf3(0x118)]},..._0x38b565[_0x24faf3(0x13c)]&&{'visibility':_0x38b565['visibility']}};}export async function activationDefToCreateRequest(_0x5017e6,_0x34d137){const _0x3f27ec=a118_0xe18e,_0x17cea0=_0x34d137?.['emailToIdMap'],_0x2233b9=_0x34d137?.[_0x3f27ec(0x150)],_0x121c60=_0x5017e6[_0x3f27ec(0xf2)];let _0x2d90dd;const _0x4025e4=parseInt(_0x121c60,0xa);if(!isNaN(_0x4025e4)&&String(_0x4025e4)===_0x121c60)_0x2d90dd=_0x4025e4;else{const _0x255b55=_0x2233b9?.[_0x3f27ec(0x169)](_0x121c60);if(_0x255b55===undefined)throw new SDKError(ErrorCode[_0x3f27ec(0x13e)],'Unknown\x20connection:\x20'+_0x121c60,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x2d90dd=_0x255b55;}const _0x1ada02={'name':_0x5017e6[_0x3f27ec(0xfd)],'connectionId':_0x2d90dd};_0x5017e6['description']&&(_0x1ada02[_0x3f27ec(0x12f)]=_0x5017e6[_0x3f27ec(0x12f)]);let _0x5aa465=[];_0x5017e6[_0x3f27ec(0x145)]&&_0x5017e6[_0x3f27ec(0x145)][_0x3f27ec(0x129)]>0x0&&(_0x5aa465=_0x5017e6[_0x3f27ec(0x145)][_0x3f27ec(0x177)](_0x50cfa8=>_0x50cfa8!=null)['map'](normalizeColumn));_0x5aa465[_0x3f27ec(0x129)]>0x0&&(_0x1ada02[_0x3f27ec(0x145)]=_0x5aa465);_0x5017e6[_0x3f27ec(0x16b)]!==undefined&&(_0x5017e6[_0x3f27ec(0x16b)]===![]&&_0x5aa465[_0x3f27ec(0x129)]===0x0?_0x1ada02[_0x3f27ec(0x106)]=!![]:_0x1ada02[_0x3f27ec(0x106)]=_0x5017e6['all_columns']);if(_0x5017e6['schedule']){const _0x945d82=_0x5017e6['schedule'];_0x945d82[_0x3f27ec(0x118)]&&(_0x1ada02['scheduleType']=_0x945d82['type']),_0x945d82[_0x3f27ec(0x152)]&&(_0x1ada02[_0x3f27ec(0x12d)]=_0x945d82['repeat_unit']),_0x945d82[_0x3f27ec(0x10c)]!==undefined&&(_0x1ada02[_0x3f27ec(0x100)]=_0x945d82['repeat_frequency']),_0x945d82[_0x3f27ec(0xef)]&&(_0x1ada02['repeatSubFrequency']=_0x945d82[_0x3f27ec(0xef)]),_0x945d82[_0x3f27ec(0x105)]!==undefined&&(_0x1ada02[_0x3f27ec(0xec)]=_0x945d82['start_at']),_0x945d82[_0x3f27ec(0x15f)]!==undefined&&(_0x1ada02[_0x3f27ec(0xf8)]=_0x945d82[_0x3f27ec(0x15f)]),_0x945d82['timezone']&&(_0x1ada02[_0x3f27ec(0xf9)]=_0x945d82[_0x3f27ec(0xf9)]);}_0x5017e6[_0x3f27ec(0x16c)]&&(_0x5017e6[_0x3f27ec(0x16c)][_0x3f27ec(0x110)]&&(_0x1ada02['notifyOn']=_0x5017e6[_0x3f27ec(0x16c)][_0x3f27ec(0x110)]),_0x5017e6['notification'][_0x3f27ec(0xf3)]&&(_0x1ada02[_0x3f27ec(0x131)]=_0x5017e6[_0x3f27ec(0x16c)][_0x3f27ec(0xf3)][_0x3f27ec(0x149)](_0x29e045=>{const _0x239b8c=_0x3f27ec,_0x493850=Number(_0x29e045);if(!isNaN(_0x493850)&&String(_0x493850)===_0x29e045)return _0x493850;const _0xe7d514=_0x17cea0?.[_0x239b8c(0x169)](_0x29e045[_0x239b8c(0x11a)]());if(_0xe7d514===undefined)throw new SDKError(ErrorCode[_0x239b8c(0x14a)],_0x239b8c(0x156)+_0x29e045+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0xe7d514;})));if(_0x5017e6[_0x3f27ec(0x115)]){const _0xb7405c=_0x34d137?.[_0x3f27ec(0x130)]?.[_0x3f27ec(0x169)](_0x121c60);if(_0xb7405c&&_0x34d137?.['getSchema'])try{const _0x57f6a0=await _0x34d137[_0x3f27ec(0x117)](_0xb7405c),_0x1ee89c=validateConnectorConfig(_0x5017e6['connector_config'],_0x57f6a0);if(!_0x1ee89c[_0x3f27ec(0x127)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x5017e6['name']+_0x3f27ec(0x137)+formatValidationErrors(_0x1ee89c[_0x3f27ec(0x178)]),undefined,{'helpText':_0x3f27ec(0x114)+_0xb7405c+_0x3f27ec(0x11c)+formatSchemaAsHelp(_0x57f6a0)});if(_0x1ee89c['warnings']['length']>0x0){const _0x4b764f=formatValidationWarnings(_0x1ee89c['warnings']);console['warn']('connector_config\x20for\x20activation\x20\x22'+_0x5017e6[_0x3f27ec(0xfd)]+_0x3f27ec(0x137)+_0x4b764f);}_0x1ada02['connectorConfig']=transformConfigToLegacy(_0x5017e6[_0x3f27ec(0x115)],_0x57f6a0);}catch(_0x1911b4){if(_0x1911b4 instanceof SDKError&&_0x1911b4[_0x3f27ec(0x125)]===ErrorCode[_0x3f27ec(0x10a)])_0x1ada02[_0x3f27ec(0x174)]=_0x5017e6[_0x3f27ec(0x115)];else throw _0x1911b4;}else _0x1ada02[_0x3f27ec(0x174)]=_0x5017e6[_0x3f27ec(0x115)];}_0x5017e6[_0x3f27ec(0x14d)]!==undefined&&(_0x1ada02[_0x3f27ec(0x157)]=_0x5017e6[_0x3f27ec(0x14d)]);if(_0x5017e6[_0x3f27ec(0x102)]){const _0x39e7a6=_0x5017e6[_0x3f27ec(0x102)],_0x52e845={};if(_0x39e7a6[_0x3f27ec(0x145)]&&_0x39e7a6[_0x3f27ec(0x145)][_0x3f27ec(0x129)]>0x0){const _0x11e56c=_0x39e7a6[_0x3f27ec(0x145)]['filter'](_0x5d8d5a=>_0x5d8d5a&&_0x5d8d5a['name']);_0x11e56c[_0x3f27ec(0x129)]>0x0&&(_0x52e845['columns']=_0x11e56c);}_0x39e7a6[_0x3f27ec(0x103)]&&(_0x52e845[_0x3f27ec(0x166)]=_0x39e7a6[_0x3f27ec(0x103)]),_0x39e7a6[_0x3f27ec(0xf1)]!==undefined&&(_0x52e845['joinRow']=_0x39e7a6['join_row']),_0x39e7a6[_0x3f27ec(0xf7)]&&(_0x52e845[_0x3f27ec(0x12e)]=_0x39e7a6[_0x3f27ec(0xf7)]),_0x39e7a6['formatting']&&(_0x52e845[_0x3f27ec(0x165)]=_0x39e7a6[_0x3f27ec(0x165)]),_0x39e7a6[_0x3f27ec(0x17a)]&&(_0x52e845['orderBy']=_0x39e7a6[_0x3f27ec(0x17a)]),_0x1ada02[_0x3f27ec(0x112)]=_0x52e845;}return _0x1ada02;}export async function activationDefToUpdateRequest(_0xb7f7af,_0x2372bd){return activationDefToCreateRequest(_0xb7f7af,_0x2372bd);}export function deepSortObject(_0x5e1b1b){const _0x115135=a118_0xe18e;if(_0x5e1b1b===null||typeof _0x5e1b1b!=='object')return _0x5e1b1b;if(Array[_0x115135(0x159)](_0x5e1b1b))return _0x5e1b1b['map'](deepSortObject)[_0x115135(0x13a)]((_0xcc605a,_0x293bb4)=>JSON['stringify'](_0xcc605a)[_0x115135(0x17f)](JSON[_0x115135(0x182)](_0x293bb4)));const _0x5cde1c={};for(const _0x98a85c of Object['keys'](_0x5e1b1b)[_0x115135(0x13a)]()){_0x5cde1c[_0x98a85c]=deepSortObject(_0x5e1b1b[_0x98a85c]);}return _0x5cde1c;}export function serializeRule(_0x567206){const _0x33547b=a118_0xe18e;return JSON[_0x33547b(0x182)](deepSortObject(_0x567206));}export function normalizeRuleForMatching(_0x36044c){return normalizeConditionsForMatching(_0x36044c);}function normalizeConditionsForMatching(_0x520a63){const _0x3b5c7f=a118_0xe18e;if(_0x520a63===null||typeof _0x520a63!==_0x3b5c7f(0x113))return _0x520a63;if(Array[_0x3b5c7f(0x159)](_0x520a63))return _0x520a63[_0x3b5c7f(0x149)](normalizeConditionsForMatching);const _0x453880=_0x520a63;if((_0x453880[_0x3b5c7f(0x118)]===_0x3b5c7f(0x132)||_0x453880[_0x3b5c7f(0x118)]===_0x3b5c7f(0x11f))&&typeof _0x453880[_0x3b5c7f(0x17b)]===_0x3b5c7f(0x16d))return{..._0x453880,'segment':_0x3b5c7f(0x163)};const _0x562bd4={};for(const _0x51d038 of Object[_0x3b5c7f(0x10e)](_0x453880)){_0x562bd4[_0x51d038]=normalizeConditionsForMatching(_0x453880[_0x51d038]);}return _0x562bd4;}export function serializeRuleForMatching(_0x3c7325){const _0x28c57c=a118_0xe18e;return JSON[_0x28c57c(0x182)](deepSortObject(normalizeRuleForMatching(_0x3c7325)));}export function expandSegmentReferences(_0x772996,_0x3faecf,_0x54a262=new Set()){return expandConditions(_0x772996,_0x3faecf,_0x54a262);}function expandConditions(_0x2329de,_0x5ad44c,_0x32d963){const _0x4b0e43=a118_0xe18e;if(_0x2329de===null||typeof _0x2329de!==_0x4b0e43(0x113))return _0x2329de;if(Array['isArray'](_0x2329de))return _0x2329de['map'](_0x192e42=>expandConditions(_0x192e42,_0x5ad44c,_0x32d963));const _0x179eab=_0x2329de;if((_0x179eab['type']===_0x4b0e43(0x132)||_0x179eab[_0x4b0e43(0x118)]===_0x4b0e43(0x11f))&&typeof _0x179eab[_0x4b0e43(0x17b)]===_0x4b0e43(0x16d)){const _0x50beb2=_0x179eab[_0x4b0e43(0x17b)],_0x4f9350=_0x5ad44c[_0x4b0e43(0x169)](_0x50beb2);if(_0x4f9350&&!_0x32d963['has'](_0x50beb2)){const _0x60ae82=new Set(_0x32d963);_0x60ae82['add'](_0x50beb2);const _0x3ba661=expandConditions(_0x4f9350,_0x5ad44c,_0x60ae82);return{'type':_0x179eab[_0x4b0e43(0x118)],'expanded_rule':_0x3ba661};}return{'type':_0x179eab[_0x4b0e43(0x118)],'expanded_rule':_0x4b0e43(0x146)};}const _0x45981f={};for(const _0x406b43 of Object[_0x4b0e43(0x10e)](_0x179eab)){_0x45981f[_0x406b43]=expandConditions(_0x179eab[_0x406b43],_0x5ad44c,_0x32d963);}return _0x45981f;}export function serializeExpandedRule(_0x998f54,_0x3fd063){const _0x1d260a=a118_0xe18e,_0x58e218=expandSegmentReferences(_0x998f54,_0x3fd063);return JSON[_0x1d260a(0x182)](deepSortObject(_0x58e218));}export function createSegmentNameContext(_0x22fa8a){const _0x407740=a118_0xe18e,_0x124f56=new Set(),_0x2c39ab=new Map(),_0xc877c7=new Map();if(_0x22fa8a)for(const [_0x4f701d,_0x3c3de4]of Object[_0x407740(0x135)](_0x22fa8a)){if(_0x3c3de4['rule']){const _0x13369b=serializeRule(_0x3c3de4[_0x407740(0x10d)]);_0xc877c7[_0x407740(0xfa)](_0x13369b,_0x4f701d),_0x124f56[_0x407740(0x143)](_0x4f701d);}}return{'usedNames':_0x124f56,'ruleHashToName':_0x2c39ab,'localRuleToName':_0x22fa8a?_0xc877c7:undefined};}export function resolveSegmentName(_0x265568,_0x2c9dc1,_0x314115,_0x102270){const _0x4d3ee1=a118_0xe18e,_0x2c3e8d=serializeRule(_0x2c9dc1);if(_0x314115[_0x4d3ee1(0x109)]){const _0x30f845=_0x314115[_0x4d3ee1(0x109)][_0x4d3ee1(0x169)](_0x2c3e8d);if(_0x30f845)return{'name':_0x30f845,'isDuplicate':![],'isLocalMatch':!![]};}const _0x394078=_0x314115[_0x4d3ee1(0x15b)]['get'](_0x2c3e8d);if(_0x394078)return{'name':_0x394078,'isDuplicate':!![],'isLocalMatch':![]};const _0x5a5d2c=_0x102270(_0x265568);let _0x2f94af=_0x5a5d2c||_0x265568,_0x54b5af=_0x2f94af,_0x2d0162=0x2;while(_0x314115['usedNames']['has'](_0x54b5af)){_0x54b5af=_0x2f94af+'_'+_0x2d0162,_0x2d0162++;}return _0x314115[_0x4d3ee1(0x155)]['add'](_0x54b5af),_0x314115[_0x4d3ee1(0x15b)][_0x4d3ee1(0xfa)](_0x2c3e8d,_0x54b5af),{'name':_0x54b5af,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x1457de){const _0x1c02ef=[],_0x596221=_0x50f8d7=>{const _0x401f55=a118_0xe18e;if(!_0x50f8d7||typeof _0x50f8d7!==_0x401f55(0x113))return;if(Array['isArray'](_0x50f8d7)){_0x50f8d7['forEach'](_0x596221);return;}const _0x502f08=_0x50f8d7;(_0x502f08['type']===_0x401f55(0x132)||_0x502f08[_0x401f55(0x118)]===_0x401f55(0x11f))&&typeof _0x502f08['segment']==='string'&&_0x1c02ef[_0x401f55(0x142)](_0x502f08['segment']);for(const _0x1d9a65 of Object['values'](_0x502f08)){_0x596221(_0x1d9a65);}};return _0x596221(_0x1457de),_0x1c02ef;}export function validateSegmentRule(_0xcaf381,_0x4ffabc){const _0x4087d9=a118_0xe18e;if(!_0x4ffabc||!_0x4ffabc[_0x4087d9(0x107)])return;for(let _0x507976=0x0;_0x507976<_0x4ffabc[_0x4087d9(0x107)][_0x4087d9(0x129)];_0x507976++){const _0x16ab26=_0x4ffabc[_0x4087d9(0x107)][_0x507976];if(_0x4087d9(0x118)in _0x16ab26&&_0x16ab26[_0x4087d9(0x118)]===_0x4087d9(0x10f)){const _0x414535=_0x16ab26,_0x3f30ec=_0x414535['source']||_0x414535[_0x4087d9(0xf6)];if((!_0x414535[_0x4087d9(0xea)]||_0x414535[_0x4087d9(0xea)]==='')&&!_0x3f30ec)throw new SDKError(ErrorCode[_0x4087d9(0x10b)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0xcaf381+_0x4087d9(0x14c)+('conditions['+_0x507976+_0x4087d9(0x14b))+_0x4087d9(0x15c));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b79f6,_0x193d73){const _0x375322=a119_0xf251,_0x5eb911=_0x2b79f6();while(!![]){try{const _0x1d1eaf=parseInt(_0x375322(0x162))/0x1+parseInt(_0x375322(0x164))/0x2+parseInt(_0x375322(0x14d))/0x3+parseInt(_0x375322(0x16d))/0x4+-parseInt(_0x375322(0x156))/0x5*(-parseInt(_0x375322(0x174))/0x6)+-parseInt(_0x375322(0x17e))/0x7+-parseInt(_0x375322(0x16e))/0x8;if(_0x1d1eaf===_0x193d73)break;else _0x5eb911['push'](_0x5eb911['shift']());}catch(_0x4aea18){_0x5eb911['push'](_0x5eb911['shift']());}}}(a119_0x26fe,0x7936f));import a119_0x5d1781 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x19b24a){const _0x34b477=a119_0xf251,_0x50ab82=_0x19b24a[_0x34b477(0x160)][_0x34b477(0x177)](_0x31e301=>({'column_name':_0x31e301[_0x34b477(0x179)],'column_type':_0x31e301[_0x34b477(0x148)],'null':_0x34b477(0x166),'key':null,'default':null,'extra':null}));return{..._0x19b24a,'columns':[{'name':_0x34b477(0x171),'type':_0x34b477(0x153)},{'name':_0x34b477(0x165),'type':_0x34b477(0x153)},{'name':_0x34b477(0x168),'type':_0x34b477(0x153)},{'name':_0x34b477(0x15b),'type':_0x34b477(0x153)},{'name':_0x34b477(0x161),'type':_0x34b477(0x153)},{'name':_0x34b477(0x17a),'type':_0x34b477(0x153)}],'data':_0x50ab82};}function a119_0xf251(_0x58661f,_0x4c98ee){_0x58661f=_0x58661f-0x148;const _0x26fedb=a119_0x26fe();let _0xf251e6=_0x26fedb[_0x58661f];return _0xf251e6;}export async function executeSchemaQuery(_0x3ae0d8,_0x1f3b0e,_0x244fa5){const _0x512ea2=a119_0xf251,_0x4981fe=_0x3ae0d8[_0x512ea2(0x17b)]()['replace'](/;+$/,''),_0x628299=_0x512ea2(0x176)+_0x4981fe+_0x512ea2(0x175);_0x244fa5['verbose']&&console[_0x512ea2(0x15f)](_0x512ea2(0x172)+_0x628299);const _0x2814df=await withProgressSpinner(_0x512ea2(0x17d),async _0x54a714=>{const _0x5ebba7=_0x512ea2,_0x2eaba1=await _0x1f3b0e[_0x5ebba7(0x149)]['execute'](_0x628299,{'catalog':'td','schema':_0x5ebba7(0x167),'onJobId':_0x5c478b=>{_0x54a714['setJobId'](_0x5c478b);}});return _0x2eaba1;},{'verbose':_0x244fa5['verbose']});return buildSchemaResult(_0x2814df[_0x512ea2(0x180)]);}function columnName(_0x10816c){const _0x300a86=a119_0xf251;return _0x10816c[_0x300a86(0x16b)]||_0x10816c[_0x300a86(0x170)]||_0x10816c[_0x300a86(0x179)];}function formatFieldLine(_0x42ca76,_0x50ec97,_0x1f8d19){const _0x366670=a119_0xf251,_0x3e2269=_0x42ca76!==_0x50ec97?'\x20'+a119_0x5d1781[_0x366670(0x151)]('('+_0x50ec97+')'):'';return _0x366670(0x159)+_0x42ca76+_0x3e2269+':\x20'+a119_0x5d1781[_0x366670(0x15c)](_0x1f8d19);}function sortByColumnName(_0x22f799){const _0x3823b4=a119_0xf251;return[..._0x22f799][_0x3823b4(0x152)]((_0x140e39,_0x1c231f)=>columnName(_0x140e39)[_0x3823b4(0x155)](columnName(_0x1c231f)));}function a119_0x26fe(){const _0x473a3e=['Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','key','cyan','size','displayName','error','columns','default','910499YOCOJr','bold','272364KJFtxZ','column_type','YES','information_schema','null','Attributes','filter','matrixColumnName','fields','916676EMIkIb','11595680lQLpmG','behaviorName','parentColumn','column_name','Schema\x20query:\x0a','push','3630oCrwuz','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','SELECT\x20*\x20FROM\x20(\x0a','map','get','name','extra','trim','set','Fetching\x20schema...','5053293rcBZfY','tableName','data','Behaviors','Unknown','type','query','attribute','parentTableName','matrixTableName','1242972ODJZZA','source','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','length','dim','sort','varchar','entries','localeCompare','8080wjVpPS','startsWith','groupingName','\x20\x20\x20\x20'];a119_0x26fe=function(){return _0x473a3e;};return a119_0x26fe();}export function displayFieldsHumanReadable(_0x1a9f13,_0x107e6a){const _0x26ec3d=a119_0xf251,_0xc548eb=_0x1a9f13[_0x26ec3d(0x16a)](_0x3c75ac=>_0x3c75ac['source']===_0x26ec3d(0x14a)),_0x33e759=_0x1a9f13[_0x26ec3d(0x16a)](_0x4e70de=>_0x4e70de[_0x26ec3d(0x14e)]==='behavior'),_0x32f235=new Map();for(const _0x594190 of _0xc548eb){const _0x11efb6=_0x594190[_0x26ec3d(0x158)]||_0x594190['parentTableName']||_0x26ec3d(0x182),_0x5eb941=_0x32f235[_0x26ec3d(0x178)](_0x11efb6);_0x5eb941?_0x5eb941[_0x26ec3d(0x16c)][_0x26ec3d(0x173)](_0x594190):_0x32f235[_0x26ec3d(0x17c)](_0x11efb6,{'displayName':_0x11efb6,'tableName':_0x594190[_0x26ec3d(0x14b)],'fields':[_0x594190]});}const _0x486882=new Map();for(const _0x132b6c of _0x33e759){const _0x2a95ab=_0x132b6c[_0x26ec3d(0x16f)]||_0x26ec3d(0x182),_0x5ea227=_0x486882['get'](_0x2a95ab)||[];_0x5ea227[_0x26ec3d(0x173)](_0x132b6c),_0x486882[_0x26ec3d(0x17c)](_0x2a95ab,_0x5ea227);}console[_0x26ec3d(0x15f)]('\x0a'+a119_0x5d1781[_0x26ec3d(0x163)](_0x107e6a));if(_0x32f235[_0x26ec3d(0x15d)]>0x0){console[_0x26ec3d(0x15f)]('\x0a'+a119_0x5d1781[_0x26ec3d(0x151)](_0x26ec3d(0x169)));const _0x37290f=[..._0x32f235[_0x26ec3d(0x154)]()]['sort']((_0x60128c,_0x34b04b)=>_0x60128c[0x0][_0x26ec3d(0x155)](_0x34b04b[0x0]));for(const [,_0x5307cf]of _0x37290f){const _0x5c1592=_0x5307cf[_0x26ec3d(0x17f)]&&_0x5307cf[_0x26ec3d(0x17f)]!==_0x5307cf[_0x26ec3d(0x15e)]?'\x20'+a119_0x5d1781[_0x26ec3d(0x151)]('('+_0x5307cf[_0x26ec3d(0x17f)]+')'):'';console[_0x26ec3d(0x15f)]('\x20\x20'+a119_0x5d1781['bold'](_0x5307cf[_0x26ec3d(0x15e)])+_0x5c1592);for(const _0x11fe38 of sortByColumnName(_0x5307cf[_0x26ec3d(0x16c)])){console[_0x26ec3d(0x15f)](formatFieldLine(columnName(_0x11fe38),_0x11fe38['name'],_0x11fe38[_0x26ec3d(0x148)]));}}}if(_0x486882[_0x26ec3d(0x15d)]>0x0){console[_0x26ec3d(0x15f)]('\x0a'+a119_0x5d1781[_0x26ec3d(0x151)](_0x26ec3d(0x181)));const _0x1b117d=[..._0x486882['entries']()]['sort']((_0x556713,_0x2e0a8d)=>_0x556713[0x0][_0x26ec3d(0x155)](_0x2e0a8d[0x0]));for(const [_0x48cd8e,_0xb88613]of _0x1b117d){const _0x455d2d=_0xb88613[0x0],_0x21621b=_0x455d2d?.[_0x26ec3d(0x14c)];if(_0x21621b){const _0x1579f4=_0x21621b!==_0x48cd8e?'\x20'+a119_0x5d1781[_0x26ec3d(0x151)]('('+_0x48cd8e+')'):'';console[_0x26ec3d(0x15f)]('\x20\x20'+a119_0x5d1781[_0x26ec3d(0x163)](_0x21621b)+_0x1579f4);}else{const _0x1f22c3=_0x455d2d?.['parentTableName']||'';console['error']('\x20\x20'+a119_0x5d1781[_0x26ec3d(0x163)](_0x48cd8e)+(_0x1f22c3?'\x20'+a119_0x5d1781[_0x26ec3d(0x151)]('('+_0x1f22c3+')'):''));}for(const _0x295d37 of sortByColumnName(_0xb88613)){const _0x6e0c5e=_0x295d37['name'][_0x26ec3d(0x157)](_0x48cd8e+'.')?_0x295d37[_0x26ec3d(0x179)]['slice'](_0x48cd8e[_0x26ec3d(0x150)]+0x1):_0x295d37[_0x26ec3d(0x179)];console[_0x26ec3d(0x15f)](formatFieldLine(columnName(_0x295d37),_0x6e0c5e,_0x295d37[_0x26ec3d(0x148)]));}}}const _0x3c86cf=_0x1a9f13['some'](_0x4132bf=>_0x4132bf[_0x26ec3d(0x16b)]||_0x4132bf[_0x26ec3d(0x14c)]);_0x3c86cf&&(console[_0x26ec3d(0x15f)]('\x0a'+a119_0x5d1781[_0x26ec3d(0x151)](_0x26ec3d(0x15a))),console[_0x26ec3d(0x15f)](a119_0x5d1781[_0x26ec3d(0x151)](_0x26ec3d(0x14f)))),console[_0x26ec3d(0x15f)]('');}
|