lua-cli 3.5.0-alpha.3 → 3.5.0-beta.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.
- package/README.md +137 -689
- package/dist/api/agent.api.service.d.ts +1 -8
- package/dist/api/agent.api.service.js +1 -11
- package/dist/api/agent.api.service.js.map +1 -1
- package/dist/api/auth.api.service.d.ts +1 -1
- package/dist/api/auth.api.service.js +1 -1
- package/dist/api/auth.api.service.js.map +1 -1
- package/dist/api/backup.api.service.d.ts +80 -0
- package/dist/api/backup.api.service.js +101 -0
- package/dist/api/backup.api.service.js.map +1 -0
- package/dist/api/basket.api.service.d.ts +4 -5
- package/dist/api/basket.api.service.js +13 -18
- package/dist/api/basket.api.service.js.map +1 -1
- package/dist/api/cdn.api.service.d.ts +2 -0
- package/dist/api/cdn.api.service.js +2 -0
- package/dist/api/cdn.api.service.js.map +1 -1
- package/dist/api/chat.api.service.d.ts +10 -2
- package/dist/api/chat.api.service.js +21 -2
- package/dist/api/chat.api.service.js.map +1 -1
- package/dist/api/credentials.js +5 -8
- package/dist/api/credentials.js.map +1 -1
- package/dist/api/custom.data.api.service.d.ts +3 -3
- package/dist/api/custom.data.api.service.js +9 -10
- package/dist/api/custom.data.api.service.js.map +1 -1
- package/dist/api/developer.api.service.d.ts +1 -1
- package/dist/api/developer.api.service.js +1 -1
- package/dist/api/developer.api.service.js.map +1 -1
- package/dist/api/http.client.js.map +1 -0
- package/dist/api/job.api.service.d.ts +2 -2
- package/dist/api/job.api.service.js +2 -2
- package/dist/api/job.api.service.js.map +1 -1
- package/dist/api/logs.api.service.d.ts +1 -1
- package/dist/api/logs.api.service.js +1 -1
- package/dist/api/logs.api.service.js.map +1 -1
- package/dist/api/marketplace.api.service.d.ts +6 -6
- package/dist/api/marketplace.api.service.js.map +1 -1
- package/dist/api/order.api.service.d.ts +3 -4
- package/dist/api/order.api.service.js +8 -10
- package/dist/api/order.api.service.js.map +1 -1
- package/dist/api/persona.api.service.d.ts +1 -1
- package/dist/api/persona.api.service.js +1 -1
- package/dist/api/persona.api.service.js.map +1 -1
- package/dist/api/postprocessor.api.service.d.ts +1 -1
- package/dist/api/postprocessor.api.service.js +1 -1
- package/dist/api/postprocessor.api.service.js.map +1 -1
- package/dist/api/preprocessor.api.service.d.ts +1 -1
- package/dist/api/preprocessor.api.service.js +1 -1
- package/dist/api/preprocessor.api.service.js.map +1 -1
- package/dist/api/products.api.service.d.ts +4 -4
- package/dist/api/products.api.service.js +6 -6
- package/dist/api/products.api.service.js.map +1 -1
- package/dist/api/resource.api.service.d.ts +76 -0
- package/dist/api/resource.api.service.js +74 -0
- package/dist/api/resource.api.service.js.map +1 -0
- package/dist/api/skills.api.service.d.ts +7 -15
- package/dist/api/skills.api.service.js +1 -1
- package/dist/api/skills.api.service.js.map +1 -1
- package/dist/api/tool.api.service.d.ts +1 -1
- package/dist/api/tool.api.service.js +1 -1
- package/dist/api/tool.api.service.js.map +1 -1
- package/dist/api/unifiedto.api.service.d.ts +1 -1
- package/dist/api/unifiedto.api.service.js +1 -1
- package/dist/api/unifiedto.api.service.js.map +1 -1
- package/dist/api/user.data.api.service.d.ts +7 -8
- package/dist/api/user.data.api.service.js +2 -3
- package/dist/api/user.data.api.service.js.map +1 -1
- package/dist/api/webhook.api.service.d.ts +1 -1
- package/dist/api/webhook.api.service.js +1 -1
- package/dist/api/webhook.api.service.js.map +1 -1
- package/dist/api/whatsapp-templates.api.service.d.ts +1 -1
- package/dist/api/whatsapp-templates.api.service.js +1 -1
- package/dist/api/whatsapp-templates.api.service.js.map +1 -1
- package/dist/api-exports.d.ts +14 -12
- package/dist/api-exports.js +8 -8
- package/dist/api-exports.js.map +1 -1
- package/dist/cli/command-definitions.js +32 -17
- package/dist/cli/command-definitions.js.map +1 -1
- package/dist/commands/admin.js +3 -24
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/agents.d.ts +8 -7
- package/dist/commands/agents.js +63 -21
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/channels.js +11 -23
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/chat.js +33 -47
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/chatClear.js +11 -41
- package/dist/commands/chatClear.js.map +1 -1
- package/dist/commands/compile.d.ts +26 -23
- package/dist/commands/compile.js +98 -403
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/completion.js +1 -1
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/deploy.js +55 -25
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.js +29 -45
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/env.js +12 -25
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/evals.js +3 -20
- package/dist/commands/evals.js.map +1 -1
- package/dist/commands/features.js +10 -23
- package/dist/commands/features.js.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.js +1 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +135 -19
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/integrations.js +26 -37
- package/dist/commands/integrations.js.map +1 -1
- package/dist/commands/jobs.js +32 -56
- package/dist/commands/jobs.js.map +1 -1
- package/dist/commands/logs.js +9 -20
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/marketplace.js +34 -52
- package/dist/commands/marketplace.js.map +1 -1
- package/dist/commands/mcp.js +10 -23
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/persona.js +43 -74
- package/dist/commands/persona.js.map +1 -1
- package/dist/commands/postprocessors.js +15 -28
- package/dist/commands/postprocessors.js.map +1 -1
- package/dist/commands/preprocessors.js +15 -28
- package/dist/commands/preprocessors.js.map +1 -1
- package/dist/commands/production.js +30 -63
- package/dist/commands/production.js.map +1 -1
- package/dist/commands/push.js +294 -1241
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/pushBackup.d.ts +22 -0
- package/dist/commands/pushBackup.js +133 -0
- package/dist/commands/pushBackup.js.map +1 -0
- package/dist/commands/resources.js +29 -72
- package/dist/commands/resources.js.map +1 -1
- package/dist/commands/skills.d.ts +1 -1
- package/dist/commands/skills.js +58 -70
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/sync.d.ts +1 -3
- package/dist/commands/sync.js +12 -24
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/test.js +135 -104
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/webhooks.js +15 -28
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/compiler/agent-traverser.d.ts +104 -0
- package/dist/compiler/agent-traverser.js +311 -0
- package/dist/compiler/agent-traverser.js.map +1 -0
- package/dist/compiler/bundler.d.ts +42 -0
- package/dist/compiler/bundler.js +187 -0
- package/dist/compiler/bundler.js.map +1 -0
- package/dist/compiler/compiler.d.ts +177 -0
- package/dist/compiler/compiler.js +580 -0
- package/dist/compiler/compiler.js.map +1 -0
- package/dist/compiler/index.d.ts +36 -0
- package/dist/compiler/index.js +42 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/plugins/base.d.ts +264 -0
- package/dist/compiler/plugins/base.js +307 -0
- package/dist/compiler/plugins/base.js.map +1 -0
- package/dist/compiler/plugins/job.plugin.d.ts +33 -0
- package/dist/compiler/plugins/job.plugin.js +143 -0
- package/dist/compiler/plugins/job.plugin.js.map +1 -0
- package/dist/compiler/plugins/mcp-server.plugin.d.ts +50 -0
- package/dist/compiler/plugins/mcp-server.plugin.js +186 -0
- package/dist/compiler/plugins/mcp-server.plugin.js.map +1 -0
- package/dist/compiler/plugins/postprocessor.plugin.d.ts +20 -0
- package/dist/compiler/plugins/postprocessor.plugin.js +39 -0
- package/dist/compiler/plugins/postprocessor.plugin.js.map +1 -0
- package/dist/compiler/plugins/preprocessor.plugin.d.ts +20 -0
- package/dist/compiler/plugins/preprocessor.plugin.js +48 -0
- package/dist/compiler/plugins/preprocessor.plugin.js.map +1 -0
- package/dist/compiler/plugins/processor-base.d.ts +16 -0
- package/dist/compiler/plugins/processor-base.js +34 -0
- package/dist/compiler/plugins/processor-base.js.map +1 -0
- package/dist/compiler/plugins/registry.d.ts +61 -0
- package/dist/compiler/plugins/registry.js +107 -0
- package/dist/compiler/plugins/registry.js.map +1 -0
- package/dist/compiler/plugins/skill.plugin.d.ts +71 -0
- package/dist/compiler/plugins/skill.plugin.js +243 -0
- package/dist/compiler/plugins/skill.plugin.js.map +1 -0
- package/dist/compiler/plugins/tool.plugin.d.ts +67 -0
- package/dist/compiler/plugins/tool.plugin.js +279 -0
- package/dist/compiler/plugins/tool.plugin.js.map +1 -0
- package/dist/compiler/plugins/webhook.plugin.d.ts +37 -0
- package/dist/compiler/plugins/webhook.plugin.js +127 -0
- package/dist/compiler/plugins/webhook.plugin.js.map +1 -0
- package/dist/compiler/source-writer.d.ts +98 -0
- package/dist/compiler/source-writer.js +223 -0
- package/dist/compiler/source-writer.js.map +1 -0
- package/dist/compiler/types.d.ts +289 -0
- package/dist/compiler/types.js +20 -0
- package/dist/compiler/types.js.map +1 -0
- package/dist/compiler/utils/ast-helpers.d.ts +57 -0
- package/dist/compiler/utils/ast-helpers.js +164 -0
- package/dist/compiler/utils/ast-helpers.js.map +1 -0
- package/dist/compiler/utils/common.d.ts +23 -0
- package/dist/compiler/utils/common.js +66 -0
- package/dist/compiler/utils/common.js.map +1 -0
- package/dist/compiler/utils/file-discovery.d.ts +34 -0
- package/dist/compiler/utils/file-discovery.js +68 -0
- package/dist/compiler/utils/file-discovery.js.map +1 -0
- package/dist/compiler/utils/path-resolver.d.ts +25 -0
- package/dist/compiler/utils/path-resolver.js +66 -0
- package/dist/compiler/utils/path-resolver.js.map +1 -0
- package/dist/compiler/utils/schema-converter.d.ts +26 -0
- package/dist/compiler/utils/schema-converter.js +94 -0
- package/dist/compiler/utils/schema-converter.js.map +1 -0
- package/dist/config/compile.constants.d.ts +2 -22
- package/dist/config/compile.constants.js +2 -49
- package/dist/config/compile.constants.js.map +1 -1
- package/dist/config/constants.d.ts +18 -2
- package/dist/config/constants.js +28 -8
- package/dist/config/constants.js.map +1 -1
- package/dist/config/dev.constants.d.ts +0 -10
- package/dist/config/dev.constants.js +0 -10
- package/dist/config/dev.constants.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/instances/basket.instance.js.map +1 -0
- package/dist/instances/data.entry.instance.js.map +1 -0
- package/dist/instances/job.instance.js.map +1 -0
- package/dist/instances/order.instance.js.map +1 -0
- package/dist/instances/product.instance.js.map +1 -0
- package/dist/instances/product.pagination.instance.js.map +1 -0
- package/dist/instances/product.search.instance.js.map +1 -0
- package/dist/instances/user.instance.js.map +1 -0
- package/dist/interfaces/admin.d.ts +0 -38
- package/dist/interfaces/backup.d.ts +125 -0
- package/dist/interfaces/backup.js +8 -0
- package/dist/interfaces/backup.js.map +1 -0
- package/dist/interfaces/baskets.d.ts +0 -56
- package/dist/interfaces/common.d.ts +1 -0
- package/dist/interfaces/deploy.d.ts +0 -15
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/interfaces/marketplace.d.ts +51 -0
- package/dist/interfaces/marketplace.js +1 -1
- package/dist/interfaces/marketplace.js.map +1 -1
- package/dist/interfaces/message.d.ts +0 -3
- package/dist/interfaces/orders.d.ts +0 -24
- package/dist/interfaces/postprocessors.d.ts +0 -18
- package/dist/interfaces/preprocessors.d.ts +0 -18
- package/dist/interfaces/skills.d.ts +61 -0
- package/dist/interfaces/user.d.ts +25 -0
- package/dist/interfaces/webhooks.d.ts +0 -9
- package/dist/primitives/base.handler.d.ts +106 -0
- package/dist/primitives/base.handler.js +370 -0
- package/dist/primitives/base.handler.js.map +1 -0
- package/dist/primitives/index.d.ts +47 -0
- package/dist/primitives/index.js +78 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/job.handler.d.ts +52 -0
- package/dist/primitives/job.handler.js +118 -0
- package/dist/primitives/job.handler.js.map +1 -0
- package/dist/primitives/mcp-server.handler.d.ts +54 -0
- package/dist/primitives/mcp-server.handler.js +91 -0
- package/dist/primitives/mcp-server.handler.js.map +1 -0
- package/dist/primitives/postprocessor.handler.d.ts +49 -0
- package/dist/primitives/postprocessor.handler.js +81 -0
- package/dist/primitives/postprocessor.handler.js.map +1 -0
- package/dist/primitives/preprocessor.handler.d.ts +54 -0
- package/dist/primitives/preprocessor.handler.js +95 -0
- package/dist/primitives/preprocessor.handler.js.map +1 -0
- package/dist/primitives/skill.handler.d.ts +44 -0
- package/dist/primitives/skill.handler.js +192 -0
- package/dist/primitives/skill.handler.js.map +1 -0
- package/dist/primitives/types.d.ts +72 -0
- package/dist/primitives/types.js +17 -0
- package/dist/primitives/types.js.map +1 -0
- package/dist/primitives/webhook.handler.d.ts +50 -0
- package/dist/primitives/webhook.handler.js +96 -0
- package/dist/primitives/webhook.handler.js.map +1 -0
- package/dist/services/auth.js +1 -2
- package/dist/services/auth.js.map +1 -1
- package/dist/services/sandbox.service.d.ts +103 -0
- package/dist/services/sandbox.service.js +479 -0
- package/dist/services/sandbox.service.js.map +1 -0
- package/dist/types/api-contracts.d.ts +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/skill.d.ts +8 -2
- package/dist/types/skill.js +8 -0
- package/dist/types/skill.js.map +1 -1
- package/dist/types/yaml.types.d.ts +69 -0
- package/dist/types/yaml.types.js +6 -0
- package/dist/types/yaml.types.js.map +1 -0
- package/dist/utils/artifact-loader.d.ts +108 -0
- package/dist/utils/artifact-loader.js +188 -0
- package/dist/utils/artifact-loader.js.map +1 -0
- package/dist/utils/backup-helpers.d.ts +122 -0
- package/dist/utils/backup-helpers.js +274 -0
- package/dist/utils/backup-helpers.js.map +1 -0
- package/dist/utils/cli.d.ts +8 -0
- package/dist/utils/cli.js +19 -2
- package/dist/utils/cli.js.map +1 -1
- package/dist/utils/command-utils.d.ts +42 -0
- package/dist/utils/command-utils.js +83 -0
- package/dist/utils/command-utils.js.map +1 -0
- package/dist/utils/deploy-helpers.d.ts +0 -29
- package/dist/utils/deploy-helpers.js +0 -70
- package/dist/utils/deploy-helpers.js.map +1 -1
- package/dist/utils/dev-api.d.ts +3 -99
- package/dist/utils/dev-api.js +3 -430
- package/dist/utils/dev-api.js.map +1 -1
- package/dist/utils/dev-server.d.ts +3 -1
- package/dist/utils/dev-server.js +69 -145
- package/dist/utils/dev-server.js.map +1 -1
- package/dist/utils/dev-watcher.d.ts +0 -1
- package/dist/utils/dev-watcher.js +23 -8
- package/dist/utils/dev-watcher.js.map +1 -1
- package/dist/utils/env-loader.utils.d.ts +10 -1
- package/dist/utils/env-loader.utils.js +39 -31
- package/dist/utils/env-loader.utils.js.map +1 -1
- package/dist/utils/files.d.ts +47 -3
- package/dist/utils/files.js +98 -40
- package/dist/utils/files.js.map +1 -1
- package/dist/utils/init-agent.js +1 -2
- package/dist/utils/init-agent.js.map +1 -1
- package/dist/utils/init-helpers.d.ts +2 -10
- package/dist/utils/init-helpers.js +9 -17
- package/dist/utils/init-helpers.js.map +1 -1
- package/dist/utils/init-prompts.d.ts +0 -8
- package/dist/utils/init-prompts.js +0 -22
- package/dist/utils/init-prompts.js.map +1 -1
- package/dist/utils/prompt-handler.d.ts +3 -0
- package/dist/utils/prompt-handler.js +13 -0
- package/dist/utils/prompt-handler.js.map +1 -1
- package/dist/utils/sandbox-storage.d.ts +6 -5
- package/dist/utils/sandbox-storage.js +12 -12
- package/dist/utils/sandbox-storage.js.map +1 -1
- package/dist/utils/sandbox.d.ts +7 -30
- package/dist/utils/sandbox.js +247 -223
- package/dist/utils/sandbox.js.map +1 -1
- package/dist/utils/semver.d.ts +12 -0
- package/dist/utils/semver.js +23 -0
- package/dist/utils/semver.js.map +1 -1
- package/dist/utils/sync-display.d.ts +9 -0
- package/dist/utils/sync-display.js +67 -0
- package/dist/utils/sync-display.js.map +1 -0
- package/dist/utils/sync-fetch.d.ts +23 -0
- package/dist/utils/sync-fetch.js +64 -0
- package/dist/utils/sync-fetch.js.map +1 -0
- package/dist/utils/sync-helpers.d.ts +4 -59
- package/dist/utils/sync-helpers.js +4 -206
- package/dist/utils/sync-helpers.js.map +1 -1
- package/dist/web/app.css +912 -186
- package/dist/web/app.js +46 -46
- package/docs/API_INDEX.md +100 -0
- package/docs/API_REFERENCE.md +773 -0
- package/docs/CLI_REFERENCE.md +924 -0
- package/docs/GETTING_STARTED.md +862 -0
- package/docs/README.md +270 -0
- package/docs/api/AI.md +882 -0
- package/docs/api/Baskets.md +511 -0
- package/docs/api/CDN.md +524 -0
- package/docs/api/Data.md +446 -0
- package/docs/api/Jobs.md +524 -0
- package/docs/api/LuaAgent.md +454 -0
- package/docs/api/LuaJob.md +604 -0
- package/docs/api/LuaSkill.md +396 -0
- package/docs/api/LuaTool.md +521 -0
- package/docs/api/LuaWebhook.md +601 -0
- package/docs/api/Orders.md +514 -0
- package/docs/api/PostProcessor.md +565 -0
- package/docs/api/PreProcessor.md +630 -0
- package/docs/api/Products.md +507 -0
- package/docs/api/Templates.md +662 -0
- package/docs/api/User.md +567 -0
- package/docs/archive/DEVELOPMENT_GUIDE_V1.md +1294 -0
- package/docs/compiler-v2/ASSESSMENT.md +205 -0
- package/docs/compiler-v2/TEST_PLAN.md +306 -0
- package/package.json +3 -7
- package/template/tsconfig.json +1 -1
- package/dist/common/basket.instance.js.map +0 -1
- package/dist/common/data.entry.instance.js.map +0 -1
- package/dist/common/http.client.js.map +0 -1
- package/dist/common/job.instance.js.map +0 -1
- package/dist/common/order.instance.js.map +0 -1
- package/dist/common/product.instance.js.map +0 -1
- package/dist/common/product.pagination.instance.js.map +0 -1
- package/dist/common/product.search.instance.js.map +0 -1
- package/dist/common/user.instance.js.map +0 -1
- package/dist/config/auth.constants.d.ts +0 -11
- package/dist/config/auth.constants.js +0 -12
- package/dist/config/auth.constants.js.map +0 -1
- package/dist/config/init.constants.d.ts +0 -15
- package/dist/config/init.constants.js +0 -20
- package/dist/config/init.constants.js.map +0 -1
- package/dist/interfaces/compile.d.ts +0 -12
- package/dist/interfaces/compile.js +0 -5
- package/dist/interfaces/compile.js.map +0 -1
- package/dist/types/compile.types.d.ts +0 -131
- package/dist/types/compile.types.js +0 -6
- package/dist/types/compile.types.js.map +0 -1
- package/dist/utils/agent-code-utils.d.ts +0 -25
- package/dist/utils/agent-code-utils.js +0 -107
- package/dist/utils/agent-code-utils.js.map +0 -1
- package/dist/utils/bundling.d.ts +0 -89
- package/dist/utils/bundling.js +0 -1068
- package/dist/utils/bundling.js.map +0 -1
- package/dist/utils/compile.d.ts +0 -116
- package/dist/utils/compile.js +0 -1062
- package/dist/utils/compile.js.map +0 -1
- package/dist/utils/deploy-api.d.ts +0 -26
- package/dist/utils/deploy-api.js +0 -54
- package/dist/utils/deploy-api.js.map +0 -1
- package/dist/utils/deployment.d.ts +0 -26
- package/dist/utils/deployment.js +0 -218
- package/dist/utils/deployment.js.map +0 -1
- package/dist/utils/dev-helpers.d.ts +0 -47
- package/dist/utils/dev-helpers.js +0 -82
- package/dist/utils/dev-helpers.js.map +0 -1
- package/dist/utils/job-management.d.ts +0 -27
- package/dist/utils/job-management.js +0 -248
- package/dist/utils/job-management.js.map +0 -1
- package/dist/utils/mcp-server-management.d.ts +0 -26
- package/dist/utils/mcp-server-management.js +0 -197
- package/dist/utils/mcp-server-management.js.map +0 -1
- package/dist/utils/postprocessor-management.d.ts +0 -9
- package/dist/utils/postprocessor-management.js +0 -117
- package/dist/utils/postprocessor-management.js.map +0 -1
- package/dist/utils/pre-bundle-jobs.d.ts +0 -27
- package/dist/utils/pre-bundle-jobs.js +0 -189
- package/dist/utils/pre-bundle-jobs.js.map +0 -1
- package/dist/utils/preprocessor-management.d.ts +0 -9
- package/dist/utils/preprocessor-management.js +0 -117
- package/dist/utils/preprocessor-management.js.map +0 -1
- package/dist/utils/push-api.d.ts +0 -15
- package/dist/utils/push-api.js +0 -49
- package/dist/utils/push-api.js.map +0 -1
- package/dist/utils/push-helpers.d.ts +0 -82
- package/dist/utils/push-helpers.js +0 -246
- package/dist/utils/push-helpers.js.map +0 -1
- package/dist/utils/skill-management.d.ts +0 -39
- package/dist/utils/skill-management.js +0 -299
- package/dist/utils/skill-management.js.map +0 -1
- package/dist/utils/test-helpers.d.ts +0 -33
- package/dist/utils/test-helpers.js +0 -84
- package/dist/utils/test-helpers.js.map +0 -1
- package/dist/utils/test-prompts.d.ts +0 -23
- package/dist/utils/test-prompts.js +0 -187
- package/dist/utils/test-prompts.js.map +0 -1
- package/dist/utils/tool-detection.d.ts +0 -19
- package/dist/utils/tool-detection.js +0 -125
- package/dist/utils/tool-detection.js.map +0 -1
- package/dist/utils/webhook-management.d.ts +0 -27
- package/dist/utils/webhook-management.js +0 -241
- package/dist/utils/webhook-management.js.map +0 -1
- /package/dist/{common → api}/http.client.d.ts +0 -0
- /package/dist/{common → api}/http.client.js +0 -0
- /package/dist/{common → instances}/basket.instance.d.ts +0 -0
- /package/dist/{common → instances}/basket.instance.js +0 -0
- /package/dist/{common → instances}/data.entry.instance.d.ts +0 -0
- /package/dist/{common → instances}/data.entry.instance.js +0 -0
- /package/dist/{common → instances}/job.instance.d.ts +0 -0
- /package/dist/{common → instances}/job.instance.js +0 -0
- /package/dist/{common → instances}/order.instance.d.ts +0 -0
- /package/dist/{common → instances}/order.instance.js +0 -0
- /package/dist/{common → instances}/product.instance.d.ts +0 -0
- /package/dist/{common → instances}/product.instance.js +0 -0
- /package/dist/{common → instances}/product.pagination.instance.d.ts +0 -0
- /package/dist/{common → instances}/product.pagination.instance.js +0 -0
- /package/dist/{common → instances}/product.search.instance.d.ts +0 -0
- /package/dist/{common → instances}/product.search.instance.js +0 -0
- /package/dist/{common → instances}/user.instance.d.ts +0 -0
- /package/dist/{common → instances}/user.instance.js +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { HttpClient } from "
|
|
1
|
+
import { HttpClient } from "./http.client.js";
|
|
2
2
|
import { ApiResponse } from "../interfaces/common.js";
|
|
3
|
-
import { Organization } from "../interfaces/admin.js";
|
|
4
3
|
import { AgentType } from "../interfaces/agent.js";
|
|
5
4
|
import { CreateAgentRequest } from "../interfaces/agent.js";
|
|
6
5
|
import { CreateAgentResponse } from "../interfaces/agent.js";
|
|
@@ -28,12 +27,6 @@ export default class AgentApi extends HttpClient {
|
|
|
28
27
|
* @param apiKey - The API key for authentication
|
|
29
28
|
*/
|
|
30
29
|
constructor(baseUrl: string, apiKey: string);
|
|
31
|
-
/**
|
|
32
|
-
* Retrieves all organizations associated with the authenticated user
|
|
33
|
-
* @returns Promise resolving to an ApiResponse containing an array of Organization objects
|
|
34
|
-
* @throws Error if the API request fails
|
|
35
|
-
*/
|
|
36
|
-
getOrganizations(): Promise<ApiResponse<Organization[]>>;
|
|
37
30
|
/**
|
|
38
31
|
* Retrieves all available agent types that can be created
|
|
39
32
|
* @returns Promise resolving to an ApiResponse containing an array of AgentType objects
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpClient } from "
|
|
1
|
+
import { HttpClient } from "./http.client.js";
|
|
2
2
|
/**
|
|
3
3
|
* Agent API calls
|
|
4
4
|
*/
|
|
@@ -12,16 +12,6 @@ export default class AgentApi extends HttpClient {
|
|
|
12
12
|
super(baseUrl);
|
|
13
13
|
this.apiKey = apiKey;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves all organizations associated with the authenticated user
|
|
17
|
-
* @returns Promise resolving to an ApiResponse containing an array of Organization objects
|
|
18
|
-
* @throws Error if the API request fails
|
|
19
|
-
*/
|
|
20
|
-
async getOrganizations() {
|
|
21
|
-
return this.httpGet(`/admin`, {
|
|
22
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
15
|
/**
|
|
26
16
|
* Retrieves all available agent types that can be created
|
|
27
17
|
* @returns Promise resolving to an ApiResponse containing an array of AgentType objects
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.api.service.js","sourceRoot":"","sources":["../../src/api/agent.api.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
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,WAAW,EACnC,WAAW,EACX;YACE,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;SACvC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,CACf,OAAe,EACf,UAAuF;QAEvF,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,WAAW,GAAG,EAAE,EAAE,CAAC,CAAC;QAEhE,OAAO,IAAI,CAAC,SAAS,CACnB,WAAW,WAAW,YAAY,EAClC;YACE,EAAE,EAAE,gBAAgB;YACpB,GAAG,UAAU;SACd,EACD;YACE,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;SACvC,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.api.service.js","sourceRoot":"","sources":["../../src/api/auth.api.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"auth.api.service.js","sourceRoot":"","sources":["../../src/api/auth.api.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,UAAU;IAC3C;;;OAGG;IACH,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CAAC,MAAc;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAW,QAAQ,EAAE;YACtC,aAAa,EAAE,UAAU,MAAM,EAAE;SAClC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,KAAa;QACzB,OAAO,IAAI,CAAC,QAAQ,CAAsB,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,SAAS,CAAC,KAAa,EAAE,GAAW;QACxC,OAAO,IAAI,CAAC,QAAQ,CAA0B,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CAAC,WAAmB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAqB,iBAAiB,EAAE,SAAS,EAAE;YACrE,aAAa,EAAE,UAAU,WAAW,EAAE;SACvC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backup API Service
|
|
3
|
+
*
|
|
4
|
+
* Handles all backup-related API calls using S3 blob storage.
|
|
5
|
+
* Content is stored in S3, keyed by content hash for deduplication.
|
|
6
|
+
*/
|
|
7
|
+
import { HttpClient } from './http.client.js';
|
|
8
|
+
import { ApiResponse } from '../interfaces/common.js';
|
|
9
|
+
import { BackupMetadata, BackupManifest, BackupExistsResponse, CheckBlobsResponse, UploadBlobsResponse, SaveManifestRequest, GetBlobUrlsResponse } from '../interfaces/backup.js';
|
|
10
|
+
/**
|
|
11
|
+
* Backup API client for project source backup operations
|
|
12
|
+
*/
|
|
13
|
+
export default class BackupApi extends HttpClient {
|
|
14
|
+
private apiKey;
|
|
15
|
+
private agentId;
|
|
16
|
+
/**
|
|
17
|
+
* Creates an instance of BackupApi
|
|
18
|
+
* @param baseUrl - The base URL for the API
|
|
19
|
+
* @param apiKey - The API key for authentication
|
|
20
|
+
* @param agentId - The unique identifier of the agent
|
|
21
|
+
*/
|
|
22
|
+
constructor(baseUrl: string, apiKey: string, agentId: string);
|
|
23
|
+
/**
|
|
24
|
+
* Check which blobs exist in S3.
|
|
25
|
+
* Called first to determine which files need to be uploaded.
|
|
26
|
+
*
|
|
27
|
+
* @param hashes - Array of content hashes to check
|
|
28
|
+
* @returns Promise resolving to missing/existing hash lists
|
|
29
|
+
*/
|
|
30
|
+
checkBlobsExist(hashes: string[]): Promise<ApiResponse<CheckBlobsResponse>>;
|
|
31
|
+
/**
|
|
32
|
+
* Upload blobs to S3.
|
|
33
|
+
* Called after checkBlobsExist to upload only missing files.
|
|
34
|
+
*
|
|
35
|
+
* @param blobs - Array of { hash, content } where content is base64-encoded
|
|
36
|
+
* @returns Promise resolving to upload result
|
|
37
|
+
*/
|
|
38
|
+
uploadBlobs(blobs: Array<{
|
|
39
|
+
hash: string;
|
|
40
|
+
content: string;
|
|
41
|
+
}>): Promise<ApiResponse<UploadBlobsResponse>>;
|
|
42
|
+
/**
|
|
43
|
+
* Get presigned URLs for downloading blobs from S3.
|
|
44
|
+
* Used by download to fetch files in parallel directly from S3.
|
|
45
|
+
*
|
|
46
|
+
* @param hashes - Array of content hashes to get URLs for
|
|
47
|
+
* @returns Promise resolving to map of hash -> presigned URL
|
|
48
|
+
*/
|
|
49
|
+
getBlobUrls(hashes: string[]): Promise<ApiResponse<GetBlobUrlsResponse>>;
|
|
50
|
+
/**
|
|
51
|
+
* Save backup manifest after blobs are uploaded.
|
|
52
|
+
* Final step in the backup flow.
|
|
53
|
+
*
|
|
54
|
+
* @param data - Manifest data with file references
|
|
55
|
+
* @returns Promise resolving to backup metadata
|
|
56
|
+
*/
|
|
57
|
+
saveManifest(data: SaveManifestRequest): Promise<ApiResponse<BackupMetadata>>;
|
|
58
|
+
/**
|
|
59
|
+
* Get backup metadata without file list.
|
|
60
|
+
* Used to check if backup exists and get basic info.
|
|
61
|
+
*
|
|
62
|
+
* @returns Promise resolving to backup metadata
|
|
63
|
+
*/
|
|
64
|
+
getBackupMetadata(): Promise<ApiResponse<BackupMetadata>>;
|
|
65
|
+
/**
|
|
66
|
+
* Get backup manifest with file list.
|
|
67
|
+
* Use getBlobUrls to get download URLs for the content.
|
|
68
|
+
*
|
|
69
|
+
* @returns Promise resolving to backup manifest with file refs
|
|
70
|
+
*/
|
|
71
|
+
getBackupManifest(): Promise<ApiResponse<BackupManifest>>;
|
|
72
|
+
/**
|
|
73
|
+
* Check if backup with given hash exists.
|
|
74
|
+
* Allows skipping upload if backup is already up-to-date.
|
|
75
|
+
*
|
|
76
|
+
* @param hash - Project hash to check
|
|
77
|
+
* @returns Promise resolving to existence check result
|
|
78
|
+
*/
|
|
79
|
+
checkBackupExists(hash: string): Promise<ApiResponse<BackupExistsResponse>>;
|
|
80
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backup API Service
|
|
3
|
+
*
|
|
4
|
+
* Handles all backup-related API calls using S3 blob storage.
|
|
5
|
+
* Content is stored in S3, keyed by content hash for deduplication.
|
|
6
|
+
*/
|
|
7
|
+
import { HttpClient } from './http.client.js';
|
|
8
|
+
/**
|
|
9
|
+
* Backup API client for project source backup operations
|
|
10
|
+
*/
|
|
11
|
+
export default class BackupApi extends HttpClient {
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of BackupApi
|
|
14
|
+
* @param baseUrl - The base URL for the API
|
|
15
|
+
* @param apiKey - The API key for authentication
|
|
16
|
+
* @param agentId - The unique identifier of the agent
|
|
17
|
+
*/
|
|
18
|
+
constructor(baseUrl, apiKey, agentId) {
|
|
19
|
+
super(baseUrl);
|
|
20
|
+
this.apiKey = apiKey;
|
|
21
|
+
this.agentId = agentId;
|
|
22
|
+
}
|
|
23
|
+
// ===========================================================================
|
|
24
|
+
// BLOB OPERATIONS (S3)
|
|
25
|
+
// ===========================================================================
|
|
26
|
+
/**
|
|
27
|
+
* Check which blobs exist in S3.
|
|
28
|
+
* Called first to determine which files need to be uploaded.
|
|
29
|
+
*
|
|
30
|
+
* @param hashes - Array of content hashes to check
|
|
31
|
+
* @returns Promise resolving to missing/existing hash lists
|
|
32
|
+
*/
|
|
33
|
+
async checkBlobsExist(hashes) {
|
|
34
|
+
const data = { hashes };
|
|
35
|
+
return this.httpPost(`/developer/agents/${this.agentId}/backup/check-blobs`, data, { Authorization: `Bearer ${this.apiKey}` });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Upload blobs to S3.
|
|
39
|
+
* Called after checkBlobsExist to upload only missing files.
|
|
40
|
+
*
|
|
41
|
+
* @param blobs - Array of { hash, content } where content is base64-encoded
|
|
42
|
+
* @returns Promise resolving to upload result
|
|
43
|
+
*/
|
|
44
|
+
async uploadBlobs(blobs) {
|
|
45
|
+
const data = { blobs };
|
|
46
|
+
return this.httpPost(`/developer/agents/${this.agentId}/backup/blobs`, data, { Authorization: `Bearer ${this.apiKey}` });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get presigned URLs for downloading blobs from S3.
|
|
50
|
+
* Used by download to fetch files in parallel directly from S3.
|
|
51
|
+
*
|
|
52
|
+
* @param hashes - Array of content hashes to get URLs for
|
|
53
|
+
* @returns Promise resolving to map of hash -> presigned URL
|
|
54
|
+
*/
|
|
55
|
+
async getBlobUrls(hashes) {
|
|
56
|
+
const data = { hashes };
|
|
57
|
+
return this.httpPost(`/developer/agents/${this.agentId}/backup/blob-urls`, data, { Authorization: `Bearer ${this.apiKey}` });
|
|
58
|
+
}
|
|
59
|
+
// ===========================================================================
|
|
60
|
+
// MANIFEST OPERATIONS (MongoDB)
|
|
61
|
+
// ===========================================================================
|
|
62
|
+
/**
|
|
63
|
+
* Save backup manifest after blobs are uploaded.
|
|
64
|
+
* Final step in the backup flow.
|
|
65
|
+
*
|
|
66
|
+
* @param data - Manifest data with file references
|
|
67
|
+
* @returns Promise resolving to backup metadata
|
|
68
|
+
*/
|
|
69
|
+
async saveManifest(data) {
|
|
70
|
+
return this.httpPost(`/developer/agents/${this.agentId}/backup/manifest`, data, { Authorization: `Bearer ${this.apiKey}` });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get backup metadata without file list.
|
|
74
|
+
* Used to check if backup exists and get basic info.
|
|
75
|
+
*
|
|
76
|
+
* @returns Promise resolving to backup metadata
|
|
77
|
+
*/
|
|
78
|
+
async getBackupMetadata() {
|
|
79
|
+
return this.httpGet(`/developer/agents/${this.agentId}/backup`, { Authorization: `Bearer ${this.apiKey}` });
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get backup manifest with file list.
|
|
83
|
+
* Use getBlobUrls to get download URLs for the content.
|
|
84
|
+
*
|
|
85
|
+
* @returns Promise resolving to backup manifest with file refs
|
|
86
|
+
*/
|
|
87
|
+
async getBackupManifest() {
|
|
88
|
+
return this.httpGet(`/developer/agents/${this.agentId}/backup/manifest`, { Authorization: `Bearer ${this.apiKey}` });
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Check if backup with given hash exists.
|
|
92
|
+
* Allows skipping upload if backup is already up-to-date.
|
|
93
|
+
*
|
|
94
|
+
* @param hash - Project hash to check
|
|
95
|
+
* @returns Promise resolving to existence check result
|
|
96
|
+
*/
|
|
97
|
+
async checkBackupExists(hash) {
|
|
98
|
+
return this.httpGet(`/developer/agents/${this.agentId}/backup/check/${hash}`, { Authorization: `Bearer ${this.apiKey}` });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=backup.api.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backup.api.service.js","sourceRoot":"","sources":["../../src/api/backup.api.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAe9C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAU;IAI/C;;;;;OAKG;IACH,YAAY,OAAe,EAAE,MAAc,EAAE,OAAe;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,8EAA8E;I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1C,EAAE,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE,CAC3C,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB;QACrB,OAAO,IAAI,CAAC,OAAO,CACjB,qBAAqB,IAAI,CAAC,OAAO,kBAAkB,EACnD,EAAE,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE,CAC3C,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,iBAAiB,CAAC,IAAY;QAClC,OAAO,IAAI,CAAC,OAAO,CACjB,qBAAqB,IAAI,CAAC,OAAO,iBAAiB,IAAI,EAAE,EACxD,EAAE,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE,CAC3C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import BasketInstance from "../
|
|
2
|
-
import { HttpClient } from "
|
|
3
|
-
import OrderInstance from "../
|
|
1
|
+
import BasketInstance from "../instances/basket.instance.js";
|
|
2
|
+
import { HttpClient } from "./http.client.js";
|
|
3
|
+
import OrderInstance from "../instances/order.instance.js";
|
|
4
4
|
import { BasketStatus, CreateBasketRequest, AddItemToBasketRequest, Basket } from "../interfaces/baskets.js";
|
|
5
|
-
import { UpdateBasketMetadataResponse } from "../interfaces/baskets.js";
|
|
6
5
|
import { BasketAPI } from "../types/index.js";
|
|
7
6
|
export default class BasketApi extends HttpClient implements BasketAPI {
|
|
8
7
|
private apiKey;
|
|
@@ -73,7 +72,7 @@ export default class BasketApi extends HttpClient implements BasketAPI {
|
|
|
73
72
|
* @returns Promise resolving to the updated metadata
|
|
74
73
|
* @throws Error if the basket is not found or the metadata update fails
|
|
75
74
|
*/
|
|
76
|
-
updateMetadata(basketId: string, metadata: any): Promise<
|
|
75
|
+
updateMetadata(basketId: string, metadata: Record<string, any>): Promise<Record<string, any>>;
|
|
77
76
|
/**
|
|
78
77
|
* Creates an order from a basket
|
|
79
78
|
* @param data - Additional order data (shipping info, payment details, etc.)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import BasketInstance from "../
|
|
2
|
-
import { HttpClient } from "
|
|
3
|
-
import OrderInstance from "../
|
|
1
|
+
import BasketInstance from "../instances/basket.instance.js";
|
|
2
|
+
import { HttpClient } from "./http.client.js";
|
|
3
|
+
import OrderInstance from "../instances/order.instance.js";
|
|
4
4
|
import OrderApi from "./order.api.service.js";
|
|
5
5
|
export default class BasketApi extends HttpClient {
|
|
6
6
|
/**
|
|
@@ -40,11 +40,8 @@ export default class BasketApi extends HttpClient {
|
|
|
40
40
|
const response = await this.httpGet(`/developer/agents/${this.agentId}/basket/user${statusParam}`, {
|
|
41
41
|
Authorization: `Bearer ${this.apiKey}`,
|
|
42
42
|
});
|
|
43
|
-
if (response.success) {
|
|
44
|
-
|
|
45
|
-
return baskets.map((basket) => {
|
|
46
|
-
return new BasketInstance(this, basket);
|
|
47
|
-
});
|
|
43
|
+
if (response.success && response.data) {
|
|
44
|
+
return response.data.map((basket) => new BasketInstance(this, basket));
|
|
48
45
|
}
|
|
49
46
|
throw new Error(response.error?.message || 'Failed to get user baskets');
|
|
50
47
|
}
|
|
@@ -74,7 +71,7 @@ export default class BasketApi extends HttpClient {
|
|
|
74
71
|
const response = await this.httpPost(`/developer/agents/${this.agentId}/basket/${basketId}/item`, itemData, {
|
|
75
72
|
Authorization: `Bearer ${this.apiKey}`,
|
|
76
73
|
});
|
|
77
|
-
if (response.success) {
|
|
74
|
+
if (response.success && response.data) {
|
|
78
75
|
return response.data;
|
|
79
76
|
}
|
|
80
77
|
throw new Error(response.error?.message || 'Failed to add item to basket');
|
|
@@ -90,7 +87,7 @@ export default class BasketApi extends HttpClient {
|
|
|
90
87
|
const response = await this.httpDelete(`/developer/agents/${this.agentId}/basket/${basketId}/item/${itemId}`, {
|
|
91
88
|
Authorization: `Bearer ${this.apiKey}`,
|
|
92
89
|
});
|
|
93
|
-
if (response.success) {
|
|
90
|
+
if (response.success && response.data) {
|
|
94
91
|
return response.data;
|
|
95
92
|
}
|
|
96
93
|
throw new Error(response.error?.message || 'Failed to remove item from basket');
|
|
@@ -105,10 +102,10 @@ export default class BasketApi extends HttpClient {
|
|
|
105
102
|
const response = await this.httpDelete(`/developer/agents/${this.agentId}/basket/${basketId}/clear`, {
|
|
106
103
|
Authorization: `Bearer ${this.apiKey}`,
|
|
107
104
|
});
|
|
108
|
-
if (response.success) {
|
|
105
|
+
if (response.success && response.data) {
|
|
109
106
|
return response.data;
|
|
110
107
|
}
|
|
111
|
-
throw new Error(response.message || 'Failed to clear basket');
|
|
108
|
+
throw new Error(response.error?.message || 'Failed to clear basket');
|
|
112
109
|
}
|
|
113
110
|
/**
|
|
114
111
|
* Updates the status of a basket
|
|
@@ -124,7 +121,7 @@ export default class BasketApi extends HttpClient {
|
|
|
124
121
|
if (response.success) {
|
|
125
122
|
return status;
|
|
126
123
|
}
|
|
127
|
-
throw new Error(response.message || 'Failed to update basket status');
|
|
124
|
+
throw new Error(response.error?.message || 'Failed to update basket status');
|
|
128
125
|
}
|
|
129
126
|
/**
|
|
130
127
|
* Updates the metadata of a basket
|
|
@@ -140,7 +137,7 @@ export default class BasketApi extends HttpClient {
|
|
|
140
137
|
if (response.success) {
|
|
141
138
|
return metadata;
|
|
142
139
|
}
|
|
143
|
-
throw new Error(response.message || 'Failed to update basket metadata');
|
|
140
|
+
throw new Error(response.error?.message || 'Failed to update basket metadata');
|
|
144
141
|
}
|
|
145
142
|
/**
|
|
146
143
|
* Creates an order from a basket
|
|
@@ -154,12 +151,10 @@ export default class BasketApi extends HttpClient {
|
|
|
154
151
|
Authorization: `Bearer ${this.apiKey}`,
|
|
155
152
|
});
|
|
156
153
|
if (response.success && response.data) {
|
|
157
|
-
//create order api instance
|
|
158
154
|
const orderApi = new OrderApi(this.baseUrl, this.apiKey, this.agentId);
|
|
159
|
-
|
|
160
|
-
return orderInstance;
|
|
155
|
+
return new OrderInstance(orderApi, response.data);
|
|
161
156
|
}
|
|
162
|
-
throw new Error(response.message || 'Failed to create order');
|
|
157
|
+
throw new Error(response.error?.message || 'Failed to create order');
|
|
163
158
|
}
|
|
164
159
|
}
|
|
165
160
|
//# sourceMappingURL=basket.api.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basket.api.service.js","sourceRoot":"","sources":["../../src/api/basket.api.service.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"basket.api.service.js","sourceRoot":"","sources":["../../src/api/basket.api.service.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAI3D,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAU;IAI/C;;;;;OAKG;IACH,YAAY,OAAe,EAAE,MAAc,EAAE,OAAe;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CAAC,UAA+B;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAS,qBAAqB,IAAI,CAAC,OAAO,SAAS,EAAE,UAAU,EAAE;YACnG,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;SACvC,CAAC,CAAC;QACH,IAAG,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YACrC,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,yBAAyB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AI,QAAQ,CAAC,IAAI,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACvE,OAAO,IAAI,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,wBAAwB,CAAC,CAAC;IACvE,CAAC;CAEF"}
|
|
@@ -9,6 +9,8 @@ export default class CdnApi implements CdnAPI {
|
|
|
9
9
|
constructor(baseUrl: string, apiKey: string);
|
|
10
10
|
/**
|
|
11
11
|
* Uploads a file to the CDN
|
|
12
|
+
* @param file - The file to upload
|
|
13
|
+
* @returns Promise resolving to the file ID
|
|
12
14
|
*/
|
|
13
15
|
upload(file: File): Promise<string>;
|
|
14
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdn.api.service.js","sourceRoot":"","sources":["../../src/api/cdn.api.service.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"cdn.api.service.js","sourceRoot":"","sources":["../../src/api/cdn.api.service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,CAAC,OAAO,OAAO,MAAM;IAIzB,YAAY,OAAe,EAAE,MAAc;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,IAAU;QACrB,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC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C,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatResponse } from "../interfaces/chat.js";
|
|
2
|
-
import { HttpClient } from "
|
|
2
|
+
import { HttpClient } from "./http.client.js";
|
|
3
3
|
import { ApiResponse } from "../interfaces/common.js";
|
|
4
4
|
import { ChatRequest } from "../interfaces/chat.js";
|
|
5
5
|
export default class ChatApi extends HttpClient {
|
|
@@ -26,5 +26,13 @@ export default class ChatApi extends HttpClient {
|
|
|
26
26
|
* @param onPostprocessComplete - Optional callback for when post-processing completes (receives modified response)
|
|
27
27
|
* @returns Promise resolving when stream completes
|
|
28
28
|
*/
|
|
29
|
-
sendMessageStream(agentId: string, chatData: ChatRequest, onChunk: (text: string) => void, onPostprocessComplete?: (originalResponse: string, modifiedResponse: string) => void): Promise<void>;
|
|
29
|
+
sendMessageStream(agentId: string, chatData: ChatRequest, onChunk: (text: string) => void, onPostprocessComplete?: (originalResponse: string, modifiedResponse: string) => void, onPreprocessorBlocked?: (message: string) => void): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Clears conversation history for an agent
|
|
32
|
+
* @param agentId - The unique identifier of the agent
|
|
33
|
+
* @param targetIdentifier - Optional user identifier to clear history for specific user
|
|
34
|
+
* @returns Promise resolving to an ApiResponse with confirmation
|
|
35
|
+
* @throws Error if the agent is not found or the clear operation fails
|
|
36
|
+
*/
|
|
37
|
+
clearHistory(agentId: string, targetIdentifier?: string): Promise<ApiResponse<void>>;
|
|
30
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpClient } from "
|
|
1
|
+
import { HttpClient } from "./http.client.js";
|
|
2
2
|
export default class ChatApi extends HttpClient {
|
|
3
3
|
/**
|
|
4
4
|
* Creates an instance of ChatApi
|
|
@@ -29,7 +29,7 @@ export default class ChatApi extends HttpClient {
|
|
|
29
29
|
* @param onPostprocessComplete - Optional callback for when post-processing completes (receives modified response)
|
|
30
30
|
* @returns Promise resolving when stream completes
|
|
31
31
|
*/
|
|
32
|
-
async sendMessageStream(agentId, chatData, onChunk, onPostprocessComplete) {
|
|
32
|
+
async sendMessageStream(agentId, chatData, onChunk, onPostprocessComplete, onPreprocessorBlocked) {
|
|
33
33
|
const response = await fetch(`${this.baseUrl}/chat/stream/${agentId}?channel=dev`, {
|
|
34
34
|
method: 'POST',
|
|
35
35
|
headers: {
|
|
@@ -70,6 +70,10 @@ export default class ChatApi extends HttpClient {
|
|
|
70
70
|
else if (chunk.type === 'postprocess-complete' && onPostprocessComplete) {
|
|
71
71
|
onPostprocessComplete(chunk.originalResponse, chunk.modifiedResponse);
|
|
72
72
|
}
|
|
73
|
+
// Process preprocessor-blocked event (emitted when a preprocessor blocks the message)
|
|
74
|
+
else if (chunk.type === 'preprocessor_blocked' && onPreprocessorBlocked) {
|
|
75
|
+
onPreprocessorBlocked(chunk.message || 'Message was blocked by a preprocessor.');
|
|
76
|
+
}
|
|
73
77
|
}
|
|
74
78
|
catch (error) {
|
|
75
79
|
// Skip invalid JSON lines
|
|
@@ -81,5 +85,20 @@ export default class ChatApi extends HttpClient {
|
|
|
81
85
|
reader.releaseLock();
|
|
82
86
|
}
|
|
83
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Clears conversation history for an agent
|
|
90
|
+
* @param agentId - The unique identifier of the agent
|
|
91
|
+
* @param targetIdentifier - Optional user identifier to clear history for specific user
|
|
92
|
+
* @returns Promise resolving to an ApiResponse with confirmation
|
|
93
|
+
* @throws Error if the agent is not found or the clear operation fails
|
|
94
|
+
*/
|
|
95
|
+
async clearHistory(agentId, targetIdentifier) {
|
|
96
|
+
const url = targetIdentifier
|
|
97
|
+
? `/chat/history/${agentId}?targetIdentifier=${encodeURIComponent(targetIdentifier)}`
|
|
98
|
+
: `/chat/history/${agentId}`;
|
|
99
|
+
return this.httpDelete(url, {
|
|
100
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
84
103
|
}
|
|
85
104
|
//# sourceMappingURL=chat.api.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.api.service.js","sourceRoot":"","sources":["../../src/api/chat.api.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"chat.api.service.js","sourceRoot":"","sources":["../../src/api/chat.api.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,UAAU;IAG7C;;;;OAIG;IACH,YAAY,OAAe,EAAE,MAAc;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,QAAqB;QACtD,OAAO,IAAI,CAAC,QAAQ,CAAe,kBAAkB,OAAO,cAAc,EAAE,QAAQ,EAAE;YACpF,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;SACvC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,iBAAiB,CACrB,OAAe,EACf,QAAqB,EACrB,OAA+B,EAC/B,qBAAoF,EACpF,qBAAiD;QAEjD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,gBAAgB,OAAO,cAAc,EAAE;YACjF,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;gBACxC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;SAC/B,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ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,IAAI,qBAAqB,EAAE,CAAC;4BACxE,qBAAqB,CAAC,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;wBACxE,CAAC;wBACD,sFAAsF;6BACjF,IAAI,KAAK,CAAC,IAAI,KAAK,sBAAsB,IAAI,qBAAqB,EAAE,CAAC;4BACxE,qBAAqB,CAAC,KAAK,CAAC,OAAO,IAAI,wCAAwC,CAAC,CAAC;wBACnF,CAAC;oBACH,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,0BAA0B;oBAC5B,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,CAAC,OAAe,EAAE,gBAAyB;QAC3D,MAAM,GAAG,GAAG,gBAAgB;YAC1B,CAAC,CAAC,iBAAiB,OAAO,qBAAqB,kBAAkB,CAAC,gBAAgB,CAAC,EAAE;YACrF,CAAC,CAAC,iBAAiB,OAAO,EAAE,CAAC;QAE/B,OAAO,IAAI,CAAC,UAAU,CAAO,GAAG,EAAE;YAChC,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;SACvC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/api/credentials.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* API Credentials Management
|
|
3
3
|
* Handles loading and caching of API credentials for skill execution
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { requireAuth } from "../utils/command-utils.js";
|
|
6
|
+
import { readYamlConfig } from "../utils/files.js";
|
|
7
7
|
/**
|
|
8
8
|
* Cached credentials to avoid repeated file/keychain access
|
|
9
9
|
*/
|
|
@@ -20,13 +20,10 @@ export async function getCredentials() {
|
|
|
20
20
|
if (cachedCredentials) {
|
|
21
21
|
return cachedCredentials;
|
|
22
22
|
}
|
|
23
|
-
// Load API key from keystore
|
|
24
|
-
const apiKey = await
|
|
25
|
-
if (!apiKey) {
|
|
26
|
-
throw new Error('No API key found. Please run "lua auth configure" first.');
|
|
27
|
-
}
|
|
23
|
+
// Load and validate API key from keystore
|
|
24
|
+
const apiKey = await requireAuth();
|
|
28
25
|
// Load agent ID from YAML file
|
|
29
|
-
const config =
|
|
26
|
+
const config = readYamlConfig();
|
|
30
27
|
if (!config?.agent?.agentId) {
|
|
31
28
|
throw new Error('No agent ID found in lua.skill.yaml. Please run "lua init" first.');
|
|
32
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/api/credentials.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/api/credentials.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUnD;;GAEG;AACH,IAAI,iBAAiB,GAA0B,IAAI,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,yCAAyC;IACzC,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,0CAA0C;IAC1C,MAAM,MAAM,GAAG,MAAM,WAAW,EAAE,CAAC;IAEnC,+BAA+B;IAC/B,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;IAED,+BAA+B;IAC/B,iBAAiB,GAAG;QAClB,MAAM;QACN,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;KAC9B,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,iBAAiB,GAAG,IAAI,CAAC;AAC3B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HttpClient } from "
|
|
1
|
+
import { HttpClient } from "./http.client.js";
|
|
2
2
|
import { CustomDataAPI } from "../types/index.js";
|
|
3
3
|
import { GetCustomDataResponse, UpdateCustomDataResponse, DeleteCustomDataResponse } from "../interfaces/custom.data.js";
|
|
4
|
-
import DataEntryInstance from "../
|
|
4
|
+
import DataEntryInstance from "../instances/data.entry.instance.js";
|
|
5
5
|
export default class CustomDataApi extends HttpClient implements CustomDataAPI {
|
|
6
6
|
private apiKey;
|
|
7
7
|
private agentId;
|
|
@@ -30,7 +30,7 @@ export default class CustomDataApi extends HttpClient implements CustomDataAPI {
|
|
|
30
30
|
* @returns Promise resolving to a GetCustomDataResponse containing the entries and pagination info
|
|
31
31
|
* @throws Error if the query fails or the API request is unsuccessful
|
|
32
32
|
*/
|
|
33
|
-
get(collectionName: string, filter?:
|
|
33
|
+
get(collectionName: string, filter?: Record<string, any>, page?: number, limit?: number): Promise<GetCustomDataResponse>;
|
|
34
34
|
/**
|
|
35
35
|
* Retrieves a single custom data entry by its ID
|
|
36
36
|
* @param collectionName - The name of the collection containing the entry
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HttpClient } from "
|
|
2
|
-
import DataEntryInstance from "../
|
|
1
|
+
import { HttpClient } from "./http.client.js";
|
|
2
|
+
import DataEntryInstance from "../instances/data.entry.instance.js";
|
|
3
3
|
// Custom Data API calls
|
|
4
4
|
export default class CustomDataApi extends HttpClient {
|
|
5
5
|
/**
|
|
@@ -25,7 +25,7 @@ export default class CustomDataApi extends HttpClient {
|
|
|
25
25
|
const response = await this.httpPost(`/developer/agents/${this.agentId}/custom-data/${collectionName}`, { data, searchText }, {
|
|
26
26
|
Authorization: `Bearer ${this.apiKey}`,
|
|
27
27
|
});
|
|
28
|
-
if (response.success) {
|
|
28
|
+
if (response.success && response.data) {
|
|
29
29
|
return new DataEntryInstance(this, response.data, collectionName);
|
|
30
30
|
}
|
|
31
31
|
throw new Error(response.error?.message || 'Failed to create custom data entry');
|
|
@@ -48,7 +48,7 @@ export default class CustomDataApi extends HttpClient {
|
|
|
48
48
|
const response = await this.httpGet(url, {
|
|
49
49
|
Authorization: `Bearer ${this.apiKey}`,
|
|
50
50
|
});
|
|
51
|
-
if (response.success) {
|
|
51
|
+
if (response.success && response.data) {
|
|
52
52
|
return response.data;
|
|
53
53
|
}
|
|
54
54
|
throw new Error(response.error?.message || 'Failed to get custom data entries');
|
|
@@ -64,7 +64,7 @@ export default class CustomDataApi extends HttpClient {
|
|
|
64
64
|
const response = await this.httpGet(`/developer/agents/${this.agentId}/custom-data/${collectionName}/${entryId}`, {
|
|
65
65
|
Authorization: `Bearer ${this.apiKey}`,
|
|
66
66
|
});
|
|
67
|
-
if (response.success) {
|
|
67
|
+
if (response.success && response.data) {
|
|
68
68
|
return new DataEntryInstance(this, response.data, collectionName);
|
|
69
69
|
}
|
|
70
70
|
throw new Error(response.error?.message || 'Failed to get custom data entry');
|
|
@@ -82,7 +82,7 @@ export default class CustomDataApi extends HttpClient {
|
|
|
82
82
|
const response = await this.httpPut(`/developer/agents/${this.agentId}/custom-data/${collectionName}/${entryId}`, { data, searchText }, {
|
|
83
83
|
Authorization: `Bearer ${this.apiKey}`,
|
|
84
84
|
});
|
|
85
|
-
if (response.success) {
|
|
85
|
+
if (response.success && response.data) {
|
|
86
86
|
return response.data;
|
|
87
87
|
}
|
|
88
88
|
throw new Error(response.error?.message || 'Failed to update custom data entry');
|
|
@@ -101,9 +101,8 @@ export default class CustomDataApi extends HttpClient {
|
|
|
101
101
|
const response = await this.httpGet(url, {
|
|
102
102
|
Authorization: `Bearer ${this.apiKey}`,
|
|
103
103
|
});
|
|
104
|
-
if (response.success) {
|
|
105
|
-
|
|
106
|
-
return entries.map((entry) => new DataEntryInstance(this, entry, collectionName)) || [];
|
|
104
|
+
if (response.success && response.data) {
|
|
105
|
+
return response.data.data.map((entry) => new DataEntryInstance(this, entry, collectionName));
|
|
107
106
|
}
|
|
108
107
|
throw new Error(response.error?.message || 'Failed to search custom data entries');
|
|
109
108
|
}
|
|
@@ -118,7 +117,7 @@ export default class CustomDataApi extends HttpClient {
|
|
|
118
117
|
const response = await this.httpDelete(`/developer/agents/${this.agentId}/custom-data/${collectionName}/${entryId}`, {
|
|
119
118
|
Authorization: `Bearer ${this.apiKey}`,
|
|
120
119
|
});
|
|
121
|
-
if (response.success) {
|
|
120
|
+
if (response.success && response.data) {
|
|
122
121
|
return response.data;
|
|
123
122
|
}
|
|
124
123
|
throw new Error(response.error?.message || 'Failed to delete custom data entry');
|