@xano/xanoscript-language-server 11.12.2 → 11.12.3
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/package.json +25 -1
- package/.claude/memory/feedback_no_git.md +0 -11
- package/.claude/settings.local.json +0 -21
- package/.github/copilot-instructions.md +0 -190
- package/.github/workflows/ci.yml +0 -31
- package/.husky/pre-commit +0 -1
- package/CLAUDE.md +0 -256
- package/eslint.config.js +0 -24
- package/lexer/comment.spec.js +0 -77
- package/lexer/multiline.spec.js +0 -179
- package/lexer/regexp.spec.js +0 -84
- package/lexer/tests/query/query_lexer.spec.js +0 -36
- package/lexer/tests/query/valid_sources/basic_query.xs +0 -44
- package/lexer/tests/query/valid_sources/db_query.xs +0 -77
- package/lexer/tests/query/valid_sources/empty_query.xs +0 -5
- package/lexer/tests/query/valid_sources/header_query.xs +0 -15
- package/lexer/tests/table/basic_table.xs +0 -17
- package/lexer/tests/table/empty_table.xs +0 -3
- package/lexer/tests/table/table_lexer.spec.js +0 -324
- package/lexer/utils.spec.js +0 -61
- package/onCompletion/contentAssist.spec.js +0 -275
- package/onDefinition/onDefinition.spec.js +0 -313
- package/onHover/FilterMessageProvider.spec.js +0 -85
- package/onHover/FunctionMessageProvider.spec.js +0 -128
- package/onHover/InputFilterMessageProvider.spec.js +0 -329
- package/onHover/QueryFilterMessageProvider.spec.js +0 -164
- package/onHover/onHoverDocument.spec.js +0 -660
- package/parser/addon_parser.spec.js +0 -88
- package/parser/agent_parser.spec.js +0 -599
- package/parser/agent_trigger_parser.spec.js +0 -525
- package/parser/api_group_parser.spec.js +0 -137
- package/parser/attributes/columnDefaultValueAttribute.spec.js +0 -49
- package/parser/attributes/descriptionFieldAttribute.spec.js +0 -39
- package/parser/attributes/disabledFieldAttribute.spec.js +0 -34
- package/parser/attributes/docsFieldAttribute.spec.js +0 -44
- package/parser/attributes/guidFieldAttribute.spec.js +0 -93
- package/parser/attributes/inputFilterFn.spec.js +0 -39
- package/parser/attributes/sensitiveFieldAttribute.spec.js +0 -39
- package/parser/attributes/valueFieldAttribute.spec.js +0 -54
- package/parser/attributes/valuesFieldAttribute.spec.js +0 -44
- package/parser/attributes/visibilityFieldAttribute.spec.js +0 -44
- package/parser/branch_parser.spec.js +0 -34
- package/parser/clauses/agentClause.spec.js +0 -34
- package/parser/clauses/authClause.spec.js +0 -39
- package/parser/clauses/cacheClause.spec.js +0 -103
- package/parser/clauses/canonicalClause.spec.js +0 -34
- package/parser/clauses/channelClause.spec.js +0 -34
- package/parser/clauses/dbTableClause.spec.js +0 -34
- package/parser/clauses/historyClause.spec.js +0 -53
- package/parser/clauses/indexClause.spec.js +0 -47
- package/parser/clauses/inputClause.spec.js +0 -96
- package/parser/clauses/mcpServerClause.spec.js +0 -34
- package/parser/clauses/middlewareClause.spec.js +0 -161
- package/parser/clauses/nakedStackFn.spec.js +0 -73
- package/parser/clauses/responseClause.spec.js +0 -47
- package/parser/clauses/scheduleClause.spec.js +0 -71
- package/parser/clauses/schemaClause.spec.js +0 -102
- package/parser/clauses/testClause.spec.js +0 -69
- package/parser/clauses/viewClause.spec.js +0 -163
- package/parser/definitions/arraySlice.spec.js +0 -49
- package/parser/definitions/columnDefinition.spec.js +0 -199
- package/parser/definitions/dbLinkColumnDefinition.spec.js +0 -45
- package/parser/definitions/enumColumnDefinition.spec.js +0 -108
- package/parser/definitions/filterDefinition.spec.js +0 -43
- package/parser/definitions/objectColumnDefinition.spec.js +0 -118
- package/parser/function_parser.spec.js +0 -131
- package/parser/functions/actionCallFn.spec.js +0 -51
- package/parser/functions/addonCallFn.spec.js +0 -41
- package/parser/functions/ai/aiAgentRunFn.spec.js +0 -94
- package/parser/functions/ai/aiExternalMcpServerDetailsFn.spec.js +0 -85
- package/parser/functions/ai/aiExternalMcpToolListFn.spec.js +0 -85
- package/parser/functions/ai/aiExternalMcpToolRunFn.spec.js +0 -101
- package/parser/functions/aiFn.spec.js +0 -51
- package/parser/functions/api/apiCallFn.spec.js +0 -62
- package/parser/functions/api/apiLambdaFn.spec.js +0 -63
- package/parser/functions/api/apiRealtimeEventFn.spec.js +0 -82
- package/parser/functions/api/apiRequestFn.spec.js +0 -113
- package/parser/functions/api/apiStreamFn.spec.js +0 -44
- package/parser/functions/api/webflowRequestFn.spec.js +0 -114
- package/parser/functions/array/arrayDifferenceFn.spec.js +0 -34
- package/parser/functions/array/arrayFindFn.spec.js +0 -44
- package/parser/functions/array/arrayGroupByFn.spec.js +0 -41
- package/parser/functions/array/arrayIntersectionFn.spec.js +0 -22
- package/parser/functions/array/arrayMapFn.spec.js +0 -37
- package/parser/functions/array/arrayNoValueAs.spec.js +0 -56
- package/parser/functions/array/arrayPartitionFn.spec.js +0 -29
- package/parser/functions/array/arrayUnionFn.spec.js +0 -22
- package/parser/functions/array/arrayValueIfAs.spec.js +0 -54
- package/parser/functions/array/arrayValueOnly.spec.js +0 -61
- package/parser/functions/array/valueAttrOnly.spec.js +0 -61
- package/parser/functions/cloud/cloudAlgoliaRequestFn.spec.js +0 -30
- package/parser/functions/cloud/cloudAwsS3Fn.spec.js +0 -21
- package/parser/functions/cloud/cloudDeleteFileFn.spec.js +0 -25
- package/parser/functions/cloud/cloudGetFileInfoFn.spec.js +0 -25
- package/parser/functions/cloud/cloudListDirectoryFn.spec.js +0 -26
- package/parser/functions/cloud/cloudReadFileFn.spec.js +0 -25
- package/parser/functions/cloud/cloudSearchDocumentFn.spec.js +0 -28
- package/parser/functions/cloud/cloudSearchQueryFn.spec.js +0 -32
- package/parser/functions/cloud/cloudSearchRequestFn.spec.js +0 -32
- package/parser/functions/cloud/cloudSignUrlFn.spec.js +0 -26
- package/parser/functions/cloud/cloudStorageFn.spec.js +0 -21
- package/parser/functions/cloud/cloudUploadFileFn.spec.js +0 -29
- package/parser/functions/controls/awaitFn.spec.js +0 -48
- package/parser/functions/controls/conditionalFn.spec.js +0 -188
- package/parser/functions/controls/forEachFn.spec.js +0 -109
- package/parser/functions/controls/forFn.spec.js +0 -85
- package/parser/functions/controls/functionRunFn.spec.js +0 -87
- package/parser/functions/controls/groupFn.spec.js +0 -63
- package/parser/functions/controls/preconditionFn.spec.js +0 -107
- package/parser/functions/controls/returnFn.spec.js +0 -44
- package/parser/functions/controls/switchFn.spec.js +0 -118
- package/parser/functions/controls/throwFn.spec.js +0 -56
- package/parser/functions/controls/tryCatchFn.spec.js +0 -193
- package/parser/functions/controls/whileFn.spec.js +0 -94
- package/parser/functions/db/dbAddFn.spec.js +0 -72
- package/parser/functions/db/dbAddOrEditFn.spec.js +0 -97
- package/parser/functions/db/dbBulkAddFn.spec.js +0 -94
- package/parser/functions/db/dbBulkDeleteFn.spec.js +0 -28
- package/parser/functions/db/dbBulkPatchFn.spec.js +0 -42
- package/parser/functions/db/dbBulkUpdateFn.spec.js +0 -42
- package/parser/functions/db/dbDelFn.spec.js +0 -67
- package/parser/functions/db/dbDirectQueryFn.spec.js +0 -104
- package/parser/functions/db/dbEditFn.spec.js +0 -122
- package/parser/functions/db/dbExternalDirectQueryFn.spec.js +0 -103
- package/parser/functions/db/dbGetFn.spec.js +0 -117
- package/parser/functions/db/dbHasFn.spec.js +0 -62
- package/parser/functions/db/dbPatchFn.spec.js +0 -88
- package/parser/functions/db/dbQueryFn.spec.js +0 -380
- package/parser/functions/db/dbSchemaFn.spec.js +0 -42
- package/parser/functions/db/dbSetDatasourceFn.spec.js +0 -44
- package/parser/functions/db/dbTransactionFn.spec.js +0 -63
- package/parser/functions/db/dbTruncateFn.spec.js +0 -42
- package/parser/functions/debug/debugLogFn.spec.js +0 -44
- package/parser/functions/debug/debugStopFn.spec.js +0 -44
- package/parser/functions/expect/unitExpectToBeWithinFn.spec.js +0 -63
- package/parser/functions/expect/unitExpectToThrowFn.spec.js +0 -40
- package/parser/functions/expect/unitExpectWithArgumentsFn.spec.js +0 -355
- package/parser/functions/expect/unitExpectWithoutArgumentsFn.spec.js +0 -69
- package/parser/functions/expect/workflowExpectToBeWithinFn.spec.js +0 -70
- package/parser/functions/expect/workflowExpectToThrowFn.spec.js +0 -56
- package/parser/functions/expect/workflowExpectWithArgumentsFn.spec.js +0 -308
- package/parser/functions/expect/workflowExpectWithoutArgumentsFn.spec.js +0 -87
- package/parser/functions/math/allMathFn.spec.js +0 -100
- package/parser/functions/middlewareCallFn.spec.js +0 -44
- package/parser/functions/object/objectEntriesFn.spec.js +0 -44
- package/parser/functions/object/objectKeysFn.spec.js +0 -44
- package/parser/functions/object/objectValuesFn.spec.js +0 -44
- package/parser/functions/redis/redisCountFn.spec.js +0 -58
- package/parser/functions/redis/redisDecrFn.spec.js +0 -47
- package/parser/functions/redis/redisDelFn.spec.js +0 -58
- package/parser/functions/redis/redisGetFn.spec.js +0 -67
- package/parser/functions/redis/redisHasFn.spec.js +0 -58
- package/parser/functions/redis/redisIncrFn.spec.js +0 -74
- package/parser/functions/redis/redisKeysFn.spec.js +0 -67
- package/parser/functions/redis/redisPopFn.spec.js +0 -75
- package/parser/functions/redis/redisPushFn.spec.js +0 -71
- package/parser/functions/redis/redisRangeFn.spec.js +0 -80
- package/parser/functions/redis/redisRateLimitFn.spec.js +0 -87
- package/parser/functions/redis/redisRemoveFn.spec.js +0 -65
- package/parser/functions/redis/redisSetFn.spec.js +0 -89
- package/parser/functions/redis/redisShiftFn.spec.js +0 -75
- package/parser/functions/redis/redisUnshiftFn.spec.js +0 -73
- package/parser/functions/schema/schemaFn.spec.js +0 -92
- package/parser/functions/schema/schemaParseArrayFn.spec.js +0 -134
- package/parser/functions/schema/schemaParseAttributeFn.spec.js +0 -285
- package/parser/functions/schema/schemaParseConstantFn.spec.js +0 -122
- package/parser/functions/schema/schemaParseEnum.spec.js +0 -47
- package/parser/functions/schema/schemaParseImmutableFn.spec.js +0 -99
- package/parser/functions/schema/schemaParseObjectFn.spec.js +0 -223
- package/parser/functions/schema/utils.spec.js +0 -27
- package/parser/functions/security/securityCheckPasswordFn.spec.js +0 -22
- package/parser/functions/security/securityCreateAuthTokenFn.spec.js +0 -51
- package/parser/functions/security/securityCreateCurveKeyFn.spec.js +0 -22
- package/parser/functions/security/securityCreatePasswordFn.spec.js +0 -26
- package/parser/functions/security/securityCreateRsaKeyFn.spec.js +0 -22
- package/parser/functions/security/securityCreateSecretKeyFn.spec.js +0 -22
- package/parser/functions/security/securityCreateUuidFn.spec.js +0 -27
- package/parser/functions/security/securityDecryptFn.spec.js +0 -24
- package/parser/functions/security/securityEncryptFn.spec.js +0 -24
- package/parser/functions/security/securityJweDecodeFn.spec.js +0 -26
- package/parser/functions/security/securityJweDecodeLegacyFn.spec.js +0 -26
- package/parser/functions/security/securityJweEncodeFn.spec.js +0 -26
- package/parser/functions/security/securityJweEncodeLegacyFn.spec.js +0 -25
- package/parser/functions/security/securityJwsDecodeFn.spec.js +0 -25
- package/parser/functions/security/securityJwsEncodeFn.spec.js +0 -25
- package/parser/functions/security/securityRandomBytesFn.spec.js +0 -21
- package/parser/functions/security/securityRandomNumberFn.spec.js +0 -22
- package/parser/functions/storage/storageCreateAttachmentFn.spec.js +0 -87
- package/parser/functions/storage/storageCreateAudioFn.spec.js +0 -98
- package/parser/functions/storage/storageCreateFileResourceFn.spec.js +0 -72
- package/parser/functions/storage/storageCreateImageFn.spec.js +0 -98
- package/parser/functions/storage/storageCreateVideoFn.spec.js +0 -99
- package/parser/functions/storage/storageDeleteFileFn.spec.js +0 -67
- package/parser/functions/storage/storageReadFileResourceFn.spec.js +0 -60
- package/parser/functions/storage/storageSignPrivateUrlFn.spec.js +0 -72
- package/parser/functions/stream/streamFromCsvFn.spec.js +0 -69
- package/parser/functions/stream/streamFromJsonlFn.spec.js +0 -47
- package/parser/functions/stream/streamFromRequestFn.spec.js +0 -103
- package/parser/functions/text/allTextWithReturnValueFn.spec.js +0 -100
- package/parser/functions/text/allTextWithoutReturnValueFn.spec.js +0 -122
- package/parser/functions/toolCallFn.spec.js +0 -28
- package/parser/functions/triggerCallFn.spec.js +0 -51
- package/parser/functions/unitExpectFn.spec.js +0 -21
- package/parser/functions/util/utilGeoDistanceFn.spec.js +0 -79
- package/parser/functions/util/utilGetAllInputFn.spec.js +0 -33
- package/parser/functions/util/utilGetEnvFn.spec.js +0 -33
- package/parser/functions/util/utilGetRawInputFn.spec.js +0 -62
- package/parser/functions/util/utilGetVarsFn.spec.js +0 -33
- package/parser/functions/util/utilIpLookupFn.spec.js +0 -37
- package/parser/functions/util/utilPostProcessFn.spec.js +0 -63
- package/parser/functions/util/utilSendEmailFn.spec.js +0 -62
- package/parser/functions/util/utilSetHeaderFn.spec.js +0 -48
- package/parser/functions/util/utilSleepFn.spec.js +0 -44
- package/parser/functions/util/utilTemplateFn.spec.js +0 -78
- package/parser/functions/varFn.spec.js +0 -332
- package/parser/functions/workflowExpectFn.spec.js +0 -32
- package/parser/functions/zip/zipAddToArchiveFn.spec.js +0 -78
- package/parser/functions/zip/zipCreateArchiveFn.spec.js +0 -53
- package/parser/functions/zip/zipDeleteFromArchiveFn.spec.js +0 -69
- package/parser/functions/zip/zipExtractFn.spec.js +0 -52
- package/parser/functions/zip/zipViewContentsFn.spec.js +0 -52
- package/parser/generic/arrayWithValues.spec.js +0 -72
- package/parser/generic/asVariable.spec.js +0 -117
- package/parser/generic/assignableVariableAs.spec.js +0 -126
- package/parser/generic/assignableVariableProperty.spec.js +0 -138
- package/parser/generic/castedValue.spec.js +0 -29
- package/parser/generic/chainedIdentifier.spec.js +0 -89
- package/parser/generic/completeAuthVariable.spec.js +0 -23
- package/parser/generic/completeEnvVariable.spec.js +0 -99
- package/parser/generic/completeErrorVariable.spec.js +0 -17
- package/parser/generic/completeInputVariable.spec.js +0 -53
- package/parser/generic/expressionFn.spec.js +0 -605
- package/parser/generic/filterFn.spec.js +0 -47
- package/parser/generic/functionAttrReq.spec.js +0 -353
- package/parser/generic/longFormVariable.spec.js +0 -25
- package/parser/generic/minimalFnBody.spec.js +0 -47
- package/parser/generic/mockAttribute.spec.js +0 -57
- package/parser/generic/multilineFilterFn.spec.js +0 -51
- package/parser/generic/objectWithAttributes.spec.js +0 -147
- package/parser/generic/requiredValueFnBody.spec.js +0 -56
- package/parser/generic/shortFormVariable.spec.js +0 -27
- package/parser/generic/stringArray.spec.js +0 -55
- package/parser/generic/tagsAttribute.spec.js +0 -47
- package/parser/generic/variableOnly.spec.js +0 -47
- package/parser/mcp_server_parser.spec.js +0 -478
- package/parser/mcp_server_trigger_parser.spec.js +0 -396
- package/parser/metadata/columnMetadataDefinition.spec.js +0 -47
- package/parser/metadata/enumColumnMetadataDefinition.spec.js +0 -81
- package/parser/middleware_parser.spec.js +0 -230
- package/parser/multidoc.spec.js +0 -946
- package/parser/query_parser.spec.js +0 -202
- package/parser/realtime_channel_parser.spec.js +0 -20
- package/parser/realtime_trigger_parser.spec.js +0 -469
- package/parser/run_parser.spec.js +0 -100
- package/parser/table_parser.spec.js +0 -176
- package/parser/table_trigger_parser.spec.js +0 -478
- package/parser/task_parser.spec.js +0 -94
- package/parser/tests/agent/agent_parser.spec.js +0 -52
- package/parser/tests/agent/valid_sources/customer_servier_agent.xs +0 -45
- package/parser/tests/api_group/api_group_parser.spec.js +0 -52
- package/parser/tests/api_group/valid_sources/api_group_history.xs +0 -4
- package/parser/tests/api_group/valid_sources/basic_api_group.xs +0 -3
- package/parser/tests/api_group/valid_sources/complete_api_group.xs +0 -7
- package/parser/tests/api_group/valid_sources/protected_api_group.xs +0 -7
- package/parser/tests/function/function_parser.spec.js +0 -52
- package/parser/tests/function/valid_sources/all_controls.xs +0 -68
- package/parser/tests/function/valid_sources/all_query_return_types.xs +0 -227
- package/parser/tests/function/valid_sources/all_storage.xs +0 -45
- package/parser/tests/function/valid_sources/discord_poll_send_to_slack.xs +0 -133
- package/parser/tests/function/valid_sources/expression_in_response.xs +0 -22
- package/parser/tests/function/valid_sources/filter_by_value.xs +0 -55
- package/parser/tests/function/valid_sources/filter_query.xs +0 -82
- package/parser/tests/function/valid_sources/large_regex.xs +0 -13
- package/parser/tests/function/valid_sources/ledash_ends_with.xs +0 -90
- package/parser/tests/function/valid_sources/multiline_description.xs +0 -28
- package/parser/tests/function/valid_sources/multiline_expr.xs +0 -41
- package/parser/tests/function/valid_sources/set_theory_fn.xs +0 -129
- package/parser/tests/function/valid_sources/simple_unit_test.xs +0 -33
- package/parser/tests/function/valid_sources/valid_officer.xs +0 -57
- package/parser/tests/function/valid_sources/webflow.xs +0 -18
- package/parser/tests/query/query_parser.spec.js +0 -54
- package/parser/tests/query/valid_sources/all_basics.xs +0 -51
- package/parser/tests/query/valid_sources/all_cloud.xs +0 -141
- package/parser/tests/query/valid_sources/all_db.xs +0 -102
- package/parser/tests/query/valid_sources/all_external_db.xs +0 -43
- package/parser/tests/query/valid_sources/all_keywords.xs +0 -65
- package/parser/tests/query/valid_sources/all_math.xs +0 -53
- package/parser/tests/query/valid_sources/all_object.xs +0 -25
- package/parser/tests/query/valid_sources/all_redis.xs +0 -106
- package/parser/tests/query/valid_sources/all_security.xs +0 -105
- package/parser/tests/query/valid_sources/all_stream.xs +0 -69
- package/parser/tests/query/valid_sources/all_text.xs +0 -54
- package/parser/tests/query/valid_sources/all_util.xs +0 -66
- package/parser/tests/query/valid_sources/all_zip.xs +0 -39
- package/parser/tests/query/valid_sources/arrays.xs +0 -33
- package/parser/tests/query/valid_sources/disabled_response.xs +0 -27
- package/parser/tests/query/valid_sources/multiline_lambda_GET.xs +0 -50
- package/parser/tests/query/valid_sources/mutliline_query.xs +0 -140
- package/parser/tests/query/valid_sources/patch_expression_multiline.xs +0 -27
- package/parser/tests/query/valid_sources/query_cache.xs +0 -34
- package/parser/tests/query/valid_sources/query_example.xs +0 -43
- package/parser/tests/query/valid_sources/query_mini.xs +0 -11
- package/parser/tests/query/valid_sources/query_rich_inputs.xs +0 -32
- package/parser/tests/query/valid_sources/simple_unit_test.xs +0 -33
- package/parser/tests/query/valid_sources/test_with_slashes.xs +0 -22
- package/parser/tests/query/valid_sources/with_unit_test.xs +0 -97
- package/parser/tests/table/table_parser.spec.js +0 -52
- package/parser/tests/table/valid_sources/account.xs +0 -31
- package/parser/tests/table/valid_sources/all_basic_columns.xs +0 -44
- package/parser/tests/table/valid_sources/basic_table.xs +0 -15
- package/parser/tests/table/valid_sources/empty_object.xs +0 -17
- package/parser/tests/table/valid_sources/empty_table.xs +0 -3
- package/parser/tests/table/valid_sources/multiline_index.xs +0 -33
- package/parser/tests/table/valid_sources/relation.xs +0 -44
- package/parser/tests/table/valid_sources/rich_columns.xs +0 -31
- package/parser/tests/table/valid_sources/table_with_comments.xs +0 -17
- package/parser/tests/table/valid_sources/table_with_search_index.xs +0 -31
- package/parser/tests/table/valid_sources/view_table.xs +0 -62
- package/parser/tests/task/task_parser.spec.js +0 -53
- package/parser/tests/task/valid_sources/active_event.xs +0 -11
- package/parser/tests/task/valid_sources/all_events.xs +0 -17
- package/parser/tests/task/valid_sources/create_leak.xs +0 -165
- package/parser/tests/task/valid_sources/daily_sales_report.xs +0 -56
- package/parser/tests/task/valid_sources/inactive_event.xs +0 -11
- package/parser/tests/variable_test/coverage_check.xs +0 -293
- package/parser/tests/workflow_test/valid_sources/basic_workflow_test.xs +0 -13
- package/parser/tests/workflow_test/workflow_test_parser.spec.js +0 -52
- package/parser/tool_parser.spec.js +0 -115
- package/parser/variableValidator.spec.js +0 -179
- package/parser/workflow_test_parser.spec.js +0 -136
- package/parser/workspace_parser.spec.js +0 -142
- package/parser/workspace_trigger_parser.spec.js +0 -332
- package/toTmLanguage.js +0 -75
- package/utils.spec.js +0 -369
- package/workspace/crossFileValidator.spec.js +0 -654
- package/workspace/referenceTracking.spec.js +0 -420
- package/workspace/workspaceIndex.spec.js +0 -189
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
task claim_reminders {
|
|
2
|
-
description = "Runs every 6 hours to send reminders for claims stalled at the assessment, review, or approval workflow stages."
|
|
3
|
-
|
|
4
|
-
stack {
|
|
5
|
-
debug.log {
|
|
6
|
-
value = "Claim reminders task started"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// --- Cutoff timestamps ---
|
|
10
|
-
|
|
11
|
-
var $forty_eight_hours_ago {
|
|
12
|
-
value = now|transform_timestamp:"-48 hours"
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
var $twenty_four_hours_ago {
|
|
16
|
-
value = now|transform_timestamp:"-24 hours"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var $twelve_hours_ago {
|
|
20
|
-
value = now|transform_timestamp:"-12 hours"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var $assessment_reminder_count {
|
|
24
|
-
value = 0
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var $review_reminder_count {
|
|
28
|
-
value = 0
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var $approval_reminder_count {
|
|
32
|
-
value = 0
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// === Step 1: Garage Assessment Reminders (stalled > 48h) ===
|
|
36
|
-
|
|
37
|
-
db.query claim {
|
|
38
|
-
where = ($db.claim.workflow_status == "assessment" && $db.claim.updated_at < $forty_eight_hours_ago)
|
|
39
|
-
} as $assessment_claims
|
|
40
|
-
|
|
41
|
-
foreach ($assessment_claims) {
|
|
42
|
-
each as $claim {
|
|
43
|
-
try_catch {
|
|
44
|
-
try {
|
|
45
|
-
function.run "communication/send_notification" {
|
|
46
|
-
input = {
|
|
47
|
-
user_id : $claim.garage_id
|
|
48
|
-
claim_id: $claim.id
|
|
49
|
-
message : "Reminder: Vehicle assessment for claim " ~ $claim.claim_number ~ " is awaiting your action. Please complete the assessment report at your earliest convenience."
|
|
50
|
-
subject : "Assessment Reminder - Claim " ~ $claim.claim_number
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var.update $assessment_reminder_count {
|
|
55
|
-
value = $assessment_reminder_count + 1
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
debug.log {
|
|
60
|
-
value = {
|
|
61
|
-
error : "Failed to send assessment reminder"
|
|
62
|
-
claim_number: $claim.claim_number
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
debug.log {
|
|
71
|
-
value = "Assessment reminders sent: " ~ $assessment_reminder_count
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// === Step 2: Agent Review Reminders (stalled > 24h) ===
|
|
75
|
-
|
|
76
|
-
db.query claim {
|
|
77
|
-
where = ($db.claim.workflow_status == "review" && $db.claim.updated_at < $twenty_four_hours_ago)
|
|
78
|
-
} as $review_claims
|
|
79
|
-
|
|
80
|
-
foreach ($review_claims) {
|
|
81
|
-
each as $claim {
|
|
82
|
-
try_catch {
|
|
83
|
-
try {
|
|
84
|
-
function.run "communication/send_notification" {
|
|
85
|
-
input = {
|
|
86
|
-
user_id : $claim.assigned_agent_id
|
|
87
|
-
claim_id: $claim.id
|
|
88
|
-
message : "Reminder: Claim " ~ $claim.claim_number ~ " is awaiting your review. Please complete your review to keep the claim moving forward."
|
|
89
|
-
subject : "Review Reminder - Claim " ~ $claim.claim_number
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
var.update $review_reminder_count {
|
|
94
|
-
value = $review_reminder_count + 1
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
catch {
|
|
98
|
-
debug.log {
|
|
99
|
-
value = {
|
|
100
|
-
error : "Failed to send review reminder"
|
|
101
|
-
claim_number: $claim.claim_number
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
debug.log {
|
|
110
|
-
value = "Review reminders sent: " ~ $review_reminder_count
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// === Step 3: Agent Approval Reminders - URGENT (stalled > 12h) ===
|
|
114
|
-
|
|
115
|
-
db.query claim {
|
|
116
|
-
where = ($db.claim.workflow_status == "approval" && $db.claim.updated_at < $twelve_hours_ago)
|
|
117
|
-
} as $approval_claims
|
|
118
|
-
|
|
119
|
-
foreach ($approval_claims) {
|
|
120
|
-
each as $claim {
|
|
121
|
-
try_catch {
|
|
122
|
-
try {
|
|
123
|
-
function.run "communication/send_notification" {
|
|
124
|
-
input = {
|
|
125
|
-
user_id : $claim.assigned_agent_id
|
|
126
|
-
claim_id: $claim.id
|
|
127
|
-
message : "URGENT: Claim " ~ $claim.claim_number ~ " requires your immediate approval. This claim has been pending approval for over 12 hours. Please review and take action as soon as possible."
|
|
128
|
-
subject : "URGENT: Approval Required - Claim " ~ $claim.claim_number
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var.update $approval_reminder_count {
|
|
133
|
-
value = $approval_reminder_count + 1
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
catch {
|
|
137
|
-
debug.log {
|
|
138
|
-
value = {
|
|
139
|
-
error : "Failed to send approval reminder"
|
|
140
|
-
claim_number: $claim.claim_number
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
debug.log {
|
|
149
|
-
value = "Approval reminders sent: " ~ $approval_reminder_count
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// === Step 4: Final summary ===
|
|
153
|
-
|
|
154
|
-
debug.log {
|
|
155
|
-
value = {
|
|
156
|
-
assessment_reminders_sent: $assessment_reminder_count
|
|
157
|
-
review_reminders_sent : $review_reminder_count
|
|
158
|
-
approval_reminders_sent : $approval_reminder_count
|
|
159
|
-
total_reminders_sent : ($assessment_reminder_count + $review_reminder_count + $approval_reminder_count)
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
schedule = [{starts_on: 2026-01-01 00:00:00+0000, freq: 21600}]
|
|
165
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
task daily_sales_report {
|
|
2
|
-
description = "Daily at 11 PM UTC generate a sales report by querying all payment transactions from the past 24 hours and calculating the total sales amount and transaction count. The task automatically executes every day starting from May 1, 2026, providing a summary of daily sales performance."
|
|
3
|
-
stack {
|
|
4
|
-
var $twenty_four_hours_ago {
|
|
5
|
-
value = (now|to_timestamp|transform_timestamp:"24 hours ago":"UTC")
|
|
6
|
-
description = "Calculate timestamp for 24 hours ago"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
db.query payment_transactions {
|
|
10
|
-
description = "Get all transactions from the past 24 hours"
|
|
11
|
-
where = $db.payment_transactions.transaction_date >= $twenty_four_hours_ago
|
|
12
|
-
} as $daily_sales
|
|
13
|
-
|
|
14
|
-
var $transaction_count {
|
|
15
|
-
value = $daily_sales|count
|
|
16
|
-
description = "Count number of transactions"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var $total_sales {
|
|
20
|
-
value = ($daily_sales[$$].amount)|sum
|
|
21
|
-
description = "Initialize total sales amount"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var $report_date {
|
|
25
|
-
value = now|to_timestamp
|
|
26
|
-
description = "Current timestamp for the report"
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
db.transaction {
|
|
30
|
-
description = "Store daily sales report with data consistency"
|
|
31
|
-
stack {
|
|
32
|
-
db.add reports {
|
|
33
|
-
data = {
|
|
34
|
-
report_type : "daily_sales"
|
|
35
|
-
report_date : $report_date
|
|
36
|
-
total_sales : $total_sales
|
|
37
|
-
transaction_count: $transaction_count
|
|
38
|
-
period_start : $twenty_four_hours_ago
|
|
39
|
-
period_end : $report_date
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
description = "Insert daily sales report into reports table"
|
|
43
|
-
} as $report_result
|
|
44
|
-
|
|
45
|
-
debug.log {
|
|
46
|
-
value = "Daily sales report generated successfully"
|
|
47
|
-
description = "Log successful report generation"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
schedule = [{starts_on: 2026-05-01 23:00:00+0000, freq: 86400}]
|
|
54
|
-
|
|
55
|
-
history = "inherit"
|
|
56
|
-
}
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
// Valide a couverture pour un assuré
|
|
2
|
-
query "coverage/check" verb=GET {
|
|
3
|
-
api_group = "coverage"
|
|
4
|
-
|
|
5
|
-
input {
|
|
6
|
-
// VIN (17 caractères)
|
|
7
|
-
text vin filters=trim|upper
|
|
8
|
-
|
|
9
|
-
// Code garage (optionnel)
|
|
10
|
-
text shop_code? filters=trim|upper
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
stack {
|
|
14
|
-
// Recherche et validation du véhicule
|
|
15
|
-
group {
|
|
16
|
-
stack {
|
|
17
|
-
// Trouve le vehicle a partir du VIN
|
|
18
|
-
db.query vehicle {
|
|
19
|
-
where = $db.vehicle.vin == $input.vin
|
|
20
|
-
return = {type: "single"}
|
|
21
|
-
mock = {
|
|
22
|
-
"devrait retourner véhicule sans police" : {id: 2, vin: "2HGCM82633A004353", make: "Toyota", model: "Camry", year: 2021, owner_name: "Marie Martin"}
|
|
23
|
-
"devrait échouer si VIN introuvable" : null
|
|
24
|
-
"devrait avoir coverages vide si pas de police": {id: 2, vin: "2HGCM82633A004353", make: "Toyota", model: "Camry", year: 2021, owner_name: "Marie Martin"}
|
|
25
|
-
}
|
|
26
|
-
} as $vehicle
|
|
27
|
-
|
|
28
|
-
// Véhicule requis
|
|
29
|
-
precondition ($vehicle != null) {
|
|
30
|
-
error_type = "notfound"
|
|
31
|
-
error = "Vehicle not found with VIN: " ~ $input.vin
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var $unused_variable {
|
|
36
|
-
value = "This variable is not used anywhere in the code"
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Réponse véhicule
|
|
40
|
-
var $vehicle_response {
|
|
41
|
-
value = {
|
|
42
|
-
vin : $vehicle.vin
|
|
43
|
-
make : $vehicle.make
|
|
44
|
-
model : $vehicle.model
|
|
45
|
-
year : $vehicle.year
|
|
46
|
-
owner_name: $vehicle.owner_name
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Recherche de la police d'assurance active
|
|
53
|
-
group {
|
|
54
|
-
stack {
|
|
55
|
-
// Police active du véhicule
|
|
56
|
-
db.query insurance_policy {
|
|
57
|
-
where = $db.insurance_policy.vehicle_id == $vehicle.id && $db.insurance_policy.status == "active"
|
|
58
|
-
return = {type: "single"}
|
|
59
|
-
mock = {
|
|
60
|
-
"devrait retourner véhicule sans police" : null
|
|
61
|
-
"devrait avoir coverages vide si pas de police": null
|
|
62
|
-
}
|
|
63
|
-
} as $policy
|
|
64
|
-
|
|
65
|
-
// Init réponses
|
|
66
|
-
var $policy_response {
|
|
67
|
-
value = null
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var $coverages_response {
|
|
71
|
-
value = []
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var $claims_summary {
|
|
75
|
-
value = {total_claims: 0, recent_claims: []}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Traitement si police active
|
|
81
|
-
conditional {
|
|
82
|
-
if ($policy != null) {
|
|
83
|
-
// Construction de la réponse police
|
|
84
|
-
group {
|
|
85
|
-
stack {
|
|
86
|
-
// Réponse police
|
|
87
|
-
var.update $policy_response {
|
|
88
|
-
value = {
|
|
89
|
-
policy_number : $policy.policy_number
|
|
90
|
-
status : $policy.status
|
|
91
|
-
effective_date : $policy.effective_date
|
|
92
|
-
expiration_date: $policy.expiration_date
|
|
93
|
-
insurer_name : $policy.insurer_name
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Récupération des couvertures
|
|
100
|
-
group {
|
|
101
|
-
stack {
|
|
102
|
-
db.query policy_coverage {
|
|
103
|
-
where = $db.policy_coverage.policy_id == $policy.id
|
|
104
|
-
return = {type: "list"}
|
|
105
|
-
} as $policy_coverages
|
|
106
|
-
|
|
107
|
-
// Requête par couverture
|
|
108
|
-
foreach ($policy_coverages) {
|
|
109
|
-
each as $pc {
|
|
110
|
-
db.get coverage_type {
|
|
111
|
-
field_name = "id"
|
|
112
|
-
field_value = $pc.coverage_type_id
|
|
113
|
-
} as $ctype
|
|
114
|
-
|
|
115
|
-
// Objet couverture
|
|
116
|
-
var $coverage_item {
|
|
117
|
-
value = {
|
|
118
|
-
code : $ctype.code
|
|
119
|
-
name : $ctype.name
|
|
120
|
-
coverage_limit: $pc.coverage_limit
|
|
121
|
-
deductible : $pc.deductible
|
|
122
|
-
is_active : $pc.is_active
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Ajout au tableau
|
|
127
|
-
array.push $coverages_response {
|
|
128
|
-
value = $coverage_item
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Récupération et filtrage des sinistres
|
|
136
|
-
group {
|
|
137
|
-
stack {
|
|
138
|
-
// Récupère TOUS les sinistres puis filtre en code
|
|
139
|
-
db.query claim {
|
|
140
|
-
where = $db.claim.policy_id == $policy.id
|
|
141
|
-
return = {type: "list"}
|
|
142
|
-
} as $all_claims
|
|
143
|
-
|
|
144
|
-
// Total sinistres
|
|
145
|
-
var $total_claims_count {
|
|
146
|
-
value = $all_claims|count
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Date il y a 2 ans
|
|
150
|
-
var $two_years_ago {
|
|
151
|
-
value = now|transform_timestamp:"-2 years"
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Filtrage en code (au lieu de SQL)
|
|
155
|
-
var $recent_claims_list {
|
|
156
|
-
value = []
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
foreach ($all_claims) {
|
|
160
|
-
each as $claim {
|
|
161
|
-
// Date en timestamp
|
|
162
|
-
var $claim_date_ts {
|
|
163
|
-
value = $claim.incident_date|to_timestamp
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// ⚠️ Filtre en code - devrait être en SQL
|
|
167
|
-
conditional {
|
|
168
|
-
if ($claim_date_ts >= $two_years_ago) {
|
|
169
|
-
var $recent_claim_item {
|
|
170
|
-
value = {
|
|
171
|
-
claim_number : $claim.claim_number
|
|
172
|
-
incident_date : $claim.incident_date
|
|
173
|
-
status : $claim.status
|
|
174
|
-
amount_claimed: $claim.amount_claimed
|
|
175
|
-
amount_paid : $claim.amount_paid
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
array.push $recent_claims_list {
|
|
180
|
-
value = $recent_claim_item
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Résumé sinistres
|
|
188
|
-
var.update $claims_summary {
|
|
189
|
-
value = {
|
|
190
|
-
total_claims : $total_claims_count
|
|
191
|
-
recent_claims: $recent_claims_list
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Recherche du garage si code fourni
|
|
200
|
-
group {
|
|
201
|
-
stack {
|
|
202
|
-
var $queried_by {
|
|
203
|
-
value = null
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
conditional {
|
|
207
|
-
if ($input.shop_code != null && ($input.shop_code|strlen) > 0) {
|
|
208
|
-
// Récupère garage
|
|
209
|
-
db.query repair_shop {
|
|
210
|
-
where = $db.repair_shop.shop_code == $input.shop_code
|
|
211
|
-
return = {type: "single"}
|
|
212
|
-
} as $shop
|
|
213
|
-
|
|
214
|
-
// Si garage trouvé
|
|
215
|
-
conditional {
|
|
216
|
-
if ($shop != null) {
|
|
217
|
-
var.update $queried_by {
|
|
218
|
-
value = {shop_code: $shop.shop_code, shop_name: $shop.name}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Construction de la réponse finale
|
|
228
|
-
group {
|
|
229
|
-
stack {
|
|
230
|
-
var $result {
|
|
231
|
-
value = {
|
|
232
|
-
vehicle : $vehicle_response
|
|
233
|
-
policy : $policy_response
|
|
234
|
-
coverages : $coverages_response
|
|
235
|
-
claims_summary: $claims_summary
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// Ajoute queried_by si présent
|
|
240
|
-
conditional {
|
|
241
|
-
if ($queried_by != null) {
|
|
242
|
-
var.update $result {
|
|
243
|
-
value = $result|set:"queried_by":$queried_by
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
response = $result
|
|
252
|
-
history = 100
|
|
253
|
-
|
|
254
|
-
test "devrait retourner véhicule sans police" {
|
|
255
|
-
input = {vin: "2HGCM82633A004353"}
|
|
256
|
-
|
|
257
|
-
expect.to_equal ($response.vehicle.vin) {
|
|
258
|
-
value = "2HGCM82633A004353"
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
expect.to_equal ($response.vehicle.make) {
|
|
262
|
-
value = "Toyota"
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
expect.to_be_null ($response.policy)
|
|
266
|
-
expect.to_be_empty ($response.coverages)
|
|
267
|
-
expect.to_equal ($response.claims_summary.total_claims) {
|
|
268
|
-
value = 0
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
test "devrait échouer si VIN introuvable" {
|
|
273
|
-
input = {vin: "INVALID12345678901"}
|
|
274
|
-
|
|
275
|
-
expect.to_throw {
|
|
276
|
-
exception = "ERROR_CODE_NOT_FOUND"
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
test "devrait avoir coverages vide si pas de police" {
|
|
281
|
-
input = {vin: "2HGCM82633A004353"}
|
|
282
|
-
|
|
283
|
-
expect.to_be_empty ($response.coverages)
|
|
284
|
-
expect.to_be_null ($response.policy)
|
|
285
|
-
expect.to_equal ($response.claims_summary.total_claims) {
|
|
286
|
-
value = 0
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
expect.to_be_empty ($response.claims_summary.recent_claims)
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
guid = "n20O4mlUR72ZWVYiGAE-QFk_ZO4"
|
|
293
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { readdirSync, readFileSync } from "fs";
|
|
3
|
-
import { truncate } from "lodash-es";
|
|
4
|
-
import { describe, it } from "mocha";
|
|
5
|
-
import { dirname, join } from "path";
|
|
6
|
-
import { xanoscriptParser } from "../../parser.js";
|
|
7
|
-
|
|
8
|
-
describe("Xanoscript WorkflowTest Parser", () => {
|
|
9
|
-
it("parses all the valid sources", () => {
|
|
10
|
-
const errors = [];
|
|
11
|
-
const files = readdirSync(
|
|
12
|
-
join(dirname("./"), "parser/tests/workflow_test/valid_sources")
|
|
13
|
-
);
|
|
14
|
-
files.forEach((file) => {
|
|
15
|
-
const source = readFileSync(
|
|
16
|
-
join(dirname("./"), "parser/tests/workflow_test/valid_sources", file),
|
|
17
|
-
"utf8"
|
|
18
|
-
);
|
|
19
|
-
const parser = xanoscriptParser(source);
|
|
20
|
-
|
|
21
|
-
if (parser.errors.length > 0) {
|
|
22
|
-
parser.errors.forEach((error) => {
|
|
23
|
-
errors.push({
|
|
24
|
-
previous: error.previousToken
|
|
25
|
-
? `${error.previousToken.tokenType.name} (${truncate(
|
|
26
|
-
error.previousToken.image,
|
|
27
|
-
{
|
|
28
|
-
length: 20,
|
|
29
|
-
}
|
|
30
|
-
)})`
|
|
31
|
-
: "N/A",
|
|
32
|
-
file: `parser/tests/api_group/valid_sources/${file}:${error.token.startLine}:${error.token.startColumn}`,
|
|
33
|
-
stack: parser.sectionStack[parser.sectionStack.length - 1],
|
|
34
|
-
message: truncate(error.message, { length: 50 }),
|
|
35
|
-
token: `${error.token.tokenType.name} (${truncate(
|
|
36
|
-
error.token.image,
|
|
37
|
-
{
|
|
38
|
-
length: 20,
|
|
39
|
-
}
|
|
40
|
-
)})`,
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
if (errors.length > 0) {
|
|
47
|
-
console.table(errors);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
expect(errors).to.be.empty;
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { describe, it } from "mocha";
|
|
3
|
-
import { xanoscriptParser } from "./parser.js";
|
|
4
|
-
|
|
5
|
-
describe("tool_parser", () => {
|
|
6
|
-
it("should parse a basic tool", () => {
|
|
7
|
-
const parser = xanoscriptParser(`tool foo {
|
|
8
|
-
input {
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
stack {
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
response = null
|
|
15
|
-
}`);
|
|
16
|
-
|
|
17
|
-
expect(parser.errors).to.be.empty;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("should parse a basic a string tool url", () => {
|
|
21
|
-
const parser = xanoscriptParser(`tool "foo/bar" {
|
|
22
|
-
input {
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
stack {
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
response = null
|
|
29
|
-
}`);
|
|
30
|
-
|
|
31
|
-
expect(parser.errors).to.be.empty;
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("should parse a tool with a string as a response", () => {
|
|
35
|
-
const parser = xanoscriptParser(`tool silent_exception {
|
|
36
|
-
input {
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
stack {
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
response = "something is wrong"
|
|
43
|
-
}`);
|
|
44
|
-
expect(parser.errors).to.be.empty;
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("tool don't accept dynamic params", () => {
|
|
48
|
-
const parser = xanoscriptParser(`tool foo/{user_id} {
|
|
49
|
-
input {
|
|
50
|
-
text user_id filters=trim
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
stack {
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
response = null
|
|
57
|
-
}`);
|
|
58
|
-
|
|
59
|
-
expect(parser.errors).to.not.be.empty;
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it("should parse a tool with instructions as a string", () => {
|
|
63
|
-
const parser = xanoscriptParser(`tool foo {
|
|
64
|
-
instructions = "This tool does something"
|
|
65
|
-
|
|
66
|
-
input {
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
stack {
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
response = null
|
|
73
|
-
}`);
|
|
74
|
-
|
|
75
|
-
expect(parser.errors).to.be.empty;
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it("should parse a tool with instructions as a multiline string", () => {
|
|
79
|
-
const parser = xanoscriptParser(`tool foo {
|
|
80
|
-
instructions = """
|
|
81
|
-
This tool does multiple things:
|
|
82
|
-
- First thing
|
|
83
|
-
- Second thing
|
|
84
|
-
"""
|
|
85
|
-
|
|
86
|
-
input {
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
stack {
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
response = null
|
|
93
|
-
}`);
|
|
94
|
-
|
|
95
|
-
expect(parser.errors).to.be.empty;
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it("should parse a tool with multiple clauses including instructions", () => {
|
|
99
|
-
const parser = xanoscriptParser(`tool foo {
|
|
100
|
-
description = "A test tool"
|
|
101
|
-
instructions = "Follow these instructions"
|
|
102
|
-
|
|
103
|
-
input {
|
|
104
|
-
text param
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
stack {
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
response = null
|
|
111
|
-
}`);
|
|
112
|
-
|
|
113
|
-
expect(parser.errors).to.be.empty;
|
|
114
|
-
});
|
|
115
|
-
});
|