@treasuredata/tdx 2026.3.27 → 2026.3.29
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.d.ts +141 -2
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-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/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/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.d.ts +29 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.d.ts +228 -0
- package/dist/sdk/personalization.d.ts.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/personalization.js.map +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.d.ts +57 -0
- package/dist/sdk/realtime.d.ts.map +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/realtime.js.map +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/cdp.d.ts +76 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a103_0x5c5fa8=a103_0x5c9f;(function(_0x19ee6d,_0x12007d){const _0x2af10f=a103_0x5c9f,_0x43ee25=_0x19ee6d();while(!![]){try{const _0x53c11d=parseInt(_0x2af10f(0x12e))/0x1+-parseInt(_0x2af10f(0x14a))/0x2+-parseInt(_0x2af10f(0x130))/0x3*(parseInt(_0x2af10f(0x12c))/0x4)+parseInt(_0x2af10f(0x13a))/0x5+-parseInt(_0x2af10f(0x13d))/0x6+parseInt(_0x2af10f(0x13b))/0x7*(-parseInt(_0x2af10f(0x147))/0x8)+parseInt(_0x2af10f(0x151))/0x9*(parseInt(_0x2af10f(0x12d))/0xa);if(_0x53c11d===_0x12007d)break;else _0x43ee25['push'](_0x43ee25['shift']());}catch(_0x3d4102){_0x43ee25['push'](_0x43ee25['shift']());}}}(a103_0x5a77,0x6c3f6));import a103_0x3210f0 from'path';import{existsSync,readFileSync}from'fs';function a103_0x5c9f(_0x48ae54,_0x3d3bbf){_0x48ae54=_0x48ae54-0x127;const _0x5a77f9=a103_0x5a77();let _0x5c9f03=_0x5a77f9[_0x48ae54];return _0x5c9f03;}function a103_0x5a77(){const _0x46a5ca=['length','listFolders','getSegment','progress','attributes','.html','109206SUSxEJ','update','Processing\x20campaign\x20','getWorkspace','.yaml','\x20so\x20far)...','listCampaigns','segment','12IHgyMV','1380sZeweC','57624tIheur','targetDir','408732hLsBHI','filter','cwd','set','campaigns','campaignType','hasChanges','segmentFolderId','Fetching\x20campaigns\x20(','workspaceId','646320zokCuH','1126566kvKPTa','get','777516ofKOze','name','type','utf-8','isNew','.txt','segmentId','campaignName','join','Resolving\x20workspace...','32DxLHTm','getCampaignFull','push','471856PnNnkk'];a103_0x5a77=function(){return _0x46a5ca;};return a103_0x5a77();}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeCampaignFileName,campaignToDef,toYamlString,normalizeDef}from'./campaign-yaml.js';import{createEngageTdxConfigContent}from'../segment/tdx-config.js';import{buildFolderIdToPathMap}from'../segment/resolution-context.js';const CAMPAIGNS_DIR=a103_0x5c5fa8(0x134),API_PAGE_LIMIT=0x64;export async function pullCampaigns(_0x186570,_0x133fcb,_0x43399f={}){const _0x2c0342=a103_0x5c5fa8,{engage:_0x3959d9}=_0x186570;_0x43399f[_0x2c0342(0x14e)]?.[_0x2c0342(0x152)](_0x2c0342(0x146));const _0x530a26=await _0x3959d9[_0x2c0342(0x127)](_0x133fcb),_0x5a349b=_0x530a26['name'],_0x3aac2f=_0x530a26['id'],_0xa38613=_0x43399f[_0x2c0342(0x12f)]||a103_0x3210f0[_0x2c0342(0x145)](process[_0x2c0342(0x132)](),CAMPAIGNS_DIR,sanitizeCampaignFileName(_0x5a349b));_0x43399f[_0x2c0342(0x14e)]?.[_0x2c0342(0x152)]('Fetching\x20campaigns...');const _0x326ff9=await listAllCampaigns(_0x3959d9,{'workspaceId':_0x3aac2f,'type':_0x43399f[_0x2c0342(0x135)],'progress':_0x43399f[_0x2c0342(0x14e)]});let _0x229e23=_0x326ff9;_0x43399f[_0x2c0342(0x144)]&&(_0x229e23=_0x229e23[_0x2c0342(0x131)](_0x556b99=>_0x556b99[_0x2c0342(0x13e)]===_0x43399f[_0x2c0342(0x144)]));const _0x4874c8=[];let _0x5ad537=0x0;const _0x1697ae=new Map();for(const _0x3a40fc of _0x229e23){_0x5ad537++,_0x43399f[_0x2c0342(0x14e)]?.['update'](_0x2c0342(0x153)+_0x5ad537+'/'+_0x229e23[_0x2c0342(0x14b)]+':\x20'+_0x3a40fc[_0x2c0342(0x13e)]);const _0x5e529e=await _0x3959d9[_0x2c0342(0x148)](_0x3a40fc['id']);let _0x1c2c7b;_0x186570[_0x2c0342(0x12b)]&&_0x5e529e[_0x2c0342(0x14f)]['audienceId']&&_0x5e529e[_0x2c0342(0x14f)][_0x2c0342(0x143)]&&(_0x1c2c7b=await resolveSegmentFolderPath(_0x186570[_0x2c0342(0x12b)],_0x5e529e[_0x2c0342(0x14f)]['audienceId'],_0x5e529e[_0x2c0342(0x14f)][_0x2c0342(0x143)],_0x1697ae));const {def:_0x57962b,htmlContent:_0x59f6c5,plaintextContent:_0x4d75e1}=campaignToDef(_0x5e529e,{'workspaceName':_0x5a349b,'segmentFolderPath':_0x1c2c7b}),_0x3c5474=normalizeDef(_0x57962b),_0x35aa78=sanitizeCampaignFileName(_0x3c5474[_0x2c0342(0x13e)]),_0xe01077=toYamlString(_0x3c5474);_0x4874c8[_0x2c0342(0x149)](prepareFile(_0xa38613,_0x35aa78+_0x2c0342(0x128),_0xe01077)),_0x59f6c5&&_0x4874c8[_0x2c0342(0x149)](prepareFile(_0xa38613,_0x35aa78+_0x2c0342(0x150),_0x59f6c5)),_0x4d75e1&&_0x4874c8[_0x2c0342(0x149)](prepareFile(_0xa38613,_0x35aa78+_0x2c0342(0x142),_0x4d75e1));}const _0x283e5e=createEngageTdxConfigContent(_0x5a349b);_0x4874c8['push'](prepareFile(_0xa38613,'tdx.json',_0x283e5e));const _0x415d44=_0x4874c8['filter'](_0x20eb6c=>_0x20eb6c[_0x2c0342(0x141)])[_0x2c0342(0x14b)],_0x30ab72=_0x4874c8[_0x2c0342(0x131)](_0x1f5c09=>!_0x1f5c09['isNew']&&_0x1f5c09[_0x2c0342(0x136)])[_0x2c0342(0x14b)],_0x135ef3=_0x4874c8[_0x2c0342(0x131)](_0x183d8f=>!_0x183d8f[_0x2c0342(0x141)]&&!_0x183d8f['hasChanges'])[_0x2c0342(0x14b)];return{'workspaceName':_0x5a349b,'workspaceId':_0x3aac2f,'targetDir':_0xa38613,'files':_0x4874c8,'counts':{'campaigns':_0x229e23[_0x2c0342(0x14b)]},'newFiles':_0x415d44,'changedFiles':_0x30ab72,'unchangedFiles':_0x135ef3};}function prepareFile(_0x1ccb6f,_0x1373fd,_0x4fc73d){const _0x5ef760=a103_0x5c5fa8,_0x23fac0=a103_0x3210f0[_0x5ef760(0x145)](_0x1ccb6f,_0x1373fd),_0x46099e=!existsSync(_0x23fac0);let _0x22bba1=_0x46099e,_0x47fa08;if(!_0x46099e){const _0x5d5575=readFileSync(_0x23fac0,_0x5ef760(0x140)),_0x4fe50e=generateDiff(_0x5d5575,_0x4fc73d);_0x22bba1=hasChanges(_0x4fe50e),_0x22bba1&&(_0x47fa08=formatDiffWithColors(_0x4fe50e));}return{'relativePath':_0x1373fd,'absolutePath':_0x23fac0,'content':_0x4fc73d,'isNew':_0x46099e,'hasChanges':_0x22bba1,'diff':_0x47fa08};}async function listAllCampaigns(_0x1193f8,_0x318cec){const _0x5a30ca=a103_0x5c5fa8,_0x33a12b=[];let _0x148994=0x0;while(!![]){const _0x34ad5e=await _0x1193f8[_0x5a30ca(0x12a)]({'workspaceId':_0x318cec[_0x5a30ca(0x139)],'type':_0x318cec[_0x5a30ca(0x13f)],'limit':API_PAGE_LIMIT,'offset':_0x148994});_0x33a12b[_0x5a30ca(0x149)](..._0x34ad5e);if(_0x34ad5e['length']<API_PAGE_LIMIT)break;_0x148994+=API_PAGE_LIMIT,_0x318cec['progress']?.[_0x5a30ca(0x152)](_0x5a30ca(0x138)+_0x33a12b[_0x5a30ca(0x14b)]+_0x5a30ca(0x129));}return _0x33a12b;}async function resolveSegmentFolderPath(_0x1f1328,_0x5bd380,_0x2fba40,_0x4c06c6){const _0x6d9d26=a103_0x5c5fa8;try{let _0x196c9a=_0x4c06c6[_0x6d9d26(0x13c)](_0x5bd380);if(!_0x196c9a){const _0x2a5547=await _0x1f1328[_0x6d9d26(0x14c)](_0x5bd380);_0x196c9a=buildFolderIdToPathMap(_0x2a5547),_0x4c06c6[_0x6d9d26(0x133)](_0x5bd380,_0x196c9a);}const _0x1a58ef=await _0x1f1328[_0x6d9d26(0x14d)](_0x5bd380,_0x2fba40);if(!_0x1a58ef[_0x6d9d26(0x137)])return undefined;return _0x196c9a[_0x6d9d26(0x13c)](_0x1a58ef['segmentFolderId'])||undefined;}catch{return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24e9e7,_0x42a2de){const _0x1196bb=a104_0x3939,_0x5243ae=_0x24e9e7();while(!![]){try{const _0x1a4548=parseInt(_0x1196bb(0x11c))/0x1*(parseInt(_0x1196bb(0x132))/0x2)+-parseInt(_0x1196bb(0x13a))/0x3*(-parseInt(_0x1196bb(0x13f))/0x4)+-parseInt(_0x1196bb(0x144))/0x5*(-parseInt(_0x1196bb(0x12f))/0x6)+parseInt(_0x1196bb(0x13b))/0x7*(parseInt(_0x1196bb(0x12c))/0x8)+-parseInt(_0x1196bb(0x148))/0x9*(-parseInt(_0x1196bb(0x142))/0xa)+parseInt(_0x1196bb(0x13c))/0xb*(-parseInt(_0x1196bb(0x146))/0xc)+-parseInt(_0x1196bb(0x130))/0xd;if(_0x1a4548===_0x42a2de)break;else _0x5243ae['push'](_0x5243ae['shift']());}catch(_0x4861cc){_0x5243ae['push'](_0x5243ae['shift']());}}}(a104_0xd804,0xe0037));import a104_0x5aea57 from'path';import{readFileSync}from'fs';import{parseYamlString,defToCreateInput,defToUpdateInput}from'./campaign-yaml.js';function a104_0x3939(_0x5b6c7e,_0x3044d6){_0x5b6c7e=_0x5b6c7e-0x117;const _0xd804df=a104_0xd804();let _0x39393c=_0xd804df[_0x5b6c7e];return _0x39393c;}import{findYamlFiles}from'../segment/file-discovery.js';function a104_0xd804(){const _0x2d21cd=['relative','get','set','updateInput','segment','Fetching\x20existing\x20campaigns...','type','campaign','dir','resolveWorkspaceId','resolveTemplateId','Resolving\x20references\x20','createCampaign','24mRntFm','createInput','Pushing\x20','6090dkrFWj','35674197bNUheG','action','82fFGvuJ','length','results','created','create','filter','push','fileDir','49671bPiskq','2524494xWkirI','7403726laRaMU','join','listCampaigns','100Cqvulh','errors','updated','10NLHVFW','name','7045JZLenl','message','24voTIZB','dirname','9175707khYPJU','engage','parentName','existingId','workspaceId','utf-8','progress','25911bMyoee','def','update'];a104_0xd804=function(){return _0x2d21cd;};return a104_0xd804();}export function discoverCampaignFiles(_0x102318){const _0x23620a=a104_0x3939,_0x385118=findYamlFiles(_0x102318);return _0x385118[_0x23620a(0x137)](_0x4f1a57=>{const _0x2ab30c=_0x23620a;try{const _0x5029d3=readFileSync(_0x4f1a57,_0x2ab30c(0x11a)),_0x24a774=parseYamlString(_0x5029d3);return _0x24a774[_0x2ab30c(0x125)]===_0x2ab30c(0x126);}catch{return![];}});}export function parseCampaignFile(_0x45a12d,_0x45e8cc){const _0x5b34f8=a104_0x3939,_0x98cf5d=readFileSync(_0x45a12d,'utf-8'),_0x2674ca=parseYamlString(_0x98cf5d),_0x3e9e35=a104_0x5aea57[_0x5b34f8(0x11f)](_0x45e8cc,_0x45a12d),_0xfdeb58=a104_0x5aea57[_0x5b34f8(0x147)](_0x45a12d);return{'yamlPath':_0x45a12d,'relativePath':_0x3e9e35,'def':_0x2674ca,'dir':_0xfdeb58};}export async function preparePush(_0x342292,_0x15d36b,_0x5bfbd8,_0x1d69a5={}){const _0x266a98=a104_0x3939,{engage:_0x307c43}=_0x342292;_0x1d69a5[_0x266a98(0x11b)]?.[_0x266a98(0x11e)](_0x266a98(0x124));const _0x35d359=await listAllCampaigns(_0x307c43,_0x5bfbd8),_0x5329ac=new Map();for(const _0x38c7e2 of _0x35d359){_0x5329ac[_0x266a98(0x121)](_0x38c7e2[_0x266a98(0x143)],_0x38c7e2);}const _0x2da9f0=[];for(const _0x14d613 of _0x15d36b){const _0x15488d=_0x5329ac[_0x266a98(0x120)](_0x14d613['def'][_0x266a98(0x143)]);_0x2da9f0[_0x266a98(0x138)]({'def':_0x14d613['def'],'fileDir':_0x14d613[_0x266a98(0x127)],'action':_0x15488d?_0x266a98(0x11e):_0x266a98(0x136),'existingId':_0x15488d?.['id']});}return _0x2da9f0;}export async function resolveAndBuildInputs(_0x1969d6,_0x20f42f,_0x45a41f,_0x1fbd83={}){const _0x36e6e1=a104_0x3939;for(let _0x29f68b=0x0;_0x29f68b<_0x20f42f[_0x36e6e1(0x133)];_0x29f68b++){const _0x4c2159=_0x20f42f[_0x29f68b];_0x1fbd83[_0x36e6e1(0x11b)]?.[_0x36e6e1(0x11e)](_0x36e6e1(0x12a)+(_0x29f68b+0x1)+'/'+_0x20f42f[_0x36e6e1(0x133)]+':\x20'+_0x4c2159[_0x36e6e1(0x11d)]['name']);const _0x98fa0c=createResolveContext(_0x1969d6,_0x45a41f,_0x4c2159[_0x36e6e1(0x139)]);_0x4c2159['action']===_0x36e6e1(0x136)?(_0x4c2159[_0x36e6e1(0x12d)]=await defToCreateInput(_0x4c2159['def'],_0x98fa0c),!_0x4c2159[_0x36e6e1(0x12d)][_0x36e6e1(0x119)]&&(_0x4c2159[_0x36e6e1(0x12d)]['workspaceId']=_0x45a41f)):_0x4c2159[_0x36e6e1(0x122)]=await defToUpdateInput(_0x4c2159[_0x36e6e1(0x11d)],_0x98fa0c);}}export async function executePush(_0x30e0b0,_0x42c051,_0x193379={}){const _0x26fbd4=a104_0x3939,_0x55a55e={'results':[],'created':0x0,'updated':0x0,'unchanged':0x0,'errors':[]};if(_0x193379['dryRun']){for(const _0x317877 of _0x42c051){_0x317877[_0x26fbd4(0x131)]==='create'?(_0x55a55e[_0x26fbd4(0x134)]['push']({'name':_0x317877[_0x26fbd4(0x11d)][_0x26fbd4(0x143)],'action':_0x26fbd4(0x135)}),_0x55a55e[_0x26fbd4(0x135)]++):(_0x55a55e[_0x26fbd4(0x134)][_0x26fbd4(0x138)]({'name':_0x317877[_0x26fbd4(0x11d)]['name'],'action':_0x26fbd4(0x141)}),_0x55a55e[_0x26fbd4(0x141)]++);}return _0x55a55e;}const {engage:_0x383f6d}=_0x30e0b0;for(let _0x100a8a=0x0;_0x100a8a<_0x42c051[_0x26fbd4(0x133)];_0x100a8a++){const _0x5e4389=_0x42c051[_0x100a8a];_0x193379[_0x26fbd4(0x11b)]?.[_0x26fbd4(0x11e)](_0x26fbd4(0x12e)+(_0x100a8a+0x1)+'/'+_0x42c051[_0x26fbd4(0x133)]+':\x20'+_0x5e4389[_0x26fbd4(0x11d)][_0x26fbd4(0x143)]);try{if(_0x5e4389[_0x26fbd4(0x131)]===_0x26fbd4(0x136)&&_0x5e4389[_0x26fbd4(0x12d)]){const _0x306886=await _0x383f6d[_0x26fbd4(0x12b)](_0x5e4389[_0x26fbd4(0x12d)]);_0x55a55e['results'][_0x26fbd4(0x138)]({'name':_0x5e4389['def']['name'],'action':_0x26fbd4(0x135),'campaignId':_0x306886['id']}),_0x55a55e['created']++;}else{if(_0x5e4389[_0x26fbd4(0x131)]===_0x26fbd4(0x11e)&&_0x5e4389['updateInput']&&_0x5e4389[_0x26fbd4(0x118)]){const _0x5a843e=await _0x383f6d['updateCampaign'](_0x5e4389['existingId'],_0x5e4389['updateInput']);_0x55a55e[_0x26fbd4(0x134)]['push']({'name':_0x5e4389[_0x26fbd4(0x11d)][_0x26fbd4(0x143)],'action':'updated','campaignId':_0x5a843e['id']}),_0x55a55e['updated']++;}}}catch(_0x4566f4){const _0x33670b=_0x4566f4 instanceof Error?_0x4566f4[_0x26fbd4(0x145)]:String(_0x4566f4);_0x55a55e[_0x26fbd4(0x140)][_0x26fbd4(0x138)]({'name':_0x5e4389[_0x26fbd4(0x11d)][_0x26fbd4(0x143)],'error':_0x33670b});}}return _0x55a55e;}function createResolveContext(_0x578d49,_0x4d10b3,_0x1731d4){return{'resolveWorkspaceId':async _0x3c2892=>{const _0x5a5e3c=a104_0x3939;return await _0x578d49[_0x5a5e3c(0x149)][_0x5a5e3c(0x128)](_0x3c2892);},'resolveTemplateId':async(_0x457305,_0x547bf4)=>{const _0x35b203=a104_0x3939;return await _0x578d49[_0x35b203(0x149)][_0x35b203(0x129)](_0x457305,_0x547bf4??_0x4d10b3);},'resolveSegmentPath':async _0x2a1985=>{const _0x20c232=a104_0x3939,_0x480b93=await _0x578d49[_0x20c232(0x123)]['resolvePathToResource'](_0x2a1985);return{'audienceId':_0x480b93['parentId'],'audienceName':_0x480b93[_0x20c232(0x117)],'segmentId':_0x480b93['segmentId'],'segmentName':_0x480b93['segmentName']};},'readFile':async _0xa31f21=>{const _0x2771e8=a104_0x3939,_0x5313b5=a104_0x5aea57[_0x2771e8(0x13d)](_0x1731d4,_0xa31f21);return readFileSync(_0x5313b5,_0x2771e8(0x11a));}};}const API_PAGE_LIMIT=0x64;async function listAllCampaigns(_0x5b7e64,_0x5634fc){const _0x38dc5a=a104_0x3939,_0x421e39=[];let _0x1a3b64=0x0;while(!![]){const _0x380b1d=await _0x5b7e64[_0x38dc5a(0x13e)]({'workspaceId':_0x5634fc,'limit':API_PAGE_LIMIT,'offset':_0x1a3b64});_0x421e39[_0x38dc5a(0x138)](..._0x380b1d);if(_0x380b1d['length']<API_PAGE_LIMIT)break;_0x1a3b64+=API_PAGE_LIMIT;}return _0x421e39;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4933be,_0x2cab2a){const _0x2a0fb7=a105_0x5053,_0xbbe695=_0x4933be();while(!![]){try{const _0x39ef37=-parseInt(_0x2a0fb7(0x1cf))/0x1*(parseInt(_0x2a0fb7(0x1d7))/0x2)+-parseInt(_0x2a0fb7(0x1de))/0x3*(parseInt(_0x2a0fb7(0x1b7))/0x4)+parseInt(_0x2a0fb7(0x1db))/0x5*(parseInt(_0x2a0fb7(0x1c1))/0x6)+parseInt(_0x2a0fb7(0x1bf))/0x7+-parseInt(_0x2a0fb7(0x1d8))/0x8+parseInt(_0x2a0fb7(0x1be))/0x9+parseInt(_0x2a0fb7(0x1dd))/0xa;if(_0x39ef37===_0x2cab2a)break;else _0xbbe695['push'](_0xbbe695['shift']());}catch(_0x354e19){_0xbbe695['push'](_0xbbe695['shift']());}}}(a105_0x31ec,0x9b906));import{CampaignDefSchema}from'./types/campaign-def.js';import{formatZodPath,getLocationFromPath}from'../segment/yaml-validator.js';export function validateCampaignDef(_0x169075,_0x488cb9={}){const _0x491088=a105_0x5053,_0x1eb07=CampaignDefSchema[_0x491088(0x1b2)](_0x169075);if(_0x1eb07['success']){const _0x2e4eec=runSemanticChecks(_0x1eb07['data'],_0x488cb9),_0xf2865c=_0x2e4eec[_0x491088(0x1b8)](_0x39e397=>_0x39e397[_0x491088(0x1bd)]===_0x491088(0x1d4)),_0x4df0cd=_0x2e4eec[_0x491088(0x1b8)](_0x431ef0=>_0x431ef0['level']===_0x491088(0x1c3));return{'valid':_0xf2865c[_0x491088(0x1d6)]===0x0,'errors':_0xf2865c,'warnings':_0x4df0cd};}return zodErrorsToValidationResult(_0x1eb07[_0x491088(0x1d4)],_0x488cb9);}function a105_0x31ec(){const _0x175e72=['length','8qSPajk','9532928MlLxzd','template','campaign_type','285TTvdhv','html_file','18399860UUchxA','12wrtpTo','source','CAMPAIGN_MISSING_CONTENT','Email\x20campaign\x20requires\x20email.sender_id\x20for\x20launch\x20—\x20sender\x20profile\x20UUID\x20from\x20delivery-api','email.template','issues','CAMPAIGN_MISSING_HTML_FILE','name','message','CAMPAIGN_INVALID_CONNECTOR','Email\x20campaign\x20requires\x20an\x20email\x20section','safeParse','email.sender_id','audience','value','CAMPAIGN_MISSING_SENDER_ID','628060jeBybV','filter','connector','CAMPAIGN_INVALID_TYPE','map','path','level','4460715emqrHV','1390844SlgjIK','push','49278tbFkNe','CAMPAIGN_INVALID_REF','warning','segment','document','\x20must\x20use\x20ref:\x20prefix\x20(e.g.,\x20ref:Name)\x20—\x20got\x20\x22','CAMPAIGN_MISSING_NAME','ref:','Email\x20campaign\x20has\x20a\x20push\x20section\x20but\x20no\x20email\x20section','type','Push\x20campaign\x20requires\x20a\x20push\x20section','CAMPAIGN_MISSING_TEMPLATE','email','CAMPAIGN_CONTENT_MISMATCH','136397oKndoN','Email\x20campaign\x20requires\x20html_file\x20—\x20path\x20to\x20the\x20HTML\x20file\x20for\x20email\x20content','startsWith','symbol','sender_id','error','CAMPAIGN_SCHEMA_ERROR'];a105_0x31ec=function(){return _0x175e72;};return a105_0x31ec();}function zodErrorsToValidationResult(_0x263d4e,_0x3a7ae2){const _0x46ec1d=a105_0x5053,_0x13a204=_0x263d4e[_0x46ec1d(0x1ac)][_0x46ec1d(0x1bb)](_0x91b5e6=>{const _0x128628=_0x46ec1d,_0xc0cc3a=formatZodPath(_0x91b5e6['path']),_0x57d977=mapZodIssueToCode(_0x91b5e6,_0xc0cc3a),_0x2f4ac5=getLocationFromPath(_0x3a7ae2[_0x128628(0x1c5)],_0x3a7ae2[_0x128628(0x1df)],_0x91b5e6[_0x128628(0x1bc)][_0x128628(0x1bb)](_0x4e120e=>typeof _0x4e120e===_0x128628(0x1d2)?String(_0x4e120e):_0x4e120e));return{'level':_0x128628(0x1d4),'path':_0xc0cc3a,'code':_0x57d977,'message':_0x91b5e6[_0x128628(0x1af)],..._0x2f4ac5&&{'location':_0x2f4ac5}};});return{'valid':![],'errors':_0x13a204,'warnings':[]};}function mapZodIssueToCode(_0xced0a6,_0x1537b6){const _0x311690=a105_0x5053;if(_0x1537b6===_0x311690(0x1ae))return _0x311690(0x1c7);if(_0x1537b6===_0x311690(0x1ca))return _0x311690(0x1ba);if(_0x1537b6[_0x311690(0x1d1)](_0x311690(0x1b9)))return _0x311690(0x1b0);return _0x311690(0x1d5);}function a105_0x5053(_0x3060a0,_0x43ea1e){_0x3060a0=_0x3060a0-0x1ab;const _0x31ecca=a105_0x31ec();let _0x5053da=_0x31ecca[_0x3060a0];return _0x5053da;}function runSemanticChecks(_0x1e5294,_0x262a12){const _0x2b207d=a105_0x5053,_0x414a0f=[];_0x1e5294[_0x2b207d(0x1da)]===_0x2b207d(0x1cd)&&!_0x1e5294['email']&&_0x414a0f[_0x2b207d(0x1c0)]({'level':_0x2b207d(0x1d4),'path':'email','code':_0x2b207d(0x1e0),'message':_0x2b207d(0x1b1),'location':getLocationFromPath(_0x262a12['document'],_0x262a12[_0x2b207d(0x1df)],['campaign_type'])});_0x1e5294[_0x2b207d(0x1da)]===_0x2b207d(0x1c0)&&!_0x1e5294['push']&&_0x414a0f[_0x2b207d(0x1c0)]({'level':'error','path':_0x2b207d(0x1c0),'code':_0x2b207d(0x1e0),'message':_0x2b207d(0x1cb),'location':getLocationFromPath(_0x262a12[_0x2b207d(0x1c5)],_0x262a12[_0x2b207d(0x1df)],['campaign_type'])});_0x1e5294[_0x2b207d(0x1da)]===_0x2b207d(0x1cd)&&_0x1e5294[_0x2b207d(0x1cd)]&&!_0x1e5294[_0x2b207d(0x1cd)][_0x2b207d(0x1dc)]&&_0x414a0f['push']({'level':_0x2b207d(0x1d4),'path':'email.html_file','code':_0x2b207d(0x1ad),'message':_0x2b207d(0x1d0),'location':getLocationFromPath(_0x262a12[_0x2b207d(0x1c5)],_0x262a12[_0x2b207d(0x1df)],[_0x2b207d(0x1cd)])});_0x1e5294[_0x2b207d(0x1da)]===_0x2b207d(0x1cd)&&_0x1e5294[_0x2b207d(0x1cd)]&&!_0x1e5294['email'][_0x2b207d(0x1d9)]&&_0x414a0f[_0x2b207d(0x1c0)]({'level':'error','path':_0x2b207d(0x1ab),'code':_0x2b207d(0x1cc),'message':'Email\x20campaign\x20requires\x20email.template\x20—\x20use\x20ref:Template_Name\x20to\x20reference\x20an\x20existing\x20template','location':getLocationFromPath(_0x262a12['document'],_0x262a12[_0x2b207d(0x1df)],[_0x2b207d(0x1cd)])});_0x1e5294['campaign_type']===_0x2b207d(0x1cd)&&_0x1e5294['email']&&!_0x1e5294['email'][_0x2b207d(0x1d3)]&&_0x414a0f[_0x2b207d(0x1c0)]({'level':'warning','path':_0x2b207d(0x1b3),'code':_0x2b207d(0x1b6),'message':_0x2b207d(0x1e1),'location':getLocationFromPath(_0x262a12['document'],_0x262a12[_0x2b207d(0x1df)],[_0x2b207d(0x1cd)])});const _0x48d127=[{'path':_0x2b207d(0x1ab),'value':_0x1e5294[_0x2b207d(0x1cd)]?.[_0x2b207d(0x1d9)],'yamlPath':[_0x2b207d(0x1cd),_0x2b207d(0x1d9)]},{'path':'audience','value':_0x1e5294[_0x2b207d(0x1b4)],'yamlPath':['audience']},{'path':_0x2b207d(0x1c4),'value':_0x1e5294[_0x2b207d(0x1c4)],'yamlPath':['segment']}];for(const _0x57191b of _0x48d127){_0x57191b[_0x2b207d(0x1b5)]&&!_0x57191b[_0x2b207d(0x1b5)][_0x2b207d(0x1d1)](_0x2b207d(0x1c8))&&_0x414a0f[_0x2b207d(0x1c0)]({'level':_0x2b207d(0x1d4),'path':_0x57191b['path'],'code':_0x2b207d(0x1c2),'message':_0x57191b['path']+_0x2b207d(0x1c6)+_0x57191b['value']+'\x22','location':getLocationFromPath(_0x262a12[_0x2b207d(0x1c5)],_0x262a12['source'],_0x57191b['yamlPath'])});}return _0x1e5294['campaign_type']==='email'&&_0x1e5294[_0x2b207d(0x1c0)]&&!_0x1e5294[_0x2b207d(0x1cd)]&&_0x414a0f['push']({'level':_0x2b207d(0x1c3),'path':_0x2b207d(0x1c0),'code':_0x2b207d(0x1ce),'message':_0x2b207d(0x1c9),'location':getLocationFromPath(_0x262a12[_0x2b207d(0x1c5)],_0x262a12['source'],[_0x2b207d(0x1c0)])}),_0x1e5294[_0x2b207d(0x1da)]===_0x2b207d(0x1c0)&&_0x1e5294[_0x2b207d(0x1cd)]&&!_0x1e5294[_0x2b207d(0x1c0)]&&_0x414a0f['push']({'level':'warning','path':'email','code':_0x2b207d(0x1ce),'message':'Push\x20campaign\x20has\x20an\x20email\x20section\x20but\x20no\x20push\x20section','location':getLocationFromPath(_0x262a12[_0x2b207d(0x1c5)],_0x262a12[_0x2b207d(0x1df)],[_0x2b207d(0x1cd)])}),_0x414a0f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a106_0x59bad3=a106_0xb2f2;(function(_0x4f6f29,_0xd154d2){const _0x1bc141=a106_0xb2f2,_0x326fde=_0x4f6f29();while(!![]){try{const _0x2f0334=parseInt(_0x1bc141(0x252))/0x1+-parseInt(_0x1bc141(0x201))/0x2*(parseInt(_0x1bc141(0x25d))/0x3)+-parseInt(_0x1bc141(0x1fe))/0x4+parseInt(_0x1bc141(0x228))/0x5*(parseInt(_0x1bc141(0x23f))/0x6)+parseInt(_0x1bc141(0x230))/0x7+parseInt(_0x1bc141(0x211))/0x8+parseInt(_0x1bc141(0x212))/0x9;if(_0x2f0334===_0xd154d2)break;else _0x326fde['push'](_0x326fde['shift']());}catch(_0x563011){_0x326fde['push'](_0x326fde['shift']());}}}(a106_0x302b,0xaa3e1));import*as a106_0x46f932 from'yaml';import{safeParseYaml}from'../segment/yaml-validator.js';import{CampaignDefSchema}from'./types/campaign-def.js';const REF_PREFIX=a106_0x59bad3(0x241);function toRef(_0x3abe53){return''+REF_PREFIX+_0x3abe53;}function isRef(_0x32176d){const _0x4b282b=a106_0x59bad3;return _0x32176d[_0x4b282b(0x21d)](REF_PREFIX);}function parseRef(_0x52951f){if(!isRef(_0x52951f))return _0x52951f;return _0x52951f['slice'](REF_PREFIX['length']);}export function campaignToDef(_0x3555e3,_0x43fd8e){const _0x39ae59=a106_0x59bad3,_0x295b38=_0x3555e3[_0x39ae59(0x220)],_0x29b397=sanitizeCampaignFileName(_0x295b38['name']),_0x5ec408={'type':_0x39ae59(0x256),'name':_0x295b38['name'],'campaign_type':_0x295b38['campaignType'],..._0x295b38[_0x39ae59(0x234)]&&{'description':_0x295b38['description']},..._0x43fd8e[_0x39ae59(0x257)]&&{'workspace':_0x43fd8e[_0x39ae59(0x257)]}};_0x295b38[_0x39ae59(0x223)]&&(_0x5ec408[_0x39ae59(0x210)]=toRef(_0x295b38[_0x39ae59(0x223)]));if(_0x295b38['segmentName']){const _0x1381ef=_0x43fd8e[_0x39ae59(0x25a)]?_0x43fd8e['segmentFolderPath']+'/'+_0x295b38[_0x39ae59(0x215)]:_0x295b38['segmentName'];_0x5ec408[_0x39ae59(0x260)]=toRef(_0x1381ef);}let _0xb79630,_0xb8cfa6;if(_0x295b38[_0x39ae59(0x239)]){const _0x45c3cc={};_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x205)]&&(_0x45c3cc[_0x39ae59(0x219)]=toRef(_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x205)])),_0x295b38['emailContent'][_0x39ae59(0x207)]&&(_0x45c3cc[_0x39ae59(0x232)]=_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x207)]),_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x23a)]&&(_0x45c3cc[_0x39ae59(0x238)]=_0x295b38['emailContent'][_0x39ae59(0x23a)]),_0x295b38['emailContent']['htmlTemplate']&&(_0x45c3cc[_0x39ae59(0x22a)]=_0x29b397+_0x39ae59(0x248),_0xb79630=_0x295b38['emailContent']['htmlTemplate']),_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x1ff)]&&(_0x45c3cc[_0x39ae59(0x1f8)]=_0x29b397+_0x39ae59(0x24d),_0xb8cfa6=_0x295b38['emailContent'][_0x39ae59(0x1ff)]),_0x295b38['emailContent'][_0x39ae59(0x20b)]&&_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x20b)]['length']>0x0&&(_0x45c3cc['variables']=_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x20b)][_0x39ae59(0x1f2)](templateVariableToYaml)),Object[_0x39ae59(0x21b)](_0x45c3cc)['length']>0x0&&(_0x5ec408[_0x39ae59(0x224)]=_0x45c3cc);}if(_0x295b38['pushContent']){const _0x4572fe=pushContentToYaml(_0x295b38[_0x39ae59(0x23c)]);Object[_0x39ae59(0x21b)](_0x4572fe)[_0x39ae59(0x206)]>0x0&&(_0x5ec408[_0x39ae59(0x213)]=_0x4572fe);}if(_0x295b38['startAt']||_0x295b38['timezone']){const _0x20e667={};if(_0x295b38[_0x39ae59(0x216)])_0x20e667[_0x39ae59(0x21a)]=_0x295b38['startAt'];if(_0x295b38['timezone'])_0x20e667['timezone']=_0x295b38[_0x39ae59(0x1f3)];_0x5ec408['schedule']=_0x20e667;}const _0x469ec1=connectorToYaml(_0x295b38);_0x469ec1&&(_0x5ec408['connector']=_0x469ec1);const _0x3a30cd=activationSettingsToYaml(_0x295b38);_0x3a30cd&&(_0x5ec408[_0x39ae59(0x1fb)]=_0x3a30cd);_0x295b38[_0x39ae59(0x225)]&&_0x295b38[_0x39ae59(0x23d)]&&(_0x5ec408[_0x39ae59(0x21f)]=utmToYaml(_0x295b38['utmParameters'],_0x295b38['enableUtmTracking']));if(_0x295b38[_0x39ae59(0x22f)]&&_0x295b38[_0x39ae59(0x22f)][_0x39ae59(0x206)]>0x0||_0x295b38[_0x39ae59(0x203)]&&_0x295b38['emailRecipients'][_0x39ae59(0x206)]>0x0){const _0x37af3a={};if(_0x295b38['notifyOn']&&_0x295b38['notifyOn'][_0x39ae59(0x206)]>0x0)_0x37af3a[_0x39ae59(0x221)]=_0x295b38['notifyOn'];if(_0x295b38[_0x39ae59(0x203)]&&_0x295b38[_0x39ae59(0x203)][_0x39ae59(0x206)]>0x0)_0x37af3a[_0x39ae59(0x200)]=_0x295b38[_0x39ae59(0x203)];_0x5ec408['notifications']=_0x37af3a;}return{'def':_0x5ec408,'htmlContent':_0xb79630,'plaintextContent':_0xb8cfa6};}export async function defToCreateInput(_0x23f036,_0x26b6a9){const _0x1f00d9=a106_0x59bad3,_0x3aaa64={'name':_0x23f036[_0x1f00d9(0x204)],'campaignType':_0x23f036[_0x1f00d9(0x25f)]};_0x23f036[_0x1f00d9(0x22d)]&&(_0x3aaa64[_0x1f00d9(0x1f4)]=await _0x26b6a9[_0x1f00d9(0x21c)](_0x23f036['workspace']));_0x23f036[_0x1f00d9(0x234)]&&(_0x3aaa64[_0x1f00d9(0x234)]=_0x23f036[_0x1f00d9(0x234)]);await resolveSegmentRefs(_0x23f036,_0x3aaa64,_0x26b6a9);_0x23f036[_0x1f00d9(0x224)]&&(_0x3aaa64[_0x1f00d9(0x239)]=await emailDefToApi(_0x23f036['email'],_0x3aaa64[_0x1f00d9(0x1f4)],_0x26b6a9));_0x23f036['push']&&(_0x3aaa64[_0x1f00d9(0x23c)]=pushDefToApi(_0x23f036[_0x1f00d9(0x213)]));_0x23f036[_0x1f00d9(0x246)]&&(_0x3aaa64[_0x1f00d9(0x24c)]=connectorDefToApi(_0x23f036[_0x1f00d9(0x246)]),_0x23f036[_0x1f00d9(0x246)][_0x1f00d9(0x261)]!==undefined&&(_0x3aaa64['allColumns']=_0x23f036[_0x1f00d9(0x246)][_0x1f00d9(0x261)]),_0x23f036[_0x1f00d9(0x246)][_0x1f00d9(0x22e)]&&(_0x3aaa64[_0x1f00d9(0x22e)]=_0x23f036['connector'][_0x1f00d9(0x22e)][_0x1f00d9(0x1f2)](_0x2e4b62=>({'column':_0x2e4b62[_0x1f00d9(0x226)],'source':{'column':_0x2e4b62[_0x1f00d9(0x24f)]}}))));if(_0x23f036[_0x1f00d9(0x243)]){if(_0x23f036[_0x1f00d9(0x243)][_0x1f00d9(0x21a)])_0x3aaa64[_0x1f00d9(0x216)]=_0x23f036[_0x1f00d9(0x243)][_0x1f00d9(0x21a)];if(_0x23f036[_0x1f00d9(0x243)]['timezone'])_0x3aaa64['timezone']=_0x23f036[_0x1f00d9(0x243)]['timezone'];}return _0x23f036[_0x1f00d9(0x21f)]&&(_0x3aaa64[_0x1f00d9(0x225)]=_0x23f036[_0x1f00d9(0x21f)][_0x1f00d9(0x259)]??![]),_0x3aaa64;}export async function defToUpdateInput(_0x191b49,_0x17516b){const _0x395afc=a106_0x59bad3,_0x26aed0={};if(_0x191b49['name'])_0x26aed0[_0x395afc(0x204)]=_0x191b49['name'];if(_0x191b49[_0x395afc(0x234)]!==undefined)_0x26aed0['description']=_0x191b49['description'];await resolveSegmentRefs(_0x191b49,_0x26aed0,_0x17516b);if(_0x191b49['email']){const _0x231d39=_0x191b49[_0x395afc(0x22d)]?await _0x17516b[_0x395afc(0x21c)](_0x191b49[_0x395afc(0x22d)]):undefined;_0x26aed0[_0x395afc(0x239)]=await emailDefToApi(_0x191b49[_0x395afc(0x224)],_0x231d39,_0x17516b);}_0x191b49[_0x395afc(0x213)]&&(_0x26aed0[_0x395afc(0x23c)]=pushDefToApi(_0x191b49[_0x395afc(0x213)]));_0x191b49[_0x395afc(0x246)]&&(_0x26aed0[_0x395afc(0x24c)]=connectorDefToApi(_0x191b49['connector']),_0x191b49['connector']['all_columns']!==undefined&&(_0x26aed0[_0x395afc(0x244)]=_0x191b49[_0x395afc(0x246)][_0x395afc(0x261)]),_0x191b49[_0x395afc(0x246)][_0x395afc(0x22e)]&&(_0x26aed0['columns']=_0x191b49['connector'][_0x395afc(0x22e)]['map'](_0x241bb2=>({'column':_0x241bb2[_0x395afc(0x226)],'source':{'column':_0x241bb2[_0x395afc(0x24f)]}}))));if(_0x191b49[_0x395afc(0x243)]){if(_0x191b49[_0x395afc(0x243)]['start_at'])_0x26aed0[_0x395afc(0x216)]=_0x191b49[_0x395afc(0x243)][_0x395afc(0x21a)];if(_0x191b49[_0x395afc(0x243)][_0x395afc(0x1f3)])_0x26aed0['timezone']=_0x191b49[_0x395afc(0x243)][_0x395afc(0x1f3)];}return _0x191b49[_0x395afc(0x21f)]&&(_0x26aed0[_0x395afc(0x225)]=_0x191b49[_0x395afc(0x21f)][_0x395afc(0x259)]??![]),_0x26aed0;}export function toYamlString(_0x4cd7e7){const _0x42faf8=a106_0x59bad3,_0x47d5f1=JSON[_0x42faf8(0x253)](JSON[_0x42faf8(0x20a)](_0x4cd7e7)),_0x44be67=a106_0x46f932[_0x42faf8(0x20a)](_0x47d5f1,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x42faf8(0x254)}),_0x54b89d=[_0x42faf8(0x229),'email:',_0x42faf8(0x214),_0x42faf8(0x1fc),_0x42faf8(0x255),_0x42faf8(0x258),_0x42faf8(0x251),_0x42faf8(0x240)],_0x5a37ff=_0x44be67[_0x42faf8(0x237)]('\x0a'),_0x55bb7e=[];for(let _0xbfaa6f=0x0;_0xbfaa6f<_0x5a37ff[_0x42faf8(0x206)];_0xbfaa6f++){const _0x7c297c=_0x5a37ff[_0xbfaa6f][_0x42faf8(0x209)]();_0xbfaa6f>0x0&&_0x54b89d['some'](_0x2444ac=>_0x7c297c['startsWith'](_0x2444ac))&&_0x55bb7e[_0x42faf8(0x206)]>0x0&&_0x55bb7e[_0x55bb7e[_0x42faf8(0x206)]-0x1]!==''&&_0x55bb7e[_0x42faf8(0x213)](''),_0x55bb7e[_0x42faf8(0x213)](_0x5a37ff[_0xbfaa6f]);}return _0x55bb7e[_0x42faf8(0x227)]('\x0a');}export function parseYamlString(_0x35ee4c){return safeParseYaml(_0x35ee4c,CampaignDefSchema);}export function normalizeDef(_0x573e37){const _0x39b600=a106_0x59bad3;return{'type':'campaign','name':_0x573e37['name'],'campaign_type':_0x573e37[_0x39b600(0x25f)],..._0x573e37[_0x39b600(0x234)]!==undefined&&{'description':_0x573e37[_0x39b600(0x234)]},..._0x573e37[_0x39b600(0x22d)]!==undefined&&{'workspace':_0x573e37[_0x39b600(0x22d)]},..._0x573e37[_0x39b600(0x210)]!==undefined&&{'audience':_0x573e37['audience']},..._0x573e37['segment']!==undefined&&{'segment':_0x573e37[_0x39b600(0x260)]},..._0x573e37['email']&&{'email':normalizeEmailDef(_0x573e37[_0x39b600(0x224)])},..._0x573e37['push']&&{'push':normalizePushDef(_0x573e37['push'])},..._0x573e37[_0x39b600(0x243)]&&{'schedule':normalizeScheduleDef(_0x573e37[_0x39b600(0x243)])},..._0x573e37[_0x39b600(0x246)]&&{'connector':normalizeConnectorDef(_0x573e37['connector'])},..._0x573e37['activation']&&{'activation':normalizeActivationDef(_0x573e37['activation'])},..._0x573e37[_0x39b600(0x21f)]&&{'utm':normalizeUtmDef(_0x573e37['utm'])},..._0x573e37[_0x39b600(0x22b)]&&{'notifications':normalizeNotificationsDef(_0x573e37['notifications'])}};}function templateVariableToYaml(_0x4e8f6e){const _0x428b39=a106_0x59bad3;return{'name':_0x4e8f6e[_0x428b39(0x204)],..._0x4e8f6e['displayName']&&{'display_name':_0x4e8f6e['displayName']},..._0x4e8f6e['previewValue']&&{'preview_value':_0x4e8f6e['previewValue']},..._0x4e8f6e[_0x428b39(0x24e)]&&{'default_value':_0x4e8f6e['defaultValue']}};}function a106_0x302b(){const _0x45e559=['emailContent','emailSenderId','preview_value','pushContent','utmParameters','activationActionsEnabled','367722sMZgac','notifications:','ref:','on_click_behavior','schedule','allColumns','segmentId','connector','utmSourcePlatform','.html','push_type','image_url','message','connectorConfig','.txt','defaultValue','source','onClickBehavior','utm:','619109csfJRP','parse','null','connector:','campaign','workspaceName','activation:','enabled','segmentFolderPath','utmMedium','utmCampaign','9249TMEWlb','title','campaign_type','segment','all_columns','map','timezone','workspaceId','source_platform','display_name','imageUrl','plaintext_file','marketing_tactic','workflowName','activation','schedule:','pushType','3443860EnxYCj','plaintextTemplate','recipients','814IwkFnj','workflowProjectName','emailRecipients','name','sourceEmailTemplateName','length','subjectTemplate','replace','trimStart','stringify','templateVariables','readFile','utmId','workflow_name','utmSource','audience','6109952lpPIfr','370800QkYheM','push','push:','segmentName','startAt','workflow_project','default_value','template','start_at','keys','resolveWorkspaceId','startsWith','toLowerCase','utm','attributes','events','on_click_behavior_url','audienceName','email','enableUtmTracking','column','join','65uyPzPh','audience:','html_file','notifications','variables','workspace','columns','notifyOn','4145925HTIJcE','utmMarketingTactic','subject','audienceId','description','resolveSegmentPath','resolveTemplateId','split','sender_id'];a106_0x302b=function(){return _0x45e559;};return a106_0x302b();}function pushContentToYaml(_0x362f9d){const _0x1c25f3=a106_0x59bad3;return{..._0x362f9d[_0x1c25f3(0x25e)]&&{'title':_0x362f9d[_0x1c25f3(0x25e)]},..._0x362f9d[_0x1c25f3(0x24b)]&&{'message':_0x362f9d['message']},..._0x362f9d['pushType']&&{'push_type':_0x362f9d[_0x1c25f3(0x1fd)]},..._0x362f9d[_0x1c25f3(0x1f7)]&&{'image_url':_0x362f9d[_0x1c25f3(0x1f7)]},..._0x362f9d['onClickBehavior']&&{'on_click_behavior':_0x362f9d[_0x1c25f3(0x250)]},..._0x362f9d['onClickBehaviorUrl']&&{'on_click_behavior_url':_0x362f9d['onClickBehaviorUrl']}};}function connectorToYaml(_0x3baeb3){const _0xb392c6=a106_0x59bad3,_0x249763=_0x3baeb3['connectionId'],_0x34d1a9=_0x3baeb3['columns']&&_0x3baeb3[_0xb392c6(0x22e)][_0xb392c6(0x206)]>0x0;if(!_0x249763&&!_0x34d1a9&&!_0x3baeb3[_0xb392c6(0x244)])return undefined;const _0x51d855={};return _0x3baeb3['allColumns']!==undefined&&(_0x51d855[_0xb392c6(0x261)]=_0x3baeb3[_0xb392c6(0x244)]),_0x3baeb3[_0xb392c6(0x22e)]&&_0x3baeb3['columns']['length']>0x0&&(_0x51d855[_0xb392c6(0x22e)]=_0x3baeb3['columns'][_0xb392c6(0x1f2)](columnMappingToYaml)),_0x51d855;}function columnMappingToYaml(_0x16e096){const _0xf08683=a106_0x59bad3;return{'column':_0x16e096[_0xf08683(0x226)],'source':_0x16e096[_0xf08683(0x24f)]['column']};}function activationSettingsToYaml(_0x5f1a0b){const _0x2ddae8=a106_0x59bad3;if(!_0x5f1a0b['activationActionsEnabled']&&!_0x5f1a0b[_0x2ddae8(0x202)]&&!_0x5f1a0b[_0x2ddae8(0x1fa)])return undefined;return{..._0x5f1a0b['activationActionsEnabled']!==undefined&&{'enabled':_0x5f1a0b[_0x2ddae8(0x23e)]},..._0x5f1a0b[_0x2ddae8(0x202)]&&{'workflow_project':_0x5f1a0b[_0x2ddae8(0x202)]},..._0x5f1a0b[_0x2ddae8(0x1fa)]&&{'workflow_name':_0x5f1a0b[_0x2ddae8(0x1fa)]}};}function utmToYaml(_0x821cf,_0xf4ff6c){const _0x1810da=a106_0x59bad3;return{'enabled':_0xf4ff6c,..._0x821cf[_0x1810da(0x20d)]&&{'id':_0x821cf['utmId']},..._0x821cf[_0x1810da(0x25b)]&&{'medium':_0x821cf['utmMedium']},..._0x821cf[_0x1810da(0x20f)]&&{'source':_0x821cf[_0x1810da(0x20f)]},..._0x821cf[_0x1810da(0x247)]&&{'source_platform':_0x821cf[_0x1810da(0x247)]},..._0x821cf[_0x1810da(0x25c)]&&{'campaign':_0x821cf[_0x1810da(0x25c)]},..._0x821cf[_0x1810da(0x231)]&&{'marketing_tactic':_0x821cf[_0x1810da(0x231)]}};}function a106_0xb2f2(_0x3824da,_0x4c02d7){_0x3824da=_0x3824da-0x1f2;const _0x302bc1=a106_0x302b();let _0xb2f2d5=_0x302bc1[_0x3824da];return _0xb2f2d5;}async function resolveSegmentRefs(_0x228eae,_0x4af9b6,_0x4a7096){const _0x41fbc5=a106_0x59bad3;if(_0x228eae[_0x41fbc5(0x210)]){const _0x552688=parseRef(_0x228eae[_0x41fbc5(0x210)]),_0x3e230c=_0x228eae[_0x41fbc5(0x260)]?parseRef(_0x228eae['segment']):undefined,_0x2d675a=_0x3e230c?_0x552688+'/'+_0x3e230c:_0x552688,_0x2619fa=await _0x4a7096[_0x41fbc5(0x235)](_0x2d675a);_0x4af9b6['audienceId']=_0x2619fa[_0x41fbc5(0x233)],_0x4af9b6['audienceName']=_0x2619fa['audienceName'],_0x2619fa[_0x41fbc5(0x245)]&&(_0x4af9b6[_0x41fbc5(0x245)]=_0x2619fa[_0x41fbc5(0x245)],_0x4af9b6['segmentName']=_0x2619fa[_0x41fbc5(0x215)]);}}async function emailDefToApi(_0x1712b1,_0x509c98,_0x489b8a){const _0x5230c8=a106_0x59bad3;let _0x45c800='',_0x546a50;if(_0x1712b1[_0x5230c8(0x219)]){const _0x4a62d1=parseRef(_0x1712b1['template']),_0x5c9008=await _0x489b8a[_0x5230c8(0x236)](_0x4a62d1,_0x509c98);_0x45c800=_0x5c9008['id'],_0x546a50=_0x5c9008[_0x5230c8(0x204)];}let _0x506787;_0x1712b1[_0x5230c8(0x22a)]&&(_0x506787=await _0x489b8a[_0x5230c8(0x20c)](_0x1712b1[_0x5230c8(0x22a)]));let _0x17a4fd;return _0x1712b1['plaintext_file']&&(_0x17a4fd=await _0x489b8a[_0x5230c8(0x20c)](_0x1712b1['plaintext_file'])),{'sourceEmailTemplateId':_0x45c800,..._0x546a50&&{'sourceEmailTemplateName':_0x546a50},..._0x1712b1[_0x5230c8(0x232)]&&{'subjectTemplate':_0x1712b1[_0x5230c8(0x232)]},..._0x506787&&{'htmlTemplate':_0x506787},..._0x17a4fd&&{'plaintextTemplate':_0x17a4fd},..._0x1712b1['sender_id']&&{'emailSenderId':_0x1712b1[_0x5230c8(0x238)]}};}function pushDefToApi(_0xc4db24){const _0x41bf9f=a106_0x59bad3;return{..._0xc4db24['title']&&{'title':_0xc4db24[_0x41bf9f(0x25e)]},..._0xc4db24[_0x41bf9f(0x24b)]&&{'message':_0xc4db24[_0x41bf9f(0x24b)]},..._0xc4db24[_0x41bf9f(0x249)]&&{'pushType':_0xc4db24[_0x41bf9f(0x249)]},..._0xc4db24[_0x41bf9f(0x24a)]&&{'imageUrl':_0xc4db24[_0x41bf9f(0x24a)]},..._0xc4db24[_0x41bf9f(0x242)]&&{'onClickBehavior':_0xc4db24[_0x41bf9f(0x242)]},..._0xc4db24[_0x41bf9f(0x222)]&&{'onClickBehaviorUrl':_0xc4db24[_0x41bf9f(0x222)]}};}function connectorDefToApi(_0x1a8e28){return{};}function normalizeEmailDef(_0x2c5dc0){const _0x4ef1b4=a106_0x59bad3;return{..._0x2c5dc0[_0x4ef1b4(0x219)]!==undefined&&{'template':_0x2c5dc0[_0x4ef1b4(0x219)]},..._0x2c5dc0['subject']!==undefined&&{'subject':_0x2c5dc0['subject']},..._0x2c5dc0[_0x4ef1b4(0x22a)]!==undefined&&{'html_file':_0x2c5dc0[_0x4ef1b4(0x22a)]},..._0x2c5dc0[_0x4ef1b4(0x1f8)]!==undefined&&{'plaintext_file':_0x2c5dc0[_0x4ef1b4(0x1f8)]},..._0x2c5dc0[_0x4ef1b4(0x238)]!==undefined&&{'sender_id':_0x2c5dc0['sender_id']},..._0x2c5dc0['variables']&&{'variables':_0x2c5dc0[_0x4ef1b4(0x22c)]['map'](_0x348331=>({'name':_0x348331['name'],..._0x348331[_0x4ef1b4(0x1f6)]!==undefined&&{'display_name':_0x348331[_0x4ef1b4(0x1f6)]},..._0x348331[_0x4ef1b4(0x23b)]!==undefined&&{'preview_value':_0x348331['preview_value']},..._0x348331[_0x4ef1b4(0x218)]!==undefined&&{'default_value':_0x348331[_0x4ef1b4(0x218)]}}))}};}function normalizePushDef(_0x3c3585){const _0x1770f3=a106_0x59bad3;return{..._0x3c3585[_0x1770f3(0x25e)]!==undefined&&{'title':_0x3c3585[_0x1770f3(0x25e)]},..._0x3c3585[_0x1770f3(0x24b)]!==undefined&&{'message':_0x3c3585[_0x1770f3(0x24b)]},..._0x3c3585[_0x1770f3(0x249)]!==undefined&&{'push_type':_0x3c3585[_0x1770f3(0x249)]},..._0x3c3585[_0x1770f3(0x24a)]!==undefined&&{'image_url':_0x3c3585['image_url']},..._0x3c3585[_0x1770f3(0x242)]!==undefined&&{'on_click_behavior':_0x3c3585[_0x1770f3(0x242)]},..._0x3c3585[_0x1770f3(0x222)]!==undefined&&{'on_click_behavior_url':_0x3c3585[_0x1770f3(0x222)]}};}function normalizeScheduleDef(_0x2f9631){const _0x3151ae=a106_0x59bad3;return{..._0x2f9631[_0x3151ae(0x21a)]!==undefined&&{'start_at':_0x2f9631[_0x3151ae(0x21a)]},..._0x2f9631[_0x3151ae(0x1f3)]!==undefined&&{'timezone':_0x2f9631[_0x3151ae(0x1f3)]}};}function normalizeConnectorDef(_0x2213d9){const _0x1c9d3c=a106_0x59bad3;return{..._0x2213d9['all_columns']!==undefined&&{'all_columns':_0x2213d9['all_columns']},..._0x2213d9['columns']&&{'columns':_0x2213d9[_0x1c9d3c(0x22e)]['map'](_0x491530=>({'column':_0x491530[_0x1c9d3c(0x226)],'source':_0x491530[_0x1c9d3c(0x24f)]}))}};}function normalizeActivationDef(_0x51f21d){const _0x5cf5b0=a106_0x59bad3;return{..._0x51f21d[_0x5cf5b0(0x259)]!==undefined&&{'enabled':_0x51f21d[_0x5cf5b0(0x259)]},..._0x51f21d[_0x5cf5b0(0x217)]!==undefined&&{'workflow_project':_0x51f21d[_0x5cf5b0(0x217)]},..._0x51f21d[_0x5cf5b0(0x20e)]!==undefined&&{'workflow_name':_0x51f21d[_0x5cf5b0(0x20e)]}};}function normalizeUtmDef(_0x3dc789){const _0x241aee=a106_0x59bad3;return{..._0x3dc789[_0x241aee(0x259)]!==undefined&&{'enabled':_0x3dc789[_0x241aee(0x259)]},..._0x3dc789['id']!==undefined&&{'id':_0x3dc789['id']},..._0x3dc789['medium']!==undefined&&{'medium':_0x3dc789['medium']},..._0x3dc789[_0x241aee(0x24f)]!==undefined&&{'source':_0x3dc789['source']},..._0x3dc789[_0x241aee(0x1f5)]!==undefined&&{'source_platform':_0x3dc789[_0x241aee(0x1f5)]},..._0x3dc789['campaign']!==undefined&&{'campaign':_0x3dc789[_0x241aee(0x256)]},..._0x3dc789[_0x241aee(0x1f9)]!==undefined&&{'marketing_tactic':_0x3dc789['marketing_tactic']}};}function normalizeNotificationsDef(_0x30e9da){const _0x4f9749=a106_0x59bad3;return{..._0x30e9da[_0x4f9749(0x221)]&&{'events':[..._0x30e9da[_0x4f9749(0x221)]]},..._0x30e9da[_0x4f9749(0x200)]&&{'recipients':[..._0x30e9da[_0x4f9749(0x200)]]}};}export function sanitizeCampaignFileName(_0x3a5da0){const _0x2ae471=a106_0x59bad3;return _0x3a5da0[_0x2ae471(0x21e)]()['replace'](/[/\\:*?"<>|]/g,'-')[_0x2ae471(0x208)](/\s+/g,'-')[_0x2ae471(0x208)](/-+/g,'-')[_0x2ae471(0x208)](/^-|-$/g,'');}
|
|
1
|
+
const a106_0x408e7a=a106_0x383d;(function(_0x34602b,_0x292860){const _0x51a704=a106_0x383d,_0x35f939=_0x34602b();while(!![]){try{const _0xdf57ec=parseInt(_0x51a704(0x143))/0x1*(-parseInt(_0x51a704(0x137))/0x2)+-parseInt(_0x51a704(0x14b))/0x3+-parseInt(_0x51a704(0x197))/0x4+parseInt(_0x51a704(0x190))/0x5+parseInt(_0x51a704(0x193))/0x6*(parseInt(_0x51a704(0x191))/0x7)+parseInt(_0x51a704(0x14f))/0x8+parseInt(_0x51a704(0x189))/0x9;if(_0xdf57ec===_0x292860)break;else _0x35f939['push'](_0x35f939['shift']());}catch(_0x2bf92a){_0x35f939['push'](_0x35f939['shift']());}}}(a106_0x1664,0x9cdaa));import*as a106_0x51b6e6 from'yaml';import{safeParseYaml}from'../segment/yaml-validator.js';import{CampaignDefSchema}from'./types/campaign-def.js';const REF_PREFIX=a106_0x408e7a(0x16f);function toRef(_0x4b2529){return''+REF_PREFIX+_0x4b2529;}function isRef(_0x5aedf8){const _0x1a6daf=a106_0x408e7a;return _0x5aedf8[_0x1a6daf(0x17c)](REF_PREFIX);}function parseRef(_0x328f8f){const _0x270051=a106_0x408e7a;if(!isRef(_0x328f8f))return _0x328f8f;return _0x328f8f[_0x270051(0x13f)](REF_PREFIX['length']);}export function campaignToDef(_0x2f8660,_0x5d0ee5){const _0x50b6a1=a106_0x408e7a,_0x1dbd5d=_0x2f8660[_0x50b6a1(0x19a)],_0x3a599c=sanitizeCampaignFileName(_0x1dbd5d['name']),_0xad9dd9={'type':_0x50b6a1(0x18a),'name':_0x1dbd5d['name'],'campaign_type':_0x1dbd5d[_0x50b6a1(0x158)],..._0x1dbd5d[_0x50b6a1(0x12d)]&&{'description':_0x1dbd5d['description']},..._0x5d0ee5[_0x50b6a1(0x16d)]&&{'workspace':_0x5d0ee5[_0x50b6a1(0x16d)]}};_0x1dbd5d[_0x50b6a1(0x187)]&&(_0xad9dd9[_0x50b6a1(0x17d)]=toRef(_0x1dbd5d[_0x50b6a1(0x187)]));if(_0x1dbd5d[_0x50b6a1(0x186)]){const _0x14eba5=_0x5d0ee5[_0x50b6a1(0x13d)]?_0x5d0ee5[_0x50b6a1(0x13d)]+'/'+_0x1dbd5d[_0x50b6a1(0x186)]:_0x1dbd5d[_0x50b6a1(0x186)];_0xad9dd9[_0x50b6a1(0x13b)]=toRef(_0x14eba5);}let _0x1b24f3,_0x5b1cb5;if(_0x1dbd5d[_0x50b6a1(0x142)]){const _0x1fae9b={};_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x199)]&&(_0x1fae9b[_0x50b6a1(0x12c)]=toRef(_0x1dbd5d['emailContent'][_0x50b6a1(0x199)])),_0x1dbd5d['emailContent']['subjectTemplate']&&(_0x1fae9b['subject']=_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x182)]),_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x12a)]&&(_0x1fae9b['sender_id']=_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x12a)]),_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x14e)]&&(_0x1fae9b[_0x50b6a1(0x141)]=_0x3a599c+_0x50b6a1(0x17a),_0x1b24f3=_0x1dbd5d['emailContent'][_0x50b6a1(0x14e)]),_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x180)]&&(_0x1fae9b['plaintext_file']=_0x3a599c+_0x50b6a1(0x17e),_0x5b1cb5=_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x180)]),_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x17b)]&&_0x1dbd5d[_0x50b6a1(0x142)][_0x50b6a1(0x17b)][_0x50b6a1(0x136)]>0x0&&(_0x1fae9b[_0x50b6a1(0x179)]=_0x1dbd5d[_0x50b6a1(0x142)]['templateVariables'][_0x50b6a1(0x194)](templateVariableToYaml)),Object['keys'](_0x1fae9b)['length']>0x0&&(_0xad9dd9['email']=_0x1fae9b);}if(_0x1dbd5d['pushContent']){const _0x2ebf0e=pushContentToYaml(_0x1dbd5d['pushContent']);Object[_0x50b6a1(0x149)](_0x2ebf0e)[_0x50b6a1(0x136)]>0x0&&(_0xad9dd9['push']=_0x2ebf0e);}if(_0x1dbd5d[_0x50b6a1(0x14a)]||_0x1dbd5d['timezone']){const _0xca00fd={};if(_0x1dbd5d[_0x50b6a1(0x14a)])_0xca00fd[_0x50b6a1(0x171)]=_0x1dbd5d[_0x50b6a1(0x14a)];if(_0x1dbd5d[_0x50b6a1(0x159)])_0xca00fd['timezone']=_0x1dbd5d['timezone'];_0xad9dd9['schedule']=_0xca00fd;}const _0x534593=connectorToYaml(_0x1dbd5d);_0x534593&&(_0xad9dd9[_0x50b6a1(0x13c)]=_0x534593);const _0x1e65f0=activationSettingsToYaml(_0x1dbd5d);_0x1e65f0&&(_0xad9dd9[_0x50b6a1(0x130)]=_0x1e65f0);_0x1dbd5d[_0x50b6a1(0x148)]&&_0x1dbd5d[_0x50b6a1(0x12e)]&&(_0xad9dd9['utm']=utmToYaml(_0x1dbd5d['utmParameters'],_0x1dbd5d[_0x50b6a1(0x148)]));if(_0x1dbd5d[_0x50b6a1(0x128)]&&_0x1dbd5d[_0x50b6a1(0x128)][_0x50b6a1(0x136)]>0x0||_0x1dbd5d[_0x50b6a1(0x12f)]&&_0x1dbd5d['emailRecipients']['length']>0x0){const _0x733d3e={};if(_0x1dbd5d[_0x50b6a1(0x128)]&&_0x1dbd5d[_0x50b6a1(0x128)][_0x50b6a1(0x136)]>0x0)_0x733d3e[_0x50b6a1(0x146)]=_0x1dbd5d['notifyOn'];if(_0x1dbd5d[_0x50b6a1(0x12f)]&&_0x1dbd5d['emailRecipients'][_0x50b6a1(0x136)]>0x0)_0x733d3e['recipients']=_0x1dbd5d[_0x50b6a1(0x12f)];_0xad9dd9[_0x50b6a1(0x135)]=_0x733d3e;}return{'def':_0xad9dd9,'htmlContent':_0x1b24f3,'plaintextContent':_0x5b1cb5};}export async function defToCreateInput(_0x258b9c,_0x168238){const _0x128b41=a106_0x408e7a,_0x19fa68={'name':_0x258b9c[_0x128b41(0x165)],'campaignType':_0x258b9c[_0x128b41(0x163)]};_0x258b9c[_0x128b41(0x18b)]&&(_0x19fa68[_0x128b41(0x145)]=await _0x168238[_0x128b41(0x13a)](_0x258b9c[_0x128b41(0x18b)]));_0x258b9c['description']&&(_0x19fa68['description']=_0x258b9c[_0x128b41(0x12d)]);await resolveSegmentRefs(_0x258b9c,_0x19fa68,_0x168238);_0x258b9c[_0x128b41(0x14d)]&&(_0x19fa68[_0x128b41(0x142)]=await emailDefToApi(_0x258b9c[_0x128b41(0x14d)],_0x19fa68[_0x128b41(0x145)],_0x168238));_0x258b9c[_0x128b41(0x183)]&&(_0x19fa68[_0x128b41(0x155)]=pushDefToApi(_0x258b9c[_0x128b41(0x183)]));_0x258b9c[_0x128b41(0x13c)]&&(_0x19fa68[_0x128b41(0x125)]=connectorDefToApi(_0x258b9c[_0x128b41(0x13c)]),_0x258b9c[_0x128b41(0x13c)][_0x128b41(0x153)]!==undefined&&(_0x19fa68[_0x128b41(0x166)]=_0x258b9c[_0x128b41(0x13c)]['all_columns']),_0x258b9c[_0x128b41(0x13c)]['columns']&&(_0x19fa68[_0x128b41(0x15f)]=_0x258b9c[_0x128b41(0x13c)][_0x128b41(0x15f)][_0x128b41(0x194)](_0x1907a7=>({'column':_0x1907a7[_0x128b41(0x140)],'source':{'column':_0x1907a7[_0x128b41(0x126)]}}))));if(_0x258b9c[_0x128b41(0x192)]){if(_0x258b9c[_0x128b41(0x192)][_0x128b41(0x171)])_0x19fa68['startAt']=_0x258b9c['schedule']['start_at'];if(_0x258b9c[_0x128b41(0x192)][_0x128b41(0x159)])_0x19fa68['timezone']=_0x258b9c[_0x128b41(0x192)]['timezone'];}return _0x258b9c['utm']&&(_0x19fa68[_0x128b41(0x148)]=_0x258b9c[_0x128b41(0x167)][_0x128b41(0x15d)]??![]),_0x19fa68;}export async function defToUpdateInput(_0x34f6c2,_0x474350){const _0x3bfb64=a106_0x408e7a,_0x410230={};if(_0x34f6c2[_0x3bfb64(0x165)])_0x410230[_0x3bfb64(0x165)]=_0x34f6c2[_0x3bfb64(0x165)];if(_0x34f6c2[_0x3bfb64(0x12d)]!==undefined)_0x410230[_0x3bfb64(0x12d)]=_0x34f6c2[_0x3bfb64(0x12d)];await resolveSegmentRefs(_0x34f6c2,_0x410230,_0x474350);if(_0x34f6c2['email']){const _0x44659a=_0x34f6c2[_0x3bfb64(0x18b)]?await _0x474350[_0x3bfb64(0x13a)](_0x34f6c2[_0x3bfb64(0x18b)]):undefined;_0x410230[_0x3bfb64(0x142)]=await emailDefToApi(_0x34f6c2[_0x3bfb64(0x14d)],_0x44659a,_0x474350);}_0x34f6c2[_0x3bfb64(0x183)]&&(_0x410230[_0x3bfb64(0x155)]=pushDefToApi(_0x34f6c2['push']));_0x34f6c2[_0x3bfb64(0x13c)]&&(_0x410230[_0x3bfb64(0x125)]=connectorDefToApi(_0x34f6c2[_0x3bfb64(0x13c)]),_0x34f6c2[_0x3bfb64(0x13c)]['all_columns']!==undefined&&(_0x410230[_0x3bfb64(0x166)]=_0x34f6c2['connector']['all_columns']),_0x34f6c2[_0x3bfb64(0x13c)][_0x3bfb64(0x15f)]&&(_0x410230[_0x3bfb64(0x15f)]=_0x34f6c2['connector'][_0x3bfb64(0x15f)][_0x3bfb64(0x194)](_0x4d165b=>({'column':_0x4d165b[_0x3bfb64(0x140)],'source':{'column':_0x4d165b['source']}}))));if(_0x34f6c2['schedule']){if(_0x34f6c2[_0x3bfb64(0x192)][_0x3bfb64(0x171)])_0x410230[_0x3bfb64(0x14a)]=_0x34f6c2[_0x3bfb64(0x192)][_0x3bfb64(0x171)];if(_0x34f6c2[_0x3bfb64(0x192)][_0x3bfb64(0x159)])_0x410230['timezone']=_0x34f6c2['schedule']['timezone'];}return _0x34f6c2['utm']&&(_0x410230[_0x3bfb64(0x148)]=_0x34f6c2[_0x3bfb64(0x167)][_0x3bfb64(0x15d)]??![]),_0x410230;}export function toYamlString(_0x2424c5){const _0x536b9d=a106_0x408e7a,_0x30302d=JSON[_0x536b9d(0x176)](JSON[_0x536b9d(0x12b)](_0x2424c5)),_0xb8d2d0=a106_0x51b6e6['stringify'](_0x30302d,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x536b9d(0x16c)}),_0x3294a4=[_0x536b9d(0x160),_0x536b9d(0x15c),_0x536b9d(0x131),_0x536b9d(0x162),_0x536b9d(0x133),'activation:',_0x536b9d(0x18d),_0x536b9d(0x147)],_0x5b8a20=_0xb8d2d0[_0x536b9d(0x185)]('\x0a'),_0x4f1b23=[];for(let _0x506c2e=0x0;_0x506c2e<_0x5b8a20['length'];_0x506c2e++){const _0x2a5fec=_0x5b8a20[_0x506c2e]['trimStart']();_0x506c2e>0x0&&_0x3294a4[_0x536b9d(0x196)](_0x34102f=>_0x2a5fec[_0x536b9d(0x17c)](_0x34102f))&&_0x4f1b23['length']>0x0&&_0x4f1b23[_0x4f1b23[_0x536b9d(0x136)]-0x1]!==''&&_0x4f1b23[_0x536b9d(0x183)](''),_0x4f1b23[_0x536b9d(0x183)](_0x5b8a20[_0x506c2e]);}return _0x4f1b23['join']('\x0a');}export function parseYamlString(_0x5a7e64){return safeParseYaml(_0x5a7e64,CampaignDefSchema);}export function normalizeDef(_0x53411e){const _0x3aa841=a106_0x408e7a;return{'type':_0x3aa841(0x18a),'name':_0x53411e[_0x3aa841(0x165)],'campaign_type':_0x53411e[_0x3aa841(0x163)],..._0x53411e[_0x3aa841(0x12d)]!==undefined&&{'description':_0x53411e[_0x3aa841(0x12d)]},..._0x53411e['workspace']!==undefined&&{'workspace':_0x53411e[_0x3aa841(0x18b)]},..._0x53411e[_0x3aa841(0x17d)]!==undefined&&{'audience':_0x53411e[_0x3aa841(0x17d)]},..._0x53411e[_0x3aa841(0x13b)]!==undefined&&{'segment':_0x53411e[_0x3aa841(0x13b)]},..._0x53411e['email']&&{'email':normalizeEmailDef(_0x53411e[_0x3aa841(0x14d)])},..._0x53411e['push']&&{'push':normalizePushDef(_0x53411e[_0x3aa841(0x183)])},..._0x53411e['schedule']&&{'schedule':normalizeScheduleDef(_0x53411e['schedule'])},..._0x53411e[_0x3aa841(0x13c)]&&{'connector':normalizeConnectorDef(_0x53411e['connector'])},..._0x53411e[_0x3aa841(0x130)]&&{'activation':normalizeActivationDef(_0x53411e['activation'])},..._0x53411e['utm']&&{'utm':normalizeUtmDef(_0x53411e[_0x3aa841(0x167)])},..._0x53411e['notifications']&&{'notifications':normalizeNotificationsDef(_0x53411e['notifications'])}};}function templateVariableToYaml(_0x1944ed){const _0x12b60f=a106_0x408e7a;return{'name':_0x1944ed[_0x12b60f(0x165)],..._0x1944ed[_0x12b60f(0x164)]&&{'display_name':_0x1944ed[_0x12b60f(0x164)]},..._0x1944ed[_0x12b60f(0x156)]&&{'preview_value':_0x1944ed[_0x12b60f(0x156)]},..._0x1944ed[_0x12b60f(0x154)]&&{'default_value':_0x1944ed[_0x12b60f(0x154)]}};}function pushContentToYaml(_0x4b6300){const _0x385e92=a106_0x408e7a;return{..._0x4b6300[_0x385e92(0x178)]&&{'title':_0x4b6300[_0x385e92(0x178)]},..._0x4b6300[_0x385e92(0x14c)]&&{'message':_0x4b6300[_0x385e92(0x14c)]},..._0x4b6300[_0x385e92(0x168)]&&{'push_type':_0x4b6300[_0x385e92(0x168)]},..._0x4b6300[_0x385e92(0x174)]&&{'image_url':_0x4b6300[_0x385e92(0x174)]},..._0x4b6300[_0x385e92(0x134)]&&{'on_click_behavior':_0x4b6300[_0x385e92(0x134)]},..._0x4b6300[_0x385e92(0x13e)]&&{'on_click_behavior_url':_0x4b6300[_0x385e92(0x13e)]}};}function connectorToYaml(_0x5476e0){const _0x2197bf=a106_0x408e7a,_0x4b4dba=_0x5476e0[_0x2197bf(0x16b)],_0x287757=_0x5476e0['columns']&&_0x5476e0[_0x2197bf(0x15f)]['length']>0x0;if(!_0x4b4dba&&!_0x287757&&!_0x5476e0[_0x2197bf(0x166)])return undefined;const _0x16537d={};return _0x5476e0[_0x2197bf(0x166)]!==undefined&&(_0x16537d[_0x2197bf(0x153)]=_0x5476e0[_0x2197bf(0x166)]),_0x5476e0['columns']&&_0x5476e0[_0x2197bf(0x15f)][_0x2197bf(0x136)]>0x0&&(_0x16537d[_0x2197bf(0x15f)]=_0x5476e0['columns'][_0x2197bf(0x194)](columnMappingToYaml)),_0x16537d;}function columnMappingToYaml(_0x207fe8){const _0xcde9f6=a106_0x408e7a;return{'column':_0x207fe8['column'],'source':_0x207fe8[_0xcde9f6(0x126)][_0xcde9f6(0x140)]};}function activationSettingsToYaml(_0x2066a8){const _0x204a7b=a106_0x408e7a;if(!_0x2066a8[_0x204a7b(0x177)]&&!_0x2066a8[_0x204a7b(0x198)]&&!_0x2066a8[_0x204a7b(0x157)])return undefined;return{..._0x2066a8['activationActionsEnabled']!==undefined&&{'enabled':_0x2066a8[_0x204a7b(0x177)]},..._0x2066a8[_0x204a7b(0x198)]&&{'workflow_project':_0x2066a8['workflowProjectName']},..._0x2066a8[_0x204a7b(0x157)]&&{'workflow_name':_0x2066a8[_0x204a7b(0x157)]}};}function utmToYaml(_0x3c85d0,_0x39eb02){const _0x20517b=a106_0x408e7a;return{'enabled':_0x39eb02,..._0x3c85d0[_0x20517b(0x161)]&&{'id':_0x3c85d0[_0x20517b(0x161)]},..._0x3c85d0[_0x20517b(0x172)]&&{'medium':_0x3c85d0[_0x20517b(0x172)]},..._0x3c85d0[_0x20517b(0x127)]&&{'source':_0x3c85d0['utmSource']},..._0x3c85d0[_0x20517b(0x150)]&&{'source_platform':_0x3c85d0[_0x20517b(0x150)]},..._0x3c85d0['utmCampaign']&&{'campaign':_0x3c85d0[_0x20517b(0x15e)]},..._0x3c85d0[_0x20517b(0x188)]&&{'marketing_tactic':_0x3c85d0['utmMarketingTactic']}};}function a106_0x383d(_0x5bc68b,_0x37aa2b){_0x5bc68b=_0x5bc68b-0x124;const _0x1664b7=a106_0x1664();let _0x383d99=_0x1664b7[_0x5bc68b];return _0x383d99;}async function resolveSegmentRefs(_0x204380,_0x33bc04,_0x39960b){const _0x3d4958=a106_0x408e7a;if(_0x204380[_0x3d4958(0x17d)]){const _0x24c6c5=parseRef(_0x204380['audience']),_0x136057=_0x204380['segment']?parseRef(_0x204380[_0x3d4958(0x13b)]):undefined,_0x526b6d=_0x136057?_0x24c6c5+'/'+_0x136057:_0x24c6c5,_0x453ef5=await _0x39960b[_0x3d4958(0x129)](_0x526b6d);_0x33bc04[_0x3d4958(0x170)]=_0x453ef5[_0x3d4958(0x170)],_0x33bc04['audienceName']=_0x453ef5['audienceName'],_0x453ef5[_0x3d4958(0x195)]&&(_0x33bc04['segmentId']=_0x453ef5[_0x3d4958(0x195)],_0x33bc04[_0x3d4958(0x186)]=_0x453ef5['segmentName']);}}async function emailDefToApi(_0x42df21,_0x3b3cc3,_0x14e00d){const _0x5dc32c=a106_0x408e7a;let _0x41956c='',_0xa4b74b;if(_0x42df21[_0x5dc32c(0x12c)]){const _0x5024d0=parseRef(_0x42df21[_0x5dc32c(0x12c)]),_0x29f1ef=await _0x14e00d[_0x5dc32c(0x152)](_0x5024d0,_0x3b3cc3);_0x41956c=_0x29f1ef['id'],_0xa4b74b=_0x29f1ef[_0x5dc32c(0x165)];}let _0x182964;_0x42df21['html_file']&&(_0x182964=await _0x14e00d[_0x5dc32c(0x139)](_0x42df21[_0x5dc32c(0x141)]));let _0x272d37;return _0x42df21[_0x5dc32c(0x15b)]&&(_0x272d37=await _0x14e00d[_0x5dc32c(0x139)](_0x42df21[_0x5dc32c(0x15b)])),{'sourceEmailTemplateId':_0x41956c,..._0xa4b74b&&{'sourceEmailTemplateName':_0xa4b74b},..._0x42df21[_0x5dc32c(0x18e)]&&{'subjectTemplate':_0x42df21[_0x5dc32c(0x18e)]},..._0x182964&&{'htmlTemplate':_0x182964},..._0x272d37&&{'plaintextTemplate':_0x272d37},..._0x42df21[_0x5dc32c(0x18c)]&&{'emailSenderId':_0x42df21[_0x5dc32c(0x18c)]}};}function pushDefToApi(_0x345d1f){const _0x5ea395=a106_0x408e7a;return{..._0x345d1f['title']&&{'title':_0x345d1f[_0x5ea395(0x178)]},..._0x345d1f[_0x5ea395(0x14c)]&&{'message':_0x345d1f[_0x5ea395(0x14c)]},..._0x345d1f['push_type']&&{'pushType':_0x345d1f['push_type']},..._0x345d1f[_0x5ea395(0x124)]&&{'imageUrl':_0x345d1f[_0x5ea395(0x124)]},..._0x345d1f[_0x5ea395(0x17f)]&&{'onClickBehavior':_0x345d1f[_0x5ea395(0x17f)]},..._0x345d1f[_0x5ea395(0x169)]&&{'onClickBehaviorUrl':_0x345d1f[_0x5ea395(0x169)]}};}function connectorDefToApi(_0x13bf3d){return{};}function normalizeEmailDef(_0x1da629){const _0x47ef3b=a106_0x408e7a;return{..._0x1da629[_0x47ef3b(0x12c)]!==undefined&&{'template':_0x1da629[_0x47ef3b(0x12c)]},..._0x1da629[_0x47ef3b(0x18e)]!==undefined&&{'subject':_0x1da629[_0x47ef3b(0x18e)]},..._0x1da629['html_file']!==undefined&&{'html_file':_0x1da629[_0x47ef3b(0x141)]},..._0x1da629[_0x47ef3b(0x15b)]!==undefined&&{'plaintext_file':_0x1da629[_0x47ef3b(0x15b)]},..._0x1da629[_0x47ef3b(0x18c)]!==undefined&&{'sender_id':_0x1da629['sender_id']},..._0x1da629[_0x47ef3b(0x179)]&&{'variables':_0x1da629['variables']['map'](_0xfac25c=>({'name':_0xfac25c[_0x47ef3b(0x165)],..._0xfac25c['display_name']!==undefined&&{'display_name':_0xfac25c[_0x47ef3b(0x132)]},..._0xfac25c[_0x47ef3b(0x144)]!==undefined&&{'preview_value':_0xfac25c['preview_value']},..._0xfac25c[_0x47ef3b(0x181)]!==undefined&&{'default_value':_0xfac25c[_0x47ef3b(0x181)]}}))}};}function normalizePushDef(_0x22718f){const _0x1a2db7=a106_0x408e7a;return{..._0x22718f[_0x1a2db7(0x178)]!==undefined&&{'title':_0x22718f[_0x1a2db7(0x178)]},..._0x22718f[_0x1a2db7(0x14c)]!==undefined&&{'message':_0x22718f[_0x1a2db7(0x14c)]},..._0x22718f[_0x1a2db7(0x15a)]!==undefined&&{'push_type':_0x22718f[_0x1a2db7(0x15a)]},..._0x22718f[_0x1a2db7(0x124)]!==undefined&&{'image_url':_0x22718f[_0x1a2db7(0x124)]},..._0x22718f[_0x1a2db7(0x17f)]!==undefined&&{'on_click_behavior':_0x22718f[_0x1a2db7(0x17f)]},..._0x22718f[_0x1a2db7(0x169)]!==undefined&&{'on_click_behavior_url':_0x22718f['on_click_behavior_url']}};}function normalizeScheduleDef(_0x3016dd){const _0x195acb=a106_0x408e7a;return{..._0x3016dd[_0x195acb(0x171)]!==undefined&&{'start_at':_0x3016dd['start_at']},..._0x3016dd[_0x195acb(0x159)]!==undefined&&{'timezone':_0x3016dd[_0x195acb(0x159)]}};}function normalizeConnectorDef(_0x226e0b){const _0x725ce0=a106_0x408e7a;return{..._0x226e0b[_0x725ce0(0x153)]!==undefined&&{'all_columns':_0x226e0b[_0x725ce0(0x153)]},..._0x226e0b[_0x725ce0(0x15f)]&&{'columns':_0x226e0b[_0x725ce0(0x15f)]['map'](_0x28ac57=>({'column':_0x28ac57['column'],'source':_0x28ac57[_0x725ce0(0x126)]}))}};}function normalizeActivationDef(_0x53c8d3){const _0x508777=a106_0x408e7a;return{..._0x53c8d3[_0x508777(0x15d)]!==undefined&&{'enabled':_0x53c8d3[_0x508777(0x15d)]},..._0x53c8d3[_0x508777(0x16e)]!==undefined&&{'workflow_project':_0x53c8d3['workflow_project']},..._0x53c8d3[_0x508777(0x173)]!==undefined&&{'workflow_name':_0x53c8d3['workflow_name']}};}function a106_0x1664(){const _0x4892eb=['segment','connector','segmentFolderPath','onClickBehaviorUrl','slice','column','html_file','emailContent','611457QmDsTC','preview_value','workspaceId','events','notifications:','enableUtmTracking','keys','startAt','1373046ArQLMJ','message','email','htmlTemplate','1016312QBHeic','utmSourcePlatform','toLowerCase','resolveTemplateId','all_columns','defaultValue','pushContent','previewValue','workflowName','campaignType','timezone','push_type','plaintext_file','email:','enabled','utmCampaign','columns','audience:','utmId','schedule:','campaign_type','displayName','name','allColumns','utm','pushType','on_click_behavior_url','marketing_tactic','connectionId','null','workspaceName','workflow_project','ref:','audienceId','start_at','utmMedium','workflow_name','imageUrl','medium','parse','activationActionsEnabled','title','variables','.html','templateVariables','startsWith','audience','.txt','on_click_behavior','plaintextTemplate','default_value','subjectTemplate','push','recipients','split','segmentName','audienceName','utmMarketingTactic','12493944rRIDTv','campaign','workspace','sender_id','utm:','subject','source_platform','2552545gzDYVc','27083RrxQie','schedule','1038dbxjpk','map','segmentId','some','3933952PlOoWK','workflowProjectName','sourceEmailTemplateName','attributes','image_url','connectorConfig','source','utmSource','notifyOn','resolveSegmentPath','emailSenderId','stringify','template','description','utmParameters','emailRecipients','activation','push:','display_name','connector:','onClickBehavior','notifications','length','2AwduRY','replace','readFile','resolveWorkspaceId'];a106_0x1664=function(){return _0x4892eb;};return a106_0x1664();}function normalizeUtmDef(_0x24ea2f){const _0x260d00=a106_0x408e7a;return{..._0x24ea2f[_0x260d00(0x15d)]!==undefined&&{'enabled':_0x24ea2f[_0x260d00(0x15d)]},..._0x24ea2f['id']!==undefined&&{'id':_0x24ea2f['id']},..._0x24ea2f[_0x260d00(0x175)]!==undefined&&{'medium':_0x24ea2f['medium']},..._0x24ea2f['source']!==undefined&&{'source':_0x24ea2f[_0x260d00(0x126)]},..._0x24ea2f[_0x260d00(0x18f)]!==undefined&&{'source_platform':_0x24ea2f[_0x260d00(0x18f)]},..._0x24ea2f[_0x260d00(0x18a)]!==undefined&&{'campaign':_0x24ea2f[_0x260d00(0x18a)]},..._0x24ea2f[_0x260d00(0x16a)]!==undefined&&{'marketing_tactic':_0x24ea2f[_0x260d00(0x16a)]}};}function normalizeNotificationsDef(_0x2c07c0){const _0x4cc687=a106_0x408e7a;return{..._0x2c07c0[_0x4cc687(0x146)]&&{'events':[..._0x2c07c0[_0x4cc687(0x146)]]},..._0x2c07c0[_0x4cc687(0x184)]&&{'recipients':[..._0x2c07c0[_0x4cc687(0x184)]]}};}export function sanitizeCampaignFileName(_0x1d8838){const _0x394dc3=a106_0x408e7a;return _0x1d8838[_0x394dc3(0x151)]()[_0x394dc3(0x138)](/[/\\:*?"<>|]/g,'-')[_0x394dc3(0x138)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x394dc3(0x138)](/^-|-$/g,'');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a107_0x5d72e0=a107_0xdc19;(function(_0x4d6332,_0x2da490){const _0x766c33=a107_0xdc19,_0x2b346e=_0x4d6332();while(!![]){try{const _0xfbd33a=-parseInt(_0x766c33(0x17b))/0x1+parseInt(_0x766c33(0x166))/0x2+parseInt(_0x766c33(0x17c))/0x3*(-parseInt(_0x766c33(0x181))/0x4)+parseInt(_0x766c33(0x183))/0x5+-parseInt(_0x766c33(0x16d))/0x6*(parseInt(_0x766c33(0x172))/0x7)+-parseInt(_0x766c33(0x173))/0x8*(-parseInt(_0x766c33(0x176))/0x9)+parseInt(_0x766c33(0x16f))/0xa*(parseInt(_0x766c33(0x17a))/0xb);if(_0xfbd33a===_0x2da490)break;else _0x2b346e['push'](_0x2b346e['shift']());}catch(_0x194c63){_0x2b346e['push'](_0x2b346e['shift']());}}}(a107_0x19b1,0xc456d));import a107_0x2e44fa from'path';import{existsSync,readFileSync}from'fs';function a107_0x19b1(){const _0x716f3f=['Resolving\x20workspace...','length','4OKwQJj','templates','5125215gBoNjc','getTemplateFull','push','templateName','.html','progress','2066956xmsjKw','.txt','join','Processing\x20template\x20','update','cwd','utf-8','54504eYcXSh','.yaml','20WOHZxR','name','hasChanges','959hRXYey','280DUrHUJ','Fetching\x20templates\x20(','workspaceId','34065OBfVlv','\x20so\x20far)...','listTemplates','isNew','12061621bwdvLR','836408OGRwyb','4496691yOseaB','filter','getWorkspace'];a107_0x19b1=function(){return _0x716f3f;};return a107_0x19b1();}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeTemplateFileName,templateToDef,toYamlString,normalizeDef}from'./template-yaml.js';import{createEngageTdxConfigContent}from'../segment/tdx-config.js';const TEMPLATES_DIR=a107_0x5d72e0(0x182),API_PAGE_LIMIT=0x64;export async function pullTemplates(_0x23eb04,_0x2d55e9,_0x35cdc5={}){const _0x1b64fd=a107_0x5d72e0,{engage:_0x2f6b3d}=_0x23eb04;_0x35cdc5[_0x1b64fd(0x165)]?.['update'](_0x1b64fd(0x17f));const _0x234c66=await _0x2f6b3d[_0x1b64fd(0x17e)](_0x2d55e9),_0xd20efb=_0x234c66[_0x1b64fd(0x170)],_0x161ba9=_0x234c66['id'],_0x1952de=_0x35cdc5['targetDir']||a107_0x2e44fa[_0x1b64fd(0x168)](process[_0x1b64fd(0x16b)](),TEMPLATES_DIR,sanitizeTemplateFileName(_0xd20efb));_0x35cdc5[_0x1b64fd(0x165)]?.[_0x1b64fd(0x16a)]('Fetching\x20templates...');const _0x490295=await listAllTemplates(_0x2f6b3d,{'workspaceId':_0x161ba9,'progress':_0x35cdc5[_0x1b64fd(0x165)]});let _0x557b49=_0x490295;_0x35cdc5['templateName']&&(_0x557b49=_0x557b49[_0x1b64fd(0x17d)](_0x5f2d21=>_0x5f2d21[_0x1b64fd(0x170)]===_0x35cdc5[_0x1b64fd(0x186)]));const _0xd57fd1=[];let _0x257f0e=0x0;for(const _0x2dc327 of _0x557b49){_0x257f0e++,_0x35cdc5[_0x1b64fd(0x165)]?.['update'](_0x1b64fd(0x169)+_0x257f0e+'/'+_0x557b49['length']+':\x20'+_0x2dc327[_0x1b64fd(0x170)]);const _0xe16acc=await _0x2f6b3d[_0x1b64fd(0x184)](_0x2dc327['id']),{def:_0x175989,htmlContent:_0x2cfdec,plaintextContent:_0x288ff5}=templateToDef(_0xe16acc,{'workspaceName':_0xd20efb}),_0x125638=normalizeDef(_0x175989),_0x318056=sanitizeTemplateFileName(_0x125638[_0x1b64fd(0x170)]),_0xb07fb4=toYamlString(_0x125638);_0xd57fd1[_0x1b64fd(0x185)](prepareFile(_0x1952de,_0x318056+_0x1b64fd(0x16e),_0xb07fb4)),_0x2cfdec&&_0xd57fd1[_0x1b64fd(0x185)](prepareFile(_0x1952de,_0x318056+_0x1b64fd(0x164),_0x2cfdec)),_0x288ff5&&_0xd57fd1[_0x1b64fd(0x185)](prepareFile(_0x1952de,_0x318056+_0x1b64fd(0x167),_0x288ff5));}const _0x48511c=createEngageTdxConfigContent(_0xd20efb);_0xd57fd1[_0x1b64fd(0x185)](prepareFile(_0x1952de,'tdx.json',_0x48511c));const _0x38530d=_0xd57fd1[_0x1b64fd(0x17d)](_0x2077ee=>_0x2077ee[_0x1b64fd(0x179)])[_0x1b64fd(0x180)],_0x26d0e4=_0xd57fd1['filter'](_0x4e41d4=>!_0x4e41d4[_0x1b64fd(0x179)]&&_0x4e41d4[_0x1b64fd(0x171)])[_0x1b64fd(0x180)],_0x2027d5=_0xd57fd1['filter'](_0x38299c=>!_0x38299c[_0x1b64fd(0x179)]&&!_0x38299c[_0x1b64fd(0x171)])[_0x1b64fd(0x180)];return{'workspaceName':_0xd20efb,'workspaceId':_0x161ba9,'targetDir':_0x1952de,'files':_0xd57fd1,'counts':{'templates':_0x557b49['length']},'newFiles':_0x38530d,'changedFiles':_0x26d0e4,'unchangedFiles':_0x2027d5};}function prepareFile(_0x2ff11d,_0x2fb82d,_0x50cfe9){const _0x4b8818=a107_0x5d72e0,_0x42cbeb=a107_0x2e44fa[_0x4b8818(0x168)](_0x2ff11d,_0x2fb82d),_0x358ec6=!existsSync(_0x42cbeb);let _0x162d18=_0x358ec6,_0x311f7a;if(!_0x358ec6){const _0x483fb3=readFileSync(_0x42cbeb,_0x4b8818(0x16c)),_0x35237c=generateDiff(_0x483fb3,_0x50cfe9);_0x162d18=hasChanges(_0x35237c),_0x162d18&&(_0x311f7a=formatDiffWithColors(_0x35237c));}return{'relativePath':_0x2fb82d,'absolutePath':_0x42cbeb,'content':_0x50cfe9,'isNew':_0x358ec6,'hasChanges':_0x162d18,'diff':_0x311f7a};}function a107_0xdc19(_0x467a8b,_0x10ed96){_0x467a8b=_0x467a8b-0x164;const _0x19b1cc=a107_0x19b1();let _0xdc195b=_0x19b1cc[_0x467a8b];return _0xdc195b;}export async function listAllTemplates(_0x39d6e5,_0x3615d1){const _0x2f1d68=a107_0x5d72e0,_0xdd227d=[];let _0x2444a8=0x0;while(!![]){const _0x54cbb6=await _0x39d6e5[_0x2f1d68(0x178)]({'workspaceId':_0x3615d1[_0x2f1d68(0x175)],'limit':API_PAGE_LIMIT,'offset':_0x2444a8});_0xdd227d[_0x2f1d68(0x185)](..._0x54cbb6);if(_0x54cbb6['length']<API_PAGE_LIMIT)break;_0x2444a8+=API_PAGE_LIMIT,_0x3615d1['progress']?.[_0x2f1d68(0x16a)](_0x2f1d68(0x174)+_0xdd227d['length']+_0x2f1d68(0x177));}return _0xdd227d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54ef45,_0x3ce63e){const _0x1ec913=a108_0xd401,_0x2199fc=_0x54ef45();while(!![]){try{const _0x1b5dc7=-parseInt(_0x1ec913(0x195))/0x1*(parseInt(_0x1ec913(0x1a5))/0x2)+parseInt(_0x1ec913(0x192))/0x3*(-parseInt(_0x1ec913(0x19e))/0x4)+parseInt(_0x1ec913(0x18a))/0x5*(-parseInt(_0x1ec913(0x186))/0x6)+-parseInt(_0x1ec913(0x19d))/0x7+-parseInt(_0x1ec913(0x1aa))/0x8*(parseInt(_0x1ec913(0x18c))/0x9)+-parseInt(_0x1ec913(0x18f))/0xa*(parseInt(_0x1ec913(0x19f))/0xb)+parseInt(_0x1ec913(0x1a9))/0xc;if(_0x1b5dc7===_0x3ce63e)break;else _0x2199fc['push'](_0x2199fc['shift']());}catch(_0x5555f0){_0x2199fc['push'](_0x2199fc['shift']());}}}(a108_0x5d2a,0x44d60));import a108_0x5aafca from'path';import{readFileSync}from'fs';function a108_0x5d2a(){const _0x293226=['Resolving\x20references\x20','fileDir','dryRun','join','get','54JDLzLO','utf-8','name','action','26431140wTFaRD','3271544tNgRXP','create','createTemplate','results','1239660MAXivk','relative','Fetching\x20existing\x20templates...','createInput','5okzBVK','def','9ZwuDMm','workspaceId','update','5562190skNikw','created','length','15vhdtCX','updateInput','resolveWorkspaceId','5595mWYkUx','errors','type','progress','updateTemplate','existingId','push','updated','793387grypWe','387572IpMqVu','11KpqJsY'];a108_0x5d2a=function(){return _0x293226;};return a108_0x5d2a();}import{parseYamlString,defToCreateInput,defToUpdateInput}from'./template-yaml.js';function a108_0xd401(_0x5eef24,_0x3639e9){_0x5eef24=_0x5eef24-0x186;const _0x5d2aba=a108_0x5d2a();let _0xd40195=_0x5d2aba[_0x5eef24];return _0xd40195;}import{findYamlFiles}from'../segment/file-discovery.js';import{listAllTemplates}from'./template-pull.js';export function discoverAndParseTemplateFiles(_0x2483b2){const _0x59a730=a108_0xd401,_0x47b8cc=findYamlFiles(_0x2483b2),_0x55eee3=[];for(const _0x495bac of _0x47b8cc){try{const _0x5e0d3d=readFileSync(_0x495bac,_0x59a730(0x1a6)),_0x54a121=parseYamlString(_0x5e0d3d);_0x54a121[_0x59a730(0x197)]==='template'&&_0x55eee3[_0x59a730(0x19b)]({'yamlPath':_0x495bac,'relativePath':a108_0x5aafca[_0x59a730(0x187)](_0x2483b2,_0x495bac),'def':_0x54a121,'dir':a108_0x5aafca['dirname'](_0x495bac)});}catch{}}return _0x55eee3;}export function parseTemplateFile(_0xe00408,_0x1d8b4f){const _0x467c0f=a108_0xd401,_0xbb52a9=readFileSync(_0xe00408,_0x467c0f(0x1a6)),_0x7ef26b=parseYamlString(_0xbb52a9),_0x383df7=a108_0x5aafca[_0x467c0f(0x187)](_0x1d8b4f,_0xe00408),_0x29e3c2=a108_0x5aafca['dirname'](_0xe00408);return{'yamlPath':_0xe00408,'relativePath':_0x383df7,'def':_0x7ef26b,'dir':_0x29e3c2};}export async function preparePush(_0x1bd24f,_0x580f79,_0x2434bc,_0x1a4c01={}){const _0xa48a83=a108_0xd401,{engage:_0x564ef6}=_0x1bd24f;_0x1a4c01[_0xa48a83(0x198)]?.['update'](_0xa48a83(0x188));const _0x36ae85=await listAllTemplates(_0x564ef6,{'workspaceId':_0x2434bc}),_0x94bc2f=new Map();for(const _0x3801b8 of _0x36ae85){_0x94bc2f['set'](_0x3801b8[_0xa48a83(0x1a7)],_0x3801b8);}const _0x3c2e1e=[];for(const _0x5e52d2 of _0x580f79){const _0x467639=_0x94bc2f[_0xa48a83(0x1a4)](_0x5e52d2['def'][_0xa48a83(0x1a7)]);_0x3c2e1e[_0xa48a83(0x19b)]({'def':_0x5e52d2['def'],'fileDir':_0x5e52d2['dir'],'action':_0x467639?_0xa48a83(0x18e):_0xa48a83(0x1ab),'existingId':_0x467639?.['id']});}return _0x3c2e1e;}export async function resolveAndBuildInputs(_0x9a3a35,_0x2570b6,_0x541492,_0x4633cf={}){const _0x283b1d=a108_0xd401;for(let _0xb0993b=0x0;_0xb0993b<_0x2570b6[_0x283b1d(0x191)];_0xb0993b++){const _0x4783ac=_0x2570b6[_0xb0993b];_0x4633cf[_0x283b1d(0x198)]?.[_0x283b1d(0x18e)](_0x283b1d(0x1a0)+(_0xb0993b+0x1)+'/'+_0x2570b6[_0x283b1d(0x191)]+':\x20'+_0x4783ac[_0x283b1d(0x18b)][_0x283b1d(0x1a7)]);const _0x22800e=createResolveContext(_0x9a3a35,_0x541492,_0x4783ac[_0x283b1d(0x1a1)]);_0x4783ac[_0x283b1d(0x1a8)]===_0x283b1d(0x1ab)?(_0x4783ac['createInput']=await defToCreateInput(_0x4783ac['def'],_0x22800e),!_0x4783ac['createInput'][_0x283b1d(0x18d)]&&(_0x4783ac[_0x283b1d(0x189)][_0x283b1d(0x18d)]=_0x541492)):_0x4783ac[_0x283b1d(0x193)]=await defToUpdateInput(_0x4783ac[_0x283b1d(0x18b)],_0x22800e);}}export async function executePush(_0x164b79,_0x43245b,_0x459244={}){const _0x35885c=a108_0xd401,_0x578f18={'results':[],'created':0x0,'updated':0x0,'unchanged':0x0,'errors':[]};if(_0x459244[_0x35885c(0x1a2)]){for(const _0x326de7 of _0x43245b){_0x326de7[_0x35885c(0x1a8)]===_0x35885c(0x1ab)?(_0x578f18[_0x35885c(0x1ad)]['push']({'name':_0x326de7[_0x35885c(0x18b)][_0x35885c(0x1a7)],'action':_0x35885c(0x190)}),_0x578f18[_0x35885c(0x190)]++):(_0x578f18[_0x35885c(0x1ad)]['push']({'name':_0x326de7[_0x35885c(0x18b)][_0x35885c(0x1a7)],'action':'updated'}),_0x578f18['updated']++);}return _0x578f18;}const {engage:_0x1cbe38}=_0x164b79;for(let _0x34e523=0x0;_0x34e523<_0x43245b[_0x35885c(0x191)];_0x34e523++){const _0x837334=_0x43245b[_0x34e523];_0x459244[_0x35885c(0x198)]?.[_0x35885c(0x18e)]('Pushing\x20'+(_0x34e523+0x1)+'/'+_0x43245b[_0x35885c(0x191)]+':\x20'+_0x837334[_0x35885c(0x18b)][_0x35885c(0x1a7)]);try{if(_0x837334[_0x35885c(0x1a8)]===_0x35885c(0x1ab)&&_0x837334[_0x35885c(0x189)]){const _0x17c331=await _0x1cbe38[_0x35885c(0x1ac)](_0x837334['createInput']);_0x578f18[_0x35885c(0x1ad)][_0x35885c(0x19b)]({'name':_0x837334['def']['name'],'action':_0x35885c(0x190),'templateId':_0x17c331['id']}),_0x578f18[_0x35885c(0x190)]++;}else{if(_0x837334['action']===_0x35885c(0x18e)&&_0x837334[_0x35885c(0x193)]&&_0x837334[_0x35885c(0x19a)]){const _0x1776db=await _0x1cbe38[_0x35885c(0x199)](_0x837334['existingId'],_0x837334[_0x35885c(0x193)]);_0x578f18[_0x35885c(0x1ad)][_0x35885c(0x19b)]({'name':_0x837334[_0x35885c(0x18b)][_0x35885c(0x1a7)],'action':'updated','templateId':_0x1776db['id']}),_0x578f18[_0x35885c(0x19c)]++;}}}catch(_0x3f72af){const _0x2972f8=_0x3f72af instanceof Error?_0x3f72af['message']:String(_0x3f72af);_0x578f18[_0x35885c(0x196)][_0x35885c(0x19b)]({'name':_0x837334[_0x35885c(0x18b)][_0x35885c(0x1a7)],'error':_0x2972f8});}}return _0x578f18;}function createResolveContext(_0x4dc90e,_0x20f738,_0x22551c){return{'resolveWorkspaceId':async _0x4f5805=>{const _0x4d38be=a108_0xd401;return await _0x4dc90e['engage'][_0x4d38be(0x194)](_0x4f5805);},'readFile':async _0x3d2fec=>{const _0x5bec79=a108_0xd401,_0x3f949a=a108_0x5aafca[_0x5bec79(0x1a3)](_0x22551c,_0x3d2fec);return readFileSync(_0x3f949a,_0x5bec79(0x1a6));}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2d545a,_0x2998f5){const _0x1dabad=a109_0x4b5d,_0x12d6ee=_0x2d545a();while(!![]){try{const _0x2c2f38=-parseInt(_0x1dabad(0x1de))/0x1+parseInt(_0x1dabad(0x1ce))/0x2+-parseInt(_0x1dabad(0x1e0))/0x3+-parseInt(_0x1dabad(0x1d2))/0x4*(parseInt(_0x1dabad(0x1ed))/0x5)+parseInt(_0x1dabad(0x1dc))/0x6*(-parseInt(_0x1dabad(0x1d9))/0x7)+-parseInt(_0x1dabad(0x1f7))/0x8+parseInt(_0x1dabad(0x1db))/0x9;if(_0x2c2f38===_0x2998f5)break;else _0x12d6ee['push'](_0x12d6ee['shift']());}catch(_0x34a42a){_0x12d6ee['push'](_0x12d6ee['shift']());}}}(a109_0x34d2,0x5b9b1));function a109_0x34d2(){const _0x44542f=['2885722ughRXq','Variable\x20name\x20\x22','12880998egGxjI','6ijJGYz','variables[','35293EkJuSQ','length','1517919shsXhF','TEMPLATE_MISSING_SUBJECT','TEMPLATE_INVALID_VARIABLES','TEMPLATE_MISSING_HTML_FILE','symbol','name','variables','test','TEMPLATE_INVALID_VARIABLE_NAME','success','TEMPLATE_INVALID_TYPE','warning','safeParse','5LObqCU','map','filter','TEMPLATE_MISSING_NAME','level','source','path','subject','push','startsWith','4673800NRNWbA','issues','error','1318458TNCSUD','type','TEMPLATE_MISSING_WORKSPACE','workspace','709988TTKLNS','TEMPLATE_SCHEMA_ERROR','Template\x20requires\x20subject\x20—\x20email\x20subject\x20line\x20template','html_file','\x22\x20must\x20not\x20contain\x20whitespace','document','No\x20workspace\x20specified\x20—\x20template\x20will\x20use\x20workspace\x20from\x20context\x20or\x20CLI\x20option'];a109_0x34d2=function(){return _0x44542f;};return a109_0x34d2();}import{TemplateDefSchema}from'./types/template-schema.js';import{formatZodPath,getLocationFromPath}from'../segment/yaml-validator.js';export function validateTemplateDef(_0x513815,_0x22a6b5={}){const _0x5f3625=a109_0x4b5d,_0x44292e=TemplateDefSchema[_0x5f3625(0x1ec)](_0x513815);if(_0x44292e[_0x5f3625(0x1e9)]){const _0x147ad8=runSemanticChecks(_0x44292e['data'],_0x22a6b5),_0x597f3e=_0x147ad8[_0x5f3625(0x1ef)](_0x4c3f29=>_0x4c3f29['level']===_0x5f3625(0x1cd)),_0x230842=_0x147ad8[_0x5f3625(0x1ef)](_0xb6dce3=>_0xb6dce3[_0x5f3625(0x1f1)]===_0x5f3625(0x1eb));return{'valid':_0x597f3e['length']===0x0,'errors':_0x597f3e,'warnings':_0x230842};}return zodErrorsToValidationResult(_0x44292e[_0x5f3625(0x1cd)],_0x22a6b5);}function zodErrorsToValidationResult(_0x498dec,_0x2f1207){const _0x5c3049=a109_0x4b5d,_0x3a0727=_0x498dec[_0x5c3049(0x1cc)][_0x5c3049(0x1ee)](_0xbe0cce=>{const _0x582dfd=_0x5c3049,_0x22281e=formatZodPath(_0xbe0cce[_0x582dfd(0x1f3)]),_0x432a0e=mapZodIssueToCode(_0xbe0cce,_0x22281e),_0x242d53=getLocationFromPath(_0x2f1207[_0x582dfd(0x1d7)],_0x2f1207['source'],_0xbe0cce['path'][_0x582dfd(0x1ee)](_0x3b69e6=>typeof _0x3b69e6===_0x582dfd(0x1e4)?String(_0x3b69e6):_0x3b69e6));return{'level':_0x582dfd(0x1cd),'path':_0x22281e,'code':_0x432a0e,'message':_0xbe0cce['message'],..._0x242d53&&{'location':_0x242d53}};});return{'valid':![],'errors':_0x3a0727,'warnings':[]};}function mapZodIssueToCode(_0x342e9c,_0x3430e2){const _0x441a43=a109_0x4b5d;if(_0x3430e2===_0x441a43(0x1e5))return _0x441a43(0x1f0);if(_0x3430e2===_0x441a43(0x1cf))return _0x441a43(0x1ea);if(_0x3430e2===_0x441a43(0x1e6)||_0x3430e2[_0x441a43(0x1f6)](_0x441a43(0x1e6)))return _0x441a43(0x1e2);return _0x441a43(0x1d3);}function a109_0x4b5d(_0xbfbd3f,_0x104513){_0xbfbd3f=_0xbfbd3f-0x1cc;const _0x34d235=a109_0x34d2();let _0x4b5d04=_0x34d235[_0xbfbd3f];return _0x4b5d04;}function runSemanticChecks(_0x4be751,_0x570188){const _0x288d78=a109_0x4b5d,_0x5bb0a6=[];!_0x4be751[_0x288d78(0x1d5)]&&_0x5bb0a6[_0x288d78(0x1f5)]({'level':_0x288d78(0x1cd),'path':_0x288d78(0x1d5),'code':_0x288d78(0x1e3),'message':'Template\x20requires\x20html_file\x20—\x20path\x20to\x20the\x20HTML\x20file\x20for\x20email\x20content','location':getLocationFromPath(_0x570188[_0x288d78(0x1d7)],_0x570188['source'],[_0x288d78(0x1e5)])});!_0x4be751[_0x288d78(0x1f4)]&&_0x5bb0a6[_0x288d78(0x1f5)]({'level':'error','path':_0x288d78(0x1f4),'code':_0x288d78(0x1e1),'message':_0x288d78(0x1d4),'location':getLocationFromPath(_0x570188[_0x288d78(0x1d7)],_0x570188['source'],[_0x288d78(0x1e5)])});!_0x4be751['workspace']&&_0x5bb0a6[_0x288d78(0x1f5)]({'level':_0x288d78(0x1eb),'path':_0x288d78(0x1d1),'code':_0x288d78(0x1d0),'message':_0x288d78(0x1d8),'location':getLocationFromPath(_0x570188[_0x288d78(0x1d7)],_0x570188['source'],[_0x288d78(0x1e5)])});for(let _0x2ed00d=0x0;_0x2ed00d<_0x4be751[_0x288d78(0x1e6)][_0x288d78(0x1df)];_0x2ed00d++){const _0x4ba498=_0x4be751[_0x288d78(0x1e6)][_0x2ed00d];/\s/[_0x288d78(0x1e7)](_0x4ba498[_0x288d78(0x1e5)])&&_0x5bb0a6[_0x288d78(0x1f5)]({'level':'error','path':_0x288d78(0x1dd)+_0x2ed00d+'].name','code':_0x288d78(0x1e8),'message':_0x288d78(0x1da)+_0x4ba498[_0x288d78(0x1e5)]+_0x288d78(0x1d6),'location':getLocationFromPath(_0x570188[_0x288d78(0x1d7)],_0x570188[_0x288d78(0x1f2)],[_0x288d78(0x1e6),_0x2ed00d,_0x288d78(0x1e5)])});}return _0x5bb0a6;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e18d9,_0x5252b0){const _0x4586cd=a110_0x371b,_0x8b5af3=_0x4e18d9();while(!![]){try{const _0x109913=parseInt(_0x4586cd(0xe9))/0x1+-parseInt(_0x4586cd(0xd5))/0x2+parseInt(_0x4586cd(0xe2))/0x3+parseInt(_0x4586cd(0xea))/0x4*(-parseInt(_0x4586cd(0xf1))/0x5)+parseInt(_0x4586cd(0xdb))/0x6*(parseInt(_0x4586cd(0xce))/0x7)+parseInt(_0x4586cd(0xe4))/0x8+parseInt(_0x4586cd(0xf7))/0x9;if(_0x109913===_0x5252b0)break;else _0x8b5af3['push'](_0x8b5af3['shift']());}catch(_0xacd536){_0x8b5af3['push'](_0x8b5af3['shift']());}}}(a110_0x4302,0xa2936));import*as a110_0x446530 from'yaml';import{safeParseYaml}from'../segment/yaml-validator.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{TemplateDefSchema}from'./types/template-schema.js';export function templateToDef(_0x5302de,_0x19714e){const _0x216d73=a110_0x371b,_0x3f29e7=_0x5302de['attributes'],_0x39ba7b=sanitizeTemplateFileName(_0x3f29e7[_0x216d73(0xdd)]);let _0x5cd02d,_0x413ef2,_0x115d1d,_0x572480;_0x3f29e7[_0x216d73(0xe3)]&&(_0x115d1d=_0x39ba7b+'.html',_0x5cd02d=_0x3f29e7[_0x216d73(0xe3)]);_0x3f29e7[_0x216d73(0xdf)]&&(_0x572480=_0x39ba7b+_0x216d73(0xee),_0x413ef2=_0x3f29e7[_0x216d73(0xdf)]);const _0x434b6b=_0x3f29e7['templateVariables']&&_0x3f29e7[_0x216d73(0xe7)][_0x216d73(0xd8)]>0x0,_0x111d07={'type':_0x216d73(0xef),'name':_0x3f29e7[_0x216d73(0xdd)],..._0x3f29e7[_0x216d73(0xf0)]&&{'subject':_0x3f29e7[_0x216d73(0xf0)]},..._0x19714e[_0x216d73(0xd3)]&&{'workspace':_0x19714e[_0x216d73(0xd3)]},..._0x3f29e7['editorType']&&{'editor_type':_0x3f29e7[_0x216d73(0xe6)]},..._0x115d1d&&{'html_file':_0x115d1d},..._0x572480&&{'plaintext_file':_0x572480},'variables':_0x434b6b?_0x3f29e7[_0x216d73(0xe7)][_0x216d73(0xd6)](templateVariableToYaml):[]};return{'def':_0x111d07,'htmlContent':_0x5cd02d,'plaintextContent':_0x413ef2};}export async function defToCreateInput(_0x2e408a,_0x399348){const _0x3d9bba=a110_0x371b,_0x5c9af3={'name':_0x2e408a[_0x3d9bba(0xdd)],'subjectTemplate':_0x2e408a[_0x3d9bba(0xde)]??'','htmlTemplate':''};return _0x2e408a[_0x3d9bba(0xe1)]&&(_0x5c9af3[_0x3d9bba(0xe5)]=await _0x399348[_0x3d9bba(0xec)](_0x2e408a[_0x3d9bba(0xe1)])),_0x2e408a[_0x3d9bba(0xd7)]&&(_0x5c9af3['editorType']=_0x2e408a['editor_type']),_0x2e408a[_0x3d9bba(0xe8)]&&(_0x5c9af3[_0x3d9bba(0xe3)]=await _0x399348[_0x3d9bba(0xcf)](_0x2e408a[_0x3d9bba(0xe8)])),_0x2e408a[_0x3d9bba(0xd2)]&&(_0x5c9af3[_0x3d9bba(0xdf)]=await _0x399348[_0x3d9bba(0xcf)](_0x2e408a['plaintext_file'])),_0x2e408a[_0x3d9bba(0xd0)][_0x3d9bba(0xd8)]>0x0&&(_0x5c9af3[_0x3d9bba(0xe7)]=_0x2e408a['variables'][_0x3d9bba(0xd6)](variableDefToApi)),_0x5c9af3;}function a110_0x4302(){const _0x1a8ce2=['subject','plaintextTemplate','some','workspace','1180176IGoUNC','htmlTemplate','7336832dusigI','workspaceId','editorType','templateVariables','html_file','551394fPAWvv','3126916ShDFVN','defaultValue','resolveWorkspaceId','variables:','.txt','template','subjectTemplate','5rrdRko','parse','display_name','previewValue','default_value','split','870129jEsixu','preview_value','303541ksHGHD','readFile','variables','push','plaintext_file','workspaceName','null','2409480hnEzzW','map','editor_type','length','trimStart','displayName','96sGBNpl','stringify','name'];a110_0x4302=function(){return _0x1a8ce2;};return a110_0x4302();}export async function defToUpdateInput(_0x1da0d5,_0x168bd6){const _0xbe0b1e=a110_0x371b,_0x252da7={};if(_0x1da0d5['name'])_0x252da7['name']=_0x1da0d5[_0xbe0b1e(0xdd)];if(_0x1da0d5[_0xbe0b1e(0xde)])_0x252da7[_0xbe0b1e(0xf0)]=_0x1da0d5[_0xbe0b1e(0xde)];return _0x1da0d5[_0xbe0b1e(0xe8)]&&(_0x252da7['htmlTemplate']=await _0x168bd6[_0xbe0b1e(0xcf)](_0x1da0d5['html_file'])),_0x1da0d5[_0xbe0b1e(0xd2)]&&(_0x252da7[_0xbe0b1e(0xdf)]=await _0x168bd6[_0xbe0b1e(0xcf)](_0x1da0d5['plaintext_file'])),_0x1da0d5[_0xbe0b1e(0xd0)][_0xbe0b1e(0xd8)]>0x0&&(_0x252da7[_0xbe0b1e(0xe7)]=_0x1da0d5[_0xbe0b1e(0xd0)][_0xbe0b1e(0xd6)](variableDefToApi)),_0x252da7;}export function toYamlString(_0x4b0885){const _0x154a83=a110_0x371b,_0x3b7312=JSON[_0x154a83(0xf2)](JSON[_0x154a83(0xdc)](_0x4b0885)),_0x5ea679=a110_0x446530[_0x154a83(0xdc)](_0x3b7312,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x154a83(0xd4)}),_0x489315=[_0x154a83(0xed)],_0x39a79f=_0x5ea679[_0x154a83(0xf6)]('\x0a'),_0x26b138=[];for(let _0x19a516=0x0;_0x19a516<_0x39a79f[_0x154a83(0xd8)];_0x19a516++){const _0x28e56b=_0x39a79f[_0x19a516][_0x154a83(0xd9)]();_0x19a516>0x0&&_0x489315[_0x154a83(0xe0)](_0x517421=>_0x28e56b['startsWith'](_0x517421))&&_0x26b138['length']>0x0&&_0x26b138[_0x26b138[_0x154a83(0xd8)]-0x1]!==''&&_0x26b138[_0x154a83(0xd1)](''),_0x26b138['push'](_0x39a79f[_0x19a516]);}return _0x26b138['join']('\x0a');}export function parseYamlString(_0x2af0e1){return safeParseYaml(_0x2af0e1,TemplateDefSchema);}export function normalizeDef(_0x559a03){const _0x1eb704=a110_0x371b;return{'type':'template','name':_0x559a03[_0x1eb704(0xdd)],..._0x559a03['subject']!==undefined&&{'subject':_0x559a03[_0x1eb704(0xde)]},..._0x559a03[_0x1eb704(0xe1)]!==undefined&&{'workspace':_0x559a03[_0x1eb704(0xe1)]},..._0x559a03[_0x1eb704(0xd7)]!==undefined&&{'editor_type':_0x559a03['editor_type']},..._0x559a03[_0x1eb704(0xe8)]!==undefined&&{'html_file':_0x559a03[_0x1eb704(0xe8)]},..._0x559a03['plaintext_file']!==undefined&&{'plaintext_file':_0x559a03['plaintext_file']},'variables':_0x559a03[_0x1eb704(0xd0)][_0x1eb704(0xd8)]>0x0?_0x559a03[_0x1eb704(0xd0)][_0x1eb704(0xd6)](_0x44055b=>({'name':_0x44055b[_0x1eb704(0xdd)],'display_name':_0x44055b[_0x1eb704(0xf3)],'preview_value':_0x44055b[_0x1eb704(0xcd)],..._0x44055b[_0x1eb704(0xf5)]!==undefined&&{'default_value':_0x44055b[_0x1eb704(0xf5)]}})):[]};}function variableDefToApi(_0x1eb916){const _0x4253b6=a110_0x371b;return{'name':_0x1eb916[_0x4253b6(0xdd)],'displayName':_0x1eb916[_0x4253b6(0xf3)],'previewValue':_0x1eb916[_0x4253b6(0xcd)],..._0x1eb916[_0x4253b6(0xf5)]!==undefined&&{'defaultValue':_0x1eb916[_0x4253b6(0xf5)]}};}function templateVariableToYaml(_0x12f0d3){const _0x3cc772=a110_0x371b;return{'name':_0x12f0d3[_0x3cc772(0xdd)],'display_name':_0x12f0d3[_0x3cc772(0xda)],'preview_value':_0x12f0d3[_0x3cc772(0xf4)],..._0x12f0d3[_0x3cc772(0xeb)]!==undefined&&{'default_value':_0x12f0d3[_0x3cc772(0xeb)]}};}function a110_0x371b(_0x23ce53,_0x174b36){_0x23ce53=_0x23ce53-0xcd;const _0x430237=a110_0x4302();let _0x371bbe=_0x430237[_0x23ce53];return _0x371bbe;}export const sanitizeTemplateFileName=sanitizeFileName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x321ecc,_0x45841f){var _0x5cdc4f=a111_0x3187,_0x501ca6=_0x321ecc();while(!![]){try{var _0x273cda=-parseInt(_0x5cdc4f(0x178))/0x1*(-parseInt(_0x5cdc4f(0x173))/0x2)+parseInt(_0x5cdc4f(0x17a))/0x3*(parseInt(_0x5cdc4f(0x171))/0x4)+parseInt(_0x5cdc4f(0x179))/0x5+parseInt(_0x5cdc4f(0x172))/0x6+parseInt(_0x5cdc4f(0x174))/0x7*(-parseInt(_0x5cdc4f(0x175))/0x8)+-parseInt(_0x5cdc4f(0x17b))/0x9*(parseInt(_0x5cdc4f(0x176))/0xa)+-parseInt(_0x5cdc4f(0x177))/0xb;if(_0x273cda===_0x45841f)break;else _0x501ca6['push'](_0x501ca6['shift']());}catch(_0x91dbc){_0x501ca6['push'](_0x501ca6['shift']());}}}(a111_0x19e7,0xbca94));function a111_0x3187(_0x36b1dc,_0x15c1a6){_0x36b1dc=_0x36b1dc-0x171;var _0x19e74f=a111_0x19e7();var _0x31870c=_0x19e74f[_0x36b1dc];return _0x31870c;}function a111_0x19e7(){var _0x4a68bc=['12308888FJWSGO','480rbYxqJ','8802376pHMvIF','52iYhoKa','2976995WIlwmS','247083UBikoX','43047SvZqzI','68cZCMBM','7031394BemPSq','6682UzdyJy','7fUBXcz'];a111_0x19e7=function(){return _0x4a68bc;};return a111_0x19e7();}export{CampaignDefSchema,EmailDefSchema,PushContentDefSchema,ScheduleDefSchema,ColumnMappingDefSchema,ConnectorDefSchema,ActivationSettingsDefSchema,UtmDefSchema,NotificationsDefSchema,TemplateVariableDefSchema}from'./campaign-schema.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a112_0x6e6368=a112_0x54e2;(function(_0x5ed451,_0xed132e){const _0x176e81=a112_0x54e2,_0xff974=_0x5ed451();while(!![]){try{const _0x277f2f=parseInt(_0x176e81(0x14f))/0x1*(-parseInt(_0x176e81(0x14d))/0x2)+parseInt(_0x176e81(0x164))/0x3*(parseInt(_0x176e81(0x150))/0x4)+parseInt(_0x176e81(0x15e))/0x5*(parseInt(_0x176e81(0x152))/0x6)+-parseInt(_0x176e81(0x151))/0x7*(-parseInt(_0x176e81(0x158))/0x8)+parseInt(_0x176e81(0x153))/0x9*(-parseInt(_0x176e81(0x157))/0xa)+-parseInt(_0x176e81(0x15c))/0xb*(-parseInt(_0x176e81(0x161))/0xc)+-parseInt(_0x176e81(0x15b))/0xd*(-parseInt(_0x176e81(0x165))/0xe);if(_0x277f2f===_0xed132e)break;else _0xff974['push'](_0xff974['shift']());}catch(_0x35a65b){_0xff974['push'](_0xff974['shift']());}}}(a112_0x4962,0x6ae89));function a112_0x4962(){const _0x103599=['33745uHxTIb','optional','array','84OcoDmF','object','string','14559nvvkOr','4773412YQRtms','1419356ZRpoOv','number','1eMfGUh','488cJigGv','28WVCder','102aZkPKv','5057145SbFzyt','campaign','Campaign\x20name\x20is\x20required','boolean','10eFhaqC','89944BrXWZH','default','push','26RxaKFI','433389EehzCX','literal'];a112_0x4962=function(){return _0x103599;};return a112_0x4962();}import{z}from'zod';export const TemplateVariableDefSchema=z['object']({'name':z['string'](),'display_name':z['string']()[a112_0x6e6368(0x15f)](),'preview_value':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'default_value':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)]()});export const EmailDefSchema=z[a112_0x6e6368(0x162)]({'template':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'subject':z[a112_0x6e6368(0x163)]()['optional'](),'html_file':z['string']()[a112_0x6e6368(0x15f)](),'plaintext_file':z[a112_0x6e6368(0x163)]()['optional'](),'sender_id':z['string']()[a112_0x6e6368(0x15f)](),'variables':z[a112_0x6e6368(0x160)](TemplateVariableDefSchema)[a112_0x6e6368(0x15f)]()});export const PushContentDefSchema=z[a112_0x6e6368(0x162)]({'title':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'message':z['string']()[a112_0x6e6368(0x15f)](),'push_type':z[a112_0x6e6368(0x163)]()['optional'](),'image_url':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'on_click_behavior':z['string']()[a112_0x6e6368(0x15f)](),'on_click_behavior_url':z['string']()[a112_0x6e6368(0x15f)]()});export const ScheduleDefSchema=z[a112_0x6e6368(0x162)]({'start_at':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'timezone':z[a112_0x6e6368(0x163)]()['optional']()});export const ColumnMappingDefSchema=z[a112_0x6e6368(0x162)]({'column':z['string'](),'source':z[a112_0x6e6368(0x163)]()});export const ConnectorDefSchema=z[a112_0x6e6368(0x162)]({'all_columns':z[a112_0x6e6368(0x156)]()[a112_0x6e6368(0x15f)](),'columns':z[a112_0x6e6368(0x160)](ColumnMappingDefSchema)[a112_0x6e6368(0x15f)]()});export const ActivationSettingsDefSchema=z['object']({'enabled':z[a112_0x6e6368(0x156)]()[a112_0x6e6368(0x15f)](),'workflow_project':z['string']()[a112_0x6e6368(0x15f)](),'workflow_name':z['string']()[a112_0x6e6368(0x15f)]()});export const UtmDefSchema=z[a112_0x6e6368(0x162)]({'enabled':z[a112_0x6e6368(0x156)]()[a112_0x6e6368(0x15f)](),'id':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'medium':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'source':z['string']()[a112_0x6e6368(0x15f)](),'source_platform':z['string']()[a112_0x6e6368(0x15f)](),'campaign':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'marketing_tactic':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)]()});export const NotificationsDefSchema=z[a112_0x6e6368(0x162)]({'events':z['array'](z['string']())[a112_0x6e6368(0x15f)](),'recipients':z[a112_0x6e6368(0x160)](z[a112_0x6e6368(0x14e)]())['optional']()});function a112_0x54e2(_0x125cb1,_0x413270){_0x125cb1=_0x125cb1-0x14d;const _0x4962dd=a112_0x4962();let _0x54e2ab=_0x4962dd[_0x125cb1];return _0x54e2ab;}export const CampaignDefSchema=z['object']({'type':z[a112_0x6e6368(0x15d)](a112_0x6e6368(0x154))[a112_0x6e6368(0x159)](a112_0x6e6368(0x154)),'name':z[a112_0x6e6368(0x163)]()['min'](0x1,a112_0x6e6368(0x155)),'campaign_type':z['enum'](['email',a112_0x6e6368(0x15a)]),'description':z[a112_0x6e6368(0x163)]()['optional'](),'workspace':z[a112_0x6e6368(0x163)]()['optional'](),'audience':z['string']()[a112_0x6e6368(0x15f)](),'segment':z[a112_0x6e6368(0x163)]()[a112_0x6e6368(0x15f)](),'email':EmailDefSchema['optional'](),'push':PushContentDefSchema[a112_0x6e6368(0x15f)](),'schedule':ScheduleDefSchema[a112_0x6e6368(0x15f)](),'connector':ConnectorDefSchema[a112_0x6e6368(0x15f)](),'activation':ActivationSettingsDefSchema[a112_0x6e6368(0x15f)](),'utm':UtmDefSchema['optional'](),'notifications':NotificationsDefSchema[a112_0x6e6368(0x15f)]()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a113_0x5bcf54=a113_0x31d6;(function(_0x36b758,_0x128e4d){const _0x5165b3=a113_0x31d6,_0x252a31=_0x36b758();while(!![]){try{const _0x854dfa=parseInt(_0x5165b3(0xb4))/0x1+-parseInt(_0x5165b3(0xaf))/0x2+parseInt(_0x5165b3(0xae))/0x3*(parseInt(_0x5165b3(0xb2))/0x4)+parseInt(_0x5165b3(0xb0))/0x5+-parseInt(_0x5165b3(0xab))/0x6*(-parseInt(_0x5165b3(0xa8))/0x7)+-parseInt(_0x5165b3(0xa9))/0x8*(parseInt(_0x5165b3(0xa3))/0x9)+parseInt(_0x5165b3(0xb1))/0xa;if(_0x854dfa===_0x128e4d)break;else _0x252a31['push'](_0x252a31['shift']());}catch(_0x3ed27d){_0x252a31['push'](_0x252a31['shift']());}}}(a113_0xe39c,0x1b1d9));import{z}from'zod';function a113_0x31d6(_0xdbb71e,_0x8656da){_0xdbb71e=_0xdbb71e-0xa3;const _0xe39c7f=a113_0xe39c();let _0x31d667=_0xe39c7f[_0xdbb71e];return _0x31d667;}export const TemplateVariableDefSchema=z[a113_0x5bcf54(0xa6)]({'name':z['string']()[a113_0x5bcf54(0xac)](0x1,a113_0x5bcf54(0xa4)),'display_name':z[a113_0x5bcf54(0xa7)]()[a113_0x5bcf54(0xac)](0x1,a113_0x5bcf54(0xaa)),'preview_value':z['string']()[a113_0x5bcf54(0xac)](0x1,'Variable\x20preview_value\x20is\x20required'),'default_value':z[a113_0x5bcf54(0xa7)]()[a113_0x5bcf54(0xa5)]()});export const TemplateDefSchema=z['object']({'type':z['literal']('template')[a113_0x5bcf54(0xad)](a113_0x5bcf54(0xb3)),'name':z[a113_0x5bcf54(0xa7)]()[a113_0x5bcf54(0xac)](0x1,'Template\x20name\x20is\x20required'),'subject':z[a113_0x5bcf54(0xa7)]()[a113_0x5bcf54(0xa5)](),'html_file':z[a113_0x5bcf54(0xa7)]()[a113_0x5bcf54(0xa5)](),'plaintext_file':z[a113_0x5bcf54(0xa7)]()[a113_0x5bcf54(0xa5)](),'workspace':z['string']()[a113_0x5bcf54(0xa5)](),'editor_type':z[a113_0x5bcf54(0xa7)]()[a113_0x5bcf54(0xa5)](),'variables':z['array'](TemplateVariableDefSchema)['default']([])});function a113_0xe39c(){const _0x309c60=['48488gTbPCX','9Mmztrm','Variable\x20name\x20is\x20required','optional','object','string','140dxDigz','1017776xvWtdk','Variable\x20display_name\x20is\x20required','26430vBlStk','min','default','26220TDcRuV','2732SgVnTZ','108820YmVUqp','725610hWnCck','4lZdagM','template'];a113_0xe39c=function(){return _0x309c60;};return a113_0xe39c();}
|