@chriscamp/sf-data-cloud-mcp 0.1.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 (174) hide show
  1. package/README.md +158 -0
  2. package/dist/auth/auth-manager.d.ts +18 -0
  3. package/dist/auth/auth-manager.d.ts.map +1 -0
  4. package/dist/auth/auth-manager.js +64 -0
  5. package/dist/auth/auth-manager.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +160 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/smart/field-resolver.d.ts +17 -0
  11. package/dist/smart/field-resolver.d.ts.map +1 -0
  12. package/dist/smart/field-resolver.js +40 -0
  13. package/dist/smart/field-resolver.js.map +1 -0
  14. package/dist/smart/sql-translator.d.ts +6 -0
  15. package/dist/smart/sql-translator.d.ts.map +1 -0
  16. package/dist/smart/sql-translator.js +60 -0
  17. package/dist/smart/sql-translator.js.map +1 -0
  18. package/dist/smart/type-mapper.d.ts +3 -0
  19. package/dist/smart/type-mapper.d.ts.map +1 -0
  20. package/dist/smart/type-mapper.js +31 -0
  21. package/dist/smart/type-mapper.js.map +1 -0
  22. package/dist/tools/action/list-data-actions.d.ts +8 -0
  23. package/dist/tools/action/list-data-actions.d.ts.map +1 -0
  24. package/dist/tools/action/list-data-actions.js +10 -0
  25. package/dist/tools/action/list-data-actions.js.map +1 -0
  26. package/dist/tools/activation/create-activation.d.ts +10 -0
  27. package/dist/tools/activation/create-activation.d.ts.map +1 -0
  28. package/dist/tools/activation/create-activation.js +14 -0
  29. package/dist/tools/activation/create-activation.js.map +1 -0
  30. package/dist/tools/activation/list-activation-targets.d.ts +8 -0
  31. package/dist/tools/activation/list-activation-targets.d.ts.map +1 -0
  32. package/dist/tools/activation/list-activation-targets.js +10 -0
  33. package/dist/tools/activation/list-activation-targets.js.map +1 -0
  34. package/dist/tools/activation/list-activations.d.ts +8 -0
  35. package/dist/tools/activation/list-activations.d.ts.map +1 -0
  36. package/dist/tools/activation/list-activations.js +10 -0
  37. package/dist/tools/activation/list-activations.js.map +1 -0
  38. package/dist/tools/ci/create-calculated-insight.d.ts +11 -0
  39. package/dist/tools/ci/create-calculated-insight.d.ts.map +1 -0
  40. package/dist/tools/ci/create-calculated-insight.js +57 -0
  41. package/dist/tools/ci/create-calculated-insight.js.map +1 -0
  42. package/dist/tools/ci/delete-calculated-insight.d.ts +11 -0
  43. package/dist/tools/ci/delete-calculated-insight.d.ts.map +1 -0
  44. package/dist/tools/ci/delete-calculated-insight.js +15 -0
  45. package/dist/tools/ci/delete-calculated-insight.js.map +1 -0
  46. package/dist/tools/ci/get-calculated-insight-status.d.ts +10 -0
  47. package/dist/tools/ci/get-calculated-insight-status.d.ts.map +1 -0
  48. package/dist/tools/ci/get-calculated-insight-status.js +21 -0
  49. package/dist/tools/ci/get-calculated-insight-status.js.map +1 -0
  50. package/dist/tools/ci/list-calculated-insights.d.ts +10 -0
  51. package/dist/tools/ci/list-calculated-insights.d.ts.map +1 -0
  52. package/dist/tools/ci/list-calculated-insights.js +18 -0
  53. package/dist/tools/ci/list-calculated-insights.js.map +1 -0
  54. package/dist/tools/ci/run-calculated-insight.d.ts +11 -0
  55. package/dist/tools/ci/run-calculated-insight.d.ts.map +1 -0
  56. package/dist/tools/ci/run-calculated-insight.js +14 -0
  57. package/dist/tools/ci/run-calculated-insight.js.map +1 -0
  58. package/dist/tools/credits/estimate-flex-credits.d.ts +18 -0
  59. package/dist/tools/credits/estimate-flex-credits.d.ts.map +1 -0
  60. package/dist/tools/credits/estimate-flex-credits.js +56 -0
  61. package/dist/tools/credits/estimate-flex-credits.js.map +1 -0
  62. package/dist/tools/dmo/create-dmo-from-dlo.d.ts +15 -0
  63. package/dist/tools/dmo/create-dmo-from-dlo.d.ts.map +1 -0
  64. package/dist/tools/dmo/create-dmo-from-dlo.js +78 -0
  65. package/dist/tools/dmo/create-dmo-from-dlo.js.map +1 -0
  66. package/dist/tools/dmo/create-dmo-mapping.d.ts +11 -0
  67. package/dist/tools/dmo/create-dmo-mapping.d.ts.map +1 -0
  68. package/dist/tools/dmo/create-dmo-mapping.js +14 -0
  69. package/dist/tools/dmo/create-dmo-mapping.js.map +1 -0
  70. package/dist/tools/dmo/create-dmo.d.ts +11 -0
  71. package/dist/tools/dmo/create-dmo.d.ts.map +1 -0
  72. package/dist/tools/dmo/create-dmo.js +14 -0
  73. package/dist/tools/dmo/create-dmo.js.map +1 -0
  74. package/dist/tools/dmo/delete-dmo.d.ts +11 -0
  75. package/dist/tools/dmo/delete-dmo.d.ts.map +1 -0
  76. package/dist/tools/dmo/delete-dmo.js +15 -0
  77. package/dist/tools/dmo/delete-dmo.js.map +1 -0
  78. package/dist/tools/dmo/describe-dmo.d.ts +23 -0
  79. package/dist/tools/dmo/describe-dmo.d.ts.map +1 -0
  80. package/dist/tools/dmo/describe-dmo.js +10 -0
  81. package/dist/tools/dmo/describe-dmo.js.map +1 -0
  82. package/dist/tools/dmo/list-dmo-mappings.d.ts +11 -0
  83. package/dist/tools/dmo/list-dmo-mappings.d.ts.map +1 -0
  84. package/dist/tools/dmo/list-dmo-mappings.js +11 -0
  85. package/dist/tools/dmo/list-dmo-mappings.js.map +1 -0
  86. package/dist/tools/dmo/list-dmos.d.ts +17 -0
  87. package/dist/tools/dmo/list-dmos.d.ts.map +1 -0
  88. package/dist/tools/dmo/list-dmos.js +10 -0
  89. package/dist/tools/dmo/list-dmos.js.map +1 -0
  90. package/dist/tools/health/doctor.d.ts +18 -0
  91. package/dist/tools/health/doctor.d.ts.map +1 -0
  92. package/dist/tools/health/doctor.js +25 -0
  93. package/dist/tools/health/doctor.js.map +1 -0
  94. package/dist/tools/identity/describe-identity-resolution.d.ts +9 -0
  95. package/dist/tools/identity/describe-identity-resolution.d.ts.map +1 -0
  96. package/dist/tools/identity/describe-identity-resolution.js +10 -0
  97. package/dist/tools/identity/describe-identity-resolution.js.map +1 -0
  98. package/dist/tools/identity/list-identity-resolutions.d.ts +8 -0
  99. package/dist/tools/identity/list-identity-resolutions.d.ts.map +1 -0
  100. package/dist/tools/identity/list-identity-resolutions.js +10 -0
  101. package/dist/tools/identity/list-identity-resolutions.js.map +1 -0
  102. package/dist/tools/profile/query-profile.d.ts +10 -0
  103. package/dist/tools/profile/query-profile.d.ts.map +1 -0
  104. package/dist/tools/profile/query-profile.js +14 -0
  105. package/dist/tools/profile/query-profile.js.map +1 -0
  106. package/dist/tools/query/describe-table.d.ts +10 -0
  107. package/dist/tools/query/describe-table.d.ts.map +1 -0
  108. package/dist/tools/query/describe-table.js +10 -0
  109. package/dist/tools/query/describe-table.js.map +1 -0
  110. package/dist/tools/query/query-sql.d.ts +10 -0
  111. package/dist/tools/query/query-sql.d.ts.map +1 -0
  112. package/dist/tools/query/query-sql.js +10 -0
  113. package/dist/tools/query/query-sql.js.map +1 -0
  114. package/dist/tools/query/search-hybrid.d.ts +12 -0
  115. package/dist/tools/query/search-hybrid.d.ts.map +1 -0
  116. package/dist/tools/query/search-hybrid.js +12 -0
  117. package/dist/tools/query/search-hybrid.js.map +1 -0
  118. package/dist/tools/query/search-vector.d.ts +12 -0
  119. package/dist/tools/query/search-vector.d.ts.map +1 -0
  120. package/dist/tools/query/search-vector.js +12 -0
  121. package/dist/tools/query/search-vector.js.map +1 -0
  122. package/dist/tools/segment/describe-segment.d.ts +9 -0
  123. package/dist/tools/segment/describe-segment.d.ts.map +1 -0
  124. package/dist/tools/segment/describe-segment.js +10 -0
  125. package/dist/tools/segment/describe-segment.js.map +1 -0
  126. package/dist/tools/segment/list-segments.d.ts +8 -0
  127. package/dist/tools/segment/list-segments.d.ts.map +1 -0
  128. package/dist/tools/segment/list-segments.js +10 -0
  129. package/dist/tools/segment/list-segments.js.map +1 -0
  130. package/dist/tools/segment/publish-segment.d.ts +10 -0
  131. package/dist/tools/segment/publish-segment.d.ts.map +1 -0
  132. package/dist/tools/segment/publish-segment.js +14 -0
  133. package/dist/tools/segment/publish-segment.js.map +1 -0
  134. package/dist/tools/smart/resolve-field-names.d.ts +10 -0
  135. package/dist/tools/smart/resolve-field-names.d.ts.map +1 -0
  136. package/dist/tools/smart/resolve-field-names.js +18 -0
  137. package/dist/tools/smart/resolve-field-names.js.map +1 -0
  138. package/dist/tools/stream/create-data-stream.d.ts +10 -0
  139. package/dist/tools/stream/create-data-stream.d.ts.map +1 -0
  140. package/dist/tools/stream/create-data-stream.js +14 -0
  141. package/dist/tools/stream/create-data-stream.js.map +1 -0
  142. package/dist/tools/stream/describe-data-stream.d.ts +9 -0
  143. package/dist/tools/stream/describe-data-stream.d.ts.map +1 -0
  144. package/dist/tools/stream/describe-data-stream.js +10 -0
  145. package/dist/tools/stream/describe-data-stream.js.map +1 -0
  146. package/dist/tools/stream/list-data-streams.d.ts +8 -0
  147. package/dist/tools/stream/list-data-streams.d.ts.map +1 -0
  148. package/dist/tools/stream/list-data-streams.js +10 -0
  149. package/dist/tools/stream/list-data-streams.js.map +1 -0
  150. package/dist/tools/transform/get-transform-status.d.ts +9 -0
  151. package/dist/tools/transform/get-transform-status.d.ts.map +1 -0
  152. package/dist/tools/transform/get-transform-status.js +10 -0
  153. package/dist/tools/transform/get-transform-status.js.map +1 -0
  154. package/dist/tools/transform/list-transforms.d.ts +8 -0
  155. package/dist/tools/transform/list-transforms.d.ts.map +1 -0
  156. package/dist/tools/transform/list-transforms.js +10 -0
  157. package/dist/tools/transform/list-transforms.js.map +1 -0
  158. package/dist/tools/transform/run-transform.d.ts +10 -0
  159. package/dist/tools/transform/run-transform.d.ts.map +1 -0
  160. package/dist/tools/transform/run-transform.js +14 -0
  161. package/dist/tools/transform/run-transform.js.map +1 -0
  162. package/dist/util/errors.d.ts +2 -0
  163. package/dist/util/errors.d.ts.map +1 -0
  164. package/dist/util/errors.js +40 -0
  165. package/dist/util/errors.js.map +1 -0
  166. package/dist/util/http.d.ts +24 -0
  167. package/dist/util/http.d.ts.map +1 -0
  168. package/dist/util/http.js +104 -0
  169. package/dist/util/http.js.map +1 -0
  170. package/dist/util/unwrap.d.ts +12 -0
  171. package/dist/util/unwrap.d.ts.map +1 -0
  172. package/dist/util/unwrap.js +51 -0
  173. package/dist/util/unwrap.js.map +1 -0
  174. package/package.json +46 -0
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const listDataActionsInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare function listDataActionsTool(input: z.infer<typeof listDataActionsInputSchema>, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>[]>;
8
+ //# sourceMappingURL=list-data-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-data-actions.d.ts","sourceRoot":"","sources":["../../../src/tools/action/list-data-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,EACjD,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CASpC"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export const listDataActionsInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username")
4
+ });
5
+ export async function listDataActionsTool(input, auth, http) {
6
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
7
+ const result = await http.paginatedGet(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/data-actions`, orgCreds.accessToken, "dataActions", orgCreds.instanceUrl);
8
+ return result.items;
9
+ }
10
+ //# sourceMappingURL=list-data-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-data-actions.js","sourceRoot":"","sources":["../../../src/tools/action/list-data-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;CACpE,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAiD,EACjD,IAAiB,EACjB,IAAyB;IAEzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CACpC,GAAG,QAAQ,CAAC,WAAW,wCAAwC,EAC/D,QAAQ,CAAC,WAAW,EACpB,aAAa,EACb,QAAQ,CAAC,WAAW,CACrB,CAAC;IACF,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const createActivationInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
7
+ confirm: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ export declare function createActivationTool(input: z.infer<typeof createActivationInputSchema>, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>>;
10
+ //# sourceMappingURL=create-activation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-activation.d.ts","sourceRoot":"","sources":["../../../src/tools/activation/create-activation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,2BAA2B;;;;iBAItC,CAAC;AAEH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,EAClD,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAWlC"}
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ export const createActivationInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username"),
4
+ definition: z.record(z.string(), z.unknown()).describe("Activation definition"),
5
+ confirm: z.boolean().optional().describe("Set to true to execute. Omit for preview.")
6
+ });
7
+ export async function createActivationTool(input, auth, http) {
8
+ if (!input.confirm) {
9
+ return { preview: true, definition: input.definition, message: "Set confirm: true to create this activation." };
10
+ }
11
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
12
+ return http.post(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/activations`, orgCreds.accessToken, input.definition);
13
+ }
14
+ //# sourceMappingURL=create-activation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-activation.js","sourceRoot":"","sources":["../../../src/tools/activation/create-activation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACnE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IAC/E,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACtF,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAkD,EAClD,IAAiB,EACjB,IAAyB;IAEzB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,8CAA8C,EAAE,CAAC;IAClH,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,IAAI,CACd,GAAG,QAAQ,CAAC,WAAW,uCAAuC,EAC9D,QAAQ,CAAC,WAAW,EACpB,KAAK,CAAC,UAAU,CACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const listActivationTargetsInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare function listActivationTargetsTool(input: z.infer<typeof listActivationTargetsInputSchema>, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>[]>;
8
+ //# sourceMappingURL=list-activation-targets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-activation-targets.d.ts","sourceRoot":"","sources":["../../../src/tools/activation/list-activation-targets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,gCAAgC;;iBAE3C,CAAC;AAEH,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,EACvD,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CASpC"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export const listActivationTargetsInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username")
4
+ });
5
+ export async function listActivationTargetsTool(input, auth, http) {
6
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
7
+ const result = await http.paginatedGet(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/activation-targets`, orgCreds.accessToken, "activationTargets", orgCreds.instanceUrl);
8
+ return result.items;
9
+ }
10
+ //# sourceMappingURL=list-activation-targets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-activation-targets.js","sourceRoot":"","sources":["../../../src/tools/activation/list-activation-targets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;CACpE,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,KAAuD,EACvD,IAAiB,EACjB,IAAyB;IAEzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CACpC,GAAG,QAAQ,CAAC,WAAW,8CAA8C,EACrE,QAAQ,CAAC,WAAW,EACpB,mBAAmB,EACnB,QAAQ,CAAC,WAAW,CACrB,CAAC;IACF,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const listActivationsInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare function listActivationsTool(input: z.infer<typeof listActivationsInputSchema>, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>[]>;
8
+ //# sourceMappingURL=list-activations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-activations.d.ts","sourceRoot":"","sources":["../../../src/tools/activation/list-activations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,EACjD,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CASpC"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export const listActivationsInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username")
4
+ });
5
+ export async function listActivationsTool(input, auth, http) {
6
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
7
+ const result = await http.paginatedGet(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/activations`, orgCreds.accessToken, "activations", orgCreds.instanceUrl);
8
+ return result.items;
9
+ }
10
+ //# sourceMappingURL=list-activations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-activations.js","sourceRoot":"","sources":["../../../src/tools/activation/list-activations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;CACpE,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAiD,EACjD,IAAiB,EACjB,IAAyB;IAEzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CACpC,GAAG,QAAQ,CAAC,WAAW,uCAAuC,EAC9D,QAAQ,CAAC,WAAW,EACpB,aAAa,EACb,QAAQ,CAAC,WAAW,CACrB,CAAC;IACF,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const createCalculatedInsightInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
7
+ confirm: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ export type CreateCalculatedInsightInput = z.infer<typeof createCalculatedInsightInputSchema>;
10
+ export declare function createCalculatedInsightTool(input: CreateCalculatedInsightInput, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>>;
11
+ //# sourceMappingURL=create-calculated-insight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-calculated-insight.d.ts","sourceRoot":"","sources":["../../../src/tools/ci/create-calculated-insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAiB9D,eAAO,MAAM,kCAAkC;;;;iBAI7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAmC9F,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,4BAA4B,EACnC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAoBlC"}
@@ -0,0 +1,57 @@
1
+ import { z } from "zod";
2
+ const SCHEDULE_MAP = {
3
+ daily: "TwentyFour",
4
+ "24h": "TwentyFour",
5
+ "12h": "Twelve",
6
+ "6h": "Six",
7
+ "1h": "One",
8
+ none: "NotScheduled",
9
+ off: "NotScheduled",
10
+ TwentyFour: "TwentyFour",
11
+ Twelve: "Twelve",
12
+ Six: "Six",
13
+ One: "One",
14
+ NotScheduled: "NotScheduled"
15
+ };
16
+ export const createCalculatedInsightInputSchema = z.object({
17
+ target_org: z.string().describe("Salesforce org alias or username"),
18
+ definition: z.record(z.string(), z.unknown()).describe("CI definition object"),
19
+ confirm: z.boolean().optional().describe("Set to true to execute. Omit for preview.")
20
+ });
21
+ function enhanceDefinition(definition) {
22
+ const enhanced = { ...definition };
23
+ const warnings = [];
24
+ // Auto-add definitionType
25
+ if (!enhanced.definitionType) {
26
+ enhanced.definitionType = "CALCULATED_METRIC";
27
+ }
28
+ // Translate schedule interval
29
+ if (typeof enhanced.publishScheduleInterval === "string") {
30
+ const mapped = SCHEDULE_MAP[enhanced.publishScheduleInterval];
31
+ if (mapped) {
32
+ enhanced.publishScheduleInterval = mapped;
33
+ }
34
+ }
35
+ // Warn if expression references DLO tables (__dll) — CIs require DMO tables (__dlm)
36
+ if (typeof enhanced.expression === "string" && enhanced.expression.includes("__dll")) {
37
+ warnings.push("Expression contains __dll (DLO) table references. CIs require __dlm (DMO) references. " +
38
+ "Use resolve_field_names to find the correct DMO table names, or use the sql_translator smart layer.");
39
+ }
40
+ return { definition: enhanced, warnings };
41
+ }
42
+ export async function createCalculatedInsightTool(input, auth, http) {
43
+ const { definition: enhanced, warnings } = enhanceDefinition(input.definition);
44
+ if (!input.confirm) {
45
+ const preview = { preview: true, definition: enhanced, message: "Set confirm: true to create this CI." };
46
+ if (warnings.length > 0)
47
+ preview.warnings = warnings;
48
+ return preview;
49
+ }
50
+ // Block creation if expression has DLO references — they'll fail at runtime
51
+ if (warnings.length > 0 && typeof enhanced.expression === "string" && enhanced.expression.includes("__dll")) {
52
+ return { error: "Cannot create CI with __dll references in expression. CIs require __dlm (DMO) table names.", warnings };
53
+ }
54
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
55
+ return http.post(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/calculated-insights`, orgCreds.accessToken, enhanced);
56
+ }
57
+ //# sourceMappingURL=create-calculated-insight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-calculated-insight.js","sourceRoot":"","sources":["../../../src/tools/ci/create-calculated-insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,YAAY,GAA2B;IAC3C,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,cAAc;IACnB,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,YAAY,EAAE,cAAc;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAk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E/E,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,OAAO,GAA4B,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;QAClI,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACrD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,4EAA4E;IAC5E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,QAAQ,CAAC,UAAU,KAAK,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5G,OAAO,EAAE,KAAK,EAAE,4FAA4F,EAAE,QAAQ,EAAE,CAAC;IAC3H,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,IAAI,CACd,GAAG,QAAQ,CAAC,WAAW,+CAA+C,EACtE,QAAQ,CAAC,WAAW,EACpB,QAAQ,CACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const deleteCalculatedInsightInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ ci_name: z.ZodString;
7
+ confirm: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ export type DeleteCalculatedInsightInput = z.infer<typeof deleteCalculatedInsightInputSchema>;
10
+ export declare function deleteCalculatedInsightTool(input: DeleteCalculatedInsightInput, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>>;
11
+ //# sourceMappingURL=delete-calculated-insight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-calculated-insight.d.ts","sourceRoot":"","sources":["../../../src/tools/ci/delete-calculated-insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,kCAAkC;;;;iBAI7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,4BAA4B,EACnC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAWlC"}
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export const deleteCalculatedInsightInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username"),
4
+ ci_name: z.string().describe("Calculated Insight API name to delete"),
5
+ confirm: z.boolean().optional().describe("Set to true to execute. Omit for preview.")
6
+ });
7
+ export async function deleteCalculatedInsightTool(input, auth, http) {
8
+ if (!input.confirm) {
9
+ return { preview: true, ci_name: input.ci_name, message: "Set confirm: true to delete this CI." };
10
+ }
11
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
12
+ await http.delete(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/calculated-insights/${input.ci_name}`, orgCreds.accessToken);
13
+ return { deleted: true, ci_name: input.ci_name };
14
+ }
15
+ //# sourceMappingURL=delete-calculated-insight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-calculated-insight.js","sourceRoot":"","sources":["../../../src/tools/ci/delete-calculated-insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACnE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IACrE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACtF,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,KAAmC,EACnC,IAAiB,EACjB,IAAyB;IAEzB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IACpG,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,IAAI,CAAC,MAAM,CACf,GAAG,QAAQ,CAAC,WAAW,iDAAiD,KAAK,CAAC,OAAO,EAAE,EACvF,QAAQ,CAAC,WAAW,CACrB,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;AACnD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const getCalculatedInsightStatusInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ ci_name: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type GetCalculatedInsightStatusInput = z.infer<typeof getCalculatedInsightStatusInputSchema>;
9
+ export declare function getCalculatedInsightStatusTool(input: GetCalculatedInsightStatusInput, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>>;
10
+ //# sourceMappingURL=get-calculated-insight-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-calculated-insight-status.d.ts","sourceRoot":"","sources":["../../../src/tools/ci/get-calculated-insight-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,qCAAqC;;;iBAGhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,+BAA+B,EACtC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAwBlC"}
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ export const getCalculatedInsightStatusInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username"),
4
+ ci_name: z.string().describe("Calculated Insight API name")
5
+ });
6
+ export async function getCalculatedInsightStatusTool(input, auth, http) {
7
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
8
+ const result = await http.paginatedGet(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/calculated-insights`, orgCreds.accessToken, "calculatedInsights", orgCreds.instanceUrl);
9
+ const ci = result.items.find((c) => c.apiName === input.ci_name);
10
+ if (!ci) {
11
+ throw new Error(`Calculated Insight "${input.ci_name}" not found`);
12
+ }
13
+ return {
14
+ name: ci.apiName,
15
+ status: ci.calculatedInsightStatus,
16
+ lastRunStatus: ci.lastRunStatus,
17
+ lastRunDateTime: ci.lastRunDateTime,
18
+ lastRunErrorCode: ci.lastRunErrorCode
19
+ };
20
+ }
21
+ //# sourceMappingURL=get-calculated-insight-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-calculated-insight-status.js","sourceRoot":"","sources":["../../../src/tools/ci/get-calculated-insight-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACnE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;CAC5D,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,KAAsC,EACtC,IAAiB,EACjB,IAAyB;IAEzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CACpC,GAAG,QAAQ,CAAC,WAAW,+CAA+C,EACtE,QAAQ,CAAC,WAAW,EACpB,oBAAoB,EACpB,QAAQ,CAAC,WAAW,CACrB,CAAC;IAEF,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAC1B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,CACnC,CAAC;IAEF,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,uBAAuB,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IACrE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,EAAE,CAAC,OAAO;QAChB,MAAM,EAAE,EAAE,CAAC,uBAAuB;QAClC,aAAa,EAAE,EAAE,CAAC,aAAa;QAC/B,eAAe,EAAE,EAAE,CAAC,eAAe;QACnC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB;KACtC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const listCalculatedInsightsInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ raw: z.ZodOptional<z.ZodBoolean>;
7
+ }, z.core.$strip>;
8
+ export type ListCalculatedInsightsInput = z.infer<typeof listCalculatedInsightsInputSchema>;
9
+ export declare function listCalculatedInsightsTool(input: ListCalculatedInsightsInput, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>[]>;
10
+ //# sourceMappingURL=list-calculated-insights.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-calculated-insights.d.ts","sourceRoot":"","sources":["../../../src/tools/ci/list-calculated-insights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,iCAAiC;;;iBAG5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,2BAA2B,EAClC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAkBpC"}
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ export const listCalculatedInsightsInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username"),
4
+ raw: z.boolean().optional().describe("Return full CI definitions including expressions")
5
+ });
6
+ export async function listCalculatedInsightsTool(input, auth, http) {
7
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
8
+ const result = await http.paginatedGet(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/calculated-insights`, orgCreds.accessToken, "calculatedInsights", orgCreds.instanceUrl);
9
+ if (input.raw) {
10
+ return result.items;
11
+ }
12
+ return result.items.map(ci => ({
13
+ apiName: ci.apiName,
14
+ displayName: ci.displayName,
15
+ calculatedInsightStatus: ci.calculatedInsightStatus
16
+ }));
17
+ }
18
+ //# sourceMappingURL=list-calculated-insights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-calculated-insights.js","sourceRoot":"","sources":["../../../src/tools/ci/list-calculated-insights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACnE,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;CACzF,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,KAAkC,EAClC,IAAiB,EACjB,IAAyB;IAEzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CACpC,GAAG,QAAQ,CAAC,WAAW,+CAA+C,EACtE,QAAQ,CAAC,WAAW,EACpB,oBAAoB,EACpB,QAAQ,CAAC,WAAW,CACrB,CAAC;IAEF,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,WAAW,EAAE,EAAE,CAAC,WAAW;QAC3B,uBAAuB,EAAE,EAAE,CAAC,uBAAuB;KACpD,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const runCalculatedInsightInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ ci_name: z.ZodString;
7
+ confirm: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ export type RunCalculatedInsightInput = z.infer<typeof runCalculatedInsightInputSchema>;
10
+ export declare function runCalculatedInsightTool(input: RunCalculatedInsightInput, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>>;
11
+ //# sourceMappingURL=run-calculated-insight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-calculated-insight.d.ts","sourceRoot":"","sources":["../../../src/tools/ci/run-calculated-insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,+BAA+B;;;;iBAI1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,yBAAyB,EAChC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAWlC"}
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ export const runCalculatedInsightInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username"),
4
+ ci_name: z.string().describe("Calculated Insight API name"),
5
+ confirm: z.boolean().optional().describe("Set to true to execute. Omit for preview.")
6
+ });
7
+ export async function runCalculatedInsightTool(input, auth, http) {
8
+ if (!input.confirm) {
9
+ return { preview: true, ci_name: input.ci_name, message: "Set confirm: true to run this CI." };
10
+ }
11
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
12
+ return http.post(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/calculated-insights/${input.ci_name}/actions/run`, orgCreds.accessToken, undefined);
13
+ }
14
+ //# sourceMappingURL=run-calculated-insight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-calculated-insight.js","sourceRoot":"","sources":["../../../src/tools/ci/run-calculated-insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACnE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC3D,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACtF,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,KAAgC,EAChC,IAAiB,EACjB,IAAyB;IAEzB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;IACjG,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,IAAI,CACd,GAAG,QAAQ,CAAC,WAAW,iDAAiD,KAAK,CAAC,OAAO,cAAc,EACnG,QAAQ,CAAC,WAAW,EACpB,SAAS,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const estimateFlexCreditsInputSchema: z.ZodObject<{
5
+ mode: z.ZodEnum<{
6
+ estimate: "estimate";
7
+ live: "live";
8
+ }>;
9
+ target_org: z.ZodOptional<z.ZodString>;
10
+ ci_count: z.ZodOptional<z.ZodNumber>;
11
+ schedule: z.ZodOptional<z.ZodString>;
12
+ avg_records_per_ci: z.ZodOptional<z.ZodNumber>;
13
+ stream_count: z.ZodOptional<z.ZodNumber>;
14
+ avg_records_per_stream: z.ZodOptional<z.ZodNumber>;
15
+ }, z.core.$strip>;
16
+ export type EstimateFlexCreditsInput = z.infer<typeof estimateFlexCreditsInputSchema>;
17
+ export declare function estimateFlexCredits(input: EstimateFlexCreditsInput, auth?: AuthManager, http?: DataCloudHttpClient): Promise<Record<string, unknown>>;
18
+ //# sourceMappingURL=estimate-flex-credits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimate-flex-credits.d.ts","sourceRoot":"","sources":["../../../src/tools/credits/estimate-flex-credits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAkB9D,eAAO,MAAM,8BAA8B;;;;;;;;;;;iBAQzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAQtF,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,wBAAwB,EAC/B,IAAI,CAAC,EAAE,WAAW,EAClB,IAAI,CAAC,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAuClC"}
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ const CREDIT_RATES = {
3
+ ci_refresh_per_1k_rows: 0.25,
4
+ query_per_execution: 0.05,
5
+ stream_ingestion_per_1k_records: 0.1,
6
+ identity_resolution_per_1k_profiles: 0.5,
7
+ segment_publish_per_1k_members: 0.1,
8
+ activation_per_1k_records: 0.15
9
+ };
10
+ const SCHEDULE_MULTIPLIER = {
11
+ daily: 1,
12
+ "12h": 2,
13
+ "6h": 4,
14
+ "1h": 24
15
+ };
16
+ export const estimateFlexCreditsInputSchema = z.object({
17
+ mode: z.enum(["estimate", "live"]).describe("'estimate' for projection, 'live' for actual usage query"),
18
+ target_org: z.string().optional().describe("Required for live mode"),
19
+ ci_count: z.number().optional().describe("Number of CIs"),
20
+ schedule: z.string().optional().describe("CI schedule: daily, 12h, 6h, 1h"),
21
+ avg_records_per_ci: z.number().optional().describe("Average rows per CI"),
22
+ stream_count: z.number().optional().describe("Number of data streams"),
23
+ avg_records_per_stream: z.number().optional().describe("Average records per stream ingestion")
24
+ });
25
+ export async function estimateFlexCredits(input, auth, http) {
26
+ if (input.mode === "live" && auth && http && input.target_org) {
27
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
28
+ const usage = await http.post(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/query`, orgCreds.accessToken, { sql: "SELECT Unit_Consumed, Drawdown_Day FROM FlexCreditsUsage__dll ORDER BY Drawdown_Day DESC LIMIT 30" });
29
+ return { live_usage: usage };
30
+ }
31
+ const breakdown = [];
32
+ if (input.ci_count && input.avg_records_per_ci) {
33
+ const multiplier = SCHEDULE_MULTIPLIER[input.schedule ?? "daily"] ?? 1;
34
+ const dailyCredits = input.ci_count * (input.avg_records_per_ci / 1000) * CREDIT_RATES.ci_refresh_per_1k_rows * multiplier;
35
+ breakdown.push({
36
+ operation: "Calculated Insight refresh",
37
+ daily_credits: dailyCredits,
38
+ details: `${input.ci_count} CIs x ${input.avg_records_per_ci} rows x ${multiplier}x/day`
39
+ });
40
+ }
41
+ if (input.stream_count && input.avg_records_per_stream) {
42
+ const dailyCredits = input.stream_count * (input.avg_records_per_stream / 1000) * CREDIT_RATES.stream_ingestion_per_1k_records;
43
+ breakdown.push({
44
+ operation: "Data stream ingestion",
45
+ daily_credits: dailyCredits,
46
+ details: `${input.stream_count} streams x ${input.avg_records_per_stream} records`
47
+ });
48
+ }
49
+ const totalDaily = breakdown.reduce((sum, b) => sum + b.daily_credits, 0);
50
+ return {
51
+ estimated_daily_credits: totalDaily,
52
+ estimated_monthly_credits: totalDaily * 30,
53
+ breakdown
54
+ };
55
+ }
56
+ //# sourceMappingURL=estimate-flex-credits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimate-flex-credits.js","sourceRoot":"","sources":["../../../src/tools/credits/estimate-flex-credits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,YAAY,GAAG;IACnB,sBAAsB,EAAE,IAAI;IAC5B,mBAAmB,EAAE,IAAI;IACzB,+BAA+B,EAAE,GAAG;IACpC,mCAAmC,EAAE,GAAG;IACxC,8BAA8B,EAAE,GAAG;IACnC,yBAAyB,EAAE,IAAI;CAChC,CAAC;AAEF,MAAM,mBAAmB,GAA2B;IAClD,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,0DAA0D,CAAC;IACvG,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACpE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ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CAAC,sBAAsB,GAAG,UAAU,CAAC;QAC3H,SAAS,CAAC,IAAI,CAAC;YACb,SAAS,EAAE,4BAA4B;YACvC,aAAa,EAAE,YAAY;YAC3B,OAAO,EAAE,GAAG,KAAK,CAAC,QAAQ,UAAU,KAAK,CAAC,kBAAkB,WAAW,UAAU,OAAO;SACzF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,sBAAsB,EAAE,CAAC;QACvD,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,GAAG,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC,GAAG,YAAY,CAAC,+BAA+B,CAAC;QAC/H,SAAS,CAAC,IAAI,CAAC;YACb,SAAS,EAAE,uBAAuB;YAClC,aAAa,EAAE,YAAY;YAC3B,OAAO,EAAE,GAAG,KAAK,CAAC,YAAY,cAAc,KAAK,CAAC,sBAAsB,UAAU;SACnF,CAAC,CAAC;IACL,CAAC;IAED,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;IAE1E,OAAO;QACL,uBAAuB,EAAE,UAAU;QACnC,yBAAyB,EAAE,UAAU,GAAG,EAAE;QAC1C,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const createDmoFromDloInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ dlo_name: z.ZodString;
7
+ dmo_name: z.ZodOptional<z.ZodString>;
8
+ category: z.ZodDefault<z.ZodOptional<z.ZodString>>;
9
+ include_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
10
+ exclude_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
11
+ confirm: z.ZodOptional<z.ZodBoolean>;
12
+ }, z.core.$strip>;
13
+ export type CreateDmoFromDloInput = z.infer<typeof createDmoFromDloInputSchema>;
14
+ export declare function createDmoFromDloTool(input: CreateDmoFromDloInput, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>>;
15
+ //# sourceMappingURL=create-dmo-from-dlo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-dmo-from-dlo.d.ts","sourceRoot":"","sources":["../../../src/tools/dmo/create-dmo-from-dlo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,eAAO,MAAM,2BAA2B;;;;;;;;iBAQtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAWhF,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,qBAAqB,EAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAiFlC"}
@@ -0,0 +1,78 @@
1
+ import { z } from "zod";
2
+ import { correctDmoFieldType } from "../../smart/type-mapper.js";
3
+ export const createDmoFromDloInputSchema = z.object({
4
+ target_org: z.string().describe("Salesforce org alias or username"),
5
+ dlo_name: z.string().describe("DLO table name (e.g. Billing_Account_c_00Dxx0000000001__dll)"),
6
+ dmo_name: z.string().optional().describe("Target DMO name. Derived from DLO name if omitted."),
7
+ category: z.string().optional().default("OTHER").describe("DMO category (default: OTHER)"),
8
+ include_fields: z.array(z.string()).optional().describe("Only include these DLO fields"),
9
+ exclude_fields: z.array(z.string()).optional().describe("Exclude these DLO fields"),
10
+ confirm: z.boolean().optional().describe("Set to true to execute. Omit for preview.")
11
+ });
12
+ function dloFieldToDmoField(dloField) {
13
+ // Custom fields get doubled suffix: Field__c → Field_c__c
14
+ const dmoFieldName = dloField.name.endsWith("__c")
15
+ ? dloField.name.replace(/__c$/, "_c__c")
16
+ : dloField.name;
17
+ return { name: dmoFieldName, type: correctDmoFieldType(dloField.type) };
18
+ }
19
+ export async function createDmoFromDloTool(input, auth, http) {
20
+ const dcCreds = await auth.getDataCloudCredentials(input.target_org);
21
+ // Describe the DLO via Query API
22
+ const dloDescribe = await http.get(`${dcCreds.instanceUrl}/api/v1/metadata/${input.dlo_name}`, dcCreds.accessToken);
23
+ let columns = dloDescribe.metadata.columns;
24
+ // Filter fields
25
+ if (input.include_fields) {
26
+ columns = columns.filter(c => input.include_fields.includes(c.name));
27
+ }
28
+ if (input.exclude_fields) {
29
+ columns = columns.filter(c => !input.exclude_fields.includes(c.name));
30
+ }
31
+ const dmoName = input.dmo_name ?? input.dlo_name.replace(/__dll$/, "__dlm");
32
+ const category = input.category ?? "OTHER";
33
+ // Build DMO definition
34
+ const dmoFields = columns.map(col => {
35
+ const mapped = dloFieldToDmoField(col);
36
+ return {
37
+ name: mapped.name,
38
+ type: mapped.type,
39
+ label: col.name.replace(/__c$/g, "").replace(/_/g, " ").trim(),
40
+ creationType: "Custom"
41
+ };
42
+ });
43
+ const dmoDefinition = {
44
+ name: dmoName,
45
+ category,
46
+ dataSpaceName: "default",
47
+ fields: dmoFields
48
+ };
49
+ // Build mapping definition
50
+ const fieldMappings = columns.map(col => ({
51
+ sourceField: col.name,
52
+ targetField: dloFieldToDmoField(col).name
53
+ }));
54
+ const mappingDefinition = {
55
+ sourceDlo: input.dlo_name,
56
+ targetDmo: dmoName,
57
+ fieldMappings
58
+ };
59
+ if (!input.confirm) {
60
+ return {
61
+ preview: true,
62
+ dmo_definition: dmoDefinition,
63
+ mapping_definition: mappingDefinition,
64
+ message: "Set confirm: true to create this DMO and mapping."
65
+ };
66
+ }
67
+ // Create DMO
68
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
69
+ await http.post(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/data-model-objects`, orgCreds.accessToken, dmoDefinition);
70
+ // Create mapping
71
+ await http.post(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/data-model-object-mappings`, orgCreds.accessToken, mappingDefinition);
72
+ return {
73
+ created: true,
74
+ dmo_name: dmoName,
75
+ fields_mapped: fieldMappings.length
76
+ };
77
+ }
78
+ //# sourceMappingURL=create-dmo-from-dlo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-dmo-from-dlo.js","sourceRoot":"","sources":["../../../src/tools/dmo/create-dmo-from-dlo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACnE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8DAA8D,CAAC;IAC7F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;IAC9F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC1F,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IACxF,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACnF,OAAO,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,mDAAmD;SAC7D,CAAC;IACJ,CAAC;IAED,aAAa;IACb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,IAAI,CAAC,IAAI,CACb,GAAG,QAAQ,CAAC,WAAW,8CAA8C,EACrE,QAAQ,CAAC,WAAW,EACpB,aAAa,CACd,CAAC;IAEF,iBAAiB;IACjB,MAAM,IAAI,CAAC,IAAI,CACb,GAAG,QAAQ,CAAC,WAAW,sDAAsD,EAC7E,QAAQ,CAAC,WAAW,EACpB,iBAAiB,CAClB,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,OAAO;QACjB,aAAa,EAAE,aAAa,CAAC,MAAM;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import type { AuthManager } from "../../auth/auth-manager.js";
3
+ import type { DataCloudHttpClient } from "../../util/http.js";
4
+ export declare const createDmoMappingInputSchema: z.ZodObject<{
5
+ target_org: z.ZodString;
6
+ mapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
7
+ confirm: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ export type CreateDmoMappingInput = z.infer<typeof createDmoMappingInputSchema>;
10
+ export declare function createDmoMappingTool(input: CreateDmoMappingInput, auth: AuthManager, http: DataCloudHttpClient): Promise<Record<string, unknown>>;
11
+ //# sourceMappingURL=create-dmo-mapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-dmo-mapping.d.ts","sourceRoot":"","sources":["../../../src/tools/dmo/create-dmo-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,2BAA2B;;;;iBAItC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,qBAAqB,EAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAWlC"}
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ export const createDmoMappingInputSchema = z.object({
3
+ target_org: z.string().describe("Salesforce org alias or username"),
4
+ mapping: z.record(z.string(), z.unknown()).describe("Mapping definition with sourceDlo, targetDmo, and fieldMappings"),
5
+ confirm: z.boolean().optional().describe("Set to true to execute. Omit for preview.")
6
+ });
7
+ export async function createDmoMappingTool(input, auth, http) {
8
+ if (!input.confirm) {
9
+ return { preview: true, mapping: input.mapping, message: "Set confirm: true to create this mapping." };
10
+ }
11
+ const orgCreds = await auth.getOrgCredentials(input.target_org);
12
+ return http.post(`${orgCreds.instanceUrl}/services/data/v66.0/ssot/data-model-object-mappings`, orgCreds.accessToken, input.mapping);
13
+ }
14
+ //# sourceMappingURL=create-dmo-mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-dmo-mapping.js","sourceRoot":"","sources":["../../../src/tools/dmo/create-dmo-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACnE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,iEAAiE,CAAC;IACtH,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACtF,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAA4B,EAC5B,IAAiB,EACjB,IAAyB;IAEzB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC;IACzG,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,IAAI,CACd,GAAG,QAAQ,CAAC,WAAW,sDAAsD,EAC7E,QAAQ,CAAC,WAAW,EACpB,KAAK,CAAC,OAAO,CACd,CAAC;AACJ,CAAC"}