lua-cli 3.15.3 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-exports.d.ts +5029 -698
- package/dist/api-exports.js +6509 -772
- package/dist/api-exports.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +41174 -82
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +1217 -0
- package/dist/voice/test/index.js +386 -0
- package/dist/voice/test/index.js.map +1 -0
- package/dist/voice-exports.d.ts +40 -0
- package/dist/voice-exports.js +16 -0
- package/dist/voice-exports.js.map +1 -0
- package/docs/README.md +1 -1
- package/package.json +38 -21
- package/scripts/build-vendor.mjs +6 -3
- package/scripts/run-api-extractor.mjs +79 -0
- package/template/.gitignore +21 -0
- package/template/package.json +1 -1
- package/dist/api/agent.api.service.d.ts +0 -165
- package/dist/api/agent.api.service.d.ts.map +0 -1
- package/dist/api/agent.api.service.js +0 -207
- package/dist/api/agent.api.service.js.map +0 -1
- package/dist/api/agents.api.service.d.ts +0 -21
- package/dist/api/agents.api.service.d.ts.map +0 -1
- package/dist/api/agents.api.service.js +0 -51
- package/dist/api/agents.api.service.js.map +0 -1
- package/dist/api/ai.api.service.d.ts +0 -20
- package/dist/api/ai.api.service.d.ts.map +0 -1
- package/dist/api/ai.api.service.js +0 -40
- package/dist/api/ai.api.service.js.map +0 -1
- package/dist/api/auth.api.service.d.ts +0 -49
- package/dist/api/auth.api.service.d.ts.map +0 -1
- package/dist/api/auth.api.service.js +0 -55
- package/dist/api/auth.api.service.js.map +0 -1
- package/dist/api/backup.api.service.d.ts +0 -78
- package/dist/api/backup.api.service.d.ts.map +0 -1
- package/dist/api/backup.api.service.js +0 -115
- package/dist/api/backup.api.service.js.map +0 -1
- package/dist/api/basket.api.service.d.ts +0 -85
- package/dist/api/basket.api.service.d.ts.map +0 -1
- package/dist/api/basket.api.service.js +0 -160
- package/dist/api/basket.api.service.js.map +0 -1
- package/dist/api/cdn.api.service.d.ts +0 -21
- package/dist/api/cdn.api.service.d.ts.map +0 -1
- package/dist/api/cdn.api.service.js +0 -46
- package/dist/api/cdn.api.service.js.map +0 -1
- package/dist/api/chat.api.service.d.ts +0 -40
- package/dist/api/chat.api.service.d.ts.map +0 -1
- package/dist/api/chat.api.service.js +0 -121
- package/dist/api/chat.api.service.js.map +0 -1
- package/dist/api/credentials.d.ts +0 -25
- package/dist/api/credentials.d.ts.map +0 -1
- package/dist/api/credentials.js +0 -44
- package/dist/api/credentials.js.map +0 -1
- package/dist/api/custom.data.api.service.d.ts +0 -71
- package/dist/api/custom.data.api.service.d.ts.map +0 -1
- package/dist/api/custom.data.api.service.js +0 -126
- package/dist/api/custom.data.api.service.js.map +0 -1
- package/dist/api/developer.api.service.d.ts +0 -121
- package/dist/api/developer.api.service.d.ts.map +0 -1
- package/dist/api/developer.api.service.js +0 -162
- package/dist/api/developer.api.service.js.map +0 -1
- package/dist/api/device-trigger.api.service.d.ts +0 -136
- package/dist/api/device-trigger.api.service.d.ts.map +0 -1
- package/dist/api/device-trigger.api.service.js +0 -120
- package/dist/api/device-trigger.api.service.js.map +0 -1
- package/dist/api/device.api.service.d.ts +0 -61
- package/dist/api/device.api.service.d.ts.map +0 -1
- package/dist/api/device.api.service.js +0 -72
- package/dist/api/device.api.service.js.map +0 -1
- package/dist/api/http.client.d.ts +0 -90
- package/dist/api/http.client.d.ts.map +0 -1
- package/dist/api/http.client.js +0 -265
- package/dist/api/http.client.js.map +0 -1
- package/dist/api/job.api.service.d.ts +0 -154
- package/dist/api/job.api.service.d.ts.map +0 -1
- package/dist/api/job.api.service.js +0 -230
- package/dist/api/job.api.service.js.map +0 -1
- package/dist/api/lazy-instances.d.ts +0 -107
- package/dist/api/lazy-instances.d.ts.map +0 -1
- package/dist/api/lazy-instances.js +0 -220
- package/dist/api/lazy-instances.js.map +0 -1
- package/dist/api/logs.api.service.d.ts +0 -38
- package/dist/api/logs.api.service.d.ts.map +0 -1
- package/dist/api/logs.api.service.js +0 -50
- package/dist/api/logs.api.service.js.map +0 -1
- package/dist/api/marketplace.api.service.d.ts +0 -28
- package/dist/api/marketplace.api.service.d.ts.map +0 -1
- package/dist/api/marketplace.api.service.js +0 -112
- package/dist/api/marketplace.api.service.js.map +0 -1
- package/dist/api/order.api.service.d.ts +0 -53
- package/dist/api/order.api.service.d.ts.map +0 -1
- package/dist/api/order.api.service.js +0 -94
- package/dist/api/order.api.service.js.map +0 -1
- package/dist/api/persona.api.service.d.ts +0 -56
- package/dist/api/persona.api.service.d.ts.map +0 -1
- package/dist/api/persona.api.service.js +0 -90
- package/dist/api/persona.api.service.js.map +0 -1
- package/dist/api/postprocessor.api.service.d.ts +0 -151
- package/dist/api/postprocessor.api.service.d.ts.map +0 -1
- package/dist/api/postprocessor.api.service.js +0 -109
- package/dist/api/postprocessor.api.service.js.map +0 -1
- package/dist/api/preprocessor.api.service.d.ts +0 -155
- package/dist/api/preprocessor.api.service.d.ts.map +0 -1
- package/dist/api/preprocessor.api.service.js +0 -111
- package/dist/api/preprocessor.api.service.js.map +0 -1
- package/dist/api/products.api.service.d.ts +0 -80
- package/dist/api/products.api.service.d.ts.map +0 -1
- package/dist/api/products.api.service.js +0 -126
- package/dist/api/products.api.service.js.map +0 -1
- package/dist/api/resource.api.service.d.ts +0 -77
- package/dist/api/resource.api.service.d.ts.map +0 -1
- package/dist/api/resource.api.service.js +0 -74
- package/dist/api/resource.api.service.js.map +0 -1
- package/dist/api/skills.api.service.d.ts +0 -94
- package/dist/api/skills.api.service.d.ts.map +0 -1
- package/dist/api/skills.api.service.js +0 -120
- package/dist/api/skills.api.service.js.map +0 -1
- package/dist/api/tool.api.service.d.ts +0 -53
- package/dist/api/tool.api.service.d.ts.map +0 -1
- package/dist/api/tool.api.service.js +0 -74
- package/dist/api/tool.api.service.js.map +0 -1
- package/dist/api/unifiedto.api.service.d.ts +0 -133
- package/dist/api/unifiedto.api.service.d.ts.map +0 -1
- package/dist/api/unifiedto.api.service.js +0 -166
- package/dist/api/unifiedto.api.service.js.map +0 -1
- package/dist/api/user.data.api.service.d.ts +0 -69
- package/dist/api/user.data.api.service.d.ts.map +0 -1
- package/dist/api/user.data.api.service.js +0 -158
- package/dist/api/user.data.api.service.js.map +0 -1
- package/dist/api/webhook.api.service.d.ts +0 -163
- package/dist/api/webhook.api.service.d.ts.map +0 -1
- package/dist/api/webhook.api.service.js +0 -140
- package/dist/api/webhook.api.service.js.map +0 -1
- package/dist/api/whatsapp-templates.api.service.d.ts +0 -41
- package/dist/api/whatsapp-templates.api.service.d.ts.map +0 -1
- package/dist/api/whatsapp-templates.api.service.js +0 -79
- package/dist/api/whatsapp-templates.api.service.js.map +0 -1
- package/dist/api-exports.d.ts.map +0 -1
- package/dist/cli/command-definitions.d.ts +0 -29
- package/dist/cli/command-definitions.d.ts.map +0 -1
- package/dist/cli/command-definitions.js +0 -943
- package/dist/cli/command-definitions.js.map +0 -1
- package/dist/commands/admin.d.ts +0 -24
- package/dist/commands/admin.d.ts.map +0 -1
- package/dist/commands/admin.js +0 -44
- package/dist/commands/admin.js.map +0 -1
- package/dist/commands/agents.d.ts +0 -23
- package/dist/commands/agents.d.ts.map +0 -1
- package/dist/commands/agents.js +0 -83
- package/dist/commands/agents.js.map +0 -1
- package/dist/commands/apiKey.d.ts +0 -8
- package/dist/commands/apiKey.d.ts.map +0 -1
- package/dist/commands/apiKey.js +0 -43
- package/dist/commands/apiKey.js.map +0 -1
- package/dist/commands/channels.d.ts +0 -13
- package/dist/commands/channels.d.ts.map +0 -1
- package/dist/commands/channels.js +0 -747
- package/dist/commands/channels.js.map +0 -1
- package/dist/commands/chat-log-probe.d.ts +0 -59
- package/dist/commands/chat-log-probe.d.ts.map +0 -1
- package/dist/commands/chat-log-probe.js +0 -87
- package/dist/commands/chat-log-probe.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -20
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -618
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/chatClear.d.ts +0 -25
- package/dist/commands/chatClear.d.ts.map +0 -1
- package/dist/commands/chatClear.js +0 -71
- package/dist/commands/chatClear.js.map +0 -1
- package/dist/commands/compile.d.ts +0 -48
- package/dist/commands/compile.d.ts.map +0 -1
- package/dist/commands/compile.js +0 -216
- package/dist/commands/compile.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -12
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js +0 -211
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/configure.d.ts +0 -42
- package/dist/commands/configure.d.ts.map +0 -1
- package/dist/commands/configure.js +0 -76
- package/dist/commands/configure.js.map +0 -1
- package/dist/commands/deploy.d.ts +0 -14
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deploy.js +0 -517
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/destroy.d.ts +0 -8
- package/dist/commands/destroy.d.ts.map +0 -1
- package/dist/commands/destroy.js +0 -66
- package/dist/commands/destroy.js.map +0 -1
- package/dist/commands/devices.d.ts +0 -6
- package/dist/commands/devices.d.ts.map +0 -1
- package/dist/commands/devices.js +0 -265
- package/dist/commands/devices.js.map +0 -1
- package/dist/commands/docs.d.ts +0 -20
- package/dist/commands/docs.d.ts.map +0 -1
- package/dist/commands/docs.js +0 -33
- package/dist/commands/docs.js.map +0 -1
- package/dist/commands/env.d.ts +0 -34
- package/dist/commands/env.d.ts.map +0 -1
- package/dist/commands/env.js +0 -612
- package/dist/commands/env.js.map +0 -1
- package/dist/commands/evals.d.ts +0 -9
- package/dist/commands/evals.d.ts.map +0 -1
- package/dist/commands/evals.js +0 -27
- package/dist/commands/evals.js.map +0 -1
- package/dist/commands/features.d.ts +0 -13
- package/dist/commands/features.d.ts.map +0 -1
- package/dist/commands/features.js +0 -455
- package/dist/commands/features.js.map +0 -1
- package/dist/commands/governance.d.ts +0 -7
- package/dist/commands/governance.d.ts.map +0 -1
- package/dist/commands/governance.js +0 -258
- package/dist/commands/governance.js.map +0 -1
- package/dist/commands/index.d.ts +0 -38
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -38
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/init.d.ts +0 -53
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -992
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/integrations.d.ts +0 -18
- package/dist/commands/integrations.d.ts.map +0 -1
- package/dist/commands/integrations.js +0 -2666
- package/dist/commands/integrations.js.map +0 -1
- package/dist/commands/jobs.d.ts +0 -13
- package/dist/commands/jobs.d.ts.map +0 -1
- package/dist/commands/jobs.js +0 -736
- package/dist/commands/jobs.js.map +0 -1
- package/dist/commands/log-tip.d.ts +0 -79
- package/dist/commands/log-tip.d.ts.map +0 -1
- package/dist/commands/log-tip.js +0 -83
- package/dist/commands/log-tip.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -13
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -493
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/marketplace.d.ts +0 -34
- package/dist/commands/marketplace.d.ts.map +0 -1
- package/dist/commands/marketplace.js +0 -2105
- package/dist/commands/marketplace.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -32
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -395
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/models.d.ts +0 -18
- package/dist/commands/models.d.ts.map +0 -1
- package/dist/commands/models.js +0 -207
- package/dist/commands/models.js.map +0 -1
- package/dist/commands/persona.d.ts +0 -13
- package/dist/commands/persona.d.ts.map +0 -1
- package/dist/commands/persona.js +0 -560
- package/dist/commands/persona.js.map +0 -1
- package/dist/commands/postprocessors.d.ts +0 -13
- package/dist/commands/postprocessors.d.ts.map +0 -1
- package/dist/commands/postprocessors.js +0 -558
- package/dist/commands/postprocessors.js.map +0 -1
- package/dist/commands/preprocessors.d.ts +0 -13
- package/dist/commands/preprocessors.d.ts.map +0 -1
- package/dist/commands/preprocessors.js +0 -558
- package/dist/commands/preprocessors.js.map +0 -1
- package/dist/commands/production.d.ts +0 -13
- package/dist/commands/production.d.ts.map +0 -1
- package/dist/commands/production.js +0 -588
- package/dist/commands/production.js.map +0 -1
- package/dist/commands/push-helpers.d.ts +0 -42
- package/dist/commands/push-helpers.d.ts.map +0 -1
- package/dist/commands/push-helpers.js +0 -48
- package/dist/commands/push-helpers.js.map +0 -1
- package/dist/commands/push.d.ts +0 -31
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -1262
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/pushBackup.d.ts +0 -78
- package/dist/commands/pushBackup.d.ts.map +0 -1
- package/dist/commands/pushBackup.js +0 -274
- package/dist/commands/pushBackup.js.map +0 -1
- package/dist/commands/resources.d.ts +0 -13
- package/dist/commands/resources.d.ts.map +0 -1
- package/dist/commands/resources.js +0 -377
- package/dist/commands/resources.js.map +0 -1
- package/dist/commands/skills.d.ts +0 -13
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js +0 -618
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/source.d.ts +0 -72
- package/dist/commands/source.d.ts.map +0 -1
- package/dist/commands/source.js +0 -134
- package/dist/commands/source.js.map +0 -1
- package/dist/commands/status.d.ts +0 -14
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -731
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -28
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js +0 -802
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/telemetry.d.ts +0 -6
- package/dist/commands/telemetry.d.ts.map +0 -1
- package/dist/commands/telemetry.js +0 -42
- package/dist/commands/telemetry.js.map +0 -1
- package/dist/commands/test-output.helpers.d.ts +0 -24
- package/dist/commands/test-output.helpers.d.ts.map +0 -1
- package/dist/commands/test-output.helpers.js +0 -62
- package/dist/commands/test-output.helpers.js.map +0 -1
- package/dist/commands/test.d.ts +0 -9
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -787
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/update.d.ts +0 -14
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -97
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/webhooks.d.ts +0 -13
- package/dist/commands/webhooks.d.ts.map +0 -1
- package/dist/commands/webhooks.js +0 -691
- package/dist/commands/webhooks.js.map +0 -1
- package/dist/compiler/agent-traverser.d.ts +0 -140
- package/dist/compiler/agent-traverser.d.ts.map +0 -1
- package/dist/compiler/agent-traverser.js +0 -420
- package/dist/compiler/agent-traverser.js.map +0 -1
- package/dist/compiler/bundler.d.ts +0 -43
- package/dist/compiler/bundler.d.ts.map +0 -1
- package/dist/compiler/bundler.js +0 -188
- package/dist/compiler/bundler.js.map +0 -1
- package/dist/compiler/compiler.d.ts +0 -208
- package/dist/compiler/compiler.d.ts.map +0 -1
- package/dist/compiler/compiler.js +0 -706
- package/dist/compiler/compiler.js.map +0 -1
- package/dist/compiler/index.d.ts +0 -38
- package/dist/compiler/index.d.ts.map +0 -1
- package/dist/compiler/index.js +0 -43
- package/dist/compiler/index.js.map +0 -1
- package/dist/compiler/plugins/agent.plugin.d.ts +0 -58
- package/dist/compiler/plugins/agent.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/agent.plugin.js +0 -161
- package/dist/compiler/plugins/agent.plugin.js.map +0 -1
- package/dist/compiler/plugins/base.d.ts +0 -334
- package/dist/compiler/plugins/base.d.ts.map +0 -1
- package/dist/compiler/plugins/base.js +0 -353
- package/dist/compiler/plugins/base.js.map +0 -1
- package/dist/compiler/plugins/device-trigger.plugin.d.ts +0 -38
- package/dist/compiler/plugins/device-trigger.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/device-trigger.plugin.js +0 -107
- package/dist/compiler/plugins/device-trigger.plugin.js.map +0 -1
- package/dist/compiler/plugins/device.plugin.d.ts +0 -39
- package/dist/compiler/plugins/device.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/device.plugin.js +0 -77
- package/dist/compiler/plugins/device.plugin.js.map +0 -1
- package/dist/compiler/plugins/job.plugin.d.ts +0 -34
- package/dist/compiler/plugins/job.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/job.plugin.js +0 -108
- package/dist/compiler/plugins/job.plugin.js.map +0 -1
- package/dist/compiler/plugins/mcp-server.plugin.d.ts +0 -38
- package/dist/compiler/plugins/mcp-server.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/mcp-server.plugin.js +0 -107
- package/dist/compiler/plugins/mcp-server.plugin.js.map +0 -1
- package/dist/compiler/plugins/postprocessor.plugin.d.ts +0 -21
- package/dist/compiler/plugins/postprocessor.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/postprocessor.plugin.js +0 -36
- package/dist/compiler/plugins/postprocessor.plugin.js.map +0 -1
- package/dist/compiler/plugins/preprocessor.plugin.d.ts +0 -21
- package/dist/compiler/plugins/preprocessor.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/preprocessor.plugin.js +0 -38
- package/dist/compiler/plugins/preprocessor.plugin.js.map +0 -1
- package/dist/compiler/plugins/processor-base.d.ts +0 -17
- package/dist/compiler/plugins/processor-base.d.ts.map +0 -1
- package/dist/compiler/plugins/processor-base.js +0 -27
- package/dist/compiler/plugins/processor-base.js.map +0 -1
- package/dist/compiler/plugins/registry.d.ts +0 -62
- package/dist/compiler/plugins/registry.d.ts.map +0 -1
- package/dist/compiler/plugins/registry.js +0 -113
- package/dist/compiler/plugins/registry.js.map +0 -1
- package/dist/compiler/plugins/skill.plugin.d.ts +0 -106
- package/dist/compiler/plugins/skill.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/skill.plugin.js +0 -316
- package/dist/compiler/plugins/skill.plugin.js.map +0 -1
- package/dist/compiler/plugins/tool.plugin.d.ts +0 -69
- package/dist/compiler/plugins/tool.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/tool.plugin.js +0 -262
- package/dist/compiler/plugins/tool.plugin.js.map +0 -1
- package/dist/compiler/plugins/webhook.plugin.d.ts +0 -38
- package/dist/compiler/plugins/webhook.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/webhook.plugin.js +0 -117
- package/dist/compiler/plugins/webhook.plugin.js.map +0 -1
- package/dist/compiler/source-writer.d.ts +0 -129
- package/dist/compiler/source-writer.d.ts.map +0 -1
- package/dist/compiler/source-writer.js +0 -329
- package/dist/compiler/source-writer.js.map +0 -1
- package/dist/compiler/types.d.ts +0 -391
- package/dist/compiler/types.d.ts.map +0 -1
- package/dist/compiler/types.js +0 -30
- package/dist/compiler/types.js.map +0 -1
- package/dist/compiler/utils/ast-helpers.d.ts +0 -106
- package/dist/compiler/utils/ast-helpers.d.ts.map +0 -1
- package/dist/compiler/utils/ast-helpers.js +0 -356
- package/dist/compiler/utils/ast-helpers.js.map +0 -1
- package/dist/compiler/utils/common.d.ts +0 -22
- package/dist/compiler/utils/common.d.ts.map +0 -1
- package/dist/compiler/utils/common.js +0 -55
- package/dist/compiler/utils/common.js.map +0 -1
- package/dist/compiler/utils/file-discovery.d.ts +0 -35
- package/dist/compiler/utils/file-discovery.d.ts.map +0 -1
- package/dist/compiler/utils/file-discovery.js +0 -60
- package/dist/compiler/utils/file-discovery.js.map +0 -1
- package/dist/compiler/utils/path-resolver.d.ts +0 -83
- package/dist/compiler/utils/path-resolver.d.ts.map +0 -1
- package/dist/compiler/utils/path-resolver.js +0 -162
- package/dist/compiler/utils/path-resolver.js.map +0 -1
- package/dist/compiler/utils/reference-resolver.d.ts +0 -196
- package/dist/compiler/utils/reference-resolver.d.ts.map +0 -1
- package/dist/compiler/utils/reference-resolver.js +0 -1026
- package/dist/compiler/utils/reference-resolver.js.map +0 -1
- package/dist/compiler/utils/schema-converter.d.ts +0 -52
- package/dist/compiler/utils/schema-converter.d.ts.map +0 -1
- package/dist/compiler/utils/schema-converter.js +0 -170
- package/dist/compiler/utils/schema-converter.js.map +0 -1
- package/dist/compiler/utils/workspace.d.ts +0 -35
- package/dist/compiler/utils/workspace.d.ts.map +0 -1
- package/dist/compiler/utils/workspace.js +0 -121
- package/dist/compiler/utils/workspace.js.map +0 -1
- package/dist/config/compile.constants.d.ts +0 -75
- package/dist/config/compile.constants.d.ts.map +0 -1
- package/dist/config/compile.constants.js +0 -95
- package/dist/config/compile.constants.js.map +0 -1
- package/dist/config/constants.d.ts +0 -49
- package/dist/config/constants.d.ts.map +0 -1
- package/dist/config/constants.js +0 -69
- package/dist/config/constants.js.map +0 -1
- package/dist/errors/auth.error.d.ts +0 -34
- package/dist/errors/auth.error.d.ts.map +0 -1
- package/dist/errors/auth.error.js +0 -29
- package/dist/errors/auth.error.js.map +0 -1
- package/dist/errors/index.d.ts +0 -5
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js +0 -5
- package/dist/errors/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/instances/basket.instance.d.ts +0 -82
- package/dist/instances/basket.instance.d.ts.map +0 -1
- package/dist/instances/basket.instance.js +0 -245
- package/dist/instances/basket.instance.js.map +0 -1
- package/dist/instances/data.entry.instance.d.ts +0 -50
- package/dist/instances/data.entry.instance.d.ts.map +0 -1
- package/dist/instances/data.entry.instance.js +0 -163
- package/dist/instances/data.entry.instance.js.map +0 -1
- package/dist/instances/job.instance.d.ts +0 -133
- package/dist/instances/job.instance.d.ts.map +0 -1
- package/dist/instances/job.instance.js +0 -180
- package/dist/instances/job.instance.js.map +0 -1
- package/dist/instances/order.instance.d.ts +0 -50
- package/dist/instances/order.instance.d.ts.map +0 -1
- package/dist/instances/order.instance.js +0 -199
- package/dist/instances/order.instance.js.map +0 -1
- package/dist/instances/product.instance.d.ts +0 -43
- package/dist/instances/product.instance.d.ts.map +0 -1
- package/dist/instances/product.instance.js +0 -145
- package/dist/instances/product.instance.js.map +0 -1
- package/dist/instances/product.pagination.instance.d.ts +0 -102
- package/dist/instances/product.pagination.instance.d.ts.map +0 -1
- package/dist/instances/product.pagination.instance.js +0 -156
- package/dist/instances/product.pagination.instance.js.map +0 -1
- package/dist/instances/product.search.instance.d.ts +0 -81
- package/dist/instances/product.search.instance.d.ts.map +0 -1
- package/dist/instances/product.search.instance.js +0 -121
- package/dist/instances/product.search.instance.js.map +0 -1
- package/dist/instances/user.instance.d.ts +0 -56
- package/dist/instances/user.instance.d.ts.map +0 -1
- package/dist/instances/user.instance.js +0 -188
- package/dist/instances/user.instance.js.map +0 -1
- package/dist/interfaces/admin.d.ts +0 -64
- package/dist/interfaces/admin.d.ts.map +0 -1
- package/dist/interfaces/admin.js +0 -6
- package/dist/interfaces/admin.js.map +0 -1
- package/dist/interfaces/agent.d.ts +0 -399
- package/dist/interfaces/agent.d.ts.map +0 -1
- package/dist/interfaces/agent.js +0 -6
- package/dist/interfaces/agent.js.map +0 -1
- package/dist/interfaces/backup.d.ts +0 -17
- package/dist/interfaces/backup.d.ts.map +0 -1
- package/dist/interfaces/backup.js +0 -7
- package/dist/interfaces/backup.js.map +0 -1
- package/dist/interfaces/baskets.d.ts +0 -80
- package/dist/interfaces/baskets.d.ts.map +0 -1
- package/dist/interfaces/baskets.js +0 -20
- package/dist/interfaces/baskets.js.map +0 -1
- package/dist/interfaces/cdn.d.ts +0 -25
- package/dist/interfaces/cdn.d.ts.map +0 -1
- package/dist/interfaces/cdn.js +0 -6
- package/dist/interfaces/cdn.js.map +0 -1
- package/dist/interfaces/chat.d.ts +0 -98
- package/dist/interfaces/chat.d.ts.map +0 -1
- package/dist/interfaces/chat.js +0 -6
- package/dist/interfaces/chat.js.map +0 -1
- package/dist/interfaces/common.d.ts +0 -64
- package/dist/interfaces/common.d.ts.map +0 -1
- package/dist/interfaces/common.js +0 -9
- package/dist/interfaces/common.js.map +0 -1
- package/dist/interfaces/custom.data.d.ts +0 -83
- package/dist/interfaces/custom.data.d.ts.map +0 -1
- package/dist/interfaces/custom.data.js +0 -6
- package/dist/interfaces/custom.data.js.map +0 -1
- package/dist/interfaces/deploy.d.ts +0 -15
- package/dist/interfaces/deploy.d.ts.map +0 -1
- package/dist/interfaces/deploy.js +0 -5
- package/dist/interfaces/deploy.js.map +0 -1
- package/dist/interfaces/dev.d.ts +0 -54
- package/dist/interfaces/dev.d.ts.map +0 -1
- package/dist/interfaces/dev.js +0 -6
- package/dist/interfaces/dev.js.map +0 -1
- package/dist/interfaces/device-triggers.d.ts +0 -80
- package/dist/interfaces/device-triggers.d.ts.map +0 -1
- package/dist/interfaces/device-triggers.js +0 -6
- package/dist/interfaces/device-triggers.js.map +0 -1
- package/dist/interfaces/devices.d.ts +0 -74
- package/dist/interfaces/devices.d.ts.map +0 -1
- package/dist/interfaces/devices.js +0 -5
- package/dist/interfaces/devices.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -15
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/index.js +0 -8
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/init.d.ts +0 -42
- package/dist/interfaces/init.d.ts.map +0 -1
- package/dist/interfaces/init.js +0 -5
- package/dist/interfaces/init.js.map +0 -1
- package/dist/interfaces/jobs.d.ts +0 -149
- package/dist/interfaces/jobs.d.ts.map +0 -1
- package/dist/interfaces/jobs.js +0 -6
- package/dist/interfaces/jobs.js.map +0 -1
- package/dist/interfaces/logs.d.ts +0 -44
- package/dist/interfaces/logs.d.ts.map +0 -1
- package/dist/interfaces/logs.js +0 -6
- package/dist/interfaces/logs.js.map +0 -1
- package/dist/interfaces/lua.d.ts +0 -37
- package/dist/interfaces/lua.d.ts.map +0 -1
- package/dist/interfaces/lua.js +0 -6
- package/dist/interfaces/lua.js.map +0 -1
- package/dist/interfaces/marketplace.d.ts +0 -171
- package/dist/interfaces/marketplace.d.ts.map +0 -1
- package/dist/interfaces/marketplace.js +0 -3
- package/dist/interfaces/marketplace.js.map +0 -1
- package/dist/interfaces/mcp.d.ts +0 -96
- package/dist/interfaces/mcp.d.ts.map +0 -1
- package/dist/interfaces/mcp.js +0 -9
- package/dist/interfaces/mcp.js.map +0 -1
- package/dist/interfaces/message.d.ts +0 -16
- package/dist/interfaces/message.d.ts.map +0 -1
- package/dist/interfaces/message.js +0 -2
- package/dist/interfaces/message.js.map +0 -1
- package/dist/interfaces/orders.d.ts +0 -68
- package/dist/interfaces/orders.d.ts.map +0 -1
- package/dist/interfaces/orders.js +0 -20
- package/dist/interfaces/orders.js.map +0 -1
- package/dist/interfaces/persona.d.ts +0 -44
- package/dist/interfaces/persona.d.ts.map +0 -1
- package/dist/interfaces/persona.js +0 -6
- package/dist/interfaces/persona.js.map +0 -1
- package/dist/interfaces/postprocessors.d.ts +0 -15
- package/dist/interfaces/postprocessors.d.ts.map +0 -1
- package/dist/interfaces/postprocessors.js +0 -5
- package/dist/interfaces/postprocessors.js.map +0 -1
- package/dist/interfaces/preprocessors.d.ts +0 -15
- package/dist/interfaces/preprocessors.d.ts.map +0 -1
- package/dist/interfaces/preprocessors.js +0 -5
- package/dist/interfaces/preprocessors.js.map +0 -1
- package/dist/interfaces/product.d.ts +0 -92
- package/dist/interfaces/product.d.ts.map +0 -1
- package/dist/interfaces/product.js +0 -6
- package/dist/interfaces/product.js.map +0 -1
- package/dist/interfaces/push.d.ts +0 -27
- package/dist/interfaces/push.d.ts.map +0 -1
- package/dist/interfaces/push.js +0 -5
- package/dist/interfaces/push.js.map +0 -1
- package/dist/interfaces/skills.d.ts +0 -137
- package/dist/interfaces/skills.d.ts.map +0 -1
- package/dist/interfaces/skills.js +0 -6
- package/dist/interfaces/skills.js.map +0 -1
- package/dist/interfaces/test.d.ts +0 -37
- package/dist/interfaces/test.d.ts.map +0 -1
- package/dist/interfaces/test.js +0 -5
- package/dist/interfaces/test.js.map +0 -1
- package/dist/interfaces/unifiedto.d.ts +0 -141
- package/dist/interfaces/unifiedto.d.ts.map +0 -1
- package/dist/interfaces/unifiedto.js +0 -6
- package/dist/interfaces/unifiedto.js.map +0 -1
- package/dist/interfaces/user.d.ts +0 -75
- package/dist/interfaces/user.d.ts.map +0 -1
- package/dist/interfaces/user.js +0 -2
- package/dist/interfaces/user.js.map +0 -1
- package/dist/interfaces/webhooks.d.ts +0 -97
- package/dist/interfaces/webhooks.d.ts.map +0 -1
- package/dist/interfaces/webhooks.js +0 -6
- package/dist/interfaces/webhooks.js.map +0 -1
- package/dist/interfaces/whatsapp-templates.d.ts +0 -105
- package/dist/interfaces/whatsapp-templates.d.ts.map +0 -1
- package/dist/interfaces/whatsapp-templates.js +0 -6
- package/dist/interfaces/whatsapp-templates.js.map +0 -1
- package/dist/primitives/agent.handler.d.ts +0 -71
- package/dist/primitives/agent.handler.d.ts.map +0 -1
- package/dist/primitives/agent.handler.js +0 -226
- package/dist/primitives/agent.handler.js.map +0 -1
- package/dist/primitives/base.handler.d.ts +0 -229
- package/dist/primitives/base.handler.d.ts.map +0 -1
- package/dist/primitives/base.handler.js +0 -620
- package/dist/primitives/base.handler.js.map +0 -1
- package/dist/primitives/device-trigger.handler.d.ts +0 -56
- package/dist/primitives/device-trigger.handler.d.ts.map +0 -1
- package/dist/primitives/device-trigger.handler.js +0 -99
- package/dist/primitives/device-trigger.handler.js.map +0 -1
- package/dist/primitives/device.handler.d.ts +0 -57
- package/dist/primitives/device.handler.d.ts.map +0 -1
- package/dist/primitives/device.handler.js +0 -103
- package/dist/primitives/device.handler.js.map +0 -1
- package/dist/primitives/index.d.ts +0 -51
- package/dist/primitives/index.d.ts.map +0 -1
- package/dist/primitives/index.js +0 -75
- package/dist/primitives/index.js.map +0 -1
- package/dist/primitives/job.handler.d.ts +0 -53
- package/dist/primitives/job.handler.d.ts.map +0 -1
- package/dist/primitives/job.handler.js +0 -110
- package/dist/primitives/job.handler.js.map +0 -1
- package/dist/primitives/mcp-server.handler.d.ts +0 -93
- package/dist/primitives/mcp-server.handler.d.ts.map +0 -1
- package/dist/primitives/mcp-server.handler.js +0 -216
- package/dist/primitives/mcp-server.handler.js.map +0 -1
- package/dist/primitives/postprocessor.handler.d.ts +0 -44
- package/dist/primitives/postprocessor.handler.d.ts.map +0 -1
- package/dist/primitives/postprocessor.handler.js +0 -71
- package/dist/primitives/postprocessor.handler.js.map +0 -1
- package/dist/primitives/preprocessor.handler.d.ts +0 -44
- package/dist/primitives/preprocessor.handler.d.ts.map +0 -1
- package/dist/primitives/preprocessor.handler.js +0 -72
- package/dist/primitives/preprocessor.handler.js.map +0 -1
- package/dist/primitives/skill.handler.d.ts +0 -47
- package/dist/primitives/skill.handler.d.ts.map +0 -1
- package/dist/primitives/skill.handler.js +0 -229
- package/dist/primitives/skill.handler.js.map +0 -1
- package/dist/primitives/types.d.ts +0 -91
- package/dist/primitives/types.d.ts.map +0 -1
- package/dist/primitives/types.js +0 -17
- package/dist/primitives/types.js.map +0 -1
- package/dist/primitives/webhook.handler.d.ts +0 -47
- package/dist/primitives/webhook.handler.d.ts.map +0 -1
- package/dist/primitives/webhook.handler.js +0 -87
- package/dist/primitives/webhook.handler.js.map +0 -1
- package/dist/services/analytics.d.ts +0 -57
- package/dist/services/analytics.d.ts.map +0 -1
- package/dist/services/analytics.js +0 -317
- package/dist/services/analytics.js.map +0 -1
- package/dist/services/auth.d.ts +0 -72
- package/dist/services/auth.d.ts.map +0 -1
- package/dist/services/auth.js +0 -173
- package/dist/services/auth.js.map +0 -1
- package/dist/services/sandbox.service.d.ts +0 -105
- package/dist/services/sandbox.service.d.ts.map +0 -1
- package/dist/services/sandbox.service.js +0 -531
- package/dist/services/sandbox.service.js.map +0 -1
- package/dist/types/api-contracts.d.ts +0 -287
- package/dist/types/api-contracts.d.ts.map +0 -1
- package/dist/types/api-contracts.js +0 -2
- package/dist/types/api-contracts.js.map +0 -1
- package/dist/types/index.d.ts +0 -28
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -30
- package/dist/types/index.js.map +0 -1
- package/dist/types/skill.d.ts +0 -1079
- package/dist/types/skill.d.ts.map +0 -1
- package/dist/types/skill.js +0 -688
- package/dist/types/skill.js.map +0 -1
- package/dist/types/tool-validation.d.ts +0 -35
- package/dist/types/tool-validation.d.ts.map +0 -1
- package/dist/types/tool-validation.js +0 -43
- package/dist/types/tool-validation.js.map +0 -1
- package/dist/types/yaml.types.d.ts +0 -91
- package/dist/types/yaml.types.d.ts.map +0 -1
- package/dist/types/yaml.types.js +0 -5
- package/dist/types/yaml.types.js.map +0 -1
- package/dist/utils/aliases.d.ts +0 -7
- package/dist/utils/aliases.d.ts.map +0 -1
- package/dist/utils/aliases.js +0 -492
- package/dist/utils/aliases.js.map +0 -1
- package/dist/utils/artifact-loader.d.ts +0 -152
- package/dist/utils/artifact-loader.d.ts.map +0 -1
- package/dist/utils/artifact-loader.js +0 -284
- package/dist/utils/artifact-loader.js.map +0 -1
- package/dist/utils/auth-flows.d.ts +0 -55
- package/dist/utils/auth-flows.d.ts.map +0 -1
- package/dist/utils/auth-flows.js +0 -246
- package/dist/utils/auth-flows.js.map +0 -1
- package/dist/utils/backup-helpers.d.ts +0 -238
- package/dist/utils/backup-helpers.d.ts.map +0 -1
- package/dist/utils/backup-helpers.js +0 -704
- package/dist/utils/backup-helpers.js.map +0 -1
- package/dist/utils/build-manifest-from-disk.d.ts +0 -8
- package/dist/utils/build-manifest-from-disk.d.ts.map +0 -1
- package/dist/utils/build-manifest-from-disk.js +0 -21
- package/dist/utils/build-manifest-from-disk.js.map +0 -1
- package/dist/utils/bundle-upload.d.ts +0 -42
- package/dist/utils/bundle-upload.d.ts.map +0 -1
- package/dist/utils/bundle-upload.js +0 -90
- package/dist/utils/bundle-upload.js.map +0 -1
- package/dist/utils/chat-attachments.d.ts +0 -15
- package/dist/utils/chat-attachments.d.ts.map +0 -1
- package/dist/utils/chat-attachments.js +0 -116
- package/dist/utils/chat-attachments.js.map +0 -1
- package/dist/utils/cli.d.ts +0 -62
- package/dist/utils/cli.d.ts.map +0 -1
- package/dist/utils/cli.js +0 -198
- package/dist/utils/cli.js.map +0 -1
- package/dist/utils/command-utils.d.ts +0 -46
- package/dist/utils/command-utils.d.ts.map +0 -1
- package/dist/utils/command-utils.js +0 -74
- package/dist/utils/command-utils.js.map +0 -1
- package/dist/utils/deploy-helpers.d.ts +0 -40
- package/dist/utils/deploy-helpers.d.ts.map +0 -1
- package/dist/utils/deploy-helpers.js +0 -76
- package/dist/utils/deploy-helpers.js.map +0 -1
- package/dist/utils/env-loader.utils.d.ts +0 -19
- package/dist/utils/env-loader.utils.d.ts.map +0 -1
- package/dist/utils/env-loader.utils.js +0 -90
- package/dist/utils/env-loader.utils.js.map +0 -1
- package/dist/utils/files.d.ts +0 -65
- package/dist/utils/files.d.ts.map +0 -1
- package/dist/utils/files.js +0 -193
- package/dist/utils/files.js.map +0 -1
- package/dist/utils/hints.d.ts +0 -81
- package/dist/utils/hints.d.ts.map +0 -1
- package/dist/utils/hints.js +0 -81
- package/dist/utils/hints.js.map +0 -1
- package/dist/utils/init-agent.d.ts +0 -86
- package/dist/utils/init-agent.d.ts.map +0 -1
- package/dist/utils/init-agent.js +0 -201
- package/dist/utils/init-agent.js.map +0 -1
- package/dist/utils/init-helpers.d.ts +0 -37
- package/dist/utils/init-helpers.d.ts.map +0 -1
- package/dist/utils/init-helpers.js +0 -78
- package/dist/utils/init-helpers.js.map +0 -1
- package/dist/utils/init-prompts.d.ts +0 -74
- package/dist/utils/init-prompts.d.ts.map +0 -1
- package/dist/utils/init-prompts.js +0 -256
- package/dist/utils/init-prompts.js.map +0 -1
- package/dist/utils/prompt-handler.d.ts +0 -17
- package/dist/utils/prompt-handler.d.ts.map +0 -1
- package/dist/utils/prompt-handler.js +0 -49
- package/dist/utils/prompt-handler.js.map +0 -1
- package/dist/utils/sandbox-storage.d.ts +0 -83
- package/dist/utils/sandbox-storage.d.ts.map +0 -1
- package/dist/utils/sandbox-storage.js +0 -211
- package/dist/utils/sandbox-storage.js.map +0 -1
- package/dist/utils/sandbox.d.ts +0 -76
- package/dist/utils/sandbox.d.ts.map +0 -1
- package/dist/utils/sandbox.js +0 -664
- package/dist/utils/sandbox.js.map +0 -1
- package/dist/utils/semver.d.ts +0 -40
- package/dist/utils/semver.d.ts.map +0 -1
- package/dist/utils/semver.js +0 -99
- package/dist/utils/semver.js.map +0 -1
- package/dist/utils/suggest.d.ts +0 -3
- package/dist/utils/suggest.d.ts.map +0 -1
- package/dist/utils/suggest.js +0 -32
- package/dist/utils/suggest.js.map +0 -1
- package/dist/utils/sync-display.d.ts +0 -28
- package/dist/utils/sync-display.d.ts.map +0 -1
- package/dist/utils/sync-display.js +0 -168
- package/dist/utils/sync-display.js.map +0 -1
- package/dist/utils/sync-fetch.d.ts +0 -108
- package/dist/utils/sync-fetch.d.ts.map +0 -1
- package/dist/utils/sync-fetch.js +0 -294
- package/dist/utils/sync-fetch.js.map +0 -1
- package/dist/utils/sync-helpers.d.ts +0 -7
- package/dist/utils/sync-helpers.d.ts.map +0 -1
- package/dist/utils/sync-helpers.js +0 -7
- package/dist/utils/sync-helpers.js.map +0 -1
- package/dist/utils/version-check.d.ts +0 -37
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js +0 -117
- package/dist/utils/version-check.js.map +0 -1
- package/dist/utils/write-info.d.ts +0 -9
- package/dist/utils/write-info.d.ts.map +0 -1
- package/dist/utils/write-info.js +0 -11
- package/dist/utils/write-info.js.map +0 -1
- package/node_modules/@lua/shared-source-sync/dist/index.d.mts +0 -424
- package/node_modules/@lua/shared-source-sync/dist/index.d.ts +0 -424
- package/node_modules/@lua/shared-source-sync/dist/index.js +0 -536
- package/node_modules/@lua/shared-source-sync/dist/index.mjs +0 -491
- package/node_modules/@lua/shared-source-sync/package.json +0 -26
- package/node_modules/@lua/shared-source-sync/src/archive.ts +0 -98
- package/node_modules/@lua/shared-source-sync/src/filter.ts +0 -72
- package/node_modules/@lua/shared-source-sync/src/hash.ts +0 -40
- package/node_modules/@lua/shared-source-sync/src/http.ts +0 -132
- package/node_modules/@lua/shared-source-sync/src/index.ts +0 -56
- package/node_modules/@lua/shared-source-sync/src/pull.ts +0 -50
- package/node_modules/@lua/shared-source-sync/src/push.ts +0 -94
- package/node_modules/@lua/shared-source-sync/src/restore.ts +0 -83
- package/node_modules/@lua/shared-source-sync/src/skill-source.ts +0 -55
- package/node_modules/@lua/shared-source-sync/src/transfer.ts +0 -92
- package/node_modules/@lua/shared-source-sync/src/types.ts +0 -88
- package/node_modules/@lua/shared-source-sync/src/walk.ts +0 -91
- package/node_modules/@lua/shared-source-sync/tests/archive.test.ts +0 -108
- package/node_modules/@lua/shared-source-sync/tests/hash.test.ts +0 -40
- package/node_modules/@lua/shared-source-sync/tests/http.test.ts +0 -77
- package/node_modules/@lua/shared-source-sync/tests/push.test.ts +0 -162
- package/node_modules/@lua/shared-source-sync/tests/walk.test.ts +0 -84
- package/node_modules/@lua/shared-source-sync/tsconfig.json +0 -12
- package/node_modules/@lua/shared-source-sync/tsup.config.ts +0 -9
- package/node_modules/@lua/shared-source-sync/vitest.config.ts +0 -8
- package/node_modules/@lua/shared-types/dist/index.d.mts +0 -619
- package/node_modules/@lua/shared-types/dist/index.d.ts +0 -619
- package/node_modules/@lua/shared-types/dist/index.js +0 -435
- package/node_modules/@lua/shared-types/dist/index.mjs +0 -394
- package/node_modules/@lua/shared-types/package.json +0 -26
- package/node_modules/@lua/shared-types/src/agent-config.types.ts +0 -45
- package/node_modules/@lua/shared-types/src/agent-invocation.types.ts +0 -73
- package/node_modules/@lua/shared-types/src/ai-generate.types.ts +0 -74
- package/node_modules/@lua/shared-types/src/ai-generate.utils.ts +0 -16
- package/node_modules/@lua/shared-types/src/channel.type.ts +0 -23
- package/node_modules/@lua/shared-types/src/chat-history.types.ts +0 -112
- package/node_modules/@lua/shared-types/src/chat-stream.types.ts +0 -18
- package/node_modules/@lua/shared-types/src/client-tools.types.ts +0 -47
- package/node_modules/@lua/shared-types/src/device.types.ts +0 -190
- package/node_modules/@lua/shared-types/src/index.ts +0 -15
- package/node_modules/@lua/shared-types/src/model-registry.ts +0 -26
- package/node_modules/@lua/shared-types/src/persona-defaults.ts +0 -59
- package/node_modules/@lua/shared-types/src/persona-text.type.ts +0 -92
- package/node_modules/@lua/shared-types/src/sandbox-contract.ts +0 -63
- package/node_modules/@lua/shared-types/src/unstructured-types.ts +0 -58
- package/node_modules/@lua/shared-types/src/vm-execution-log.types.ts +0 -41
- package/node_modules/@lua/shared-types/tsconfig.json +0 -12
- package/node_modules/@lua/shared-types/tsup.config.ts +0 -9
- package/scripts/resolve-workspace-deps.cjs +0 -61
- /package/dist/{compiler/utils/zod-runtime.mjs → zod-runtime.mjs} +0 -0
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Order instance class providing a fluent API for managing orders
|
|
3
|
-
* Provides methods for updating order status and order data
|
|
4
|
-
* Supports direct property access (e.g., order.shippingAddress) for accessing data and common properties
|
|
5
|
-
*/
|
|
6
|
-
export default class OrderInstance {
|
|
7
|
-
/**
|
|
8
|
-
* Creates a new OrderInstance with proxy support for direct property access
|
|
9
|
-
* @param api - The OrderApi instance for making API calls
|
|
10
|
-
* @param order - The order response data from the API
|
|
11
|
-
* @returns Proxied instance that allows direct access to data and common properties
|
|
12
|
-
*/
|
|
13
|
-
constructor(api, order) {
|
|
14
|
-
// Ensure data and common are always objects, never null or undefined
|
|
15
|
-
this.data = order.data && typeof order.data === 'object' ? order.data : {};
|
|
16
|
-
this.common = order.common && typeof order.common === 'object' ? order.common : {};
|
|
17
|
-
this.id = order.id;
|
|
18
|
-
this.userId = order.userId;
|
|
19
|
-
this.agentId = order.agentId;
|
|
20
|
-
this.orderId = order.orderId;
|
|
21
|
-
// Make orderAPI non-enumerable so it doesn't show up in console.log
|
|
22
|
-
Object.defineProperty(this, 'orderAPI', {
|
|
23
|
-
value: api,
|
|
24
|
-
writable: true,
|
|
25
|
-
enumerable: false,
|
|
26
|
-
configurable: true,
|
|
27
|
-
});
|
|
28
|
-
// Return a proxy that allows direct property access
|
|
29
|
-
return new Proxy(this, {
|
|
30
|
-
get(target, prop, receiver) {
|
|
31
|
-
// If the property exists on the instance itself, return it
|
|
32
|
-
if (prop in target) {
|
|
33
|
-
return Reflect.get(target, prop, receiver);
|
|
34
|
-
}
|
|
35
|
-
// Check data object (with null check)
|
|
36
|
-
if (typeof prop === 'string' && target.data && typeof target.data === 'object' && prop in target.data) {
|
|
37
|
-
return target.data[prop];
|
|
38
|
-
}
|
|
39
|
-
// Check common object (with null check)
|
|
40
|
-
if (typeof prop === 'string' && target.common && typeof target.common === 'object' && prop in target.common) {
|
|
41
|
-
return target.common[prop];
|
|
42
|
-
}
|
|
43
|
-
return undefined;
|
|
44
|
-
},
|
|
45
|
-
set(target, prop, value, receiver) {
|
|
46
|
-
// Reserved properties that should be set on the instance itself
|
|
47
|
-
const reservedProps = [
|
|
48
|
-
'data',
|
|
49
|
-
'common',
|
|
50
|
-
'id',
|
|
51
|
-
'userId',
|
|
52
|
-
'agentId',
|
|
53
|
-
'orderId',
|
|
54
|
-
'orderAPI',
|
|
55
|
-
'updateStatus',
|
|
56
|
-
'update',
|
|
57
|
-
'toJSON',
|
|
58
|
-
];
|
|
59
|
-
if (typeof prop === 'string' && reservedProps.includes(prop)) {
|
|
60
|
-
return Reflect.set(target, prop, value, receiver);
|
|
61
|
-
}
|
|
62
|
-
// Check if property exists in data or common, otherwise default to data
|
|
63
|
-
if (typeof prop === 'string') {
|
|
64
|
-
// Initialize objects if they don't exist
|
|
65
|
-
if (!target.data || typeof target.data !== 'object') {
|
|
66
|
-
target.data = {};
|
|
67
|
-
}
|
|
68
|
-
if (!target.common || typeof target.common !== 'object') {
|
|
69
|
-
target.common = {};
|
|
70
|
-
}
|
|
71
|
-
if (prop in target.common) {
|
|
72
|
-
target.common[prop] = value;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
target.data[prop] = value;
|
|
76
|
-
}
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
},
|
|
81
|
-
has(target, prop) {
|
|
82
|
-
// Check if property exists on instance, in data, or in common (with null checks)
|
|
83
|
-
if (prop in target) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
if (typeof prop === 'string') {
|
|
87
|
-
if (target.data && typeof target.data === 'object' && prop in target.data) {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
if (target.common && typeof target.common === 'object' && prop in target.common) {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return false;
|
|
95
|
-
},
|
|
96
|
-
ownKeys(target) {
|
|
97
|
-
// Return instance keys, data keys, and common keys (with null checks)
|
|
98
|
-
const instanceKeys = Reflect.ownKeys(target);
|
|
99
|
-
const dataKeys = target.data && typeof target.data === 'object' ? Object.keys(target.data) : [];
|
|
100
|
-
const commonKeys = target.common && typeof target.common === 'object' ? Object.keys(target.common) : [];
|
|
101
|
-
return [...new Set([...instanceKeys, ...dataKeys, ...commonKeys])];
|
|
102
|
-
},
|
|
103
|
-
getOwnPropertyDescriptor(target, prop) {
|
|
104
|
-
// First check if it's an instance property
|
|
105
|
-
const instanceDesc = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
106
|
-
if (instanceDesc) {
|
|
107
|
-
return instanceDesc;
|
|
108
|
-
}
|
|
109
|
-
// Then check data properties (with null check)
|
|
110
|
-
if (typeof prop === 'string' && target.data && typeof target.data === 'object' && prop in target.data) {
|
|
111
|
-
return {
|
|
112
|
-
configurable: true,
|
|
113
|
-
enumerable: true,
|
|
114
|
-
writable: true,
|
|
115
|
-
value: target.data[prop],
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
// Then check common properties (with null check)
|
|
119
|
-
if (typeof prop === 'string' && target.common && typeof target.common === 'object' && prop in target.common) {
|
|
120
|
-
return {
|
|
121
|
-
configurable: true,
|
|
122
|
-
enumerable: true,
|
|
123
|
-
writable: true,
|
|
124
|
-
value: target.common[prop],
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
return undefined;
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Custom toJSON method to control what gets serialized when logging
|
|
133
|
-
* @returns Serialized order data combining data and common fields
|
|
134
|
-
*/
|
|
135
|
-
toJSON() {
|
|
136
|
-
return {
|
|
137
|
-
...this.data,
|
|
138
|
-
...this.common,
|
|
139
|
-
id: this.id,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Custom inspect method for Node.js console.log
|
|
144
|
-
* @returns Formatted order data for console output
|
|
145
|
-
*/
|
|
146
|
-
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
147
|
-
return {
|
|
148
|
-
...this.data,
|
|
149
|
-
...this.common,
|
|
150
|
-
id: this.id,
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Updates the order's status
|
|
155
|
-
* @param status - The new order status (e.g., 'pending', 'processing', 'shipped', 'delivered', 'cancelled')
|
|
156
|
-
* @returns Promise resolving to the updated order data
|
|
157
|
-
* @throws Error if the status update fails
|
|
158
|
-
*/
|
|
159
|
-
async updateStatus(status) {
|
|
160
|
-
const response = await this.orderAPI.updateStatus(status, this.id);
|
|
161
|
-
this.common = response.common;
|
|
162
|
-
return {
|
|
163
|
-
...this.data,
|
|
164
|
-
...this.common,
|
|
165
|
-
id: this.id,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Updates the order's data
|
|
170
|
-
* @param data - The data fields to update (e.g., shipping info, notes, metadata)
|
|
171
|
-
* @returns Promise resolving to the updated order data
|
|
172
|
-
* @throws Error if the data update fails
|
|
173
|
-
*/
|
|
174
|
-
async update(data) {
|
|
175
|
-
const response = await this.orderAPI.updateData(data, this.id);
|
|
176
|
-
this.data = response.data;
|
|
177
|
-
this.common = response.common;
|
|
178
|
-
return {
|
|
179
|
-
...this.data,
|
|
180
|
-
...this.common,
|
|
181
|
-
id: this.id,
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Saves the order's data
|
|
186
|
-
* @returns Promise resolving to true if saving was successful
|
|
187
|
-
* @throws Error if the save operation fails
|
|
188
|
-
*/
|
|
189
|
-
async save() {
|
|
190
|
-
try {
|
|
191
|
-
await this.orderAPI.updateData(this.data, this.id);
|
|
192
|
-
return true;
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
throw new Error('Failed to save order data');
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
//# sourceMappingURL=order.instance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.instance.js","sourceRoot":"","sources":["../../src/instances/order.instance.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IAYhC;;;;;OAKG;IACH,YAAY,GAAa,EAAE,KAAoB;QAC7C,qEAAqE;QACrE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAE,EAAgB,CAAC;QAC1F,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAE,EAAkB,CAAC;QACpG,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,oEAAoE;QACpE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE;YACtC,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KA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QAAQ,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC9B,OAAO;YACL,GAAG,IAAI,CAAC,IAAI;YACZ,GAAG,IAAI,CAAC,MAAM;YACd,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;YACnD,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Product } from '../interfaces/product.js';
|
|
2
|
-
/**
|
|
3
|
-
* Product instance class providing a fluent API for managing individual products
|
|
4
|
-
* Provides methods for updating and deleting products
|
|
5
|
-
* Supports direct property access (e.g., product.name) instead of product.data.name
|
|
6
|
-
*/
|
|
7
|
-
export default class ProductInstance {
|
|
8
|
-
data: Product;
|
|
9
|
-
private productAPI;
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
/**
|
|
12
|
-
* Creates a new ProductInstance with proxy support for direct property access
|
|
13
|
-
* @param api - The ProductAPI instance for making API calls
|
|
14
|
-
* @param product - The product data from the API
|
|
15
|
-
* @returns Proxied instance that allows direct access to product properties
|
|
16
|
-
*/
|
|
17
|
-
constructor(api: any, product: Product);
|
|
18
|
-
/**
|
|
19
|
-
* Custom toJSON method to control what gets serialized when logging
|
|
20
|
-
* @returns Serialized product data
|
|
21
|
-
*/
|
|
22
|
-
toJSON(): Record<string, any>;
|
|
23
|
-
/**
|
|
24
|
-
* Updates the product's data
|
|
25
|
-
* @param data - The product fields to update (partial update supported)
|
|
26
|
-
* @returns Promise resolving to the updated Product
|
|
27
|
-
* @throws Error if the update fails or the product is not found
|
|
28
|
-
*/
|
|
29
|
-
update(data: Record<string, any>): Promise<Product>;
|
|
30
|
-
/**
|
|
31
|
-
* Deletes the product from the catalog
|
|
32
|
-
* @returns Promise resolving to an empty Product object if deletion was successful
|
|
33
|
-
* @throws Error if the deletion fails or the product is not found
|
|
34
|
-
*/
|
|
35
|
-
delete(): Promise<Product>;
|
|
36
|
-
/**
|
|
37
|
-
* Saves the product's data
|
|
38
|
-
* @returns Promise resolving to true if saving was successful
|
|
39
|
-
* @throws Error if the save operation fails
|
|
40
|
-
*/
|
|
41
|
-
save(): Promise<boolean>;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=product.instance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.instance.d.ts","sourceRoot":"","sources":["../../src/instances/product.instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,UAAU,CAAc;IAGhC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAEnB;;;;;OAKG;gBACS,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO;IA8EtC;;;OAGG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAY7B;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAUzD;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;CAQ/B"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Product instance class providing a fluent API for managing individual products
|
|
3
|
-
* Provides methods for updating and deleting products
|
|
4
|
-
* Supports direct property access (e.g., product.name) instead of product.data.name
|
|
5
|
-
*/
|
|
6
|
-
export default class ProductInstance {
|
|
7
|
-
/**
|
|
8
|
-
* Creates a new ProductInstance with proxy support for direct property access
|
|
9
|
-
* @param api - The ProductAPI instance for making API calls
|
|
10
|
-
* @param product - The product data from the API
|
|
11
|
-
* @returns Proxied instance that allows direct access to product properties
|
|
12
|
-
*/
|
|
13
|
-
constructor(api, product) {
|
|
14
|
-
// Ensure data is always an object, never null or undefined
|
|
15
|
-
this.data = product && typeof product === 'object' ? product : {};
|
|
16
|
-
// Make productAPI non-enumerable so it doesn't show up in console.log
|
|
17
|
-
Object.defineProperty(this, 'productAPI', {
|
|
18
|
-
value: api,
|
|
19
|
-
writable: true,
|
|
20
|
-
enumerable: false,
|
|
21
|
-
configurable: true,
|
|
22
|
-
});
|
|
23
|
-
// Return a proxy that allows direct property access
|
|
24
|
-
return new Proxy(this, {
|
|
25
|
-
get(target, prop, receiver) {
|
|
26
|
-
// If the property exists on the instance itself, return it
|
|
27
|
-
if (prop in target) {
|
|
28
|
-
return Reflect.get(target, prop, receiver);
|
|
29
|
-
}
|
|
30
|
-
// Otherwise, try to get it from the data object (with null check)
|
|
31
|
-
if (typeof prop === 'string' && target.data && typeof target.data === 'object' && prop in target.data) {
|
|
32
|
-
return target.data[prop];
|
|
33
|
-
}
|
|
34
|
-
return undefined;
|
|
35
|
-
},
|
|
36
|
-
set(target, prop, value, receiver) {
|
|
37
|
-
// Reserved properties that should be set on the instance itself
|
|
38
|
-
const reservedProps = ['data', 'productAPI', 'update', 'delete', 'toJSON'];
|
|
39
|
-
if (typeof prop === 'string' && reservedProps.includes(prop)) {
|
|
40
|
-
return Reflect.set(target, prop, value, receiver);
|
|
41
|
-
}
|
|
42
|
-
// All other properties get set on the data object
|
|
43
|
-
if (typeof prop === 'string') {
|
|
44
|
-
// Initialize data object if it doesn't exist
|
|
45
|
-
if (!target.data || typeof target.data !== 'object') {
|
|
46
|
-
target.data = {};
|
|
47
|
-
}
|
|
48
|
-
target.data[prop] = value;
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
},
|
|
53
|
-
has(target, prop) {
|
|
54
|
-
// Check if property exists on instance or in data (with null check)
|
|
55
|
-
if (prop in target) {
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
if (typeof prop === 'string' && target.data && typeof target.data === 'object') {
|
|
59
|
-
return prop in target.data;
|
|
60
|
-
}
|
|
61
|
-
return false;
|
|
62
|
-
},
|
|
63
|
-
ownKeys(target) {
|
|
64
|
-
// Return both instance keys and data keys (with null check)
|
|
65
|
-
const instanceKeys = Reflect.ownKeys(target);
|
|
66
|
-
const dataKeys = target.data && typeof target.data === 'object' ? Object.keys(target.data) : [];
|
|
67
|
-
return [...new Set([...instanceKeys, ...dataKeys])];
|
|
68
|
-
},
|
|
69
|
-
getOwnPropertyDescriptor(target, prop) {
|
|
70
|
-
// First check if it's an instance property
|
|
71
|
-
const instanceDesc = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
72
|
-
if (instanceDesc) {
|
|
73
|
-
return instanceDesc;
|
|
74
|
-
}
|
|
75
|
-
// Then check if it's a data property (with null check)
|
|
76
|
-
if (typeof prop === 'string' && target.data && typeof target.data === 'object' && prop in target.data) {
|
|
77
|
-
return {
|
|
78
|
-
configurable: true,
|
|
79
|
-
enumerable: true,
|
|
80
|
-
writable: true,
|
|
81
|
-
value: target.data[prop],
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
return undefined;
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Custom toJSON method to control what gets serialized when logging
|
|
90
|
-
* @returns Serialized product data
|
|
91
|
-
*/
|
|
92
|
-
toJSON() {
|
|
93
|
-
return this.data;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Custom inspect method for Node.js console.log
|
|
97
|
-
* @returns Formatted product data for console output
|
|
98
|
-
*/
|
|
99
|
-
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
100
|
-
return this.data;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Updates the product's data
|
|
104
|
-
* @param data - The product fields to update (partial update supported)
|
|
105
|
-
* @returns Promise resolving to the updated Product
|
|
106
|
-
* @throws Error if the update fails or the product is not found
|
|
107
|
-
*/
|
|
108
|
-
async update(data) {
|
|
109
|
-
const response = await this.productAPI.update(data, this.data.id);
|
|
110
|
-
if (response.updated) {
|
|
111
|
-
this.data = response.product;
|
|
112
|
-
return this.data;
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
throw new Error('Failed to update product');
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Deletes the product from the catalog
|
|
120
|
-
* @returns Promise resolving to an empty Product object if deletion was successful
|
|
121
|
-
* @throws Error if the deletion fails or the product is not found
|
|
122
|
-
*/
|
|
123
|
-
async delete() {
|
|
124
|
-
const response = await this.productAPI.delete(this.data.id);
|
|
125
|
-
if (response.deleted) {
|
|
126
|
-
this.data = {};
|
|
127
|
-
}
|
|
128
|
-
return this.data;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Saves the product's data
|
|
132
|
-
* @returns Promise resolving to true if saving was successful
|
|
133
|
-
* @throws Error if the save operation fails
|
|
134
|
-
*/
|
|
135
|
-
async save() {
|
|
136
|
-
try {
|
|
137
|
-
await this.productAPI.update(this.data, this.data.id);
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
throw new Error('Failed to save product data');
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
//# sourceMappingURL=product.instance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.instance.js","sourceRoot":"","sources":["../../src/instances/product.instance.ts"],"names":[],"mappings":"AAGA;;;;GA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,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5D,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,GAAG,EAAa,CAAC;QAC5B,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { ProductsResponse } from '../interfaces/product.js';
|
|
2
|
-
import ProductInstance from './product.instance.js';
|
|
3
|
-
/**
|
|
4
|
-
* Product pagination instance class providing a fluent API for paginated product results
|
|
5
|
-
* Provides methods for navigating through pages of products
|
|
6
|
-
* Supports array methods like map, filter, forEach for direct iteration
|
|
7
|
-
*/
|
|
8
|
-
export default class ProductPaginationInstance {
|
|
9
|
-
products: ProductInstance[];
|
|
10
|
-
pagination: {
|
|
11
|
-
currentPage: number;
|
|
12
|
-
totalPages: number;
|
|
13
|
-
totalCount: number;
|
|
14
|
-
limit: number;
|
|
15
|
-
hasNextPage: boolean;
|
|
16
|
-
hasPrevPage: boolean;
|
|
17
|
-
nextPage: number | null;
|
|
18
|
-
prevPage: number | null;
|
|
19
|
-
};
|
|
20
|
-
private productAPI;
|
|
21
|
-
/**
|
|
22
|
-
* Creates a new ProductPaginationInstance
|
|
23
|
-
* @param api - The ProductAPI instance for making API calls
|
|
24
|
-
* @param results - The paginated product results from the API
|
|
25
|
-
*/
|
|
26
|
-
constructor(api: any, results: ProductsResponse);
|
|
27
|
-
/**
|
|
28
|
-
* Returns the number of products in the current page
|
|
29
|
-
*/
|
|
30
|
-
get length(): number;
|
|
31
|
-
/**
|
|
32
|
-
* Maps over the products array
|
|
33
|
-
* @param callback - Function to execute for each product
|
|
34
|
-
* @returns Array of mapped results
|
|
35
|
-
*/
|
|
36
|
-
map<T>(callback: (product: ProductInstance, index: number, array: ProductInstance[]) => T): T[];
|
|
37
|
-
/**
|
|
38
|
-
* Filters the products array
|
|
39
|
-
* @param callback - Function to test each product
|
|
40
|
-
* @returns Array of products that pass the test
|
|
41
|
-
*/
|
|
42
|
-
filter(callback: (product: ProductInstance, index: number, array: ProductInstance[]) => boolean): ProductInstance[];
|
|
43
|
-
/**
|
|
44
|
-
* Executes a function for each product
|
|
45
|
-
* @param callback - Function to execute for each product
|
|
46
|
-
*/
|
|
47
|
-
forEach(callback: (product: ProductInstance, index: number, array: ProductInstance[]) => void): void;
|
|
48
|
-
/**
|
|
49
|
-
* Finds the first product that satisfies the test
|
|
50
|
-
* @param callback - Function to test each product
|
|
51
|
-
* @returns The first product that passes the test, or undefined
|
|
52
|
-
*/
|
|
53
|
-
find(callback: (product: ProductInstance, index: number, array: ProductInstance[]) => boolean): ProductInstance | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Finds the index of the first product that satisfies the test
|
|
56
|
-
* @param callback - Function to test each product
|
|
57
|
-
* @returns The index of the first product that passes the test, or -1
|
|
58
|
-
*/
|
|
59
|
-
findIndex(callback: (product: ProductInstance, index: number, array: ProductInstance[]) => boolean): number;
|
|
60
|
-
/**
|
|
61
|
-
* Checks if some products satisfy the test
|
|
62
|
-
* @param callback - Function to test each product
|
|
63
|
-
* @returns true if at least one product passes the test
|
|
64
|
-
*/
|
|
65
|
-
some(callback: (product: ProductInstance, index: number, array: ProductInstance[]) => boolean): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Checks if all products satisfy the test
|
|
68
|
-
* @param callback - Function to test each product
|
|
69
|
-
* @returns true if all products pass the test
|
|
70
|
-
*/
|
|
71
|
-
every(callback: (product: ProductInstance, index: number, array: ProductInstance[]) => boolean): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Reduces the products array to a single value
|
|
74
|
-
* @param callback - Function to execute on each product
|
|
75
|
-
* @param initialValue - Initial value for the accumulator
|
|
76
|
-
* @returns The final accumulated value
|
|
77
|
-
*/
|
|
78
|
-
reduce<T>(callback: (accumulator: T, product: ProductInstance, index: number, array: ProductInstance[]) => T, initialValue: T): T;
|
|
79
|
-
/**
|
|
80
|
-
* Makes the instance iterable
|
|
81
|
-
* @returns Iterator for the products array
|
|
82
|
-
*/
|
|
83
|
-
[Symbol.iterator](): Iterator<ProductInstance>;
|
|
84
|
-
/**
|
|
85
|
-
* Custom toJSON method to control what gets serialized when logging
|
|
86
|
-
* @returns Serialized products and pagination data
|
|
87
|
-
*/
|
|
88
|
-
toJSON(): Record<string, any>;
|
|
89
|
-
/**
|
|
90
|
-
* Fetches the next page of products
|
|
91
|
-
* @returns Promise resolving to a new ProductPaginationInstance for the next page
|
|
92
|
-
* @throws Error if there is no next page available
|
|
93
|
-
*/
|
|
94
|
-
nextPage(): Promise<ProductPaginationInstance>;
|
|
95
|
-
/**
|
|
96
|
-
* Fetches the previous page of products
|
|
97
|
-
* @returns Promise resolving to a new ProductPaginationInstance for the previous page
|
|
98
|
-
* @throws Error if there is no previous page available
|
|
99
|
-
*/
|
|
100
|
-
prevPage(): Promise<ProductPaginationInstance>;
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=product.pagination.instance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.pagination.instance.d.ts","sourceRoot":"","sources":["../../src/instances/product.pagination.instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,eAAe,MAAM,uBAAuB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,OA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K,EAAE,eAAe,EAAE,KAAK,OAAO,GAAG,MAAM;IAI3G;;;;OAIG;IACH,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,OAAO,GAAG,OAAO;IAIvG;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,OAAO,GAAG,OAAO;IAIxG;;;;;OAKG;IACH,MAAM,CAAC,CAAC,EACN,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,CAAC,EAClG,YAAY,EAAE,CAAC,GACd,CAAC;IAIJ;;;OAGG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,eAAe,CAAC;IAI9C;;;OAGG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAkB7B;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAOpD;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,yBAAyB,CAAC;CAMrD"}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import ProductInstance from './product.instance.js';
|
|
2
|
-
/**
|
|
3
|
-
* Product pagination instance class providing a fluent API for paginated product results
|
|
4
|
-
* Provides methods for navigating through pages of products
|
|
5
|
-
* Supports array methods like map, filter, forEach for direct iteration
|
|
6
|
-
*/
|
|
7
|
-
export default class ProductPaginationInstance {
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new ProductPaginationInstance
|
|
10
|
-
* @param api - The ProductAPI instance for making API calls
|
|
11
|
-
* @param results - The paginated product results from the API
|
|
12
|
-
*/
|
|
13
|
-
constructor(api, results) {
|
|
14
|
-
// Ensure products array is always initialized, with null checks
|
|
15
|
-
const productsData = results?.data;
|
|
16
|
-
this.products = (Array.isArray(productsData) ? productsData : []).map((product) => new ProductInstance(api, product));
|
|
17
|
-
// Ensure pagination is always initialized with safe defaults
|
|
18
|
-
this.pagination = results?.pagination || {
|
|
19
|
-
currentPage: 1,
|
|
20
|
-
totalPages: 1,
|
|
21
|
-
totalCount: 0,
|
|
22
|
-
limit: 10,
|
|
23
|
-
hasNextPage: false,
|
|
24
|
-
hasPrevPage: false,
|
|
25
|
-
nextPage: null,
|
|
26
|
-
prevPage: null,
|
|
27
|
-
};
|
|
28
|
-
// Make productAPI non-enumerable so it doesn't show up in console.log
|
|
29
|
-
Object.defineProperty(this, 'productAPI', {
|
|
30
|
-
value: api,
|
|
31
|
-
writable: true,
|
|
32
|
-
enumerable: false,
|
|
33
|
-
configurable: true,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Returns the number of products in the current page
|
|
38
|
-
*/
|
|
39
|
-
get length() {
|
|
40
|
-
return this.products.length;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Maps over the products array
|
|
44
|
-
* @param callback - Function to execute for each product
|
|
45
|
-
* @returns Array of mapped results
|
|
46
|
-
*/
|
|
47
|
-
map(callback) {
|
|
48
|
-
return this.products.map(callback);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Filters the products array
|
|
52
|
-
* @param callback - Function to test each product
|
|
53
|
-
* @returns Array of products that pass the test
|
|
54
|
-
*/
|
|
55
|
-
filter(callback) {
|
|
56
|
-
return this.products.filter(callback);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Executes a function for each product
|
|
60
|
-
* @param callback - Function to execute for each product
|
|
61
|
-
*/
|
|
62
|
-
forEach(callback) {
|
|
63
|
-
this.products.forEach(callback);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Finds the first product that satisfies the test
|
|
67
|
-
* @param callback - Function to test each product
|
|
68
|
-
* @returns The first product that passes the test, or undefined
|
|
69
|
-
*/
|
|
70
|
-
find(callback) {
|
|
71
|
-
return this.products.find(callback);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Finds the index of the first product that satisfies the test
|
|
75
|
-
* @param callback - Function to test each product
|
|
76
|
-
* @returns The index of the first product that passes the test, or -1
|
|
77
|
-
*/
|
|
78
|
-
findIndex(callback) {
|
|
79
|
-
return this.products.findIndex(callback);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Checks if some products satisfy the test
|
|
83
|
-
* @param callback - Function to test each product
|
|
84
|
-
* @returns true if at least one product passes the test
|
|
85
|
-
*/
|
|
86
|
-
some(callback) {
|
|
87
|
-
return this.products.some(callback);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Checks if all products satisfy the test
|
|
91
|
-
* @param callback - Function to test each product
|
|
92
|
-
* @returns true if all products pass the test
|
|
93
|
-
*/
|
|
94
|
-
every(callback) {
|
|
95
|
-
return this.products.every(callback);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Reduces the products array to a single value
|
|
99
|
-
* @param callback - Function to execute on each product
|
|
100
|
-
* @param initialValue - Initial value for the accumulator
|
|
101
|
-
* @returns The final accumulated value
|
|
102
|
-
*/
|
|
103
|
-
reduce(callback, initialValue) {
|
|
104
|
-
return this.products.reduce(callback, initialValue);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Makes the instance iterable
|
|
108
|
-
* @returns Iterator for the products array
|
|
109
|
-
*/
|
|
110
|
-
[Symbol.iterator]() {
|
|
111
|
-
return this.products[Symbol.iterator]();
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Custom toJSON method to control what gets serialized when logging
|
|
115
|
-
* @returns Serialized products and pagination data
|
|
116
|
-
*/
|
|
117
|
-
toJSON() {
|
|
118
|
-
return {
|
|
119
|
-
products: this.products,
|
|
120
|
-
pagination: this.pagination,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Custom inspect method for Node.js console.log
|
|
125
|
-
* @returns Formatted products and pagination data for console output
|
|
126
|
-
*/
|
|
127
|
-
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
128
|
-
return {
|
|
129
|
-
products: this.products,
|
|
130
|
-
pagination: this.pagination,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Fetches the next page of products
|
|
135
|
-
* @returns Promise resolving to a new ProductPaginationInstance for the next page
|
|
136
|
-
* @throws Error if there is no next page available
|
|
137
|
-
*/
|
|
138
|
-
async nextPage() {
|
|
139
|
-
if (!this.pagination.nextPage) {
|
|
140
|
-
throw new Error('No next page');
|
|
141
|
-
}
|
|
142
|
-
return await this.productAPI.get(this.pagination.nextPage, this.pagination.limit);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Fetches the previous page of products
|
|
146
|
-
* @returns Promise resolving to a new ProductPaginationInstance for the previous page
|
|
147
|
-
* @throws Error if there is no previous page available
|
|
148
|
-
*/
|
|
149
|
-
async prevPage() {
|
|
150
|
-
if (!this.pagination.prevPage) {
|
|
151
|
-
throw new Error('No previous page');
|
|
152
|
-
}
|
|
153
|
-
return await this.productAPI.get(this.pagination.prevPage, this.pagination.limit);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=product.pagination.instance.js.map
|