@treasuredata/tdx 0.28.8 → 0.29.0

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.
Files changed (211) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.d.ts.map +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-push-command.js.map +1 -1
  40. package/dist/commands/segment-update-command.js +1 -1
  41. package/dist/commands/segment-use-command.js +1 -1
  42. package/dist/commands/segment-validate-command.js +1 -1
  43. package/dist/commands/segments.js +1 -1
  44. package/dist/commands/show.js +1 -1
  45. package/dist/commands/status-command.js +1 -1
  46. package/dist/commands/tables.js +1 -1
  47. package/dist/commands/unset-command.js +1 -1
  48. package/dist/commands/upgrade-command.js +1 -1
  49. package/dist/commands/use-command.js +1 -1
  50. package/dist/commands/user-command.js +1 -1
  51. package/dist/commands/workflow-command.js +1 -1
  52. package/dist/core/auth.js +1 -1
  53. package/dist/core/command-output.js +1 -1
  54. package/dist/core/config.js +1 -1
  55. package/dist/core/connection-cache.js +1 -1
  56. package/dist/core/constants.js +1 -1
  57. package/dist/core/credential-cache.js +1 -1
  58. package/dist/core/global-context.js +1 -1
  59. package/dist/core/keychain.js +1 -1
  60. package/dist/core/profile.js +1 -1
  61. package/dist/core/project-config.js +1 -1
  62. package/dist/core/session.js +1 -1
  63. package/dist/core/user-cache.js +1 -1
  64. package/dist/core/version.js +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/mcp/server.js +1 -1
  67. package/dist/mcp/tools/index.js +1 -1
  68. package/dist/mcp/tools/tdx-run.js +1 -1
  69. package/dist/mcp/tools/tdx-search.js +1 -1
  70. package/dist/mcp/utils.js +1 -1
  71. package/dist/proxy/claude-usage-tracker.js +1 -1
  72. package/dist/proxy/passthrough-server.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/agent/tool-target-registry.js +1 -1
  83. package/dist/sdk/api.js +1 -1
  84. package/dist/sdk/client/cdp-api-client.js +1 -1
  85. package/dist/sdk/client/delivery-api-client.js +1 -1
  86. package/dist/sdk/client/endpoints.js +1 -1
  87. package/dist/sdk/client/engage-api-client.js +1 -1
  88. package/dist/sdk/client/http-client.js +1 -1
  89. package/dist/sdk/client/llm-api-client.js +1 -1
  90. package/dist/sdk/client/rate-limiter.js +1 -1
  91. package/dist/sdk/client/td-api-client.js +1 -1
  92. package/dist/sdk/client/trino-api-client.js +1 -1
  93. package/dist/sdk/client/workflow-client.js +1 -1
  94. package/dist/sdk/connection-validator.js +1 -1
  95. package/dist/sdk/connection.js +1 -1
  96. package/dist/sdk/delivery.js +1 -1
  97. package/dist/sdk/engage/campaign-pull.js +1 -1
  98. package/dist/sdk/engage/campaign-push.js +1 -1
  99. package/dist/sdk/engage/campaign-validator.d.ts.map +1 -1
  100. package/dist/sdk/engage/campaign-validator.js +1 -1
  101. package/dist/sdk/engage/campaign-validator.js.map +1 -1
  102. package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
  103. package/dist/sdk/engage/campaign-yaml.js +1 -1
  104. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  105. package/dist/sdk/engage/types/campaign-def.js +1 -1
  106. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  107. package/dist/sdk/engage.js +1 -1
  108. package/dist/sdk/errors.js +1 -1
  109. package/dist/sdk/index.js +1 -1
  110. package/dist/sdk/io/index.js +1 -1
  111. package/dist/sdk/io/node-filesystem.js +1 -1
  112. package/dist/sdk/job.js +1 -1
  113. package/dist/sdk/journey.js +1 -1
  114. package/dist/sdk/llm/chat-cache.js +1 -1
  115. package/dist/sdk/llm/index.js +1 -1
  116. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  117. package/dist/sdk/llm/model-factors.js +1 -1
  118. package/dist/sdk/personalization.js +1 -1
  119. package/dist/sdk/query/index.js +1 -1
  120. package/dist/sdk/query/sql-parser.js +1 -1
  121. package/dist/sdk/realtime.js +1 -1
  122. package/dist/sdk/schedule.js +1 -1
  123. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  124. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  125. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  126. package/dist/sdk/segment/fields-display.js +1 -1
  127. package/dist/sdk/segment/file-discovery.js +1 -1
  128. package/dist/sdk/segment/journey-utils.js +1 -1
  129. package/dist/sdk/segment/journey-validator.js +1 -1
  130. package/dist/sdk/segment/journey-yaml.js +1 -1
  131. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  132. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  133. package/dist/sdk/segment/pull-workflow.js +1 -1
  134. package/dist/sdk/segment/push-recovery.js +1 -1
  135. package/dist/sdk/segment/push-workflow.d.ts +1 -1
  136. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  137. package/dist/sdk/segment/push-workflow.js +1 -1
  138. package/dist/sdk/segment/push-workflow.js.map +1 -1
  139. package/dist/sdk/segment/resolution-context.js +1 -1
  140. package/dist/sdk/segment/segment-path-parser.js +1 -1
  141. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  142. package/dist/sdk/segment/segment-validator.d.ts +33 -0
  143. package/dist/sdk/segment/segment-validator.d.ts.map +1 -0
  144. package/dist/sdk/segment/segment-validator.js +1 -0
  145. package/dist/sdk/segment/segment-validator.js.map +1 -0
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/segment-def.d.ts +5 -179
  149. package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
  150. package/dist/sdk/segment/types/segment-def.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js.map +1 -1
  152. package/dist/sdk/segment/types/segment-schema.d.ts +259 -0
  153. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -0
  154. package/dist/sdk/segment/types/segment-schema.js +1 -0
  155. package/dist/sdk/segment/types/segment-schema.js.map +1 -0
  156. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  157. package/dist/sdk/segment/validate-files.js +1 -1
  158. package/dist/sdk/segment/validate-files.js.map +1 -1
  159. package/dist/sdk/segment/yaml-validator.d.ts +27 -10
  160. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  161. package/dist/sdk/segment/yaml-validator.js +1 -1
  162. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  163. package/dist/sdk/segment.js +1 -1
  164. package/dist/sdk/types/cdp.d.ts +11 -2
  165. package/dist/sdk/types/cdp.d.ts.map +1 -1
  166. package/dist/sdk/types/index.js +1 -1
  167. package/dist/sdk/types/progress.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/tree-formatter.js +1 -1
  173. package/dist/sdk/workflow/archive-validation.js +1 -1
  174. package/dist/sdk/workflow/clone-workflow.js +1 -1
  175. package/dist/sdk/workflow/index.js +1 -1
  176. package/dist/sdk/workflow/pull-workflow.js +1 -1
  177. package/dist/sdk/workflow/push-workflow.js +1 -1
  178. package/dist/sdk/workflow/tdx-config.js +1 -1
  179. package/dist/sdk/workflow/workflow-utils.js +1 -1
  180. package/dist/test-utils/command-runner.js +1 -1
  181. package/dist/test-utils/factories.js +1 -1
  182. package/dist/test-utils/fixtures.js +1 -1
  183. package/dist/test-utils/http-mock.js +1 -1
  184. package/dist/test-utils/index.js +1 -1
  185. package/dist/utils/async.js +1 -1
  186. package/dist/utils/colors.js +1 -1
  187. package/dist/utils/diff.js +1 -1
  188. package/dist/utils/file-permissions.js +1 -1
  189. package/dist/utils/file-reader.js +1 -1
  190. package/dist/utils/global-cache.js +1 -1
  191. package/dist/utils/json-loader.js +1 -1
  192. package/dist/utils/local-cache.js +1 -1
  193. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  194. package/dist/utils/logger/formatters/index.js +1 -1
  195. package/dist/utils/logger/handlers/console-handler.js +1 -1
  196. package/dist/utils/logger/handlers/file-handler.js +1 -1
  197. package/dist/utils/logger/handlers/index.js +1 -1
  198. package/dist/utils/logger/handlers/null-handler.js +1 -1
  199. package/dist/utils/logger/index.js +1 -1
  200. package/dist/utils/logger/logger.js +1 -1
  201. package/dist/utils/logger/types.js +1 -1
  202. package/dist/utils/option-validation.js +1 -1
  203. package/dist/utils/process.js +1 -1
  204. package/dist/utils/prompt.js +1 -1
  205. package/dist/utils/spinner.js +1 -1
  206. package/dist/utils/sse-parser.js +1 -1
  207. package/dist/utils/string-utils.js +1 -1
  208. package/dist/utils/table-ref-parser.js +1 -1
  209. package/dist/utils/tdx-logger.js +1 -1
  210. package/dist/utils/version-check.js +1 -1
  211. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x335f22,_0x20313f){const _0x425bfd=a132_0x51d2,_0x4166d7=_0x335f22();while(!![]){try{const _0x481634=-parseInt(_0x425bfd(0x124))/0x1+parseInt(_0x425bfd(0x135))/0x2*(parseInt(_0x425bfd(0x153))/0x3)+parseInt(_0x425bfd(0x14b))/0x4*(parseInt(_0x425bfd(0x156))/0x5)+-parseInt(_0x425bfd(0x132))/0x6*(-parseInt(_0x425bfd(0x150))/0x7)+parseInt(_0x425bfd(0x130))/0x8*(-parseInt(_0x425bfd(0x13f))/0x9)+-parseInt(_0x425bfd(0x155))/0xa+-parseInt(_0x425bfd(0x148))/0xb*(parseInt(_0x425bfd(0x152))/0xc);if(_0x481634===_0x20313f)break;else _0x4166d7['push'](_0x4166d7['shift']());}catch(_0x515382){_0x4166d7['push'](_0x4166d7['shift']());}}}(a132_0x3474,0x9523f));import a132_0xd0b3a2 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';function a132_0x3474(){const _0x4d9b05=['folderPath','message','invalid_yaml','No\x20tdx.json\x20found\x20for\x20file:\x20','8239pHAmVd','readFile','492sWJIZX','77583dJYNJy','trim','1961930qYpsQS','1145YDOVTJ','parent_segment','match','replace','30713vcpUCn','exists','parentSegment','join','scopedFolderPath','resolve','resourceType','error','includes','cwd','extname','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','8lBnLxD','File\x20not\x20found','552mazRYd','journey','file','46MTNGhe','parent_name','Not\x20a\x20YAML\x20file:\x20','segmentName','segment','dirname','configDir','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','startsWith','no_parent','4287924RPJjfq','string','type','stat','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','basename','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','isScoped','no_config','6039ZXkqkN','directory','context','11068WivzLu'];a132_0x3474=function(){return _0x4d9b05;};return a132_0x3474();}function a132_0x51d2(_0x152434,_0x5ebff1){_0x152434=_0x152434-0x123;const _0x3474a9=a132_0x3474();let _0x51d233=_0x3474a9[_0x152434];return _0x51d233;}import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x591852){const _0xb13b74=a132_0x51d2;return _0x591852['type']!==_0xb13b74(0x12b);}export function isScopedResolution(_0x410bae){const _0xdff876=a132_0x51d2;return _0x410bae[_0xdff876(0x141)]==='directory'||_0x410bae[_0xdff876(0x141)]===_0xdff876(0x134)||_0x410bae[_0xdff876(0x141)]==='context';}export function getScopedDetails(_0x423fb4){const _0x17f24d=a132_0x51d2;if(isScopedResolution(_0x423fb4))return{'isScoped':_0x423fb4[_0x17f24d(0x146)],'scopedFolderPath':_0x423fb4[_0x17f24d(0x128)]};return undefined;}async function findTdxConfigAsync(_0x4c939e,_0x36c132){const _0x33fb06=a132_0x51d2;let _0x190c9a=a132_0xd0b3a2[_0x33fb06(0x129)](_0x4c939e);const _0x4da706=a132_0xd0b3a2['parse'](_0x190c9a)['root'];while(_0x190c9a!==_0x4da706){const _0x3b6f2b=a132_0xd0b3a2[_0x33fb06(0x127)](_0x190c9a,'tdx.json');if(await _0x36c132[_0x33fb06(0x125)](_0x3b6f2b))try{const _0x27ec01=await _0x36c132[_0x33fb06(0x151)](_0x3b6f2b),_0x27bf95=JSON['parse'](_0x27ec01);if(_0x27bf95[_0x33fb06(0x157)]&&typeof _0x27bf95[_0x33fb06(0x157)]===_0x33fb06(0x140))return{'configPath':_0x3b6f2b,'configDir':_0x190c9a,'parentSegment':_0x27bf95[_0x33fb06(0x157)]};}catch{}_0x190c9a=a132_0xd0b3a2['dirname'](_0x190c9a);}return null;}function calculateScopedPath(_0x23ac66,_0xc733f0){const _0x1a7253=a132_0x51d2,_0x2cbd8c=a132_0xd0b3a2['relative'](_0xc733f0,_0x23ac66),_0x514398=_0x2cbd8c!==''&&_0x2cbd8c!=='.'&&!_0x2cbd8c[_0x1a7253(0x13d)]('..');return{'isScoped':_0x514398,'scopedFolderPath':_0x514398?_0x2cbd8c[_0x1a7253(0x123)](/\\/g,'/'):''};}export async function resolveTarget(_0x3908bf){const _0x5e158b=a132_0x51d2,{arg:_0x42fb42,contextParent:_0x453741,cwd:cwd=process[_0x5e158b(0x12d)](),fs:fs=nodeFileSystem}=_0x3908bf;if(_0x42fb42&&isYamlFilePath(_0x42fb42))try{const _0x5a0247=await resolveYamlFilePath(_0x42fb42,fs),_0x3370a3=a132_0xd0b3a2[_0x5e158b(0x129)](_0x42fb42),_0x3b377a=a132_0xd0b3a2[_0x5e158b(0x13a)](_0x3370a3),_0x271c2a=await findTdxConfigAsync(_0x3b377a,fs);if(!_0x271c2a){if(_0x453741){const _0x241faa=a132_0xd0b3a2[_0x5e158b(0x13a)](_0x3370a3);return{'type':'file','parentName':_0x453741,'targetDir':_0x241faa,'configRoot':_0x241faa,'filePath':_0x3370a3,'resourceName':_0x5a0247[_0x5e158b(0x138)],'folderPath':_0x5a0247['folderPath'],'resourceType':_0x5a0247[_0x5e158b(0x12a)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x147),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x42fb42,'arg':_0x42fb42,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x46c403=calculateScopedPath(_0x3b377a,_0x271c2a['configDir']);return{'type':_0x5e158b(0x134),'parentName':_0x271c2a['parentSegment'],'targetDir':_0x271c2a[_0x5e158b(0x13b)],'configRoot':_0x271c2a['configDir'],'filePath':_0x3370a3,'resourceName':_0x5a0247['segmentName'],'folderPath':_0x5a0247[_0x5e158b(0x14c)],'resourceType':_0x5a0247[_0x5e158b(0x12a)],'isScoped':_0x46c403['isScoped'],'scopedFolderPath':_0x46c403[_0x5e158b(0x128)]};}catch(_0x51b84b){const _0x4fcd4d=_0x51b84b instanceof Error?_0x51b84b[_0x5e158b(0x14d)]:String(_0x51b84b);if(_0x4fcd4d[_0x5e158b(0x12c)](_0x5e158b(0x131)))return{'type':'error','errorCode':'file_not_found','message':'File\x20not\x20found:\x20'+_0x42fb42,'arg':_0x42fb42};if(_0x4fcd4d['includes']('No\x20tdx.json\x20found')){if(_0x453741){const _0x251cb4=a132_0xd0b3a2['resolve'](_0x42fb42);if(await fs['exists'](_0x251cb4)){const _0x5a4781=a132_0xd0b3a2[_0x5e158b(0x13a)](_0x251cb4),_0x3e999a=await fs['readFile'](_0x251cb4),_0x416a3d=_0x3e999a['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x1e95f8=_0x3e999a[_0x5e158b(0x158)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4d21c1=_0x416a3d?_0x416a3d[0x1][_0x5e158b(0x154)]():a132_0xd0b3a2[_0x5e158b(0x144)](_0x42fb42,a132_0xd0b3a2[_0x5e158b(0x12e)](_0x42fb42)),_0x256eee=_0x1e95f8&&_0x1e95f8[0x1][_0x5e158b(0x154)]()===_0x5e158b(0x133)?_0x5e158b(0x133):_0x5e158b(0x139);return{'type':_0x5e158b(0x134),'parentName':_0x453741,'targetDir':_0x5a4781,'configRoot':_0x5a4781,'filePath':_0x251cb4,'resourceName':_0x4d21c1,'folderPath':'','resourceType':_0x256eee,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x147),'message':_0x5e158b(0x14f)+_0x42fb42,'arg':_0x42fb42,'helpText':_0x5e158b(0x145)};}return{'type':_0x5e158b(0x12b),'errorCode':'invalid_yaml','message':_0x4fcd4d,'arg':_0x42fb42};}if(_0x42fb42){const _0xce439=a132_0xd0b3a2[_0x5e158b(0x129)](cwd,_0x42fb42);let _0x23d282=null;try{_0x23d282=await fs[_0x5e158b(0x142)](_0xce439);}catch{}if(_0x23d282?.['isDirectory']()){const _0x1fd3fa=await findTdxConfigAsync(_0xce439,fs);if(_0x1fd3fa){const _0x8e9a26=calculateScopedPath(_0xce439,_0x1fd3fa[_0x5e158b(0x13b)]);return{'type':'directory','parentName':_0x1fd3fa[_0x5e158b(0x126)],'targetDir':_0xce439,'configRoot':_0x1fd3fa[_0x5e158b(0x13b)],'isScoped':_0x8e9a26[_0x5e158b(0x146)],'scopedFolderPath':_0x8e9a26[_0x5e158b(0x128)]};}if(_0x453741)return{'type':_0x5e158b(0x149),'parentName':_0x453741,'targetDir':_0xce439,'configRoot':_0xce439,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x147),'message':_0x5e158b(0x143)+_0x42fb42,'arg':_0x42fb42,'helpText':_0x5e158b(0x145)};}if(_0x23d282?.['isFile']())return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x14e),'message':_0x5e158b(0x137)+_0x42fb42,'arg':_0x42fb42,'helpText':_0x5e158b(0x13c)};const _0x356e7d=sanitizeFileName(_0x42fb42),_0x2b54d9=getSegmentRootDir(_0x356e7d,cwd);return{'type':_0x5e158b(0x136),'parentName':_0x42fb42,'targetDir':_0x2b54d9,'configRoot':_0x2b54d9};}const _0x19cece=await findTdxConfigAsync(cwd,fs);if(_0x19cece){const _0x2b6ae1=calculateScopedPath(cwd,_0x19cece[_0x5e158b(0x13b)]);return{'type':_0x5e158b(0x14a),'parentName':_0x19cece['parentSegment'],'targetDir':cwd,'configRoot':_0x19cece[_0x5e158b(0x13b)],'isScoped':_0x2b6ae1[_0x5e158b(0x146)],'scopedFolderPath':_0x2b6ae1['scopedFolderPath']};}if(_0x453741){const _0x1105f1=sanitizeFileName(_0x453741),_0xfbc3c4=getSegmentRootDir(_0x1105f1,cwd);return{'type':_0x5e158b(0x14a),'parentName':_0x453741,'targetDir':_0xfbc3c4,'configRoot':_0xfbc3c4,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x13e),'message':'Parent\x20segment\x20not\x20specified','helpText':_0x5e158b(0x12f)};}
1
+ function a133_0x384a(){const _0x5650a9=['segmentName','folderPath','replace','no_config','1638312xoIiXn','scopedFolderPath','6717487YuSaWS','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','File\x20not\x20found:\x20','isScoped','startsWith','error','file_not_found','segment','parent_segment','8vASbvA','4053408HjNBZg','includes','File\x20not\x20found','isFile','954759gfdTBe','directory','parentSegment','cwd','journey','resolve','5163sIwFeR','Parent\x20segment\x20not\x20specified','configDir','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','type','join','context','parent_name','436muPQMR','trim','message','invalid_yaml','match','readFile','relative','tdx.json','3562551dcOTvN','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','4821335zCHPmv','parse','Not\x20a\x20YAML\x20file:\x20','file','No\x20tdx.json\x20found\x20for\x20file:\x20','dirname','extname','exists','basename'];a133_0x384a=function(){return _0x5650a9;};return a133_0x384a();}(function(_0x32294b,_0x39e77f){const _0x2c1904=a133_0x4407,_0x5bbbe4=_0x32294b();while(!![]){try{const _0x37cb60=-parseInt(_0x2c1904(0x1c0))/0x1+-parseInt(_0x2c1904(0x1ce))/0x2*(-parseInt(_0x2c1904(0x1c6))/0x3)+parseInt(_0x2c1904(0x1bc))/0x4+parseInt(_0x2c1904(0x1d8))/0x5+-parseInt(_0x2c1904(0x1b0))/0x6+parseInt(_0x2c1904(0x1b2))/0x7*(-parseInt(_0x2c1904(0x1bb))/0x8)+parseInt(_0x2c1904(0x1d6))/0x9;if(_0x37cb60===_0x39e77f)break;else _0x5bbbe4['push'](_0x5bbbe4['shift']());}catch(_0x90609b){_0x5bbbe4['push'](_0x5bbbe4['shift']());}}}(a133_0x384a,0x89020));import a133_0x13f878 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';function a133_0x4407(_0x17ea23,_0x506ee4){_0x17ea23=_0x17ea23-0x1a5;const _0x384a6f=a133_0x384a();let _0x44077b=_0x384a6f[_0x17ea23];return _0x44077b;}import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x33087c){const _0x150926=a133_0x4407;return _0x33087c[_0x150926(0x1ca)]!=='error';}export function isScopedResolution(_0x8cfbf1){const _0x1aa231=a133_0x4407;return _0x8cfbf1['type']===_0x1aa231(0x1c1)||_0x8cfbf1[_0x1aa231(0x1ca)]===_0x1aa231(0x1a6)||_0x8cfbf1['type']===_0x1aa231(0x1cc);}export function getScopedDetails(_0x2bf1fd){const _0x17be24=a133_0x4407;if(isScopedResolution(_0x2bf1fd))return{'isScoped':_0x2bf1fd[_0x17be24(0x1b5)],'scopedFolderPath':_0x2bf1fd[_0x17be24(0x1b1)]};return undefined;}async function findTdxConfigAsync(_0x166d4a,_0x401f86){const _0x709453=a133_0x4407;let _0xca9b78=a133_0x13f878[_0x709453(0x1c5)](_0x166d4a);const _0x78b14b=a133_0x13f878[_0x709453(0x1d9)](_0xca9b78)['root'];while(_0xca9b78!==_0x78b14b){const _0x416043=a133_0x13f878[_0x709453(0x1cb)](_0xca9b78,_0x709453(0x1d5));if(await _0x401f86[_0x709453(0x1aa)](_0x416043))try{const _0x3e7b71=await _0x401f86[_0x709453(0x1d3)](_0x416043),_0x19fe61=JSON[_0x709453(0x1d9)](_0x3e7b71);if(_0x19fe61['parent_segment']&&typeof _0x19fe61[_0x709453(0x1ba)]==='string')return{'configPath':_0x416043,'configDir':_0xca9b78,'parentSegment':_0x19fe61[_0x709453(0x1ba)]};}catch{}_0xca9b78=a133_0x13f878[_0x709453(0x1a8)](_0xca9b78);}return null;}function calculateScopedPath(_0x2d44ed,_0x1a6003){const _0x3fbd73=a133_0x4407,_0x133bc2=a133_0x13f878[_0x3fbd73(0x1d4)](_0x1a6003,_0x2d44ed),_0x209ecb=_0x133bc2!==''&&_0x133bc2!=='.'&&!_0x133bc2[_0x3fbd73(0x1b6)]('..');return{'isScoped':_0x209ecb,'scopedFolderPath':_0x209ecb?_0x133bc2[_0x3fbd73(0x1ae)](/\\/g,'/'):''};}export async function resolveTarget(_0x4423ab){const _0x44fb67=a133_0x4407,{arg:_0x214099,contextParent:_0x545921,cwd:cwd=process[_0x44fb67(0x1c3)](),fs:fs=nodeFileSystem}=_0x4423ab;if(_0x214099&&isYamlFilePath(_0x214099))try{const _0x14a4b8=await resolveYamlFilePath(_0x214099,fs),_0x5e7eac=a133_0x13f878['resolve'](_0x214099),_0x484a59=a133_0x13f878[_0x44fb67(0x1a8)](_0x5e7eac),_0x4b6fa0=await findTdxConfigAsync(_0x484a59,fs);if(!_0x4b6fa0){if(_0x545921){const _0x4e326e=a133_0x13f878[_0x44fb67(0x1a8)](_0x5e7eac);return{'type':_0x44fb67(0x1a6),'parentName':_0x545921,'targetDir':_0x4e326e,'configRoot':_0x4e326e,'filePath':_0x5e7eac,'resourceName':_0x14a4b8[_0x44fb67(0x1ac)],'folderPath':_0x14a4b8[_0x44fb67(0x1ad)],'resourceType':_0x14a4b8['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x44fb67(0x1af),'message':_0x44fb67(0x1a7)+_0x214099,'arg':_0x214099,'helpText':_0x44fb67(0x1d7)};}const _0x2dcf79=calculateScopedPath(_0x484a59,_0x4b6fa0[_0x44fb67(0x1c8)]);return{'type':'file','parentName':_0x4b6fa0['parentSegment'],'targetDir':_0x4b6fa0['configDir'],'configRoot':_0x4b6fa0[_0x44fb67(0x1c8)],'filePath':_0x5e7eac,'resourceName':_0x14a4b8[_0x44fb67(0x1ac)],'folderPath':_0x14a4b8['folderPath'],'resourceType':_0x14a4b8['resourceType'],'isScoped':_0x2dcf79[_0x44fb67(0x1b5)],'scopedFolderPath':_0x2dcf79[_0x44fb67(0x1b1)]};}catch(_0x544788){const _0x5755ad=_0x544788 instanceof Error?_0x544788[_0x44fb67(0x1d0)]:String(_0x544788);if(_0x5755ad['includes'](_0x44fb67(0x1be)))return{'type':_0x44fb67(0x1b7),'errorCode':_0x44fb67(0x1b8),'message':_0x44fb67(0x1b4)+_0x214099,'arg':_0x214099};if(_0x5755ad[_0x44fb67(0x1bd)]('No\x20tdx.json\x20found')){if(_0x545921){const _0x2d291c=a133_0x13f878[_0x44fb67(0x1c5)](_0x214099);if(await fs[_0x44fb67(0x1aa)](_0x2d291c)){const _0x3f5708=a133_0x13f878[_0x44fb67(0x1a8)](_0x2d291c),_0x4bca3e=await fs[_0x44fb67(0x1d3)](_0x2d291c),_0xbc93e7=_0x4bca3e['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x557bf4=_0x4bca3e[_0x44fb67(0x1d2)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x59c275=_0xbc93e7?_0xbc93e7[0x1][_0x44fb67(0x1cf)]():a133_0x13f878[_0x44fb67(0x1ab)](_0x214099,a133_0x13f878[_0x44fb67(0x1a9)](_0x214099)),_0xd2f9d9=_0x557bf4&&_0x557bf4[0x1][_0x44fb67(0x1cf)]()==='journey'?_0x44fb67(0x1c4):_0x44fb67(0x1b9);return{'type':'file','parentName':_0x545921,'targetDir':_0x3f5708,'configRoot':_0x3f5708,'filePath':_0x2d291c,'resourceName':_0x59c275,'folderPath':'','resourceType':_0xd2f9d9,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x44fb67(0x1b7),'errorCode':_0x44fb67(0x1af),'message':_0x44fb67(0x1a7)+_0x214099,'arg':_0x214099,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}return{'type':_0x44fb67(0x1b7),'errorCode':_0x44fb67(0x1d1),'message':_0x5755ad,'arg':_0x214099};}if(_0x214099){const _0x5586d1=a133_0x13f878[_0x44fb67(0x1c5)](cwd,_0x214099);let _0x24ac54=null;try{_0x24ac54=await fs['stat'](_0x5586d1);}catch{}if(_0x24ac54?.['isDirectory']()){const _0x244409=await findTdxConfigAsync(_0x5586d1,fs);if(_0x244409){const _0x1e7505=calculateScopedPath(_0x5586d1,_0x244409[_0x44fb67(0x1c8)]);return{'type':_0x44fb67(0x1c1),'parentName':_0x244409[_0x44fb67(0x1c2)],'targetDir':_0x5586d1,'configRoot':_0x244409[_0x44fb67(0x1c8)],'isScoped':_0x1e7505[_0x44fb67(0x1b5)],'scopedFolderPath':_0x1e7505['scopedFolderPath']};}if(_0x545921)return{'type':'directory','parentName':_0x545921,'targetDir':_0x5586d1,'configRoot':_0x5586d1,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x44fb67(0x1af),'message':_0x44fb67(0x1c9)+_0x214099,'arg':_0x214099,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}if(_0x24ac54?.[_0x44fb67(0x1bf)]())return{'type':_0x44fb67(0x1b7),'errorCode':_0x44fb67(0x1d1),'message':_0x44fb67(0x1a5)+_0x214099,'arg':_0x214099,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x3cab01=sanitizeFileName(_0x214099),_0x4b740d=getSegmentRootDir(_0x3cab01,cwd);return{'type':_0x44fb67(0x1cd),'parentName':_0x214099,'targetDir':_0x4b740d,'configRoot':_0x4b740d};}const _0x264d9f=await findTdxConfigAsync(cwd,fs);if(_0x264d9f){const _0x3e7a13=calculateScopedPath(cwd,_0x264d9f[_0x44fb67(0x1c8)]);return{'type':_0x44fb67(0x1cc),'parentName':_0x264d9f[_0x44fb67(0x1c2)],'targetDir':cwd,'configRoot':_0x264d9f['configDir'],'isScoped':_0x3e7a13[_0x44fb67(0x1b5)],'scopedFolderPath':_0x3e7a13['scopedFolderPath']};}if(_0x545921){const _0x178ece=sanitizeFileName(_0x545921),_0x4013b0=getSegmentRootDir(_0x178ece,cwd);return{'type':_0x44fb67(0x1cc),'parentName':_0x545921,'targetDir':_0x4013b0,'configRoot':_0x4013b0,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x44fb67(0x1b7),'errorCode':'no_parent','message':_0x44fb67(0x1c7),'helpText':_0x44fb67(0x1b3)};}
@@ -1 +1 @@
1
- const a133_0x7f1d65=a133_0x301b;(function(_0x5f5863,_0x793102){const _0x39e834=a133_0x301b,_0x5475d8=_0x5f5863();while(!![]){try{const _0x501041=-parseInt(_0x39e834(0x17f))/0x1+-parseInt(_0x39e834(0x17e))/0x2+parseInt(_0x39e834(0x181))/0x3*(parseInt(_0x39e834(0x17d))/0x4)+-parseInt(_0x39e834(0x174))/0x5+-parseInt(_0x39e834(0x16f))/0x6*(-parseInt(_0x39e834(0x173))/0x7)+parseInt(_0x39e834(0x16a))/0x8+parseInt(_0x39e834(0x169))/0x9;if(_0x501041===_0x793102)break;else _0x5475d8['push'](_0x5475d8['shift']());}catch(_0x483658){_0x5475d8['push'](_0x5475d8['shift']());}}}(a133_0x3461,0x9dfd0));import{existsSync,readFileSync}from'fs';function a133_0x301b(_0x238988,_0x14e3b3){_0x238988=_0x238988-0x166;const _0x3461fb=a133_0x3461();let _0x301b47=_0x3461fb[_0x238988];return _0x301b47;}import a133_0xde5428 from'path';const TDX_CONFIG_FILE=a133_0x7f1d65(0x176),SEGMENTS_DIR=a133_0x7f1d65(0x172);export function findTdxConfigPath(_0x594609=process[a133_0x7f1d65(0x168)]()){const _0x20bbaa=a133_0x7f1d65;let _0x42af87=a133_0xde5428['resolve'](_0x594609);const _0x46661a=a133_0xde5428[_0x20bbaa(0x180)](_0x42af87)[_0x20bbaa(0x17c)];while(_0x42af87!==_0x46661a){const _0x12641c=a133_0xde5428[_0x20bbaa(0x170)](_0x42af87,TDX_CONFIG_FILE);if(existsSync(_0x12641c))return _0x12641c;_0x42af87=a133_0xde5428[_0x20bbaa(0x16c)](_0x42af87);}return null;}export function loadTdxConfig(_0x4c5958){const _0x412e00=a133_0x7f1d65,_0x8c3187=readFileSync(_0x4c5958,_0x412e00(0x16d));let _0x38812d;try{_0x38812d=JSON[_0x412e00(0x180)](_0x8c3187);}catch{throw new Error(_0x412e00(0x167)+_0x4c5958);}if(!_0x38812d||typeof _0x38812d!=='object')throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x238e59=_0x38812d,_0x2c57c1=_0x238e59['parent_segment']&&typeof _0x238e59['parent_segment']==='string',_0x49ebfd=_0x238e59[_0x412e00(0x16e)]&&typeof _0x238e59['engage_workspace']===_0x412e00(0x178);if(!_0x2c57c1&&!_0x49ebfd)throw new Error(_0x412e00(0x17a));const _0x56b65e={};return _0x2c57c1&&(_0x56b65e['parent_segment']=_0x238e59[_0x412e00(0x16b)]),_0x49ebfd&&(_0x56b65e['engage_workspace']=_0x238e59['engage_workspace']),_0x56b65e;}export function findTdxConfig(_0x3b535f=process[a133_0x7f1d65(0x168)]()){const _0x53bc3c=a133_0x7f1d65,_0x2e3e4f=findTdxConfigPath(_0x3b535f);if(!_0x2e3e4f)throw new Error(_0x53bc3c(0x177));const _0x14a256=loadTdxConfig(_0x2e3e4f),_0xf15c3c=a133_0xde5428[_0x53bc3c(0x16c)](_0x2e3e4f);return{'config':_0x14a256,'configPath':_0x2e3e4f,'configDir':_0xf15c3c};}export function tryFindTdxConfig(_0x4d4b17){try{return findTdxConfig(_0x4d4b17);}catch{return null;}}function a133_0x3461(){const _0x5f9610=['tdx.json','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','string','relative','Invalid\x20tdx.json:\x20must\x20contain\x20\x27parent_segment\x27\x20or\x20\x27engage_workspace\x27\x20field','stringify','root','250780iitTyC','53572TeHwOi','427054hgABWA','parse','27YbIwYH','resolve','Invalid\x20JSON\x20in\x20','cwd','4264218Wpwnrf','4260400oVJDbl','parent_segment','dirname','utf-8','engage_workspace','1122714WoPNEw','join','replace','segments','7HLeTKa','3283830BfmmLt','startsWith'];a133_0x3461=function(){return _0x5f9610;};return a133_0x3461();}export function getSegmentRootDir(_0x1da001,_0x4c5bff=process['cwd']()){const _0x34f7fe=a133_0x7f1d65;return a133_0xde5428[_0x34f7fe(0x170)](_0x4c5bff,SEGMENTS_DIR,_0x1da001);}export function getTdxConfigPath(_0x560909,_0x4ab11e=process[a133_0x7f1d65(0x168)]()){const _0x5990af=a133_0x7f1d65;return a133_0xde5428[_0x5990af(0x170)](getSegmentRootDir(_0x560909,_0x4ab11e),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x3aa941,_0xde18fd){const _0x487ff5=a133_0x7f1d65,_0x217016=a133_0xde5428[_0x487ff5(0x166)](_0x3aa941),_0x284b0a=a133_0xde5428[_0x487ff5(0x179)](_0xde18fd,_0x217016);if(_0x284b0a[_0x487ff5(0x175)]('..'))return'';return _0x284b0a;}export function localPathToTdFolderPath(_0x34a637){const _0x38788a=a133_0x7f1d65,_0x53bd06=a133_0xde5428[_0x38788a(0x16c)](_0x34a637);if(_0x53bd06==='.'||_0x53bd06==='')return'';return _0x53bd06[_0x38788a(0x171)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x3d1da0,_0x4afea9){const _0x40c639=a133_0x7f1d65;if(!_0x3d1da0)return _0x4afea9;return a133_0xde5428[_0x40c639(0x170)](_0x4afea9,_0x3d1da0);}export function createTdxConfigContent(_0x1dc9e4){const _0xc36418=a133_0x7f1d65,_0x2f1d9d={'parent_segment':_0x1dc9e4};return JSON[_0xc36418(0x17b)](_0x2f1d9d,null,0x2)+'\x0a';}export function createEngageTdxConfigContent(_0x4e2517){const _0xda5088={'engage_workspace':_0x4e2517};return JSON['stringify'](_0xda5088,null,0x2)+'\x0a';}
1
+ const a134_0x2359eb=a134_0x3468;(function(_0x3c8bcb,_0x3833d7){const _0x3b987e=a134_0x3468,_0x5f2397=_0x3c8bcb();while(!![]){try{const _0x2c4ec5=-parseInt(_0x3b987e(0xfa))/0x1+parseInt(_0x3b987e(0xf8))/0x2*(-parseInt(_0x3b987e(0xfd))/0x3)+parseInt(_0x3b987e(0xef))/0x4+-parseInt(_0x3b987e(0x100))/0x5+-parseInt(_0x3b987e(0xf1))/0x6+-parseInt(_0x3b987e(0xee))/0x7+parseInt(_0x3b987e(0xfc))/0x8;if(_0x2c4ec5===_0x3833d7)break;else _0x5f2397['push'](_0x5f2397['shift']());}catch(_0x5f3d42){_0x5f2397['push'](_0x5f2397['shift']());}}}(a134_0x1074,0x6d9ac));function a134_0x3468(_0x416bc9,_0xe75634){_0x416bc9=_0x416bc9-0xed;const _0x1074f2=a134_0x1074();let _0x3468a7=_0x1074f2[_0x416bc9];return _0x3468a7;}import{existsSync,readFileSync}from'fs';import a134_0x37e76f from'path';const TDX_CONFIG_FILE=a134_0x2359eb(0xed),SEGMENTS_DIR=a134_0x2359eb(0x102);export function findTdxConfigPath(_0x3be76=process[a134_0x2359eb(0xf0)]()){const _0x29f57d=a134_0x2359eb;let _0xe2ee0c=a134_0x37e76f[_0x29f57d(0xf2)](_0x3be76);const _0x5c0aad=a134_0x37e76f['parse'](_0xe2ee0c)['root'];while(_0xe2ee0c!==_0x5c0aad){const _0x16d6a5=a134_0x37e76f[_0x29f57d(0xff)](_0xe2ee0c,TDX_CONFIG_FILE);if(existsSync(_0x16d6a5))return _0x16d6a5;_0xe2ee0c=a134_0x37e76f[_0x29f57d(0xf6)](_0xe2ee0c);}return null;}function a134_0x1074(){const _0x574e6b=['63967IdhWsg','Invalid\x20tdx.json:\x20expected\x20object','14633144OmMPrN','15CgclVF','string','join','2596970SMJBvu','replace','segments','engage_workspace','parent_segment','tdx.json','1196412BjZwaK','1149576zdczPR','cwd','3609390aOPeRj','resolve','parse','utf-8','Invalid\x20tdx.json:\x20must\x20contain\x20\x27parent_segment\x27\x20or\x20\x27engage_workspace\x27\x20field','dirname','stringify','124702VxMASJ','object'];a134_0x1074=function(){return _0x574e6b;};return a134_0x1074();}export function loadTdxConfig(_0x11417b){const _0x55ea6b=a134_0x2359eb,_0xcc5fcd=readFileSync(_0x11417b,_0x55ea6b(0xf4));let _0x4568c1;try{_0x4568c1=JSON[_0x55ea6b(0xf3)](_0xcc5fcd);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x11417b);}if(!_0x4568c1||typeof _0x4568c1!==_0x55ea6b(0xf9))throw new Error(_0x55ea6b(0xfb));const _0x47a8ed=_0x4568c1,_0x2eddb9=_0x47a8ed[_0x55ea6b(0x104)]&&typeof _0x47a8ed['parent_segment']==='string',_0x25ce97=_0x47a8ed[_0x55ea6b(0x103)]&&typeof _0x47a8ed[_0x55ea6b(0x103)]===_0x55ea6b(0xfe);if(!_0x2eddb9&&!_0x25ce97)throw new Error(_0x55ea6b(0xf5));const _0x2ff4ef={};return _0x2eddb9&&(_0x2ff4ef[_0x55ea6b(0x104)]=_0x47a8ed[_0x55ea6b(0x104)]),_0x25ce97&&(_0x2ff4ef[_0x55ea6b(0x103)]=_0x47a8ed[_0x55ea6b(0x103)]),_0x2ff4ef;}export function findTdxConfig(_0xff2e2a=process[a134_0x2359eb(0xf0)]()){const _0x24aa4a=a134_0x2359eb,_0x4cfd06=findTdxConfigPath(_0xff2e2a);if(!_0x4cfd06)throw new Error('No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x356b6b=loadTdxConfig(_0x4cfd06),_0x91da1b=a134_0x37e76f[_0x24aa4a(0xf6)](_0x4cfd06);return{'config':_0x356b6b,'configPath':_0x4cfd06,'configDir':_0x91da1b};}export function tryFindTdxConfig(_0x4bfda1){try{return findTdxConfig(_0x4bfda1);}catch{return null;}}export function getSegmentRootDir(_0x43510c,_0x4c38cb=process['cwd']()){const _0x5b4a13=a134_0x2359eb;return a134_0x37e76f[_0x5b4a13(0xff)](_0x4c38cb,SEGMENTS_DIR,_0x43510c);}export function getTdxConfigPath(_0x209ee0,_0x19a4d9=process[a134_0x2359eb(0xf0)]()){const _0x5460e5=a134_0x2359eb;return a134_0x37e76f[_0x5460e5(0xff)](getSegmentRootDir(_0x209ee0,_0x19a4d9),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x4abb99,_0x2cbbfb){const _0x730fd5=a134_0x2359eb,_0x2b4a6d=a134_0x37e76f[_0x730fd5(0xf2)](_0x4abb99),_0x5bbd19=a134_0x37e76f['relative'](_0x2cbbfb,_0x2b4a6d);if(_0x5bbd19['startsWith']('..'))return'';return _0x5bbd19;}export function localPathToTdFolderPath(_0x33b786){const _0x27875d=a134_0x2359eb,_0x2f500e=a134_0x37e76f[_0x27875d(0xf6)](_0x33b786);if(_0x2f500e==='.'||_0x2f500e==='')return'';return _0x2f500e[_0x27875d(0x101)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x496605,_0x66a077){const _0x531af0=a134_0x2359eb;if(!_0x496605)return _0x66a077;return a134_0x37e76f[_0x531af0(0xff)](_0x66a077,_0x496605);}export function createTdxConfigContent(_0x247b2d){const _0x1d74a2=a134_0x2359eb,_0x2aeb0f={'parent_segment':_0x247b2d};return JSON[_0x1d74a2(0xf7)](_0x2aeb0f,null,0x2)+'\x0a';}export function createEngageTdxConfigContent(_0x35b613){const _0x428668=a134_0x2359eb,_0x30b369={'engage_workspace':_0x35b613};return JSON[_0x428668(0xf7)](_0x30b369,null,0x2)+'\x0a';}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Segment Definition Types
3
3
  *
4
- * These types represent the portable, human-readable format for segment configurations.
5
- * They use names instead of IDs and can be serialized to/from YAML.
4
+ * Rule/condition/operator types derived from Zod schemas see segment-schema.ts.
5
+ * SegmentDef and Activation types remain here (ActivationDef is complex and out-of-scope for Zod).
6
6
  *
7
7
  * Naming convention:
8
8
  * - XXXDef = Definition types (portable, human-readable, no IDs)
@@ -10,183 +10,9 @@
10
10
  *
11
11
  * @module
12
12
  */
13
- /**
14
- * Operator type for segment conditions
15
- */
16
- export type OperatorType = 'Equal' | 'NotEqual' | 'Greater' | 'GreaterEqual' | 'Less' | 'LessEqual' | 'In' | 'NotIn' | 'Contain' | 'StartWith' | 'EndWith' | 'Regexp' | 'IsNull' | 'TimeWithinPast' | 'TimeWithinNext' | 'TimeRange' | 'TimeToday' | 'Between';
17
- /**
18
- * Time unit for temporal operators
19
- */
20
- export type TimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
21
- /**
22
- * Array matching mode for array attributes
23
- */
24
- export type ArrayMatching = 'any' | 'all' | {
25
- atLeast: number;
26
- } | {
27
- atMost: number;
28
- } | {
29
- exactly: number;
30
- };
31
- /**
32
- * Aggregation type for behavior conditions
33
- */
34
- export type AggregationType = 'Count' | 'Sum' | 'Average' | 'Min' | 'Max' | 'CountDistinct' | 'First' | 'Last';
35
- /**
36
- * Temporal value for time-based operators (e.g., Between with timestamp or relative time)
37
- */
38
- export type TemporalValue = {
39
- timestamp: string;
40
- } | {
41
- last: number | Record<string, number>;
42
- unit: string;
43
- };
44
- /**
45
- * Value type for operator - can be single or array
46
- */
47
- export type OperatorValue = string | number | boolean | TemporalValue | (string | number | boolean)[];
48
- /**
49
- * Operator definition (portable format)
50
- */
51
- export interface OperatorDef {
52
- /** Operator type */
53
- type: OperatorType;
54
- /** Negate the condition */
55
- not?: boolean;
56
- /**
57
- * Value for comparison - single value or array.
58
- * When array is provided, API uses rightValues parameter.
59
- * When single value is provided, API uses rightValue parameter.
60
- */
61
- value?: OperatorValue;
62
- /** Min/max for Between operator */
63
- min?: number | string | TemporalValue;
64
- max?: number | string | TemporalValue;
65
- /** Time unit for temporal operators */
66
- unit?: TimeUnit;
67
- /** Duration for time range operators */
68
- duration?: {
69
- day?: number;
70
- hour?: number;
71
- minute?: number;
72
- second?: number;
73
- };
74
- /** From reference for time range operators */
75
- from?: {
76
- last?: number;
77
- unit?: TimeUnit;
78
- };
79
- }
80
- /**
81
- * Aggregation definition for behavior-based conditions
82
- */
83
- export interface AggregationDef {
84
- type: AggregationType;
85
- column?: string;
86
- groupingColumns?: string[];
87
- }
88
- /**
89
- * Value condition definition (leaf condition)
90
- */
91
- export interface ValueConditionDef {
92
- type: 'Value';
93
- /** Attribute name to filter on */
94
- attribute: string;
95
- /** Operator configuration */
96
- operator: OperatorDef;
97
- /** Array matching mode (for array attributes) */
98
- arrayMatching?: ArrayMatching;
99
- /** Exclude matching records (negate the condition) */
100
- exclude?: boolean;
101
- /** Optional aggregation for behavior-based conditions */
102
- aggregation?: AggregationDef;
103
- /** Optional source table for behavior-based conditions */
104
- source?: string;
105
- /** Optional nested filter for aggregation conditions */
106
- filter?: RuleDef;
107
- /** Limit for aggregation results */
108
- limit?: number;
109
- }
110
- /**
111
- * Time window for behavior conditions
112
- */
113
- export interface TimeWindowDef {
114
- /** Duration value */
115
- duration: number;
116
- /** Time unit */
117
- unit: TimeUnit;
118
- }
119
- /**
120
- * Behavior condition definition - for filtering based on user actions/events
121
- *
122
- * Similar to ValueConditionDef but with behavior-specific semantics:
123
- * - `attribute` refers to the behavior/event name (e.g., "page_view", "purchase")
124
- * - `source` is the behavior table (e.g., "behavior_behv_website")
125
- * - `aggregation` defines how to aggregate behavior data (Count, Sum, etc.)
126
- * - `timeWindow` constrains the time period for behavior matching
127
- *
128
- * Note: When `aggregation` is present, `attribute` may be empty (counting all events).
129
- */
130
- export interface BehaviorConditionDef {
131
- type: 'Behavior';
132
- /** Behavior/event name to filter on (may be empty when using aggregation) */
133
- attribute: string;
134
- /** Operator configuration */
135
- operator: OperatorDef;
136
- /** Array matching mode */
137
- arrayMatching?: ArrayMatching;
138
- /** Exclude matching records */
139
- exclude?: boolean;
140
- /** Aggregation configuration (e.g., Count, Sum) */
141
- aggregation?: AggregationDef;
142
- /** Source behavior table */
143
- source?: string;
144
- /** Nested filter for aggregation conditions */
145
- filter?: RuleDef;
146
- /** Time window for behavior matching */
147
- timeWindow?: TimeWindowDef;
148
- /** Limit for aggregation results */
149
- limit?: number;
150
- }
151
- /**
152
- * Column condition definition - used inside behavior filter.conditions
153
- * to filter on columns of the behavior table (e.g., timestamp filtering).
154
- */
155
- export interface ColumnConditionDef {
156
- type: 'Column';
157
- column: string;
158
- operator: OperatorDef;
159
- }
160
- /**
161
- * Composite condition definition (And/Or)
162
- */
163
- export interface CompositeConditionDef {
164
- type: 'And' | 'Or';
165
- conditions: ConditionDef[];
166
- description?: string;
167
- }
168
- /**
169
- * Segment reference condition definition - includes/excludes members of another segment
170
- * Uses segment name (not ID) for portability
171
- */
172
- export interface SegmentRefConditionDef {
173
- /** Type: 'include' to include segment members, 'exclude' to exclude them */
174
- type: 'include' | 'exclude';
175
- /** Segment name or path (e.g., "california_high_engagement" or "folder/segment_name") */
176
- segment: string;
177
- }
178
- /**
179
- * Any condition type (union)
180
- */
181
- export type ConditionDef = ValueConditionDef | BehaviorConditionDef | ColumnConditionDef | CompositeConditionDef | SegmentRefConditionDef;
182
- /**
183
- * Segment rule definition (top-level condition)
184
- */
185
- export interface RuleDef {
186
- type: 'And' | 'Or';
187
- conditions: ConditionDef[];
188
- description?: string;
189
- }
13
+ import type { RuleDef } from './segment-schema.js';
14
+ export type { OperatorType, TimeUnit, AggregationType, ArrayMatching, TemporalValue, OperatorValue, OperatorDef, AggregationDef, TimeWindowDef, FilterColumnConditionDef, FilterRuleDef, ValueConditionDef, BehaviorConditionDef, ColumnConditionDef, CompositeConditionDef, SegmentRefConditionDef, ConditionDef, RuleDef, } from './segment-schema.js';
15
+ export { OperatorTypeSchema, TimeUnitSchema, AggregationTypeSchema, ArrayMatchingSchema, OperatorDefSchema, AggregationDefSchema, TimeWindowDefSchema, FilterColumnConditionDefSchema, FilterRuleDefSchema, ValueConditionDefSchema, BehaviorConditionDefSchema, ColumnConditionDefSchema, CompositeConditionDefSchema, SegmentRefConditionDefSchema, ConditionDefSchema, RuleDefSchema, SegmentDefSchema, } from './segment-schema.js';
190
16
  /**
191
17
  * Activation schedule type
192
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"segment-def.d.ts","sourceRoot":"","sources":["../../../../src/sdk/segment/types/segment-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,UAAU,GACV,SAAS,GACT,cAAc,GACd,MAAM,GACN,WAAW,GACX,IAAI,GACJ,OAAO,GACP,SAAS,GACT,WAAW,GACX,SAAS,GACT,QA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,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,kDAAkD;IAClD,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B"}
1
+ {"version":3,"file":"segment-def.d.ts","sourceRoot":"","sources":["../../../../src/sdk/segment/types/segment-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,OAAO,GACR,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,8BAA8B,EAC9B,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,aAAa,EACb,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAM7B;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAExF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,oBAAoB;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,kBAAkB;IAClB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,4CAA4C;IAC5C,gBAAg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,EAAE,OAAO,CAAC;IACtB,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,mBAAmB,CAAC,EAAE,CAAC;IAC3C,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,6BAA6B;IAC7B,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,kCAAkC;IAClC,QAAQ,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACxC,uFAAuF;IACvF,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAMD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IAEb,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,qDAAqD;IACrD,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,kDAAkD;IAClD,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B"}
@@ -1 +1 @@
1
- export{};
1
+ function a137_0x29a1(_0x185635,_0x2ced37){_0x185635=_0x185635-0x1a7;var _0x32d949=a137_0x32d9();var _0x29a1ab=_0x32d949[_0x185635];return _0x29a1ab;}(function(_0x45198c,_0x55bf3d){var _0x192d94=a137_0x29a1,_0x991d37=_0x45198c();while(!![]){try{var _0x2053e3=parseInt(_0x192d94(0x1a8))/0x1+parseInt(_0x192d94(0x1a7))/0x2*(parseInt(_0x192d94(0x1b1))/0x3)+-parseInt(_0x192d94(0x1b3))/0x4*(parseInt(_0x192d94(0x1ad))/0x5)+-parseInt(_0x192d94(0x1aa))/0x6*(parseInt(_0x192d94(0x1ac))/0x7)+parseInt(_0x192d94(0x1af))/0x8*(parseInt(_0x192d94(0x1ab))/0x9)+-parseInt(_0x192d94(0x1a9))/0xa*(-parseInt(_0x192d94(0x1b0))/0xb)+parseInt(_0x192d94(0x1b2))/0xc*(-parseInt(_0x192d94(0x1ae))/0xd);if(_0x2053e3===_0x55bf3d)break;else _0x991d37['push'](_0x991d37['shift']());}catch(_0x1ab84e){_0x991d37['push'](_0x991d37['shift']());}}}(a137_0x32d9,0xb2b4a));function a137_0x32d9(){var _0x5e7609=['849871oruxfy','3UUurLS','12GFSLIK','129548vYBkwH','1355858pYCTUX','1087408eAsLCw','170emuULo','246KtUUmF','261162xBgXTV','165641ImRqxj','220FwYHOB','502307VnHkku','24ZxLmrX'];a137_0x32d9=function(){return _0x5e7609;};return a137_0x32d9();}export{OperatorTypeSchema,TimeUnitSchema,AggregationTypeSchema,ArrayMatchingSchema,OperatorDefSchema,AggregationDefSchema,TimeWindowDefSchema,FilterColumnConditionDefSchema,FilterRuleDefSchema,ValueConditionDefSchema,BehaviorConditionDefSchema,ColumnConditionDefSchema,CompositeConditionDefSchema,SegmentRefConditionDefSchema,ConditionDefSchema,RuleDefSchema,SegmentDefSchema}from'./segment-schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"segment-def.js","sourceRoot":"","sources":["../../../../src/sdk/segment/types/segment-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
1
+ {"version":3,"file":"segment-def.js","sourceRoot":"","sources":["../../../../src/sdk/segment/types/segment-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA8BH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,8BAA8B,EAC9B,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,aAAa,EACb,gBAAgB,GACjB,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,259 @@
1
+ /**
2
+ * Segment YAML definition Zod schemas
3
+ *
4
+ * Single source of truth for segment rule validation and TypeScript types.
5
+ * Non-recursive types are derived via z.infer<> — recursive types use
6
+ * manual interfaces due to circular references with z.lazy().
7
+ *
8
+ * Uses z.object() which strips unknown fields by default.
9
+ *
10
+ * @module
11
+ */
12
+ import { z } from 'zod';
13
+ export declare const OperatorTypeSchema: z.ZodEnum<{
14
+ Equal: "Equal";
15
+ Greater: "Greater";
16
+ Less: "Less";
17
+ GreaterEqual: "GreaterEqual";
18
+ LessEqual: "LessEqual";
19
+ In: "In";
20
+ Between: "Between";
21
+ Regexp: "Regexp";
22
+ IsNull: "IsNull";
23
+ TimeWithinPast: "TimeWithinPast";
24
+ TimeWithinNext: "TimeWithinNext";
25
+ Contain: "Contain";
26
+ StartWith: "StartWith";
27
+ EndWith: "EndWith";
28
+ TimeRange: "TimeRange";
29
+ }>;
30
+ export declare const TimeUnitSchema: z.ZodEnum<{
31
+ minute: "minute";
32
+ hour: "hour";
33
+ day: "day";
34
+ week: "week";
35
+ month: "month";
36
+ second: "second";
37
+ year: "year";
38
+ }>;
39
+ export declare const AggregationTypeSchema: z.ZodEnum<{
40
+ First: "First";
41
+ Last: "Last";
42
+ Count: "Count";
43
+ Sum: "Sum";
44
+ Average: "Average";
45
+ Min: "Min";
46
+ Max: "Max";
47
+ CountDistinct: "CountDistinct";
48
+ }>;
49
+ declare const TemporalValueSchema: z.ZodUnion<readonly [z.ZodObject<{
50
+ timestamp: z.ZodString;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ last: z.ZodUnion<readonly [z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>;
53
+ unit: z.ZodString;
54
+ }, z.core.$strip>]>;
55
+ declare const OperatorValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
56
+ timestamp: z.ZodString;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ last: z.ZodUnion<readonly [z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>;
59
+ unit: z.ZodString;
60
+ }, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>;
61
+ export declare const OperatorDefSchema: z.ZodObject<{
62
+ type: z.ZodEnum<{
63
+ Equal: "Equal";
64
+ Greater: "Greater";
65
+ Less: "Less";
66
+ GreaterEqual: "GreaterEqual";
67
+ LessEqual: "LessEqual";
68
+ In: "In";
69
+ Between: "Between";
70
+ Regexp: "Regexp";
71
+ IsNull: "IsNull";
72
+ TimeWithinPast: "TimeWithinPast";
73
+ TimeWithinNext: "TimeWithinNext";
74
+ Contain: "Contain";
75
+ StartWith: "StartWith";
76
+ EndWith: "EndWith";
77
+ TimeRange: "TimeRange";
78
+ }>;
79
+ not: z.ZodOptional<z.ZodBoolean>;
80
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
81
+ timestamp: z.ZodString;
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ last: z.ZodUnion<readonly [z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>;
84
+ unit: z.ZodString;
85
+ }, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>;
86
+ min: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
87
+ timestamp: z.ZodString;
88
+ }, z.core.$strip>, z.ZodObject<{
89
+ last: z.ZodUnion<readonly [z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>;
90
+ unit: z.ZodString;
91
+ }, z.core.$strip>]>]>>;
92
+ max: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
93
+ timestamp: z.ZodString;
94
+ }, z.core.$strip>, z.ZodObject<{
95
+ last: z.ZodUnion<readonly [z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>;
96
+ unit: z.ZodString;
97
+ }, z.core.$strip>]>]>>;
98
+ unit: z.ZodOptional<z.ZodEnum<{
99
+ minute: "minute";
100
+ hour: "hour";
101
+ day: "day";
102
+ week: "week";
103
+ month: "month";
104
+ second: "second";
105
+ year: "year";
106
+ }>>;
107
+ duration: z.ZodOptional<z.ZodObject<{
108
+ day: z.ZodOptional<z.ZodNumber>;
109
+ week: z.ZodOptional<z.ZodNumber>;
110
+ month: z.ZodOptional<z.ZodNumber>;
111
+ year: z.ZodOptional<z.ZodNumber>;
112
+ hour: z.ZodOptional<z.ZodNumber>;
113
+ minute: z.ZodOptional<z.ZodNumber>;
114
+ second: z.ZodOptional<z.ZodNumber>;
115
+ }, z.core.$strip>>;
116
+ from: z.ZodOptional<z.ZodObject<{
117
+ last: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
118
+ unit: z.ZodEnum<{
119
+ minute: "minute";
120
+ hour: "hour";
121
+ day: "day";
122
+ week: "week";
123
+ month: "month";
124
+ second: "second";
125
+ year: "year";
126
+ }>;
127
+ }, z.core.$strip>>;
128
+ reverse: z.ZodOptional<z.ZodBoolean>;
129
+ }, z.core.$strip>;
130
+ export declare const ArrayMatchingSchema: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodLiteral<"all">, z.ZodObject<{
131
+ atLeast: z.ZodNumber;
132
+ }, z.core.$strip>, z.ZodObject<{
133
+ atMost: z.ZodNumber;
134
+ }, z.core.$strip>, z.ZodObject<{
135
+ exactly: z.ZodNumber;
136
+ }, z.core.$strip>]>;
137
+ export declare const AggregationDefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
138
+ type: z.ZodEnum<{
139
+ Sum: "Sum";
140
+ Average: "Average";
141
+ Min: "Min";
142
+ Max: "Max";
143
+ }>;
144
+ column: z.ZodString;
145
+ groupingColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
146
+ }, z.core.$strip>, z.ZodObject<{
147
+ type: z.ZodLiteral<"Count">;
148
+ groupingColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
149
+ }, z.core.$strip>, z.ZodObject<{
150
+ type: z.ZodLiteral<"CountDistinct">;
151
+ columns: z.ZodArray<z.ZodString>;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ type: z.ZodEnum<{
154
+ First: "First";
155
+ Last: "Last";
156
+ }>;
157
+ column: z.ZodString;
158
+ orderColumn: z.ZodString;
159
+ groupingColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
160
+ }, z.core.$strip>], "type">;
161
+ export declare const TimeWindowDefSchema: z.ZodObject<{
162
+ duration: z.ZodNumber;
163
+ unit: z.ZodEnum<{
164
+ minute: "minute";
165
+ hour: "hour";
166
+ day: "day";
167
+ week: "week";
168
+ month: "month";
169
+ second: "second";
170
+ year: "year";
171
+ }>;
172
+ }, z.core.$strip>;
173
+ export type OperatorType = z.infer<typeof OperatorTypeSchema>;
174
+ export type TimeUnit = z.infer<typeof TimeUnitSchema>;
175
+ export type AggregationType = z.infer<typeof AggregationTypeSchema>;
176
+ export type ArrayMatching = z.infer<typeof ArrayMatchingSchema>;
177
+ export type TemporalValue = z.infer<typeof TemporalValueSchema>;
178
+ export type OperatorValue = z.infer<typeof OperatorValueSchema>;
179
+ export type OperatorDef = z.infer<typeof OperatorDefSchema>;
180
+ export type AggregationDef = z.infer<typeof AggregationDefSchema>;
181
+ export type TimeWindowDef = z.infer<typeof TimeWindowDefSchema>;
182
+ export interface FilterColumnConditionDef {
183
+ type: 'Column';
184
+ column: string;
185
+ operator: OperatorDef;
186
+ arrayMatching?: ArrayMatching;
187
+ }
188
+ export interface FilterRuleDef {
189
+ type: 'And';
190
+ conditions: FilterColumnConditionDef[];
191
+ }
192
+ export declare const FilterColumnConditionDefSchema: z.ZodType<FilterColumnConditionDef>;
193
+ export declare const FilterRuleDefSchema: z.ZodType<FilterRuleDef>;
194
+ export interface ValueConditionDef {
195
+ type: 'Value';
196
+ attribute: string;
197
+ operator: OperatorDef;
198
+ arrayMatching?: ArrayMatching;
199
+ exclude?: boolean;
200
+ aggregation?: AggregationDef;
201
+ source?: string;
202
+ filter?: FilterRuleDef;
203
+ limit?: number;
204
+ }
205
+ export interface BehaviorConditionDef {
206
+ type: 'Behavior';
207
+ attribute: string;
208
+ operator: OperatorDef;
209
+ arrayMatching?: ArrayMatching;
210
+ exclude?: boolean;
211
+ aggregation?: AggregationDef;
212
+ source?: string;
213
+ filter?: FilterRuleDef;
214
+ timeWindow?: TimeWindowDef;
215
+ limit?: number;
216
+ }
217
+ export interface ColumnConditionDef {
218
+ type: 'Column';
219
+ column: string;
220
+ operator: OperatorDef;
221
+ }
222
+ export interface CompositeConditionDef {
223
+ type: 'And' | 'Or';
224
+ conditions: ConditionDef[];
225
+ description?: string;
226
+ }
227
+ export interface SegmentRefConditionDef {
228
+ type: 'include' | 'exclude';
229
+ segment: string;
230
+ }
231
+ export type ConditionDef = ValueConditionDef | BehaviorConditionDef | ColumnConditionDef | CompositeConditionDef | SegmentRefConditionDef;
232
+ export interface RuleDef {
233
+ type: 'And' | 'Or';
234
+ conditions: ConditionDef[];
235
+ description?: string;
236
+ }
237
+ export declare const ValueConditionDefSchema: z.ZodType<ValueConditionDef>;
238
+ export declare const BehaviorConditionDefSchema: z.ZodType<BehaviorConditionDef>;
239
+ export declare const ColumnConditionDefSchema: z.ZodType<ColumnConditionDef>;
240
+ export declare const CompositeConditionDefSchema: z.ZodType<CompositeConditionDef>;
241
+ export declare const SegmentRefConditionDefSchema: z.ZodType<SegmentRefConditionDef>;
242
+ export declare const ConditionDefSchema: z.ZodType<ConditionDef>;
243
+ export declare const RuleDefSchema: z.ZodType<RuleDef>;
244
+ export declare const SegmentDefSchema: z.ZodObject<{
245
+ type: z.ZodOptional<z.ZodLiteral<"segment">>;
246
+ name: z.ZodString;
247
+ description: z.ZodOptional<z.ZodString>;
248
+ folder: z.ZodOptional<z.ZodString>;
249
+ rule: z.ZodOptional<z.ZodType<RuleDef, unknown, z.core.$ZodTypeInternals<RuleDef, unknown>>>;
250
+ kind: z.ZodOptional<z.ZodEnum<{
251
+ batch: "batch";
252
+ realtime: "realtime";
253
+ funnel_stage: "funnel_stage";
254
+ }>>;
255
+ visible: z.ZodOptional<z.ZodBoolean>;
256
+ activations: z.ZodOptional<z.ZodArray<z.ZodAny>>;
257
+ }, z.core.$strip>;
258
+ export {};
259
+ //# sourceMappingURL=segment-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment-schema.d.ts","sourceRoot":"","sources":["../../../../src/sdk/segment/types/segment-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;EAgB7B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;EAQzB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;EAShC,CAAC;AAMH,QAAA,MAAM,mBAAmB;;;;;mBAGvB,CAAC;AAEH,QAAA,MAAM,mBAAmB;;;;;gGAMvB,CAAC;AAuBH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsE1B,CAAC;AAML,eAAO,MAAM,mBAAmB;;;;;;mBAM9B,CAAC;AAMH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;2BAwB/B,CAAC;AAE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EAAE,YAAY,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAYhE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAatE,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAIjE,CAAC;AAEH,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAMxE,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAGzE,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAQtD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAM5C,CAAC;AAMF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;iBAS3B,CAAC"}
@@ -0,0 +1 @@
1
+ const a138_0x1a0b8b=a138_0x2d85;(function(_0x300cfc,_0x57a440){const _0x15be2d=a138_0x2d85,_0x4b77ea=_0x300cfc();while(!![]){try{const _0x2d4c1a=-parseInt(_0x15be2d(0x129))/0x1+parseInt(_0x15be2d(0x10c))/0x2*(parseInt(_0x15be2d(0x120))/0x3)+-parseInt(_0x15be2d(0x132))/0x4*(parseInt(_0x15be2d(0x142))/0x5)+parseInt(_0x15be2d(0x14b))/0x6*(parseInt(_0x15be2d(0x109))/0x7)+parseInt(_0x15be2d(0x11f))/0x8+parseInt(_0x15be2d(0x139))/0x9+parseInt(_0x15be2d(0x134))/0xa;if(_0x2d4c1a===_0x57a440)break;else _0x4b77ea['push'](_0x4b77ea['shift']());}catch(_0x495414){_0x4b77ea['push'](_0x4b77ea['shift']());}}}(a138_0x8804,0x86382));import{z}from'zod';export const OperatorTypeSchema=z[a138_0x1a0b8b(0x136)](['Equal',a138_0x1a0b8b(0x128),a138_0x1a0b8b(0x105),'GreaterEqual',a138_0x1a0b8b(0x143),'In',a138_0x1a0b8b(0x113),a138_0x1a0b8b(0x10a),'IsNull','TimeWithinPast',a138_0x1a0b8b(0x14f),'Contain',a138_0x1a0b8b(0x106),a138_0x1a0b8b(0x124),'TimeRange']);export const TimeUnitSchema=z[a138_0x1a0b8b(0x136)]([a138_0x1a0b8b(0x14c),'minute',a138_0x1a0b8b(0x103),a138_0x1a0b8b(0x12f),a138_0x1a0b8b(0x127),a138_0x1a0b8b(0x135),a138_0x1a0b8b(0x144)]);function a138_0x2d85(_0x597a90,_0x491697){_0x597a90=_0x597a90-0x102;const _0x8804f8=a138_0x8804();let _0x2d8552=_0x8804f8[_0x597a90];return _0x2d8552;}function a138_0x8804(){const _0x56ccef=['Column','TimeWithinNext','has','\x27\x20requires\x20a\x20time\x20unit','TimeWithinPast','Max','hour','duration','Less','StartWith','column','from','385zQxfTf','Regexp','include','184UpWuDh','Segment\x20reference\x20must\x20not\x20be\x20empty','TimeRange\x20operator\x20requires\x20\x27duration\x27','object','string','Behavior','funnel_stage','Between','Count','First','Min','value','unit','operator','TimeRange','type','lazy','optional','discriminatedUnion','3121472MQsrGx','20547eCJnjv','Value','\x27\x20is\x20only\x20valid\x20for\x20the\x20\x27timestamp\x27\x20column','all','EndWith','\x27\x20requires\x20a\x20value','superRefine','week','Greater','697956bVOdzt','TimeRange\x20operator\x20requires\x20\x27from\x27','any','min','boolean','CountDistinct','day','MISSING_TIME_UNIT','And','64732BArssP','Equal','1159200btiKFh','month','enum','addIssue','max','3343491DkEYGi','literal','number','custom','realtime','Average','GreaterEqual','Timestamp\x20column\x20only\x20supports\x20TimeWithinPast,\x20TimeWithinNext,\x20or\x20TimeRange\x20operators\x20(got\x20\x27','Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','130EfuLub','LessEqual','year','union','batch','Operator\x20\x27','Sum','array','timestamp','17538qrJorn','second','Segment\x20name\x20is\x20required'];a138_0x8804=function(){return _0x56ccef;};return a138_0x8804();}export const AggregationTypeSchema=z[a138_0x1a0b8b(0x136)]([a138_0x1a0b8b(0x114),a138_0x1a0b8b(0x148),a138_0x1a0b8b(0x13e),a138_0x1a0b8b(0x116),'Max',a138_0x1a0b8b(0x12e),a138_0x1a0b8b(0x115),'Last']);const TemporalValueSchema=z[a138_0x1a0b8b(0x145)]([z[a138_0x1a0b8b(0x10f)]({'timestamp':z['string']()}),z[a138_0x1a0b8b(0x10f)]({'last':z['union']([z[a138_0x1a0b8b(0x13b)](),z['record'](z[a138_0x1a0b8b(0x110)](),z[a138_0x1a0b8b(0x13b)]())]),'unit':z[a138_0x1a0b8b(0x110)]()})]),OperatorValueSchema=z[a138_0x1a0b8b(0x145)]([z[a138_0x1a0b8b(0x110)](),z['number'](),z[a138_0x1a0b8b(0x12d)](),TemporalValueSchema,z[a138_0x1a0b8b(0x149)](z[a138_0x1a0b8b(0x145)]([z[a138_0x1a0b8b(0x110)](),z['number'](),z[a138_0x1a0b8b(0x12d)]()]))]),OPERATORS_REQUIRING_VALUE=new Set([a138_0x1a0b8b(0x133),a138_0x1a0b8b(0x128),a138_0x1a0b8b(0x13f),a138_0x1a0b8b(0x105),a138_0x1a0b8b(0x143),'In','Contain',a138_0x1a0b8b(0x106),a138_0x1a0b8b(0x124),'Regexp',a138_0x1a0b8b(0x152),'TimeWithinNext']),OPERATORS_REQUIRING_UNIT=new Set([a138_0x1a0b8b(0x152),a138_0x1a0b8b(0x14f)]);export const OperatorDefSchema=z[a138_0x1a0b8b(0x10f)]({'type':OperatorTypeSchema,'not':z[a138_0x1a0b8b(0x12d)]()[a138_0x1a0b8b(0x11d)](),'value':OperatorValueSchema[a138_0x1a0b8b(0x11d)](),'min':z['union']([z[a138_0x1a0b8b(0x13b)](),z[a138_0x1a0b8b(0x110)](),TemporalValueSchema])['optional'](),'max':z[a138_0x1a0b8b(0x145)]([z[a138_0x1a0b8b(0x13b)](),z[a138_0x1a0b8b(0x110)](),TemporalValueSchema])['optional'](),'unit':TimeUnitSchema[a138_0x1a0b8b(0x11d)](),'duration':z[a138_0x1a0b8b(0x10f)]({'day':z[a138_0x1a0b8b(0x13b)]()[a138_0x1a0b8b(0x11d)](),'week':z['number']()[a138_0x1a0b8b(0x11d)](),'month':z[a138_0x1a0b8b(0x13b)]()[a138_0x1a0b8b(0x11d)](),'year':z[a138_0x1a0b8b(0x13b)]()[a138_0x1a0b8b(0x11d)](),'hour':z[a138_0x1a0b8b(0x13b)]()['optional'](),'minute':z[a138_0x1a0b8b(0x13b)]()[a138_0x1a0b8b(0x11d)](),'second':z[a138_0x1a0b8b(0x13b)]()[a138_0x1a0b8b(0x11d)]()})[a138_0x1a0b8b(0x11d)](),'from':z['object']({'last':z['union']([z[a138_0x1a0b8b(0x13b)](),z[a138_0x1a0b8b(0x110)]()]),'unit':TimeUnitSchema})[a138_0x1a0b8b(0x11d)](),'reverse':z['boolean']()[a138_0x1a0b8b(0x11d)]()})[a138_0x1a0b8b(0x126)]((_0x44b58d,_0x20332f)=>{const _0x545fbb=a138_0x1a0b8b;OPERATORS_REQUIRING_VALUE[_0x545fbb(0x150)](_0x44b58d[_0x545fbb(0x11b)])&&(_0x44b58d[_0x545fbb(0x117)]===undefined||_0x44b58d['value']===null)&&_0x20332f[_0x545fbb(0x137)]({'code':'custom','message':_0x545fbb(0x147)+_0x44b58d[_0x545fbb(0x11b)]+_0x545fbb(0x125),'path':[_0x545fbb(0x117)]}),_0x44b58d[_0x545fbb(0x11b)]==='Between'&&_0x44b58d['min']===undefined&&_0x44b58d[_0x545fbb(0x138)]===undefined&&_0x20332f[_0x545fbb(0x137)]({'code':_0x545fbb(0x13c),'message':_0x545fbb(0x141),'params':{'validationCode':'MISSING_BETWEEN_BOUNDS'}}),OPERATORS_REQUIRING_UNIT[_0x545fbb(0x150)](_0x44b58d[_0x545fbb(0x11b)])&&_0x44b58d[_0x545fbb(0x117)]!==undefined&&!_0x44b58d['unit']&&_0x20332f[_0x545fbb(0x137)]({'code':_0x545fbb(0x13c),'message':'Operator\x20\x27'+_0x44b58d['type']+_0x545fbb(0x151),'path':[_0x545fbb(0x118)],'params':{'validationCode':_0x545fbb(0x130)}}),_0x44b58d[_0x545fbb(0x11b)]===_0x545fbb(0x11a)&&(!_0x44b58d[_0x545fbb(0x104)]&&_0x20332f['addIssue']({'code':'custom','message':_0x545fbb(0x10e),'path':[_0x545fbb(0x104)]}),!_0x44b58d[_0x545fbb(0x108)]&&_0x20332f[_0x545fbb(0x137)]({'code':_0x545fbb(0x13c),'message':_0x545fbb(0x12a),'path':[_0x545fbb(0x108)]}));});export const ArrayMatchingSchema=z[a138_0x1a0b8b(0x145)]([z[a138_0x1a0b8b(0x13a)](a138_0x1a0b8b(0x12b)),z['literal'](a138_0x1a0b8b(0x123)),z[a138_0x1a0b8b(0x10f)]({'atLeast':z[a138_0x1a0b8b(0x13b)]()}),z[a138_0x1a0b8b(0x10f)]({'atMost':z[a138_0x1a0b8b(0x13b)]()}),z[a138_0x1a0b8b(0x10f)]({'exactly':z[a138_0x1a0b8b(0x13b)]()})]);export const AggregationDefSchema=z[a138_0x1a0b8b(0x11e)](a138_0x1a0b8b(0x11b),[z[a138_0x1a0b8b(0x10f)]({'type':z[a138_0x1a0b8b(0x136)]([a138_0x1a0b8b(0x148),a138_0x1a0b8b(0x116),a138_0x1a0b8b(0x102),a138_0x1a0b8b(0x13e)]),'column':z[a138_0x1a0b8b(0x110)](),'groupingColumns':z[a138_0x1a0b8b(0x149)](z[a138_0x1a0b8b(0x110)]())[a138_0x1a0b8b(0x11d)]()}),z[a138_0x1a0b8b(0x10f)]({'type':z[a138_0x1a0b8b(0x13a)](a138_0x1a0b8b(0x114)),'groupingColumns':z['array'](z[a138_0x1a0b8b(0x110)]())[a138_0x1a0b8b(0x11d)]()}),z[a138_0x1a0b8b(0x10f)]({'type':z[a138_0x1a0b8b(0x13a)](a138_0x1a0b8b(0x12e)),'columns':z[a138_0x1a0b8b(0x149)](z['string']())}),z['object']({'type':z[a138_0x1a0b8b(0x136)]([a138_0x1a0b8b(0x115),'Last']),'column':z[a138_0x1a0b8b(0x110)](),'orderColumn':z[a138_0x1a0b8b(0x110)](),'groupingColumns':z[a138_0x1a0b8b(0x149)](z['string']())[a138_0x1a0b8b(0x11d)]()})]);export const TimeWindowDefSchema=z['object']({'duration':z[a138_0x1a0b8b(0x13b)](),'unit':TimeUnitSchema});const TIMESTAMP_OPERATORS=new Set([a138_0x1a0b8b(0x152),a138_0x1a0b8b(0x14f),'TimeRange']);export const FilterColumnConditionDefSchema=z[a138_0x1a0b8b(0x10f)]({'type':z[a138_0x1a0b8b(0x13a)](a138_0x1a0b8b(0x14e)),'column':z[a138_0x1a0b8b(0x110)](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema['optional']()})['superRefine']((_0x5173ff,_0x1f0e06)=>{const _0x480c87=a138_0x1a0b8b,_0x1b2980=_0x5173ff['operator'][_0x480c87(0x11b)];_0x5173ff[_0x480c87(0x107)]===_0x480c87(0x14a)?!TIMESTAMP_OPERATORS[_0x480c87(0x150)](_0x1b2980)&&_0x1f0e06['addIssue']({'code':'custom','message':_0x480c87(0x140)+_0x1b2980+'\x27)','path':[_0x480c87(0x119),_0x480c87(0x11b)]}):TIMESTAMP_OPERATORS[_0x480c87(0x150)](_0x1b2980)&&_0x1f0e06[_0x480c87(0x137)]({'code':_0x480c87(0x13c),'message':_0x480c87(0x147)+_0x1b2980+_0x480c87(0x122),'path':['operator','type']});});export const FilterRuleDefSchema=z['object']({'type':z[a138_0x1a0b8b(0x13a)](a138_0x1a0b8b(0x131)),'conditions':z[a138_0x1a0b8b(0x149)](FilterColumnConditionDefSchema)});export const ValueConditionDefSchema=z['lazy'](()=>z['object']({'type':z[a138_0x1a0b8b(0x13a)](a138_0x1a0b8b(0x121)),'attribute':z[a138_0x1a0b8b(0x110)](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema[a138_0x1a0b8b(0x11d)](),'exclude':z[a138_0x1a0b8b(0x12d)]()[a138_0x1a0b8b(0x11d)](),'aggregation':AggregationDefSchema['optional'](),'source':z[a138_0x1a0b8b(0x110)]()['optional'](),'filter':FilterRuleDefSchema['optional'](),'limit':z[a138_0x1a0b8b(0x13b)]()[a138_0x1a0b8b(0x11d)]()}));export const BehaviorConditionDefSchema=z[a138_0x1a0b8b(0x11c)](()=>z[a138_0x1a0b8b(0x10f)]({'type':z[a138_0x1a0b8b(0x13a)](a138_0x1a0b8b(0x111)),'attribute':z[a138_0x1a0b8b(0x110)](),'operator':OperatorDefSchema,'arrayMatching':ArrayMatchingSchema[a138_0x1a0b8b(0x11d)](),'exclude':z[a138_0x1a0b8b(0x12d)]()[a138_0x1a0b8b(0x11d)](),'aggregation':AggregationDefSchema[a138_0x1a0b8b(0x11d)](),'source':z[a138_0x1a0b8b(0x110)]()[a138_0x1a0b8b(0x11d)](),'filter':FilterRuleDefSchema['optional'](),'timeWindow':TimeWindowDefSchema['optional'](),'limit':z[a138_0x1a0b8b(0x13b)]()[a138_0x1a0b8b(0x11d)]()}));export const ColumnConditionDefSchema=z[a138_0x1a0b8b(0x10f)]({'type':z[a138_0x1a0b8b(0x13a)]('Column'),'column':z[a138_0x1a0b8b(0x110)](),'operator':OperatorDefSchema});export const CompositeConditionDefSchema=z['lazy'](()=>z['object']({'type':z['enum']([a138_0x1a0b8b(0x131),'Or']),'conditions':z[a138_0x1a0b8b(0x149)](ConditionDefSchema),'description':z[a138_0x1a0b8b(0x110)]()[a138_0x1a0b8b(0x11d)]()}));export const SegmentRefConditionDefSchema=z[a138_0x1a0b8b(0x10f)]({'type':z['enum']([a138_0x1a0b8b(0x10b),'exclude']),'segment':z[a138_0x1a0b8b(0x110)]()[a138_0x1a0b8b(0x12c)](0x1,a138_0x1a0b8b(0x10d))});export const ConditionDefSchema=z['lazy'](()=>z[a138_0x1a0b8b(0x145)]([ValueConditionDefSchema,BehaviorConditionDefSchema,ColumnConditionDefSchema,CompositeConditionDefSchema,SegmentRefConditionDefSchema]));export const RuleDefSchema=z[a138_0x1a0b8b(0x11c)](()=>z[a138_0x1a0b8b(0x10f)]({'type':z[a138_0x1a0b8b(0x136)](['And','Or']),'conditions':z[a138_0x1a0b8b(0x149)](ConditionDefSchema),'description':z[a138_0x1a0b8b(0x110)]()[a138_0x1a0b8b(0x11d)]()}));export const SegmentDefSchema=z[a138_0x1a0b8b(0x10f)]({'type':z[a138_0x1a0b8b(0x13a)]('segment')[a138_0x1a0b8b(0x11d)](),'name':z[a138_0x1a0b8b(0x110)]()['min'](0x1,a138_0x1a0b8b(0x14d)),'description':z[a138_0x1a0b8b(0x110)]()[a138_0x1a0b8b(0x11d)](),'folder':z['string']()[a138_0x1a0b8b(0x11d)](),'rule':RuleDefSchema['optional'](),'kind':z['enum']([a138_0x1a0b8b(0x146),a138_0x1a0b8b(0x13d),a138_0x1a0b8b(0x112)])['optional'](),'visible':z[a138_0x1a0b8b(0x12d)]()[a138_0x1a0b8b(0x11d)](),'activations':z[a138_0x1a0b8b(0x149)](z[a138_0x1a0b8b(0x12b)]())[a138_0x1a0b8b(0x11d)]()});const _syncCheck1=!![],_syncCheck2=!![];void _syncCheck1,void _syncCheck2;