@treasuredata/tdx 2026.3.7 → 2026.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +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.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.d.ts.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/profiles-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/user-command.js.map +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.d.ts +2 -2
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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.d.ts +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.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/delivery.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a101_0x2ef24d=a101_0x4387;function a101_0x4387(_0x450d8c,_0x4a3d08){_0x450d8c=_0x450d8c-0x12f;const _0x497a52=a101_0x497a();let _0x438704=_0x497a52[_0x450d8c];return _0x438704;}(function(_0x5d574c,_0x2fbd32){const _0x442dfb=a101_0x4387,_0x5c252f=_0x5d574c();while(!![]){try{const _0x146fd7=parseInt(_0x442dfb(0x133))/0x1*(parseInt(_0x442dfb(0x141))/0x2)+-parseInt(_0x442dfb(0x12f))/0x3*(-parseInt(_0x442dfb(0x144))/0x4)+parseInt(_0x442dfb(0x131))/0x5*(-parseInt(_0x442dfb(0x13c))/0x6)+-parseInt(_0x442dfb(0x130))/0x7+parseInt(_0x442dfb(0x132))/0x8+parseInt(_0x442dfb(0x136))/0x9*(parseInt(_0x442dfb(0x139))/0xa)+parseInt(_0x442dfb(0x140))/0xb*(-parseInt(_0x442dfb(0x134))/0xc);if(_0x146fd7===_0x2fbd32)break;else _0x5c252f['push'](_0x5c252f['shift']());}catch(_0x3d90bb){_0x5c252f['push'](_0x5c252f['shift']());}}}(a101_0x497a,0x1d8be));import{DeliveryApiClient}from'./client/delivery-api-client.js';function a101_0x497a(){const _0x56b5ad=['data','workspaceId','map','451JtfvTY','4ztmCRa','fromAddress','isArray','47356fyWHSF','attributes','ensureArray','42shBRLL','977557mRMbCt','695230fGxrLn','483128uCoWwt','114891RWUitV','44916PkgXMU','limit','9RAaOfi','createdAt','listEmailSenders','972630wJzYKd','client','normalizeEmailSender','6CsRouH'];a101_0x497a=function(){return _0x56b5ad;};return a101_0x497a();}export class DeliverySDK{[a101_0x2ef24d(0x13a)];constructor(_0x537cdd){const _0x1a1a89=a101_0x2ef24d;this[_0x1a1a89(0x13a)]=new DeliveryApiClient(_0x537cdd);}[a101_0x2ef24d(0x146)](_0x1acd07){const _0x2c58c3=a101_0x2ef24d;return Array[_0x2c58c3(0x143)](_0x1acd07)?_0x1acd07:[_0x1acd07];}['normalizeEmailSender'](_0x275481){const _0x40dff3=a101_0x2ef24d;return{'id':_0x275481['id'],'name':_0x275481[_0x40dff3(0x145)]['name'],'fromAddress':_0x275481[_0x40dff3(0x145)][_0x40dff3(0x142)],'fromDisplayName':_0x275481[_0x40dff3(0x145)]['fromDisplayName'],'workspaceId':_0x275481['attributes'][_0x40dff3(0x13e)],'createdAt':_0x275481[_0x40dff3(0x145)][_0x40dff3(0x137)],'updatedAt':_0x275481['attributes']['updatedAt']};}async['listEmailSenders'](_0x2a5830){const _0x24db72=a101_0x2ef24d,_0xa707f=await this['client'][_0x24db72(0x138)]({'workspaceId':_0x2a5830?.['workspaceId'],'limit':_0x2a5830?.[_0x24db72(0x135)]}),_0x5c8904=this[_0x24db72(0x146)](_0xa707f[_0x24db72(0x13d)]);return _0x5c8904[_0x24db72(0x13f)](_0x51b838=>this[_0x24db72(0x13b)](_0x51b838));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a102_0x2c41ce=a102_0x5e39;function a102_0x20c5(){const _0x2ee69b=['259153wjRzYO','658620duYasX','Processing\x20campaign\x20','push','361719KxJVsG','315840FoqBQo','segmentId','listFolders','.yaml','200MRmHTa','update','progress','listCampaigns','get','.html','attributes','Fetching\x20campaigns\x20(','\x20so\x20far)...','segment','8934NPQVkA','cwd','campaignType','12kNSDck','925352UWAWIc','audienceId','Fetching\x20campaigns...','campaigns','utf-8','join','segmentFolderId','.txt','campaignName','workspaceId','1040046EXGcTA','name','length','filter','tdx.json','hasChanges','getSegment','isNew','getWorkspace','set','Resolving\x20workspace...','7kPVieh'];a102_0x20c5=function(){return _0x2ee69b;};return a102_0x20c5();}(function(_0x2e2792,_0x26e1c7){const _0x531b01=a102_0x5e39,_0xf6b964=_0x2e2792();while(!![]){try{const _0xe7eea0=-parseInt(_0x531b01(0xde))/0x1+-parseInt(_0x531b01(0xdf))/0x2+-parseInt(_0x531b01(0xc4))/0x3*(parseInt(_0x531b01(0xc7))/0x4)+-parseInt(_0x531b01(0xe3))/0x5+parseInt(_0x531b01(0xd2))/0x6+-parseInt(_0x531b01(0xdd))/0x7*(parseInt(_0x531b01(0xc8))/0x8)+parseInt(_0x531b01(0xe2))/0x9*(parseInt(_0x531b01(0xe7))/0xa);if(_0xe7eea0===_0x26e1c7)break;else _0xf6b964['push'](_0xf6b964['shift']());}catch(_0x37d04c){_0xf6b964['push'](_0xf6b964['shift']());}}}(a102_0x20c5,0x310df));import a102_0x6c0637 from'path';import{existsSync,readFileSync}from'fs';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=a102_0x2c41ce(0xcb),API_PAGE_LIMIT=0x64;export async function pullCampaigns(_0x4c1843,_0x3edf11,_0x2b419c={}){const _0x2c8b7c=a102_0x2c41ce,{engage:_0x2cfe89}=_0x4c1843;_0x2b419c[_0x2c8b7c(0xe9)]?.[_0x2c8b7c(0xe8)](_0x2c8b7c(0xdc));const _0x44efc3=await _0x2cfe89[_0x2c8b7c(0xda)](_0x3edf11),_0xa8404c=_0x44efc3['name'],_0x5d994c=_0x44efc3['id'],_0x4afe37=_0x2b419c['targetDir']||a102_0x6c0637[_0x2c8b7c(0xcd)](process[_0x2c8b7c(0xc5)](),CAMPAIGNS_DIR,sanitizeCampaignFileName(_0xa8404c));_0x2b419c[_0x2c8b7c(0xe9)]?.[_0x2c8b7c(0xe8)](_0x2c8b7c(0xca));const _0x3e002d=await listAllCampaigns(_0x2cfe89,{'workspaceId':_0x5d994c,'type':_0x2b419c[_0x2c8b7c(0xc6)],'progress':_0x2b419c[_0x2c8b7c(0xe9)]});let _0x5619af=_0x3e002d;_0x2b419c[_0x2c8b7c(0xd0)]&&(_0x5619af=_0x5619af[_0x2c8b7c(0xd5)](_0x449a2f=>_0x449a2f[_0x2c8b7c(0xd3)]===_0x2b419c[_0x2c8b7c(0xd0)]));const _0xa33a9d=[];let _0x4de57c=0x0;const _0x1f488d=new Map();for(const _0x550c79 of _0x5619af){_0x4de57c++,_0x2b419c[_0x2c8b7c(0xe9)]?.[_0x2c8b7c(0xe8)](_0x2c8b7c(0xe0)+_0x4de57c+'/'+_0x5619af[_0x2c8b7c(0xd4)]+':\x20'+_0x550c79[_0x2c8b7c(0xd3)]);const _0x108763=await _0x2cfe89['getCampaignFull'](_0x550c79['id']);let _0x5ef704;_0x4c1843[_0x2c8b7c(0xc3)]&&_0x108763['attributes'][_0x2c8b7c(0xc9)]&&_0x108763['attributes'][_0x2c8b7c(0xe4)]&&(_0x5ef704=await resolveSegmentFolderPath(_0x4c1843[_0x2c8b7c(0xc3)],_0x108763['attributes'][_0x2c8b7c(0xc9)],_0x108763[_0x2c8b7c(0xed)][_0x2c8b7c(0xe4)],_0x1f488d));const {def:_0x22f310,htmlContent:_0x1a4987,plaintextContent:_0x15057a}=campaignToDef(_0x108763,{'workspaceName':_0xa8404c,'segmentFolderPath':_0x5ef704}),_0xaf8c80=normalizeDef(_0x22f310),_0x2a63c2=sanitizeCampaignFileName(_0xaf8c80[_0x2c8b7c(0xd3)]),_0x1ce323=toYamlString(_0xaf8c80);_0xa33a9d[_0x2c8b7c(0xe1)](prepareFile(_0x4afe37,_0x2a63c2+_0x2c8b7c(0xe6),_0x1ce323)),_0x1a4987&&_0xa33a9d['push'](prepareFile(_0x4afe37,_0x2a63c2+_0x2c8b7c(0xec),_0x1a4987)),_0x15057a&&_0xa33a9d[_0x2c8b7c(0xe1)](prepareFile(_0x4afe37,_0x2a63c2+_0x2c8b7c(0xcf),_0x15057a));}const _0x2f1ef8=createEngageTdxConfigContent(_0xa8404c);_0xa33a9d[_0x2c8b7c(0xe1)](prepareFile(_0x4afe37,_0x2c8b7c(0xd6),_0x2f1ef8));const _0x2868c2=_0xa33a9d['filter'](_0x1cd3f5=>_0x1cd3f5[_0x2c8b7c(0xd9)])['length'],_0x3d1044=_0xa33a9d[_0x2c8b7c(0xd5)](_0x2ba102=>!_0x2ba102['isNew']&&_0x2ba102[_0x2c8b7c(0xd7)])[_0x2c8b7c(0xd4)],_0x97c566=_0xa33a9d[_0x2c8b7c(0xd5)](_0x3fda4c=>!_0x3fda4c[_0x2c8b7c(0xd9)]&&!_0x3fda4c[_0x2c8b7c(0xd7)])[_0x2c8b7c(0xd4)];return{'workspaceName':_0xa8404c,'workspaceId':_0x5d994c,'targetDir':_0x4afe37,'files':_0xa33a9d,'counts':{'campaigns':_0x5619af['length']},'newFiles':_0x2868c2,'changedFiles':_0x3d1044,'unchangedFiles':_0x97c566};}function a102_0x5e39(_0xcf9892,_0x22717b){_0xcf9892=_0xcf9892-0xc2;const _0x20c543=a102_0x20c5();let _0x5e39fa=_0x20c543[_0xcf9892];return _0x5e39fa;}function prepareFile(_0x1e88a6,_0x259421,_0x56f8cb){const _0x4b6c16=a102_0x2c41ce,_0xf96618=a102_0x6c0637['join'](_0x1e88a6,_0x259421),_0x1cd0e1=!existsSync(_0xf96618);let _0x4190d3=_0x1cd0e1,_0x496646;if(!_0x1cd0e1){const _0x301641=readFileSync(_0xf96618,_0x4b6c16(0xcc)),_0x425d5d=generateDiff(_0x301641,_0x56f8cb);_0x4190d3=hasChanges(_0x425d5d),_0x4190d3&&(_0x496646=formatDiffWithColors(_0x425d5d));}return{'relativePath':_0x259421,'absolutePath':_0xf96618,'content':_0x56f8cb,'isNew':_0x1cd0e1,'hasChanges':_0x4190d3,'diff':_0x496646};}async function listAllCampaigns(_0x1538ea,_0x1b242b){const _0x289591=a102_0x2c41ce,_0x33b824=[];let _0x362768=0x0;while(!![]){const _0x14877e=await _0x1538ea[_0x289591(0xea)]({'workspaceId':_0x1b242b[_0x289591(0xd1)],'type':_0x1b242b['type'],'limit':API_PAGE_LIMIT,'offset':_0x362768});_0x33b824[_0x289591(0xe1)](..._0x14877e);if(_0x14877e['length']<API_PAGE_LIMIT)break;_0x362768+=API_PAGE_LIMIT,_0x1b242b[_0x289591(0xe9)]?.[_0x289591(0xe8)](_0x289591(0xee)+_0x33b824[_0x289591(0xd4)]+_0x289591(0xc2));}return _0x33b824;}async function resolveSegmentFolderPath(_0x26208e,_0x2163bb,_0x1b6b26,_0x1e227d){const _0x595885=a102_0x2c41ce;try{let _0xf7bd11=_0x1e227d['get'](_0x2163bb);if(!_0xf7bd11){const _0x1bf6ce=await _0x26208e[_0x595885(0xe5)](_0x2163bb);_0xf7bd11=buildFolderIdToPathMap(_0x1bf6ce),_0x1e227d[_0x595885(0xdb)](_0x2163bb,_0xf7bd11);}const _0x3ad972=await _0x26208e[_0x595885(0xd8)](_0x2163bb,_0x1b6b26);if(!_0x3ad972[_0x595885(0xce)])return undefined;return _0xf7bd11[_0x595885(0xeb)](_0x3ad972[_0x595885(0xce)])||undefined;}catch{return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a103_0x381a(){const _0x500cbf=['3708887RGZGdP','campaign','relative','parentId','Pushing\x20','createInput','segment','Resolving\x20references\x20','segmentName','dirname','create','1058856vndTnE','updateInput','progress','created','message','10PfkHIS','update','812495DBHGGG','resolvePathToResource','resolveWorkspaceId','12LgFoas','action','fileDir','name','utf-8','engage','536157rTAaoQ','def','534714ZbOGlc','2tXXvdI','workspaceId','735777LGQfRY','existingId','2810512prisZY','push','results','length','resolveTemplateId','updated','listCampaigns','updateCampaign','Fetching\x20existing\x20campaigns...'];a103_0x381a=function(){return _0x500cbf;};return a103_0x381a();}(function(_0x593129,_0xcec5c2){const _0xd5b6dd=a103_0x4d89,_0x202c85=_0x593129();while(!![]){try{const _0x45e3c6=parseInt(_0xd5b6dd(0x150))/0x1+-parseInt(_0xd5b6dd(0x153))/0x2*(-parseInt(_0xd5b6dd(0x152))/0x3)+-parseInt(_0xd5b6dd(0x140))/0x4+-parseInt(_0xd5b6dd(0x147))/0x5*(parseInt(_0xd5b6dd(0x14a))/0x6)+parseInt(_0xd5b6dd(0x160))/0x7+-parseInt(_0xd5b6dd(0x157))/0x8+parseInt(_0xd5b6dd(0x155))/0x9*(parseInt(_0xd5b6dd(0x145))/0xa);if(_0x45e3c6===_0xcec5c2)break;else _0x202c85['push'](_0x202c85['shift']());}catch(_0xe7fc65){_0x202c85['push'](_0x202c85['shift']());}}}(a103_0x381a,0x5dfc3));import a103_0x3ff672 from'path';import{readFileSync}from'fs';import{parseYamlString,defToCreateInput,defToUpdateInput}from'./campaign-yaml.js';import{findYamlFiles}from'../segment/file-discovery.js';function a103_0x4d89(_0x3f22c0,_0x3f3f25){_0x3f22c0=_0x3f22c0-0x13e;const _0x381a4e=a103_0x381a();let _0x4d894f=_0x381a4e[_0x3f22c0];return _0x4d894f;}export function discoverCampaignFiles(_0x54e0bd){const _0x4612b0=findYamlFiles(_0x54e0bd);return _0x4612b0['filter'](_0x6c1022=>{const _0x1d4572=a103_0x4d89;try{const _0x101026=readFileSync(_0x6c1022,_0x1d4572(0x14e)),_0x169d15=parseYamlString(_0x101026);return _0x169d15['type']===_0x1d4572(0x161);}catch{return![];}});}export function parseCampaignFile(_0x2146a6,_0x390116){const _0x50db81=a103_0x4d89,_0x116c08=readFileSync(_0x2146a6,_0x50db81(0x14e)),_0x24230d=parseYamlString(_0x116c08),_0x4586ce=a103_0x3ff672[_0x50db81(0x162)](_0x390116,_0x2146a6),_0x158c31=a103_0x3ff672[_0x50db81(0x13e)](_0x2146a6);return{'yamlPath':_0x2146a6,'relativePath':_0x4586ce,'def':_0x24230d,'dir':_0x158c31};}export async function preparePush(_0x1a4119,_0xc8ef34,_0x48c249,_0x5bcfd3={}){const _0x5a3d11=a103_0x4d89,{engage:_0x195183}=_0x1a4119;_0x5bcfd3['progress']?.[_0x5a3d11(0x146)](_0x5a3d11(0x15f));const _0xc9f6af=await listAllCampaigns(_0x195183,_0x48c249),_0x14cde8=new Map();for(const _0xaee8cf of _0xc9f6af){_0x14cde8['set'](_0xaee8cf['name'],_0xaee8cf);}const _0x48f0f3=[];for(const _0x287975 of _0xc8ef34){const _0x2670a3=_0x14cde8['get'](_0x287975['def'][_0x5a3d11(0x14d)]);_0x48f0f3['push']({'def':_0x287975[_0x5a3d11(0x151)],'fileDir':_0x287975['dir'],'action':_0x2670a3?'update':_0x5a3d11(0x13f),'existingId':_0x2670a3?.['id']});}return _0x48f0f3;}export async function resolveAndBuildInputs(_0x362e32,_0x3ecc71,_0x13c346,_0x1cea64={}){const _0x1d5394=a103_0x4d89;for(let _0x1f9cfa=0x0;_0x1f9cfa<_0x3ecc71[_0x1d5394(0x15a)];_0x1f9cfa++){const _0x2e1b12=_0x3ecc71[_0x1f9cfa];_0x1cea64['progress']?.[_0x1d5394(0x146)](_0x1d5394(0x167)+(_0x1f9cfa+0x1)+'/'+_0x3ecc71['length']+':\x20'+_0x2e1b12[_0x1d5394(0x151)][_0x1d5394(0x14d)]);const _0x551d71=createResolveContext(_0x362e32,_0x13c346,_0x2e1b12[_0x1d5394(0x14c)]);_0x2e1b12[_0x1d5394(0x14b)]===_0x1d5394(0x13f)?(_0x2e1b12['createInput']=await defToCreateInput(_0x2e1b12['def'],_0x551d71),!_0x2e1b12['createInput'][_0x1d5394(0x154)]&&(_0x2e1b12[_0x1d5394(0x165)][_0x1d5394(0x154)]=_0x13c346)):_0x2e1b12[_0x1d5394(0x141)]=await defToUpdateInput(_0x2e1b12[_0x1d5394(0x151)],_0x551d71);}}export async function executePush(_0x5ec6f1,_0x899215,_0x141dce={}){const _0x34a5aa=a103_0x4d89,_0x25cb2b={'results':[],'created':0x0,'updated':0x0,'unchanged':0x0,'errors':[]};if(_0x141dce['dryRun']){for(const _0x24c99f of _0x899215){_0x24c99f[_0x34a5aa(0x14b)]===_0x34a5aa(0x13f)?(_0x25cb2b[_0x34a5aa(0x159)][_0x34a5aa(0x158)]({'name':_0x24c99f[_0x34a5aa(0x151)]['name'],'action':_0x34a5aa(0x143)}),_0x25cb2b[_0x34a5aa(0x143)]++):(_0x25cb2b[_0x34a5aa(0x159)][_0x34a5aa(0x158)]({'name':_0x24c99f['def'][_0x34a5aa(0x14d)],'action':_0x34a5aa(0x15c)}),_0x25cb2b['updated']++);}return _0x25cb2b;}const {engage:_0x2bcb9f}=_0x5ec6f1;for(let _0x86a9ad=0x0;_0x86a9ad<_0x899215[_0x34a5aa(0x15a)];_0x86a9ad++){const _0x587bb1=_0x899215[_0x86a9ad];_0x141dce[_0x34a5aa(0x142)]?.[_0x34a5aa(0x146)](_0x34a5aa(0x164)+(_0x86a9ad+0x1)+'/'+_0x899215[_0x34a5aa(0x15a)]+':\x20'+_0x587bb1[_0x34a5aa(0x151)][_0x34a5aa(0x14d)]);try{if(_0x587bb1[_0x34a5aa(0x14b)]==='create'&&_0x587bb1[_0x34a5aa(0x165)]){const _0x580404=await _0x2bcb9f['createCampaign'](_0x587bb1['createInput']);_0x25cb2b[_0x34a5aa(0x159)][_0x34a5aa(0x158)]({'name':_0x587bb1[_0x34a5aa(0x151)][_0x34a5aa(0x14d)],'action':'created','campaignId':_0x580404['id']}),_0x25cb2b[_0x34a5aa(0x143)]++;}else{if(_0x587bb1[_0x34a5aa(0x14b)]===_0x34a5aa(0x146)&&_0x587bb1[_0x34a5aa(0x141)]&&_0x587bb1['existingId']){const _0x362739=await _0x2bcb9f[_0x34a5aa(0x15e)](_0x587bb1[_0x34a5aa(0x156)],_0x587bb1['updateInput']);_0x25cb2b[_0x34a5aa(0x159)][_0x34a5aa(0x158)]({'name':_0x587bb1[_0x34a5aa(0x151)][_0x34a5aa(0x14d)],'action':_0x34a5aa(0x15c),'campaignId':_0x362739['id']}),_0x25cb2b['updated']++;}}}catch(_0x540f12){const _0x557612=_0x540f12 instanceof Error?_0x540f12[_0x34a5aa(0x144)]:String(_0x540f12);_0x25cb2b['errors'][_0x34a5aa(0x158)]({'name':_0x587bb1['def']['name'],'error':_0x557612});}}return _0x25cb2b;}function createResolveContext(_0x3152bf,_0x3eac90,_0x5f005b){return{'resolveWorkspaceId':async _0x5e7bdc=>{const _0x22af19=a103_0x4d89;return await _0x3152bf[_0x22af19(0x14f)][_0x22af19(0x149)](_0x5e7bdc);},'resolveTemplateId':async(_0x56c436,_0x2453bb)=>{const _0x342ef3=a103_0x4d89;return await _0x3152bf['engage'][_0x342ef3(0x15b)](_0x56c436,_0x2453bb??_0x3eac90);},'resolveSegmentPath':async _0x11cf99=>{const _0x113af6=a103_0x4d89,_0x44edc1=await _0x3152bf[_0x113af6(0x166)][_0x113af6(0x148)](_0x11cf99);return{'audienceId':_0x44edc1[_0x113af6(0x163)],'audienceName':_0x44edc1['parentName'],'segmentId':_0x44edc1['segmentId'],'segmentName':_0x44edc1[_0x113af6(0x168)]};},'readFile':async _0x1fa933=>{const _0x2bc440=a103_0x3ff672['join'](_0x5f005b,_0x1fa933);return readFileSync(_0x2bc440,'utf-8');}};}const API_PAGE_LIMIT=0x64;async function listAllCampaigns(_0x36d149,_0x37890c){const _0xbaec8e=a103_0x4d89,_0x202295=[];let _0x183cb8=0x0;while(!![]){const _0x55902d=await _0x36d149[_0xbaec8e(0x15d)]({'workspaceId':_0x37890c,'limit':API_PAGE_LIMIT,'offset':_0x183cb8});_0x202295[_0xbaec8e(0x158)](..._0x55902d);if(_0x55902d[_0xbaec8e(0x15a)]<API_PAGE_LIMIT)break;_0x183cb8+=API_PAGE_LIMIT;}return _0x202295;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x331fa0,_0x45cde3){const _0x2330d9=a104_0x8a7a,_0x2c1ba7=_0x331fa0();while(!![]){try{const _0xe0c583=parseInt(_0x2330d9(0x121))/0x1+-parseInt(_0x2330d9(0x10d))/0x2*(-parseInt(_0x2330d9(0x104))/0x3)+-parseInt(_0x2330d9(0x123))/0x4*(-parseInt(_0x2330d9(0x126))/0x5)+-parseInt(_0x2330d9(0x117))/0x6+parseInt(_0x2330d9(0x12f))/0x7+parseInt(_0x2330d9(0x11c))/0x8+-parseInt(_0x2330d9(0x11f))/0x9*(parseInt(_0x2330d9(0x110))/0xa);if(_0xe0c583===_0x45cde3)break;else _0x2c1ba7['push'](_0x2c1ba7['shift']());}catch(_0x85f7ba){_0x2c1ba7['push'](_0x2c1ba7['shift']());}}}(a104_0x2d83,0xaad2c));import{CampaignDefSchema}from'./types/campaign-def.js';import{formatZodPath,getLocationFromPath}from'../segment/yaml-validator.js';function a104_0x2d83(){const _0xedb1e9=['4369141HbPIOd','warning','email.template','CAMPAIGN_MISSING_SENDER_ID','CAMPAIGN_SCHEMA_ERROR','name','3doiepO','\x20must\x20use\x20ref:\x20prefix\x20(e.g.,\x20ref:Name)\x20—\x20got\x20\x22','CAMPAIGN_INVALID_CONNECTOR','path','Email\x20campaign\x20requires\x20an\x20email\x20section','CAMPAIGN_MISSING_CONTENT','audience','html_file','Push\x20campaign\x20has\x20an\x20email\x20section\x20but\x20no\x20push\x20section','1392068ihTAPP','email','CAMPAIGN_CONTENT_MISMATCH','22340HWqhKM','message','success','campaign_type','error','value','source','6582114BozWai','type','length','startsWith','CAMPAIGN_MISSING_NAME','2496048VpwONq','CAMPAIGN_INVALID_TYPE','document','6894YPaxmB','map','965824nMslZu','CAMPAIGN_INVALID_REF','454964ksJpyK','filter','data','40sdSISj','level','template','push','CAMPAIGN_MISSING_HTML_FILE','segment','issues','symbol','Email\x20campaign\x20requires\x20email.template\x20—\x20use\x20ref:Template_Name\x20to\x20reference\x20an\x20existing\x20template'];a104_0x2d83=function(){return _0xedb1e9;};return a104_0x2d83();}export function validateCampaignDef(_0xd621a2,_0x4b0abb={}){const _0x1b90be=a104_0x8a7a,_0xb33b58=CampaignDefSchema['safeParse'](_0xd621a2);if(_0xb33b58[_0x1b90be(0x112)]){const _0x4ed42f=runSemanticChecks(_0xb33b58[_0x1b90be(0x125)],_0x4b0abb),_0x34855d=_0x4ed42f[_0x1b90be(0x124)](_0x3df8cd=>_0x3df8cd[_0x1b90be(0x127)]===_0x1b90be(0x114)),_0x3183d1=_0x4ed42f[_0x1b90be(0x124)](_0x3e24b9=>_0x3e24b9[_0x1b90be(0x127)]===_0x1b90be(0x130));return{'valid':_0x34855d[_0x1b90be(0x119)]===0x0,'errors':_0x34855d,'warnings':_0x3183d1};}return zodErrorsToValidationResult(_0xb33b58[_0x1b90be(0x114)],_0x4b0abb);}function zodErrorsToValidationResult(_0x12831c,_0x37503a){const _0x3a592a=a104_0x8a7a,_0x493e60=_0x12831c[_0x3a592a(0x12c)][_0x3a592a(0x120)](_0x41a8f8=>{const _0x49b6db=_0x3a592a,_0x59b47e=formatZodPath(_0x41a8f8[_0x49b6db(0x107)]),_0x1c3a8c=mapZodIssueToCode(_0x41a8f8,_0x59b47e),_0x353bcc=getLocationFromPath(_0x37503a['document'],_0x37503a[_0x49b6db(0x116)],_0x41a8f8[_0x49b6db(0x107)][_0x49b6db(0x120)](_0x38ad74=>typeof _0x38ad74===_0x49b6db(0x12d)?String(_0x38ad74):_0x38ad74));return{'level':_0x49b6db(0x114),'path':_0x59b47e,'code':_0x1c3a8c,'message':_0x41a8f8[_0x49b6db(0x111)],..._0x353bcc&&{'location':_0x353bcc}};});return{'valid':![],'errors':_0x493e60,'warnings':[]};}function mapZodIssueToCode(_0xced96d,_0xce3f3e){const _0x1ec3de=a104_0x8a7a;if(_0xce3f3e===_0x1ec3de(0x103))return _0x1ec3de(0x11b);if(_0xce3f3e===_0x1ec3de(0x118))return _0x1ec3de(0x11d);if(_0xce3f3e['startsWith']('connector'))return _0x1ec3de(0x106);return _0x1ec3de(0x102);}function a104_0x8a7a(_0x2f9da3,_0x25fe14){_0x2f9da3=_0x2f9da3-0x102;const _0x2d833f=a104_0x2d83();let _0x8a7a40=_0x2d833f[_0x2f9da3];return _0x8a7a40;}function runSemanticChecks(_0x369969,_0x5ccec1){const _0x4655e1=a104_0x8a7a,_0x1f2a79=[];_0x369969[_0x4655e1(0x113)]===_0x4655e1(0x10e)&&!_0x369969[_0x4655e1(0x10e)]&&_0x1f2a79[_0x4655e1(0x129)]({'level':_0x4655e1(0x114),'path':_0x4655e1(0x10e),'code':_0x4655e1(0x109),'message':_0x4655e1(0x108),'location':getLocationFromPath(_0x5ccec1[_0x4655e1(0x11e)],_0x5ccec1[_0x4655e1(0x116)],[_0x4655e1(0x113)])});_0x369969[_0x4655e1(0x113)]===_0x4655e1(0x129)&&!_0x369969[_0x4655e1(0x129)]&&_0x1f2a79[_0x4655e1(0x129)]({'level':_0x4655e1(0x114),'path':_0x4655e1(0x129),'code':_0x4655e1(0x109),'message':'Push\x20campaign\x20requires\x20a\x20push\x20section','location':getLocationFromPath(_0x5ccec1[_0x4655e1(0x11e)],_0x5ccec1['source'],['campaign_type'])});_0x369969[_0x4655e1(0x113)]===_0x4655e1(0x10e)&&_0x369969[_0x4655e1(0x10e)]&&!_0x369969[_0x4655e1(0x10e)][_0x4655e1(0x10b)]&&_0x1f2a79['push']({'level':'error','path':'email.html_file','code':_0x4655e1(0x12a),'message':'Email\x20campaign\x20requires\x20html_file\x20—\x20path\x20to\x20the\x20HTML\x20file\x20for\x20email\x20content','location':getLocationFromPath(_0x5ccec1[_0x4655e1(0x11e)],_0x5ccec1[_0x4655e1(0x116)],['email'])});_0x369969['campaign_type']==='email'&&_0x369969['email']&&!_0x369969[_0x4655e1(0x10e)][_0x4655e1(0x128)]&&_0x1f2a79[_0x4655e1(0x129)]({'level':_0x4655e1(0x114),'path':'email.template','code':'CAMPAIGN_MISSING_TEMPLATE','message':_0x4655e1(0x12e),'location':getLocationFromPath(_0x5ccec1['document'],_0x5ccec1[_0x4655e1(0x116)],[_0x4655e1(0x10e)])});_0x369969[_0x4655e1(0x113)]===_0x4655e1(0x10e)&&_0x369969[_0x4655e1(0x10e)]&&!_0x369969['email']['sender_id']&&_0x1f2a79[_0x4655e1(0x129)]({'level':_0x4655e1(0x130),'path':'email.sender_id','code':_0x4655e1(0x132),'message':'Email\x20campaign\x20requires\x20email.sender_id\x20for\x20launch\x20—\x20sender\x20profile\x20UUID\x20from\x20delivery-api','location':getLocationFromPath(_0x5ccec1['document'],_0x5ccec1['source'],['email'])});const _0x3f35fd=[{'path':_0x4655e1(0x131),'value':_0x369969[_0x4655e1(0x10e)]?.[_0x4655e1(0x128)],'yamlPath':[_0x4655e1(0x10e),_0x4655e1(0x128)]},{'path':'audience','value':_0x369969[_0x4655e1(0x10a)],'yamlPath':['audience']},{'path':'segment','value':_0x369969[_0x4655e1(0x12b)],'yamlPath':[_0x4655e1(0x12b)]}];for(const _0x14c490 of _0x3f35fd){_0x14c490[_0x4655e1(0x115)]&&!_0x14c490[_0x4655e1(0x115)][_0x4655e1(0x11a)]('ref:')&&_0x1f2a79[_0x4655e1(0x129)]({'level':'error','path':_0x14c490[_0x4655e1(0x107)],'code':_0x4655e1(0x122),'message':_0x14c490[_0x4655e1(0x107)]+_0x4655e1(0x105)+_0x14c490['value']+'\x22','location':getLocationFromPath(_0x5ccec1['document'],_0x5ccec1[_0x4655e1(0x116)],_0x14c490['yamlPath'])});}return _0x369969[_0x4655e1(0x113)]==='email'&&_0x369969[_0x4655e1(0x129)]&&!_0x369969[_0x4655e1(0x10e)]&&_0x1f2a79['push']({'level':_0x4655e1(0x130),'path':_0x4655e1(0x129),'code':_0x4655e1(0x10f),'message':'Email\x20campaign\x20has\x20a\x20push\x20section\x20but\x20no\x20email\x20section','location':getLocationFromPath(_0x5ccec1[_0x4655e1(0x11e)],_0x5ccec1[_0x4655e1(0x116)],[_0x4655e1(0x129)])}),_0x369969[_0x4655e1(0x113)]==='push'&&_0x369969[_0x4655e1(0x10e)]&&!_0x369969[_0x4655e1(0x129)]&&_0x1f2a79[_0x4655e1(0x129)]({'level':'warning','path':'email','code':_0x4655e1(0x10f),'message':_0x4655e1(0x10c),'location':getLocationFromPath(_0x5ccec1['document'],_0x5ccec1[_0x4655e1(0x116)],['email'])}),_0x1f2a79;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a105_0x37de03=a105_0x128b;(function(_0x289772,_0x12b89e){const _0x1b7879=a105_0x128b,_0x36fad6=_0x289772();while(!![]){try{const _0x4b73f7=parseInt(_0x1b7879(0x205))/0x1*(parseInt(_0x1b7879(0x1c6))/0x2)+-parseInt(_0x1b7879(0x1ee))/0x3+-parseInt(_0x1b7879(0x1ea))/0x4+parseInt(_0x1b7879(0x1b6))/0x5+-parseInt(_0x1b7879(0x1b2))/0x6+-parseInt(_0x1b7879(0x1f3))/0x7+-parseInt(_0x1b7879(0x1ae))/0x8*(-parseInt(_0x1b7879(0x1bc))/0x9);if(_0x4b73f7===_0x12b89e)break;else _0x36fad6['push'](_0x36fad6['shift']());}catch(_0x52fe1d){_0x36fad6['push'](_0x36fad6['shift']());}}}(a105_0x5024,0x3a4a7));import*as a105_0x292c62 from'yaml';import{safeParseYaml}from'../segment/yaml-validator.js';import{CampaignDefSchema}from'./types/campaign-def.js';const REF_PREFIX=a105_0x37de03(0x1f9);function toRef(_0x1971e6){return''+REF_PREFIX+_0x1971e6;}function a105_0x128b(_0x5e49da,_0x2bdf5c){_0x5e49da=_0x5e49da-0x19c;const _0x502446=a105_0x5024();let _0x128b0a=_0x502446[_0x5e49da];return _0x128b0a;}function isRef(_0x1833cc){const _0x65cace=a105_0x37de03;return _0x1833cc[_0x65cace(0x19c)](REF_PREFIX);}function parseRef(_0xc95a8c){const _0x1e9d6e=a105_0x37de03;if(!isRef(_0xc95a8c))return _0xc95a8c;return _0xc95a8c[_0x1e9d6e(0x1bf)](REF_PREFIX[_0x1e9d6e(0x1bd)]);}export function campaignToDef(_0x16fef3,_0x140c35){const _0x5813f0=a105_0x37de03,_0x104d91=_0x16fef3['attributes'],_0x11cea2=sanitizeCampaignFileName(_0x104d91['name']),_0x30b4c6={'type':'campaign','name':_0x104d91[_0x5813f0(0x1ec)],'campaign_type':_0x104d91[_0x5813f0(0x1a0)],..._0x104d91[_0x5813f0(0x201)]&&{'description':_0x104d91[_0x5813f0(0x201)]},..._0x140c35[_0x5813f0(0x1f1)]&&{'workspace':_0x140c35[_0x5813f0(0x1f1)]}};_0x104d91[_0x5813f0(0x1b5)]&&(_0x30b4c6['audience']=toRef(_0x104d91[_0x5813f0(0x1b5)]));if(_0x104d91[_0x5813f0(0x1f0)]){const _0x37a224=_0x140c35[_0x5813f0(0x1f7)]?_0x140c35[_0x5813f0(0x1f7)]+'/'+_0x104d91['segmentName']:_0x104d91[_0x5813f0(0x1f0)];_0x30b4c6[_0x5813f0(0x1b7)]=toRef(_0x37a224);}let _0x2d349a,_0x5e084f;if(_0x104d91[_0x5813f0(0x1c7)]){const _0x299799={};_0x104d91[_0x5813f0(0x1c7)]['sourceEmailTemplateName']&&(_0x299799[_0x5813f0(0x208)]=toRef(_0x104d91[_0x5813f0(0x1c7)][_0x5813f0(0x1ba)])),_0x104d91['emailContent'][_0x5813f0(0x1e2)]&&(_0x299799[_0x5813f0(0x1d3)]=_0x104d91['emailContent'][_0x5813f0(0x1e2)]),_0x104d91[_0x5813f0(0x1c7)][_0x5813f0(0x1a4)]&&(_0x299799[_0x5813f0(0x1ed)]=_0x104d91[_0x5813f0(0x1c7)][_0x5813f0(0x1a4)]),_0x104d91[_0x5813f0(0x1c7)]['htmlTemplate']&&(_0x299799['html_file']=_0x11cea2+_0x5813f0(0x1e4),_0x2d349a=_0x104d91[_0x5813f0(0x1c7)][_0x5813f0(0x1db)]),_0x104d91[_0x5813f0(0x1c7)][_0x5813f0(0x209)]&&(_0x299799[_0x5813f0(0x1a2)]=_0x11cea2+_0x5813f0(0x1d7),_0x5e084f=_0x104d91[_0x5813f0(0x1c7)]['plaintextTemplate']),_0x104d91[_0x5813f0(0x1c7)][_0x5813f0(0x20c)]&&_0x104d91[_0x5813f0(0x1c7)][_0x5813f0(0x20c)]['length']>0x0&&(_0x299799[_0x5813f0(0x1be)]=_0x104d91[_0x5813f0(0x1c7)][_0x5813f0(0x20c)][_0x5813f0(0x1f4)](templateVariableToYaml)),Object[_0x5813f0(0x1d8)](_0x299799)[_0x5813f0(0x1bd)]>0x0&&(_0x30b4c6[_0x5813f0(0x1d2)]=_0x299799);}if(_0x104d91['pushContent']){const _0x294c31=pushContentToYaml(_0x104d91['pushContent']);Object[_0x5813f0(0x1d8)](_0x294c31)['length']>0x0&&(_0x30b4c6[_0x5813f0(0x1ca)]=_0x294c31);}if(_0x104d91[_0x5813f0(0x1ad)]||_0x104d91[_0x5813f0(0x1a1)]){const _0x17a07f={};if(_0x104d91[_0x5813f0(0x1ad)])_0x17a07f[_0x5813f0(0x1d6)]=_0x104d91[_0x5813f0(0x1ad)];if(_0x104d91[_0x5813f0(0x1a1)])_0x17a07f['timezone']=_0x104d91['timezone'];_0x30b4c6[_0x5813f0(0x1e8)]=_0x17a07f;}const _0x3c60dc=connectorToYaml(_0x104d91);_0x3c60dc&&(_0x30b4c6[_0x5813f0(0x202)]=_0x3c60dc);const _0x26c2e6=activationSettingsToYaml(_0x104d91);_0x26c2e6&&(_0x30b4c6['activation']=_0x26c2e6);_0x104d91['enableUtmTracking']&&_0x104d91[_0x5813f0(0x1ff)]&&(_0x30b4c6[_0x5813f0(0x1c2)]=utmToYaml(_0x104d91[_0x5813f0(0x1ff)],_0x104d91[_0x5813f0(0x1e7)]));if(_0x104d91[_0x5813f0(0x1da)]&&_0x104d91[_0x5813f0(0x1da)][_0x5813f0(0x1bd)]>0x0||_0x104d91['emailRecipients']&&_0x104d91[_0x5813f0(0x1e0)][_0x5813f0(0x1bd)]>0x0){const _0x3cfe4b={};if(_0x104d91[_0x5813f0(0x1da)]&&_0x104d91[_0x5813f0(0x1da)][_0x5813f0(0x1bd)]>0x0)_0x3cfe4b[_0x5813f0(0x1c5)]=_0x104d91['notifyOn'];if(_0x104d91[_0x5813f0(0x1e0)]&&_0x104d91[_0x5813f0(0x1e0)]['length']>0x0)_0x3cfe4b['recipients']=_0x104d91[_0x5813f0(0x1e0)];_0x30b4c6[_0x5813f0(0x1f5)]=_0x3cfe4b;}return{'def':_0x30b4c6,'htmlContent':_0x2d349a,'plaintextContent':_0x5e084f};}export async function defToCreateInput(_0x5bbe29,_0x69031a){const _0x2645d7=a105_0x37de03,_0x4e983c={'name':_0x5bbe29['name'],'campaignType':_0x5bbe29['campaign_type']};_0x5bbe29[_0x2645d7(0x1d1)]&&(_0x4e983c[_0x2645d7(0x1a3)]=await _0x69031a['resolveWorkspaceId'](_0x5bbe29[_0x2645d7(0x1d1)]));_0x5bbe29[_0x2645d7(0x201)]&&(_0x4e983c['description']=_0x5bbe29[_0x2645d7(0x201)]);await resolveSegmentRefs(_0x5bbe29,_0x4e983c,_0x69031a);_0x5bbe29[_0x2645d7(0x1d2)]&&(_0x4e983c[_0x2645d7(0x1c7)]=await emailDefToApi(_0x5bbe29[_0x2645d7(0x1d2)],_0x4e983c['workspaceId'],_0x69031a));_0x5bbe29[_0x2645d7(0x1ca)]&&(_0x4e983c[_0x2645d7(0x1b3)]=pushDefToApi(_0x5bbe29[_0x2645d7(0x1ca)]));_0x5bbe29[_0x2645d7(0x202)]&&(_0x4e983c[_0x2645d7(0x1ac)]=connectorDefToApi(_0x5bbe29[_0x2645d7(0x202)]),_0x5bbe29[_0x2645d7(0x202)][_0x2645d7(0x1b9)]!==undefined&&(_0x4e983c[_0x2645d7(0x1a8)]=_0x5bbe29[_0x2645d7(0x202)][_0x2645d7(0x1b9)]),_0x5bbe29[_0x2645d7(0x202)][_0x2645d7(0x1cf)]&&(_0x4e983c['columns']=_0x5bbe29['connector']['columns']['map'](_0x415883=>({'column':_0x415883['column'],'source':{'column':_0x415883[_0x2645d7(0x204)]}}))));if(_0x5bbe29[_0x2645d7(0x1e8)]){if(_0x5bbe29[_0x2645d7(0x1e8)][_0x2645d7(0x1d6)])_0x4e983c[_0x2645d7(0x1ad)]=_0x5bbe29[_0x2645d7(0x1e8)]['start_at'];if(_0x5bbe29['schedule'][_0x2645d7(0x1a1)])_0x4e983c['timezone']=_0x5bbe29[_0x2645d7(0x1e8)][_0x2645d7(0x1a1)];}return _0x5bbe29['utm']&&(_0x4e983c[_0x2645d7(0x1e7)]=_0x5bbe29[_0x2645d7(0x1c2)]['enabled']??![]),_0x4e983c;}export async function defToUpdateInput(_0x52ec4f,_0x2e5eeb){const _0x560ab8=a105_0x37de03,_0x40a487={};if(_0x52ec4f['name'])_0x40a487['name']=_0x52ec4f[_0x560ab8(0x1ec)];if(_0x52ec4f[_0x560ab8(0x201)]!==undefined)_0x40a487[_0x560ab8(0x201)]=_0x52ec4f[_0x560ab8(0x201)];await resolveSegmentRefs(_0x52ec4f,_0x40a487,_0x2e5eeb);if(_0x52ec4f['email']){const _0x59f290=_0x52ec4f[_0x560ab8(0x1d1)]?await _0x2e5eeb[_0x560ab8(0x1c0)](_0x52ec4f[_0x560ab8(0x1d1)]):undefined;_0x40a487[_0x560ab8(0x1c7)]=await emailDefToApi(_0x52ec4f['email'],_0x59f290,_0x2e5eeb);}_0x52ec4f[_0x560ab8(0x1ca)]&&(_0x40a487[_0x560ab8(0x1b3)]=pushDefToApi(_0x52ec4f[_0x560ab8(0x1ca)]));_0x52ec4f[_0x560ab8(0x202)]&&(_0x40a487[_0x560ab8(0x1ac)]=connectorDefToApi(_0x52ec4f['connector']),_0x52ec4f[_0x560ab8(0x202)][_0x560ab8(0x1b9)]!==undefined&&(_0x40a487['allColumns']=_0x52ec4f[_0x560ab8(0x202)][_0x560ab8(0x1b9)]),_0x52ec4f[_0x560ab8(0x202)][_0x560ab8(0x1cf)]&&(_0x40a487[_0x560ab8(0x1cf)]=_0x52ec4f[_0x560ab8(0x202)][_0x560ab8(0x1cf)][_0x560ab8(0x1f4)](_0x46de4c=>({'column':_0x46de4c[_0x560ab8(0x20a)],'source':{'column':_0x46de4c['source']}}))));if(_0x52ec4f['schedule']){if(_0x52ec4f[_0x560ab8(0x1e8)][_0x560ab8(0x1d6)])_0x40a487[_0x560ab8(0x1ad)]=_0x52ec4f[_0x560ab8(0x1e8)][_0x560ab8(0x1d6)];if(_0x52ec4f['schedule'][_0x560ab8(0x1a1)])_0x40a487['timezone']=_0x52ec4f[_0x560ab8(0x1e8)][_0x560ab8(0x1a1)];}return _0x52ec4f[_0x560ab8(0x1c2)]&&(_0x40a487[_0x560ab8(0x1e7)]=_0x52ec4f[_0x560ab8(0x1c2)][_0x560ab8(0x1d9)]??![]),_0x40a487;}export function toYamlString(_0x43f564){const _0x42014f=a105_0x37de03,_0xd74ce0=JSON[_0x42014f(0x200)](JSON[_0x42014f(0x1d5)](_0x43f564)),_0x476073=a105_0x292c62[_0x42014f(0x1d5)](_0xd74ce0,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x3682e5=[_0x42014f(0x1f6),_0x42014f(0x1e3),_0x42014f(0x1c4),_0x42014f(0x19d),_0x42014f(0x1fa),_0x42014f(0x1a5),'utm:',_0x42014f(0x1a6)],_0x202f54=_0x476073[_0x42014f(0x20b)]('\x0a'),_0x4fd1e3=[];for(let _0x1d8d38=0x0;_0x1d8d38<_0x202f54['length'];_0x1d8d38++){const _0x37c2fb=_0x202f54[_0x1d8d38][_0x42014f(0x1fb)]();_0x1d8d38>0x0&&_0x3682e5[_0x42014f(0x1b8)](_0xe1a024=>_0x37c2fb[_0x42014f(0x19c)](_0xe1a024))&&_0x4fd1e3[_0x42014f(0x1bd)]>0x0&&_0x4fd1e3[_0x4fd1e3[_0x42014f(0x1bd)]-0x1]!==''&&_0x4fd1e3[_0x42014f(0x1ca)](''),_0x4fd1e3['push'](_0x202f54[_0x1d8d38]);}return _0x4fd1e3['join']('\x0a');}export function parseYamlString(_0x63fefc){return safeParseYaml(_0x63fefc,CampaignDefSchema);}export function normalizeDef(_0x33eda7){const _0x254d15=a105_0x37de03;return{'type':'campaign','name':_0x33eda7[_0x254d15(0x1ec)],'campaign_type':_0x33eda7['campaign_type'],..._0x33eda7['description']!==undefined&&{'description':_0x33eda7[_0x254d15(0x201)]},..._0x33eda7[_0x254d15(0x1d1)]!==undefined&&{'workspace':_0x33eda7[_0x254d15(0x1d1)]},..._0x33eda7[_0x254d15(0x1aa)]!==undefined&&{'audience':_0x33eda7[_0x254d15(0x1aa)]},..._0x33eda7['segment']!==undefined&&{'segment':_0x33eda7[_0x254d15(0x1b7)]},..._0x33eda7[_0x254d15(0x1d2)]&&{'email':normalizeEmailDef(_0x33eda7['email'])},..._0x33eda7[_0x254d15(0x1ca)]&&{'push':normalizePushDef(_0x33eda7['push'])},..._0x33eda7[_0x254d15(0x1e8)]&&{'schedule':normalizeScheduleDef(_0x33eda7['schedule'])},..._0x33eda7[_0x254d15(0x202)]&&{'connector':normalizeConnectorDef(_0x33eda7[_0x254d15(0x202)])},..._0x33eda7[_0x254d15(0x1e5)]&&{'activation':normalizeActivationDef(_0x33eda7[_0x254d15(0x1e5)])},..._0x33eda7[_0x254d15(0x1c2)]&&{'utm':normalizeUtmDef(_0x33eda7[_0x254d15(0x1c2)])},..._0x33eda7[_0x254d15(0x1f5)]&&{'notifications':normalizeNotificationsDef(_0x33eda7[_0x254d15(0x1f5)])}};}function templateVariableToYaml(_0x3676a7){const _0x239fc5=a105_0x37de03;return{'name':_0x3676a7[_0x239fc5(0x1ec)],..._0x3676a7['displayName']&&{'display_name':_0x3676a7[_0x239fc5(0x1de)]},..._0x3676a7[_0x239fc5(0x1ce)]&&{'preview_value':_0x3676a7[_0x239fc5(0x1ce)]},..._0x3676a7[_0x239fc5(0x1ab)]&&{'default_value':_0x3676a7[_0x239fc5(0x1ab)]}};}function pushContentToYaml(_0x2ada61){const _0x53a763=a105_0x37de03;return{..._0x2ada61['title']&&{'title':_0x2ada61[_0x53a763(0x1c9)]},..._0x2ada61[_0x53a763(0x1d0)]&&{'message':_0x2ada61[_0x53a763(0x1d0)]},..._0x2ada61['pushType']&&{'push_type':_0x2ada61[_0x53a763(0x1dc)]},..._0x2ada61['imageUrl']&&{'image_url':_0x2ada61[_0x53a763(0x1f2)]},..._0x2ada61[_0x53a763(0x206)]&&{'on_click_behavior':_0x2ada61[_0x53a763(0x206)]},..._0x2ada61[_0x53a763(0x1eb)]&&{'on_click_behavior_url':_0x2ada61[_0x53a763(0x1eb)]}};}function connectorToYaml(_0x130684){const _0x3b7b90=a105_0x37de03,_0x1ae2b3=_0x130684[_0x3b7b90(0x1c3)],_0x1f55e9=_0x130684['columns']&&_0x130684['columns']['length']>0x0;if(!_0x1ae2b3&&!_0x1f55e9&&!_0x130684[_0x3b7b90(0x1a8)])return undefined;const _0x3d3a2e={};return _0x130684[_0x3b7b90(0x1a8)]!==undefined&&(_0x3d3a2e['all_columns']=_0x130684['allColumns']),_0x130684['columns']&&_0x130684[_0x3b7b90(0x1cf)]['length']>0x0&&(_0x3d3a2e[_0x3b7b90(0x1cf)]=_0x130684[_0x3b7b90(0x1cf)][_0x3b7b90(0x1f4)](columnMappingToYaml)),_0x3d3a2e;}function columnMappingToYaml(_0x44f14b){const _0x43d99f=a105_0x37de03;return{'column':_0x44f14b[_0x43d99f(0x20a)],'source':_0x44f14b['source'][_0x43d99f(0x20a)]};}function activationSettingsToYaml(_0x251d79){const _0x19cb37=a105_0x37de03;if(!_0x251d79[_0x19cb37(0x1e9)]&&!_0x251d79['workflowProjectName']&&!_0x251d79[_0x19cb37(0x1a9)])return undefined;return{..._0x251d79[_0x19cb37(0x1e9)]!==undefined&&{'enabled':_0x251d79[_0x19cb37(0x1e9)]},..._0x251d79[_0x19cb37(0x1b1)]&&{'workflow_project':_0x251d79['workflowProjectName']},..._0x251d79[_0x19cb37(0x1a9)]&&{'workflow_name':_0x251d79['workflowName']}};}function utmToYaml(_0x1c771e,_0x46b825){const _0x480259=a105_0x37de03;return{'enabled':_0x46b825,..._0x1c771e[_0x480259(0x1c1)]&&{'id':_0x1c771e[_0x480259(0x1c1)]},..._0x1c771e[_0x480259(0x1cb)]&&{'medium':_0x1c771e[_0x480259(0x1cb)]},..._0x1c771e['utmSource']&&{'source':_0x1c771e[_0x480259(0x19e)]},..._0x1c771e['utmSourcePlatform']&&{'source_platform':_0x1c771e['utmSourcePlatform']},..._0x1c771e[_0x480259(0x1f8)]&&{'campaign':_0x1c771e[_0x480259(0x1f8)]},..._0x1c771e[_0x480259(0x1c8)]&&{'marketing_tactic':_0x1c771e[_0x480259(0x1c8)]}};}async function resolveSegmentRefs(_0x2ea09a,_0x40fe83,_0x144b6a){const _0x2173f0=a105_0x37de03;if(_0x2ea09a[_0x2173f0(0x1aa)]){const _0x196a4c=parseRef(_0x2ea09a['audience']),_0x46b493=_0x2ea09a['segment']?parseRef(_0x2ea09a[_0x2173f0(0x1b7)]):undefined,_0x2cf17b=_0x46b493?_0x196a4c+'/'+_0x46b493:_0x196a4c,_0x2190d8=await _0x144b6a['resolveSegmentPath'](_0x2cf17b);_0x40fe83[_0x2173f0(0x1b0)]=_0x2190d8['audienceId'],_0x40fe83[_0x2173f0(0x1b5)]=_0x2190d8[_0x2173f0(0x1b5)],_0x2190d8['segmentId']&&(_0x40fe83[_0x2173f0(0x207)]=_0x2190d8[_0x2173f0(0x207)],_0x40fe83[_0x2173f0(0x1f0)]=_0x2190d8[_0x2173f0(0x1f0)]);}}async function emailDefToApi(_0x2cd16b,_0xa26e53,_0x2a2d29){const _0x6bf856=a105_0x37de03;let _0x406963='',_0x49400d;if(_0x2cd16b[_0x6bf856(0x208)]){const _0x1ea693=parseRef(_0x2cd16b[_0x6bf856(0x208)]),_0xca3eb0=await _0x2a2d29[_0x6bf856(0x1cc)](_0x1ea693,_0xa26e53);_0x406963=_0xca3eb0['id'],_0x49400d=_0xca3eb0[_0x6bf856(0x1ec)];}let _0xedebb6;_0x2cd16b[_0x6bf856(0x1af)]&&(_0xedebb6=await _0x2a2d29[_0x6bf856(0x203)](_0x2cd16b[_0x6bf856(0x1af)]));let _0xd6578e;return _0x2cd16b[_0x6bf856(0x1a2)]&&(_0xd6578e=await _0x2a2d29[_0x6bf856(0x203)](_0x2cd16b[_0x6bf856(0x1a2)])),{'sourceEmailTemplateId':_0x406963,..._0x49400d&&{'sourceEmailTemplateName':_0x49400d},..._0x2cd16b[_0x6bf856(0x1d3)]&&{'subjectTemplate':_0x2cd16b[_0x6bf856(0x1d3)]},..._0xedebb6&&{'htmlTemplate':_0xedebb6},..._0xd6578e&&{'plaintextTemplate':_0xd6578e},..._0x2cd16b[_0x6bf856(0x1ed)]&&{'emailSenderId':_0x2cd16b['sender_id']}};}function pushDefToApi(_0x296cc8){const _0x8ffc43=a105_0x37de03;return{..._0x296cc8[_0x8ffc43(0x1c9)]&&{'title':_0x296cc8['title']},..._0x296cc8[_0x8ffc43(0x1d0)]&&{'message':_0x296cc8['message']},..._0x296cc8['push_type']&&{'pushType':_0x296cc8['push_type']},..._0x296cc8[_0x8ffc43(0x19f)]&&{'imageUrl':_0x296cc8[_0x8ffc43(0x19f)]},..._0x296cc8['on_click_behavior']&&{'onClickBehavior':_0x296cc8[_0x8ffc43(0x1df)]},..._0x296cc8[_0x8ffc43(0x1cd)]&&{'onClickBehaviorUrl':_0x296cc8[_0x8ffc43(0x1cd)]}};}function connectorDefToApi(_0x285b92){return{};}function normalizeEmailDef(_0x100b92){const _0x2bc243=a105_0x37de03;return{..._0x100b92[_0x2bc243(0x208)]!==undefined&&{'template':_0x100b92[_0x2bc243(0x208)]},..._0x100b92[_0x2bc243(0x1d3)]!==undefined&&{'subject':_0x100b92[_0x2bc243(0x1d3)]},..._0x100b92[_0x2bc243(0x1af)]!==undefined&&{'html_file':_0x100b92[_0x2bc243(0x1af)]},..._0x100b92[_0x2bc243(0x1a2)]!==undefined&&{'plaintext_file':_0x100b92[_0x2bc243(0x1a2)]},..._0x100b92[_0x2bc243(0x1ed)]!==undefined&&{'sender_id':_0x100b92['sender_id']},..._0x100b92[_0x2bc243(0x1be)]&&{'variables':_0x100b92[_0x2bc243(0x1be)]['map'](_0x57009a=>({'name':_0x57009a[_0x2bc243(0x1ec)],..._0x57009a[_0x2bc243(0x1fd)]!==undefined&&{'display_name':_0x57009a[_0x2bc243(0x1fd)]},..._0x57009a[_0x2bc243(0x1fc)]!==undefined&&{'preview_value':_0x57009a['preview_value']},..._0x57009a[_0x2bc243(0x20e)]!==undefined&&{'default_value':_0x57009a[_0x2bc243(0x20e)]}}))}};}function normalizePushDef(_0xf228ee){const _0x5947ee=a105_0x37de03;return{..._0xf228ee[_0x5947ee(0x1c9)]!==undefined&&{'title':_0xf228ee[_0x5947ee(0x1c9)]},..._0xf228ee[_0x5947ee(0x1d0)]!==undefined&&{'message':_0xf228ee[_0x5947ee(0x1d0)]},..._0xf228ee[_0x5947ee(0x1dd)]!==undefined&&{'push_type':_0xf228ee[_0x5947ee(0x1dd)]},..._0xf228ee[_0x5947ee(0x19f)]!==undefined&&{'image_url':_0xf228ee['image_url']},..._0xf228ee['on_click_behavior']!==undefined&&{'on_click_behavior':_0xf228ee[_0x5947ee(0x1df)]},..._0xf228ee['on_click_behavior_url']!==undefined&&{'on_click_behavior_url':_0xf228ee[_0x5947ee(0x1cd)]}};}function normalizeScheduleDef(_0x3f5e1d){const _0x582de9=a105_0x37de03;return{..._0x3f5e1d[_0x582de9(0x1d6)]!==undefined&&{'start_at':_0x3f5e1d['start_at']},..._0x3f5e1d[_0x582de9(0x1a1)]!==undefined&&{'timezone':_0x3f5e1d[_0x582de9(0x1a1)]}};}function normalizeConnectorDef(_0xef2bd8){const _0x149461=a105_0x37de03;return{..._0xef2bd8[_0x149461(0x1b9)]!==undefined&&{'all_columns':_0xef2bd8['all_columns']},..._0xef2bd8[_0x149461(0x1cf)]&&{'columns':_0xef2bd8[_0x149461(0x1cf)][_0x149461(0x1f4)](_0x268ad2=>({'column':_0x268ad2[_0x149461(0x20a)],'source':_0x268ad2[_0x149461(0x204)]}))}};}function normalizeActivationDef(_0xf64215){const _0x1d365f=a105_0x37de03;return{..._0xf64215[_0x1d365f(0x1d9)]!==undefined&&{'enabled':_0xf64215[_0x1d365f(0x1d9)]},..._0xf64215['workflow_project']!==undefined&&{'workflow_project':_0xf64215[_0x1d365f(0x1bb)]},..._0xf64215[_0x1d365f(0x1e6)]!==undefined&&{'workflow_name':_0xf64215[_0x1d365f(0x1e6)]}};}function a105_0x5024(){const _0x590e30=['segment','some','all_columns','sourceEmailTemplateName','workflow_project','1539855zPrYRg','length','variables','slice','resolveWorkspaceId','utmId','utm','connectionId','push:','events','743476wOEdsZ','emailContent','utmMarketingTactic','title','push','utmMedium','resolveTemplateId','on_click_behavior_url','previewValue','columns','message','workspace','email','subject','source_platform','stringify','start_at','.txt','keys','enabled','notifyOn','htmlTemplate','pushType','push_type','displayName','on_click_behavior','emailRecipients','campaign','subjectTemplate','email:','.html','activation','workflow_name','enableUtmTracking','schedule','activationActionsEnabled','239796vOrRJl','onClickBehaviorUrl','name','sender_id','525006pwIOjx','replace','segmentName','workspaceName','imageUrl','1862581EZgLlp','map','notifications','audience:','segmentFolderPath','utmCampaign','ref:','connector:','trimStart','preview_value','display_name','marketing_tactic','utmParameters','parse','description','connector','readFile','source','1ZfNYZQ','onClickBehavior','segmentId','template','plaintextTemplate','column','split','templateVariables','medium','default_value','startsWith','schedule:','utmSource','image_url','campaignType','timezone','plaintext_file','workspaceId','emailSenderId','activation:','notifications:','recipients','allColumns','workflowName','audience','defaultValue','connectorConfig','startAt','32IYnBln','html_file','audienceId','workflowProjectName','2553084BOTzsk','pushContent','toLowerCase','audienceName','545945OdJUbv'];a105_0x5024=function(){return _0x590e30;};return a105_0x5024();}function normalizeUtmDef(_0xd6329b){const _0x24abae=a105_0x37de03;return{..._0xd6329b['enabled']!==undefined&&{'enabled':_0xd6329b[_0x24abae(0x1d9)]},..._0xd6329b['id']!==undefined&&{'id':_0xd6329b['id']},..._0xd6329b[_0x24abae(0x20d)]!==undefined&&{'medium':_0xd6329b[_0x24abae(0x20d)]},..._0xd6329b[_0x24abae(0x204)]!==undefined&&{'source':_0xd6329b[_0x24abae(0x204)]},..._0xd6329b[_0x24abae(0x1d4)]!==undefined&&{'source_platform':_0xd6329b[_0x24abae(0x1d4)]},..._0xd6329b['campaign']!==undefined&&{'campaign':_0xd6329b[_0x24abae(0x1e1)]},..._0xd6329b[_0x24abae(0x1fe)]!==undefined&&{'marketing_tactic':_0xd6329b['marketing_tactic']}};}function normalizeNotificationsDef(_0x40c673){const _0x4b8551=a105_0x37de03;return{..._0x40c673[_0x4b8551(0x1c5)]&&{'events':[..._0x40c673[_0x4b8551(0x1c5)]]},..._0x40c673[_0x4b8551(0x1a7)]&&{'recipients':[..._0x40c673['recipients']]}};}export function sanitizeCampaignFileName(_0x56fd93){const _0x4480a9=a105_0x37de03;return _0x56fd93[_0x4480a9(0x1b4)]()['replace'](/[/\\:*?"<>|]/g,'-')['replace'](/\s+/g,'-')[_0x4480a9(0x1ef)](/-+/g,'-')[_0x4480a9(0x1ef)](/^-|-$/g,'');}
|
|
1
|
+
const a105_0x16b621=a105_0x49b6;(function(_0x280315,_0x26479e){const _0x418f44=a105_0x49b6,_0x16caae=_0x280315();while(!![]){try{const _0x3e7762=parseInt(_0x418f44(0x1b3))/0x1+parseInt(_0x418f44(0x20e))/0x2+-parseInt(_0x418f44(0x218))/0x3*(-parseInt(_0x418f44(0x1e6))/0x4)+-parseInt(_0x418f44(0x1f7))/0x5+-parseInt(_0x418f44(0x1d6))/0x6*(parseInt(_0x418f44(0x1fd))/0x7)+-parseInt(_0x418f44(0x1bc))/0x8*(-parseInt(_0x418f44(0x1c3))/0x9)+-parseInt(_0x418f44(0x21d))/0xa;if(_0x3e7762===_0x26479e)break;else _0x16caae['push'](_0x16caae['shift']());}catch(_0x534cec){_0x16caae['push'](_0x16caae['shift']());}}}(a105_0x3160,0x80184));import*as a105_0x2061a4 from'yaml';import{safeParseYaml}from'../segment/yaml-validator.js';function a105_0x49b6(_0x16a469,_0xb775a7){_0x16a469=_0x16a469-0x1af;const _0x31608b=a105_0x3160();let _0x49b63c=_0x31608b[_0x16a469];return _0x49b63c;}import{CampaignDefSchema}from'./types/campaign-def.js';const REF_PREFIX=a105_0x16b621(0x209);function toRef(_0x487d4d){return''+REF_PREFIX+_0x487d4d;}function isRef(_0x3d6aa2){return _0x3d6aa2['startsWith'](REF_PREFIX);}function parseRef(_0x17d6b4){const _0x88bf6f=a105_0x16b621;if(!isRef(_0x17d6b4))return _0x17d6b4;return _0x17d6b4[_0x88bf6f(0x202)](REF_PREFIX['length']);}export function campaignToDef(_0x2ef32b,_0xb7bb34){const _0xb16e11=a105_0x16b621,_0x2fa42b=_0x2ef32b['attributes'],_0x46691c=sanitizeCampaignFileName(_0x2fa42b[_0xb16e11(0x1ed)]),_0x3b34a9={'type':_0xb16e11(0x1c4),'name':_0x2fa42b['name'],'campaign_type':_0x2fa42b['campaignType'],..._0x2fa42b['description']&&{'description':_0x2fa42b['description']},..._0xb7bb34[_0xb16e11(0x1f3)]&&{'workspace':_0xb7bb34[_0xb16e11(0x1f3)]}};_0x2fa42b[_0xb16e11(0x1b9)]&&(_0x3b34a9[_0xb16e11(0x1b7)]=toRef(_0x2fa42b['audienceName']));if(_0x2fa42b[_0xb16e11(0x210)]){const _0x5f26b8=_0xb7bb34[_0xb16e11(0x1b6)]?_0xb7bb34[_0xb16e11(0x1b6)]+'/'+_0x2fa42b[_0xb16e11(0x210)]:_0x2fa42b[_0xb16e11(0x210)];_0x3b34a9[_0xb16e11(0x1d5)]=toRef(_0x5f26b8);}let _0x18c684,_0x3d44a5;if(_0x2fa42b['emailContent']){const _0x21a62b={};_0x2fa42b[_0xb16e11(0x1e2)][_0xb16e11(0x1f5)]&&(_0x21a62b[_0xb16e11(0x1c0)]=toRef(_0x2fa42b[_0xb16e11(0x1e2)][_0xb16e11(0x1f5)])),_0x2fa42b[_0xb16e11(0x1e2)][_0xb16e11(0x1c1)]&&(_0x21a62b[_0xb16e11(0x1fe)]=_0x2fa42b['emailContent'][_0xb16e11(0x1c1)]),_0x2fa42b[_0xb16e11(0x1e2)]['emailSenderId']&&(_0x21a62b[_0xb16e11(0x1bb)]=_0x2fa42b[_0xb16e11(0x1e2)][_0xb16e11(0x1d7)]),_0x2fa42b['emailContent'][_0xb16e11(0x1ef)]&&(_0x21a62b[_0xb16e11(0x1dc)]=_0x46691c+_0xb16e11(0x1e0),_0x18c684=_0x2fa42b['emailContent']['htmlTemplate']),_0x2fa42b[_0xb16e11(0x1e2)][_0xb16e11(0x1e1)]&&(_0x21a62b[_0xb16e11(0x1ff)]=_0x46691c+_0xb16e11(0x201),_0x3d44a5=_0x2fa42b[_0xb16e11(0x1e2)][_0xb16e11(0x1e1)]),_0x2fa42b[_0xb16e11(0x1e2)][_0xb16e11(0x1cc)]&&_0x2fa42b[_0xb16e11(0x1e2)]['templateVariables'][_0xb16e11(0x213)]>0x0&&(_0x21a62b['variables']=_0x2fa42b[_0xb16e11(0x1e2)][_0xb16e11(0x1cc)][_0xb16e11(0x1b1)](templateVariableToYaml)),Object[_0xb16e11(0x1c2)](_0x21a62b)[_0xb16e11(0x213)]>0x0&&(_0x3b34a9[_0xb16e11(0x1c5)]=_0x21a62b);}if(_0x2fa42b['pushContent']){const _0x14dea2=pushContentToYaml(_0x2fa42b['pushContent']);Object[_0xb16e11(0x1c2)](_0x14dea2)[_0xb16e11(0x213)]>0x0&&(_0x3b34a9[_0xb16e11(0x1db)]=_0x14dea2);}if(_0x2fa42b[_0xb16e11(0x1b5)]||_0x2fa42b[_0xb16e11(0x1fa)]){const _0x2fe864={};if(_0x2fa42b[_0xb16e11(0x1b5)])_0x2fe864[_0xb16e11(0x1de)]=_0x2fa42b[_0xb16e11(0x1b5)];if(_0x2fa42b[_0xb16e11(0x1fa)])_0x2fe864[_0xb16e11(0x1fa)]=_0x2fa42b['timezone'];_0x3b34a9[_0xb16e11(0x21f)]=_0x2fe864;}const _0x49f721=connectorToYaml(_0x2fa42b);_0x49f721&&(_0x3b34a9[_0xb16e11(0x1d2)]=_0x49f721);const _0x170491=activationSettingsToYaml(_0x2fa42b);_0x170491&&(_0x3b34a9[_0xb16e11(0x205)]=_0x170491);_0x2fa42b[_0xb16e11(0x1bd)]&&_0x2fa42b[_0xb16e11(0x207)]&&(_0x3b34a9[_0xb16e11(0x1df)]=utmToYaml(_0x2fa42b[_0xb16e11(0x207)],_0x2fa42b[_0xb16e11(0x1bd)]));if(_0x2fa42b[_0xb16e11(0x20d)]&&_0x2fa42b[_0xb16e11(0x20d)][_0xb16e11(0x213)]>0x0||_0x2fa42b['emailRecipients']&&_0x2fa42b[_0xb16e11(0x214)][_0xb16e11(0x213)]>0x0){const _0x1b6ca4={};if(_0x2fa42b['notifyOn']&&_0x2fa42b[_0xb16e11(0x20d)][_0xb16e11(0x213)]>0x0)_0x1b6ca4[_0xb16e11(0x1af)]=_0x2fa42b[_0xb16e11(0x20d)];if(_0x2fa42b['emailRecipients']&&_0x2fa42b[_0xb16e11(0x214)]['length']>0x0)_0x1b6ca4[_0xb16e11(0x1be)]=_0x2fa42b[_0xb16e11(0x214)];_0x3b34a9['notifications']=_0x1b6ca4;}return{'def':_0x3b34a9,'htmlContent':_0x18c684,'plaintextContent':_0x3d44a5};}export async function defToCreateInput(_0xe8abc7,_0x3d6568){const _0x248a07=a105_0x16b621,_0x2e96b6={'name':_0xe8abc7['name'],'campaignType':_0xe8abc7[_0x248a07(0x1ca)]};_0xe8abc7[_0x248a07(0x1e9)]&&(_0x2e96b6[_0x248a07(0x219)]=await _0x3d6568[_0x248a07(0x1cb)](_0xe8abc7[_0x248a07(0x1e9)]));_0xe8abc7[_0x248a07(0x1c8)]&&(_0x2e96b6[_0x248a07(0x1c8)]=_0xe8abc7[_0x248a07(0x1c8)]);await resolveSegmentRefs(_0xe8abc7,_0x2e96b6,_0x3d6568);_0xe8abc7[_0x248a07(0x1c5)]&&(_0x2e96b6[_0x248a07(0x1e2)]=await emailDefToApi(_0xe8abc7['email'],_0x2e96b6[_0x248a07(0x219)],_0x3d6568));_0xe8abc7[_0x248a07(0x1db)]&&(_0x2e96b6['pushContent']=pushDefToApi(_0xe8abc7['push']));_0xe8abc7[_0x248a07(0x1d2)]&&(_0x2e96b6[_0x248a07(0x1eb)]=connectorDefToApi(_0xe8abc7['connector']),_0xe8abc7['connector'][_0x248a07(0x20b)]!==undefined&&(_0x2e96b6['allColumns']=_0xe8abc7['connector'][_0x248a07(0x20b)]),_0xe8abc7['connector'][_0x248a07(0x20f)]&&(_0x2e96b6['columns']=_0xe8abc7[_0x248a07(0x1d2)][_0x248a07(0x20f)][_0x248a07(0x1b1)](_0x31fb75=>({'column':_0x31fb75['column'],'source':{'column':_0x31fb75[_0x248a07(0x20c)]}}))));if(_0xe8abc7[_0x248a07(0x21f)]){if(_0xe8abc7[_0x248a07(0x21f)]['start_at'])_0x2e96b6[_0x248a07(0x1b5)]=_0xe8abc7[_0x248a07(0x21f)][_0x248a07(0x1de)];if(_0xe8abc7['schedule'][_0x248a07(0x1fa)])_0x2e96b6[_0x248a07(0x1fa)]=_0xe8abc7['schedule'][_0x248a07(0x1fa)];}return _0xe8abc7['utm']&&(_0x2e96b6[_0x248a07(0x1bd)]=_0xe8abc7[_0x248a07(0x1df)][_0x248a07(0x1ea)]??![]),_0x2e96b6;}export async function defToUpdateInput(_0x2fd91,_0x48e37c){const _0x5e6627=a105_0x16b621,_0x25cb83={};if(_0x2fd91['name'])_0x25cb83[_0x5e6627(0x1ed)]=_0x2fd91['name'];if(_0x2fd91[_0x5e6627(0x1c8)]!==undefined)_0x25cb83['description']=_0x2fd91[_0x5e6627(0x1c8)];await resolveSegmentRefs(_0x2fd91,_0x25cb83,_0x48e37c);if(_0x2fd91[_0x5e6627(0x1c5)]){const _0x52ea32=_0x2fd91[_0x5e6627(0x1e9)]?await _0x48e37c[_0x5e6627(0x1cb)](_0x2fd91['workspace']):undefined;_0x25cb83[_0x5e6627(0x1e2)]=await emailDefToApi(_0x2fd91['email'],_0x52ea32,_0x48e37c);}_0x2fd91[_0x5e6627(0x1db)]&&(_0x25cb83['pushContent']=pushDefToApi(_0x2fd91[_0x5e6627(0x1db)]));_0x2fd91[_0x5e6627(0x1d2)]&&(_0x25cb83['connectorConfig']=connectorDefToApi(_0x2fd91[_0x5e6627(0x1d2)]),_0x2fd91[_0x5e6627(0x1d2)][_0x5e6627(0x20b)]!==undefined&&(_0x25cb83[_0x5e6627(0x208)]=_0x2fd91[_0x5e6627(0x1d2)][_0x5e6627(0x20b)]),_0x2fd91['connector'][_0x5e6627(0x20f)]&&(_0x25cb83[_0x5e6627(0x20f)]=_0x2fd91[_0x5e6627(0x1d2)][_0x5e6627(0x20f)][_0x5e6627(0x1b1)](_0x122310=>({'column':_0x122310[_0x5e6627(0x20a)],'source':{'column':_0x122310['source']}}))));if(_0x2fd91['schedule']){if(_0x2fd91[_0x5e6627(0x21f)]['start_at'])_0x25cb83[_0x5e6627(0x1b5)]=_0x2fd91[_0x5e6627(0x21f)]['start_at'];if(_0x2fd91[_0x5e6627(0x21f)][_0x5e6627(0x1fa)])_0x25cb83[_0x5e6627(0x1fa)]=_0x2fd91[_0x5e6627(0x21f)][_0x5e6627(0x1fa)];}return _0x2fd91['utm']&&(_0x25cb83[_0x5e6627(0x1bd)]=_0x2fd91[_0x5e6627(0x1df)][_0x5e6627(0x1ea)]??![]),_0x25cb83;}export function toYamlString(_0x59d921){const _0x3edf79=a105_0x16b621,_0x43eab4=JSON[_0x3edf79(0x206)](JSON[_0x3edf79(0x1c7)](_0x59d921)),_0x2ccaf3=a105_0x2061a4[_0x3edf79(0x1c7)](_0x43eab4,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3edf79(0x211)}),_0x240f3c=['audience:',_0x3edf79(0x1d4),_0x3edf79(0x1d8),_0x3edf79(0x216),_0x3edf79(0x212),_0x3edf79(0x1ce),'utm:','notifications:'],_0x28580c=_0x2ccaf3[_0x3edf79(0x1ba)]('\x0a'),_0x16ab0f=[];for(let _0x38d437=0x0;_0x38d437<_0x28580c['length'];_0x38d437++){const _0x4bd9b8=_0x28580c[_0x38d437][_0x3edf79(0x1f2)]();_0x38d437>0x0&&_0x240f3c['some'](_0x191feb=>_0x4bd9b8[_0x3edf79(0x1bf)](_0x191feb))&&_0x16ab0f[_0x3edf79(0x213)]>0x0&&_0x16ab0f[_0x16ab0f['length']-0x1]!==''&&_0x16ab0f['push'](''),_0x16ab0f[_0x3edf79(0x1db)](_0x28580c[_0x38d437]);}return _0x16ab0f[_0x3edf79(0x1b2)]('\x0a');}export function parseYamlString(_0x21d0bb){return safeParseYaml(_0x21d0bb,CampaignDefSchema);}export function normalizeDef(_0x499225){const _0x42fef4=a105_0x16b621;return{'type':_0x42fef4(0x1c4),'name':_0x499225['name'],'campaign_type':_0x499225[_0x42fef4(0x1ca)],..._0x499225[_0x42fef4(0x1c8)]!==undefined&&{'description':_0x499225[_0x42fef4(0x1c8)]},..._0x499225[_0x42fef4(0x1e9)]!==undefined&&{'workspace':_0x499225[_0x42fef4(0x1e9)]},..._0x499225[_0x42fef4(0x1b7)]!==undefined&&{'audience':_0x499225[_0x42fef4(0x1b7)]},..._0x499225['segment']!==undefined&&{'segment':_0x499225['segment']},..._0x499225[_0x42fef4(0x1c5)]&&{'email':normalizeEmailDef(_0x499225[_0x42fef4(0x1c5)])},..._0x499225[_0x42fef4(0x1db)]&&{'push':normalizePushDef(_0x499225[_0x42fef4(0x1db)])},..._0x499225['schedule']&&{'schedule':normalizeScheduleDef(_0x499225['schedule'])},..._0x499225['connector']&&{'connector':normalizeConnectorDef(_0x499225[_0x42fef4(0x1d2)])},..._0x499225[_0x42fef4(0x205)]&&{'activation':normalizeActivationDef(_0x499225[_0x42fef4(0x205)])},..._0x499225[_0x42fef4(0x1df)]&&{'utm':normalizeUtmDef(_0x499225[_0x42fef4(0x1df)])},..._0x499225[_0x42fef4(0x1f0)]&&{'notifications':normalizeNotificationsDef(_0x499225[_0x42fef4(0x1f0)])}};}function templateVariableToYaml(_0x3073a7){const _0x4e8e28=a105_0x16b621;return{'name':_0x3073a7[_0x4e8e28(0x1ed)],..._0x3073a7[_0x4e8e28(0x1f1)]&&{'display_name':_0x3073a7[_0x4e8e28(0x1f1)]},..._0x3073a7[_0x4e8e28(0x1ee)]&&{'preview_value':_0x3073a7[_0x4e8e28(0x1ee)]},..._0x3073a7[_0x4e8e28(0x1fb)]&&{'default_value':_0x3073a7[_0x4e8e28(0x1fb)]}};}function pushContentToYaml(_0x1a76c1){const _0xdc2d6d=a105_0x16b621;return{..._0x1a76c1['title']&&{'title':_0x1a76c1[_0xdc2d6d(0x1b8)]},..._0x1a76c1[_0xdc2d6d(0x1e5)]&&{'message':_0x1a76c1[_0xdc2d6d(0x1e5)]},..._0x1a76c1[_0xdc2d6d(0x21a)]&&{'push_type':_0x1a76c1[_0xdc2d6d(0x21a)]},..._0x1a76c1[_0xdc2d6d(0x200)]&&{'image_url':_0x1a76c1['imageUrl']},..._0x1a76c1['onClickBehavior']&&{'on_click_behavior':_0x1a76c1[_0xdc2d6d(0x1e3)]},..._0x1a76c1[_0xdc2d6d(0x1fc)]&&{'on_click_behavior_url':_0x1a76c1[_0xdc2d6d(0x1fc)]}};}function connectorToYaml(_0x2340e3){const _0x4579ea=a105_0x16b621,_0x20b6fb=_0x2340e3[_0x4579ea(0x1da)],_0x46347e=_0x2340e3[_0x4579ea(0x20f)]&&_0x2340e3[_0x4579ea(0x20f)][_0x4579ea(0x213)]>0x0;if(!_0x20b6fb&&!_0x46347e&&!_0x2340e3['allColumns'])return undefined;const _0x57c1a0={};return _0x2340e3[_0x4579ea(0x208)]!==undefined&&(_0x57c1a0[_0x4579ea(0x20b)]=_0x2340e3[_0x4579ea(0x208)]),_0x2340e3[_0x4579ea(0x20f)]&&_0x2340e3[_0x4579ea(0x20f)][_0x4579ea(0x213)]>0x0&&(_0x57c1a0[_0x4579ea(0x20f)]=_0x2340e3[_0x4579ea(0x20f)]['map'](columnMappingToYaml)),_0x57c1a0;}function columnMappingToYaml(_0x1a33ce){const _0x47f354=a105_0x16b621;return{'column':_0x1a33ce['column'],'source':_0x1a33ce['source'][_0x47f354(0x20a)]};}function activationSettingsToYaml(_0x587604){const _0x193eed=a105_0x16b621;if(!_0x587604[_0x193eed(0x1e7)]&&!_0x587604['workflowProjectName']&&!_0x587604[_0x193eed(0x1ec)])return undefined;return{..._0x587604[_0x193eed(0x1e7)]!==undefined&&{'enabled':_0x587604[_0x193eed(0x1e7)]},..._0x587604[_0x193eed(0x1f4)]&&{'workflow_project':_0x587604['workflowProjectName']},..._0x587604[_0x193eed(0x1ec)]&&{'workflow_name':_0x587604['workflowName']}};}function utmToYaml(_0x449fa5,_0x251b5f){const _0x183df6=a105_0x16b621;return{'enabled':_0x251b5f,..._0x449fa5[_0x183df6(0x1d9)]&&{'id':_0x449fa5[_0x183df6(0x1d9)]},..._0x449fa5[_0x183df6(0x1b0)]&&{'medium':_0x449fa5[_0x183df6(0x1b0)]},..._0x449fa5[_0x183df6(0x1d3)]&&{'source':_0x449fa5['utmSource']},..._0x449fa5[_0x183df6(0x204)]&&{'source_platform':_0x449fa5[_0x183df6(0x204)]},..._0x449fa5[_0x183df6(0x1cf)]&&{'campaign':_0x449fa5[_0x183df6(0x1cf)]},..._0x449fa5['utmMarketingTactic']&&{'marketing_tactic':_0x449fa5['utmMarketingTactic']}};}async function resolveSegmentRefs(_0x7913ec,_0x538356,_0xa951d){const _0x298103=a105_0x16b621;if(_0x7913ec[_0x298103(0x1b7)]){const _0x14f972=parseRef(_0x7913ec[_0x298103(0x1b7)]),_0x3a344f=_0x7913ec['segment']?parseRef(_0x7913ec[_0x298103(0x1d5)]):undefined,_0x19c9c2=_0x3a344f?_0x14f972+'/'+_0x3a344f:_0x14f972,_0x5bbdda=await _0xa951d[_0x298103(0x1f9)](_0x19c9c2);_0x538356[_0x298103(0x1e8)]=_0x5bbdda[_0x298103(0x1e8)],_0x538356['audienceName']=_0x5bbdda[_0x298103(0x1b9)],_0x5bbdda[_0x298103(0x1c9)]&&(_0x538356[_0x298103(0x1c9)]=_0x5bbdda[_0x298103(0x1c9)],_0x538356['segmentName']=_0x5bbdda[_0x298103(0x210)]);}}function a105_0x3160(){const _0x39359c=['utmId','connectionId','push','html_file','on_click_behavior_url','start_at','utm','.html','plaintextTemplate','emailContent','onClickBehavior','display_name','message','1430644sFGmME','activationActionsEnabled','audienceId','workspace','enabled','connectorConfig','workflowName','name','previewValue','htmlTemplate','notifications','displayName','trimStart','workspaceName','workflowProjectName','sourceEmailTemplateName','on_click_behavior','487645RrhFHQ','replace','resolveSegmentPath','timezone','defaultValue','onClickBehaviorUrl','126bLFnDE','subject','plaintext_file','imageUrl','.txt','slice','readFile','utmSourcePlatform','activation','parse','utmParameters','allColumns','ref:','column','all_columns','source','notifyOn','455868fsxQLx','columns','segmentName','null','connector:','length','emailRecipients','medium','schedule:','source_platform','3bUprAj','workspaceId','pushType','workflow_name','resolveTemplateId','11603270ldxQEb','variables','schedule','events','utmMedium','map','join','991801bitJdJ','preview_value','startAt','segmentFolderPath','audience','title','audienceName','split','sender_id','16ILIBeR','enableUtmTracking','recipients','startsWith','template','subjectTemplate','keys','4410729PjKEKn','campaign','email','image_url','stringify','description','segmentId','campaign_type','resolveWorkspaceId','templateVariables','default_value','activation:','utmCampaign','push_type','workflow_project','connector','utmSource','email:','segment','258342bzJOrD','emailSenderId','push:'];a105_0x3160=function(){return _0x39359c;};return a105_0x3160();}async function emailDefToApi(_0x1c2007,_0x2e3dba,_0x2c049b){const _0x3af1d9=a105_0x16b621;let _0x346035='',_0x311f4a;if(_0x1c2007[_0x3af1d9(0x1c0)]){const _0x244761=parseRef(_0x1c2007[_0x3af1d9(0x1c0)]),_0xd075ee=await _0x2c049b[_0x3af1d9(0x21c)](_0x244761,_0x2e3dba);_0x346035=_0xd075ee['id'],_0x311f4a=_0xd075ee[_0x3af1d9(0x1ed)];}let _0x157df7;_0x1c2007[_0x3af1d9(0x1dc)]&&(_0x157df7=await _0x2c049b[_0x3af1d9(0x203)](_0x1c2007[_0x3af1d9(0x1dc)]));let _0x5643f3;return _0x1c2007[_0x3af1d9(0x1ff)]&&(_0x5643f3=await _0x2c049b[_0x3af1d9(0x203)](_0x1c2007[_0x3af1d9(0x1ff)])),{'sourceEmailTemplateId':_0x346035,..._0x311f4a&&{'sourceEmailTemplateName':_0x311f4a},..._0x1c2007[_0x3af1d9(0x1fe)]&&{'subjectTemplate':_0x1c2007[_0x3af1d9(0x1fe)]},..._0x157df7&&{'htmlTemplate':_0x157df7},..._0x5643f3&&{'plaintextTemplate':_0x5643f3},..._0x1c2007[_0x3af1d9(0x1bb)]&&{'emailSenderId':_0x1c2007[_0x3af1d9(0x1bb)]}};}function pushDefToApi(_0x20c67f){const _0x5a1e79=a105_0x16b621;return{..._0x20c67f[_0x5a1e79(0x1b8)]&&{'title':_0x20c67f[_0x5a1e79(0x1b8)]},..._0x20c67f['message']&&{'message':_0x20c67f[_0x5a1e79(0x1e5)]},..._0x20c67f[_0x5a1e79(0x1d0)]&&{'pushType':_0x20c67f['push_type']},..._0x20c67f[_0x5a1e79(0x1c6)]&&{'imageUrl':_0x20c67f[_0x5a1e79(0x1c6)]},..._0x20c67f[_0x5a1e79(0x1f6)]&&{'onClickBehavior':_0x20c67f[_0x5a1e79(0x1f6)]},..._0x20c67f[_0x5a1e79(0x1dd)]&&{'onClickBehaviorUrl':_0x20c67f[_0x5a1e79(0x1dd)]}};}function connectorDefToApi(_0x1a1863){return{};}function normalizeEmailDef(_0x433b62){const _0x501508=a105_0x16b621;return{..._0x433b62[_0x501508(0x1c0)]!==undefined&&{'template':_0x433b62[_0x501508(0x1c0)]},..._0x433b62[_0x501508(0x1fe)]!==undefined&&{'subject':_0x433b62['subject']},..._0x433b62[_0x501508(0x1dc)]!==undefined&&{'html_file':_0x433b62[_0x501508(0x1dc)]},..._0x433b62[_0x501508(0x1ff)]!==undefined&&{'plaintext_file':_0x433b62[_0x501508(0x1ff)]},..._0x433b62[_0x501508(0x1bb)]!==undefined&&{'sender_id':_0x433b62[_0x501508(0x1bb)]},..._0x433b62[_0x501508(0x21e)]&&{'variables':_0x433b62[_0x501508(0x21e)][_0x501508(0x1b1)](_0xbc093d=>({'name':_0xbc093d[_0x501508(0x1ed)],..._0xbc093d[_0x501508(0x1e4)]!==undefined&&{'display_name':_0xbc093d[_0x501508(0x1e4)]},..._0xbc093d[_0x501508(0x1b4)]!==undefined&&{'preview_value':_0xbc093d[_0x501508(0x1b4)]},..._0xbc093d[_0x501508(0x1cd)]!==undefined&&{'default_value':_0xbc093d[_0x501508(0x1cd)]}}))}};}function normalizePushDef(_0x33501f){const _0x5f17c5=a105_0x16b621;return{..._0x33501f[_0x5f17c5(0x1b8)]!==undefined&&{'title':_0x33501f['title']},..._0x33501f[_0x5f17c5(0x1e5)]!==undefined&&{'message':_0x33501f[_0x5f17c5(0x1e5)]},..._0x33501f[_0x5f17c5(0x1d0)]!==undefined&&{'push_type':_0x33501f['push_type']},..._0x33501f[_0x5f17c5(0x1c6)]!==undefined&&{'image_url':_0x33501f['image_url']},..._0x33501f[_0x5f17c5(0x1f6)]!==undefined&&{'on_click_behavior':_0x33501f[_0x5f17c5(0x1f6)]},..._0x33501f['on_click_behavior_url']!==undefined&&{'on_click_behavior_url':_0x33501f[_0x5f17c5(0x1dd)]}};}function normalizeScheduleDef(_0x35a571){const _0x465b53=a105_0x16b621;return{..._0x35a571['start_at']!==undefined&&{'start_at':_0x35a571[_0x465b53(0x1de)]},..._0x35a571[_0x465b53(0x1fa)]!==undefined&&{'timezone':_0x35a571['timezone']}};}function normalizeConnectorDef(_0x150813){const _0x1e9f81=a105_0x16b621;return{..._0x150813[_0x1e9f81(0x20b)]!==undefined&&{'all_columns':_0x150813[_0x1e9f81(0x20b)]},..._0x150813[_0x1e9f81(0x20f)]&&{'columns':_0x150813[_0x1e9f81(0x20f)]['map'](_0x11be5=>({'column':_0x11be5[_0x1e9f81(0x20a)],'source':_0x11be5[_0x1e9f81(0x20c)]}))}};}function normalizeActivationDef(_0x146375){const _0x5981e7=a105_0x16b621;return{..._0x146375[_0x5981e7(0x1ea)]!==undefined&&{'enabled':_0x146375[_0x5981e7(0x1ea)]},..._0x146375['workflow_project']!==undefined&&{'workflow_project':_0x146375[_0x5981e7(0x1d1)]},..._0x146375[_0x5981e7(0x21b)]!==undefined&&{'workflow_name':_0x146375[_0x5981e7(0x21b)]}};}function normalizeUtmDef(_0x3e0157){const _0x245356=a105_0x16b621;return{..._0x3e0157[_0x245356(0x1ea)]!==undefined&&{'enabled':_0x3e0157['enabled']},..._0x3e0157['id']!==undefined&&{'id':_0x3e0157['id']},..._0x3e0157[_0x245356(0x215)]!==undefined&&{'medium':_0x3e0157[_0x245356(0x215)]},..._0x3e0157[_0x245356(0x20c)]!==undefined&&{'source':_0x3e0157[_0x245356(0x20c)]},..._0x3e0157[_0x245356(0x217)]!==undefined&&{'source_platform':_0x3e0157[_0x245356(0x217)]},..._0x3e0157[_0x245356(0x1c4)]!==undefined&&{'campaign':_0x3e0157[_0x245356(0x1c4)]},..._0x3e0157['marketing_tactic']!==undefined&&{'marketing_tactic':_0x3e0157['marketing_tactic']}};}function normalizeNotificationsDef(_0x55085a){const _0x18b75e=a105_0x16b621;return{..._0x55085a[_0x18b75e(0x1af)]&&{'events':[..._0x55085a[_0x18b75e(0x1af)]]},..._0x55085a[_0x18b75e(0x1be)]&&{'recipients':[..._0x55085a['recipients']]}};}export function sanitizeCampaignFileName(_0x59c285){const _0x3143b5=a105_0x16b621;return _0x59c285['toLowerCase']()['replace'](/[/\\:*?"<>|]/g,'-')['replace'](/\s+/g,'-')[_0x3143b5(0x1f8)](/-+/g,'-')[_0x3143b5(0x1f8)](/^-|-$/g,'');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a106_0x3c30(_0xd51b17,_0x33eeb6){_0xd51b17=_0xd51b17-0xd1;const _0x14de98=a106_0x14de();let _0x3c3049=_0x14de98[_0xd51b17];return _0x3c3049;}const a106_0x2edb88=a106_0x3c30;(function(_0x1d37e4,_0x2b7fa1){const _0x5ce3da=a106_0x3c30,_0x1b881a=_0x1d37e4();while(!![]){try{const _0x46d682=-parseInt(_0x5ce3da(0xdf))/0x1+parseInt(_0x5ce3da(0xd6))/0x2*(-parseInt(_0x5ce3da(0xd8))/0x3)+-parseInt(_0x5ce3da(0xe7))/0x4+parseInt(_0x5ce3da(0xe9))/0x5+-parseInt(_0x5ce3da(0xe1))/0x6+parseInt(_0x5ce3da(0xd7))/0x7+parseInt(_0x5ce3da(0xda))/0x8;if(_0x46d682===_0x2b7fa1)break;else _0x1b881a['push'](_0x1b881a['shift']());}catch(_0x1b59ed){_0x1b881a['push'](_0x1b881a['shift']());}}}(a106_0x14de,0xe4420));import a106_0x252c6e from'path';import{existsSync,readFileSync}from'fs';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=a106_0x2edb88(0xdb),API_PAGE_LIMIT=0x64;export async function pullTemplates(_0x16546c,_0x17565f,_0x2b17c8={}){const _0x47c673=a106_0x2edb88,{engage:_0x4925a6}=_0x16546c;_0x2b17c8[_0x47c673(0xd5)]?.[_0x47c673(0xd4)]('Resolving\x20workspace...');const _0x137294=await _0x4925a6['getWorkspace'](_0x17565f),_0x5d4bf3=_0x137294[_0x47c673(0xe8)],_0x1e1700=_0x137294['id'],_0x58723d=_0x2b17c8['targetDir']||a106_0x252c6e[_0x47c673(0xe0)](process[_0x47c673(0xe4)](),TEMPLATES_DIR,sanitizeTemplateFileName(_0x5d4bf3));_0x2b17c8[_0x47c673(0xd5)]?.[_0x47c673(0xd4)](_0x47c673(0xdd));const _0x3ee2b8=await listAllTemplates(_0x4925a6,{'workspaceId':_0x1e1700,'progress':_0x2b17c8['progress']});let _0x3889f5=_0x3ee2b8;_0x2b17c8['templateName']&&(_0x3889f5=_0x3889f5[_0x47c673(0xea)](_0x5c4fde=>_0x5c4fde[_0x47c673(0xe8)]===_0x2b17c8['templateName']));const _0x15450c=[];let _0x1103a7=0x0;for(const _0x23557d of _0x3889f5){_0x1103a7++,_0x2b17c8['progress']?.[_0x47c673(0xd4)](_0x47c673(0xe6)+_0x1103a7+'/'+_0x3889f5[_0x47c673(0xd9)]+':\x20'+_0x23557d['name']);const _0x41cf68=await _0x4925a6[_0x47c673(0xdc)](_0x23557d['id']),{def:_0x3deca0,htmlContent:_0x21b220,plaintextContent:_0x56dc56}=templateToDef(_0x41cf68,{'workspaceName':_0x5d4bf3}),_0x31392b=normalizeDef(_0x3deca0),_0x26b965=sanitizeTemplateFileName(_0x31392b[_0x47c673(0xe8)]),_0x19bb84=toYamlString(_0x31392b);_0x15450c[_0x47c673(0xde)](prepareFile(_0x58723d,_0x26b965+'.yaml',_0x19bb84)),_0x21b220&&_0x15450c[_0x47c673(0xde)](prepareFile(_0x58723d,_0x26b965+'.html',_0x21b220)),_0x56dc56&&_0x15450c[_0x47c673(0xde)](prepareFile(_0x58723d,_0x26b965+_0x47c673(0xe3),_0x56dc56));}const _0x568475=createEngageTdxConfigContent(_0x5d4bf3);_0x15450c[_0x47c673(0xde)](prepareFile(_0x58723d,_0x47c673(0xeb),_0x568475));const _0x50e98c=_0x15450c['filter'](_0x4dd825=>_0x4dd825[_0x47c673(0xd3)])['length'],_0x2721f9=_0x15450c['filter'](_0xd65cb5=>!_0xd65cb5[_0x47c673(0xd3)]&&_0xd65cb5[_0x47c673(0xd1)])[_0x47c673(0xd9)],_0x2203b9=_0x15450c['filter'](_0x5d01f4=>!_0x5d01f4[_0x47c673(0xd3)]&&!_0x5d01f4[_0x47c673(0xd1)])['length'];return{'workspaceName':_0x5d4bf3,'workspaceId':_0x1e1700,'targetDir':_0x58723d,'files':_0x15450c,'counts':{'templates':_0x3889f5['length']},'newFiles':_0x50e98c,'changedFiles':_0x2721f9,'unchangedFiles':_0x2203b9};}function prepareFile(_0x8a8503,_0x526cc4,_0x26c8af){const _0x3e11c9=a106_0x2edb88,_0x155a99=a106_0x252c6e[_0x3e11c9(0xe0)](_0x8a8503,_0x526cc4),_0x5ebe47=!existsSync(_0x155a99);let _0x43be0d=_0x5ebe47,_0x2664ee;if(!_0x5ebe47){const _0x1130e7=readFileSync(_0x155a99,_0x3e11c9(0xd2)),_0x79f74c=generateDiff(_0x1130e7,_0x26c8af);_0x43be0d=hasChanges(_0x79f74c),_0x43be0d&&(_0x2664ee=formatDiffWithColors(_0x79f74c));}return{'relativePath':_0x526cc4,'absolutePath':_0x155a99,'content':_0x26c8af,'isNew':_0x5ebe47,'hasChanges':_0x43be0d,'diff':_0x2664ee};}export async function listAllTemplates(_0x39fae1,_0x281bd1){const _0x1336d0=a106_0x2edb88,_0x1c0319=[];let _0x54c1c1=0x0;while(!![]){const _0x3ee700=await _0x39fae1['listTemplates']({'workspaceId':_0x281bd1[_0x1336d0(0xe5)],'limit':API_PAGE_LIMIT,'offset':_0x54c1c1});_0x1c0319[_0x1336d0(0xde)](..._0x3ee700);if(_0x3ee700[_0x1336d0(0xd9)]<API_PAGE_LIMIT)break;_0x54c1c1+=API_PAGE_LIMIT,_0x281bd1[_0x1336d0(0xd5)]?.[_0x1336d0(0xd4)](_0x1336d0(0xe2)+_0x1c0319['length']+'\x20so\x20far)...');}return _0x1c0319;}function a106_0x14de(){const _0x4268b4=['workspaceId','Processing\x20template\x20','5660900cKSyyv','name','6993070fkjaZq','filter','tdx.json','hasChanges','utf-8','isNew','update','progress','2YfnYSY','2335970nMyqpt','1291566GHIAfU','length','17421712RBaAzQ','templates','getTemplateFull','Fetching\x20templates...','push','468578VKXeiW','join','3964614lQHXaV','Fetching\x20templates\x20(','.txt','cwd'];a106_0x14de=function(){return _0x4268b4;};return a106_0x14de();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a107_0x4752(_0x428202,_0x2625d3){_0x428202=_0x428202-0x149;const _0x494e69=a107_0x494e();let _0x475255=_0x494e69[_0x428202];return _0x475255;}(function(_0x192b71,_0x3c454d){const _0x219ae3=a107_0x4752,_0x3df23d=_0x192b71();while(!![]){try{const _0x3c40d3=-parseInt(_0x219ae3(0x152))/0x1*(parseInt(_0x219ae3(0x15b))/0x2)+parseInt(_0x219ae3(0x150))/0x3+-parseInt(_0x219ae3(0x15a))/0x4+-parseInt(_0x219ae3(0x154))/0x5*(parseInt(_0x219ae3(0x172))/0x6)+parseInt(_0x219ae3(0x16f))/0x7*(parseInt(_0x219ae3(0x153))/0x8)+parseInt(_0x219ae3(0x167))/0x9*(-parseInt(_0x219ae3(0x156))/0xa)+parseInt(_0x219ae3(0x157))/0xb;if(_0x3c40d3===_0x3c454d)break;else _0x3df23d['push'](_0x3df23d['shift']());}catch(_0x7bb476){_0x3df23d['push'](_0x3df23d['shift']());}}}(a107_0x494e,0x361ac));import a107_0x2f6a54 from'path';import{readFileSync}from'fs';import{parseYamlString,defToCreateInput,defToUpdateInput}from'./template-yaml.js';import{findYamlFiles}from'../segment/file-discovery.js';import{listAllTemplates}from'./template-pull.js';export function discoverAndParseTemplateFiles(_0x4fdfa4){const _0x32a3c9=a107_0x4752,_0x16bb14=findYamlFiles(_0x4fdfa4),_0x32c2ac=[];for(const _0x505b04 of _0x16bb14){try{const _0x180e0b=readFileSync(_0x505b04,'utf-8'),_0x520249=parseYamlString(_0x180e0b);_0x520249[_0x32a3c9(0x169)]===_0x32a3c9(0x14a)&&_0x32c2ac[_0x32a3c9(0x166)]({'yamlPath':_0x505b04,'relativePath':a107_0x2f6a54[_0x32a3c9(0x14c)](_0x4fdfa4,_0x505b04),'def':_0x520249,'dir':a107_0x2f6a54[_0x32a3c9(0x15f)](_0x505b04)});}catch{}}return _0x32c2ac;}export function parseTemplateFile(_0x29f50d,_0x5d49f1){const _0x4788e3=a107_0x4752,_0x567916=readFileSync(_0x29f50d,_0x4788e3(0x163)),_0x37b79c=parseYamlString(_0x567916),_0x3b0856=a107_0x2f6a54[_0x4788e3(0x14c)](_0x5d49f1,_0x29f50d),_0x3e7217=a107_0x2f6a54[_0x4788e3(0x15f)](_0x29f50d);return{'yamlPath':_0x29f50d,'relativePath':_0x3b0856,'def':_0x37b79c,'dir':_0x3e7217};}function a107_0x494e(){const _0x1b7677=['dryRun','resolveWorkspaceId','get','889bWgSkC','createTemplate','set','6tWDkLD','name','engage','template','results','relative','updated','updateInput','message','208188RSmiRz','Pushing\x20','37549gAbOTW','27672urjViB','1751915ebtxNp','progress','6530IKkSSg','4669390dNEOBX','workspaceId','create','1182224RYfkFs','2JVxWeM','updateTemplate','createInput','join','dirname','def','action','errors','utf-8','Resolving\x20references\x20','created','push','387LnGZdG','length','type','update','fileDir'];a107_0x494e=function(){return _0x1b7677;};return a107_0x494e();}export async function preparePush(_0x3047ee,_0x30f6e4,_0x2c5dc3,_0x2c211c={}){const _0x47e72b=a107_0x4752,{engage:_0x5bcf08}=_0x3047ee;_0x2c211c['progress']?.[_0x47e72b(0x16a)]('Fetching\x20existing\x20templates...');const _0x532761=await listAllTemplates(_0x5bcf08,{'workspaceId':_0x2c5dc3}),_0x128bb5=new Map();for(const _0x5acb4a of _0x532761){_0x128bb5[_0x47e72b(0x171)](_0x5acb4a[_0x47e72b(0x173)],_0x5acb4a);}const _0x48452a=[];for(const _0x1e251b of _0x30f6e4){const _0x11ccb5=_0x128bb5[_0x47e72b(0x16e)](_0x1e251b[_0x47e72b(0x160)]['name']);_0x48452a[_0x47e72b(0x166)]({'def':_0x1e251b[_0x47e72b(0x160)],'fileDir':_0x1e251b['dir'],'action':_0x11ccb5?_0x47e72b(0x16a):_0x47e72b(0x159),'existingId':_0x11ccb5?.['id']});}return _0x48452a;}export async function resolveAndBuildInputs(_0x5a6f3e,_0x21b05d,_0x2edb08,_0x2c54b6={}){const _0x2a00e5=a107_0x4752;for(let _0x3f3f9b=0x0;_0x3f3f9b<_0x21b05d[_0x2a00e5(0x168)];_0x3f3f9b++){const _0x2f68a2=_0x21b05d[_0x3f3f9b];_0x2c54b6[_0x2a00e5(0x155)]?.[_0x2a00e5(0x16a)](_0x2a00e5(0x164)+(_0x3f3f9b+0x1)+'/'+_0x21b05d[_0x2a00e5(0x168)]+':\x20'+_0x2f68a2[_0x2a00e5(0x160)][_0x2a00e5(0x173)]);const _0x556e01=createResolveContext(_0x5a6f3e,_0x2edb08,_0x2f68a2[_0x2a00e5(0x16b)]);_0x2f68a2[_0x2a00e5(0x161)]===_0x2a00e5(0x159)?(_0x2f68a2[_0x2a00e5(0x15d)]=await defToCreateInput(_0x2f68a2['def'],_0x556e01),!_0x2f68a2[_0x2a00e5(0x15d)][_0x2a00e5(0x158)]&&(_0x2f68a2[_0x2a00e5(0x15d)]['workspaceId']=_0x2edb08)):_0x2f68a2[_0x2a00e5(0x14e)]=await defToUpdateInput(_0x2f68a2[_0x2a00e5(0x160)],_0x556e01);}}export async function executePush(_0x889d75,_0x1eab3d,_0x4c25bd={}){const _0x527aeb=a107_0x4752,_0x807861={'results':[],'created':0x0,'updated':0x0,'unchanged':0x0,'errors':[]};if(_0x4c25bd[_0x527aeb(0x16c)]){for(const _0x2f4d66 of _0x1eab3d){_0x2f4d66[_0x527aeb(0x161)]===_0x527aeb(0x159)?(_0x807861[_0x527aeb(0x14b)][_0x527aeb(0x166)]({'name':_0x2f4d66[_0x527aeb(0x160)]['name'],'action':_0x527aeb(0x165)}),_0x807861[_0x527aeb(0x165)]++):(_0x807861[_0x527aeb(0x14b)][_0x527aeb(0x166)]({'name':_0x2f4d66['def'][_0x527aeb(0x173)],'action':'updated'}),_0x807861['updated']++);}return _0x807861;}const {engage:_0x5154af}=_0x889d75;for(let _0x1baf2d=0x0;_0x1baf2d<_0x1eab3d[_0x527aeb(0x168)];_0x1baf2d++){const _0x43c008=_0x1eab3d[_0x1baf2d];_0x4c25bd[_0x527aeb(0x155)]?.[_0x527aeb(0x16a)](_0x527aeb(0x151)+(_0x1baf2d+0x1)+'/'+_0x1eab3d[_0x527aeb(0x168)]+':\x20'+_0x43c008[_0x527aeb(0x160)]['name']);try{if(_0x43c008[_0x527aeb(0x161)]===_0x527aeb(0x159)&&_0x43c008['createInput']){const _0x469e71=await _0x5154af[_0x527aeb(0x170)](_0x43c008[_0x527aeb(0x15d)]);_0x807861[_0x527aeb(0x14b)]['push']({'name':_0x43c008[_0x527aeb(0x160)][_0x527aeb(0x173)],'action':'created','templateId':_0x469e71['id']}),_0x807861[_0x527aeb(0x165)]++;}else{if(_0x43c008[_0x527aeb(0x161)]===_0x527aeb(0x16a)&&_0x43c008[_0x527aeb(0x14e)]&&_0x43c008['existingId']){const _0x1a1eb7=await _0x5154af[_0x527aeb(0x15c)](_0x43c008['existingId'],_0x43c008['updateInput']);_0x807861['results'][_0x527aeb(0x166)]({'name':_0x43c008['def'][_0x527aeb(0x173)],'action':_0x527aeb(0x14d),'templateId':_0x1a1eb7['id']}),_0x807861[_0x527aeb(0x14d)]++;}}}catch(_0x4beacd){const _0x4a1a07=_0x4beacd instanceof Error?_0x4beacd[_0x527aeb(0x14f)]:String(_0x4beacd);_0x807861[_0x527aeb(0x162)][_0x527aeb(0x166)]({'name':_0x43c008['def'][_0x527aeb(0x173)],'error':_0x4a1a07});}}return _0x807861;}function createResolveContext(_0x101637,_0x18653d,_0x10052b){return{'resolveWorkspaceId':async _0x4aef04=>{const _0x1a2c86=a107_0x4752;return await _0x101637[_0x1a2c86(0x149)][_0x1a2c86(0x16d)](_0x4aef04);},'readFile':async _0x3dd204=>{const _0x814877=a107_0x4752,_0x5c5c89=a107_0x2f6a54[_0x814877(0x15e)](_0x10052b,_0x3dd204);return readFileSync(_0x5c5c89,_0x814877(0x163));}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3f307e,_0x1a42d9){const _0x319756=a108_0x2187,_0x5af785=_0x3f307e();while(!![]){try{const _0x1380ab=parseInt(_0x319756(0x1a0))/0x1+-parseInt(_0x319756(0x194))/0x2+parseInt(_0x319756(0x19f))/0x3+parseInt(_0x319756(0x18f))/0x4+parseInt(_0x319756(0x1a5))/0x5*(-parseInt(_0x319756(0x19b))/0x6)+parseInt(_0x319756(0x19a))/0x7*(parseInt(_0x319756(0x1a3))/0x8)+parseInt(_0x319756(0x1a1))/0x9*(-parseInt(_0x319756(0x1a6))/0xa);if(_0x1380ab===_0x1a42d9)break;else _0x5af785['push'](_0x5af785['shift']());}catch(_0x16031a){_0x5af785['push'](_0x5af785['shift']());}}}(a108_0x32c2,0xba461));import{TemplateDefSchema}from'./types/template-schema.js';import{formatZodPath,getLocationFromPath}from'../segment/yaml-validator.js';function a108_0x32c2(){const _0x556e52=['subject','TEMPLATE_INVALID_VARIABLE_NAME','length','875540feRsyo','warning','variables','TEMPLATE_MISSING_SUBJECT','data','variables[','84eqXDza','546WvQwru','TEMPLATE_INVALID_TYPE','error','TEMPLATE_MISSING_WORKSPACE','2047983coBJEO','1094725urHLiN','2556090CZsFnz','level','196032TVKilc','No\x20workspace\x20specified\x20—\x20template\x20will\x20use\x20workspace\x20from\x20context\x20or\x20CLI\x20option','44985iotPFX','30JIKxlu','Template\x20requires\x20subject\x20—\x20email\x20subject\x20line\x20template','html_file','].name','name','message','issues','workspace','success','source','symbol','path','map','push','Variable\x20name\x20\x22','3200280TIoXDy','document'];a108_0x32c2=function(){return _0x556e52;};return a108_0x32c2();}function a108_0x2187(_0x4f5005,_0x29a248){_0x4f5005=_0x4f5005-0x18f;const _0x32c20b=a108_0x32c2();let _0x21878f=_0x32c20b[_0x4f5005];return _0x21878f;}export function validateTemplateDef(_0x1e0ccb,_0x11dd38={}){const _0x460354=a108_0x2187,_0x306698=TemplateDefSchema['safeParse'](_0x1e0ccb);if(_0x306698[_0x460354(0x1ae)]){const _0xf01d68=runSemanticChecks(_0x306698[_0x460354(0x198)],_0x11dd38),_0x372bee=_0xf01d68['filter'](_0x1e2442=>_0x1e2442[_0x460354(0x1a2)]===_0x460354(0x19d)),_0x1c637d=_0xf01d68['filter'](_0x1a1541=>_0x1a1541[_0x460354(0x1a2)]===_0x460354(0x195));return{'valid':_0x372bee[_0x460354(0x193)]===0x0,'errors':_0x372bee,'warnings':_0x1c637d};}return zodErrorsToValidationResult(_0x306698[_0x460354(0x19d)],_0x11dd38);}function zodErrorsToValidationResult(_0x166ecb,_0x564fc){const _0x2096d1=a108_0x2187,_0x249879=_0x166ecb[_0x2096d1(0x1ac)][_0x2096d1(0x1b2)](_0x11d57b=>{const _0x2b78d3=_0x2096d1,_0x4b5660=formatZodPath(_0x11d57b[_0x2b78d3(0x1b1)]),_0x6fffe6=mapZodIssueToCode(_0x11d57b,_0x4b5660),_0xa75ad7=getLocationFromPath(_0x564fc['document'],_0x564fc[_0x2b78d3(0x1af)],_0x11d57b[_0x2b78d3(0x1b1)][_0x2b78d3(0x1b2)](_0x112536=>typeof _0x112536===_0x2b78d3(0x1b0)?String(_0x112536):_0x112536));return{'level':_0x2b78d3(0x19d),'path':_0x4b5660,'code':_0x6fffe6,'message':_0x11d57b[_0x2b78d3(0x1ab)],..._0xa75ad7&&{'location':_0xa75ad7}};});return{'valid':![],'errors':_0x249879,'warnings':[]};}function mapZodIssueToCode(_0x368080,_0x32e899){const _0x560c43=a108_0x2187;if(_0x32e899==='name')return'TEMPLATE_MISSING_NAME';if(_0x32e899==='type')return _0x560c43(0x19c);if(_0x32e899===_0x560c43(0x196)||_0x32e899['startsWith'](_0x560c43(0x196)))return'TEMPLATE_INVALID_VARIABLES';return'TEMPLATE_SCHEMA_ERROR';}function runSemanticChecks(_0x5bad55,_0x32362a){const _0x408a12=a108_0x2187,_0xe8a533=[];!_0x5bad55[_0x408a12(0x1a8)]&&_0xe8a533['push']({'level':_0x408a12(0x19d),'path':_0x408a12(0x1a8),'code':'TEMPLATE_MISSING_HTML_FILE','message':'Template\x20requires\x20html_file\x20—\x20path\x20to\x20the\x20HTML\x20file\x20for\x20email\x20content','location':getLocationFromPath(_0x32362a[_0x408a12(0x190)],_0x32362a[_0x408a12(0x1af)],[_0x408a12(0x1aa)])});!_0x5bad55['subject']&&_0xe8a533[_0x408a12(0x1b3)]({'level':_0x408a12(0x19d),'path':_0x408a12(0x191),'code':_0x408a12(0x197),'message':_0x408a12(0x1a7),'location':getLocationFromPath(_0x32362a[_0x408a12(0x190)],_0x32362a[_0x408a12(0x1af)],[_0x408a12(0x1aa)])});!_0x5bad55[_0x408a12(0x1ad)]&&_0xe8a533[_0x408a12(0x1b3)]({'level':_0x408a12(0x195),'path':_0x408a12(0x1ad),'code':_0x408a12(0x19e),'message':_0x408a12(0x1a4),'location':getLocationFromPath(_0x32362a[_0x408a12(0x190)],_0x32362a['source'],[_0x408a12(0x1aa)])});for(let _0x25aec7=0x0;_0x25aec7<_0x5bad55[_0x408a12(0x196)][_0x408a12(0x193)];_0x25aec7++){const _0x4b63ec=_0x5bad55[_0x408a12(0x196)][_0x25aec7];/\s/['test'](_0x4b63ec[_0x408a12(0x1aa)])&&_0xe8a533[_0x408a12(0x1b3)]({'level':_0x408a12(0x19d),'path':_0x408a12(0x199)+_0x25aec7+_0x408a12(0x1a9),'code':_0x408a12(0x192),'message':_0x408a12(0x1b4)+_0x4b63ec[_0x408a12(0x1aa)]+'\x22\x20must\x20not\x20contain\x20whitespace','location':getLocationFromPath(_0x32362a['document'],_0x32362a[_0x408a12(0x1af)],[_0x408a12(0x196),_0x25aec7,_0x408a12(0x1aa)])});}return _0xe8a533;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a109_0x5471(_0x5638fb,_0x5bee00){_0x5638fb=_0x5638fb-0x145;const _0x2d9bf5=a109_0x2d9b();let _0x5471e5=_0x2d9bf5[_0x5638fb];return _0x5471e5;}(function(_0x2fae34,_0x3f7501){const _0x4171c4=a109_0x5471,_0x1a9499=_0x2fae34();while(!![]){try{const _0x385f41=-parseInt(_0x4171c4(0x156))/0x1*(-parseInt(_0x4171c4(0x16c))/0x2)+parseInt(_0x4171c4(0x151))/0x3*(parseInt(_0x4171c4(0x14f))/0x4)+-parseInt(_0x4171c4(0x145))/0x5+parseInt(_0x4171c4(0x153))/0x6+parseInt(_0x4171c4(0x148))/0x7*(parseInt(_0x4171c4(0x169))/0x8)+parseInt(_0x4171c4(0x152))/0x9+parseInt(_0x4171c4(0x154))/0xa*(-parseInt(_0x4171c4(0x171))/0xb);if(_0x385f41===_0x3f7501)break;else _0x1a9499['push'](_0x1a9499['shift']());}catch(_0x261555){_0x1a9499['push'](_0x1a9499['shift']());}}}(a109_0x2d9b,0xe2573));import*as a109_0x1637e4 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(_0x2c378c,_0x1c8c3b){const _0x1912d4=a109_0x5471,_0x402362=_0x2c378c['attributes'],_0x2eaaea=sanitizeTemplateFileName(_0x402362[_0x1912d4(0x160)]);let _0x3a0146,_0xe232ce,_0x2545c2,_0x9c5b6e;_0x402362[_0x1912d4(0x168)]&&(_0x2545c2=_0x2eaaea+_0x1912d4(0x14b),_0x3a0146=_0x402362['htmlTemplate']);_0x402362[_0x1912d4(0x16e)]&&(_0x9c5b6e=_0x2eaaea+_0x1912d4(0x15b),_0xe232ce=_0x402362[_0x1912d4(0x16e)]);const _0x23f4a9=_0x402362[_0x1912d4(0x149)]&&_0x402362['templateVariables'][_0x1912d4(0x166)]>0x0,_0x2240e2={'type':_0x1912d4(0x15c),'name':_0x402362[_0x1912d4(0x160)],..._0x402362['subjectTemplate']&&{'subject':_0x402362[_0x1912d4(0x14a)]},..._0x1c8c3b[_0x1912d4(0x158)]&&{'workspace':_0x1c8c3b[_0x1912d4(0x158)]},..._0x402362[_0x1912d4(0x14c)]&&{'editor_type':_0x402362[_0x1912d4(0x14c)]},..._0x2545c2&&{'html_file':_0x2545c2},..._0x9c5b6e&&{'plaintext_file':_0x9c5b6e},'variables':_0x23f4a9?_0x402362['templateVariables'][_0x1912d4(0x170)](templateVariableToYaml):[]};return{'def':_0x2240e2,'htmlContent':_0x3a0146,'plaintextContent':_0xe232ce};}export async function defToCreateInput(_0x4dd9e9,_0x583cbf){const _0x4ae648=a109_0x5471,_0x4e7974={'name':_0x4dd9e9[_0x4ae648(0x160)],'subjectTemplate':_0x4dd9e9['subject']??'','htmlTemplate':''};return _0x4dd9e9['workspace']&&(_0x4e7974[_0x4ae648(0x164)]=await _0x583cbf[_0x4ae648(0x165)](_0x4dd9e9['workspace'])),_0x4dd9e9[_0x4ae648(0x155)]&&(_0x4e7974[_0x4ae648(0x14c)]=_0x4dd9e9[_0x4ae648(0x155)]),_0x4dd9e9[_0x4ae648(0x146)]&&(_0x4e7974['htmlTemplate']=await _0x583cbf[_0x4ae648(0x163)](_0x4dd9e9[_0x4ae648(0x146)])),_0x4dd9e9[_0x4ae648(0x161)]&&(_0x4e7974[_0x4ae648(0x16e)]=await _0x583cbf[_0x4ae648(0x163)](_0x4dd9e9['plaintext_file'])),_0x4dd9e9[_0x4ae648(0x16b)][_0x4ae648(0x166)]>0x0&&(_0x4e7974['templateVariables']=_0x4dd9e9[_0x4ae648(0x16b)]['map'](variableDefToApi)),_0x4e7974;}export async function defToUpdateInput(_0x1fc684,_0x5a2707){const _0x477cb3=a109_0x5471,_0x30e1d4={};if(_0x1fc684[_0x477cb3(0x160)])_0x30e1d4[_0x477cb3(0x160)]=_0x1fc684[_0x477cb3(0x160)];if(_0x1fc684[_0x477cb3(0x16f)])_0x30e1d4[_0x477cb3(0x14a)]=_0x1fc684[_0x477cb3(0x16f)];return _0x1fc684[_0x477cb3(0x146)]&&(_0x30e1d4[_0x477cb3(0x168)]=await _0x5a2707[_0x477cb3(0x163)](_0x1fc684[_0x477cb3(0x146)])),_0x1fc684[_0x477cb3(0x161)]&&(_0x30e1d4[_0x477cb3(0x16e)]=await _0x5a2707['readFile'](_0x1fc684['plaintext_file'])),_0x1fc684[_0x477cb3(0x16b)][_0x477cb3(0x166)]>0x0&&(_0x30e1d4[_0x477cb3(0x149)]=_0x1fc684['variables'][_0x477cb3(0x170)](variableDefToApi)),_0x30e1d4;}function a109_0x2d9b(){const _0xa4f8d6=['html_file','parse','445235wcOvkc','templateVariables','subjectTemplate','.html','editorType','stringify','display_name','4gBTLMy','trimStart','2550333smGLKP','15404301TqIwAg','8859966ivUSjV','370zPzTty','editor_type','583awXdjt','displayName','workspaceName','split','defaultValue','.txt','template','null','variables:','workspace','name','plaintext_file','preview_value','readFile','workspaceId','resolveWorkspaceId','length','join','htmlTemplate','48ocBBvi','some','variables','4184hOeemi','default_value','plaintextTemplate','subject','map','1060389IDMKjy','5728865PJBBWC'];a109_0x2d9b=function(){return _0xa4f8d6;};return a109_0x2d9b();}export function toYamlString(_0x352274){const _0x1c840c=a109_0x5471,_0x3d7723=JSON[_0x1c840c(0x147)](JSON[_0x1c840c(0x14d)](_0x352274)),_0x427a31=a109_0x1637e4['stringify'](_0x3d7723,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x1c840c(0x15d)}),_0x3f4ec4=[_0x1c840c(0x15e)],_0x4177f4=_0x427a31[_0x1c840c(0x159)]('\x0a'),_0x5c9189=[];for(let _0x22d58d=0x0;_0x22d58d<_0x4177f4['length'];_0x22d58d++){const _0xf6c037=_0x4177f4[_0x22d58d][_0x1c840c(0x150)]();_0x22d58d>0x0&&_0x3f4ec4[_0x1c840c(0x16a)](_0x26dd12=>_0xf6c037['startsWith'](_0x26dd12))&&_0x5c9189[_0x1c840c(0x166)]>0x0&&_0x5c9189[_0x5c9189[_0x1c840c(0x166)]-0x1]!==''&&_0x5c9189['push'](''),_0x5c9189['push'](_0x4177f4[_0x22d58d]);}return _0x5c9189[_0x1c840c(0x167)]('\x0a');}export function parseYamlString(_0x15f712){return safeParseYaml(_0x15f712,TemplateDefSchema);}export function normalizeDef(_0x505537){const _0x445591=a109_0x5471;return{'type':_0x445591(0x15c),'name':_0x505537[_0x445591(0x160)],..._0x505537['subject']!==undefined&&{'subject':_0x505537['subject']},..._0x505537[_0x445591(0x15f)]!==undefined&&{'workspace':_0x505537[_0x445591(0x15f)]},..._0x505537['editor_type']!==undefined&&{'editor_type':_0x505537['editor_type']},..._0x505537[_0x445591(0x146)]!==undefined&&{'html_file':_0x505537[_0x445591(0x146)]},..._0x505537['plaintext_file']!==undefined&&{'plaintext_file':_0x505537['plaintext_file']},'variables':_0x505537['variables'][_0x445591(0x166)]>0x0?_0x505537['variables'][_0x445591(0x170)](_0x4c95a1=>({'name':_0x4c95a1[_0x445591(0x160)],'display_name':_0x4c95a1[_0x445591(0x14e)],'preview_value':_0x4c95a1[_0x445591(0x162)],..._0x4c95a1['default_value']!==undefined&&{'default_value':_0x4c95a1[_0x445591(0x16d)]}})):[]};}function variableDefToApi(_0x387abf){const _0x2c2657=a109_0x5471;return{'name':_0x387abf[_0x2c2657(0x160)],'displayName':_0x387abf[_0x2c2657(0x14e)],'previewValue':_0x387abf['preview_value'],..._0x387abf[_0x2c2657(0x16d)]!==undefined&&{'defaultValue':_0x387abf[_0x2c2657(0x16d)]}};}function templateVariableToYaml(_0x5f18c7){const _0x59f80d=a109_0x5471;return{'name':_0x5f18c7['name'],'display_name':_0x5f18c7[_0x59f80d(0x157)],'preview_value':_0x5f18c7['previewValue'],..._0x5f18c7[_0x59f80d(0x15a)]!==undefined&&{'default_value':_0x5f18c7[_0x59f80d(0x15a)]}};}export const sanitizeTemplateFileName=sanitizeFileName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4b4eab,_0x1dfc63){var _0x4abcf1=a110_0x2861,_0x5b2aff=_0x4b4eab();while(!![]){try{var _0x548cd1=parseInt(_0x4abcf1(0x78))/0x1+parseInt(_0x4abcf1(0x7a))/0x2+-parseInt(_0x4abcf1(0x7b))/0x3+parseInt(_0x4abcf1(0x77))/0x4+parseInt(_0x4abcf1(0x76))/0x5*(parseInt(_0x4abcf1(0x75))/0x6)+parseInt(_0x4abcf1(0x74))/0x7+-parseInt(_0x4abcf1(0x79))/0x8;if(_0x548cd1===_0x1dfc63)break;else _0x5b2aff['push'](_0x5b2aff['shift']());}catch(_0x5072a0){_0x5b2aff['push'](_0x5b2aff['shift']());}}}(a110_0x27ad,0xe81e0));export{CampaignDefSchema,EmailDefSchema,PushContentDefSchema,ScheduleDefSchema,ColumnMappingDefSchema,ConnectorDefSchema,ActivationSettingsDefSchema,UtmDefSchema,NotificationsDefSchema,TemplateVariableDefSchema}from'./campaign-schema.js';function a110_0x2861(_0x28f9f6,_0x22a1f3){_0x28f9f6=_0x28f9f6-0x74;var _0x27ad2f=a110_0x27ad();var _0x2861d0=_0x27ad2f[_0x28f9f6];return _0x2861d0;}function a110_0x27ad(){var _0xeb773d=['4186761OwXqHi','11860898ovOhwp','390vDmfDB','132565PbGnRO','1388724wMxKFk','1136997sBtyHU','30458024WEDEym','2503310WAYFNY'];a110_0x27ad=function(){return _0xeb773d;};return a110_0x27ad();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a111_0x1dee25=a111_0x1749;(function(_0x6af8e4,_0x112305){const _0x8e37dd=a111_0x1749,_0x384775=_0x6af8e4();while(!![]){try{const _0x286e69=-parseInt(_0x8e37dd(0x1ec))/0x1+parseInt(_0x8e37dd(0x1f8))/0x2+-parseInt(_0x8e37dd(0x1eb))/0x3*(parseInt(_0x8e37dd(0x1e3))/0x4)+-parseInt(_0x8e37dd(0x1f2))/0x5+parseInt(_0x8e37dd(0x1f5))/0x6+parseInt(_0x8e37dd(0x1f1))/0x7*(parseInt(_0x8e37dd(0x1f6))/0x8)+parseInt(_0x8e37dd(0x1e4))/0x9*(parseInt(_0x8e37dd(0x1e9))/0xa);if(_0x286e69===_0x112305)break;else _0x384775['push'](_0x384775['shift']());}catch(_0x5d7f89){_0x384775['push'](_0x384775['shift']());}}}(a111_0x2f73,0x9a5c7));import{z}from'zod';export const TemplateVariableDefSchema=z[a111_0x1dee25(0x1ee)]({'name':z['string'](),'display_name':z[a111_0x1dee25(0x1e8)]()['optional'](),'preview_value':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'default_value':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)]()});function a111_0x1749(_0x796ae0,_0x37a0e8){_0x796ae0=_0x796ae0-0x1e2;const _0x2f737a=a111_0x2f73();let _0x174970=_0x2f737a[_0x796ae0];return _0x174970;}export const EmailDefSchema=z['object']({'template':z[a111_0x1dee25(0x1e8)]()['optional'](),'subject':z[a111_0x1dee25(0x1e8)]()['optional'](),'html_file':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'plaintext_file':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'sender_id':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'variables':z[a111_0x1dee25(0x1ed)](TemplateVariableDefSchema)[a111_0x1dee25(0x1ea)]()});export const PushContentDefSchema=z[a111_0x1dee25(0x1ee)]({'title':z[a111_0x1dee25(0x1e8)]()['optional'](),'message':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'push_type':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'image_url':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'on_click_behavior':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'on_click_behavior_url':z[a111_0x1dee25(0x1e8)]()['optional']()});export const ScheduleDefSchema=z[a111_0x1dee25(0x1ee)]({'start_at':z[a111_0x1dee25(0x1e8)]()['optional'](),'timezone':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)]()});export const ColumnMappingDefSchema=z['object']({'column':z['string'](),'source':z[a111_0x1dee25(0x1e8)]()});export const ConnectorDefSchema=z[a111_0x1dee25(0x1ee)]({'all_columns':z[a111_0x1dee25(0x1ef)]()[a111_0x1dee25(0x1ea)](),'columns':z['array'](ColumnMappingDefSchema)[a111_0x1dee25(0x1ea)]()});function a111_0x2f73(){const _0x15beb9=['enum','6524490snadrR','584PQqELQ','push','130020mZCELh','number','2659612tUQOBX','9558927xMFdHp','literal','default','Campaign\x20name\x20is\x20required','string','10ZQqxqi','optional','3SlbsgI','460371RNPECZ','array','object','boolean','campaign','28798zlBmZV','3786565xkfLqj','email'];a111_0x2f73=function(){return _0x15beb9;};return a111_0x2f73();}export const ActivationSettingsDefSchema=z[a111_0x1dee25(0x1ee)]({'enabled':z[a111_0x1dee25(0x1ef)]()['optional'](),'workflow_project':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'workflow_name':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)]()});export const UtmDefSchema=z['object']({'enabled':z[a111_0x1dee25(0x1ef)]()[a111_0x1dee25(0x1ea)](),'id':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'medium':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'source':z['string']()['optional'](),'source_platform':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'campaign':z[a111_0x1dee25(0x1e8)]()['optional'](),'marketing_tactic':z['string']()[a111_0x1dee25(0x1ea)]()});export const NotificationsDefSchema=z[a111_0x1dee25(0x1ee)]({'events':z[a111_0x1dee25(0x1ed)](z[a111_0x1dee25(0x1e8)]())[a111_0x1dee25(0x1ea)](),'recipients':z[a111_0x1dee25(0x1ed)](z[a111_0x1dee25(0x1e2)]())['optional']()});export const CampaignDefSchema=z[a111_0x1dee25(0x1ee)]({'type':z[a111_0x1dee25(0x1e5)](a111_0x1dee25(0x1f0))[a111_0x1dee25(0x1e6)](a111_0x1dee25(0x1f0)),'name':z[a111_0x1dee25(0x1e8)]()['min'](0x1,a111_0x1dee25(0x1e7)),'campaign_type':z[a111_0x1dee25(0x1f4)]([a111_0x1dee25(0x1f3),a111_0x1dee25(0x1f7)]),'description':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'workspace':z['string']()[a111_0x1dee25(0x1ea)](),'audience':z[a111_0x1dee25(0x1e8)]()[a111_0x1dee25(0x1ea)](),'segment':z[a111_0x1dee25(0x1e8)]()['optional'](),'email':EmailDefSchema[a111_0x1dee25(0x1ea)](),'push':PushContentDefSchema[a111_0x1dee25(0x1ea)](),'schedule':ScheduleDefSchema['optional'](),'connector':ConnectorDefSchema[a111_0x1dee25(0x1ea)](),'activation':ActivationSettingsDefSchema[a111_0x1dee25(0x1ea)](),'utm':UtmDefSchema[a111_0x1dee25(0x1ea)](),'notifications':NotificationsDefSchema[a111_0x1dee25(0x1ea)]()});
|