@aifabrix/builder 2.50.0 → 2.51.1

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 (236) hide show
  1. package/.cursor/plans/Done/157.1-security-quality-violations-by-type.csv +374 -0
  2. package/.cursor/rules/assistant-driven-integration-build.mdc +40 -0
  3. package/integration/hubspot-test/create-hubspot.js +1 -16
  4. package/jest.isolated-projects.js +77 -1
  5. package/jest.projects.js +5 -426
  6. package/lib/api/assistants.api.js +67 -0
  7. package/lib/api/datasources-extended.api.js +6 -6
  8. package/lib/api/evidence-authoring-helpers.js +267 -0
  9. package/lib/api/evidence-authoring.api.js +337 -0
  10. package/lib/api/evidence-kinds.api.js +128 -0
  11. package/lib/api/evidence.api.js +57 -1
  12. package/lib/api/index.js +24 -7
  13. package/lib/api/pipeline.api.js +47 -3
  14. package/lib/api/records-bulk.api.js +28 -3
  15. package/lib/api/resource-types.api.js +4 -4
  16. package/lib/api/roles.api.js +121 -0
  17. package/lib/api/types/evidence-kinds.types.js +42 -0
  18. package/lib/api/types/evidence.types.js +156 -8
  19. package/lib/api/types/roles.types.js +36 -0
  20. package/lib/api/work.api.js +283 -0
  21. package/lib/app/certification-verify-rows.js +1 -1
  22. package/lib/app/run-deploy-job.js +108 -0
  23. package/lib/app/run-helpers.js +10 -3
  24. package/lib/app/run.js +8 -0
  25. package/lib/app/show.js +2 -2
  26. package/lib/certification/merge-certification-from-artifact.js +1 -1
  27. package/lib/channels/add-channel.js +54 -23
  28. package/lib/channels/approval-guides/chatgpt.js +8 -7
  29. package/lib/channels/approval-guides/microsoft-copilot.js +7 -8
  30. package/lib/channels/channel-artifact-generator.js +16 -3
  31. package/lib/channels/channel-credential.js +3 -1
  32. package/lib/channels/channel-probe-evidence.js +79 -0
  33. package/lib/channels/channel-probe.js +265 -13
  34. package/lib/channels/channel-runtime-resolver.js +120 -29
  35. package/lib/channels/channel-status-display.js +44 -0
  36. package/lib/channels/channel-targets.js +7 -0
  37. package/lib/channels/chatgpt-runtime-contract.js +29 -0
  38. package/lib/channels/microsoft-copilot-package.js +280 -0
  39. package/lib/channels/runtime-tool-catalog.js +165 -0
  40. package/lib/cli/index.js +6 -0
  41. package/lib/cli/setup-app.js +26 -5
  42. package/lib/cli/setup-dev.js +23 -7
  43. package/lib/cli/setup-external-system-help.js +8 -2
  44. package/lib/cli/setup-external-system.js +12 -0
  45. package/lib/cli/setup-utility-help-after.js +12 -0
  46. package/lib/cli/setup-utility-validate.js +41 -2
  47. package/lib/commands/app-test.js +2 -14
  48. package/lib/commands/datasource-load-export-cli.js +6 -1
  49. package/lib/commands/deploy-gate-failure-details.js +23 -0
  50. package/lib/commands/deploy-gate-orchestrator.js +64 -18
  51. package/lib/commands/dev-cli-handlers.js +6 -3
  52. package/lib/commands/dev-down.js +2 -6
  53. package/lib/commands/dev-init.js +7 -109
  54. package/lib/commands/dev-refresh.js +197 -0
  55. package/lib/commands/evidence-kind.js +478 -0
  56. package/lib/commands/governance-command-action.js +4 -2
  57. package/lib/commands/governance-generate-external.js +56 -21
  58. package/lib/commands/lifecycle-external.js +10 -4
  59. package/lib/commands/repair-datasource-apply.js +10 -1
  60. package/lib/commands/repair-datasource-run.js +4 -2
  61. package/lib/commands/repair-datasource-test-payload.js +80 -19
  62. package/lib/commands/repair-datasource-webhooks-sync-bridge.js +42 -3
  63. package/lib/commands/repair-internal.js +9 -1
  64. package/lib/commands/repair-openapi-export.js +1 -1
  65. package/lib/commands/repair-openapi-sync.js +43 -18
  66. package/lib/commands/resource-type.js +101 -18
  67. package/lib/commands/role-assistant.js +313 -0
  68. package/lib/commands/role.js +452 -0
  69. package/lib/commands/setup.js +1 -1
  70. package/lib/commands/upload-data-sync-finalize.js +5 -4
  71. package/lib/commands/upload-sidecar-followups.js +144 -47
  72. package/lib/commands/upload.js +43 -6
  73. package/lib/commands/validate-json.js +230 -0
  74. package/lib/commands/verify-governance-combined-external.js +73 -9
  75. package/lib/commands/verify-governance-db.js +80 -25
  76. package/lib/commands/verify-governance-external.js +29 -5
  77. package/lib/commands/verify-operations-step-plan.js +78 -40
  78. package/lib/commands/wizard-core-helpers.js +7 -3
  79. package/lib/commands/wizard-core.js +78 -9
  80. package/lib/core/audit-logger.js +1 -1
  81. package/lib/core/secrets-load.js +1 -3
  82. package/lib/datasource/bulk-loader-run-batches.js +4 -2
  83. package/lib/datasource/bulk-loader-service.js +5 -1
  84. package/lib/datasource/capability/relate-operations.js +1 -1
  85. package/lib/datasource/datasource-validate-summary.js +2 -2
  86. package/lib/datasource/validate.js +13 -6
  87. package/lib/external-system/deploy-helpers.js +35 -1
  88. package/lib/external-system/deploy.js +23 -10
  89. package/lib/external-system/download-helpers.js +111 -2
  90. package/lib/external-system/download-role-assistant.js +55 -0
  91. package/lib/external-system/download.js +45 -26
  92. package/lib/external-system/test-helpers.js +1 -1
  93. package/lib/external-system/test.js +39 -3
  94. package/lib/generator/builders.js +3 -0
  95. package/lib/generator/helpers.js +13 -5
  96. package/lib/generator/split-variables.js +9 -3
  97. package/lib/generator/wizard.js +51 -4
  98. package/lib/infrastructure/helpers-docker-check.js +6 -0
  99. package/lib/infrastructure/helpers.js +1 -1
  100. package/lib/lifecycle/access-control-abac.js +121 -0
  101. package/lib/lifecycle/lifecycle-governance-options.js +4 -1
  102. package/lib/lifecycle/product-model.js +3 -2
  103. package/lib/lifecycle/report-display.js +14 -2
  104. package/lib/programmatic/auth-config.js +3 -2
  105. package/lib/programmatic/bearer-auth.js +1 -1
  106. package/lib/programmatic/capability-registry.js +20 -1
  107. package/lib/programmatic/command-options.js +1 -0
  108. package/lib/programmatic/enterprise-mcp-client.js +18 -2
  109. package/lib/programmatic/index.js +4 -0
  110. package/lib/programmatic/manifest-patch-section.js +48 -9
  111. package/lib/programmatic/manifest-section-registry-data.js +3 -2
  112. package/lib/programmatic/manifest-section-registry.js +18 -1
  113. package/lib/programmatic/openapi-apply-result-schemas.js +44 -0
  114. package/lib/programmatic/openapi-component-schemas.js +16 -1
  115. package/lib/programmatic/openapi-description-enricher.js +3 -1
  116. package/lib/programmatic/openapi-descriptions.js +55 -5
  117. package/lib/programmatic/openapi-evidence-schemas.js +161 -0
  118. package/lib/programmatic/openapi-manifest-schemas.js +6 -2
  119. package/lib/programmatic/openapi-operation-bindings.js +99 -0
  120. package/lib/programmatic/openapi-request-schemas.js +36 -1
  121. package/lib/programmatic/openapi-result-schemas.js +29 -12
  122. package/lib/programmatic/openapi-schema-descriptions-certify.js +5 -1
  123. package/lib/programmatic/openapi-schema-descriptions-core.js +6 -3
  124. package/lib/programmatic/openapi-schema-descriptions-evidence.js +156 -0
  125. package/lib/programmatic/openapi-schema-descriptions-manifest.js +4 -3
  126. package/lib/programmatic/openapi-schema-descriptions-operations.js +70 -0
  127. package/lib/programmatic/openapi-schema-helpers.js +16 -1
  128. package/lib/programmatic/openapi-spec.js +48 -29
  129. package/lib/programmatic/orchestration-openapi-meta.js +5 -0
  130. package/lib/programmatic/request-timeout.js +3 -0
  131. package/lib/programmatic/route-handler-map.js +89 -2
  132. package/lib/programmatic/run-certify.js +15 -2
  133. package/lib/programmatic/run-deploy.js +74 -0
  134. package/lib/programmatic/run-evidence-authoring.js +80 -0
  135. package/lib/programmatic/run-protection.js +124 -0
  136. package/lib/programmatic/run-repository-emcp.js +11 -3
  137. package/lib/programmatic/run-template-workspace.js +42 -2
  138. package/lib/programmatic/workspace-context.js +6 -0
  139. package/lib/protection/auth-context.js +48 -6
  140. package/lib/protection/paths.js +22 -0
  141. package/lib/protection/run-protection-create-helpers.js +22 -1
  142. package/lib/protection/run-protection-create.js +1 -1
  143. package/lib/protection/sync-after-upload.js +1 -1
  144. package/lib/resolvers/evidence-kind-file.js +230 -0
  145. package/lib/resolvers/resource-type-file.js +36 -1
  146. package/lib/resolvers/role-file.js +227 -0
  147. package/lib/role-assistant/evidence-sync.js +450 -0
  148. package/lib/role-assistant/github-workflow.js +96 -0
  149. package/lib/role-assistant/knowledge-sync.js +465 -0
  150. package/lib/role-assistant/settings.js +126 -0
  151. package/lib/role-assistant/test-cases-evaluate.js +170 -0
  152. package/lib/role-assistant/test-cases-honesty.js +184 -0
  153. package/lib/role-assistant/test-cases.js +364 -0
  154. package/lib/role-assistant/test-runner-workhub-answers.js +203 -0
  155. package/lib/role-assistant/test-runner-workhub.js +385 -0
  156. package/lib/role-assistant/test-runner.js +500 -0
  157. package/lib/schema/application-schema.json +36 -2
  158. package/lib/schema/deployment-rules.yaml +1 -0
  159. package/lib/schema/external-datasource.schema.json +121 -4
  160. package/lib/schema/external-system.schema.json +20 -6
  161. package/lib/schema/infra.parameter.yaml +45 -1
  162. package/lib/schema/role-assistant-settings.schema.json +108 -0
  163. package/lib/schema/type/credential-field-registry.json +19 -3
  164. package/lib/utils/api.js +52 -21
  165. package/lib/utils/app-path-resolve.js +72 -24
  166. package/lib/utils/app-register-config.js +4 -3
  167. package/lib/utils/authentication-shape.js +3 -1
  168. package/lib/utils/cli-sync-options.js +59 -3
  169. package/lib/utils/cli-utils.js +11 -3
  170. package/lib/utils/deployment-validation.js +28 -3
  171. package/lib/utils/dev-ca-install.js +5 -6
  172. package/lib/utils/dev-config.js +2 -2
  173. package/lib/utils/dev-list-sort.js +145 -0
  174. package/lib/utils/dev-platform-tls.js +0 -63
  175. package/lib/utils/docker-build.js +46 -27
  176. package/lib/utils/docker-daemon-tls-ca.js +1 -1
  177. package/lib/utils/docker-exec.js +91 -6
  178. package/lib/utils/docker-run-ephemeral.js +55 -0
  179. package/lib/utils/enterprise-knowledge-paths.js +29 -12
  180. package/lib/utils/env-copy-keycloak.js +196 -0
  181. package/lib/utils/env-copy.js +35 -4
  182. package/lib/utils/error-formatters/error-parser.js +0 -3
  183. package/lib/utils/external-env-template.js +1 -1
  184. package/lib/utils/external-system-readiness-compact-blocks.js +28 -1
  185. package/lib/utils/external-system-readiness-compact-display.js +3 -0
  186. package/lib/utils/health-check-request.js +2 -3
  187. package/lib/utils/help-builder.js +4 -0
  188. package/lib/utils/image-name.js +22 -4
  189. package/lib/utils/logger.js +37 -4
  190. package/lib/utils/manifest-source-emit.js +1 -1
  191. package/lib/utils/paths.js +98 -26
  192. package/lib/utils/pipeline-upload-auth-retry.js +19 -3
  193. package/lib/utils/postgres-platform-bootstrap.js +24 -17
  194. package/lib/utils/postgres-wipe.js +5 -2
  195. package/lib/utils/remote-dev-auth.js +39 -4
  196. package/lib/utils/resolve-docker-image-ref.js +36 -6
  197. package/lib/utils/role-assistant-paths.js +98 -0
  198. package/lib/utils/schema-loader.js +41 -0
  199. package/lib/utils/schema-resolver.js +36 -4
  200. package/lib/utils/token-manager.js +47 -22
  201. package/lib/utils/upload-sync-options.js +17 -3
  202. package/lib/utils/url-declarative-resolve-load-doc.js +38 -1
  203. package/lib/validation/external-manifest-validator.js +31 -8
  204. package/lib/validation/openapi-contract-surface-validator.js +4 -0
  205. package/lib/validation/validate-external-file.js +8 -1
  206. package/lib/validation/validator.js +6 -5
  207. package/package.json +35 -12
  208. package/scripts/export-builder-api-evidence.js +3 -3
  209. package/scripts/lib/plan-actor.js +2 -2
  210. package/scripts/lib/plan-meta.js +1 -1
  211. package/scripts/lib/plan-parse.js +1 -1
  212. package/scripts/lib/plan-prevalidate-gates.js +12 -1
  213. package/scripts/lib/plan-run-report.js +13 -2
  214. package/scripts/pnpm/lib/resolve-aifabrix-bin.mjs +10 -10
  215. package/templates/applications/dataplane/application.yaml +47 -17
  216. package/templates/applications/dataplane/env.template +28 -9
  217. package/templates/applications/dataplane/rbac.yaml +78 -2
  218. package/templates/applications/miso-controller/application.yaml +10 -1
  219. package/templates/applications/miso-controller/env.template +13 -8
  220. package/templates/applications/miso-controller/rbac.yaml +72 -0
  221. package/templates/channels/chatgpt/install.template.md.hbs +42 -24
  222. package/templates/channels/chatgpt/integration/README.md +10 -7
  223. package/templates/channels/chatgpt/integration/application.json +2 -2
  224. package/templates/channels/chatgpt/integration/chatgpt-system.json +3 -3
  225. package/templates/channels/chatgpt/integration/env.template +1 -1
  226. package/templates/channels/chatgpt/manifest.template.json.hbs +36 -5
  227. package/templates/channels/microsoft-copilot/ai-plugin.template.json.hbs +28 -0
  228. package/templates/channels/microsoft-copilot/declarative-agent.template.json.hbs +22 -0
  229. package/templates/channels/microsoft-copilot/install.template.md.hbs +32 -22
  230. package/templates/channels/microsoft-copilot/integration/README.md +9 -7
  231. package/templates/channels/microsoft-copilot/integration/application.json +2 -2
  232. package/templates/channels/microsoft-copilot/integration/env.template +1 -1
  233. package/templates/channels/microsoft-copilot/integration/microsoft-copilot-system.json +7 -6
  234. package/templates/channels/microsoft-copilot/manifest.template.json.hbs +34 -6
  235. package/templates/channels/slack/integration/slack-system.json +60 -2
  236. package/templates/python/requirements.txt +1 -1
package/jest.projects.js CHANGED
@@ -5,7 +5,10 @@
5
5
  */
6
6
 
7
7
  const { globalLiveFabrixHooks } = require('./jest.global-live-fabrix-hooks');
8
- const { buildIsolatedProjects } = require('./jest.isolated-projects');
8
+ const {
9
+ buildIsolatedProjects,
10
+ buildDefaultTestPathIgnorePatterns
11
+ } = require('./jest.isolated-projects');
9
12
 
10
13
  // Detect CI environment (GitHub Actions, CI simulation, etc.)
11
14
  const isCI = process.env.CI === 'true' || process.env.CI_SIMULATION === 'true';
@@ -47,431 +50,7 @@ const defaultProject = {
47
50
  '**/tests/**/*.test.js',
48
51
  '**/tests/**/*.spec.js'
49
52
  ],
50
- testPathIgnorePatterns: (() => {
51
- const patterns = [
52
- '/node_modules/',
53
- '\\\\node_modules\\\\',
54
- '/tests/integration/',
55
- '\\\\tests\\\\integration\\\\',
56
- '/tests/manual/',
57
- '\\\\tests\\\\manual\\\\',
58
- 'lib/utils/cli-utils.test.js',
59
- 'lib/utils/external-system-display.test.js',
60
- '/tests/lib/utils/cli-utils.test.js',
61
- '/tests/lib/utils/external-system-display.test.js',
62
- '/tests/lib/utils/dev-hosts-helper.test.js',
63
- '/tests/lib/utils/register-aifabrix-shell-env.test.js',
64
- '/tests/lib/utils/datasource-validation-watch.test.js',
65
- '\\\\tests\\\\lib\\\\utils\\\\cli-utils.test.js',
66
- '\\\\tests\\\\lib\\\\utils\\\\external-system-display.test.js',
67
- '\\\\tests\\\\lib\\\\utils\\\\dev-hosts-helper.test.js',
68
- '\\\\tests\\\\lib\\\\utils\\\\register-aifabrix-shell-env.test.js',
69
- '\\\\tests\\\\lib\\\\utils\\\\datasource-validation-watch.test.js',
70
- 'lib/utils/dev-hosts-helper.test.js',
71
- 'lib/utils/register-aifabrix-shell-env.test.js',
72
- 'lib/utils/datasource-validation-watch.test.js',
73
- 'dev-hosts-helper\\.test\\.js',
74
- 'register-aifabrix-shell-env\\.test\\.js',
75
- '/tests/lib/datasource/log-viewer.test.js',
76
- '\\\\tests\\\\lib\\\\datasource\\\\log-viewer.test.js',
77
- 'lib/datasource/log-viewer.test.js',
78
- '/tests/lib/datasource/log-viewer-structural.test.js',
79
- '/tests/lib/datasource/log-viewer-run.test.js',
80
- '\\\\tests\\\\lib\\\\datasource\\\\log-viewer-structural.test.js',
81
- '\\\\tests\\\\lib\\\\datasource\\\\log-viewer-run.test.js',
82
- 'lib/datasource/log-viewer-structural.test.js',
83
- 'lib/datasource/log-viewer-run.test.js',
84
- 'log-viewer-run\\.test\\.js',
85
- '/tests/lib/datasource/audit-evidence-extract.test.js',
86
- '\\\\tests\\\\lib\\\\datasource\\\\audit-evidence-extract.test.js',
87
- 'lib/datasource/audit-evidence-extract.test.js',
88
- 'audit-evidence-extract\\.test\\.js',
89
- '/tests/lib/commands/parameters-validate.test.js',
90
- '\\\\tests\\\\lib\\\\commands\\\\parameters-validate.test.js',
91
- 'lib/commands/parameters-validate.test.js',
92
- 'parameters-validate\\.test\\.js',
93
- '/tests/lib/commands/test-e2e-external.test.js',
94
- '\\\\tests\\\\lib\\\\commands\\\\test-e2e-external.test.js',
95
- 'lib/commands/test-e2e-external.test.js',
96
- 'test-e2e-external\\.test\\.js',
97
- '/tests/lib/commands/repair-openapi-sync.test.js',
98
- '\\\\tests\\\\lib\\\\commands\\\\repair-openapi-sync.test.js',
99
- 'lib/commands/repair-openapi-sync.test.js',
100
- 'repair-openapi-sync\\.test\\.js',
101
- '/tests/lib/utils/datasource-test-run-schema-sync.test.js',
102
- '\\\\tests\\\\lib\\\\utils\\\\datasource-test-run-schema-sync.test.js',
103
- 'lib/utils/datasource-test-run-schema-sync.test.js',
104
- '/tests/lib/parameters/infra-platform-contract.test.js',
105
- '\\\\tests\\\\lib\\\\parameters\\\\infra-platform-contract.test.js',
106
- 'lib/parameters/infra-platform-contract.test.js',
107
- '/tests/lib/parameters/database-secret-values.test.js',
108
- '\\\\tests\\\\lib\\\\parameters\\\\database-secret-values.test.js',
109
- 'lib/parameters/database-secret-values.test.js',
110
- 'database-secret-values\\.test\\.js',
111
- '/tests/lib/parameters/infra-parameter-validate.test.js',
112
- '\\\\tests\\\\lib\\\\parameters\\\\infra-parameter-validate.test.js',
113
- 'lib/parameters/infra-parameter-validate.test.js',
114
- 'infra-parameter-validate\\.test\\.js',
115
- '/tests/lib/parameters/infra-parameter-catalog.test.js',
116
- '\\\\tests\\\\lib\\\\parameters\\\\infra-parameter-catalog.test.js',
117
- 'lib/parameters/infra-parameter-catalog.test.js',
118
- 'infra-parameter-catalog\\.test\\.js',
119
- '/tests/lib/utils/platform-kv-ref.test.js',
120
- '\\\\tests\\\\lib\\\\utils\\\\platform-kv-ref.test.js',
121
- 'lib/utils/platform-kv-ref.test.js',
122
- 'platform-kv-ref\\.test\\.js',
123
- '/tests/lib/utils/urls-local-registry.test.js',
124
- '\\\\tests\\\\lib\\\\utils\\\\urls-local-registry.test.js',
125
- 'lib/utils/urls-local-registry.test.js',
126
- 'urls-local-registry\\.test\\.js',
127
- '/tests/lib/utils/aifabrix-runtime-config-dir.test.js',
128
- '\\\\tests\\\\lib\\\\utils\\\\aifabrix-runtime-config-dir.test.js',
129
- 'lib/utils/aifabrix-runtime-config-dir.test.js',
130
- 'aifabrix-runtime-config-dir\\.test\\.js',
131
- '/tests/lib/enterprise-knowledge-paths.test.js',
132
- '\\\\tests\\\\lib\\\\enterprise-knowledge-paths.test.js',
133
- 'lib/enterprise-knowledge-paths.test.js',
134
- 'enterprise-knowledge-paths\\.test\\.js',
135
- '/tests/lib/commands/governance-fixture-subjects.test.js',
136
- '\\\\tests\\\\lib\\\\commands\\\\governance-fixture-subjects.test.js',
137
- 'lib/commands/governance-fixture-subjects.test.js',
138
- 'governance-fixture-subjects\\.test\\.js',
139
- '/tests/lib/commands/enterprise-knowledge-generate-manifest.test.js',
140
- '\\\\tests\\\\lib\\\\commands\\\\enterprise-knowledge-generate-manifest.test.js',
141
- 'lib/commands/enterprise-knowledge-generate-manifest.test.js',
142
- 'enterprise-knowledge-generate-manifest\\.test\\.js',
143
- '/tests/lib/plan-prevalidate-gates.test.js',
144
- '\\\\tests\\\\lib\\\\plan-prevalidate-gates.test.js',
145
- 'lib/plan-prevalidate-gates.test.js',
146
- 'plan-prevalidate-gates\\.test\\.js',
147
- '/tests/lib/parameters/platform-env-template-kv-catalog.test.js',
148
- '\\\\tests\\\\lib\\\\parameters\\\\platform-env-template-kv-catalog.test.js',
149
- 'lib/parameters/platform-env-template-kv-catalog.test.js',
150
- 'platform-env-template-kv-catalog\\.test\\.js',
151
- '/tests/lib/infrastructure/resolve-infra-state-paths.test.js',
152
- '\\\\tests\\\\lib\\\\infrastructure\\\\resolve-infra-state-paths.test.js',
153
- 'lib/infrastructure/resolve-infra-state-paths.test.js',
154
- 'resolve-infra-state-paths\\.test\\.js',
155
- '/tests/lib/utils/dev-ssh-config-helper.test.js',
156
- '\\\\tests\\\\lib\\\\utils\\\\dev-ssh-config-helper.test.js',
157
- 'lib/utils/dev-ssh-config-helper.test.js',
158
- 'dev-ssh-config-helper\\.test\\.js',
159
- '/tests/lib/utils/ssh-key-helper.test.js',
160
- '\\\\tests\\\\lib\\\\utils\\\\ssh-key-helper.test.js',
161
- 'lib/utils/ssh-key-helper.test.js',
162
- 'ssh-key-helper\\.test\\.js',
163
- '/tests/lib/core/secrets-ensure-catalog-fallback.test.js',
164
- '\\\\tests\\\\lib\\\\core\\\\secrets-ensure-catalog-fallback.test.js',
165
- 'lib/core/secrets-ensure-catalog-fallback.test.js',
166
- 'secrets-ensure-catalog-fallback\\.test\\.js',
167
- '/tests/lib/core/secrets-ensure.test.js',
168
- '\\\\tests\\\\lib\\\\core\\\\secrets-ensure.test.js',
169
- 'lib/core/secrets-ensure.test.js',
170
- 'secrets-ensure\\.test\\.js',
171
- '/tests/lib/utils/url-declarative-vdir-inactive-env.test.js',
172
- '\\\\tests\\\\lib\\\\utils\\\\url-declarative-vdir-inactive-env.test.js',
173
- 'lib/utils/url-declarative-vdir-inactive-env.test.js',
174
- 'url-declarative-vdir-inactive-env\\.test\\.js',
175
- '/tests/lib/utils/url-declarative-resolve-load-doc.test.js',
176
- '\\\\tests\\\\lib\\\\utils\\\\url-declarative-resolve-load-doc.test.js',
177
- 'lib/utils/url-declarative-resolve-load-doc.test.js',
178
- 'url-declarative-resolve-load-doc\\.test\\.js',
179
- '/tests/lib/utils/compose-celery-worker.test.js',
180
- '\\\\tests\\\\lib\\\\utils\\\\compose-celery-worker.test.js',
181
- 'lib/utils/compose-celery-worker.test.js',
182
- 'compose-celery-worker\\.test\\.js',
183
- '/tests/lib/utils/url-declarative-user-cfg-per-app-proxy.test.js',
184
- '\\\\tests\\\\lib\\\\utils\\\\url-declarative-user-cfg-per-app-proxy.test.js',
185
- 'lib/utils/url-declarative-user-cfg-per-app-proxy.test.js',
186
- 'url-declarative-user-cfg-per-app-proxy\\.test\\.js',
187
- '/tests/lib/utils/url-declarative-expand-traefik-off-no-usercfg.test.js',
188
- '\\\\tests\\\\lib\\\\utils\\\\url-declarative-expand-traefik-off-no-usercfg.test.js',
189
- 'lib/utils/url-declarative-expand-traefik-off-no-usercfg.test.js',
190
- 'url-declarative-expand-traefik-off-no-usercfg\\.test\\.js',
191
- '/tests/lib/core/secrets-env-declarative-show-urls.test.js',
192
- '\\\\tests\\\\lib\\\\core\\\\secrets-env-declarative-show-urls.test.js',
193
- 'lib/core/secrets-env-declarative-show-urls.test.js',
194
- 'secrets-env-declarative-show-urls\\.test\\.js',
195
- '/tests/lib/utils/url-declarative-registry-internal-docker-origin.test.js',
196
- '\\\\tests\\\\lib\\\\utils\\\\url-declarative-registry-internal-docker-origin.test.js',
197
- 'lib/utils/url-declarative-registry-internal-docker-origin.test.js',
198
- 'url-declarative-registry-internal-docker-origin\\.test\\.js',
199
- '/tests/lib/commands/platform-urls-registry.validation.test.js',
200
- '\\\\tests\\\\lib\\\\commands\\\\platform-urls-registry.validation.test.js',
201
- 'lib/commands/platform-urls-registry.validation.test.js',
202
- 'platform-urls-registry\\.validation\\.test\\.js',
203
- '/tests/lib/utils/env-copy-resolve-output.test.js',
204
- '\\\\tests\\\\lib\\\\utils\\\\env-copy-resolve-output.test.js',
205
- 'lib/utils/env-copy-resolve-output.test.js',
206
- 'env-copy-resolve-output\\.test\\.js',
207
- '/tests/lib/utils/write-env-output-reload.test.js',
208
- '\\\\tests\\\\lib\\\\utils\\\\write-env-output-reload.test.js',
209
- 'lib/utils/write-env-output-reload.test.js',
210
- 'write-env-output-reload\\.test\\.js',
211
- '/tests/lib/utils/app-service-env-from-builder.test.js',
212
- '\\\\tests\\\\lib\\\\utils\\\\app-service-env-from-builder.test.js',
213
- 'lib/utils/app-service-env-from-builder.test.js',
214
- 'app-service-env-from-builder\\.test\\.js',
215
- '/tests/lib/parameters/infra-kv-discovery.test.js',
216
- '\\\\tests\\\\lib\\\\parameters\\\\infra-kv-discovery.test.js',
217
- 'lib/parameters/infra-kv-discovery.test.js',
218
- 'infra-kv-discovery\\.test\\.js',
219
- '/tests/lib/utils/infra-env-defaults.test.js',
220
- '\\\\tests\\\\lib\\\\utils\\\\infra-env-defaults.test.js',
221
- 'lib/utils/infra-env-defaults.test.js',
222
- 'infra-env-defaults\\.test\\.js',
223
- '/tests/lib/infrastructure/compose-traefik-template.test.js',
224
- '\\\\tests\\\\lib\\\\infrastructure\\\\compose-traefik-template.test.js',
225
- 'lib/infrastructure/compose-traefik-template.test.js',
226
- 'compose-traefik-template\\.test\\.js',
227
- '/tests/lib/infrastructure/traefik-tls-dynamic.test.js',
228
- '\\\\tests\\\\lib\\\\infrastructure\\\\traefik-tls-dynamic.test.js',
229
- 'lib/infrastructure/traefik-tls-dynamic.test.js',
230
- 'traefik-tls-dynamic\\.test\\.js',
231
- '/tests/lib/utils/paths-app-listing.test.js',
232
- '\\\\tests\\\\lib\\\\utils\\\\paths-app-listing.test.js',
233
- 'lib/utils/paths-app-listing.test.js',
234
- 'paths-app-listing\\.test\\.js',
235
- '/tests/lib/app-path-resolve.test.js',
236
- '\\\\tests\\\\lib\\\\app-path-resolve.test.js',
237
- 'lib/app-path-resolve.test.js',
238
- 'app-path-resolve\\.test\\.js',
239
- '/tests/lib/utils/paths-system-builder-resolution.test.js',
240
- '\\\\tests\\\\lib\\\\utils\\\\paths-system-builder-resolution.test.js',
241
- 'lib/utils/paths-system-builder-resolution.test.js',
242
- 'paths-system-builder-resolution\\.test\\.js',
243
- '/tests/lib/utils/manifest-location.test.js',
244
- '\\\\tests\\\\lib\\\\utils\\\\manifest-location.test.js',
245
- 'lib/utils/manifest-location.test.js',
246
- 'manifest-location\\.test\\.js',
247
- '/tests/lib/programmatic/',
248
- '\\\\tests\\\\lib\\\\programmatic\\\\',
249
- '/tests/packages/builder-api/e2e.test.js',
250
- '\\\\tests\\\\packages\\\\builder-api\\\\e2e.test.js',
251
- 'builder-api/e2e\\.test\\.js',
252
- '/tests/packages/builder-api/e2e-workspace-lock.test.js',
253
- '\\\\tests\\\\packages\\\\builder-api\\\\e2e-workspace-lock.test.js',
254
- 'builder-api/e2e-workspace-lock\\.test\\.js',
255
- '/tests/lib/commands/manifest-cli-integration-path.test.js',
256
- '\\\\tests\\\\lib\\\\commands\\\\manifest-cli-integration-path.test.js',
257
- 'manifest-cli-integration-path\\.test\\.js',
258
- '/tests/lib/commands/manifest-cli-commands.test.js',
259
- '\\\\tests\\\\lib\\\\commands\\\\manifest-cli-commands.test.js',
260
- 'manifest-cli-commands\\.test\\.js',
261
- '/tests/lib/commands/repair-datasource-operation-security.test.js',
262
- '\\\\tests\\\\lib\\\\commands\\\\repair-datasource-operation-security.test.js',
263
- 'repair-datasource-operation-security\\.test\\.js',
264
- '/tests/lib/commands/repair-orchestration-datasource-split.test.js',
265
- '\\\\tests\\\\lib\\\\commands\\\\repair-orchestration-datasource-split.test.js',
266
- 'repair-orchestration-datasource-split\\.test\\.js',
267
- '/tests/lib/commands/repair-openapi-export.test.js',
268
- '\\\\tests\\\\lib\\\\commands\\\\repair-openapi-export.test.js',
269
- 'repair-openapi-export\\.test\\.js',
270
- '/tests/lib/commands/repair-rbac-platform-preset.test.js',
271
- '\\\\tests\\\\lib\\\\commands\\\\repair-rbac-platform-preset.test.js',
272
- 'repair-rbac-platform-preset\\.test\\.js',
273
- '/tests/lib/utils/paths-reload-source.test.js',
274
- '\\\\tests\\\\lib\\\\utils\\\\paths-reload-source.test.js',
275
- 'paths-reload-source\\.test\\.js',
276
- '/tests/lib/platform-integrations-manifest.test.js',
277
- '\\\\tests\\\\lib\\\\platform-integrations-manifest.test.js',
278
- 'platform-integrations-manifest\\.test\\.js',
279
- '/tests/lib/generator/deploy-script.test.js',
280
- '\\\\tests\\\\lib\\\\generator\\\\deploy-script.test.js',
281
- 'generator/deploy-script\\.test\\.js',
282
- '/tests/lib/commands/repair-deploy-script.test.js',
283
- '\\\\tests\\\\lib\\\\commands\\\\repair-deploy-script.test.js',
284
- 'repair-deploy-script\\.test\\.js',
285
- '/tests/scripts/stage_builder_api_for_docker.test.js',
286
- '\\\\tests\\\\scripts\\\\stage_builder_api_for_docker.test.js',
287
- 'stage_builder_api_for_docker\\.test\\.js',
288
- '/tests/lib/scripts/sync-builder-api-template.test.js',
289
- '\\\\tests\\\\lib\\\\scripts\\\\sync-builder-api-template.test.js',
290
- 'sync-builder-api-template\\.test\\.js',
291
- '/tests/lib/evidence/evidence-service.test.js',
292
- '\\\\tests\\\\lib\\\\evidence\\\\evidence-service.test.js',
293
- 'evidence-service\\.test\\.js',
294
- '/tests/lib/utils/installation-log.test.js',
295
- '\\\\tests\\\\lib\\\\utils\\\\installation-log.test.js',
296
- 'lib/utils/installation-log.test.js',
297
- 'installation-log\\.test\\.js',
298
- '/tests/lib/utils/manifest-source-emit.test.js',
299
- '\\\\tests\\\\lib\\\\utils\\\\manifest-source-emit.test.js',
300
- 'lib/utils/manifest-source-emit.test.js',
301
- 'manifest-source-emit\\.test\\.js',
302
- '/tests/lib/utils/secrets-ancestor-paths.test.js',
303
- '\\\\tests\\\\lib\\\\utils\\\\secrets-ancestor-paths.test.js',
304
- 'lib/utils/secrets-ancestor-paths.test.js',
305
- 'secrets-ancestor-paths\\.test\\.js',
306
- '/tests/lib/generator/generator-external-rbac.test.js',
307
- '\\\\tests\\\\lib\\\\generator\\\\generator-external-rbac.test.js',
308
- 'lib/generator/generator-external-rbac.test.js',
309
- 'generator-external-rbac\\.test\\.js',
310
- '/tests/lib/infrastructure/helpers-ensure-admin-secrets.test.js',
311
- '\\\\tests\\\\lib\\\\infrastructure\\\\helpers-ensure-admin-secrets.test.js',
312
- 'lib/infrastructure/helpers-ensure-admin-secrets.test.js',
313
- 'helpers-ensure-admin-secrets\\.test\\.js',
314
- '/tests/lib/utils/secrets-generator.test.js',
315
- '\\\\tests\\\\lib\\\\utils\\\\secrets-generator.test.js',
316
- 'lib/utils/secrets-generator.test.js',
317
- 'secrets-generator\\.test\\.js',
318
- '/tests/lib/utils/ensure-dev-certs-for-remote-docker.test.js',
319
- '\\\\tests\\\\lib\\\\utils\\\\ensure-dev-certs-for-remote-docker.test.js',
320
- 'lib/utils/ensure-dev-certs-for-remote-docker.test.js',
321
- 'ensure-dev-certs-for-remote-docker\\.test\\.js',
322
- '/tests/lib/generator/generator-error-paths.test.js',
323
- '\\\\tests\\\\lib\\\\generator\\\\generator-error-paths.test.js',
324
- 'lib/generator/generator-error-paths.test.js',
325
- 'generator-error-paths\\.test\\.js',
326
- '/tests/lib/generator/generator-validation.test.js',
327
- '\\\\tests\\\\lib\\\\generator\\\\generator-validation.test.js',
328
- 'lib/generator/generator-validation.test.js',
329
- 'generator-validation\\.test\\.js',
330
- '/tests/lib/core/secrets-databaselog.test.js',
331
- '\\\\tests\\\\lib\\\\core\\\\secrets-databaselog.test.js',
332
- 'lib/core/secrets-databaselog.test.js',
333
- 'secrets-databaselog\\.test\\.js',
334
- '/tests/lib/validation/schema-241-alignment.test.js',
335
- '\\\\tests\\\\lib\\\\validation\\\\schema-241-alignment.test.js',
336
- 'lib/validation/schema-241-alignment.test.js',
337
- 'schema-241-alignment\\.test\\.js',
338
- '/tests/lib/build/miso-controller-npm-sdk-guard.test.js',
339
- '\\\\tests\\\\lib\\\\build\\\\miso-controller-npm-sdk-guard.test.js',
340
- 'lib/build/miso-controller-npm-sdk-guard.test.js',
341
- 'miso-controller-npm-sdk-guard\\.test\\.js',
342
- '/tests/lib/validation/hubspot-e2e-com-v2.test.js',
343
- '\\\\tests\\\\lib\\\\validation\\\\hubspot-e2e-com-v2.test.js',
344
- 'lib/validation/hubspot-e2e-com-v2.test.js',
345
- 'hubspot-e2e-com-v2\\.test\\.js',
346
- '/tests/lib/utils/runtime-configuration-download.test.js',
347
- '\\\\tests\\\\lib\\\\utils\\\\runtime-configuration-download.test.js',
348
- 'lib/utils/runtime-configuration-download.test.js',
349
- 'runtime-configuration-download\\.test\\.js',
350
- '/tests/lib/utils/schema-resolver-order.test.js',
351
- '\\\\tests\\\\lib\\\\utils\\\\schema-resolver-order.test.js',
352
- 'lib/utils/schema-resolver-order.test.js',
353
- 'schema-resolver-order\\.test\\.js',
354
- '/tests/lib/app/app.test.js',
355
- '\\\\tests\\\\lib\\\\app\\\\app.test.js',
356
- 'lib/app/app.test.js',
357
- '/tests/lib/templates/application-frontdoor-paths.contract.test.js',
358
- '\\\\tests\\\\lib\\\\templates\\\\application-frontdoor-paths.contract.test.js',
359
- 'lib/templates/application-frontdoor-paths.contract.test.js',
360
- 'application-frontdoor-paths\\.contract\\.test\\.js',
361
- '/tests/lib/templates/dataplane-env-template.contract.test.js',
362
- '\\\\tests\\\\lib\\\\templates\\\\dataplane-env-template.contract.test.js',
363
- 'lib/templates/dataplane-env-template.contract.test.js',
364
- 'dataplane-env-template\\.contract\\.test\\.js',
365
- '/tests/lib/core/admin-secrets.test.js',
366
- '\\\\tests\\\\lib\\\\core\\\\admin-secrets.test.js',
367
- 'lib/core/admin-secrets.test.js',
368
- '/tests/lib/datasource/validate-datasource-parsed.test.js',
369
- '\\\\tests\\\\lib\\\\datasource\\\\validate-datasource-parsed.test.js',
370
- 'lib/datasource/validate-datasource-parsed.test.js',
371
- 'validate-datasource-parsed\\.test\\.js',
372
- '/tests/lib/datasource/run-capability-copy.test.js',
373
- '\\\\tests\\\\lib\\\\datasource\\\\run-capability-copy.test.js',
374
- 'lib/datasource/run-capability-copy.test.js',
375
- 'run-capability-copy\\.test\\.js',
376
- '/tests/lib/datasource/run-capability-diff.test.js',
377
- '\\\\tests\\\\lib\\\\datasource\\\\run-capability-diff.test.js',
378
- 'lib/datasource/run-capability-diff.test.js',
379
- 'run-capability-diff\\.test\\.js',
380
- '/tests/lib/datasource/run-capability-edit.test.js',
381
- '\\\\tests\\\\lib\\\\datasource\\\\run-capability-edit.test.js',
382
- 'lib/datasource/run-capability-edit.test.js',
383
- 'run-capability-edit\\.test\\.js',
384
- '/tests/lib/datasource/run-capability-remove.test.js',
385
- '\\\\tests\\\\lib\\\\datasource\\\\run-capability-remove.test.js',
386
- 'lib/datasource/run-capability-remove.test.js',
387
- 'run-capability-remove\\.test\\.js',
388
- '/tests/lib/datasource/log-cleaner.test.js',
389
- '\\\\tests\\\\lib\\\\datasource\\\\log-cleaner.test.js',
390
- 'lib/datasource/log-cleaner.test.js',
391
- 'log-cleaner\\.test\\.js',
392
- '/tests/lib/datasource/datasource-exporter-service.test.js',
393
- '\\\\tests\\\\lib\\\\datasource\\\\datasource-exporter-service.test.js',
394
- 'lib/datasource/datasource-exporter-service.test.js',
395
- 'datasource-exporter-service\\.test\\.js',
396
- '/tests/lib/protection/paths.test.js',
397
- '\\\\tests\\\\lib\\\\protection\\\\paths.test.js',
398
- 'lib/protection/paths.test.js',
399
- 'protection/paths\\.test\\.js',
400
- '/tests/lib/protection/protection-resolve.test.js',
401
- '\\\\tests\\\\lib\\\\protection\\\\protection-resolve.test.js',
402
- 'lib/protection/protection-resolve.test.js',
403
- 'protection-resolve\\.test\\.js',
404
- '/tests/lib/protection/run-protection-create-helpers.test.js',
405
- '\\\\tests\\\\lib\\\\protection\\\\run-protection-create-helpers.test.js',
406
- 'lib/protection/run-protection-create-helpers.test.js',
407
- 'run-protection-create-helpers\\.test\\.js',
408
- '/tests/lib/governance/governance-pack-loader.test.js',
409
- '\\\\tests\\\\lib\\\\governance\\\\governance-pack-loader.test.js',
410
- 'lib/governance/governance-pack-loader.test.js',
411
- 'governance-pack-loader\\.test\\.js',
412
- '/tests/lib/lifecycle/scenario-upload.test.js',
413
- '\\\\tests\\\\lib\\\\lifecycle\\\\scenario-upload.test.js',
414
- 'lib/lifecycle/scenario-upload.test.js',
415
- 'scenario-upload\\.test\\.js',
416
- '/tests/lib/commands/governance-generate-external.test.js',
417
- '\\\\tests\\\\lib\\\\commands\\\\governance-generate-external.test.js',
418
- 'lib/commands/governance-generate-external.test.js',
419
- 'governance-generate-external\\.test\\.js',
420
- '/tests/lib/protection/validate-batch.test.js',
421
- '\\\\tests\\\\lib\\\\protection\\\\validate-batch.test.js',
422
- 'lib/protection/validate-batch.test.js',
423
- 'validate-batch\\.test\\.js',
424
- '/tests/helpers/aifabrix-runtime-sandbox.test.js',
425
- '\\\\tests\\\\helpers\\\\aifabrix-runtime-sandbox.test.js',
426
- 'helpers/aifabrix-runtime-sandbox\\.test\\.js',
427
- '/tests/helpers/aifabrix-runtime-backup.test.js',
428
- '\\\\tests\\\\helpers\\\\aifabrix-runtime-backup.test.js',
429
- 'helpers/aifabrix-runtime-backup\\.test\\.js',
430
- '/tests/lib/utils/paths-jest-sandbox-integration.test.js',
431
- '\\\\tests\\\\lib\\\\utils\\\\paths-jest-sandbox-integration.test.js',
432
- 'paths-jest-sandbox-integration\\.test\\.js',
433
- '/tests/lib/commands/secrets-remove-all-guard.test.js',
434
- '\\\\tests\\\\lib\\\\commands\\\\secrets-remove-all-guard.test.js',
435
- 'lib/commands/secrets-remove-all-guard.test.js',
436
- 'secrets-remove-all-guard\\.test\\.js',
437
- '/tests/lib/commands/app-logs.test.js',
438
- '\\\\tests\\\\lib\\\\commands\\\\app-logs.test.js',
439
- 'lib/commands/app-logs.test.js',
440
- 'app-logs\\.test\\.js',
441
- '/tests/lib/app/app-down.test.js',
442
- '\\\\tests\\\\lib\\\\app\\\\app-down.test.js',
443
- 'lib/app/app-down.test.js',
444
- 'app-down\\.test\\.js',
445
- '/tests/lib/channels/channel-integration-generator.test.js',
446
- '\\\\tests\\\\lib\\\\channels\\\\channel-integration-generator.test.js',
447
- 'lib/channels/channel-integration-generator.test.js',
448
- 'channel-integration-generator\\.test\\.js',
449
- '/tests/lib/channels/channel-integration-template.test.js',
450
- '\\\\tests\\\\lib\\\\channels\\\\channel-integration-template.test.js',
451
- 'lib/channels/channel-integration-template.test.js',
452
- 'channel-integration-template\\.test\\.js',
453
- '/tests/lib/channels/channel-artifact-generator.test.js',
454
- '\\\\tests\\\\lib\\\\channels\\\\channel-artifact-generator.test.js',
455
- 'lib/channels/channel-artifact-generator.test.js',
456
- 'channel-artifact-generator\\.test\\.js',
457
- '/tests/setup-ci-live-fabrix-guard.test.js',
458
- '\\\\tests\\\\setup-ci-live-fabrix-guard.test.js',
459
- 'setup-ci-live-fabrix-guard\\.test\\.js',
460
- '/tests/lib/utils/compose-local-data-mount.test.js',
461
- '\\\\tests\\\\lib\\\\utils\\\\compose-local-data-mount.test.js',
462
- 'lib/utils/compose-local-data-mount.test.js',
463
- 'compose-local-data-mount\\.test\\.js',
464
- '/tests/lib/commands/repair-capability-openapi-warnings.test.js',
465
- '\\\\tests\\\\lib\\\\commands\\\\repair-capability-openapi-warnings.test.js',
466
- 'lib/commands/repair-capability-openapi-warnings.test.js',
467
- 'repair-capability-openapi-warnings\\.test\\.js'
468
- ];
469
- if (process.env.INCLUDE_LOCAL_TESTS !== 'true') {
470
- patterns.push('/tests/local/');
471
- patterns.push('\\\\tests\\\\local\\\\');
472
- }
473
- return patterns;
474
- })(),
53
+ testPathIgnorePatterns: buildDefaultTestPathIgnorePatterns(),
475
54
  modulePathIgnorePatterns: [
476
55
  '<rootDir>/docker-builder-api-staging/'
477
56
  ],
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @fileoverview Admin Assistants API (dataplane operator Role Assistant surfaces).
3
+ * @author AI Fabrix Team
4
+ * @version 1.0.0
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ const { createDataplaneApiClient } = require('./index');
10
+
11
+ /**
12
+ * GET /api/v1/admin/assistants/{assistantKey}
13
+ * @async
14
+ * @function getAssistantDetails
15
+ * @param {string} dataplaneUrl - Dataplane base URL
16
+ * @param {string} assistantKey - Role Assistant / digital worker key
17
+ * @param {Object} authConfig - Auth config for dataplane client
18
+ * @returns {Promise<Object>} API response
19
+ * @requiresPermission {Dataplane} worker:read
20
+ */
21
+ async function getAssistantDetails(dataplaneUrl, assistantKey, authConfig) {
22
+ const client = createDataplaneApiClient(dataplaneUrl, authConfig);
23
+ const key = encodeURIComponent(String(assistantKey || '').trim());
24
+ return await client.get(`/api/v1/admin/assistants/${key}`);
25
+ }
26
+
27
+ /**
28
+ * PATCH /api/v1/admin/assistants/{assistantKey}/settings
29
+ * @async
30
+ * @function updateAssistantSettings
31
+ * @param {string} dataplaneUrl
32
+ * @param {string} assistantKey
33
+ * @param {Object} authConfig
34
+ * @param {Object} body - AssistantSettingsUpdate fields
35
+ * @returns {Promise<Object>}
36
+ * @requiresPermission {Dataplane} worker:update
37
+ */
38
+ async function updateAssistantSettings(dataplaneUrl, assistantKey, authConfig, body) {
39
+ const client = createDataplaneApiClient(dataplaneUrl, authConfig);
40
+ const key = encodeURIComponent(String(assistantKey || '').trim());
41
+ return await client.patch(`/api/v1/admin/assistants/${key}/settings`, { body });
42
+ }
43
+
44
+ /**
45
+ * Read Knowledge documentStorageKey from an assistants details API response.
46
+ * @param {Object|null|undefined} response
47
+ * @returns {string|null}
48
+ */
49
+ function extractDocumentStorageKeyFromAssistantDetails(response) {
50
+ if (!response || typeof response !== 'object' || response.success === false) {
51
+ return null;
52
+ }
53
+ const payload = response.data && typeof response.data === 'object' ? response.data : response;
54
+ const nested =
55
+ payload.data && typeof payload.data === 'object' ? payload.data : payload;
56
+ const key = nested.documentStorageKey;
57
+ if (typeof key !== 'string' || !key.trim()) {
58
+ return null;
59
+ }
60
+ return key.trim();
61
+ }
62
+
63
+ module.exports = {
64
+ getAssistantDetails,
65
+ updateAssistantSettings,
66
+ extractDocumentStorageKeyFromAssistantDetails
67
+ };
@@ -92,20 +92,20 @@ async function executeSyncJob(dataplaneUrl, sourceIdOrKey, syncJobId, authConfig
92
92
  const client = createDataplaneApiClient(dataplaneUrl, authConfig);
93
93
  return await client.post(`/api/v1/external/${sourceIdOrKey}/sync/${syncJobId}/execute`);
94
94
  }
95
- /** @requiresPermission {Dataplane} document-record or external-system scope */
95
+ /** @requiresPermission {Dataplane} external-data-source:sync */
96
96
  async function validateDocuments(dataplaneUrl, sourceIdOrKey, authConfig, validateData) {
97
97
  const client = createDataplaneApiClient(dataplaneUrl, authConfig);
98
- return await client.post(`/api/v1/external/data-sources/${sourceIdOrKey}/documents/validate`, { body: validateData });
98
+ return await client.post(`/api/v1/data-storage/${sourceIdOrKey}/documents/validate`, { body: validateData });
99
99
  }
100
- /** @requiresPermission {Dataplane} document-record or external-system scope */
100
+ /** @requiresPermission {Dataplane} external-data-source:sync */
101
101
  async function bulkDocuments(dataplaneUrl, sourceIdOrKey, authConfig, bulkData) {
102
102
  const client = createDataplaneApiClient(dataplaneUrl, authConfig);
103
- return await client.post(`/api/v1/external/data-sources/${sourceIdOrKey}/documents/bulk`, { body: bulkData });
103
+ return await client.post(`/api/v1/data-storage/${sourceIdOrKey}/documents/bulk`, { body: bulkData });
104
104
  }
105
- /** @requiresPermission {Dataplane} document-record:read or external-system:read */
105
+ /** @requiresPermission {Dataplane} document-record:read */
106
106
  async function listDocuments(dataplaneUrl, sourceIdOrKey, authConfig, options = {}) {
107
107
  const client = createDataplaneApiClient(dataplaneUrl, authConfig);
108
- return await client.get(`/api/v1/external/data-sources/${sourceIdOrKey}/documents`, { params: options });
108
+ return await client.get(`/api/v1/document-storages/${sourceIdOrKey}/documents`, { params: options });
109
109
  }
110
110
 
111
111
  module.exports = {