@wix/mcp 1.0.75 → 1.0.76
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/build/bin-standalone.js +83486 -12285
- package/build/dts/index.d.ts +1 -0
- package/build/dts/index.js +0 -1
- package/build/dts/infra/tool-bi.d.ts +4 -4
- package/build/dts/infra/tool-bi.js +1 -1
- package/build/dts/toolkit-entry.d.cts +410 -0
- package/build/dts/toolkit-entry.d.ts +409 -19
- package/build/dts/toolkit-entry.js +0 -1
- package/build/dts/toolkit-types.d.ts +31 -0
- package/build/dts/toolkit-types.js +12 -0
- package/build/dts/toolkit.d.ts +5 -5
- package/package.json +26 -19
- package/build/bin-standalone.js.map +0 -7
- package/build/cjs/index.cjs.map +0 -7
- package/build/cjs/toolkit.cjs.map +0 -7
- package/build/dts/api-call/index.d.ts.map +0 -1
- package/build/dts/api-call/index.js.map +0 -1
- package/build/dts/api-call/upload-image-tool.d.ts.map +0 -1
- package/build/dts/api-call/upload-image-tool.js.map +0 -1
- package/build/dts/api-call/upload-image-tool.test.d.ts +0 -2
- package/build/dts/api-call/upload-image-tool.test.d.ts.map +0 -1
- package/build/dts/api-call/upload-image-tool.test.js +0 -217
- package/build/dts/api-call/upload-image-tool.test.js.map +0 -1
- package/build/dts/api-call/upload-image-utils.d.ts.map +0 -1
- package/build/dts/api-call/upload-image-utils.js.map +0 -1
- package/build/dts/api-call/upload-image-utils.test.d.ts +0 -2
- package/build/dts/api-call/upload-image-utils.test.d.ts.map +0 -1
- package/build/dts/api-call/upload-image-utils.test.js +0 -121
- package/build/dts/api-call/upload-image-utils.test.js.map +0 -1
- package/build/dts/api-call/validation.d.ts.map +0 -1
- package/build/dts/api-call/validation.js.map +0 -1
- package/build/dts/api-call/validation.test.d.ts +0 -2
- package/build/dts/api-call/validation.test.d.ts.map +0 -1
- package/build/dts/api-call/validation.test.js +0 -42
- package/build/dts/api-call/validation.test.js.map +0 -1
- package/build/dts/auth/auth-error-handling.test.d.ts +0 -2
- package/build/dts/auth/auth-error-handling.test.d.ts.map +0 -1
- package/build/dts/auth/auth-error-handling.test.js +0 -347
- package/build/dts/auth/auth-error-handling.test.js.map +0 -1
- package/build/dts/auth/index.d.ts.map +0 -1
- package/build/dts/auth/index.js.map +0 -1
- package/build/dts/bin.d.ts.map +0 -1
- package/build/dts/bin.js.map +0 -1
- package/build/dts/cli-tools/account-auth-strategy.d.ts.map +0 -1
- package/build/dts/cli-tools/account-auth-strategy.js.map +0 -1
- package/build/dts/cli-tools/account-token-store.d.ts.map +0 -1
- package/build/dts/cli-tools/account-token-store.js.map +0 -1
- package/build/dts/cli-tools/cli.d.ts.map +0 -1
- package/build/dts/cli-tools/cli.js.map +0 -1
- package/build/dts/cli-tools/utils.d.ts.map +0 -1
- package/build/dts/cli-tools/utils.js.map +0 -1
- package/build/dts/code-mode/index.d.ts.map +0 -1
- package/build/dts/code-mode/index.js.map +0 -1
- package/build/dts/code-mode/index.test.d.ts +0 -2
- package/build/dts/code-mode/index.test.d.ts.map +0 -1
- package/build/dts/code-mode/index.test.js +0 -342
- package/build/dts/code-mode/index.test.js.map +0 -1
- package/build/dts/code-mode/truncate-response.d.ts.map +0 -1
- package/build/dts/code-mode/truncate-response.js.map +0 -1
- package/build/dts/code-mode/truncate-response.test.d.ts +0 -2
- package/build/dts/code-mode/truncate-response.test.d.ts.map +0 -1
- package/build/dts/code-mode/truncate-response.test.js +0 -32
- package/build/dts/code-mode/truncate-response.test.js.map +0 -1
- package/build/dts/code-mode/validation.d.ts.map +0 -1
- package/build/dts/code-mode/validation.js.map +0 -1
- package/build/dts/code-mode/validation.test.d.ts +0 -2
- package/build/dts/code-mode/validation.test.d.ts.map +0 -1
- package/build/dts/code-mode/validation.test.js +0 -72
- package/build/dts/code-mode/validation.test.js.map +0 -1
- package/build/dts/config/default-config.bulk-preference.test.d.ts +0 -2
- package/build/dts/config/default-config.bulk-preference.test.d.ts.map +0 -1
- package/build/dts/config/default-config.bulk-preference.test.js +0 -42
- package/build/dts/config/default-config.bulk-preference.test.js.map +0 -1
- package/build/dts/config/default-config.d.ts.map +0 -1
- package/build/dts/config/default-config.execute-orchestration.test.d.ts +0 -2
- package/build/dts/config/default-config.execute-orchestration.test.d.ts.map +0 -1
- package/build/dts/config/default-config.execute-orchestration.test.js +0 -40
- package/build/dts/config/default-config.execute-orchestration.test.js.map +0 -1
- package/build/dts/config/default-config.js.map +0 -1
- package/build/dts/config/default-config.readme.test.d.ts +0 -2
- package/build/dts/config/default-config.readme.test.d.ts.map +0 -1
- package/build/dts/config/default-config.readme.test.js +0 -84
- package/build/dts/config/default-config.readme.test.js.map +0 -1
- package/build/dts/config/default-config.searchspec-goal.test.d.ts +0 -2
- package/build/dts/config/default-config.searchspec-goal.test.d.ts.map +0 -1
- package/build/dts/config/default-config.searchspec-goal.test.js +0 -30
- package/build/dts/config/default-config.searchspec-goal.test.js.map +0 -1
- package/build/dts/config/param-descriptions.d.ts.map +0 -1
- package/build/dts/config/param-descriptions.js.map +0 -1
- package/build/dts/constants.d.ts.map +0 -1
- package/build/dts/constants.js.map +0 -1
- package/build/dts/docs/browse-menu.d.ts.map +0 -1
- package/build/dts/docs/browse-menu.js.map +0 -1
- package/build/dts/docs/browse-menu.test.d.ts +0 -2
- package/build/dts/docs/browse-menu.test.d.ts.map +0 -1
- package/build/dts/docs/browse-menu.test.js +0 -66
- package/build/dts/docs/browse-menu.test.js.map +0 -1
- package/build/dts/docs/browse-tool.test.d.ts +0 -2
- package/build/dts/docs/browse-tool.test.d.ts.map +0 -1
- package/build/dts/docs/browse-tool.test.js +0 -77
- package/build/dts/docs/browse-tool.test.js.map +0 -1
- package/build/dts/docs/create-site-guide.d.ts.map +0 -1
- package/build/dts/docs/create-site-guide.js.map +0 -1
- package/build/dts/docs/docs.d.ts.map +0 -1
- package/build/dts/docs/docs.js.map +0 -1
- package/build/dts/docs/fetch-article.d.ts.map +0 -1
- package/build/dts/docs/fetch-article.js.map +0 -1
- package/build/dts/docs/fetch-article.test.d.ts +0 -2
- package/build/dts/docs/fetch-article.test.d.ts.map +0 -1
- package/build/dts/docs/fetch-article.test.js +0 -93
- package/build/dts/docs/fetch-article.test.js.map +0 -1
- package/build/dts/docs/fetch-skills.d.ts.map +0 -1
- package/build/dts/docs/fetch-skills.js.map +0 -1
- package/build/dts/docs/fetch-skills.test.d.ts +0 -2
- package/build/dts/docs/fetch-skills.test.d.ts.map +0 -1
- package/build/dts/docs/fetch-skills.test.js +0 -140
- package/build/dts/docs/fetch-skills.test.js.map +0 -1
- package/build/dts/docs/get-to-know.d.ts.map +0 -1
- package/build/dts/docs/get-to-know.js.map +0 -1
- package/build/dts/docs/get-to-know.test.d.ts +0 -2
- package/build/dts/docs/get-to-know.test.d.ts.map +0 -1
- package/build/dts/docs/get-to-know.test.js +0 -152
- package/build/dts/docs/get-to-know.test.js.map +0 -1
- package/build/dts/docs/long-content.d.ts.map +0 -1
- package/build/dts/docs/long-content.js.map +0 -1
- package/build/dts/docs/normalize-menu-content.d.ts.map +0 -1
- package/build/dts/docs/normalize-menu-content.js.map +0 -1
- package/build/dts/docs/searchFormatting.d.ts.map +0 -1
- package/build/dts/docs/searchFormatting.js.map +0 -1
- package/build/dts/docs/searchFormatting.test.d.ts +0 -2
- package/build/dts/docs/searchFormatting.test.d.ts.map +0 -1
- package/build/dts/docs/searchFormatting.test.js +0 -102
- package/build/dts/docs/searchFormatting.test.js.map +0 -1
- package/build/dts/docs/semanticSearch.d.ts.map +0 -1
- package/build/dts/docs/semanticSearch.js.map +0 -1
- package/build/dts/docs/semanticSearch.test.d.ts +0 -2
- package/build/dts/docs/semanticSearch.test.d.ts.map +0 -1
- package/build/dts/docs/semanticSearch.test.js +0 -923
- package/build/dts/docs/semanticSearch.test.js.map +0 -1
- package/build/dts/docs/velo-readme.d.ts.map +0 -1
- package/build/dts/docs/velo-readme.js.map +0 -1
- package/build/dts/import-claude-design-tool/banner.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/banner.js.map +0 -1
- package/build/dts/import-claude-design-tool/constants.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/constants.js.map +0 -1
- package/build/dts/import-claude-design-tool/index.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/index.js.map +0 -1
- package/build/dts/import-claude-design-tool/index.test.d.ts +0 -2
- package/build/dts/import-claude-design-tool/index.test.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/index.test.js +0 -329
- package/build/dts/import-claude-design-tool/index.test.js.map +0 -1
- package/build/dts/import-claude-design-tool/sanitize.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/sanitize.js.map +0 -1
- package/build/dts/import-claude-design-tool/wixstro-client.d.ts.map +0 -1
- package/build/dts/import-claude-design-tool/wixstro-client.js.map +0 -1
- package/build/dts/index.d.ts.map +0 -1
- package/build/dts/index.js.map +0 -1
- package/build/dts/infra/bi-logger.d.ts.map +0 -1
- package/build/dts/infra/bi-logger.js.map +0 -1
- package/build/dts/infra/environment.d.ts.map +0 -1
- package/build/dts/infra/environment.js.map +0 -1
- package/build/dts/infra/file-logger.d.ts.map +0 -1
- package/build/dts/infra/file-logger.js.map +0 -1
- package/build/dts/infra/logger.d.ts.map +0 -1
- package/build/dts/infra/logger.js.map +0 -1
- package/build/dts/infra/panorama.d.ts.map +0 -1
- package/build/dts/infra/panorama.js.map +0 -1
- package/build/dts/infra/response-size-limits.d.ts.map +0 -1
- package/build/dts/infra/response-size-limits.js.map +0 -1
- package/build/dts/infra/sentry.d.ts.map +0 -1
- package/build/dts/infra/sentry.js.map +0 -1
- package/build/dts/infra/tool-bi.d.ts.map +0 -1
- package/build/dts/infra/tool-bi.js.map +0 -1
- package/build/dts/infra/widget-payload.d.ts.map +0 -1
- package/build/dts/infra/widget-payload.js.map +0 -1
- package/build/dts/resources/docs.d.ts.map +0 -1
- package/build/dts/resources/docs.js.map +0 -1
- package/build/dts/site-widget-tools/claim-site-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/claim-site-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/constants.d.ts.map +0 -1
- package/build/dts/site-widget-tools/constants.js.map +0 -1
- package/build/dts/site-widget-tools/create-site-from-template-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/create-site-from-template-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/edit-site-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/edit-site-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/index.js.map +0 -1
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/search-site-templates-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/search-site-templates-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.test.d.ts +0 -2
- package/build/dts/site-widget-tools/site-builder-tool/index.test.d.ts.map +0 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.test.js +0 -46
- package/build/dts/site-widget-tools/site-builder-tool/index.test.js.map +0 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.test.d.ts +0 -2
- package/build/dts/site-widget-tools/site-creation-tool/index.test.d.ts.map +0 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.test.js +0 -57
- package/build/dts/site-widget-tools/site-creation-tool/index.test.js.map +0 -1
- package/build/dts/site-widget-tools/suggested-domain-tool/index.d.ts.map +0 -1
- package/build/dts/site-widget-tools/suggested-domain-tool/index.js.map +0 -1
- package/build/dts/site-widget-tools/types.d.ts.map +0 -1
- package/build/dts/site-widget-tools/types.js.map +0 -1
- package/build/dts/site-widget-tools/utils.d.ts.map +0 -1
- package/build/dts/site-widget-tools/utils.js.map +0 -1
- package/build/dts/support/index.d.ts.map +0 -1
- package/build/dts/support/index.js.map +0 -1
- package/build/dts/tool-bi-reporting.test.d.ts +0 -2
- package/build/dts/tool-bi-reporting.test.d.ts.map +0 -1
- package/build/dts/tool-bi-reporting.test.js +0 -219
- package/build/dts/tool-bi-reporting.test.js.map +0 -1
- package/build/dts/tool-utils.d.ts.map +0 -1
- package/build/dts/tool-utils.js.map +0 -1
- package/build/dts/tool-utils.spec.d.ts +0 -2
- package/build/dts/tool-utils.spec.d.ts.map +0 -1
- package/build/dts/tool-utils.spec.js +0 -98
- package/build/dts/tool-utils.spec.js.map +0 -1
- package/build/dts/toolkit-entry.d.ts.map +0 -1
- package/build/dts/toolkit-entry.js.map +0 -1
- package/build/dts/toolkit-json-schema.test.d.ts +0 -2
- package/build/dts/toolkit-json-schema.test.d.ts.map +0 -1
- package/build/dts/toolkit-json-schema.test.js +0 -36
- package/build/dts/toolkit-json-schema.test.js.map +0 -1
- package/build/dts/toolkit.d.ts.map +0 -1
- package/build/dts/toolkit.js.map +0 -1
- package/build/dts/toolkit.test.d.ts +0 -2
- package/build/dts/toolkit.test.d.ts.map +0 -1
- package/build/dts/toolkit.test.js +0 -691
- package/build/dts/toolkit.test.js.map +0 -1
- package/build/dts/widget-manifest.d.ts.map +0 -1
- package/build/dts/widget-manifest.js.map +0 -1
- package/build/dts/wix-fetch-error.d.ts.map +0 -1
- package/build/dts/wix-fetch-error.js.map +0 -1
- package/build/dts/wix-mcp-server.d.ts.map +0 -1
- package/build/dts/wix-mcp-server.js.map +0 -1
- package/build/dts/wixel/api.d.ts.map +0 -1
- package/build/dts/wixel/api.js.map +0 -1
- package/build/dts/wixel/constants.d.ts.map +0 -1
- package/build/dts/wixel/constants.js.map +0 -1
- package/build/dts/wixel/external-agent-api.d.ts.map +0 -1
- package/build/dts/wixel/external-agent-api.js.map +0 -1
- package/build/dts/wixel/get-wixel-asset-tool.d.ts.map +0 -1
- package/build/dts/wixel/get-wixel-asset-tool.js.map +0 -1
- package/build/dts/wixel/get-wixel-job-status-tool.d.ts.map +0 -1
- package/build/dts/wixel/get-wixel-job-status-tool.js.map +0 -1
- package/build/dts/wixel/get-wixel-project-assets-tool.d.ts.map +0 -1
- package/build/dts/wixel/get-wixel-project-assets-tool.js.map +0 -1
- package/build/dts/wixel/index.d.ts.map +0 -1
- package/build/dts/wixel/index.js.map +0 -1
- package/build/dts/wixel/mark-wixel-job-as-fulfilled-tool.d.ts.map +0 -1
- package/build/dts/wixel/mark-wixel-job-as-fulfilled-tool.js.map +0 -1
- package/build/dts/wixel/open-headless-wixel-project-tool.d.ts.map +0 -1
- package/build/dts/wixel/open-headless-wixel-project-tool.js.map +0 -1
- package/build/dts/wixel/pull-headless-wixel-job-tool.d.ts.map +0 -1
- package/build/dts/wixel/pull-headless-wixel-job-tool.js.map +0 -1
- package/build/dts/wixel/update-headless-wixel-job-tool.d.ts.map +0 -1
- package/build/dts/wixel/update-headless-wixel-job-tool.js.map +0 -1
- package/build/dts/wixel/utils.d.ts.map +0 -1
- package/build/dts/wixel/utils.js.map +0 -1
- package/build/dts/wixel/wixel-bi.d.ts.map +0 -1
- package/build/dts/wixel/wixel-bi.js.map +0 -1
- package/build/dts/wixel/wixel-bi.test.d.ts +0 -2
- package/build/dts/wixel/wixel-bi.test.d.ts.map +0 -1
- package/build/dts/wixel/wixel-bi.test.js +0 -35
- package/build/dts/wixel/wixel-bi.test.js.map +0 -1
- package/build/dts/wixel/wixel-session-tools.d.ts.map +0 -1
- package/build/dts/wixel/wixel-session-tools.js.map +0 -1
- package/build/dts/wixel/wixel-session-tools.test.d.ts +0 -2
- package/build/dts/wixel/wixel-session-tools.test.d.ts.map +0 -1
- package/build/dts/wixel/wixel-session-tools.test.js +0 -143
- package/build/dts/wixel/wixel-session-tools.test.js.map +0 -1
- package/build/esm/index.js.map +0 -7
- package/build/esm/toolkit.js.map +0 -7
package/build/esm/toolkit.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../node_modules/base-64/base64.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/helpers/bind.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/utils.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/helpers/buildURL.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/core/InterceptorManager.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/helpers/normalizeHeaderName.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/core/enhanceError.js", "../../../../node_modules/axios/lib/helpers/bind.js", "../../../../node_modules/axios/lib/utils.js", "../../../../node_modules/axios/lib/helpers/buildURL.js", "../../../../node_modules/axios/lib/core/InterceptorManager.js", "../../../../node_modules/axios/lib/helpers/normalizeHeaderName.js", "../../../../node_modules/axios/lib/core/enhanceError.js", "../../../../node_modules/axios/lib/defaults/transitional.js", "../../../../node_modules/axios/lib/defaults/index.js", "../../../../node_modules/axios/lib/core/transformData.js", "../../../../node_modules/axios/lib/cancel/isCancel.js", "../../../../node_modules/axios/lib/cancel/Cancel.js", "../../../../node_modules/axios/lib/core/dispatchRequest.js", "../../../../node_modules/axios/lib/core/mergeConfig.js", "../../../../node_modules/axios/lib/env/data.js", "../../../../node_modules/axios/lib/helpers/validator.js", "../../../../node_modules/axios/lib/core/Axios.js", "../../../../node_modules/axios/lib/cancel/CancelToken.js", "../../../../node_modules/axios/lib/helpers/spread.js", "../../../../node_modules/axios/lib/helpers/isAxiosError.js", "../../../../node_modules/axios/lib/axios.js", "../../../../node_modules/axios/index.js", "../../../../node_modules/axios/lib/core/createError.js", "../../../../node_modules/axios/lib/core/settle.js", "../../../../node_modules/axios/lib/helpers/isAbsoluteURL.js", "../../../../node_modules/axios/lib/helpers/combineURLs.js", "../../../../node_modules/axios/lib/core/buildFullPath.js", "../../../../node_modules/@vespaiach/axios-fetch-adapter/index.js", "axios-fetch-adapter:virtual:axios-fetch-adapter:require-call", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/defaults.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/core/transformData.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/cancel/isCancel.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/core/dispatchRequest.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/core/mergeConfig.js", "../../../../node_modules/@wix/http-client/node_modules/axios/package.json", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/helpers/validator.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/core/Axios.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/cancel/Cancel.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/cancel/CancelToken.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/helpers/spread.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/helpers/isAxiosError.js", "../../../../node_modules/@wix/http-client/node_modules/axios/lib/axios.js", "../../../../node_modules/@wix/http-client/node_modules/axios/index.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/assert.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/utils/collections.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/utils/promise.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/utils/log.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/utils/debounce.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/utils/throttle.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/utils/batch-queue.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/consent-policy.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/bi-logger.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/bi-logger-manager.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/bi-logger-factory.js", "../../../../node_modules/@wix/wix-bi-logger-client/lib/index.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/helpers/bind.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/utils.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/helpers/buildURL.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/core/InterceptorManager.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/helpers/normalizeHeaderName.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/core/enhanceError.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/defaults.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/core/transformData.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/cancel/isCancel.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/core/dispatchRequest.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/core/mergeConfig.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/package.json", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/helpers/validator.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/core/Axios.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/cancel/Cancel.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/cancel/CancelToken.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/helpers/spread.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/helpers/isAxiosError.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/lib/axios.js", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/axios/index.js", "../../../../node_modules/zod/v3/external.js", "../../../../node_modules/zod/v3/helpers/util.js", "../../../../node_modules/zod/v3/ZodError.js", "../../../../node_modules/zod/v3/locales/en.js", "../../../../node_modules/zod/v3/errors.js", "../../../../node_modules/zod/v3/helpers/parseUtil.js", "../../../../node_modules/zod/v3/helpers/errorUtil.js", "../../../../node_modules/zod/v3/types.js", "../../../../node_modules/zod-to-json-schema/dist/esm/Options.js", "../../../../node_modules/zod-to-json-schema/dist/esm/Refs.js", "../../../../node_modules/zod-to-json-schema/dist/esm/errorMessages.js", "../../../../node_modules/zod-to-json-schema/dist/esm/getRelativePath.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/any.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/array.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/branded.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/catch.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/date.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/default.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/enum.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/literal.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/string.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/map.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/never.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/null.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/union.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/number.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/object.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/set.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js", "../../../../node_modules/zod-to-json-schema/dist/esm/selectParser.js", "../../../../node_modules/zod-to-json-schema/dist/esm/parseDef.js", "../../../../node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js", "../../../../node_modules/uuid/dist/esm-browser/stringify.js", "../../../../node_modules/uuid/dist/esm-browser/rng.js", "../../../../node_modules/uuid/dist/esm-browser/native.js", "../../../../node_modules/uuid/dist/esm-browser/v4.js", "../../../../node_modules/@wix/http-client/src/constants.ts", "../../../../node_modules/@wix/headers/src/globals.ts", "../../../../node_modules/@wix/headers/src/cookies.ts", "../../../../node_modules/@wix/headers/src/headers/csrf.ts", "../../../../node_modules/@wix/headers/src/headers/x-wix-brand.ts", "../../../../node_modules/@wix/headers/src/headers/consent-policy.ts", "../../../../node_modules/@wix/headers/src/headers/authorization.ts", "../../../../node_modules/@wix/headers/src/utils.ts", "../../../../node_modules/@wix/headers/src/headers/artifact-id.ts", "../../../../node_modules/@wix/headers/src/headers/common-config.ts", "../../../../node_modules/@wix/headers/src/headers/linguist.ts", "../../../../node_modules/@wix/headers/src/errors.ts", "../../../../node_modules/@wix/headers/src/assert.ts", "../../../../node_modules/@wix/headers/src/index.ts", "../../../../node_modules/@wix/http-client/src/env-util.ts", "../../../../node_modules/@wix/http-client/src/utils.ts", "../../../../node_modules/@wix/http-client/dist/es/src/whitelist.json", "../../../../node_modules/@wix/http-client/src/headers.ts", "../../../../node_modules/@wix/http-client/src/error.ts", "../../../../node_modules/@wix/http-client/src/http-client.ts", "axios-fetch-adapter:virtual:axios-fetch-adapter:import-statement", "../../../../node_modules/@wix/http-client/src/options.ts", "../../src/infra/logger.ts", "../../src/docs/searchFormatting.ts", "../../src/docs/semanticSearch.ts", "../../../../node_modules/@sentry/core/src/debug-build.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/version.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/worldwide.ts", "../../../../node_modules/@sentry/core/src/carrier.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/is.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/logger.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/string.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/object.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/misc.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/time.ts", "../../../../node_modules/@sentry/core/src/session.ts", "../../../../node_modules/@sentry/core/src/utils/merge.ts", "../../../../node_modules/@sentry/core/src/utils/spanOnScope.ts", "../../../../node_modules/@sentry/core/src/utils-hoist/propagationContext.ts", "../../../../node_modules/@sentry/core/src/scope.ts", "../../../../node_modules/@sentry/core/src/defaultScopes.ts", "../../../../node_modules/@sentry/core/src/asyncContext/stackStrategy.ts", "../../../../node_modules/@sentry/core/src/asyncContext/index.ts", "../../../../node_modules/@sentry/core/src/currentScopes.ts", "../../../../node_modules/@sentry/core/src/utils/prepareEvent.ts", "../../../../node_modules/@sentry/core/src/exports.ts", "../../src/constants.ts", "../../src/docs/fetch-article.ts", "../../src/docs/normalize-menu-content.ts", "../../src/docs/browse-menu.ts", "../../../../node_modules/dedent/dist/dedent.mjs", "../../src/docs/fetch-skills.ts", "../../src/auth/index.ts", "../../src/config/default-config.ts", "../../../dynamic-context-enricher/src/enrich.ts", "../../../dynamic-context-enricher/src/index.ts", "../../../dynamic-context-enricher/src/known-apps.json", "../../src/api-call/validation.ts", "../../src/config/param-descriptions.ts", "../../src/docs/get-to-know.ts", "../../src/docs/create-site-guide.ts", "../../src/docs/docs.ts", "../../src/tool-utils.ts", "../../src/wix-fetch-error.ts", "../../src/api-call/upload-image-utils.ts", "../../src/api-call/upload-image-tool.ts", "../../src/infra/response-size-limits.ts", "../../src/api-call/index.ts", "../../src/code-mode/truncate-response.ts", "../../src/code-mode/validation.ts", "../../src/code-mode/index.ts", "../../../../node_modules/@wix/panorama-common-shared/src/types/enum-types.ts", "../../../../node_modules/@wix/panorama-common/node_modules/uuid/dist/esm-browser/rng.js", "../../../../node_modules/@wix/panorama-common/node_modules/uuid/dist/esm-browser/stringify.js", "../../../../node_modules/@wix/panorama-common/node_modules/uuid/dist/esm-browser/native.js", "../../../../node_modules/@wix/panorama-common/node_modules/uuid/dist/esm-browser/v4.js", "../../../../node_modules/@wix/panorama-common/src/duration-tracker/duration-tracker.ts", "../../../../node_modules/@wix/panorama-common/src/global-config/global-config.ts", "../../../../node_modules/@babel/runtime/helpers/esm/typeof.js", "../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js", "../../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js", "../../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js", "../../../../node_modules/@wix/panorama-common/src/utils/class-utils.ts", "../../../../node_modules/@wix/panorama-client/src/utils/general-utils.ts", "../../../../node_modules/@wix/panorama-client/src/panorama-error-monitor.ts", "../../../../node_modules/@wix/panorama-client/src/panorama-logger.ts", "../../../../node_modules/@wix/panorama-common-shared/src/utils/transaction-utils.ts", "../../../../node_modules/@wix/panorama-client/src/panorama-transaction.ts", "../../../../node_modules/@wix/panorama-client/src/panorama-client-component.ts", "../../../../node_modules/@wix/panorama-client/src/plugins/hooks-manager.ts", "../../../../node_modules/@wix/panorama-client/src/panorama-phase.ts", "../../../../node_modules/@wix/panorama-client/src/panorama-client.ts", "../../../../node_modules/@wix/panorama-client/src/utils/error-utils.ts", "../../../../node_modules/@wix/panorama-client/src/constants.ts", "../../../../node_modules/@wix/panorama-client/src/lib/payload-sanitizer.ts", "../../../../node_modules/@wix/panorama-client/src/lib/payload-builder.ts", "../../../../node_modules/@wix/panorama-client/src/panorama-client-base.ts", "../../../../node_modules/@wix/panorama-client/src/lib/scope.ts", "../../../../node_modules/@wix/panorama-client/src/panorama-client-factory.ts", "../../../../node_modules/@wix/panorama-common-shared/src/constants.ts", "../../../../node_modules/@wix/panorama-client-node/src/reporter.ts", "../../../../node_modules/@wix/panorama-client-node/src/panorama-client-node.ts", "../../src/infra/panorama.ts", "../../../../node_modules/tslib/tslib.es6.mjs", "../../../../node_modules/@wix/standalone-node-bi-logger/src/index.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/http-client/src/constants.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/globals.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/cookies.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/headers/csrf.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/headers/x-wix-brand.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/headers/consent-policy.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/headers/authorization.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/utils.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/headers/artifact-id.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/headers/common-config.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/headers/linguist.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/errors.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/assert.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/headers/src/index.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/http-client/src/env-util.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/http-client/src/utils.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/http-client/dist/es/src/whitelist.json", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/http-client/src/headers.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/http-client/src/error.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/http-client/src/http-client.ts", "../../../../node_modules/@wix/standalone-node-bi-logger/node_modules/@wix/http-client/src/options.ts", "../../src/infra/bi-logger.ts", "../../src/infra/environment.ts", "../../../../node_modules/@wix/bi-logger-api-infra-data/src/v2/index.ts", "../../src/infra/tool-bi.ts", "../../src/toolkit.ts"],
|
|
4
|
-
"sourcesContent": ["/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code, and use\n\t// it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar InvalidCharacterError = function(message) {\n\t\tthis.message = message;\n\t};\n\tInvalidCharacterError.prototype = new Error;\n\tInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\n\tvar error = function(message) {\n\t\t// Note: the error messages used throughout this file match those used by\n\t\t// the native `atob`/`btoa` implementation in Chromium.\n\t\tthrow new InvalidCharacterError(message);\n\t};\n\n\tvar TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t// http://whatwg.org/html/common-microsyntaxes.html#space-character\n\tvar REGEX_SPACE_CHARACTERS = /[\\t\\n\\f\\r ]/g;\n\n\t// `decode` is designed to be fully compatible with `atob` as described in the\n\t// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob\n\t// The optimized base64-decoding algorithm used is based on @atk\u2019s excellent\n\t// implementation. https://gist.github.com/atk/1020396\n\tvar decode = function(input) {\n\t\tinput = String(input)\n\t\t\t.replace(REGEX_SPACE_CHARACTERS, '');\n\t\tvar length = input.length;\n\t\tif (length % 4 == 0) {\n\t\t\tinput = input.replace(/==?$/, '');\n\t\t\tlength = input.length;\n\t\t}\n\t\tif (\n\t\t\tlength % 4 == 1 ||\n\t\t\t// http://whatwg.org/C#alphanumeric-ascii-characters\n\t\t\t/[^+a-zA-Z0-9/]/.test(input)\n\t\t) {\n\t\t\terror(\n\t\t\t\t'Invalid character: the string to be decoded is not correctly encoded.'\n\t\t\t);\n\t\t}\n\t\tvar bitCounter = 0;\n\t\tvar bitStorage;\n\t\tvar buffer;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\twhile (++position < length) {\n\t\t\tbuffer = TABLE.indexOf(input.charAt(position));\n\t\t\tbitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;\n\t\t\t// Unless this is the first of a group of 4 characters\u2026\n\t\t\tif (bitCounter++ % 4) {\n\t\t\t\t// \u2026convert the first 8 bits to a single ASCII character.\n\t\t\t\toutput += String.fromCharCode(\n\t\t\t\t\t0xFF & bitStorage >> (-2 * bitCounter & 6)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t};\n\n\t// `encode` is designed to be fully compatible with `btoa` as described in the\n\t// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa\n\tvar encode = function(input) {\n\t\tinput = String(input);\n\t\tif (/[^\\0-\\xFF]/.test(input)) {\n\t\t\t// Note: no need to special-case astral symbols here, as surrogates are\n\t\t\t// matched, and the input is supposed to only contain ASCII anyway.\n\t\t\terror(\n\t\t\t\t'The string to be encoded contains characters outside of the ' +\n\t\t\t\t'Latin1 range.'\n\t\t\t);\n\t\t}\n\t\tvar padding = input.length % 3;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\tvar a;\n\t\tvar b;\n\t\tvar c;\n\t\tvar buffer;\n\t\t// Make sure any padding is handled outside of the loop.\n\t\tvar length = input.length - padding;\n\n\t\twhile (++position < length) {\n\t\t\t// Read three bytes, i.e. 24 bits.\n\t\t\ta = input.charCodeAt(position) << 16;\n\t\t\tb = input.charCodeAt(++position) << 8;\n\t\t\tc = input.charCodeAt(++position);\n\t\t\tbuffer = a + b + c;\n\t\t\t// Turn the 24 bits into four chunks of 6 bits each, and append the\n\t\t\t// matching character for each of them to the output.\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 18 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 12 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 6 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer & 0x3F)\n\t\t\t);\n\t\t}\n\n\t\tif (padding == 2) {\n\t\t\ta = input.charCodeAt(position) << 8;\n\t\t\tb = input.charCodeAt(++position);\n\t\t\tbuffer = a + b;\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 10) +\n\t\t\t\tTABLE.charAt((buffer >> 4) & 0x3F) +\n\t\t\t\tTABLE.charAt((buffer << 2) & 0x3F) +\n\t\t\t\t'='\n\t\t\t);\n\t\t} else if (padding == 1) {\n\t\t\tbuffer = input.charCodeAt(position);\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 2) +\n\t\t\t\tTABLE.charAt((buffer << 4) & 0x3F) +\n\t\t\t\t'=='\n\t\t\t);\n\t\t}\n\n\t\treturn output;\n\t};\n\n\tvar base64 = {\n\t\t'encode': encode,\n\t\t'decode': decode,\n\t\t'version': '1.0.0'\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn base64;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = base64;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (var key in base64) {\n\t\t\t\tbase64.hasOwnProperty(key) && (freeExports[key] = base64[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.base64 = base64;\n\t}\n\n}(this));\n", "'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n", "'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n", "'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n", "'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n", "'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n", "'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n", "'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n", "'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n", "'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n", "'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar enhanceError = require('../core/enhanceError');\nvar transitionalDefaults = require('./transitional');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n", "'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n", "'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n", "'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n", "module.exports = {\n \"version\": \"0.26.1\"\n};", "'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n", "'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n", "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n", "module.exports = require('./lib/axios');", "'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n", "'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n", "'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n", "'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n", "'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n", "import axios from 'axios';\r\nimport settle from 'axios/lib/core/settle';\r\nimport buildURL from 'axios/lib/helpers/buildURL';\r\nimport buildFullPath from 'axios/lib/core/buildFullPath';\r\nimport { isUndefined, isStandardBrowserEnv, isFormData } from 'axios/lib/utils';\r\n\r\n/**\r\n * - Create a request object\r\n * - Get response body\r\n * - Check if timeout\r\n */\r\nexport default async function fetchAdapter(config) {\r\n const request = createRequest(config);\r\n const promiseChain = [getResponse(request, config)];\r\n\r\n if (config.timeout && config.timeout > 0) {\r\n promiseChain.push(\r\n new Promise((res) => {\r\n setTimeout(() => {\r\n const message = config.timeoutErrorMessage\r\n ? config.timeoutErrorMessage\r\n : 'timeout of ' + config.timeout + 'ms exceeded';\r\n res(createError(message, config, 'ECONNABORTED', request));\r\n }, config.timeout);\r\n })\r\n );\r\n }\r\n\r\n const data = await Promise.race(promiseChain);\r\n return new Promise((resolve, reject) => {\r\n if (data instanceof Error) {\r\n reject(data);\r\n } else {\r\n Object.prototype.toString.call(config.settle) === '[object Function]'\r\n ? config.settle(resolve, reject, data)\r\n : settle(resolve, reject, data);\r\n }\r\n });\r\n}\r\n\r\n\r\n/**\r\n * Fetch API stage two is to get response body. This funtion tries to retrieve\r\n * response body based on response's type\r\n */\r\nasync function getResponse(request, config) {\r\n let stageOne;\r\n try {\r\n stageOne = await fetch(request);\r\n } catch (e) {\r\n return createError('Network Error', config, 'ERR_NETWORK', request);\r\n }\r\n\r\n const response = {\r\n ok: stageOne.ok,\r\n status: stageOne.status,\r\n statusText: stageOne.statusText,\r\n headers: new Headers(stageOne.headers), // Make a copy of headers\r\n config: config,\r\n request,\r\n };\r\n\r\n if (stageOne.status >= 200 && stageOne.status !== 204) {\r\n switch (config.responseType) {\r\n case 'arraybuffer':\r\n response.data = await stageOne.arrayBuffer();\r\n break;\r\n case 'blob':\r\n response.data = await stageOne.blob();\r\n break;\r\n case 'json':\r\n response.data = await stageOne.json();\r\n break;\r\n case 'formData':\r\n response.data = await stageOne.formData();\r\n break;\r\n default:\r\n response.data = await stageOne.text();\r\n break;\r\n }\r\n }\r\n\r\n return response;\r\n}\r\n\r\n/**\r\n * This function will create a Request object based on configuration's axios\r\n */\r\nfunction createRequest(config) {\r\n const headers = new Headers(config.headers);\r\n\r\n // HTTP basic authentication\r\n if (config.auth) {\r\n const username = config.auth.username || '';\r\n const password = config.auth.password ? decodeURI(encodeURIComponent(config.auth.password)) : '';\r\n headers.set('Authorization', `Basic ${btoa(username + ':' + password)}`);\r\n }\r\n\r\n const method = config.method.toUpperCase();\r\n const options = {\r\n headers: headers,\r\n method,\r\n };\r\n if (method !== 'GET' && method !== 'HEAD') {\r\n options.body = config.data;\r\n\r\n // In these cases the browser will automatically set the correct Content-Type,\r\n // but only if that header hasn't been set yet. So that's why we're deleting it.\r\n if (isFormData(options.body) && isStandardBrowserEnv()) {\r\n headers.delete('Content-Type');\r\n }\r\n }\r\n if (config.mode) {\r\n options.mode = config.mode;\r\n }\r\n if (config.cache) {\r\n options.cache = config.cache;\r\n }\r\n if (config.integrity) {\r\n options.integrity = config.integrity;\r\n }\r\n if (config.redirect) {\r\n options.redirect = config.redirect;\r\n }\r\n if (config.referrer) {\r\n options.referrer = config.referrer;\r\n }\r\n // This config is similar to XHR\u2019s withCredentials flag, but with three available values instead of two.\r\n // So if withCredentials is not set, default value 'same-origin' will be used\r\n if (!isUndefined(config.withCredentials)) {\r\n options.credentials = config.withCredentials ? 'include' : 'omit';\r\n }\r\n\r\n const fullPath = buildFullPath(config.baseURL, config.url);\r\n const url = buildURL(fullPath, config.params, config.paramsSerializer);\r\n\r\n // Expected browser to throw error if there is any wrong configuration value\r\n return new Request(url, options);\r\n}\r\n\r\n\r\n\r\n/**\r\n * Note:\r\n * \r\n * From version >= 0.27.0, createError function is replaced by AxiosError class.\r\n * So I copy the old createError function here for backward compatible.\r\n * \r\n * \r\n * \r\n * Create an Error with the specified message, config, error code, request and response.\r\n *\r\n * @param {string} message The error message.\r\n * @param {Object} config The config.\r\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\r\n * @param {Object} [request] The request.\r\n * @param {Object} [response] The response.\r\n * @returns {Error} The created error.\r\n */\r\nfunction createError(message, config, code, request, response) {\r\n if (axios.AxiosError && typeof axios.AxiosError === 'function') {\r\n return new axios.AxiosError(message, axios.AxiosError[code], config, request, response);\r\n }\r\n\r\n var error = new Error(message);\r\n return enhanceError(error, config, code, request, response);\r\n};\r\n\r\n/**\r\n * \r\n * Note:\r\n * \r\n * This function is for backward compatible.\r\n * \r\n * \r\n * Update an Error with the specified config, error code, and response.\r\n *\r\n * @param {Error} error The error to update.\r\n * @param {Object} config The config.\r\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\r\n * @param {Object} [request] The request.\r\n * @param {Object} [response] The response.\r\n * @returns {Error} The error.\r\n */\r\nfunction enhanceError(error, config, code, request, response) {\r\n error.config = config;\r\n if (code) {\r\n error.code = code;\r\n }\r\n\r\n error.request = request;\r\n error.response = response;\r\n error.isAxiosError = true;\r\n\r\n error.toJSON = function toJSON() {\r\n return {\r\n // Standard\r\n message: this.message,\r\n name: this.name,\r\n // Microsoft\r\n description: this.description,\r\n number: this.number,\r\n // Mozilla\r\n fileName: this.fileName,\r\n lineNumber: this.lineNumber,\r\n columnNumber: this.columnNumber,\r\n stack: this.stack,\r\n // Axios\r\n config: this.config,\r\n code: this.code,\r\n status: this.response && this.response.status ? this.response.status : null\r\n };\r\n };\r\n return error;\r\n};\r\n", "\n const fetchAdapter = require('/home/builduser/work/124988b7e2fb3874/node_modules/@vespaiach/axios-fetch-adapter/index.js');\n module.exports = fetchAdapter.default || fetchAdapter;\n ", "'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n", "'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n", "'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n", "{\n \"name\": \"axios\",\n \"version\": \"0.21.4\",\n \"description\": \"Promise based HTTP client for the browser and node.js\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \"grunt test\",\n \"start\": \"node ./sandbox/server.js\",\n \"build\": \"NODE_ENV=production grunt build\",\n \"preversion\": \"npm test\",\n \"version\": \"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\n \"postversion\": \"git push && git push --tags\",\n \"examples\": \"node ./examples/server.js\",\n \"coveralls\": \"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\n \"fix\": \"eslint --fix lib/**/*.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/axios/axios.git\"\n },\n \"keywords\": [\n \"xhr\",\n \"http\",\n \"ajax\",\n \"promise\",\n \"node\"\n ],\n \"author\": \"Matt Zabriskie\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/axios/axios/issues\"\n },\n \"homepage\": \"https://axios-http.com\",\n \"devDependencies\": {\n \"coveralls\": \"^3.0.0\",\n \"es6-promise\": \"^4.2.4\",\n \"grunt\": \"^1.3.0\",\n \"grunt-banner\": \"^0.6.0\",\n \"grunt-cli\": \"^1.2.0\",\n \"grunt-contrib-clean\": \"^1.1.0\",\n \"grunt-contrib-watch\": \"^1.0.0\",\n \"grunt-eslint\": \"^23.0.0\",\n \"grunt-karma\": \"^4.0.0\",\n \"grunt-mocha-test\": \"^0.13.3\",\n \"grunt-ts\": \"^6.0.0-beta.19\",\n \"grunt-webpack\": \"^4.0.2\",\n \"istanbul-instrumenter-loader\": \"^1.0.0\",\n \"jasmine-core\": \"^2.4.1\",\n \"karma\": \"^6.3.2\",\n \"karma-chrome-launcher\": \"^3.1.0\",\n \"karma-firefox-launcher\": \"^2.1.0\",\n \"karma-jasmine\": \"^1.1.1\",\n \"karma-jasmine-ajax\": \"^0.1.13\",\n \"karma-safari-launcher\": \"^1.0.0\",\n \"karma-sauce-launcher\": \"^4.3.6\",\n \"karma-sinon\": \"^1.0.5\",\n \"karma-sourcemap-loader\": \"^0.3.8\",\n \"karma-webpack\": \"^4.0.2\",\n \"load-grunt-tasks\": \"^3.5.2\",\n \"minimist\": \"^1.2.0\",\n \"mocha\": \"^8.2.1\",\n \"sinon\": \"^4.5.0\",\n \"terser-webpack-plugin\": \"^4.2.3\",\n \"typescript\": \"^4.0.5\",\n \"url-search-params\": \"^0.10.0\",\n \"webpack\": \"^4.44.2\",\n \"webpack-dev-server\": \"^3.11.0\"\n },\n \"browser\": {\n \"./lib/adapters/http.js\": \"./lib/adapters/xhr.js\"\n },\n \"jsdelivr\": \"dist/axios.min.js\",\n \"unpkg\": \"dist/axios.min.js\",\n \"typings\": \"./index.d.ts\",\n \"dependencies\": {\n \"follow-redirects\": \"^1.14.0\"\n },\n \"bundlesize\": [\n {\n \"path\": \"./dist/axios.min.js\",\n \"threshold\": \"5kB\"\n }\n ]\n}\n", "'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n", "'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n", "'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n", "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n", "'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n", "module.exports = require('./lib/axios');", "'use strict'; // eslint-disable-line strict\n\nclass AssertionError extends Error {\n constructor(message) {\n super(message);\n this.name = this.constructor.name;\n }\n}\n\nfunction assertDefined(target, message) {\n if (target === undefined) {\n throw new AssertionError(message);\n }\n}\n\nfunction assertObject(target, message) {\n if (\n target !== undefined &&\n (typeof target !== 'object' || Array.isArray(target) || target === null)\n ) {\n throw new AssertionError(message);\n }\n}\n\nfunction assertOk(target, message) {\n if (!target) {\n throw new AssertionError(message);\n }\n}\n\nfunction assertFunc(target, message) {\n if (target !== undefined && typeof target !== 'function') {\n throw new AssertionError(message);\n }\n}\n\nfunction assertBoolean(target, message) {\n if (target !== undefined && typeof target !== 'boolean') {\n throw new AssertionError(message);\n }\n}\n\nfunction assertNumber(target, message) {\n if (target !== undefined && typeof target !== 'number') {\n throw new AssertionError(message);\n }\n}\n\nfunction assertArray(target, message) {\n if (typeof Array.isArray === 'function') {\n if (!Array.isArray(target)) {\n throw new AssertionError(message);\n }\n } else if (Object.prototype.toString.call(target) !== '[object Array]') {\n throw new AssertionError(message);\n }\n}\n\nmodule.exports.defined = assertDefined;\nmodule.exports.object = assertObject;\nmodule.exports.ok = assertOk;\nmodule.exports.func = assertFunc;\nmodule.exports.boolean = assertBoolean;\nmodule.exports.number = assertNumber;\nmodule.exports.array = assertArray;\nmodule.exports.AssertionError = AssertionError;\n", "/**\n * This callback type is called `requestCallback` and is displayed as a global symbol.\n *\n * @callback iterateeCallback\n * @param {*} Value\n * @param {string} Key\n * @param {object} Original object\n */\n/**\n * Iterates over object values\n * @param {Object} collection\n * @param {iterateeCallback} iteratee\n * @return {Object} iterated object\n */\nmodule.exports.mapValues = function(collection, iteratee) {\n if (!collection) {\n return {};\n }\n\n return Object.keys(collection).reduce((acc, key) => {\n acc[key] = iteratee(collection[key], key, collection);\n return acc;\n }, {});\n};\n\nmodule.exports.filterValues = function(collection, iteratee) {\n if (!collection) {\n return {};\n }\n\n return Object.keys(collection).reduce((acc, key) => {\n const keep = iteratee(collection[key], key, collection);\n\n if (keep) {\n acc[key] = collection[key];\n }\n\n return acc;\n }, {});\n};\n", "/**\n * rejects original promise after specified timeout\n * @param {Promise<R>} promise Original promise\n * @param {string} [message] Additional message for timeout reject\n * @param {number} timeout Time for reject\n * @return {Promise<R>}\n */\nmodule.exports.timedPromise = function(promise, { message, timeout }) {\n const timeoutPromise = new Promise((resolve, reject) => {\n setTimeout(reject, timeout, message ? `Timeout: ${message}` : 'Timeout');\n });\n return Promise.race([promise, timeoutPromise]);\n};\n\n/**\n * Works like Promise.all expect uses object instead of array.\n * @param {Object} promiseObject\n * @return {Promise} Promise with original keys and resolved values\n */\nmodule.exports.allAsObject = function(promiseObject) {\n const keys = Object.keys(promiseObject);\n return Promise.all(keys.map(key => promiseObject[key])).then(resolved => {\n return resolved.reduce((acc, value, i) => {\n acc[keys[i]] = value;\n return acc;\n }, {});\n });\n};\n", "module.exports = {\n error(...args) {\n if (console && console.error) {\n console.error(...args);\n }\n },\n};\n", "// Returns a function, that, as long as it continues to be invoked, will not\n// be triggered. The function will be called after it stops being called for\n// N milliseconds. If `immediate` is passed, trigger the function on the\n// leading edge, instead of the trailing.\nfunction debounce(func, wait, immediate) {\n let timeout;\n\n // This is the function that is actually executed when\n // the DOM event is triggered.\n return function() {\n // Store the context of this and any parameters passed to executedFunction\n const context = this;\n const args = arguments;\n\n // The function to be called after\n // the debounce time has elapsed\n const later = function() {\n // null timeout to indicate the debounce ended\n timeout = null;\n\n // Call function now if you did not on the leading end\n if (!immediate) {\n func.apply(context, args);\n }\n };\n\n // Determine if you should call the function\n // on the leading or trail end\n const callNow = immediate && !timeout;\n\n // This will reset the waiting every function execution.\n // This is the step that prevents the function from\n // being executed because it will never reach the\n // inside of the previous setTimeout\n clearTimeout(timeout);\n\n // Restart the debounce waiting period.\n // setTimeout returns a truthy value (it differs in web vs node)\n timeout = setTimeout(later, wait);\n\n // Call immediately if you're dong a leading\n // end execution\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n\nmodule.exports = debounce;\n", "function throttle(func, wait) {\n let timeout;\n\n return (...args) => {\n if (!timeout) {\n timeout = setTimeout(() => {\n func(...args);\n timeout = null;\n }, wait);\n }\n };\n}\n\nmodule.exports = throttle;\n", "const debounce = require('./debounce');\nconst throttle = require('./throttle');\n\nconst createEvent = (event, context, startTime) => ({\n dt: Date.now() - startTime,\n f: event,\n context,\n});\n\nconst createBatch = (events, startTime) => ({\n dt: Date.now() - startTime,\n e: events,\n g: {},\n});\n\nconst optimizeBatch = batch => {\n const fieldCounts = {};\n const batchLen = batch.e.length;\n\n let events = batch.e.map(event => {\n const fields = Object.keys(event.f).map(field => {\n const value = event.f[field];\n const key = `${field}|${value}`;\n fieldCounts[key] = fieldCounts[key] || 0;\n fieldCounts[key]++;\n return [field, value, key];\n });\n\n return {\n ...event,\n f: fields,\n };\n });\n\n const globalFields = {};\n events = events.map(event => {\n const fields = event.f.reduce((res, [field, value, key]) => {\n if (fieldCounts[key] === batchLen) {\n globalFields[field] = value;\n } else {\n res[field] = value;\n }\n\n return res;\n }, {});\n\n return {\n ...event,\n f: fields,\n };\n });\n\n return {\n ...batch,\n e: events,\n g: globalFields,\n };\n};\n\nclass BatchQueue {\n constructor() {\n this._initilized = false;\n }\n\n _reset() {\n this._startTime = Date.now();\n this._resolve = null;\n this._promise = new Promise(resolve => (this._resolve = resolve));\n }\n\n init({ delayMs, maxBatchSize, useThrottle, optimizeBatch }, flushHandler) {\n if (this._initilized) {\n return;\n }\n\n this._maxBatchSize = maxBatchSize;\n this._optimizeBatch = optimizeBatch;\n this._queue = [];\n this._flushHandler = flushHandler;\n this._flushDebounced = useThrottle\n ? throttle(() => this.flush(), delayMs)\n : debounce(() => this.flush(), delayMs);\n this._initilized = true;\n\n this._reset();\n }\n\n flush() {\n if (!this._queue.length) {\n return Promise.resolve();\n }\n\n const events = this._queue.splice(0, this._queue.length);\n const resolve = this._resolve;\n const startTime = this._startTime;\n\n this._reset();\n\n let batch = createBatch(events, startTime);\n\n if (this._optimizeBatch) {\n batch = optimizeBatch(batch);\n }\n\n return this._flushHandler(batch).then(resolve);\n }\n\n feed(event, context) {\n this._queue.push(createEvent(event, context, this._startTime));\n\n if (this._queue.length === this._maxBatchSize) {\n return this.flush();\n }\n\n this._flushDebounced();\n\n return this._promise;\n }\n}\n\nmodule.exports = BatchQueue;\n", "'use strict'; // eslint-disable-line strict\n\nconst DefaultConsentPolicy = {\n functional: true,\n analytics: true,\n __default: true,\n};\n\nconst getPolicy = consentPolicyGetter => {\n return (\n (typeof consentPolicyGetter === 'function' && consentPolicyGetter()) ||\n DefaultConsentPolicy\n );\n};\n\nconst shouldMuteNonEssentials = policy => {\n return policy.functional === false || policy.analytics === false;\n};\n\nconst shouldMuteByCategory = (policy, category) => {\n if (category === 'essential') {\n return false;\n }\n\n if (category === 'functional' || category === 'analytics') {\n return policy[category] === false;\n }\n\n return shouldMuteNonEssentials(policy);\n};\n\nmodule.exports = {\n shouldMuteNonEssentials,\n shouldMuteByCategory,\n getPolicy,\n};\n", "'use strict'; // eslint-disable-line strict\nconst assert = require('./assert');\nconst { mapValues, filterValues } = require('./utils/collections');\nconst promise = require('./utils/promise');\nconst log = require('./utils/log');\nconst BatchQueue = require('./utils/batch-queue');\nconst {\n shouldMuteByCategory,\n shouldMuteNonEssentials,\n getPolicy,\n} = require('./consent-policy');\n\nclass BiLogger {\n // TODO: validate args\n constructor(options, context) {\n this._publishers = options.publishers;\n this._validators = options.validators || [];\n this._defaults = options.defaults;\n this._ownDefaults = {};\n this._events = options.events || {};\n this._context = context || {};\n this._defaultValueTimeout = options.defaultValueTimeout || 5000;\n this._defaultContinueOnFail = options.defaultContinueOnFail || false;\n this._onPublisherFailHandler =\n options.onPublisherFailHandler || BiLogger._defaultPublisherFailHandler;\n this._isMuted = options.isMuted || (() => false);\n this._eventTransformer = options.eventTransformer || (event => event);\n this._payloadTransformer =\n options.payloadTransformer || (payload => payload);\n this._consentPolicyGetter = options.consentPolicyGetter || (() => null);\n this._nonEssentialDefaults = options.nonEssentialDefaults || {};\n this._maxBatchSize = options.maxBatchSize || 100;\n this._globalBatchQueue = options.globalBatchQueue;\n }\n\n report(data) {\n assert.defined(data, 'Data must be provided');\n assert.object(data, 'Data must be an object');\n\n const { src, evid, params, ...context } = data;\n\n return this.log({ src, evid, ...params }, context);\n }\n\n log(eventOrKey, eventOrContextOrUndefined, contextOrUndefined) {\n assert.defined(eventOrKey, 'Event object or event key must be provided.');\n\n const { event, context } = this._extractEventAndContext(\n eventOrKey,\n eventOrContextOrUndefined,\n contextOrUndefined,\n );\n const policy = getPolicy(this._consentPolicyGetter);\n const fullContext = { ...this._context, ...context };\n\n if (this._isMuted() || shouldMuteByCategory(policy, fullContext.category)) {\n return Promise.resolve();\n }\n\n if (fullContext.useBatch) {\n const queue = this._initQueue(fullContext, policy);\n\n const transformAndQueue = _event => {\n const transformedEvent = this._eventTransformer(_event, fullContext);\n\n return queue.feed(transformedEvent, fullContext);\n };\n\n if (this._globalBatchQueue) {\n return this._getDefaults(this._defaults).then(defaults => {\n const fullEvent = {\n ...defaults,\n ...this._getDynamicNonEssentialDefaults(policy),\n ...this._getStaticNonEssentialDefaults(policy),\n ...event,\n ...this._getPolicyFields(policy, fullContext.category),\n };\n\n return transformAndQueue(fullEvent);\n });\n } else {\n const fullEvent = {\n ...this._getDynamicDefaults(this._defaults),\n ...this._getDynamicNonEssentialDefaults(policy),\n ...event,\n ...this._getPolicyFields(policy, fullContext.category),\n };\n\n return transformAndQueue(fullEvent);\n }\n }\n\n return this._getDefaults(this._defaults).then(defaults => {\n const fullEvent = Object.assign(\n defaults,\n this._getDynamicNonEssentialDefaults(policy),\n this._getStaticNonEssentialDefaults(policy),\n event,\n this._getPolicyFields(policy, fullContext.category),\n );\n\n const validatorsResult =\n this._validators.length === 0\n ? true\n : this._validators.some(\n validator =>\n validator.match(fullEvent) &&\n (validator.execute(fullEvent) || true),\n );\n\n if (!validatorsResult) {\n throw new Error(\n `No validator accepted the event. Source: ${\n fullEvent.src\n } Evid: ${fullEvent.evid || fullEvent.evtId}`,\n );\n }\n\n let transformedEvent = this._eventTransformer(fullEvent, fullContext);\n transformedEvent = this._payloadTransformer(\n transformedEvent,\n fullContext,\n );\n\n return this._send(transformedEvent, fullContext);\n });\n }\n\n flush() {\n if (!this._queue) {\n return Promise.resolve();\n }\n return this._queue.flush();\n }\n\n updateDefaults(defaults) {\n assert.defined(defaults, 'Defaults must be provided');\n assert.object(defaults, 'Defaults must be an object');\n Object.assign(this._ownDefaults, defaults);\n return this;\n }\n\n _send(payload, context = {}) {\n return Promise.all(\n this._publishers.map(publisher => {\n const cloned = { ...payload };\n\n return Promise.resolve()\n .then(() => publisher(cloned, context))\n .catch(error =>\n this._onPublisherFailHandler(error, {\n publisherName: publisher.name,\n payload,\n }),\n );\n }),\n ).then(() => undefined);\n }\n\n _extractEventAndContext(\n eventOrKey,\n eventOrContextOrUndefined,\n contextOrUndefined,\n ) {\n let event;\n let context = {};\n\n if (typeof eventOrKey !== 'string') {\n event = eventOrKey;\n context = eventOrContextOrUndefined || context;\n } else {\n event = this._events[eventOrKey];\n\n if (!event) {\n throw new assert.AssertionError(\n `Event with key '${eventOrKey}' not found in event map.`,\n );\n }\n\n if (eventOrContextOrUndefined) {\n event = { ...event, ...eventOrContextOrUndefined };\n context = contextOrUndefined || context;\n }\n }\n\n return { event, context };\n }\n\n _initQueue(context, policy) {\n if (this._queue) {\n return this._queue;\n }\n\n this._queue = this._globalBatchQueue || new BatchQueue();\n\n const onFlush = batch => {\n // if queue is global don't define global properties\n if (!this._globalBatchQueue) {\n batch.g = Object.assign(\n this._getStaticDefaults(this._defaults),\n this._getStaticNonEssentialDefaults(policy),\n );\n }\n\n const transformedPayload = this._payloadTransformer(batch, context);\n\n return this._send(transformedPayload, context);\n };\n\n this._queue.init(\n {\n delayMs: context.useBatch === true ? 300 : context.useBatch,\n maxBatchSize: this._maxBatchSize,\n useThrottle: !!this._globalBatchQueue,\n optimizeBatch: !!this._globalBatchQueue,\n },\n onFlush,\n );\n\n return this._queue;\n }\n\n _handleDefaultsError(err) {\n if (this._defaultContinueOnFail) {\n log.error(err);\n return null;\n }\n return Promise.reject(err);\n }\n\n _getDynamicNonEssentialDefaults(policy) {\n if (!shouldMuteNonEssentials(policy)) {\n return this._getDynamicDefaults(this._nonEssentialDefaults);\n }\n }\n\n _getStaticNonEssentialDefaults(policy) {\n if (!shouldMuteNonEssentials(policy)) {\n return this._getStaticDefaults(this._nonEssentialDefaults);\n }\n }\n\n _withOwnDefaults(defaults) {\n return Object.assign({}, defaults, this._ownDefaults);\n }\n\n _getDynamicDefaults(defaults) {\n defaults = this._withOwnDefaults(defaults);\n const dynamicDefaults = filterValues(\n defaults,\n v => typeof v === 'function',\n );\n return mapValues(dynamicDefaults, v => v());\n }\n\n _getStaticDefaults(defaults) {\n defaults = this._withOwnDefaults(defaults);\n const staticDefaults = filterValues(defaults, v => typeof v !== 'function');\n return staticDefaults;\n }\n\n _getDefaults(defaults) {\n defaults = this._withOwnDefaults(defaults);\n if (!defaults) {\n return Promise.resolve({});\n }\n\n const promises = mapValues(defaults, (value, key) => {\n if (typeof value === 'function') {\n try {\n value = value();\n } catch (err) {\n return this._handleDefaultsError(err);\n }\n }\n\n if (value && typeof value.then === 'function') {\n return promise\n .timedPromise(value, {\n message: `Cannot get default value '${key} for BI Event'`,\n timeout: this._defaultValueTimeout,\n })\n .catch(err => this._handleDefaultsError(err));\n }\n\n return value;\n });\n\n return promise.allAsObject(promises);\n }\n\n _encodePolicyValue(policy, key) {\n if (!policy) {\n return 1;\n }\n\n if (typeof policy[key] === 'boolean') {\n return policy[key] ? 1 : 0;\n }\n\n return policy[key];\n }\n\n _getPolicyFields(policy, category) {\n return {\n _isca: this._encodePolicyValue(policy, 'analytics'),\n _iscf: this._encodePolicyValue(policy, 'functional'),\n _ispd: policy.__default ? 1 : 0,\n _ise: category === 'essential' ? 1 : 0,\n };\n }\n\n static _defaultPublisherFailHandler(error, { publisherName }) {\n return publisherName; // do nothing\n }\n}\n\nmodule.exports = BiLogger;\n", "'use strict'; // eslint-disable-line strict\n\nconst assert = require('./assert');\n\nclass BiLoggerManager {\n constructor() {\n this.reset();\n }\n\n reset() {\n this._handlers = [];\n }\n\n onLoggerCreated(handler) {\n assert.defined(handler, 'Handler must be provided.');\n assert.func(handler, 'Handler must be a function.');\n\n this._handlers.push(handler);\n\n return () => {\n const index = this._handlers.indexOf(handler);\n\n if (index !== -1) {\n this._handlers.splice(index, 1);\n }\n };\n }\n\n notifyLoggerCreated(logger) {\n this._handlers.forEach(handler => handler(logger));\n }\n}\n\nmodule.exports = {\n manager: new BiLoggerManager(),\n BiLoggerManager,\n};\n", "'use strict'; // eslint-disable-line strict\nconst assert = require('./assert');\nconst BiLogger = require('./bi-logger');\nconst biLoggerManager = require('./bi-logger-manager');\nconst BatchQueue = require('./utils/batch-queue');\n\nclass BiLoggerFactory {\n constructor() {\n this._publishers = [];\n this._validators = [];\n this._defaults = {};\n this._nonEssentialDefaults = {};\n this._events = {};\n this._isMuted = false;\n this._eventTransformer = null;\n this._payloadTransformer = null;\n this._consentPolicyGetter = null;\n this._maxBatchSize = null;\n this._batchQueue = null;\n }\n\n addPublisher(publisher) {\n assert.defined(publisher, 'Publisher must be provided');\n assert.ok(typeof publisher === 'function', 'Expected a publisher function');\n this._publishers.push(publisher);\n return this;\n }\n\n addValidator(validator) {\n assert.defined(validator, 'Validator must be provided');\n assert.ok(\n typeof validator === 'object' && validator,\n 'Expected a validator object',\n );\n assert.ok(\n validator.execute && validator.match,\n 'Provided validator does not match the interface',\n );\n this._validators.push(validator);\n return this;\n }\n\n setDefaults(defaults) {\n assert.defined(defaults, 'Defaults must be provided');\n assert.object(defaults, 'Defaults must be an object');\n this._defaults = defaults;\n return this;\n }\n\n updateDefaults(defaults) {\n assert.defined(defaults, 'Defaults must be provided');\n assert.object(defaults, 'Defaults must be an object');\n Object.assign(this._defaults, defaults);\n return this;\n }\n\n updateNonEssentialDefaults(defaults) {\n assert.defined(defaults, 'Non-essential Defaults must be provided');\n assert.object(defaults, 'Non-essential Defaults must be an object');\n Object.assign(this._nonEssentialDefaults, defaults);\n return this;\n }\n\n setEvents(events) {\n assert.defined(events, 'Events must be provided');\n assert.object(events, 'Events must be an object');\n this._events = events;\n return this;\n }\n\n setDefaultValueTimeout(defaultValueTimeout) {\n assert.defined(\n defaultValueTimeout,\n 'Default Value Timeout must be provided',\n );\n this._defaultValueTimeout = defaultValueTimeout;\n return this;\n }\n\n setDefaultContinueOnFail(defaultContinueOnFail) {\n assert.defined(\n defaultContinueOnFail,\n 'Default Continue On Fail must be provided',\n );\n this._defaultContinueOnFail = defaultContinueOnFail;\n return this;\n }\n\n setPublisherFailHandler(onPublisherFailHandler) {\n assert.defined(\n onPublisherFailHandler,\n 'Publisher Fail Handler must be provided',\n );\n this._onPublisherFailHandler = onPublisherFailHandler;\n return this;\n }\n\n setMuted(isMuted) {\n assert.defined(isMuted, 'Is Muted must be provided');\n assert.boolean(isMuted, 'Is Muted must be a boolean');\n this._isMuted = isMuted;\n return this;\n }\n\n setMaxBatchSize(maxBatchSize) {\n assert.defined(maxBatchSize, 'Max Batch Size must be provided');\n assert.number(maxBatchSize, 'Max Batch Size must be a number');\n assert.ok(maxBatchSize > 0, 'Max Batch Size must be higher than 0');\n this._maxBatchSize = maxBatchSize;\n return this;\n }\n\n setGlobalBatchQueue(batchQueue) {\n assert.defined(batchQueue, 'Global Batch Queue must be provided');\n assert.ok(\n batchQueue instanceof BatchQueue,\n 'Global Batch Queue must be an instance of BatchQueue',\n );\n this._globalBatchQueue = batchQueue;\n return this;\n }\n\n withEventTransformer(transformer) {\n assert.defined(transformer, 'Event Transformer must be provided');\n assert.func(transformer, 'Event Transformer must be a function');\n this._eventTransformer = transformer;\n return this;\n }\n\n withPayloadTransformer(transformer) {\n assert.defined(transformer, 'Payload Transformer must be provided');\n assert.func(transformer, 'Payload Transformer must be a function');\n this._payloadTransformer = transformer;\n return this;\n }\n\n withConsentPolicyGetter(getter) {\n assert.defined(getter, 'Consent Policy Getter must be provided');\n assert.func(getter, 'Consent Policy Getter must be a function');\n this._consentPolicyGetter = getter;\n return this;\n }\n\n logger(context) {\n const logger = new BiLogger(\n {\n publishers: this._publishers,\n validators: this._validators,\n defaults: this._defaults,\n events: this._events,\n defaultValueTimeout: this._defaultValueTimeout,\n defaultContinueOnFail: this._defaultContinueOnFail,\n onPublisherFailHandler: this._onPublisherFailHandler,\n isMuted: () => this._isMuted,\n eventTransformer: this._eventTransformer,\n payloadTransformer: this._payloadTransformer,\n consentPolicyGetter: this._consentPolicyGetter,\n nonEssentialDefaults: this._nonEssentialDefaults,\n maxBatchSize: this._maxBatchSize,\n globalBatchQueue: this._globalBatchQueue,\n },\n context,\n );\n\n biLoggerManager.manager.notifyLoggerCreated(logger);\n\n return logger;\n }\n}\n\nmodule.exports = BiLoggerFactory;\n", "'use strict'; // eslint-disable-line strict\nconst BiLoggerClientFactory = require('./bi-logger-factory');\nconst BiLogger = require('./bi-logger');\nconst biLoggerManager = require('./bi-logger-manager');\nconst BatchQueue = require('./utils/batch-queue');\n\nmodule.exports.BiLoggerFactory = BiLoggerClientFactory;\nmodule.exports.BiLogger = BiLogger;\nmodule.exports.BiLoggerManager = biLoggerManager.BiLoggerManager;\n\nmodule.exports.factory = () => new BiLoggerClientFactory();\nmodule.exports.manager = biLoggerManager.manager;\nmodule.exports.createBatchQueue = () => new BatchQueue();\n", "'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n", "'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n", "'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n", "'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n", "'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n", "'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n", "{\n \"name\": \"axios\",\n \"version\": \"0.21.4\",\n \"description\": \"Promise based HTTP client for the browser and node.js\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \"grunt test\",\n \"start\": \"node ./sandbox/server.js\",\n \"build\": \"NODE_ENV=production grunt build\",\n \"preversion\": \"npm test\",\n \"version\": \"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\n \"postversion\": \"git push && git push --tags\",\n \"examples\": \"node ./examples/server.js\",\n \"coveralls\": \"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\n \"fix\": \"eslint --fix lib/**/*.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/axios/axios.git\"\n },\n \"keywords\": [\n \"xhr\",\n \"http\",\n \"ajax\",\n \"promise\",\n \"node\"\n ],\n \"author\": \"Matt Zabriskie\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/axios/axios/issues\"\n },\n \"homepage\": \"https://axios-http.com\",\n \"devDependencies\": {\n \"coveralls\": \"^3.0.0\",\n \"es6-promise\": \"^4.2.4\",\n \"grunt\": \"^1.3.0\",\n \"grunt-banner\": \"^0.6.0\",\n \"grunt-cli\": \"^1.2.0\",\n \"grunt-contrib-clean\": \"^1.1.0\",\n \"grunt-contrib-watch\": \"^1.0.0\",\n \"grunt-eslint\": \"^23.0.0\",\n \"grunt-karma\": \"^4.0.0\",\n \"grunt-mocha-test\": \"^0.13.3\",\n \"grunt-ts\": \"^6.0.0-beta.19\",\n \"grunt-webpack\": \"^4.0.2\",\n \"istanbul-instrumenter-loader\": \"^1.0.0\",\n \"jasmine-core\": \"^2.4.1\",\n \"karma\": \"^6.3.2\",\n \"karma-chrome-launcher\": \"^3.1.0\",\n \"karma-firefox-launcher\": \"^2.1.0\",\n \"karma-jasmine\": \"^1.1.1\",\n \"karma-jasmine-ajax\": \"^0.1.13\",\n \"karma-safari-launcher\": \"^1.0.0\",\n \"karma-sauce-launcher\": \"^4.3.6\",\n \"karma-sinon\": \"^1.0.5\",\n \"karma-sourcemap-loader\": \"^0.3.8\",\n \"karma-webpack\": \"^4.0.2\",\n \"load-grunt-tasks\": \"^3.5.2\",\n \"minimist\": \"^1.2.0\",\n \"mocha\": \"^8.2.1\",\n \"sinon\": \"^4.5.0\",\n \"terser-webpack-plugin\": \"^4.2.3\",\n \"typescript\": \"^4.0.5\",\n \"url-search-params\": \"^0.10.0\",\n \"webpack\": \"^4.44.2\",\n \"webpack-dev-server\": \"^3.11.0\"\n },\n \"browser\": {\n \"./lib/adapters/http.js\": \"./lib/adapters/xhr.js\"\n },\n \"jsdelivr\": \"dist/axios.min.js\",\n \"unpkg\": \"dist/axios.min.js\",\n \"typings\": \"./index.d.ts\",\n \"dependencies\": {\n \"follow-redirects\": \"^1.14.0\"\n },\n \"bundlesize\": [\n {\n \"path\": \"./dist/axios.min.js\",\n \"threshold\": \"5kB\"\n }\n ]\n}\n", "'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n", "'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n", "'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n", "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n", "'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n", "module.exports = require('./lib/axios');", "export * from \"./errors.js\";\nexport * from \"./helpers/parseUtil.js\";\nexport * from \"./helpers/typeAliases.js\";\nexport * from \"./helpers/util.js\";\nexport * from \"./types.js\";\nexport * from \"./ZodError.js\";\n", "export var util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nexport var objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nexport const ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n", "import { util } from \"./helpers/util.js\";\nexport const ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nexport const quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexport class ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n", "import { ZodIssueCode } from \"../ZodError.js\";\nimport { util, ZodParsedType } from \"../helpers/util.js\";\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"bigint\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\nexport default errorMap;\n", "import defaultErrorMap from \"./locales/en.js\";\nlet overrideErrorMap = defaultErrorMap;\nexport { defaultErrorMap };\nexport function setErrorMap(map) {\n overrideErrorMap = map;\n}\nexport function getErrorMap() {\n return overrideErrorMap;\n}\n", "import { getErrorMap } from \"../errors.js\";\nimport defaultErrorMap from \"../locales/en.js\";\nexport const makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexport const EMPTY_PATH = [];\nexport function addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexport class ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexport const INVALID = Object.freeze({\n status: \"aborted\",\n});\nexport const DIRTY = (value) => ({ status: \"dirty\", value });\nexport const OK = (value) => ({ status: \"valid\", value });\nexport const isAborted = (x) => x.status === \"aborted\";\nexport const isDirty = (x) => x.status === \"dirty\";\nexport const isValid = (x) => x.status === \"valid\";\nexport const isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n", "export var errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (errorUtil = {}));\n", "import { ZodError, ZodIssueCode, } from \"./ZodError.js\";\nimport { defaultErrorMap, getErrorMap } from \"./errors.js\";\nimport { errorUtil } from \"./helpers/errorUtil.js\";\nimport { DIRTY, INVALID, OK, ParseStatus, addIssueToContext, isAborted, isAsync, isDirty, isValid, makeIssue, } from \"./helpers/parseUtil.js\";\nimport { util, ZodParsedType, getParsedType } from \"./helpers/util.js\";\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (Array.isArray(this._key)) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message ?? ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: message ?? required_error ?? ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: message ?? invalid_type_error ?? ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nexport class ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n const ctx = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if (err?.message?.toLowerCase()?.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params?.errorMap,\n async: true,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&\u2019*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nconst ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/;\n// const ipv6Regex =\n// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\nconst ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\nconst ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n let secondsRegexSource = `[0-5]\\\\d`;\n if (args.precision) {\n secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n }\n const secondsQuantifier = args.precision ? \"+\" : \"?\"; // require seconds if precision is nonzero\n return `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n if (!header)\n return false;\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (\"typ\" in decoded && decoded?.typ !== \"JWT\")\n return false;\n if (!decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nexport class ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"nanoid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"duration\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"jwt\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cidr\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n offset: options?.offset ?? false,\n local: options?.local ?? false,\n ...errorUtil.errToObj(options?.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n ...errorUtil.errToObj(options?.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options?.position,\n ...errorUtil.errToObj(options?.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nexport class ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" || (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null;\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (Number.isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: params?.coerce || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nexport class ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nexport class ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nexport class ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nexport class ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nexport class ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nexport class ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nexport class ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nexport class ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n this._cached = { shape, keys };\n return this._cached;\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") {\n }\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: errorUtil.errToObj(message).message ?? defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n for (const key of util.objectKeys(mask)) {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nexport class ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nexport class ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\n// type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];\nexport class ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nexport class ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nexport class ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nexport class ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nexport class ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nexport class ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nexport class ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nexport class ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(this._def.values);\n }\n if (!this._cache.has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\nZodEnum.create = createZodEnum;\nexport class ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(util.getValidEnumValues(this._def.values));\n }\n if (!this._cache.has(input.data)) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nexport class ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nexport class ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return INVALID;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {\n if (!isValid(base))\n return INVALID;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n status: status.value,\n value: result,\n }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nexport { ZodEffects as ZodTransformer };\nexport class ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nexport class ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nexport class ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n ...processCreateParams(params),\n });\n};\nexport class ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nexport class ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nexport const BRAND = Symbol(\"zod_brand\");\nexport class ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nexport class ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nexport class ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if (isValid(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\" ? params(data) : typeof params === \"string\" ? { message: params } : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nexport function custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nexport { ZodType as Schema, ZodType as ZodSchema };\nexport const late = {\n object: ZodObject.lazycreate,\n};\nexport var ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\n// requires TS 4.4+\nclass Class {\n constructor(..._) { }\n}\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nexport const coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nexport { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };\nexport const NEVER = INVALID;\n", "export const ignoreOverride = Symbol(\"Let zodToJsonSchema decide on which parser to use\");\nexport const jsonDescription = (jsonSchema, def) => {\n if (def.description) {\n try {\n return {\n ...jsonSchema,\n ...JSON.parse(def.description),\n };\n }\n catch { }\n }\n return jsonSchema;\n};\nexport const defaultOptions = {\n name: undefined,\n $refStrategy: \"root\",\n basePath: [\"#\"],\n effectStrategy: \"input\",\n pipeStrategy: \"all\",\n dateStrategy: \"format:date-time\",\n mapStrategy: \"entries\",\n removeAdditionalStrategy: \"passthrough\",\n allowedAdditionalProperties: true,\n rejectedAdditionalProperties: false,\n definitionPath: \"definitions\",\n target: \"jsonSchema7\",\n strictUnions: false,\n definitions: {},\n errorMessages: false,\n markdownDescription: false,\n patternStrategy: \"escape\",\n applyRegexFlags: false,\n emailStrategy: \"format:email\",\n base64Strategy: \"contentEncoding:base64\",\n nameStrategy: \"ref\",\n openAiAnyTypeName: \"OpenAiAnyType\"\n};\nexport const getDefaultOptions = (options) => (typeof options === \"string\"\n ? {\n ...defaultOptions,\n name: options,\n }\n : {\n ...defaultOptions,\n ...options,\n });\n", "import { getDefaultOptions } from \"./Options.js\";\nexport const getRefs = (options) => {\n const _options = getDefaultOptions(options);\n const currentPath = _options.name !== undefined\n ? [..._options.basePath, _options.definitionPath, _options.name]\n : _options.basePath;\n return {\n ..._options,\n flags: { hasReferencedOpenAiAnyType: false },\n currentPath: currentPath,\n propertyPath: undefined,\n seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [\n def._def,\n {\n def: def._def,\n path: [..._options.basePath, _options.definitionPath, name],\n // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.\n jsonSchema: undefined,\n },\n ])),\n };\n};\n", "export function addErrorMessage(res, key, errorMessage, refs) {\n if (!refs?.errorMessages)\n return;\n if (errorMessage) {\n res.errorMessage = {\n ...res.errorMessage,\n [key]: errorMessage,\n };\n }\n}\nexport function setResponseValueAndErrors(res, key, value, errorMessage, refs) {\n res[key] = value;\n addErrorMessage(res, key, errorMessage, refs);\n}\n", "export const getRelativePath = (pathA, pathB) => {\n let i = 0;\n for (; i < pathA.length && i < pathB.length; i++) {\n if (pathA[i] !== pathB[i])\n break;\n }\n return [(pathA.length - i).toString(), ...pathB.slice(i)].join(\"/\");\n};\n", "import { getRelativePath } from \"../getRelativePath.js\";\nexport function parseAnyDef(refs) {\n if (refs.target !== \"openAi\") {\n return {};\n }\n const anyDefinitionPath = [\n ...refs.basePath,\n refs.definitionPath,\n refs.openAiAnyTypeName,\n ];\n refs.flags.hasReferencedOpenAiAnyType = true;\n return {\n $ref: refs.$refStrategy === \"relative\"\n ? getRelativePath(anyDefinitionPath, refs.currentPath)\n : anyDefinitionPath.join(\"/\"),\n };\n}\n", "import { ZodFirstPartyTypeKind } from \"zod/v3\";\nimport { setResponseValueAndErrors } from \"../errorMessages.js\";\nimport { parseDef } from \"../parseDef.js\";\nexport function parseArrayDef(def, refs) {\n const res = {\n type: \"array\",\n };\n if (def.type?._def &&\n def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) {\n res.items = parseDef(def.type._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"items\"],\n });\n }\n if (def.minLength) {\n setResponseValueAndErrors(res, \"minItems\", def.minLength.value, def.minLength.message, refs);\n }\n if (def.maxLength) {\n setResponseValueAndErrors(res, \"maxItems\", def.maxLength.value, def.maxLength.message, refs);\n }\n if (def.exactLength) {\n setResponseValueAndErrors(res, \"minItems\", def.exactLength.value, def.exactLength.message, refs);\n setResponseValueAndErrors(res, \"maxItems\", def.exactLength.value, def.exactLength.message, refs);\n }\n return res;\n}\n", "import { setResponseValueAndErrors } from \"../errorMessages.js\";\nexport function parseBigintDef(def, refs) {\n const res = {\n type: \"integer\",\n format: \"int64\",\n };\n if (!def.checks)\n return res;\n for (const check of def.checks) {\n switch (check.kind) {\n case \"min\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(res, \"minimum\", check.value, check.message, refs);\n }\n else {\n setResponseValueAndErrors(res, \"exclusiveMinimum\", check.value, check.message, refs);\n }\n }\n else {\n if (!check.inclusive) {\n res.exclusiveMinimum = true;\n }\n setResponseValueAndErrors(res, \"minimum\", check.value, check.message, refs);\n }\n break;\n case \"max\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(res, \"maximum\", check.value, check.message, refs);\n }\n else {\n setResponseValueAndErrors(res, \"exclusiveMaximum\", check.value, check.message, refs);\n }\n }\n else {\n if (!check.inclusive) {\n res.exclusiveMaximum = true;\n }\n setResponseValueAndErrors(res, \"maximum\", check.value, check.message, refs);\n }\n break;\n case \"multipleOf\":\n setResponseValueAndErrors(res, \"multipleOf\", check.value, check.message, refs);\n break;\n }\n }\n return res;\n}\n", "export function parseBooleanDef() {\n return {\n type: \"boolean\",\n };\n}\n", "import { parseDef } from \"../parseDef.js\";\nexport function parseBrandedDef(_def, refs) {\n return parseDef(_def.type._def, refs);\n}\n", "import { parseDef } from \"../parseDef.js\";\nexport const parseCatchDef = (def, refs) => {\n return parseDef(def.innerType._def, refs);\n};\n", "import { setResponseValueAndErrors } from \"../errorMessages.js\";\nexport function parseDateDef(def, refs, overrideDateStrategy) {\n const strategy = overrideDateStrategy ?? refs.dateStrategy;\n if (Array.isArray(strategy)) {\n return {\n anyOf: strategy.map((item, i) => parseDateDef(def, refs, item)),\n };\n }\n switch (strategy) {\n case \"string\":\n case \"format:date-time\":\n return {\n type: \"string\",\n format: \"date-time\",\n };\n case \"format:date\":\n return {\n type: \"string\",\n format: \"date\",\n };\n case \"integer\":\n return integerDateParser(def, refs);\n }\n}\nconst integerDateParser = (def, refs) => {\n const res = {\n type: \"integer\",\n format: \"unix-time\",\n };\n if (refs.target === \"openApi3\") {\n return res;\n }\n for (const check of def.checks) {\n switch (check.kind) {\n case \"min\":\n setResponseValueAndErrors(res, \"minimum\", check.value, // This is in milliseconds\n check.message, refs);\n break;\n case \"max\":\n setResponseValueAndErrors(res, \"maximum\", check.value, // This is in milliseconds\n check.message, refs);\n break;\n }\n }\n return res;\n};\n", "import { parseDef } from \"../parseDef.js\";\nexport function parseDefaultDef(_def, refs) {\n return {\n ...parseDef(_def.innerType._def, refs),\n default: _def.defaultValue(),\n };\n}\n", "import { parseDef } from \"../parseDef.js\";\nimport { parseAnyDef } from \"./any.js\";\nexport function parseEffectsDef(_def, refs) {\n return refs.effectStrategy === \"input\"\n ? parseDef(_def.schema._def, refs)\n : parseAnyDef(refs);\n}\n", "export function parseEnumDef(def) {\n return {\n type: \"string\",\n enum: Array.from(def.values),\n };\n}\n", "import { parseDef } from \"../parseDef.js\";\nconst isJsonSchema7AllOfType = (type) => {\n if (\"type\" in type && type.type === \"string\")\n return false;\n return \"allOf\" in type;\n};\nexport function parseIntersectionDef(def, refs) {\n const allOf = [\n parseDef(def.left._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"allOf\", \"0\"],\n }),\n parseDef(def.right._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"allOf\", \"1\"],\n }),\n ].filter((x) => !!x);\n let unevaluatedProperties = refs.target === \"jsonSchema2019-09\"\n ? { unevaluatedProperties: false }\n : undefined;\n const mergedAllOf = [];\n // If either of the schemas is an allOf, merge them into a single allOf\n allOf.forEach((schema) => {\n if (isJsonSchema7AllOfType(schema)) {\n mergedAllOf.push(...schema.allOf);\n if (schema.unevaluatedProperties === undefined) {\n // If one of the schemas has no unevaluatedProperties set,\n // the merged schema should also have no unevaluatedProperties set\n unevaluatedProperties = undefined;\n }\n }\n else {\n let nestedSchema = schema;\n if (\"additionalProperties\" in schema &&\n schema.additionalProperties === false) {\n const { additionalProperties, ...rest } = schema;\n nestedSchema = rest;\n }\n else {\n // As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties\n unevaluatedProperties = undefined;\n }\n mergedAllOf.push(nestedSchema);\n }\n });\n return mergedAllOf.length\n ? {\n allOf: mergedAllOf,\n ...unevaluatedProperties,\n }\n : undefined;\n}\n", "export function parseLiteralDef(def, refs) {\n const parsedType = typeof def.value;\n if (parsedType !== \"bigint\" &&\n parsedType !== \"number\" &&\n parsedType !== \"boolean\" &&\n parsedType !== \"string\") {\n return {\n type: Array.isArray(def.value) ? \"array\" : \"object\",\n };\n }\n if (refs.target === \"openApi3\") {\n return {\n type: parsedType === \"bigint\" ? \"integer\" : parsedType,\n enum: [def.value],\n };\n }\n return {\n type: parsedType === \"bigint\" ? \"integer\" : parsedType,\n const: def.value,\n };\n}\n", "import { setResponseValueAndErrors } from \"../errorMessages.js\";\nlet emojiRegex = undefined;\n/**\n * Generated from the regular expressions found here as of 2024-05-22:\n * https://github.com/colinhacks/zod/blob/master/src/types.ts.\n *\n * Expressions with /i flag have been changed accordingly.\n */\nexport const zodPatterns = {\n /**\n * `c` was changed to `[cC]` to replicate /i flag\n */\n cuid: /^[cC][^\\s-]{8,}$/,\n cuid2: /^[0-9a-z]+$/,\n ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,\n /**\n * `a-z` was added to replicate /i flag\n */\n email: /^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_'+\\-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$/,\n /**\n * Constructed a valid Unicode RegExp\n *\n * Lazily instantiate since this type of regex isn't supported\n * in all envs (e.g. React Native).\n *\n * See:\n * https://github.com/colinhacks/zod/issues/2433\n * Fix in Zod:\n * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b\n */\n emoji: () => {\n if (emojiRegex === undefined) {\n emojiRegex = RegExp(\"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\", \"u\");\n }\n return emojiRegex;\n },\n /**\n * Unused\n */\n uuid: /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/,\n /**\n * Unused\n */\n ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,\n ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/,\n /**\n * Unused\n */\n ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,\n ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,\n base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,\n base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,\n nanoid: /^[a-zA-Z0-9_-]{21}$/,\n jwt: /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/,\n};\nexport function parseStringDef(def, refs) {\n const res = {\n type: \"string\",\n };\n if (def.checks) {\n for (const check of def.checks) {\n switch (check.kind) {\n case \"min\":\n setResponseValueAndErrors(res, \"minLength\", typeof res.minLength === \"number\"\n ? Math.max(res.minLength, check.value)\n : check.value, check.message, refs);\n break;\n case \"max\":\n setResponseValueAndErrors(res, \"maxLength\", typeof res.maxLength === \"number\"\n ? Math.min(res.maxLength, check.value)\n : check.value, check.message, refs);\n break;\n case \"email\":\n switch (refs.emailStrategy) {\n case \"format:email\":\n addFormat(res, \"email\", check.message, refs);\n break;\n case \"format:idn-email\":\n addFormat(res, \"idn-email\", check.message, refs);\n break;\n case \"pattern:zod\":\n addPattern(res, zodPatterns.email, check.message, refs);\n break;\n }\n break;\n case \"url\":\n addFormat(res, \"uri\", check.message, refs);\n break;\n case \"uuid\":\n addFormat(res, \"uuid\", check.message, refs);\n break;\n case \"regex\":\n addPattern(res, check.regex, check.message, refs);\n break;\n case \"cuid\":\n addPattern(res, zodPatterns.cuid, check.message, refs);\n break;\n case \"cuid2\":\n addPattern(res, zodPatterns.cuid2, check.message, refs);\n break;\n case \"startsWith\":\n addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);\n break;\n case \"endsWith\":\n addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);\n break;\n case \"datetime\":\n addFormat(res, \"date-time\", check.message, refs);\n break;\n case \"date\":\n addFormat(res, \"date\", check.message, refs);\n break;\n case \"time\":\n addFormat(res, \"time\", check.message, refs);\n break;\n case \"duration\":\n addFormat(res, \"duration\", check.message, refs);\n break;\n case \"length\":\n setResponseValueAndErrors(res, \"minLength\", typeof res.minLength === \"number\"\n ? Math.max(res.minLength, check.value)\n : check.value, check.message, refs);\n setResponseValueAndErrors(res, \"maxLength\", typeof res.maxLength === \"number\"\n ? Math.min(res.maxLength, check.value)\n : check.value, check.message, refs);\n break;\n case \"includes\": {\n addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);\n break;\n }\n case \"ip\": {\n if (check.version !== \"v6\") {\n addFormat(res, \"ipv4\", check.message, refs);\n }\n if (check.version !== \"v4\") {\n addFormat(res, \"ipv6\", check.message, refs);\n }\n break;\n }\n case \"base64url\":\n addPattern(res, zodPatterns.base64url, check.message, refs);\n break;\n case \"jwt\":\n addPattern(res, zodPatterns.jwt, check.message, refs);\n break;\n case \"cidr\": {\n if (check.version !== \"v6\") {\n addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);\n }\n if (check.version !== \"v4\") {\n addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);\n }\n break;\n }\n case \"emoji\":\n addPattern(res, zodPatterns.emoji(), check.message, refs);\n break;\n case \"ulid\": {\n addPattern(res, zodPatterns.ulid, check.message, refs);\n break;\n }\n case \"base64\": {\n switch (refs.base64Strategy) {\n case \"format:binary\": {\n addFormat(res, \"binary\", check.message, refs);\n break;\n }\n case \"contentEncoding:base64\": {\n setResponseValueAndErrors(res, \"contentEncoding\", \"base64\", check.message, refs);\n break;\n }\n case \"pattern:zod\": {\n addPattern(res, zodPatterns.base64, check.message, refs);\n break;\n }\n }\n break;\n }\n case \"nanoid\": {\n addPattern(res, zodPatterns.nanoid, check.message, refs);\n }\n case \"toLowerCase\":\n case \"toUpperCase\":\n case \"trim\":\n break;\n default:\n ((_) => { })(check);\n }\n }\n }\n return res;\n}\nfunction escapeLiteralCheckValue(literal, refs) {\n return refs.patternStrategy === \"escape\"\n ? escapeNonAlphaNumeric(literal)\n : literal;\n}\nconst ALPHA_NUMERIC = new Set(\"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789\");\nfunction escapeNonAlphaNumeric(source) {\n let result = \"\";\n for (let i = 0; i < source.length; i++) {\n if (!ALPHA_NUMERIC.has(source[i])) {\n result += \"\\\\\";\n }\n result += source[i];\n }\n return result;\n}\n// Adds a \"format\" keyword to the schema. If a format exists, both formats will be joined in an allOf-node, along with subsequent ones.\nfunction addFormat(schema, value, message, refs) {\n if (schema.format || schema.anyOf?.some((x) => x.format)) {\n if (!schema.anyOf) {\n schema.anyOf = [];\n }\n if (schema.format) {\n schema.anyOf.push({\n format: schema.format,\n ...(schema.errorMessage &&\n refs.errorMessages && {\n errorMessage: { format: schema.errorMessage.format },\n }),\n });\n delete schema.format;\n if (schema.errorMessage) {\n delete schema.errorMessage.format;\n if (Object.keys(schema.errorMessage).length === 0) {\n delete schema.errorMessage;\n }\n }\n }\n schema.anyOf.push({\n format: value,\n ...(message &&\n refs.errorMessages && { errorMessage: { format: message } }),\n });\n }\n else {\n setResponseValueAndErrors(schema, \"format\", value, message, refs);\n }\n}\n// Adds a \"pattern\" keyword to the schema. If a pattern exists, both patterns will be joined in an allOf-node, along with subsequent ones.\nfunction addPattern(schema, regex, message, refs) {\n if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {\n if (!schema.allOf) {\n schema.allOf = [];\n }\n if (schema.pattern) {\n schema.allOf.push({\n pattern: schema.pattern,\n ...(schema.errorMessage &&\n refs.errorMessages && {\n errorMessage: { pattern: schema.errorMessage.pattern },\n }),\n });\n delete schema.pattern;\n if (schema.errorMessage) {\n delete schema.errorMessage.pattern;\n if (Object.keys(schema.errorMessage).length === 0) {\n delete schema.errorMessage;\n }\n }\n }\n schema.allOf.push({\n pattern: stringifyRegExpWithFlags(regex, refs),\n ...(message &&\n refs.errorMessages && { errorMessage: { pattern: message } }),\n });\n }\n else {\n setResponseValueAndErrors(schema, \"pattern\", stringifyRegExpWithFlags(regex, refs), message, refs);\n }\n}\n// Mutate z.string.regex() in a best attempt to accommodate for regex flags when applyRegexFlags is true\nfunction stringifyRegExpWithFlags(regex, refs) {\n if (!refs.applyRegexFlags || !regex.flags) {\n return regex.source;\n }\n // Currently handled flags\n const flags = {\n i: regex.flags.includes(\"i\"),\n m: regex.flags.includes(\"m\"),\n s: regex.flags.includes(\"s\"), // `.` matches newlines\n };\n // The general principle here is to step through each character, one at a time, applying mutations as flags require. We keep track when the current character is escaped, and when it's inside a group /like [this]/ or (also) a range like /[a-z]/. The following is fairly brittle imperative code; edit at your peril!\n const source = flags.i ? regex.source.toLowerCase() : regex.source;\n let pattern = \"\";\n let isEscaped = false;\n let inCharGroup = false;\n let inCharRange = false;\n for (let i = 0; i < source.length; i++) {\n if (isEscaped) {\n pattern += source[i];\n isEscaped = false;\n continue;\n }\n if (flags.i) {\n if (inCharGroup) {\n if (source[i].match(/[a-z]/)) {\n if (inCharRange) {\n pattern += source[i];\n pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();\n inCharRange = false;\n }\n else if (source[i + 1] === \"-\" && source[i + 2]?.match(/[a-z]/)) {\n pattern += source[i];\n inCharRange = true;\n }\n else {\n pattern += `${source[i]}${source[i].toUpperCase()}`;\n }\n continue;\n }\n }\n else if (source[i].match(/[a-z]/)) {\n pattern += `[${source[i]}${source[i].toUpperCase()}]`;\n continue;\n }\n }\n if (flags.m) {\n if (source[i] === \"^\") {\n pattern += `(^|(?<=[\\r\\n]))`;\n continue;\n }\n else if (source[i] === \"$\") {\n pattern += `($|(?=[\\r\\n]))`;\n continue;\n }\n }\n if (flags.s && source[i] === \".\") {\n pattern += inCharGroup ? `${source[i]}\\r\\n` : `[${source[i]}\\r\\n]`;\n continue;\n }\n pattern += source[i];\n if (source[i] === \"\\\\\") {\n isEscaped = true;\n }\n else if (inCharGroup && source[i] === \"]\") {\n inCharGroup = false;\n }\n else if (!inCharGroup && source[i] === \"[\") {\n inCharGroup = true;\n }\n }\n try {\n new RegExp(pattern);\n }\n catch {\n console.warn(`Could not convert regex pattern at ${refs.currentPath.join(\"/\")} to a flag-independent form! Falling back to the flag-ignorant source`);\n return regex.source;\n }\n return pattern;\n}\n", "import { ZodFirstPartyTypeKind, } from \"zod/v3\";\nimport { parseDef } from \"../parseDef.js\";\nimport { parseStringDef } from \"./string.js\";\nimport { parseBrandedDef } from \"./branded.js\";\nimport { parseAnyDef } from \"./any.js\";\nexport function parseRecordDef(def, refs) {\n if (refs.target === \"openAi\") {\n console.warn(\"Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.\");\n }\n if (refs.target === \"openApi3\" &&\n def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {\n return {\n type: \"object\",\n required: def.keyType._def.values,\n properties: def.keyType._def.values.reduce((acc, key) => ({\n ...acc,\n [key]: parseDef(def.valueType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"properties\", key],\n }) ?? parseAnyDef(refs),\n }), {}),\n additionalProperties: refs.rejectedAdditionalProperties,\n };\n }\n const schema = {\n type: \"object\",\n additionalProperties: parseDef(def.valueType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"additionalProperties\"],\n }) ?? refs.allowedAdditionalProperties,\n };\n if (refs.target === \"openApi3\") {\n return schema;\n }\n if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString &&\n def.keyType._def.checks?.length) {\n const { type, ...keyType } = parseStringDef(def.keyType._def, refs);\n return {\n ...schema,\n propertyNames: keyType,\n };\n }\n else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {\n return {\n ...schema,\n propertyNames: {\n enum: def.keyType._def.values,\n },\n };\n }\n else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded &&\n def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString &&\n def.keyType._def.type._def.checks?.length) {\n const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);\n return {\n ...schema,\n propertyNames: keyType,\n };\n }\n return schema;\n}\n", "import { parseDef } from \"../parseDef.js\";\nimport { parseRecordDef } from \"./record.js\";\nimport { parseAnyDef } from \"./any.js\";\nexport function parseMapDef(def, refs) {\n if (refs.mapStrategy === \"record\") {\n return parseRecordDef(def, refs);\n }\n const keys = parseDef(def.keyType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"items\", \"items\", \"0\"],\n }) || parseAnyDef(refs);\n const values = parseDef(def.valueType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"items\", \"items\", \"1\"],\n }) || parseAnyDef(refs);\n return {\n type: \"array\",\n maxItems: 125,\n items: {\n type: \"array\",\n items: [keys, values],\n minItems: 2,\n maxItems: 2,\n },\n };\n}\n", "export function parseNativeEnumDef(def) {\n const object = def.values;\n const actualKeys = Object.keys(def.values).filter((key) => {\n return typeof object[object[key]] !== \"number\";\n });\n const actualValues = actualKeys.map((key) => object[key]);\n const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));\n return {\n type: parsedTypes.length === 1\n ? parsedTypes[0] === \"string\"\n ? \"string\"\n : \"number\"\n : [\"string\", \"number\"],\n enum: actualValues,\n };\n}\n", "import { parseAnyDef } from \"./any.js\";\nexport function parseNeverDef(refs) {\n return refs.target === \"openAi\"\n ? undefined\n : {\n not: parseAnyDef({\n ...refs,\n currentPath: [...refs.currentPath, \"not\"],\n }),\n };\n}\n", "export function parseNullDef(refs) {\n return refs.target === \"openApi3\"\n ? {\n enum: [\"null\"],\n nullable: true,\n }\n : {\n type: \"null\",\n };\n}\n", "import { parseDef } from \"../parseDef.js\";\nexport const primitiveMappings = {\n ZodString: \"string\",\n ZodNumber: \"number\",\n ZodBigInt: \"integer\",\n ZodBoolean: \"boolean\",\n ZodNull: \"null\",\n};\nexport function parseUnionDef(def, refs) {\n if (refs.target === \"openApi3\")\n return asAnyOf(def, refs);\n const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;\n // This blocks tries to look ahead a bit to produce nicer looking schemas with type array instead of anyOf.\n if (options.every((x) => x._def.typeName in primitiveMappings &&\n (!x._def.checks || !x._def.checks.length))) {\n // all types in union are primitive and lack checks, so might as well squash into {type: [...]}\n const types = options.reduce((types, x) => {\n const type = primitiveMappings[x._def.typeName]; //Can be safely casted due to row 43\n return type && !types.includes(type) ? [...types, type] : types;\n }, []);\n return {\n type: types.length > 1 ? types : types[0],\n };\n }\n else if (options.every((x) => x._def.typeName === \"ZodLiteral\" && !x.description)) {\n // all options literals\n const types = options.reduce((acc, x) => {\n const type = typeof x._def.value;\n switch (type) {\n case \"string\":\n case \"number\":\n case \"boolean\":\n return [...acc, type];\n case \"bigint\":\n return [...acc, \"integer\"];\n case \"object\":\n if (x._def.value === null)\n return [...acc, \"null\"];\n case \"symbol\":\n case \"undefined\":\n case \"function\":\n default:\n return acc;\n }\n }, []);\n if (types.length === options.length) {\n // all the literals are primitive, as far as null can be considered primitive\n const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);\n return {\n type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],\n enum: options.reduce((acc, x) => {\n return acc.includes(x._def.value) ? acc : [...acc, x._def.value];\n }, []),\n };\n }\n }\n else if (options.every((x) => x._def.typeName === \"ZodEnum\")) {\n return {\n type: \"string\",\n enum: options.reduce((acc, x) => [\n ...acc,\n ...x._def.values.filter((x) => !acc.includes(x)),\n ], []),\n };\n }\n return asAnyOf(def, refs);\n}\nconst asAnyOf = (def, refs) => {\n const anyOf = (def.options instanceof Map\n ? Array.from(def.options.values())\n : def.options)\n .map((x, i) => parseDef(x._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", `${i}`],\n }))\n .filter((x) => !!x &&\n (!refs.strictUnions ||\n (typeof x === \"object\" && Object.keys(x).length > 0)));\n return anyOf.length ? { anyOf } : undefined;\n};\n", "import { parseDef } from \"../parseDef.js\";\nimport { primitiveMappings } from \"./union.js\";\nexport function parseNullableDef(def, refs) {\n if ([\"ZodString\", \"ZodNumber\", \"ZodBigInt\", \"ZodBoolean\", \"ZodNull\"].includes(def.innerType._def.typeName) &&\n (!def.innerType._def.checks || !def.innerType._def.checks.length)) {\n if (refs.target === \"openApi3\") {\n return {\n type: primitiveMappings[def.innerType._def.typeName],\n nullable: true,\n };\n }\n return {\n type: [\n primitiveMappings[def.innerType._def.typeName],\n \"null\",\n ],\n };\n }\n if (refs.target === \"openApi3\") {\n const base = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath],\n });\n if (base && \"$ref\" in base)\n return { allOf: [base], nullable: true };\n return base && { ...base, nullable: true };\n }\n const base = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", \"0\"],\n });\n return base && { anyOf: [base, { type: \"null\" }] };\n}\n", "import { addErrorMessage, setResponseValueAndErrors, } from \"../errorMessages.js\";\nexport function parseNumberDef(def, refs) {\n const res = {\n type: \"number\",\n };\n if (!def.checks)\n return res;\n for (const check of def.checks) {\n switch (check.kind) {\n case \"int\":\n res.type = \"integer\";\n addErrorMessage(res, \"type\", check.message, refs);\n break;\n case \"min\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(res, \"minimum\", check.value, check.message, refs);\n }\n else {\n setResponseValueAndErrors(res, \"exclusiveMinimum\", check.value, check.message, refs);\n }\n }\n else {\n if (!check.inclusive) {\n res.exclusiveMinimum = true;\n }\n setResponseValueAndErrors(res, \"minimum\", check.value, check.message, refs);\n }\n break;\n case \"max\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(res, \"maximum\", check.value, check.message, refs);\n }\n else {\n setResponseValueAndErrors(res, \"exclusiveMaximum\", check.value, check.message, refs);\n }\n }\n else {\n if (!check.inclusive) {\n res.exclusiveMaximum = true;\n }\n setResponseValueAndErrors(res, \"maximum\", check.value, check.message, refs);\n }\n break;\n case \"multipleOf\":\n setResponseValueAndErrors(res, \"multipleOf\", check.value, check.message, refs);\n break;\n }\n }\n return res;\n}\n", "import { parseDef } from \"../parseDef.js\";\nexport function parseObjectDef(def, refs) {\n const forceOptionalIntoNullable = refs.target === \"openAi\";\n const result = {\n type: \"object\",\n properties: {},\n };\n const required = [];\n const shape = def.shape();\n for (const propName in shape) {\n let propDef = shape[propName];\n if (propDef === undefined || propDef._def === undefined) {\n continue;\n }\n let propOptional = safeIsOptional(propDef);\n if (propOptional && forceOptionalIntoNullable) {\n if (propDef._def.typeName === \"ZodOptional\") {\n propDef = propDef._def.innerType;\n }\n if (!propDef.isNullable()) {\n propDef = propDef.nullable();\n }\n propOptional = false;\n }\n const parsedDef = parseDef(propDef._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"properties\", propName],\n propertyPath: [...refs.currentPath, \"properties\", propName],\n });\n if (parsedDef === undefined) {\n continue;\n }\n result.properties[propName] = parsedDef;\n if (!propOptional) {\n required.push(propName);\n }\n }\n if (required.length) {\n result.required = required;\n }\n const additionalProperties = decideAdditionalProperties(def, refs);\n if (additionalProperties !== undefined) {\n result.additionalProperties = additionalProperties;\n }\n return result;\n}\nfunction decideAdditionalProperties(def, refs) {\n if (def.catchall._def.typeName !== \"ZodNever\") {\n return parseDef(def.catchall._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"additionalProperties\"],\n });\n }\n switch (def.unknownKeys) {\n case \"passthrough\":\n return refs.allowedAdditionalProperties;\n case \"strict\":\n return refs.rejectedAdditionalProperties;\n case \"strip\":\n return refs.removeAdditionalStrategy === \"strict\"\n ? refs.allowedAdditionalProperties\n : refs.rejectedAdditionalProperties;\n }\n}\nfunction safeIsOptional(schema) {\n try {\n return schema.isOptional();\n }\n catch {\n return true;\n }\n}\n", "import { parseDef } from \"../parseDef.js\";\nimport { parseAnyDef } from \"./any.js\";\nexport const parseOptionalDef = (def, refs) => {\n if (refs.currentPath.toString() === refs.propertyPath?.toString()) {\n return parseDef(def.innerType._def, refs);\n }\n const innerSchema = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", \"1\"],\n });\n return innerSchema\n ? {\n anyOf: [\n {\n not: parseAnyDef(refs),\n },\n innerSchema,\n ],\n }\n : parseAnyDef(refs);\n};\n", "import { parseDef } from \"../parseDef.js\";\nexport const parsePipelineDef = (def, refs) => {\n if (refs.pipeStrategy === \"input\") {\n return parseDef(def.in._def, refs);\n }\n else if (refs.pipeStrategy === \"output\") {\n return parseDef(def.out._def, refs);\n }\n const a = parseDef(def.in._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"allOf\", \"0\"],\n });\n const b = parseDef(def.out._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"allOf\", a ? \"1\" : \"0\"],\n });\n return {\n allOf: [a, b].filter((x) => x !== undefined),\n };\n};\n", "import { parseDef } from \"../parseDef.js\";\nexport function parsePromiseDef(def, refs) {\n return parseDef(def.type._def, refs);\n}\n", "import { setResponseValueAndErrors } from \"../errorMessages.js\";\nimport { parseDef } from \"../parseDef.js\";\nexport function parseSetDef(def, refs) {\n const items = parseDef(def.valueType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"items\"],\n });\n const schema = {\n type: \"array\",\n uniqueItems: true,\n items,\n };\n if (def.minSize) {\n setResponseValueAndErrors(schema, \"minItems\", def.minSize.value, def.minSize.message, refs);\n }\n if (def.maxSize) {\n setResponseValueAndErrors(schema, \"maxItems\", def.maxSize.value, def.maxSize.message, refs);\n }\n return schema;\n}\n", "import { parseDef } from \"../parseDef.js\";\nexport function parseTupleDef(def, refs) {\n if (def.rest) {\n return {\n type: \"array\",\n minItems: def.items.length,\n items: def.items\n .map((x, i) => parseDef(x._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"items\", `${i}`],\n }))\n .reduce((acc, x) => (x === undefined ? acc : [...acc, x]), []),\n additionalItems: parseDef(def.rest._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"additionalItems\"],\n }),\n };\n }\n else {\n return {\n type: \"array\",\n minItems: def.items.length,\n maxItems: def.items.length,\n items: def.items\n .map((x, i) => parseDef(x._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"items\", `${i}`],\n }))\n .reduce((acc, x) => (x === undefined ? acc : [...acc, x]), []),\n };\n }\n}\n", "import { parseAnyDef } from \"./any.js\";\nexport function parseUndefinedDef(refs) {\n return {\n not: parseAnyDef(refs),\n };\n}\n", "import { parseAnyDef } from \"./any.js\";\nexport function parseUnknownDef(refs) {\n return parseAnyDef(refs);\n}\n", "import { parseDef } from \"../parseDef.js\";\nexport const parseReadonlyDef = (def, refs) => {\n return parseDef(def.innerType._def, refs);\n};\n", "import { ZodFirstPartyTypeKind } from \"zod/v3\";\nimport { parseAnyDef } from \"./parsers/any.js\";\nimport { parseArrayDef } from \"./parsers/array.js\";\nimport { parseBigintDef } from \"./parsers/bigint.js\";\nimport { parseBooleanDef } from \"./parsers/boolean.js\";\nimport { parseBrandedDef } from \"./parsers/branded.js\";\nimport { parseCatchDef } from \"./parsers/catch.js\";\nimport { parseDateDef } from \"./parsers/date.js\";\nimport { parseDefaultDef } from \"./parsers/default.js\";\nimport { parseEffectsDef } from \"./parsers/effects.js\";\nimport { parseEnumDef } from \"./parsers/enum.js\";\nimport { parseIntersectionDef } from \"./parsers/intersection.js\";\nimport { parseLiteralDef } from \"./parsers/literal.js\";\nimport { parseMapDef } from \"./parsers/map.js\";\nimport { parseNativeEnumDef } from \"./parsers/nativeEnum.js\";\nimport { parseNeverDef } from \"./parsers/never.js\";\nimport { parseNullDef } from \"./parsers/null.js\";\nimport { parseNullableDef } from \"./parsers/nullable.js\";\nimport { parseNumberDef } from \"./parsers/number.js\";\nimport { parseObjectDef } from \"./parsers/object.js\";\nimport { parseOptionalDef } from \"./parsers/optional.js\";\nimport { parsePipelineDef } from \"./parsers/pipeline.js\";\nimport { parsePromiseDef } from \"./parsers/promise.js\";\nimport { parseRecordDef } from \"./parsers/record.js\";\nimport { parseSetDef } from \"./parsers/set.js\";\nimport { parseStringDef } from \"./parsers/string.js\";\nimport { parseTupleDef } from \"./parsers/tuple.js\";\nimport { parseUndefinedDef } from \"./parsers/undefined.js\";\nimport { parseUnionDef } from \"./parsers/union.js\";\nimport { parseUnknownDef } from \"./parsers/unknown.js\";\nimport { parseReadonlyDef } from \"./parsers/readonly.js\";\nexport const selectParser = (def, typeName, refs) => {\n switch (typeName) {\n case ZodFirstPartyTypeKind.ZodString:\n return parseStringDef(def, refs);\n case ZodFirstPartyTypeKind.ZodNumber:\n return parseNumberDef(def, refs);\n case ZodFirstPartyTypeKind.ZodObject:\n return parseObjectDef(def, refs);\n case ZodFirstPartyTypeKind.ZodBigInt:\n return parseBigintDef(def, refs);\n case ZodFirstPartyTypeKind.ZodBoolean:\n return parseBooleanDef();\n case ZodFirstPartyTypeKind.ZodDate:\n return parseDateDef(def, refs);\n case ZodFirstPartyTypeKind.ZodUndefined:\n return parseUndefinedDef(refs);\n case ZodFirstPartyTypeKind.ZodNull:\n return parseNullDef(refs);\n case ZodFirstPartyTypeKind.ZodArray:\n return parseArrayDef(def, refs);\n case ZodFirstPartyTypeKind.ZodUnion:\n case ZodFirstPartyTypeKind.ZodDiscriminatedUnion:\n return parseUnionDef(def, refs);\n case ZodFirstPartyTypeKind.ZodIntersection:\n return parseIntersectionDef(def, refs);\n case ZodFirstPartyTypeKind.ZodTuple:\n return parseTupleDef(def, refs);\n case ZodFirstPartyTypeKind.ZodRecord:\n return parseRecordDef(def, refs);\n case ZodFirstPartyTypeKind.ZodLiteral:\n return parseLiteralDef(def, refs);\n case ZodFirstPartyTypeKind.ZodEnum:\n return parseEnumDef(def);\n case ZodFirstPartyTypeKind.ZodNativeEnum:\n return parseNativeEnumDef(def);\n case ZodFirstPartyTypeKind.ZodNullable:\n return parseNullableDef(def, refs);\n case ZodFirstPartyTypeKind.ZodOptional:\n return parseOptionalDef(def, refs);\n case ZodFirstPartyTypeKind.ZodMap:\n return parseMapDef(def, refs);\n case ZodFirstPartyTypeKind.ZodSet:\n return parseSetDef(def, refs);\n case ZodFirstPartyTypeKind.ZodLazy:\n return () => def.getter()._def;\n case ZodFirstPartyTypeKind.ZodPromise:\n return parsePromiseDef(def, refs);\n case ZodFirstPartyTypeKind.ZodNaN:\n case ZodFirstPartyTypeKind.ZodNever:\n return parseNeverDef(refs);\n case ZodFirstPartyTypeKind.ZodEffects:\n return parseEffectsDef(def, refs);\n case ZodFirstPartyTypeKind.ZodAny:\n return parseAnyDef(refs);\n case ZodFirstPartyTypeKind.ZodUnknown:\n return parseUnknownDef(refs);\n case ZodFirstPartyTypeKind.ZodDefault:\n return parseDefaultDef(def, refs);\n case ZodFirstPartyTypeKind.ZodBranded:\n return parseBrandedDef(def, refs);\n case ZodFirstPartyTypeKind.ZodReadonly:\n return parseReadonlyDef(def, refs);\n case ZodFirstPartyTypeKind.ZodCatch:\n return parseCatchDef(def, refs);\n case ZodFirstPartyTypeKind.ZodPipeline:\n return parsePipelineDef(def, refs);\n case ZodFirstPartyTypeKind.ZodFunction:\n case ZodFirstPartyTypeKind.ZodVoid:\n case ZodFirstPartyTypeKind.ZodSymbol:\n return undefined;\n default:\n return ((_) => undefined)(typeName);\n }\n};\n", "import { ignoreOverride } from \"./Options.js\";\nimport { selectParser } from \"./selectParser.js\";\nimport { getRelativePath } from \"./getRelativePath.js\";\nimport { parseAnyDef } from \"./parsers/any.js\";\nexport function parseDef(def, refs, forceResolution = false) {\n const seenItem = refs.seen.get(def);\n if (refs.override) {\n const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);\n if (overrideResult !== ignoreOverride) {\n return overrideResult;\n }\n }\n if (seenItem && !forceResolution) {\n const seenSchema = get$ref(seenItem, refs);\n if (seenSchema !== undefined) {\n return seenSchema;\n }\n }\n const newItem = { def, path: refs.currentPath, jsonSchema: undefined };\n refs.seen.set(def, newItem);\n const jsonSchemaOrGetter = selectParser(def, def.typeName, refs);\n // If the return was a function, then the inner definition needs to be extracted before a call to parseDef (recursive)\n const jsonSchema = typeof jsonSchemaOrGetter === \"function\"\n ? parseDef(jsonSchemaOrGetter(), refs)\n : jsonSchemaOrGetter;\n if (jsonSchema) {\n addMeta(def, refs, jsonSchema);\n }\n if (refs.postProcess) {\n const postProcessResult = refs.postProcess(jsonSchema, def, refs);\n newItem.jsonSchema = jsonSchema;\n return postProcessResult;\n }\n newItem.jsonSchema = jsonSchema;\n return jsonSchema;\n}\nconst get$ref = (item, refs) => {\n switch (refs.$refStrategy) {\n case \"root\":\n return { $ref: item.path.join(\"/\") };\n case \"relative\":\n return { $ref: getRelativePath(refs.currentPath, item.path) };\n case \"none\":\n case \"seen\": {\n if (item.path.length < refs.currentPath.length &&\n item.path.every((value, index) => refs.currentPath[index] === value)) {\n console.warn(`Recursive reference detected at ${refs.currentPath.join(\"/\")}! Defaulting to any`);\n return parseAnyDef(refs);\n }\n return refs.$refStrategy === \"seen\" ? parseAnyDef(refs) : undefined;\n }\n }\n};\nconst addMeta = (def, refs, jsonSchema) => {\n if (def.description) {\n jsonSchema.description = def.description;\n if (refs.markdownDescription) {\n jsonSchema.markdownDescription = def.description;\n }\n }\n return jsonSchema;\n};\n", "import { parseDef } from \"./parseDef.js\";\nimport { getRefs } from \"./Refs.js\";\nimport { parseAnyDef } from \"./parsers/any.js\";\nconst zodToJsonSchema = (schema, options) => {\n const refs = getRefs(options);\n let definitions = typeof options === \"object\" && options.definitions\n ? Object.entries(options.definitions).reduce((acc, [name, schema]) => ({\n ...acc,\n [name]: parseDef(schema._def, {\n ...refs,\n currentPath: [...refs.basePath, refs.definitionPath, name],\n }, true) ?? parseAnyDef(refs),\n }), {})\n : undefined;\n const name = typeof options === \"string\"\n ? options\n : options?.nameStrategy === \"title\"\n ? undefined\n : options?.name;\n const main = parseDef(schema._def, name === undefined\n ? refs\n : {\n ...refs,\n currentPath: [...refs.basePath, refs.definitionPath, name],\n }, false) ?? parseAnyDef(refs);\n const title = typeof options === \"object\" &&\n options.name !== undefined &&\n options.nameStrategy === \"title\"\n ? options.name\n : undefined;\n if (title !== undefined) {\n main.title = title;\n }\n if (refs.flags.hasReferencedOpenAiAnyType) {\n if (!definitions) {\n definitions = {};\n }\n if (!definitions[refs.openAiAnyTypeName]) {\n definitions[refs.openAiAnyTypeName] = {\n // Skipping \"object\" as no properties can be defined and additionalProperties must be \"false\"\n type: [\"string\", \"number\", \"integer\", \"boolean\", \"array\", \"null\"],\n items: {\n $ref: refs.$refStrategy === \"relative\"\n ? \"1\"\n : [\n ...refs.basePath,\n refs.definitionPath,\n refs.openAiAnyTypeName,\n ].join(\"/\"),\n },\n };\n }\n }\n const combined = name === undefined\n ? definitions\n ? {\n ...main,\n [refs.definitionPath]: definitions,\n }\n : main\n : {\n $ref: [\n ...(refs.$refStrategy === \"relative\" ? [] : refs.basePath),\n refs.definitionPath,\n name,\n ].join(\"/\"),\n [refs.definitionPath]: {\n ...definitions,\n [name]: main,\n },\n };\n if (refs.target === \"jsonSchema7\") {\n combined.$schema = \"http://json-schema.org/draft-07/schema#\";\n }\n else if (refs.target === \"jsonSchema2019-09\" || refs.target === \"openAi\") {\n combined.$schema = \"https://json-schema.org/draft/2019-09/schema#\";\n }\n if (refs.target === \"openAi\" &&\n (\"anyOf\" in combined ||\n \"oneOf\" in combined ||\n \"allOf\" in combined ||\n (\"type\" in combined && Array.isArray(combined.type)))) {\n console.warn(\"Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.\");\n }\n return combined;\n};\nexport { zodToJsonSchema };\n", "import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n", "let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n", "const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n", "import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "[\n \"wix.com\",\n \"editorx.com\",\n \"wix-code.com\",\n \"wixapps.net\",\n \"wixprod.net\"\n]\n", null, null, null, "export { default } from '/home/builduser/work/124988b7e2fb3874/node_modules/@vespaiach/axios-fetch-adapter/index.js';", null, "import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport interface Logger {\n log(...data: unknown[]): void;\n error(...data: unknown[]): void;\n}\n\nconst createNullLogger = (): Logger => {\n return {\n log: () => {},\n error: () => {}\n };\n};\n\nconst createStdErrLogger = (): Logger => {\n return {\n log: (data) => {\n console.error(data);\n },\n error: (data) => {\n console.error(data);\n }\n };\n};\n\nconst createMcpServerLogger = (server: McpServer): Logger => {\n return {\n log: (data) => {\n server.server.sendLoggingMessage({ level: 'info', data });\n },\n error: (data) => {\n server.server.sendLoggingMessage({ level: 'error', data });\n }\n };\n};\n\nexport const logger = createNullLogger();\n\nexport const attachMcpServerLogger = (server: McpServer) => {\n const mcpLogger = createMcpServerLogger(server);\n logger.log = mcpLogger.log;\n logger.error = mcpLogger.error;\n};\n\nexport const attachStdErrLogger = () => {\n const stdErrLogger = createStdErrLogger();\n logger.log = stdErrLogger.log;\n logger.error = stdErrLogger.error;\n};\n\nexport const attachConsoleLogger = () => {\n logger.log = (...data: unknown[]) => console.log('[WixMCP]', ...data);\n logger.error = (...data: unknown[]) => console.error('[WixMCP]', ...data);\n};\n", "import { logger } from '../infra/logger.js';\n\nconst MAX_CONTENT_LENGTH = 10000;\n\n/**\n * Matches a query or search endpoint by its docs URL. Lowercase because slugs are, which also keeps\n * link titles and the injected `SearchWixAPISpec` menu hints out. Pass a page of menu links to ask\n * whether any of them is one.\n */\nexport const isQueryOrSearchEndpoint = (text: string): boolean =>\n /(query|search)/.test(text);\n\n/** Exported so the search footer can fire off a marker that was actually appended. */\nexport const QUERY_CAPABILITY_MARKER =\n '> Query/search: this endpoint declares which fields it can filter and sort by, and with which ' +\n 'operators. That list is closed and covers this endpoint only; the examples show part of it.';\n\nconst INTERLEAVE_RESULT_GROUP_SIZE = 2;\nconst METHOD_KB_NAMES = new Set([\n 'REST_METHODS_KB_ID',\n 'SDK_METHODS_KB_ID',\n 'VELO_METHODS_KB_ID'\n]);\n\nexport type RankedSearchResult = {\n kbName: string;\n entry: {\n content: string;\n chunkedContent?: string[];\n url?: string;\n };\n scoresInfo: {\n overallMatchScore: number;\n };\n};\n\nconst getContentFromChunkedContent = (chunkedContent: string[]) => {\n let content = '';\n for (const chunk of chunkedContent) {\n if (content.length + chunk.length > MAX_CONTENT_LENGTH) {\n break;\n }\n content += '\\n\\n---\\n\\n' + chunk;\n }\n return content;\n};\n\nconst extractSourceUrlFromContent = (content: string): string | undefined => {\n const match = content.match(\n /^#+\\s*(?:Article Link|Method link|Method Link):\\s*(https:\\/\\/\\S+)/im\n );\n return match?.[1];\n};\n\nconst isMethodResult = ({\n kbName,\n content\n}: {\n kbName: string;\n content: string;\n}) =>\n METHOD_KB_NAMES.has(kbName) ||\n /^## Method:/im.test(content) ||\n (/^# Package:/im.test(content) &&\n /^# Namespace:/im.test(content) &&\n /^# Method:/im.test(content));\n\nconst interleaveMethodAndArticleResults = (\n sortedResults: RankedSearchResult[],\n maxResults: number\n): RankedSearchResult[] => {\n const methodResults = sortedResults.filter((result) =>\n isMethodResult({ kbName: result.kbName, content: result.entry.content })\n );\n const articleResults = sortedResults.filter(\n (result) =>\n !isMethodResult({ kbName: result.kbName, content: result.entry.content })\n );\n\n if (methodResults.length === 0 || articleResults.length === 0) {\n return sortedResults.slice(0, maxResults);\n }\n\n const results: RankedSearchResult[] = [];\n let methodIndex = 0;\n let articleIndex = 0;\n\n while (results.length < maxResults) {\n const beforeIterationLength = results.length;\n\n results.push(\n ...methodResults.slice(\n methodIndex,\n methodIndex + INTERLEAVE_RESULT_GROUP_SIZE\n )\n );\n methodIndex += INTERLEAVE_RESULT_GROUP_SIZE;\n\n if (results.length >= maxResults) {\n break;\n }\n\n results.push(\n ...articleResults.slice(\n articleIndex,\n articleIndex + INTERLEAVE_RESULT_GROUP_SIZE\n )\n );\n articleIndex += INTERLEAVE_RESULT_GROUP_SIZE;\n\n if (results.length === beforeIterationLength) {\n break;\n }\n }\n\n return results.slice(0, maxResults);\n};\n\nconst methodHintLines = (url: string): string[] => [\n `> Next: read the full method article at ${url} using the suitable read tool to get the complete code examples and method description.`,\n '> If you need more detail about the request or response shape, read the full method schema using the suitable tool.',\n ...(isQueryOrSearchEndpoint(url) ? [QUERY_CAPABILITY_MARKER] : [])\n];\n\nconst getTruncatedResultHint = ({\n kbName,\n content,\n url\n}: {\n kbName: string;\n content: string;\n url?: string;\n}) => {\n if (!url) {\n return '';\n }\n\n if (isMethodResult({ kbName, content })) {\n return ['', '', ...methodHintLines(url)].join('\\n');\n }\n\n return [\n '',\n '',\n `> Next: read the full article at ${url} using the suitable read tool.`\n ].join('\\n');\n};\n\nconst SECTION_DELIMITER_RE = /^--- .+ ---$/;\n\ntype SectionType = 'first_example' | 'response_shape' | 'description' | 'other';\n\n// Budget contract (mirrors docs-search-server's format-utils): each section\n// gets up to the caller's requested lines-per-result, but never less than its\n// floor \u2014 a tiny budget can't cut the one thing a section exists for, and a\n// larger budget exposes more of every section.\nconst SECTION_LINE_FLOORS: Record<SectionType, number> = {\n first_example: 15,\n response_shape: 15,\n description: 15,\n other: 5\n};\n\nconst CODE_FENCE_RE = /^(`{3,}|~{3,})/;\n\nconst findOpenFence = (lines: string[]): string | null => {\n let openFence: string | null = null;\n for (const line of lines) {\n const match = line.match(CODE_FENCE_RE);\n if (match) {\n if (!openFence) {\n openFence = match[1];\n } else if (line.trim() === openFence) {\n openFence = null;\n }\n }\n }\n return openFence;\n};\n\n// A fence left open by truncation means the snippet inside is NOT the complete\n// example \u2014 closing it silently produces a runnable-looking fragment with\n// required inputs missing. Say so inside the fence, where anyone copying the\n// block will see it.\nexport const INCOMPLETE_SNIPPET_MARKER =\n '... snippet cut here \u2014 INCOMPLETE example, do not use as-is; read the full doc for the complete example ...';\n\nconst truncateLines = (\n lines: string[],\n limit: number\n): { lines: string[]; moreCount: number } => {\n const kept = lines.slice(0, limit);\n const moreCount = lines.length - kept.length;\n const openFence = findOpenFence(kept);\n if (!openFence) return { lines: kept, moreCount };\n // moreCount > 0 means the cut landed inside the fence; otherwise the source\n // itself left the fence open and it just needs closing.\n return {\n lines:\n moreCount > 0\n ? [...kept, INCOMPLETE_SNIPPET_MARKER, openFence]\n : [...kept, openFence],\n moreCount\n };\n};\n\nconst getSectionType = (\n header: string,\n isFirstExample: boolean\n): SectionType => {\n if (isFirstExample && /code example/i.test(header)) return 'first_example';\n if (/response shape/i.test(header)) return 'response_shape';\n if (/description/i.test(header)) return 'description';\n return 'other';\n};\n\nconst formatMethodContent = (\n content: string,\n sourceUrl: string | undefined,\n requestedLineLimit: number\n): string => {\n const lines = content.split('\\n');\n\n const firstDelimiterIdx = lines.findIndex((line) =>\n SECTION_DELIMITER_RE.test(line)\n );\n\n if (firstDelimiterIdx === -1) {\n const { lines: truncated, moreCount } = truncateLines(\n lines,\n requestedLineLimit\n );\n const hint = sourceUrl\n ? ['', ...methodHintLines(sourceUrl)].join('\\n')\n : '';\n const suffix = moreCount > 0 ? `\\n\\n... ${moreCount} more lines ...` : '';\n return truncated.join('\\n') + suffix + (suffix && hint ? hint : '');\n }\n\n const headerLines = lines.slice(0, firstDelimiterIdx);\n const remainingLines = lines.slice(firstDelimiterIdx);\n\n const hint = sourceUrl ? ['', ...methodHintLines(sourceUrl)].join('\\n') : '';\n\n const sections: string[] = [];\n let currentHeader = '';\n let currentLines: string[] = [];\n let isFirstExample = true;\n\n const flushSection = () => {\n if (!currentHeader) return;\n const type = getSectionType(currentHeader, isFirstExample);\n if (type === 'first_example') isFirstExample = false;\n const limit = Math.max(SECTION_LINE_FLOORS[type], requestedLineLimit);\n const { lines: truncated, moreCount } = truncateLines(currentLines, limit);\n let out = currentHeader + '\\n' + truncated.join('\\n');\n if (moreCount > 0) {\n out += `\\n\\n... ${moreCount} more lines ...`;\n }\n sections.push(out);\n };\n\n for (const line of remainingLines) {\n if (SECTION_DELIMITER_RE.test(line)) {\n flushSection();\n currentHeader = line;\n currentLines = [];\n } else {\n currentLines.push(line);\n }\n }\n flushSection();\n\n const body = [headerLines.join('\\n'), ...sections].join('\\n');\n return hint ? `${body}${hint}` : body;\n};\n\nexport const formatResultsContent = (\n resultsFromKbs: Record<\n string,\n { results: Omit<RankedSearchResult, 'kbName'>[] }\n >,\n maxResults: number,\n linesInEachResult: number | undefined = undefined\n): string => {\n const results: RankedSearchResult[] = Object.entries(resultsFromKbs).flatMap(\n ([kbName, { results: kbResults }]) =>\n kbResults.map((result) => ({ ...result, kbName }))\n );\n\n if (results.length === 0) {\n throw new Error('No result from search');\n }\n\n const sortedResults = [...results].sort(\n (a, b) => b.scoresInfo.overallMatchScore - a.scoresInfo.overallMatchScore\n );\n\n const topResults = interleaveMethodAndArticleResults(\n sortedResults,\n maxResults\n );\n\n return topResults\n .map((result) => {\n let newContent = result.entry.content;\n\n if (linesInEachResult) {\n const sourceUrl =\n result.entry.url ?? extractSourceUrlFromContent(result.entry.content);\n\n if (isMethodResult({ kbName: result.kbName, content: newContent })) {\n newContent = formatMethodContent(\n newContent,\n sourceUrl,\n linesInEachResult\n );\n } else {\n const { lines: truncated, moreCount } = truncateLines(\n newContent.split('\\n'),\n linesInEachResult\n );\n const moreLinesText =\n moreCount > 0\n ? [\n `\\n\\n... ${moreCount} more lines ...`,\n getTruncatedResultHint({\n kbName: result.kbName,\n content: result.entry.content,\n url: sourceUrl\n })\n ].join('')\n : '';\n newContent = `${truncated.join('\\n')}${moreLinesText}`;\n }\n }\n\n return {\n ...result,\n entry: { ...result.entry, content: newContent }\n };\n })\n .map((result) => {\n const content = result.entry.content;\n const chunkedContent = result.entry.chunkedContent;\n\n if (content.length > MAX_CONTENT_LENGTH) {\n if (chunkedContent?.length) {\n logger.log(`Content is too long, using chunked content`, {\n contentLength: content.length,\n chunkedContentLength: chunkedContent.length\n });\n return getContentFromChunkedContent(chunkedContent);\n }\n return content.slice(0, MAX_CONTENT_LENGTH);\n }\n return content;\n })\n .join('\\n\\n' + '='.repeat(40) + '\\n\\n');\n};\n", "import type { DocsTool } from './docs.js';\nimport { logger } from '../infra/logger.js';\nimport {\n formatResultsContent,\n type RankedSearchResult\n} from './searchFormatting.js';\n\nexport const DEFAULT_MAX_RESULTS = 15;\n\n// Extends the docs-search server's time budget for slow RAG searches. Never\n// sent from a browser page: www.wixapis.com's CORS preflight does not list\n// these headers in Access-Control-Allow-Headers, so sending them fails the\n// whole request there \u2014 pages fall back to the server's default budget.\n// (`window` exists only in browser pages; node and workerd keep the headers.)\nconst timeBudgetHeaders: Record<string, string> =\n typeof window === 'undefined'\n ? { 'x-time-budget': '180000', 'x-wix-time-budget': '180000' }\n : {};\n\nconst runSemanticSearch = async (\n toolName: DocsTool,\n toolParams: Record<string, string>,\n maxResults: number = 20,\n rerank: boolean = false\n) => {\n const startTime = new Date().getTime();\n\n const url = new URL(\n `https://www.wixapis.com/mcp-docs-search/v1/search?maxResults=${maxResults}&rerank=${rerank}`\n );\n\n const kbNames: string[] = [];\n\n if (toolName === 'SDK') {\n kbNames.push(\n 'API_REFERENCE_SDK_KB_ID',\n 'REST_DOCS_KB_ID',\n 'SDK_METHODS_KB_ID',\n 'SDK_DOCS_KB_ID'\n );\n // kbNames.push('MCP_WHITELIST_API_REFERENCE_SDK_METHODS_KB_ID'); // TODO: uncomment once the docs SDK bug is fixed.\n } else if (toolName === 'REST' || toolName === 'BUSINESS_SOLUTIONS') {\n if (toolName === 'REST') {\n kbNames.push('REST_METHODS_KB_ID');\n kbNames.push('MCP_WHITELIST_REST_METHODS_KB_ID');\n }\n kbNames.push('REST_DOCS_KB_ID');\n // MCP_REST_RECIPES_KB_ID disabled - all recipes from this KB have been migrated\n // to packages/docs/recipes-v2/ and are now served via Picasso documentation.\n // Searching this KB is no longer needed and would return duplicate/outdated content.\n // kbNames.push('MCP_REST_RECIPES_KB_ID');\n } else if (toolName === 'WDS') {\n kbNames.push('WDS_DOCS_KB_ID');\n } else if (toolName === 'BUILD_APPS') {\n kbNames.push('BUILD_APPS_KB_ID');\n } else if (toolName === 'OVERVIEW') {\n kbNames.push('OVERVIEW_KB_ID');\n } else if (toolName === 'WIX_HEADLESS') {\n kbNames.push('HEADLESS_KB_ID');\n } else if (toolName === 'VELO') {\n kbNames.push('VELO_DOCS_KB_ID', 'VELO_METHODS_KB_ID');\n } else if (toolName === 'CLI') {\n kbNames.push('CLI_KB_ID');\n }\n\n logger.log(\n `[SemanticSearch] Tool: ${toolName}, KBs: [${kbNames.join(', ')}], Query: \"${toolParams.searchTerm}\"`\n );\n\n for (const kbName of kbNames) {\n url.searchParams.append('kbName', kbName);\n }\n for (const [key, value] of Object.entries(toolParams)) {\n url.searchParams.append(key, value);\n }\n\n logger.log('Running RAG search', url.toString());\n\n const response = await fetch(url.toString(), {\n headers: {\n 'Content-Type': 'application/json',\n ...timeBudgetHeaders\n }\n });\n\n if (!response.ok) {\n logger.error(`Failed to run rag search: ${response.statusText}`);\n throw new Error(`Failed to run rag search: ${response.statusText}`);\n }\n\n const data = await response.json();\n const endTime = new Date().getTime();\n const timeTaskFormatted = (endTime - startTime) / 1000;\n\n logger.log(\n 'Ran RAG search successfully with params',\n JSON.stringify(toolParams),\n timeTaskFormatted,\n typeof data\n );\n\n return data?.results as Record<\n string,\n { results: Omit<RankedSearchResult, 'kbName'>[] }\n >;\n};\n\nconst runPlatformizedSemanticSearch = async (\n toolName: DocsTool,\n searchTerm: string,\n maxResults: number = 20,\n linesInEachResult?: number\n): Promise<string> => {\n const startTime = Date.now();\n logger.log(`[SemanticSearch/v2] Tool: ${toolName}, Query: \"${searchTerm}\"`);\n\n const response = await fetch(\n 'https://www.wixapis.com/mcp-docs-search/v1/docs/search/markdown',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...timeBudgetHeaders\n },\n body: JSON.stringify({\n search_term: searchTerm,\n document_type: toolName,\n maximum_results: maxResults,\n lines_in_each_result: linesInEachResult\n })\n }\n );\n\n if (!response.ok) {\n logger.error(\n `Failed to run platformized rag search: ${response.statusText}`\n );\n throw new Error(`Failed to run rag search: ${response.statusText}`);\n }\n\n const data = await response.json();\n logger.log(\n 'Ran platformized RAG search successfully',\n (Date.now() - startTime) / 1000\n );\n\n const content = data?.content as string | undefined;\n if (!content) {\n throw new Error('No result from search');\n }\n return content;\n};\n\nexport const runSemanticSearchAndFormat = async ({\n toolName,\n toolParams,\n maxResults = DEFAULT_MAX_RESULTS,\n rerank,\n linesInEachResult,\n usePlatformizedSearch = true\n}: {\n toolName: DocsTool;\n toolParams: Record<string, string>;\n maxResults?: number;\n rerank?: boolean;\n linesInEachResult?: number | undefined;\n usePlatformizedSearch?: boolean;\n}) => {\n if (usePlatformizedSearch) {\n return runPlatformizedSemanticSearch(\n toolName,\n toolParams.searchTerm,\n maxResults,\n linesInEachResult\n );\n } else {\n const results = await runSemanticSearch(\n toolName,\n toolParams,\n maxResults,\n rerank\n );\n return formatResultsContent(results, maxResults, linesInEachResult);\n }\n};\n", "declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n", "// This is a magic string replaced by rollup\ndeclare const __SENTRY_SDK_VERSION__: string;\n\nexport const SDK_VERSION = typeof __SENTRY_SDK_VERSION__ === 'string' ? __SENTRY_SDK_VERSION__ : '0.0.0-unknown.0';\n", "/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n *\n * Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing\n * string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).\n *\n * Why worldwide?\n *\n * Why not?\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Carrier } from '../carrier';\nimport type { Client } from '../client';\nimport type { SerializedLog } from '../types-hoist/log';\nimport type { SdkSource } from './env';\n\n/** Internal global with common properties and Sentry extensions */\nexport type InternalGlobal = {\n navigator?: { userAgent?: string; maxTouchPoints?: number };\n console: Console;\n PerformanceObserver?: any;\n Sentry?: any;\n onerror?: {\n (event: object | string, source?: string, lineno?: number, colno?: number, error?: Error): any;\n __SENTRY_INSTRUMENTED__?: true;\n };\n onunhandledrejection?: {\n (event: unknown): boolean;\n __SENTRY_INSTRUMENTED__?: true;\n };\n SENTRY_ENVIRONMENT?: string;\n SENTRY_DSN?: string;\n SENTRY_RELEASE?: {\n id?: string;\n };\n SENTRY_SDK_SOURCE?: SdkSource;\n /**\n * A map of Sentry clients to their log buffers.\n *\n * This is used to store logs that are sent to Sentry.\n */\n _sentryClientToLogBufferMap?: WeakMap<Client, Array<SerializedLog>>;\n /**\n * Debug IDs are indirectly injected by Sentry CLI or bundler plugins to directly reference a particular source map\n * for resolving of a source file. The injected code will place an entry into the record for each loaded bundle/JS\n * file.\n */\n _sentryDebugIds?: Record<string, string>;\n /**\n * Raw module metadata that is injected by bundler plugins.\n *\n * Keys are `error.stack` strings, values are the metadata.\n */\n _sentryModuleMetadata?: Record<string, any>;\n _sentryEsmLoaderHookRegistered?: boolean;\n} & Carrier;\n\n/** Get's the global object for the current JavaScript runtime */\nexport const GLOBAL_OBJ = globalThis as unknown as InternalGlobal;\n", "import type { AsyncContextStack } from './asyncContext/stackStrategy';\nimport type { AsyncContextStrategy } from './asyncContext/types';\nimport type { Scope } from './scope';\nimport type { Logger } from './utils-hoist/logger';\nimport { SDK_VERSION } from './utils-hoist/version';\nimport { GLOBAL_OBJ } from './utils-hoist/worldwide';\n\n/**\n * An object that contains globally accessible properties and maintains a scope stack.\n * @hidden\n */\nexport interface Carrier {\n __SENTRY__?: VersionedCarrier;\n}\n\ntype VersionedCarrier = {\n version?: string;\n} & Record<Exclude<string, 'version'>, SentryCarrier>;\n\nexport interface SentryCarrier {\n acs?: AsyncContextStrategy;\n stack?: AsyncContextStack;\n\n globalScope?: Scope;\n defaultIsolationScope?: Scope;\n defaultCurrentScope?: Scope;\n logger?: Logger;\n\n /** Overwrites TextEncoder used in `@sentry/core`, need for `react-native@0.73` and older */\n encodePolyfill?: (input: string) => Uint8Array;\n /** Overwrites TextDecoder used in `@sentry/core`, need for `react-native@0.73` and older */\n decodePolyfill?: (input: Uint8Array) => string;\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nexport function getMainCarrier(): Carrier {\n // This ensures a Sentry carrier exists\n getSentryCarrier(GLOBAL_OBJ);\n return GLOBAL_OBJ;\n}\n\n/** Will either get the existing sentry carrier, or create a new one. */\nexport function getSentryCarrier(carrier: Carrier): SentryCarrier {\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n\n // For now: First SDK that sets the .version property wins\n __SENTRY__.version = __SENTRY__.version || SDK_VERSION;\n\n // Intentionally populating and returning the version of \"this\" SDK instance\n // rather than what's set in .version so that \"this\" SDK always gets its carrier\n return (__SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {});\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__[]` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nexport function getGlobalSingleton<Prop extends keyof SentryCarrier>(\n name: Prop,\n creator: () => NonNullable<SentryCarrier[Prop]>,\n obj = GLOBAL_OBJ,\n): NonNullable<SentryCarrier[Prop]> {\n const __SENTRY__ = (obj.__SENTRY__ = obj.__SENTRY__ || {});\n const carrier = (__SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {});\n // Note: We do not want to set `carrier.version` here, as this may be called before any `init` is called, e.g. for the default scopes\n return carrier[name] || (carrier[name] = creator());\n}\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Primitive } from '../types-hoist/misc';\nimport type { ParameterizedString } from '../types-hoist/parameterize';\nimport type { PolymorphicEvent } from '../types-hoist/polymorphics';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: unknown): wat is Error {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n case '[object WebAssembly.Exception]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat: unknown, className: string): boolean {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: unknown): boolean {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: unknown): boolean {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: unknown): boolean {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: unknown): wat is string {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isParameterizedString(wat: unknown): wat is ParameterizedString {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: unknown): wat is Primitive {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: unknown): wat is Record<string, unknown> {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: unknown): wat is PolymorphicEvent {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: unknown): boolean {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: unknown): wat is RegExp {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): wat is PromiseLike<any> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat?.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: unknown): boolean {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\ninterface VueViewModel {\n // Vue3\n __isVue?: boolean;\n // Vue2\n _isVue?: boolean;\n}\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isVueViewModel(wat: unknown): boolean {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat as VueViewModel).__isVue || (wat as VueViewModel)._isVue));\n}\n\n/**\n * Checks whether the given parameter is a Standard Web API Request instance.\n *\n * Returns false if Request is not available in the current runtime.\n */\nexport function isRequest(request: unknown): request is Request {\n return typeof Request !== 'undefined' && isInstanceOf(request, Request);\n}\n", "import { getGlobalSingleton } from '../carrier';\nimport type { ConsoleLevel } from '../types-hoist/instrument';\nimport { DEBUG_BUILD } from './../debug-build';\nimport { GLOBAL_OBJ } from './worldwide';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nexport const CONSOLE_LEVELS: readonly ConsoleLevel[] = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] as const;\n\ntype LoggerMethod = (...args: unknown[]) => void;\ntype LoggerConsoleMethods = Record<ConsoleLevel, LoggerMethod>;\n\n/** This may be mutated by the console instrumentation. */\nexport const originalConsoleMethods: {\n [key in ConsoleLevel]?: (...args: unknown[]) => void;\n} = {};\n\n/** A Sentry Logger instance. */\nexport interface Logger extends LoggerConsoleMethods {\n disable(): void;\n enable(): void;\n isEnabled(): boolean;\n}\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nexport function consoleSandbox<T>(callback: () => T): T {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console as Console;\n const wrappedFuncs: Partial<LoggerConsoleMethods> = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) as ConsoleLevel[];\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] as LoggerMethod;\n wrappedFuncs[level] = console[level] as LoggerMethod | undefined;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] as LoggerMethod;\n });\n }\n}\n\nfunction makeLogger(): Logger {\n let enabled = false;\n const logger: Partial<Logger> = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = (...args: Parameters<(typeof GLOBAL_OBJ.console)[typeof name]>) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger as Logger;\n}\n\n/**\n * This is a logger singleton which either logs things or no-ops if logging is not enabled.\n * The logger is a singleton on the carrier, to ensure that a consistent logger is used throughout the SDK.\n */\nexport const logger = getGlobalSingleton('logger', makeLogger);\n", "import { isRegExp, isString, isVueViewModel } from './is';\n\nexport { escapeStringForRegex } from './vendor/escapeStringForRegex';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\nexport function safeJoin(input: unknown[], delimiter?: string): string {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push('[VueViewModel]');\n } else {\n output.push(String(value));\n }\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nexport function isMatchingPattern(\n value: string,\n pattern: RegExp | string,\n requireExactStringMatch: boolean = false,\n): boolean {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n if (isString(pattern)) {\n return requireExactStringMatch ? value === pattern : value.includes(pattern);\n }\n\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nexport function stringMatchesSomePattern(\n testString: string,\n patterns: Array<string | RegExp> = [],\n requireExactStringMatch: boolean = false,\n): boolean {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { WrappedFunction } from '../types-hoist/wrappedfunction';\nimport { DEBUG_BUILD } from './../debug-build';\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPrimitive } from './is';\nimport { logger } from './logger';\nimport { truncate } from './string';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * If the method on the passed object is not a function, the wrapper will not be applied.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other\n * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacementFactory: (...args: any[]) => any): void {\n if (!(name in source)) {\n return;\n }\n\n // explicitly casting to unknown because we don't know the type of the method initially at all\n const original = source[name] as unknown;\n\n if (typeof original !== 'function') {\n return;\n }\n\n const wrapped = replacementFactory(original) as WrappedFunction;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n try {\n source[name] = wrapped;\n } catch {\n DEBUG_BUILD && logger.log(`Failed to replace method \"${name}\" in object`, source);\n }\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nexport function addNonEnumerableProperty(obj: object, name: string, value: unknown): void {\n try {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n } catch (o_O) {\n DEBUG_BUILD && logger.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nexport function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void {\n try {\n const proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n } catch (o_O) {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function getOriginalFunction<T extends Function>(func: WrappedFunction<T>): T | undefined {\n return func.__sentry_original__;\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argument itself, when value is neither an Event nor\n * an Error.\n */\nexport function convertToPlainObject<V>(value: V):\n | {\n [ownProps: string]: unknown;\n type: string;\n target: string;\n currentTarget: string;\n detail?: unknown;\n }\n | {\n [ownProps: string]: unknown;\n message: string;\n name: string;\n stack?: string;\n }\n | V {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj: {\n [ownProps: string]: unknown;\n type: string;\n target: string;\n currentTarget: string;\n detail?: unknown;\n } = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target: unknown): string {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '<unknown>';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj: unknown): { [key: string]: unknown } {\n if (typeof obj === 'object' && obj !== null) {\n const extractedProps: { [key: string]: unknown } = {};\n for (const property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = (obj as Record<string, unknown>)[property];\n }\n }\n return extractedProps;\n } else {\n return {};\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: Record<string, unknown>, maxLength: number = 40): string {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n const firstKey = keys[0];\n\n if (!firstKey) {\n return '[object has no keys]';\n }\n\n if (firstKey.length >= maxLength) {\n return truncate(firstKey, maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n *\n * @deprecated This function is no longer used by the SDK and will be removed in a future major version.\n */\nexport function dropUndefinedKeys<T>(inputValue: T): T {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map<unknown, unknown>();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys<T>(inputValue: T, memoizationMap: Map<unknown, unknown>): T {\n // Early return for primitive values\n if (inputValue === null || typeof inputValue !== 'object') {\n return inputValue;\n }\n\n // Check memo map first for all object types\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal as T;\n }\n\n // handle arrays\n if (Array.isArray(inputValue)) {\n const returnValue: unknown[] = [];\n // Store mapping to handle circular references\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach(value => {\n returnValue.push(_dropUndefinedKeys(value, memoizationMap));\n });\n\n return returnValue as unknown as T;\n }\n\n if (isPojo(inputValue)) {\n const returnValue: { [key: string]: unknown } = {};\n // Store mapping to handle circular references\n memoizationMap.set(inputValue, returnValue);\n\n const keys = Object.keys(inputValue);\n\n keys.forEach(key => {\n const val = inputValue[key];\n if (val !== undefined) {\n returnValue[key] = _dropUndefinedKeys(val, memoizationMap);\n }\n });\n\n return returnValue as T;\n }\n\n // For other object types, return as is\n return inputValue;\n}\n\nfunction isPojo(input: unknown): input is Record<string, unknown> {\n // Plain objects have Object as constructor or no constructor\n const constructor = (input as object).constructor;\n return constructor === Object || constructor === undefined;\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nexport function objectify(wat: unknown): typeof Object {\n let objectified;\n switch (true) {\n // this will catch both undefined and null\n case wat == undefined:\n objectified = new String(wat);\n break;\n\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n case typeof wat === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat as any).constructor(wat);\n break;\n\n // by process of elimination, at this point we know that `wat` must already be an object\n default:\n objectified = wat;\n break;\n }\n return objectified;\n}\n", "import type { Event } from '../types-hoist/event';\nimport type { Exception } from '../types-hoist/exception';\nimport type { Mechanism } from '../types-hoist/mechanism';\nimport type { StackFrame } from '../types-hoist/stackframe';\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\nimport { GLOBAL_OBJ } from './worldwide';\n\ninterface CryptoInternal {\n getRandomValues(array: Uint8Array): Uint8Array;\n randomUUID?(): string;\n}\n\n/** An interface for common properties on global */\ninterface CryptoGlobal {\n msCrypto?: CryptoInternal;\n crypto?: CryptoInternal;\n}\n\nfunction getCrypto(): CryptoInternal | undefined {\n const gbl = GLOBAL_OBJ as typeof GLOBAL_OBJ & CryptoGlobal;\n return gbl.crypto || gbl.msCrypto;\n}\n\n/**\n * UUID4 generator\n * @param crypto Object that provides the crypto API.\n * @returns string Generated UUID4.\n */\nexport function uuid4(crypto = getCrypto()): string {\n let getRandomByte = (): number => Math.random() * 16;\n try {\n if (crypto?.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto?.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return typedArray[0]!;\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] as unknown as string) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c as unknown as number) ^ ((getRandomByte() & 15) >> ((c as unknown as number) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event: Event): Exception | undefined {\n return event.exception?.values?.[0];\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '<unknown>';\n }\n return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nexport function addExceptionMechanism(event: Event, newMechanism?: Partial<Mechanism>): void {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...currentMechanism?.data, ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n major?: number;\n minor?: number;\n patch?: number;\n prerelease?: string;\n buildmetadata?: string;\n}\n\nfunction _parseInt(input: string | undefined): number {\n return parseInt(input || '', 10);\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = _parseInt(match[1]);\n const minor = _parseInt(match[2]);\n const patch = _parseInt(match[3]);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line: string) => snipLine(line, 0));\n\n // We guard here to ensure this is not larger than the existing number of lines\n const lineIndex = Math.min(maxLines - 1, sourceLine);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n frame.context_line = snipLine(lines[lineIndex]!, frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nexport function checkOrSetAlreadyCaught(exception: unknown): boolean {\n if (isAlreadyCaptured(exception)) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception as { [key: string]: unknown }, '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\nfunction isAlreadyCaptured(exception: unknown): boolean | void {\n try {\n return (exception as { __sentry_captured__?: boolean }).__sentry_captured__;\n } catch {} // eslint-disable-line no-empty\n}\n", "import { GLOBAL_OBJ } from './worldwide';\n\nconst ONE_SECOND_IN_MS = 1000;\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\ninterface Performance {\n /**\n * The millisecond timestamp at which measurement began, measured in Unix time.\n */\n timeOrigin: number;\n /**\n * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n */\n now(): number;\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\nexport function dateTimestampInSeconds(): number {\n return Date.now() / ONE_SECOND_IN_MS;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction createUnixTimestampInSecondsFunc(): () => number {\n const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & { performance?: Performance };\n if (!performance?.now) {\n return dateTimestampInSeconds;\n }\n\n // Some browser and environments don't have a timeOrigin, so we fallback to\n // using Date.now() to compute the starting time.\n const approxStartingTimeOrigin = Date.now() - performance.now();\n const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin;\n\n // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current\n // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.\n //\n // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the\n // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and\n // correct for this.\n // See: https://github.com/getsentry/sentry-javascript/issues/2590\n // See: https://github.com/mdn/content/issues/4713\n // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6\n return () => {\n return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;\n };\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds = createUnixTimestampInSecondsFunc();\n\n/**\n * Cached result of getBrowserTimeOrigin.\n */\nlet cachedTimeOrigin: [number | undefined, string] | undefined;\n\n/**\n * Gets the time origin and the mode used to determine it.\n */\nfunction getBrowserTimeOrigin(): [number | undefined, string] {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n if (!performance?.now) {\n return [undefined, 'none'];\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing?.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n return [performance.timeOrigin, 'timeOrigin'];\n } else {\n return [navigationStart, 'navigationStart'];\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n return [dateNow, 'dateNow'];\n}\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport function browserPerformanceTimeOrigin(): number | undefined {\n if (!cachedTimeOrigin) {\n cachedTimeOrigin = getBrowserTimeOrigin();\n }\n\n return cachedTimeOrigin[0];\n}\n", "import type { SerializedSession, Session, SessionContext, SessionStatus } from './types-hoist/session';\nimport { uuid4 } from './utils-hoist/misc';\nimport { timestampInSeconds } from './utils-hoist/time';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nexport function makeSession(context?: Omit<SessionContext, 'started' | 'status'>): Session {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session: Session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see Client.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nexport function updateSession(session: Session, context: SessionContext = {}): void {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nexport function closeSession(session: Session, status?: Exclude<SessionStatus, 'ok'>): void {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session: Session): SerializedSession {\n return {\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n };\n}\n", "/**\n * Shallow merge two objects.\n * Does not mutate the passed in objects.\n * Undefined/empty values in the merge object will overwrite existing values.\n *\n * By default, this merges 2 levels deep.\n */\nexport function merge<T>(initialObj: T, mergeObj: T, levels = 2): T {\n // If the merge value is not an object, or we have no merge levels left,\n // we just set the value to the merge value\n if (!mergeObj || typeof mergeObj !== 'object' || levels <= 0) {\n return mergeObj;\n }\n\n // If the merge object is an empty object, and the initial object is not undefined, we return the initial object\n if (initialObj && Object.keys(mergeObj).length === 0) {\n return initialObj;\n }\n\n // Clone object\n const output = { ...initialObj };\n\n // Merge values into output, resursively\n for (const key in mergeObj) {\n if (Object.prototype.hasOwnProperty.call(mergeObj, key)) {\n output[key] = merge(output[key], mergeObj[key], levels - 1);\n }\n }\n\n return output;\n}\n", "import type { Scope } from '../scope';\nimport type { Span } from '../types-hoist/span';\nimport { addNonEnumerableProperty } from '../utils-hoist/object';\n\nconst SCOPE_SPAN_FIELD = '_sentrySpan';\n\ntype ScopeWithMaybeSpan = Scope & {\n [SCOPE_SPAN_FIELD]?: Span;\n};\n\n/**\n * Set the active span for a given scope.\n * NOTE: This should NOT be used directly, but is only used internally by the trace methods.\n */\nexport function _setSpanForScope(scope: Scope, span: Span | undefined): void {\n if (span) {\n addNonEnumerableProperty(scope as ScopeWithMaybeSpan, SCOPE_SPAN_FIELD, span);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete (scope as ScopeWithMaybeSpan)[SCOPE_SPAN_FIELD];\n }\n}\n\n/**\n * Get the active span for a given scope.\n * NOTE: This should NOT be used directly, but is only used internally by the trace methods.\n */\nexport function _getSpanForScope(scope: ScopeWithMaybeSpan): Span | undefined {\n return scope[SCOPE_SPAN_FIELD];\n}\n", "import { uuid4 } from './misc';\n\n/**\n * Generate a random, valid trace ID.\n */\nexport function generateTraceId(): string {\n return uuid4();\n}\n\n/**\n * Generate a random, valid span ID.\n */\nexport function generateSpanId(): string {\n return uuid4().substring(16);\n}\n", "/* eslint-disable max-lines */\nimport type { Client } from './client';\nimport { updateSession } from './session';\nimport type { Attachment } from './types-hoist/attachment';\nimport type { Breadcrumb } from './types-hoist/breadcrumb';\nimport type { Context, Contexts } from './types-hoist/context';\nimport type { DynamicSamplingContext } from './types-hoist/envelope';\nimport type { Event, EventHint } from './types-hoist/event';\nimport type { EventProcessor } from './types-hoist/eventprocessor';\nimport type { Extra, Extras } from './types-hoist/extra';\nimport type { Primitive } from './types-hoist/misc';\nimport type { RequestEventData } from './types-hoist/request';\nimport type { Session } from './types-hoist/session';\nimport type { SeverityLevel } from './types-hoist/severity';\nimport type { Span } from './types-hoist/span';\nimport type { PropagationContext } from './types-hoist/tracing';\nimport type { User } from './types-hoist/user';\nimport { merge } from './utils/merge';\nimport { _getSpanForScope, _setSpanForScope } from './utils/spanOnScope';\nimport { isPlainObject } from './utils-hoist/is';\nimport { logger } from './utils-hoist/logger';\nimport { uuid4 } from './utils-hoist/misc';\nimport { generateTraceId } from './utils-hoist/propagationContext';\nimport { truncate } from './utils-hoist/string';\nimport { dateTimestampInSeconds } from './utils-hoist/time';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * A context to be used for capturing an event.\n * This can either be a Scope, or a partial ScopeContext,\n * or a callback that receives the current scope and returns a new scope to use.\n */\nexport type CaptureContext = Scope | Partial<ScopeContext> | ((scope: Scope) => Scope);\n\n/**\n * Data that can be converted to a Scope.\n */\nexport interface ScopeContext {\n user: User;\n level: SeverityLevel;\n extra: Extras;\n contexts: Contexts;\n tags: { [key: string]: Primitive };\n fingerprint: string[];\n propagationContext: PropagationContext;\n}\n\nexport interface SdkProcessingMetadata {\n [key: string]: unknown;\n requestSession?: {\n status: 'ok' | 'errored' | 'crashed';\n };\n normalizedRequest?: RequestEventData;\n dynamicSamplingContext?: Partial<DynamicSamplingContext>;\n capturedSpanScope?: Scope;\n capturedSpanIsolationScope?: Scope;\n spanCountBeforeProcessing?: number;\n ipAddress?: string;\n}\n\n/**\n * Normalized data of the Scope, ready to be used.\n */\nexport interface ScopeData {\n eventProcessors: EventProcessor[];\n breadcrumbs: Breadcrumb[];\n user: User;\n tags: { [key: string]: Primitive };\n extra: Extras;\n contexts: Contexts;\n attachments: Attachment[];\n propagationContext: PropagationContext;\n sdkProcessingMetadata: SdkProcessingMetadata;\n fingerprint: string[];\n level?: SeverityLevel;\n transactionName?: string;\n span?: Span;\n}\n\n/**\n * Holds additional event information.\n */\nexport class Scope {\n /** Flag if notifying is happening. */\n protected _notifyingListeners: boolean;\n\n /** Callback for client to receive scope changes. */\n protected _scopeListeners: Array<(scope: Scope) => void>;\n\n /** Callback list that will be called during event processing. */\n protected _eventProcessors: EventProcessor[];\n\n /** Array of breadcrumbs. */\n protected _breadcrumbs: Breadcrumb[];\n\n /** User */\n protected _user: User;\n\n /** Tags */\n protected _tags: { [key: string]: Primitive };\n\n /** Extra */\n protected _extra: Extras;\n\n /** Contexts */\n protected _contexts: Contexts;\n\n /** Attachments */\n protected _attachments: Attachment[];\n\n /** Propagation Context for distributed tracing */\n protected _propagationContext: PropagationContext;\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n protected _sdkProcessingMetadata: SdkProcessingMetadata;\n\n /** Fingerprint */\n protected _fingerprint?: string[];\n\n /** Severity */\n protected _level?: SeverityLevel;\n\n /**\n * Transaction Name\n *\n * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects.\n * It's purpose is to assign a transaction to the scope that's added to non-transaction events.\n */\n protected _transactionName?: string;\n\n /** Session */\n protected _session?: Session;\n\n /** The client on this scope */\n protected _client?: Client;\n\n /** Contains the last event id of a captured event. */\n protected _lastEventId?: string;\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n public constructor() {\n this._notifyingListeners = false;\n this._scopeListeners = [];\n this._eventProcessors = [];\n this._breadcrumbs = [];\n this._attachments = [];\n this._user = {};\n this._tags = {};\n this._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = {\n traceId: generateTraceId(),\n sampleRand: Math.random(),\n };\n }\n\n /**\n * Clone all data from this scope into a new scope.\n */\n public clone(): Scope {\n const newScope = new Scope();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\n if (this._contexts.flags) {\n // We need to copy the `values` array so insertions on a cloned scope\n // won't affect the original array.\n newScope._contexts.flags = {\n values: [...this._contexts.flags.values],\n };\n }\n\n newScope._user = this._user;\n newScope._level = this._level;\n newScope._session = this._session;\n newScope._transactionName = this._transactionName;\n newScope._fingerprint = this._fingerprint;\n newScope._eventProcessors = [...this._eventProcessors];\n newScope._attachments = [...this._attachments];\n newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n newScope._propagationContext = { ...this._propagationContext };\n newScope._client = this._client;\n newScope._lastEventId = this._lastEventId;\n\n _setSpanForScope(newScope, _getSpanForScope(this));\n\n return newScope;\n }\n\n /**\n * Update the client assigned to this scope.\n * Note that not every scope will have a client assigned - isolation scopes & the global scope will generally not have a client,\n * as well as manually created scopes.\n */\n public setClient(client: Client | undefined): void {\n this._client = client;\n }\n\n /**\n * Set the ID of the last captured error event.\n * This is generally only captured on the isolation scope.\n */\n public setLastEventId(lastEventId: string | undefined): void {\n this._lastEventId = lastEventId;\n }\n\n /**\n * Get the client assigned to this scope.\n */\n public getClient<C extends Client>(): C | undefined {\n return this._client as C | undefined;\n }\n\n /**\n * Get the ID of the last captured error event.\n * This is generally only available on the isolation scope.\n */\n public lastEventId(): string | undefined {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n */\n public addScopeListener(callback: (scope: Scope) => void): void {\n this._scopeListeners.push(callback);\n }\n\n /**\n * Add an event processor that will be called before an event is sent.\n */\n public addEventProcessor(callback: EventProcessor): this {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * Set the user for this scope.\n * Set to `null` to unset the user.\n */\n public setUser(user: User | null): this {\n // If null is passed we want to unset everything, but still define keys,\n // so that later down in the pipeline any existing values are cleared.\n this._user = user || {\n email: undefined,\n id: undefined,\n ip_address: undefined,\n username: undefined,\n };\n\n if (this._session) {\n updateSession(this._session, { user });\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Get the user from this scope.\n */\n public getUser(): User | undefined {\n return this._user;\n }\n\n /**\n * Set an object that will be merged into existing tags on the scope,\n * and will be sent as tags data with the event.\n */\n public setTags(tags: { [key: string]: Primitive }): this {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Set a single tag that will be sent as tags data with the event.\n */\n public setTag(key: string, value: Primitive): this {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Set an object that will be merged into existing extra on the scope,\n * and will be sent as extra data with the event.\n */\n public setExtras(extras: Extras): this {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Set a single key:value extra entry that will be sent as extra data with the event.\n */\n public setExtra(key: string, extra: Extra): this {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the fingerprint on the scope to send with the events.\n * @param {string[]} fingerprint Fingerprint to group events in Sentry.\n */\n public setFingerprint(fingerprint: string[]): this {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the level on the scope for future events.\n */\n public setLevel(level: SeverityLevel): this {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the transaction name on the scope so that the name of e.g. taken server route or\n * the page location is attached to future events.\n *\n * IMPORTANT: Calling this function does NOT change the name of the currently active\n * root span. If you want to change the name of the active root span, use\n * `Sentry.updateSpanName(rootSpan, 'new name')` instead.\n *\n * By default, the SDK updates the scope's transaction name automatically on sensible\n * occasions, such as a page navigation or when handling a new request on the server.\n */\n public setTransactionName(name?: string): this {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets context data with the given name.\n * Data passed as context will be normalized. You can also pass `null` to unset the context.\n * Note that context data will not be merged - calling `setContext` will overwrite an existing context with the same key.\n */\n public setContext(key: string, context: Context | null): this {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Set the session for the scope.\n */\n public setSession(session?: Session): this {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Get the session from the scope.\n */\n public getSession(): Session | undefined {\n return this._session;\n }\n\n /**\n * Updates the scope with provided data. Can work in three variations:\n * - plain object containing updatable attributes\n * - Scope instance that'll extract the attributes from\n * - callback function that'll receive the current scope as an argument and allow for modifications\n */\n public update(captureContext?: CaptureContext): this {\n if (!captureContext) {\n return this;\n }\n\n const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;\n\n const scopeInstance =\n scopeToMerge instanceof Scope\n ? scopeToMerge.getScopeData()\n : isPlainObject(scopeToMerge)\n ? (captureContext as ScopeContext)\n : undefined;\n\n const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {};\n\n this._tags = { ...this._tags, ...tags };\n this._extra = { ...this._extra, ...extra };\n this._contexts = { ...this._contexts, ...contexts };\n\n if (user && Object.keys(user).length) {\n this._user = user;\n }\n\n if (level) {\n this._level = level;\n }\n\n if (fingerprint.length) {\n this._fingerprint = fingerprint;\n }\n\n if (propagationContext) {\n this._propagationContext = propagationContext;\n }\n\n return this;\n }\n\n /**\n * Clears the current scope and resets its properties.\n * Note: The client will not be cleared.\n */\n public clear(): this {\n // client is not cleared here on purpose!\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._session = undefined;\n _setSpanForScope(this, undefined);\n this._attachments = [];\n this.setPropagationContext({ traceId: generateTraceId(), sampleRand: Math.random() });\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Adds a breadcrumb to the scope.\n * By default, the last 100 breadcrumbs are kept.\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb: Breadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n // Breadcrumb messages can theoretically be infinitely large and they're held in memory so we truncate them not to leak (too much) memory\n message: breadcrumb.message ? truncate(breadcrumb.message, 2048) : breadcrumb.message,\n };\n\n this._breadcrumbs.push(mergedBreadcrumb);\n if (this._breadcrumbs.length > maxCrumbs) {\n this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs);\n this._client?.recordDroppedEvent('buffer_overflow', 'log_item');\n }\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * Get the last breadcrumb of the scope.\n */\n public getLastBreadcrumb(): Breadcrumb | undefined {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * Clear all breadcrumbs from the scope.\n */\n public clearBreadcrumbs(): this {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Add an attachment to the scope.\n */\n public addAttachment(attachment: Attachment): this {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * Clear all attachments from the scope.\n */\n public clearAttachments(): this {\n this._attachments = [];\n return this;\n }\n\n /**\n * Get the data of this scope, which should be applied to an event during processing.\n */\n public getScopeData(): ScopeData {\n return {\n breadcrumbs: this._breadcrumbs,\n attachments: this._attachments,\n contexts: this._contexts,\n tags: this._tags,\n extra: this._extra,\n user: this._user,\n level: this._level,\n fingerprint: this._fingerprint || [],\n eventProcessors: this._eventProcessors,\n propagationContext: this._propagationContext,\n sdkProcessingMetadata: this._sdkProcessingMetadata,\n transactionName: this._transactionName,\n span: _getSpanForScope(this),\n };\n }\n\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry.\n */\n public setSDKProcessingMetadata(newData: SdkProcessingMetadata): this {\n this._sdkProcessingMetadata = merge(this._sdkProcessingMetadata, newData, 2);\n return this;\n }\n\n /**\n * Add propagation context to the scope, used for distributed tracing\n */\n public setPropagationContext(context: PropagationContext): this {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * Get propagation context from the scope, used for distributed tracing\n */\n public getPropagationContext(): PropagationContext {\n return this._propagationContext;\n }\n\n /**\n * Capture an exception for this scope.\n *\n * @returns {string} The id of the captured Sentry event.\n */\n public captureException(exception: unknown, hint?: EventHint): string {\n const eventId = hint?.event_id || uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Capture a message for this scope.\n *\n * @returns {string} The id of the captured message.\n */\n public captureMessage(message: string, level?: SeverityLevel, hint?: EventHint): string {\n const eventId = hint?.event_id || uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\n this._client.captureMessage(\n message,\n level,\n {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Capture a Sentry event for this scope.\n *\n * @returns {string} The id of the captured event.\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = hint?.event_id || uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n protected _notifyScopeListeners(): void {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n", "import { getGlobalSingleton } from './carrier';\nimport { Scope } from './scope';\n\n/** Get the default current scope. */\nexport function getDefaultCurrentScope(): Scope {\n return getGlobalSingleton('defaultCurrentScope', () => new Scope());\n}\n\n/** Get the default isolation scope. */\nexport function getDefaultIsolationScope(): Scope {\n return getGlobalSingleton('defaultIsolationScope', () => new Scope());\n}\n", "import type { Client } from '../client';\nimport { getDefaultCurrentScope, getDefaultIsolationScope } from '../defaultScopes';\nimport { Scope } from '../scope';\nimport { isThenable } from '../utils-hoist/is';\nimport { getMainCarrier, getSentryCarrier } from './../carrier';\nimport type { AsyncContextStrategy } from './types';\n\ninterface Layer {\n client?: Client;\n scope: Scope;\n}\n\n/**\n * This is an object that holds a stack of scopes.\n */\nexport class AsyncContextStack {\n private readonly _stack: [Layer, ...Layer[]];\n private _isolationScope: Scope;\n\n public constructor(scope?: Scope, isolationScope?: Scope) {\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n // scope stack for domains or the process\n this._stack = [{ scope: assignedScope }];\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Fork a scope for the stack.\n */\n public withScope<T>(callback: (scope: Scope) => T): T {\n const scope = this._pushScope();\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n this._popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n this._popScope();\n return res;\n },\n e => {\n this._popScope();\n throw e;\n },\n );\n }\n\n this._popScope();\n return maybePromiseResult;\n }\n\n /**\n * Get the client of the stack.\n */\n public getClient<C extends Client>(): C | undefined {\n return this.getStackTop().client as C;\n }\n\n /**\n * Returns the scope of the top stack.\n */\n public getScope(): Scope {\n return this.getStackTop().scope;\n }\n\n /**\n * Get the isolation scope for the stack.\n */\n public getIsolationScope(): Scope {\n return this._isolationScope;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n */\n public getStackTop(): Layer {\n return this._stack[this._stack.length - 1] as Layer;\n }\n\n /**\n * Push a scope to the stack.\n */\n private _pushScope(): Scope {\n // We want to clone the content of prev scope\n const scope = this.getScope().clone();\n this._stack.push({\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * Pop a scope from the stack.\n */\n private _popScope(): boolean {\n if (this._stack.length <= 1) return false;\n return !!this._stack.pop();\n }\n}\n\n/**\n * Get the global async context stack.\n * This will be removed during the v8 cycle and is only here to make migration easier.\n */\nfunction getAsyncContextStack(): AsyncContextStack {\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n\n return (sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope()));\n}\n\nfunction withScope<T>(callback: (scope: Scope) => T): T {\n return getAsyncContextStack().withScope(callback);\n}\n\nfunction withSetScope<T>(scope: Scope, callback: (scope: Scope) => T): T {\n const stack = getAsyncContextStack() as AsyncContextStack;\n return stack.withScope(() => {\n stack.getStackTop().scope = scope;\n return callback(scope);\n });\n}\n\nfunction withIsolationScope<T>(callback: (isolationScope: Scope) => T): T {\n return getAsyncContextStack().withScope(() => {\n return callback(getAsyncContextStack().getIsolationScope());\n });\n}\n\n/**\n * Get the stack-based async context strategy.\n */\nexport function getStackAsyncContextStrategy(): AsyncContextStrategy {\n return {\n withIsolationScope,\n withScope,\n withSetScope,\n withSetIsolationScope: <T>(_isolationScope: Scope, callback: (isolationScope: Scope) => T) => {\n return withIsolationScope(callback);\n },\n getCurrentScope: () => getAsyncContextStack().getScope(),\n getIsolationScope: () => getAsyncContextStack().getIsolationScope(),\n };\n}\n", "import type { Carrier } from './../carrier';\nimport { getMainCarrier, getSentryCarrier } from './../carrier';\nimport { getStackAsyncContextStrategy } from './stackStrategy';\nimport type { AsyncContextStrategy } from './types';\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n sentry.acs = strategy;\n}\n\n/**\n * Get the current async context strategy.\n * If none has been setup, the default will be used.\n */\nexport function getAsyncContextStrategy(carrier: Carrier): AsyncContextStrategy {\n const sentry = getSentryCarrier(carrier);\n\n if (sentry.acs) {\n return sentry.acs;\n }\n\n // Otherwise, use the default one (stack)\n return getStackAsyncContextStrategy();\n}\n", "import { getAsyncContextStrategy } from './asyncContext';\nimport { getGlobalSingleton, getMainCarrier } from './carrier';\nimport type { Client } from './client';\nimport { Scope } from './scope';\nimport type { TraceContext } from './types-hoist/context';\nimport { generateSpanId } from './utils-hoist/propagationContext';\n\n/**\n * Get the currently active scope.\n */\nexport function getCurrentScope(): Scope {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n return acs.getCurrentScope();\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current execution context.\n */\nexport function getIsolationScope(): Scope {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n return acs.getIsolationScope();\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nexport function getGlobalScope(): Scope {\n return getGlobalSingleton('globalScope', () => new Scope());\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n */\nexport function withScope<T>(callback: (scope: Scope) => T): T;\n/**\n * Set the given scope as the active scope in the callback.\n */\nexport function withScope<T>(scope: Scope | undefined, callback: (scope: Scope) => T): T;\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nexport function withScope<T>(\n ...rest: [callback: (scope: Scope) => T] | [scope: Scope | undefined, callback: (scope: Scope) => T]\n): T {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n\n if (!scope) {\n return acs.withScope(callback);\n }\n\n return acs.withSetScope(scope, callback);\n }\n\n return acs.withScope(rest[0]);\n}\n\n/**\n * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n */\nexport function withIsolationScope<T>(callback: (isolationScope: Scope) => T): T;\n/**\n * Set the provided isolation scope as active in the given callback. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n *\n * If you pass in `undefined` as a scope, it will fork a new isolation scope, the same as if no scope is passed.\n */\nexport function withIsolationScope<T>(isolationScope: Scope | undefined, callback: (isolationScope: Scope) => T): T;\n/**\n * Either creates a new active isolation scope, or sets the given isolation scope as active scope in the given callback.\n */\nexport function withIsolationScope<T>(\n ...rest:\n | [callback: (isolationScope: Scope) => T]\n | [isolationScope: Scope | undefined, callback: (isolationScope: Scope) => T]\n): T {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [isolationScope, callback] = rest;\n\n if (!isolationScope) {\n return acs.withIsolationScope(callback);\n }\n\n return acs.withSetIsolationScope(isolationScope, callback);\n }\n\n return acs.withIsolationScope(rest[0]);\n}\n\n/**\n * Get the currently active client.\n */\nexport function getClient<C extends Client>(): C | undefined {\n return getCurrentScope().getClient<C>();\n}\n\n/**\n * Get a trace context for the given scope.\n */\nexport function getTraceContextFromScope(scope: Scope): TraceContext {\n const propagationContext = scope.getPropagationContext();\n\n const { traceId, parentSpanId, propagationSpanId } = propagationContext;\n\n const traceContext: TraceContext = {\n trace_id: traceId,\n span_id: propagationSpanId || generateSpanId(),\n };\n\n if (parentSpanId) {\n traceContext.parent_span_id = parentSpanId;\n }\n\n return traceContext;\n}\n", "import type { Client } from '../client';\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { getGlobalScope } from '../currentScopes';\nimport { notifyEventProcessors } from '../eventProcessors';\nimport type { CaptureContext, ScopeContext } from '../scope';\nimport { Scope } from '../scope';\nimport type { Event, EventHint } from '../types-hoist/event';\nimport type { ClientOptions } from '../types-hoist/options';\nimport type { StackParser } from '../types-hoist/stacktrace';\nimport { getFilenameToDebugIdMap } from '../utils-hoist/debug-ids';\nimport { addExceptionMechanism, uuid4 } from '../utils-hoist/misc';\nimport { normalize } from '../utils-hoist/normalize';\nimport { truncate } from '../utils-hoist/string';\nimport { dateTimestampInSeconds } from '../utils-hoist/time';\nimport { applyScopeDataToEvent, mergeScopeData } from './applyScopeDataToEvent';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\nexport type ExclusiveEventHintOrCaptureContext =\n | (CaptureContext & Partial<{ [key in keyof EventHint]: never }>)\n | (EventHint & Partial<{ [key in keyof ScopeContext]: never }>);\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nexport function prepareEvent(\n options: ClientOptions,\n event: Event,\n hint: EventHint,\n scope?: Scope,\n client?: Client,\n isolationScope?: Scope,\n): PromiseLike<Event | null> {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1_000 } = options;\n const prepared: Event = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n if (client) {\n client.emit('applyFrameMetadata', event);\n }\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Scope.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n const eventProcessors = [\n ...clientEventProcessors,\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n *\n * Only exported for tests.\n *\n * @param event event instance to be enhanced\n */\nexport function applyClientOptions(event: Event, options: ClientOptions): void {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n // empty strings do not make sense for environment, release, and dist\n // so we handle them the same as if they were not provided\n event.environment = event.environment || environment || DEFAULT_ENVIRONMENT;\n\n if (!event.release && release) {\n event.release = release;\n }\n\n if (!event.dist && dist) {\n event.dist = dist;\n }\n\n const request = event.request;\n if (request?.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nexport function applyDebugIds(event: Event, stackParser: StackParser): void {\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);\n\n event.exception?.values?.forEach(exception => {\n exception.stacktrace?.frames?.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nexport function applyDebugMeta(event: Event): void {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap: Record<string, string> = {};\n event.exception?.values?.forEach(exception => {\n exception.stacktrace?.frames?.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id,\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event: Event, integrationNames: string[]): void {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event: Event | null, depth: number, maxBreadth: number): Event | null {\n if (!event) {\n return null;\n }\n\n const normalized: Event = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts?.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n return {\n ...span,\n ...(span.data && {\n data: normalize(span.data, depth, maxBreadth),\n }),\n };\n });\n }\n\n // event.contexts.flags (FeatureFlagContext) stores context for our feature\n // flag integrations. It has a greater nesting depth than our other typed\n // Contexts, so we re-normalize with a fixed depth of 3 here. We do not want\n // to skip this in case of conflicting, user-provided context.\n if (event.contexts?.flags && normalized.contexts) {\n normalized.contexts.flags = normalize(event.contexts.flags, 3, maxBreadth);\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope: Scope | undefined, captureContext: CaptureContext | undefined): Scope | undefined {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nexport function parseEventHintOrCaptureContext(\n hint: ExclusiveEventHintOrCaptureContext | undefined,\n): EventHint | undefined {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(hint: CaptureContext | EventHint): hint is Scope | ((scope: Scope) => Scope) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\ntype ScopeContextProperty = keyof ScopeContext;\nconst captureContextKeys: readonly ScopeContextProperty[] = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'propagationContext',\n] as const;\n\nfunction hintIsScopeContext(hint: Partial<ScopeContext> | EventHint): hint is Partial<ScopeContext> {\n return Object.keys(hint).some(key => captureContextKeys.includes(key as ScopeContextProperty));\n}\n", "import { getClient, getCurrentScope, getIsolationScope, withIsolationScope } from './currentScopes';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { CaptureContext } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport type { CheckIn, FinishedCheckIn, MonitorConfig } from './types-hoist/checkin';\nimport type { Event, EventHint } from './types-hoist/event';\nimport type { EventProcessor } from './types-hoist/eventprocessor';\nimport type { Extra, Extras } from './types-hoist/extra';\nimport type { Primitive } from './types-hoist/misc';\nimport type { Session, SessionContext } from './types-hoist/session';\nimport type { SeverityLevel } from './types-hoist/severity';\nimport type { User } from './types-hoist/user';\nimport type { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { isThenable } from './utils-hoist/is';\nimport { logger } from './utils-hoist/logger';\nimport { uuid4 } from './utils-hoist/misc';\nimport { timestampInSeconds } from './utils-hoist/time';\nimport { GLOBAL_OBJ } from './utils-hoist/worldwide';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nexport function captureException(exception: unknown, hint?: ExclusiveEventHintOrCaptureContext): string {\n return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nexport function captureMessage(message: string, captureContext?: CaptureContext | SeverityLevel): string {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n return getCurrentScope().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nexport function captureEvent(event: Event, hint?: EventHint): string {\n return getCurrentScope().captureEvent(event, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\nexport function setContext(name: string, context: { [key: string]: unknown } | null): void {\n getIsolationScope().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): void {\n getIsolationScope().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): void {\n getIsolationScope().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: Primitive }): void {\n getIsolationScope().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nexport function setTag(key: string, value: Primitive): void {\n getIsolationScope().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): void {\n getIsolationScope().setUser(user);\n}\n\n/**\n * The last error event id of the isolation scope.\n *\n * Warning: This function really returns the last recorded error event id on the current\n * isolation scope. If you call this function after handling a certain error and another error\n * is captured in between, the last one is returned instead of the one you might expect.\n * Also, ids of events that were never sent to Sentry (for example because\n * they were dropped in `beforeSend`) could be returned.\n *\n * @returns The last event id of the isolation scope.\n */\nexport function lastEventId(): string | undefined {\n return getIsolationScope().lastEventId();\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function withMonitor<T>(\n monitorSlug: CheckIn['monitorSlug'],\n callback: () => T,\n upsertMonitorConfig?: MonitorConfig,\n): T {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status: FinishedCheckIn['status']): void {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n\n return withIsolationScope(() => {\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishCheckIn('ok');\n },\n e => {\n finishCheckIn('error');\n throw e;\n },\n );\n } else {\n finishCheckIn('ok');\n }\n\n return maybePromiseResult;\n });\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nexport function isInitialized(): boolean {\n return !!getClient();\n}\n\n/** If the SDK is initialized & enabled. */\nexport function isEnabled(): boolean {\n const client = getClient();\n return client?.getOptions().enabled !== false && !!client?.getTransport();\n}\n\n/**\n * Add an event processor.\n * This will be added to the current isolation scope, ensuring any event that is processed in the current execution\n * context will have the processor applied.\n */\nexport function addEventProcessor(callback: EventProcessor): void {\n getIsolationScope().addEventProcessor(callback);\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nexport function startSession(context?: SessionContext): Session {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession?.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nexport function endSession(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate(): void {\n const isolationScope = getIsolationScope();\n const client = getClient();\n const session = isolationScope.getSession();\n if (session && client) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nexport function captureSession(end: boolean = false): void {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n", "export const RAW_DOCS_API_URL = 'https://dev.wix.com/rawdocs/api';\nexport const GET_ARTICLE_CONTENT_URL = `${RAW_DOCS_API_URL}/get-article-content`;\nexport const PORTAL_INDEX_URL = `${RAW_DOCS_API_URL}/portal-index`;\n\nexport const DOCS_API_BASE_URL = 'https://dev.wix.com/docs/api/v1';\nexport const GET_SKILLS_BY_PORTAL_URL = `${DOCS_API_BASE_URL}/docs-web-app/menu-node/get-skills-by-portal`;\nexport const REST_PORTAL_ID = 'd1972c09-74e2-4d36-a6f2-54e3310d4ad9';\n", "import { HttpClient } from '@wix/http-client';\nimport { logger } from '../infra/logger.js';\nimport { GET_ARTICLE_CONTENT_URL } from '../constants.js';\n\n// ---------------------------------------------------------------------------\n// Public constants and utilities\n// ---------------------------------------------------------------------------\n\n/** URL for the management recipes index article */\nexport const RECIPES_INDEX_URL =\n 'https://dev.wix.com/docs/api-reference/articles/ai-tools/wix-mcp/skills/wix-management-recipes-index';\n\n/**\n * Fetch the management recipes index content from the public rawdocs API.\n * Returns the recipes index as a string (markdown).\n *\n * No authentication required -- creates its own HttpClient.\n *\n * @example\n * ```typescript\n * import { fetchRecipesIndex } from '@wix/mcp';\n *\n * const recipes = await fetchRecipesIndex();\n * console.log(recipes);\n * ```\n */\nexport async function fetchRecipesIndex(): Promise<string> {\n const httpClient = new HttpClient();\n return fetchArticleContent(httpClient, RECIPES_INDEX_URL, 'article', true);\n}\n\n/**\n * Fetch any Wix documentation article by its URL.\n * Returns the article content as a string (markdown).\n *\n * No authentication required -- creates its own HttpClient.\n *\n * @param articleUrl - Full URL to a dev.wix.com docs article\n *\n * @example\n * ```typescript\n * import { fetchArticle } from '@wix/mcp';\n *\n * const article = await fetchArticle(\n * 'https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/products/query-products'\n * );\n * console.log(article);\n * ```\n */\nexport async function fetchArticle(articleUrl: string): Promise<string> {\n const httpClient = new HttpClient();\n return fetchArticleContent(httpClient, articleUrl, 'article', false);\n}\n\n// ---------------------------------------------------------------------------\n// Internal implementation\n// ---------------------------------------------------------------------------\n\nconst DOCS_URL_PREFIX = 'https://dev.wix.com/docs/';\n\nfunction getResponseErrorMessage(data: unknown): string | undefined {\n if (!data) {\n return undefined;\n }\n\n if (typeof data === 'string') {\n return data;\n }\n\n if (typeof data !== 'object') {\n return undefined;\n }\n\n const record = data as Record<string, unknown>;\n for (const key of ['error', 'message']) {\n if (typeof record[key] === 'string') {\n return record[key];\n }\n }\n\n return undefined;\n}\n\nfunction getHttpErrorDetails(error: unknown): {\n message: string;\n status?: number;\n} {\n const fallbackMessage =\n error instanceof Error ? error.message : 'Unknown error';\n\n if (!error || typeof error !== 'object') {\n return { message: fallbackMessage };\n }\n\n const response = (error as { response?: { status?: number; data?: unknown } })\n .response;\n const responseMessage = getResponseErrorMessage(response?.data);\n if (!responseMessage) {\n return { message: fallbackMessage, status: response?.status };\n }\n\n return { message: responseMessage, status: response?.status };\n}\n\n/**\n * Replaces the docs URL prefix with the configured override URL.\n * This allows fetching from a local dev server instead of production.\n *\n * Example:\n * Input: https://dev.wix.com/docs/api-reference/articles/ai-tools/wix-mcp/skills/wix-management-recipes-index\n * Output: http://localhost:4000/api-reference/articles/ai-tools/wix-mcp/skills/wix-management-recipes-index\n */\nfunction applyPortalUrlOverride(\n articleUrl: string,\n skillsPortalUrl?: string\n): string {\n if (!skillsPortalUrl) {\n return articleUrl;\n }\n\n if (articleUrl.startsWith(DOCS_URL_PREFIX)) {\n // Remove trailing slash from override URL if present to avoid double slashes\n const baseUrl = skillsPortalUrl.replace(/\\/$/, '');\n const pathAfterPrefix = articleUrl.slice(DOCS_URL_PREFIX.length);\n const overriddenUrl = `${baseUrl}/${pathAfterPrefix}`;\n logger.log(\n `[Portal URL Override] Redirecting ${articleUrl} to ${overriddenUrl}`\n );\n return overriddenUrl;\n }\n\n return articleUrl;\n}\n\nasync function fetchArticleContentFromDigor(\n httpClient: HttpClient,\n articleUrl: string,\n mode: 'article' | 'methodSchema',\n stripHeader: boolean = false,\n repo?: string,\n commitHash?: string,\n fetchMcpWhiteList?: boolean\n) {\n // https://dev.wix.com/rawdocs/api/get-article-content?articleUrl=https://dev.wix.com/docs/api-reference/business-solutions/blog/draft-posts/create-draft-post&schema=true\n const url = new URL(GET_ARTICLE_CONTENT_URL);\n url.searchParams.set('articleUrl', articleUrl);\n const schema = mode === 'methodSchema' ? 'true' : 'false';\n url.searchParams.set('schema', schema);\n if (repo) url.searchParams.set('repo', repo);\n if (commitHash) url.searchParams.set('commitHash', commitHash);\n if (fetchMcpWhiteList) url.searchParams.set('fetchMcpWhiteList', 'true');\n\n logger.log(`Fetching resource from docs ${url.toString()}`);\n\n let data: { articleContent?: string };\n try {\n ({ data } = await httpClient.get(url.toString()));\n } catch (error) {\n const { message, status } = getHttpErrorDetails(error);\n const statusSuffix = status ? ` (status ${status})` : '';\n throw new Error(`${message}${statusSuffix}`);\n }\n\n const headerDivider = '## Article Content:'; // after the header, the content starts\n const articleContent = data.articleContent;\n\n if (!articleContent) {\n throw new Error('Article content is empty');\n }\n\n if (stripHeader) {\n const headerIndex = articleContent.indexOf(headerDivider);\n if (headerIndex !== -1) {\n return articleContent.substring(\n headerIndex + headerDivider.length\n ) as string;\n }\n }\n\n return articleContent as string;\n}\n\nexport async function fetchArticleContent(\n httpClient: HttpClient,\n articleUrl: string,\n mode: 'article' | 'methodSchema' | 'raw',\n stripHeader: boolean = false,\n skillsPortalUrl?: string,\n repo?: string,\n commitHash?: string,\n fetchMcpWhiteList?: boolean\n) {\n // Apply portal URL override if configured\n const effectiveUrl = applyPortalUrlOverride(articleUrl, skillsPortalUrl);\n const isOverridden = effectiveUrl !== articleUrl;\n\n let content: string;\n\n // When override is active, fetch directly from the override server\n // (don't go through rawdocs API which can't reach localhost)\n if (isOverridden) {\n try {\n const { data: doc } = await httpClient.get(effectiveUrl);\n content = doc as string;\n } catch (error) {\n console.warn(\n `[fetch] Override failed for ${effectiveUrl}, falling back to ${articleUrl}:`,\n error instanceof Error ? error.message : error\n );\n // Fall through to normal fetch\n content = await fetchArticleContentFromDigor(\n httpClient,\n articleUrl,\n mode as 'article' | 'methodSchema',\n stripHeader\n );\n }\n } else if (mode === 'raw') {\n let parsedUrl: URL;\n\n try {\n parsedUrl = new URL(articleUrl);\n } catch {\n throw new Error(`Invalid URL format: ${articleUrl}`);\n }\n\n const hostname = parsedUrl.hostname.replace('www.', '');\n if (hostname !== 'dev.wix.com') {\n throw new Error(\n `Unsupported URL domain: ${hostname}. Article URL must be from dev.wix.com`\n );\n }\n\n const { data: doc } = await httpClient.get(articleUrl);\n content = doc as string;\n } else {\n content = await fetchArticleContentFromDigor(\n httpClient,\n articleUrl,\n mode,\n stripHeader,\n repo,\n commitHash,\n fetchMcpWhiteList\n );\n }\n\n // Log preview of fetched content\n const contentLines = content.split('\\n');\n const preview = contentLines.slice(0, 15).join('\\n');\n const truncated =\n contentLines.length > 15\n ? `\\n... (${contentLines.length - 15} more lines)`\n : '';\n logger.log(`Fetched article: ${effectiveUrl}\\n${preview}${truncated}`);\n\n return content;\n}\n", "import { logger } from '../infra/logger.js';\n\nexport const SCHEMA_HINT =\n 'prefer SearchWixAPISpec to inspect the REST method schema; use ReadFullDocsMethodSchema as fallback';\nexport const ARTICLE_HINT =\n 'use ReadFullDocsArticle to see method code examples';\nexport const MENU_HINT = 'use BrowseWixRESTDocsMenu to browse this category';\n\n/**\n * Character count threshold for menu content. When a get-menu-content response\n * exceeds this, we return a compact list of sub-category URLs instead of the\n * full (often 60-190k char) subtree that overwhelms the model's context.\n */\nexport const MENU_CONTENT_THRESHOLD = 20_000;\n\n/**\n * Safely decodes a URI component, returning the original string if decoding fails.\n */\nfunction safeDecode(encoded: string): string {\n try {\n return decodeURIComponent(encoded);\n } catch {\n return encoded;\n }\n}\n\n/**\n * Parses direct child sub-category URLs from a get-menu-content response.\n * Only returns URLs that are one path segment deeper than parentUrl.\n *\n * For example, given parentUrl \"https://dev.wix.com/docs/api-reference/business-solutions\",\n * it will match \".../business-solutions/stores\" but not \".../business-solutions/stores/catalog-v3\".\n */\nexport function parseDirectChildren(\n content: string,\n parentUrl: string\n): Array<{ title: string; url: string }> {\n const re =\n /\\[([^\\]]+)\\]\\(https:\\/\\/[^)]*get-menu-content\\?url=([^&)]+)[^)]*\\)/g;\n const seen = new Set<string>();\n const children: Array<{ title: string; url: string }> = [];\n let m;\n while ((m = re.exec(content)) !== null) {\n const title = m[1];\n const url = safeDecode(m[2]);\n if (url.startsWith(parentUrl + '/') && !seen.has(url)) {\n const after = url.slice(parentUrl.length + 1);\n if (!after.includes('/')) {\n children.push({ title, url });\n seen.add(url);\n }\n }\n }\n return children;\n}\n\n/**\n * When a menu response is too large for the model to effectively parse,\n * returns a compact summary listing only the direct sub-categories with\n * their browsable URLs. The model can then drill into a specific sub-category.\n */\nexport function summarizeLargeMenu(content: string, parentUrl: string): string {\n const children = parseDirectChildren(content, parentUrl);\n const sizeKb = Math.round(content.length / 1000);\n\n let summary = `This section is large (${sizeKb}k chars). Browse a sub-category to find what you need:\\n\\n`;\n for (const c of children) {\n summary += `- ${c.title}: \"${c.url}\"\\n`;\n }\n summary +=\n '\\nTip: If you know what you are looking for, use SearchWixRESTDocumentation instead.';\n return summary;\n}\n\n/**\n * Base URL for the Wix API reference docs.\n */\nconst API_REFERENCE_BASE = 'https://dev.wix.com/docs/api-reference';\n\n/**\n * Generates an adaptive navigation tree of the Wix API documentation.\n * - Level 1: top-level categories (Articles, Business Solutions, CRM, etc.)\n * - Level 2: their direct children\n * - Level 3: only expanded for children whose content exceeds MENU_CONTENT_THRESHOLD\n *\n * Returns compact text with relative paths. The model prepends the base URL\n * to browse any section via BrowseWixRESTDocsMenu.\n *\n * @param httpClient - HTTP client for fetching menu content\n */\nexport async function generateDocsNavigationTree(httpClient: {\n get: (url: string) => Promise<{ data: string }>;\n}): Promise<string> {\n const fetchMenu = async (url: string): Promise<string> => {\n const apiUrl = `https://dev.wix.com/docs/api/v1/get-menu-content?url=${encodeURIComponent(url)}&format=markdown`;\n const res = await httpClient.get(apiUrl);\n return res.data;\n };\n\n const toPath = (url: string) => url.slice(API_REFERENCE_BASE.length);\n\n try {\n const rootContent = await fetchMenu(API_REFERENCE_BASE);\n const topLevel = parseDirectChildren(rootContent, API_REFERENCE_BASE);\n\n const lines: string[] = [\n '## Wix API Documentation Map',\n `Use with BrowseWixRESTDocsMenu: prepend ${API_REFERENCE_BASE} to any path below.`,\n ''\n ];\n\n // Fetch all level-1 children in parallel\n const level1Results = await Promise.all(\n topLevel.map(async (cat) => {\n const catContent = await fetchMenu(cat.url);\n const catChildren = parseDirectChildren(catContent, cat.url);\n return { ...cat, children: catChildren, content: catContent };\n })\n );\n\n for (const cat of level1Results) {\n lines.push(`- ${cat.title}: ${toPath(cat.url)}`);\n\n if (cat.children.length === 0) continue;\n\n // Fetch all level-2 children sizes in parallel\n const level2Results = await Promise.all(\n cat.children.map(async (c2) => {\n const c2Content = await fetchMenu(c2.url);\n const c2Children =\n c2Content.length > MENU_CONTENT_THRESHOLD\n ? parseDirectChildren(c2Content, c2.url)\n : [];\n return { ...c2, children: c2Children };\n })\n );\n\n for (const c2 of level2Results) {\n lines.push(` - ${c2.title}: ${toPath(c2.url)}`);\n for (const c3 of c2.children) {\n lines.push(` - ${c3.title}: ${toPath(c3.url)}`);\n }\n }\n }\n\n return lines.join('\\n');\n } catch (error) {\n logger.error(\n `[generateDocsNavigationTree] Failed to generate tree: ${error}`\n );\n return '## Wix API Documentation Map\\n\\nFailed to load documentation tree. Use BrowseWixRESTDocsMenu to explore.';\n }\n}\n\n/**\n * Fetches raw menu content from the get-menu-content API for a given docs URL.\n * Returns the raw markdown string, or throws on failure.\n */\nexport async function fetchMenuContent(\n httpClient: { get: (url: string) => Promise<{ data: string }> },\n docsUrl: string\n): Promise<string> {\n const encodedUrl = encodeURIComponent(docsUrl);\n const apiUrl = `https://dev.wix.com/docs/api/v1/get-menu-content?url=${encodedUrl}&format=markdown`;\n const response = await httpClient.get(apiUrl);\n return response.data;\n}\n\n/**\n * Normalizes the raw API URLs in the BrowseWixRESTDocsMenu response content\n * back to clean dev.wix.com/docs/... URLs, and appends actionable hints to\n * the markdown link titles indicating which tool to use.\n *\n * Schema regex runs before article regex since the article pattern would also\n * match schema URLs.\n */\nexport function normalizeMenuContent(content: string): string {\n try {\n // 1. Schema links: [title](https://.../get-article-content?articleUrl=...&...schema=true...)\n // Must run before article links since article pattern also matches schema URLs.\n content = content.replace(\n /\\[([^\\]]+)\\]\\(https:\\/\\/[^)]*get-article-content\\?articleUrl=([^&)]+)[^)]*schema=true[^)]*\\)/g,\n (_, title, encoded) =>\n `[${title} (${SCHEMA_HINT})](${safeDecode(encoded)})`\n );\n\n // 2. Article links: [title](https://.../get-article-content?articleUrl=...&...)\n content = content.replace(\n /\\[([^\\]]+)\\]\\(https:\\/\\/[^)]*get-article-content\\?articleUrl=([^&)]+)[^)]*\\)/g,\n (_, title, encoded) =>\n `[${title} (${ARTICLE_HINT})](${safeDecode(encoded)})`\n );\n\n // 3. Menu links: [title](https://.../get-menu-content?url=...&...)\n content = content.replace(\n /\\[([^\\]]+)\\]\\(https:\\/\\/[^)]*get-menu-content\\?url=([^&)]+)[^)]*\\)/g,\n (_, title, encoded) => `[${title} (${MENU_HINT})](${safeDecode(encoded)})`\n );\n } catch (error) {\n logger.error(\n `[BrowseWixRESTDocsMenu] Failed to normalize menu content: ${error}`\n );\n // Return original content if normalization fails\n }\n\n return content;\n}\n", "import { logger } from '../infra/logger.js';\n\n/**\n * Platformized docs-menu browsing, backed by mcp-docs-search-server's\n * structured menu index (POST /v1/docs/menu/browse) instead of scraping the\n * legacy get-menu-content markdown. The server returns LLM-ready markdown:\n * breadcrumbs, typed entries (method verbs, articles, categories) and\n * per-subtree counts, capped server-side \u2014 no client-side thresholding needed.\n *\n * Also browser-safe: unlike dev.wix.com's get-menu-content, this endpoint\n * serves CORS headers.\n */\nexport const BROWSE_MENU_API_URL =\n 'https://www.wixapis.com/mcp-docs-search/v1/docs/menu/browse';\n\n/** The browse index has no node for the requested URL (HTTP 404). */\nexport class MenuNotFoundError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'MenuNotFoundError';\n }\n}\n\n/**\n * The browse index keys nodes by exact canonical path: trailing slashes, query\n * strings, fragments, and `.md` suffixes all miss. Each shape occurs in real\n * traffic \u2014 article prose links carry `#anchors`, and every docs page has a\n * `.md` twin whose menu pages emit all child links WITH the `.md` suffix, so\n * agents that navigated the `.md` tree hold `.md` URLs.\n */\nexport function normalizeMenuUrlForBrowse(url: string): string {\n return url\n .replace(/[?#].*$/, '')\n .replace(/\\/+$/, '')\n .replace(/\\.md$/, '')\n .trim();\n}\n\n/**\n * Browse a docs menu via the platformized endpoint. `menuUrl` omitted browses\n * the REST portal root. Returns the server's markdown content.\n *\n * Throws MenuNotFoundError on 404 (a real answer: no such menu node) and a\n * plain Error on anything else (transport/5xx) \u2014 callers treat only the latter\n * as a reason to fall back to the legacy get-menu-content path.\n */\nexport async function fetchPlatformizedMenu(menuUrl?: string): Promise<string> {\n const body = menuUrl ? { menu_url: normalizeMenuUrlForBrowse(menuUrl) } : {};\n\n const response = await fetch(BROWSE_MENU_API_URL, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body)\n });\n\n if (response.status === 404) {\n const data = (await response.json().catch(() => ({}))) as {\n error?: string;\n };\n throw new MenuNotFoundError(data.error ?? `No menu node for \"${menuUrl}\"`);\n }\n\n if (!response.ok) {\n const text = await response.text().catch(() => '');\n logger.error(\n `[browse-menu] HTTP ${response.status} from browse endpoint: ${text.slice(0, 300)}`\n );\n throw new Error(`Browse menu request failed (HTTP ${response.status})`);\n }\n\n const data = (await response.json()) as { content?: string };\n if (!data.content) {\n throw new Error('Browse menu response carried no content');\n }\n return data.content;\n}\n", "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nconst dedent = createDedent({});\nexport default dedent;\nfunction createDedent(options) {\n dedent.withOptions = newOptions => createDedent(_objectSpread(_objectSpread({}, options), newOptions));\n return dedent;\n function dedent(strings, ...values) {\n const raw = typeof strings === \"string\" ? [strings] : strings.raw;\n const {\n alignValues = false,\n escapeSpecialCharacters = Array.isArray(strings),\n trimWhitespace = true\n } = options;\n\n // first, perform interpolation\n let result = \"\";\n for (let i = 0; i < raw.length; i++) {\n let next = raw[i];\n if (escapeSpecialCharacters) {\n // handle escaped newlines, backticks, and interpolation characters\n next = next.replace(/\\\\\\n[ \\t]*/g, \"\").replace(/\\\\`/g, \"`\").replace(/\\\\\\$/g, \"$\").replace(/\\\\\\{/g, \"{\");\n }\n result += next;\n if (i < values.length) {\n const value = alignValues ? alignValue(values[i], result) : values[i];\n\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n result += value;\n }\n }\n\n // now strip indentation\n const lines = result.split(\"\\n\");\n let mindent = null;\n for (const l of lines) {\n const m = l.match(/^(\\s+)\\S+/);\n if (m) {\n const indent = m[1].length;\n if (!mindent) {\n // this is the first indented line\n mindent = indent;\n } else {\n mindent = Math.min(mindent, indent);\n }\n }\n }\n if (mindent !== null) {\n const m = mindent; // appease TypeScript\n result = lines\n // https://github.com/typescript-eslint/typescript-eslint/issues/7140\n // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with\n .map(l => l[0] === \" \" || l[0] === \"\\t\" ? l.slice(m) : l).join(\"\\n\");\n }\n\n // dedent eats leading and trailing whitespace too\n if (trimWhitespace) {\n result = result.trim();\n }\n\n // handle escaped newlines at the end to ensure they don't get stripped too\n if (escapeSpecialCharacters) {\n result = result.replace(/\\\\n/g, \"\\n\");\n }\n\n // Workaround for Bun issue with Unicode characters\n // https://github.com/oven-sh/bun/issues/8745\n if (typeof Bun !== \"undefined\") {\n result = result.replace(\n // Matches e.g. \\\\u{1f60a} or \\\\u5F1F\n /\\\\u(?:\\{([\\da-fA-F]{1,6})\\}|([\\da-fA-F]{4}))/g, (_, braced, unbraced) => {\n var _ref;\n const hex = (_ref = braced !== null && braced !== void 0 ? braced : unbraced) !== null && _ref !== void 0 ? _ref : \"\";\n return String.fromCodePoint(parseInt(hex, 16));\n });\n }\n return result;\n }\n}\n\n/**\n * Adjusts the indentation of a multi-line interpolated value to match the current line.\n */\nfunction alignValue(value, precedingText) {\n if (typeof value !== \"string\" || !value.includes(\"\\n\")) {\n return value;\n }\n const currentLine = precedingText.slice(precedingText.lastIndexOf(\"\\n\") + 1);\n const indentMatch = currentLine.match(/^(\\s+)/);\n if (indentMatch) {\n const indent = indentMatch[1];\n return value.replace(/\\n/g, `\\n${indent}`);\n }\n return value;\n}\n", "import { HttpClient } from '@wix/http-client';\nimport { logger } from '../infra/logger.js';\nimport { GET_SKILLS_BY_PORTAL_URL } from '../constants.js';\n\nexport interface GetSkillsByPortalRequest {\n portalId: string;\n repo?: string;\n commitHash?: string;\n tags?: string[];\n}\n\ninterface GetSkillsByPortalResponse {\n content: string;\n}\n\nexport async function getSkillsByPortal(\n httpClient: HttpClient,\n request: GetSkillsByPortalRequest\n): Promise<string> {\n logger.log(\n `Fetching skills for portal \"${request.portalId}\"` +\n (request.repo ? ` from repo \"${request.repo}\"` : '') +\n (request.commitHash ? ` at commit \"${request.commitHash}\"` : '')\n );\n\n const { data } = await httpClient.post<GetSkillsByPortalResponse>(\n GET_SKILLS_BY_PORTAL_URL,\n request\n );\n\n return data.content;\n}\n", "export const UNAUTHORIZED_ERROR_NAME = 'UnauthorizedError';\n\nexport type McpHeaders = Record<string, string>;\n\n/**\n * Material the execute runtime needs to obtain a site-scoped token for any site\n * on demand (multi-site ExecuteWixAPI). `oauth` is exchanged for a per-site\n * token via the oauth2/token refresh-grant; `apiKey` works for any site as-is.\n * The oauth refresh token is sensitive: never log it, never expose to sandbox JS.\n */\nexport type SiteAuthContext =\n | { type: 'oauth'; clientId: string; refreshToken: string }\n | { type: 'apiKey'; accessToken: string };\n\nexport type McpAuthenticationStrategy = {\n /**\n * Call inside the tool callback so it resolves against the session's\n * current handler \u2014 the handler can swap mid-session (e.g. anonymous\n * \u2192 authenticated after OAuth), so anything resolved at registration\n * time goes stale.\n */\n isAnonymous?: () => boolean;\n\n /**\n * Call inside the tool callback so it resolves against the session's\n * current handler \u2014 the handler can swap mid-session, so anything\n * resolved at registration time goes stale.\n */\n getSiteAuthHeaders: (siteId: string) => Promise<McpHeaders> | McpHeaders;\n\n /**\n * Call inside the tool callback so it resolves against the session's\n * current handler \u2014 the handler can swap mid-session, so anything\n * resolved at registration time goes stale.\n */\n getAccountAuthHeaders: (\n accountId?: string\n ) => Promise<McpHeaders> | McpHeaders;\n\n /**\n * Material for the runtime to obtain per-site tokens (multi-site ExecuteWixAPI).\n * Optional: strategies without it fall back to the single-site path. Call\n * before any try/catch so an UnauthorizedError propagates to wrapToolCallback.\n */\n getSiteAuthContext?: () => Promise<SiteAuthContext> | SiteAuthContext;\n\n /**\n * Call from a tool's catch block on a Wix API failure. Throws\n * `UnauthorizedError` when the error indicates a revoked upstream session\n * so `wrapToolCallback` surfaces the re-auth signal; returns silently\n * otherwise so the tool's own error handling continues.\n */\n enforceValidWixToken?: (error: unknown) => Promise<void>;\n};\n\n/**\n * Re-throws the error if it is an UnauthorizedError.\n *\n * IMPORTANT FOR TOOL AUTHORS: When your tool calls getSiteAuthHeaders() or\n * getAccountAuthHeaders(), prefer making that call BEFORE any try/catch block.\n * This lets UnauthorizedError propagate naturally to wrapToolCallback, which\n * attaches the OAuth metadata needed for anonymous-to-authenticated flow.\n *\n * If the auth call MUST be inside a try/catch (e.g. it's interleaved with\n * other logic), add rethrowIfUnauthorized(error) as the first line of your\n * catch block to ensure the error still propagates.\n */\nexport function rethrowIfUnauthorized(error: unknown): void {\n if (error instanceof Error && error.name === UNAUTHORIZED_ERROR_NAME) {\n throw error;\n }\n}\n", "import dedent from 'dedent';\nimport type { ReadmeDocConfig } from '../docs/get-to-know.js';\nimport type { DocsTool } from '../docs/docs.js';\nimport type { ToolHintsConfig } from '../api-call/index.js';\n\n/**\n * Configuration structure for MCP modes\n */\nexport interface ModeDefaultConfig {\n toolDescriptions: Record<string, string>;\n disableTools: string[];\n enableTools: string[];\n readmeDocs: ReadmeDocConfig[];\n toolHints?: Record<string, ToolHintsConfig>;\n // Docs tools config\n docsTools?: DocsTool[];\n getToKnowWixEnabled?: boolean;\n createWixBusinessGuideEnabled?: boolean;\n // Code mode (search + execute via sandboxed JS)\n codeModeEnabled?: boolean;\n maxResponseSize?: number;\n // Dynamic context fetch\n dynamicContextEnabled?: boolean;\n partnerContextEnabled?: boolean;\n // Use platformized semantic search API\n usePlatformizedSearch?: boolean;\n // Skills PR override (repo + commitHash props)\n skillsPrOverrideEnabled?: boolean;\n}\n\n/**\n * Common agent goal - used in both SYSTEM_REMINDER and defaultReadmeDocs\n */\nconst AGENT_GOAL = dedent`\n You are an agent that helps the user manage their Wix site.\n Your goal is to get the user's prompt/task and execute it by using the appropriate tools eventually calling the correct Wix APIs with the correct parameters until the task is completed.\n`;\n\nconst DISCOVERY_FLOWS = [\n \"- CONVERSATION CONTEXT BASED: find relevant docs article or API example for the user's prompt/task in the conversation context -> call API using CallWixSiteAPI() based on the docs article or API example\",\n '- METHOD CODE EXAMPLE BASED: BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() to get method code examples -> call API using CallWixSiteAPI() based on the method code examples',\n '- FULL SCHEMA BASED: BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() -> no method code examples found -> inspect the method schema using SearchWixAPISpec or ReadFullDocsMethodSchema -> call API using CallWixSiteAPI() based on the schema'\n];\n\n// README-only lines and site-creation routing are added only when includeReadme\n// is true (README-free consumers like aria don't do site creation).\nfunction buildSystemReminderGuidelines(includeReadme: boolean): string {\n const exception = includeReadme ? '**Exception:** ' : '';\n const lines: string[] = [];\n\n if (includeReadme) {\n lines.push(\n 'if the WixREADME tool is available to you, YOU MUST USE IT AT THE BEGINNING OF ANY CONVERSATION and then continue with calling the other tools and calling the Wix APIs until the task is completed.',\n '**Exception \u2014 creating a new Wix site/website:** For a normal creation request \u2014 and only then \u2014 skip WixREADME and the docs search, and route straight to the Wix site-creation tools available to you; their descriptions carry the routing rules. Everything else starts with WixREADME as usual.',\n \"If the user explicitly asks for a headless site, Wix Classic Editor site, or manual account/API-based site creation, call CreateWixBusinessGuide right away \u2014 these don't need the site's purpose first.\",\n \"Never default to AI or search templates unless the user explicitly requests it. When the user named no creation method - let the user make that choice as the site-creation tools' descriptions direct. Never route normal site creation through ManageWixSite, CallWixSiteAPI, or ExecuteWixAPI.\"\n );\n }\n\n lines.push(\n `${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? 'skip WixREADME and ' : ''}call ListWixSites directly.`,\n `${exception}If the user wants to upload local or attached image files to a Wix site, skip ${includeReadme ? 'WixREADME and ' : ''}all docs/schema/API flows \u2014 call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`\n );\n\n if (includeReadme) {\n lines.push(\n 'If the WixREADME tool is not available to you, you should use the other flows as described without using the WixREADME tool until the task is completed.'\n );\n }\n\n lines.push(\n `This applies to QUESTIONS too, not only action tasks (the ${includeReadme ? 'exceptions' : 'direct-tool routes'} above still apply \u2014 question-shaped variants of those intents, e.g. \"can you show my sites?\", follow their ${includeReadme ? \"exception's \" : ''}direct tool): never answer a Wix-specific question from memory, and never reply that you lack the tools or APIs to answer, without first ${includeReadme ? 'calling the WixREADME tool (if available) and checking its recipes index, searching the docs,' : 'searching the docs'} and reading the matching docs articles \u2014 many questions (including ones that need no API call) are answered by a ${includeReadme ? 'recipe or docs article' : 'docs article'}.`,\n 'If the user prompt / task is an instruction to do something in Wix, You should not tell the user what Docs to read or what API to call, your task is to do the work and complete the task in minimal steps and time with minimal back and forth with the user, unless absolutely necessary.'\n );\n\n return lines.join('\\n');\n}\n\nfunction buildSystemReminderFlows(includeReadme: boolean): string {\n const lines = ['Wix MCP Site Management Flows'];\n\n if (includeReadme) {\n lines.push(\n 'With WixREADME tool:',\n \"- RECIPE BASED (PREFERRED!): WixREADME() -> find relevant recipe for the user's prompt/task -> read recipe using ReadFullDocsArticle() -> call Wix API using CallWixSiteAPI() based on the recipe\",\n DISCOVERY_FLOWS[0],\n \"- EXAMPLE BASED: WixREADME() -> no relevant recipe found for user's prompt/task -> BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() to get method code examples -> call API using CallWixSiteAPI() based on the method code examples\",\n \"- SCHEMA BASED, FALLBACK: WixREADME() -> no relevant recipe found for user's prompt/task -> BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() -> no method code examples found -> inspect the method schema using SearchWixAPISpec or ReadFullDocsMethodSchema -> call API using CallWixSiteAPI() based on the schema\",\n 'Without WixREADME tool:'\n );\n }\n\n lines.push(...DISCOVERY_FLOWS);\n\n return lines.join('\\n');\n}\n\nexport const SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(true);\n\nexport function buildSystemReminder(includeReadme: boolean): string {\n const guidelines = buildSystemReminderGuidelines(includeReadme);\n const flows = buildSystemReminderFlows(includeReadme);\n return dedent`\n <agent-mandatory-instructions>\n YOU MUST READ AND FOLLOW THE AGENT-MANDATORY-INSTRUCTIONS BELOW\n A FAILURE TO DO SO WILL RESULT IN ERRORS AND CRITICAL ISSUES.\n <goal>\n ${AGENT_GOAL}\n </goal>\n <guidelines>\n ${guidelines}\n </guidelines>\n <flow-description>\n ${flows}\n </flow-description>\n </agent-mandatory-instructions>\n `;\n}\n\nexport const SYSTEM_REMINDER = buildSystemReminder(true);\n\nexport const SITE_CREATION_COPY = {\n templatePick: {\n nonWidget:\n 'After the user selects a template, call `CreateSiteFromTemplate`.',\n widget: 'The gallery creates the site when the user picks one.'\n },\n unstatedMethod: {\n nonWidget:\n 'you MUST ask whether they want to build with AI or start from a template, and create nothing and show nothing until they answer',\n widget: 'you MUST call `WixSiteCreation` and let them choose'\n },\n normalCreationRoute: {\n nonWidget: 'route those through `WixSiteBuilder` or `SearchSiteTemplates`',\n widget: 'route those through `WixSiteCreation`'\n }\n} as const;\n\n/**\n * Carried by every tool that can start creating a site, so no route skips it.\n * `CreateWixBusinessGuide` is exempt: headless/classic/manual don't need the site's purpose.\n */\nconst SITE_GUIDANCE = dedent`\n A new-site request has two things to settle: what the site is for, and how to build it. The how is AI generation vs. starting from a template, so naming templates, a template id or Wix Studio (Wix Studio is also the template side) already settles it.\n\n Settle what the site is for first: its purpose, topic, business type, audience, or main visitor action. Naming a method is not a description of the site, and neither is the business or industry on its own.\n If you can't tell yet, ask the preferred question below and nothing else \u2014 one question, no creation-method question in the same reply, and no internal tool names.\n Once the purpose is clear, unless the user already named a method, ${SITE_CREATION_COPY.unstatedMethod.nonWidget}. A method they named is settled \u2014 never re-open it. Never default to AI or to templates, and never ask the user to choose between Harmony and Wix Studio; infer that from their words.\n With the purpose and the method known, that's enough to begin \u2014 route and refine the specifics with the user afterward.\n\n Preferred question when the user has given no site context at all:\n Happy to help. To give you the right starting point, tell me a bit more about what you have in mind:\n - What's the site for? (e.g. an online clothing store, a yoga studio that takes bookings, a restaurant)\n - What's the vibe? (e.g. sleek and modern, cozy and rustic, bold and energetic)\n Give me a quick summary and I'll take it from there\n\n Tone: helpful, practical, short. Speak about the user's site \u2014 what you're making and what comes next \u2014 not the tools, payloads, or routing behind it.`;\n\n/** Rewrites non-widget copy into its widget form; a no-op on text that carries no divergence. */\nexport const toWidget = (text: string): string =>\n Object.values(SITE_CREATION_COPY).reduce(\n (acc, { nonWidget, widget }) => acc.replaceAll(nonWidget, widget),\n text\n );\n\n/**\n * `buildToolDescriptions(true)` is the canonical set used by the live MCP server;\n * `buildToolDescriptions(false)` returns the same descriptions with WixREADME\n * mentions scrubbed (used by the toolkit's `includeReadmeMentions` flag).\n */\nconst EXECUTE_WIX_API_INTRO = dedent`\n Execute JavaScript code against the Wix REST API when code is useful for chaining related calls, pagination, loops, branching, or in-memory transformation.\n\n CODE CONTRACT:\n - Pass an async function expression: \\`async function() { ... }\\` or \\`async () => { ... }\\`. Put every declaration, \\`await\\`, and \\`return\\` inside it, and do not invoke it yourself.\n - Use only \\`wix.request({ method, url, body })\\` and in-memory JavaScript. Node.js modules, filesystem access, and downloadable-file creation are unavailable.\n\n CONFIRM API CONTRACTS:\n - Do not rely on memory for endpoints, methods, bodies, response paths, filters, enum values, or auth scope. Confirm every method from conversation-provided details, a complete matching docs example, or the schema/docs tools before executing.\n - Prefer \\`method.publicUrl\\` from SearchWixAPISpec; never use \\`method.servers[0]\\`. Pass all supporting documentation URLs through \\`sourceDocUrls\\`.\n - A response field is not automatically filterable or sortable. Use only capabilities declared for that exact query/search method. If an unsupported filter is unavoidable, fetch a bounded result set and filter it in code.\n - Read-only probes may inspect state or resolve IDs. Never use speculative create/update/delete calls to discover request or response shapes, and never repeat a successful mutation merely to obtain more response data.\n`;\n\nconst EXECUTE_WIX_API_OUTPUT_AND_ERRORS = dedent`\n RESULTS AND FAILURES:\n - \\`wix.request()\\` throws on a Wix API error. Let dependent flows fail fast. For independent work, return a compact result for every operation, including exactly which mutations succeeded or failed; do not silently swallow errors.\n - For independent read-only probes, you may wrap each call in \\`try/catch\\` and return structured partial results such as \\`{ ok: false, error }\\`. When running independent calls in parallel, use \\`Promise.allSettled\\` rather than \\`Promise.all\\` so that a single failure does not discard the other results.\n - Return compact, task-focused data rather than raw responses. Paginate when the user asks for all results, using the exact paging model and supported page size from the method schema.\n - Return IDs for every created entity, plus fields needed to answer the user or safely continue, verify, or clean up the operation. Use the confirmed response path from the method schema.\n - Large results are truncated. Summarize or map them in the function. If the user needs a downloadable artifact, return appropriately sized structured data and use separate host file tools when available; do not claim ExecuteWixAPI created a file.\n - When looking up an item by user-provided name, paginate/search until you find an exact name match; never update or delete the first result unless it exactly matches.\n`;\n\nconst ACCOUNT_SITE_EXECUTE_SCOPE = dedent`\n SCOPE AND SITE TARGETING:\n - Set \\`scope: \"site\"\\` for site-level APIs and \\`scope: \"account\"\\` for account-level APIs. Account-level acts on the account itself, or on sites as objects within it; anything that reads or writes inside a site is site-level.\n - If \\`scope\\` is omitted it defaults to site when either the ExecuteWixAPI call or \\`wix.request\\` provides a \\`siteId\\`; otherwise it defaults to account.\n - \\`scope: \"account\"\\` ignores any \\`siteId\\` you pass, so a site-level endpoint called that way fails.\n - Authentication is injected automatically; never set Authorization, wix-site-id, or wix-account-id headers.\n - For one named site, prefer GetSiteContext. If it is unavailable, resolve the exact site and perform the action in the same invocation.\n - For multiple sites, use one ExecuteWixAPI invocation. Obtain every intended site ID first, paginating the Sites API when necessary, then pass a per-request \\`siteId\\`. Use \\`Promise.allSettled\\` and return a compact success/failure result for each targeted site. Never invoke ExecuteWixAPI once per site; instead, handle all sites in one invocation and pass the appropriate per-request \\`siteId\\` to each \\`wix.request\\`.\n\n AVAILABLE API:\n \\`\\`\\`typescript\n interface WixRequestOptions {\n scope?: \"site\" | \"account\";\n siteId?: string;\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n url: string;\n body?: unknown;\n headers?: Record<string, string>;\n }\n interface WixResponse<T = unknown> {\n status: number;\n data: T;\n json(): Promise<T>;\n }\n declare const wix: {\n request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;\n };\n declare const siteId: string | undefined;\n \\`\\`\\`\n`;\n\nconst EXECUTE_WIX_API_WQL = dedent`\n For query and search endpoints: each endpoint declares which fields it can filter and sort by, and with which operators. That list is closed for fields and their operators and covers that endpoint only, and a field's presence in the response is no evidence it can be filtered on. It lives in the method's declared capabilities, and some resources also publish it as a \"Supported Filters and Sorting\" page. Logical operators are WQL syntax rather than field capabilities and never appear in it. Anything else errors or silently returns the wrong rows; fetch a bounded page and filter it in your own code instead.\n\n The filter is written in WQL, where each field takes a single operator, so conditions are combined with the logical operators instead. \\`$and\\` and \\`$or\\` take an array of expressions, \\`$not\\` takes one, and they can nest \u2014 always beside field names, never inside a field's object:\n \\`\\`\\`javascript\n filter: {\n $and: [\n { \"<field>\": { $gte: \"2023-01-01T00:00:00Z\" } },\n { \"<field>\": { $lte: \"2023-12-31T23:59:59Z\" } }\n ],\n \"<other-field>\": { $eq: \"<value>\" }\n }\n \\`\\`\\`\n`;\n\nconst EXECUTE_WIX_API_BULK = dedent`\n PREFER BULK ENDPOINTS:\n When the task acts on several entities, call the resource's \\`Bulk<Verb>\\` method instead of calling the single-item one once per entity. When the request takes an array of entities, chunk to its \\`maxItems\\`. Bulk responses report per-item outcomes instead of throwing, so read them and report what succeeded and what failed. Some resources may have no bulk for a given verb; when yours doesn't, call the single-item method once per entity. A search can return similarly named bulk methods from other resources or API versions, so use only one from the same resource and version as the single-item method.\n`;\n\nconst EXECUTE_WIX_API_ORCHESTRATION = dedent`\n PLAN ONE COMPLETE INVOCATION:\n Include every foreseeable lookup, mutation, dependent follow-up, requested verification, and cross-site fan-out in one function. One invocation may make several \\`wix.request()\\` calls \u2014 Keep dependent calls in sequence, independent calls in parallel with \\`Promise.allSettled\\`. Re-invoke only when a later step requires genuinely new information that you could not have included (e.g. the user's answer to a question, a slow async job). An empty or unexpected response shape is not a reason for a new invocation \u2014 add a conditional read-back inside the same function body instead. When a mutation's response proves the outcome, never make a second ExecuteWixAPI call merely to verify it; if a follow-up read is truly needed, include it after the mutation in the same function body. Context-gathering reads \u2014 fetching a required ID, checking whether a record already exists, listing items to pick one \u2014 are part of the mutation invocation that follows, not a preceding separate call.\n`;\n\nconst EXECUTE_WIX_API_DEPENDENT_EXAMPLE = dedent`\n EXAMPLE \u2014 complete dependent flow in one invocation (replace every placeholder and response path with schema-confirmed values):\n \\`\\`\\`javascript\n async function() {\n const lookup = await wix.request({\n scope: \"site\",\n method: \"POST\",\n url: \"https://www.wixapis.com/<query-endpoint>\",\n body: { query: { cursorPaging: { limit: 100 } } }\n });\n const target = lookup.data.items.find(item => item.name === \"Exact name\");\n if (!target) return { ok: false, reason: \"NOT_FOUND\" };\n\n const mutation = await wix.request({\n scope: \"site\",\n method: \"PATCH\",\n url: \\`https://www.wixapis.com/<update-endpoint>/\\${target.id}\\`,\n body: { item: { id: target.id, revision: target.revision, name: \"New name\" } }\n });\n const updatedId = mutation.data.item.id;\n const verification = await wix.request({\n scope: \"site\",\n method: \"GET\",\n url: \\`https://www.wixapis.com/<get-endpoint>/\\${updatedId}\\`\n });\n return { id: updatedId, verifiedName: verification.data.item.name };\n }\n \\`\\`\\`\n`;\n\nconst EXECUTE_WIX_API_ACCOUNT_EXAMPLE = dedent`\n Example \u2014 account-level request:\n \\`\\`\\`javascript\n async function() {\n const response = await wix.request({\n scope: \"account\",\n method: \"POST\",\n url: \"https://www.wixapis.com/<account-level-endpoint>\",\n body: {\n query: {\n cursorPaging: { limit: 50 }\n }\n }\n });\n return response.data;\n }\n \\`\\`\\`\n`;\n\nconst EXECUTE_WIX_API_MULTI_SITE_EXAMPLE = dedent`\n EXAMPLE \u2014 independent work for an already resolved set of sites:\n \\`\\`\\`javascript\n async function() {\n const siteTargets = [{ id: \"<site-id>\", name: \"<site-name>\" }];\n const outcomes = await Promise.allSettled(\n siteTargets.map(site => wix.request({\n scope: \"site\",\n siteId: site.id,\n method: \"GET\",\n url: \"https://www.wixapis.com/<site-endpoint>\"\n }).then(response => ({ siteId: site.id, name: site.name, value: response.data.confirmedField })))\n );\n return outcomes.map((outcome, index) => outcome.status === \"fulfilled\"\n ? { ok: true, ...outcome.value }\n : { ok: false, siteId: siteTargets[index].id, name: siteTargets[index].name, error: String(outcome.reason) });\n }\n \\`\\`\\`\n`;\n\nexport const executeWixApiDescription = dedent`\n ${EXECUTE_WIX_API_INTRO}\n\n ${EXECUTE_WIX_API_WQL}\n\n ${EXECUTE_WIX_API_ORCHESTRATION}\n\n ${EXECUTE_WIX_API_BULK}\n\n ${ACCOUNT_SITE_EXECUTE_SCOPE}\n\n ${EXECUTE_WIX_API_OUTPUT_AND_ERRORS}\n\n ${EXECUTE_WIX_API_ACCOUNT_EXAMPLE}\n\n ${EXECUTE_WIX_API_DEPENDENT_EXAMPLE}\n\n ${EXECUTE_WIX_API_MULTI_SITE_EXAMPLE}\n`;\n\nexport function buildToolDescriptions(\n includeReadme: boolean\n): Record<string, string> {\n const reminder = buildSystemReminder(includeReadme);\n return {\n WixREADME: dedent`\n # Tool: WixREADME\n **Directive:** \\`WixREADME\\` is the **MANDATORY FIRST STEP** for all Wix-related tasks. Its output (including relevant linked documents) provides foundational context for all other Wix tools. Adherence to this protocol is **NON-NEGOTIABLE**.\n\n **Mid-conversation site switching:** If the user references a different site by name or ID after WixREADME has already been called, use \\`GetSiteContext\\` directly \u2014 no need to call WixREADME again.\n ${reminder}\n `,\n\n SearchWixRESTDocumentation: dedent`\n **Searches the official Wix REST API documentation \u2014 the starting point for any Wix REST API task.** Unless you already have the exact method \\`docsUrl\\` in context, begin the task here; this is how you discover the right endpoint. Reach for it before \\`SearchWixAPISpec\\`, and avoid writing code that scans or filters \\`lightIndex\\` to find an endpoint (e.g. \\`lightIndex.filter(...)\\`, \\`lightIndex.flatMap(...)\\`, or substring-matching on \\`docsUrl\\`/\\`name\\`/\\`summary\\`) \u2014 that has no relevance ranking and silently misses composite and method-level operations. This is the ranked semantic-search discovery tool over the Wix REST API docs: describe your intent in natural language and it returns the matching REST endpoints/methods (with their \\`docsUrl\\`) ranked by relevance. It is the first step whenever you need to do something on a Wix site via HTTP and don't already have the exact \\`docsUrl\\` in context \u2014 for creating, reading, updating, or deleting any kind of Wix entity, across every business domain.\n It covers all Wix REST domains equally \u2014 Stores, eCommerce/orders, Bookings, CRM/contacts, Members, CMS/data collections, Events, Blog, Forms, Marketing, Media, site settings, SEO, and the rest. Just describe the resource, action, or goal in plain words (e.g. 'add a catalog item with inventory', 'book a service', 'update a data collection item', 'create a discount', 'list contacts', 'get site details endpoint', 'REST authentication'); the ranking handles matching your wording to the right API regardless of domain.\n **Next step after this tool:** take the \\`docsUrl\\` it returns and inspect that method's exact request/response schema with \\`SearchWixAPISpec\\` (\\`getResourceSchemaByUrl(docsUrl)\\`), then execute. \\`SearchWixAPISpec\\` is only for INSPECTING a \\`docsUrl\\` you already have \u2014 it is NOT a discovery tool. Skipping this step to hand-search \\`lightIndex\\` yourself is a mistake: raw index filtering has no relevance ranking and misses operations this ranked search finds. Discover here first, every time.\n If you can't find what you need, rephrase your search term or use a bigger maxResults value.\n ${reminder}\n `,\n\n ReadFullDocsArticle: dedent`\n Fetches the full Wix docs article or method article with code examples for using the method.\n Docs articles looks like this: https://dev.wix.com/docs/... and they can either be general docs articles or method articles.\n For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.\n ${reminder}\n `,\n\n ReadFullDocsMethodSchema: dedent`\n Fetches the full method schema for a given method.\n This will give you the entire request/response schema with all the fields and their descriptions.\n For REST API methods, prefer SearchWixAPISpec when it is available: it can fetch and inspect the exact method schema by docs URL, return the request/response shape, and inspect selected nested component schemas without dumping unrelated fields. Use ReadFullDocsMethodSchema for REST only when SearchWixAPISpec is unavailable or did not provide the needed detail.\n For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.\n ${reminder}\n `,\n\n CallWixSiteAPI: dedent`\n Call Wix apis on a business or site. Use this to create, read, update, and delete data and other Wix entities in your Wix site.\n Site-level: this tool reads and writes inside the single site named by the required \\`siteId\\`.\n **Prefer using the \"ListWixSites\" tool when the user asks to list or show their sites.** Only use this tool for site listing if the user needs advanced filtering or specific site details beyond what ListWixSites provides.\n For POST/PATCH/PUT requests, pass the request body as a JSON object or array in the \"body\" parameter with all the required fields and values as described in the API schema, code examples, or docs you retrieved (e.g. body: {\"name\": \"value\", \"nested\": {\"key\": \"value\"}} or body: [{\"key\": \"value\"}]).\n Before accessing fields on a response object, know the exact shape \u2014 don't guess paths like \\`result.id\\` when the actual path might be \\`result.results[0].item.id\\`. If you fetched the method schema for the request body, include \\`method.responses\\` at the same time \u2014 it costs nothing and tells you exactly what fields come back.\n The API endpoint url param MUST ALWAYS be taken from the conversation context.\n By conversation context we mean the endpoint url was given in the user prompt OR got into the conversation context ${includeReadme ? 'by the \"WixREADME\" tool OR ' : ''}by the \"SearchWixRESTDocumentation\" tool OR by the \"BrowseWixRESTDocsMenu\" tool OR by the \"ReadFullDocsArticle\" tool.\n Error Handling:\n If the error is related to missing installed app or \"WDE0110: Wix Code not enabled\", you should install the missing app\n **Note:** there is no need to check if an app is installed/ Wix Code enabled in advance, just call the API and handle the error if it occurs, the API error message will state it clearly.\n For any other error, use your default error handling mechanism\n Allowed API urls are: wix.com, dev.wix.com, manage.wix.com, editor.wix.com, wixapis.com\n Docs urls like https://dev.wix.com/docs/... are not api urls, if you want to read the docs, use the \"ReadFullDocsArticle\" tool\n ${reminder}\n `,\n\n ListWixSites: dedent`\n **Use this tool whenever the user asks to list, show, get, or find their Wix sites.** This is the dedicated tool for listing Wix sites for the current user. By default it returns all sites, but you can filter by name.${includeReadme ? '\\n\\n**Do NOT use WixREADME before this tool.** When the user asks to list their sites, call this tool directly \u2014 no need to read documentation first.' : ''}\n\n **Prefer this tool over CallWixSiteAPI for listing sites.** Call this tool directly \u2014 it already knows the correct API and handles everything needed. Only fall back to CallWixSiteAPI if the user needs advanced filtering or specific site details beyond what this tool provides.\n ${reminder}\n `,\n\n GetSiteContext: dedent`\n Fetches deep context for a specific Wix site and returns it as structured markdown.\n\n **Call this tool when** the user references a specific site by name. Pass the site name directly as \\`siteName\\` \u2014 this tool resolves the name internally. **Do NOT call ListWixSites first to look up the site ID.** Use \\`siteId\\` only when you already have it from a previous step.\n\n **Output sections** (use these to answer questions without extra API calls):\n - **Site**: ID, URL, published/draft status, premium plan, editor type, Velo enabled, created/updated dates\n - **Properties**: language, country, timezone, currency, contact email/phone\n - **Apps**: installed app names, IDs, and catalog version (e.g. Wix Stores V1 vs V3 \u2014 check this before calling any Stores endpoint)\n - If the site cannot be resolved for the current user, the tool will return a clear \"no context found\" message instead of account or partner details\n ${reminder}\n `,\n\n ManageWixSite: dedent`\n Use account level API in order to create a site and update a site.\n Account-level only: this tool acts on the account itself, or on sites as objects within it, and sends no site context. Anything that reads or writes inside a site is site-level and does not belong here \u2014 use a site-level tool with that site's \\`siteId\\`.\n For POST/PATCH/PUT requests, pass the request body as a JSON object or array in the \"body\" parameter with all the required fields and values as described in the API schema, code examples, or docs you retrieved (e.g. body: {\"name\": \"value\", \"nested\": {\"key\": \"value\"}} or body: [{\"key\": \"value\"}]).\n The API endpoint url param MUST ALWAYS be taken from the conversation context.\n By conversation context we mean the endpoint url was given in the user prompt or got into the conversation context ${includeReadme ? 'by the \"WixREADME\" tool or ' : ''}by the \"SearchWixRESTDocumentation\" tool or by the \"BrowseWixRESTDocsMenu\" tool or by the \"ReadFullDocsArticle\" tool.\n ${reminder}\n `,\n\n UploadImageToWixSite: dedent`\n Upload one or more images to a Wix site's Media Manager. Returns wixstatic.com URL and media ID.\n Do NOT use ExecuteWixAPI or code execution for image uploads \u2014 use this tool directly.\n\n REQUIRED: a valid target siteId (UUID). If the user has not clearly specified which site,\n ASK them which site to upload to (or use ListWixSites to help them choose) BEFORE calling.\n NEVER call this tool with a missing, empty, or guessed siteId \u2014 ask first instead.\n\n Parameters \u2014 provide image input via image and/or imageUrls, OR imageBase64:\n \u2022 image (array): chat file ATTACHMENTS. Each item is an object with download_url and file_id (both required), plus optional file_name and mime_type. Pass ALL attachments in one call.\n \u2022 imageUrls (array): plain public image URLs the user pasted or other tools produced (no file_id). Pass ALL URLs in one call. Can be combined with image.\n \u2022 imageBase64 (string): base64-encoded image + mimeType. One image at a time. Do NOT combine with image/imageUrls.\n\n Delivering the bytes \u2014 this is where uploads most often fail:\n \u2022 NEVER pass a local or sandbox file path (e.g. /mnt/..., /home/user/..., /Users/...) in any field \u2014 the server cannot reach your filesystem. Use a public http(s) URL (imageUrls) or the complete base64 (imageBase64).\n \u2022 imageBase64 must be the WHOLE file, not truncated. For large images prefer imageUrls, since long base64 is easily cut off and will be rejected as unreadable.\n `,\n\n SupportAndFeedback: dedent`\n Send the user's feedback about the experience of building with Wix \u2014 the Wix MCP tools, APIs, docs, and tooling \u2014 to Wix, attributed to the authenticated user.\n This is meta-feedback about building with Wix; it is NOT a support channel and not for the user's own site content.\n\n When to offer it (user-approved only \u2014 NEVER auto-send):\n - The user explicitly asks to send feedback / report something to Wix (\"tell Wix that...\", \"report this\", \"send feedback\"). Then just confirm the wording and send.\n - The user complains, is frustrated, or reports a Wix bug in the course of the work (\"this API is broken\", \"the docs are wrong\", \"why is this so hard\"). Acknowledge, then offer to pass it on.\n - The session hit substantial friction \u2014 repeated API failures, wrong/missing docs, a tooling dead end, or a workaround you had to invent. When you notice the pattern, offer: \"This tripped us up a few times \u2014 want me to send it to Wix as feedback?\"\n\n When you offer, invite the user to add anything in their own words \u2014 whatever they give you goes into the message verbatim.\n\n What to send \u2014 a summary of the whole run, not just the last error. Structure it in four layers:\n 1. Provenance \u2014 agent/model; Wix tooling used; platform/hosting; Wix areas/APIs touched; Wix products; project type/frontend; site id; relevant links (dashboard, docs pages, live site, repos); skill areas/recipes involved; other ids created this run.\n 2. Narrative \u2014 user intent and run summary (what they set out to build, what worked vs. what fought back); a condensed play-by-play of the session (key exchanges, tool calls, decisions, course-corrections).\n 3. Friction points \u2014 for each friction point: the step/endpoint, HTTP status and error message, the gap, the workaround you had to invent, and what you expected instead. Include ones you recovered from silently \u2014 a retry that eventually worked is exactly the signal Wix wants.\n 4. Attribution \u2014 per friction point, where the fault likely lives: API behavior / API schema / API reference docs / docs articles or examples / Wix tooling / other/unsure. Don't force a tag; \"unsure\" beats a wrong route.\n End with a bottom line: one or two sentences on the single most important problem and its impact \u2014 a plain engineering assessment, not softened or hedged.\n\n **IMPORTANT**: This tool actually sends the message to Wix. Confirm the final wording with the user and call it only after an explicit yes.\n Do not send on a single transient error, and never more than once for the same issue. Feedback cannot be replied to or tracked by the user.\n `,\n\n BrowseWixRESTDocsMenu: dedent`\n Browse the Wix REST API documentation menu hierarchy.\n Alternative to SearchWixRESTDocumentation - use this to explore and discover APIs by navigating the menu structure instead of searching by keywords.\n - Omit the \\`menuUrl\\` param to see top-level categories\n - Pass a \\`menuUrl\\` param to drill into a category - copy the URL from previous responses\n Example \\`menuUrl\\` param values for main Wix verticals:\n - Stores: \"https://dev.wix.com/docs/api-reference/business-solutions/stores\"\n - Bookings: \"https://dev.wix.com/docs/api-reference/business-solutions/bookings\"\n - CMS: \"https://dev.wix.com/docs/api-reference/business-solutions/cms\"\n - CRM: \"https://dev.wix.com/docs/api-reference/crm\"\n - eCommerce: \"https://dev.wix.com/docs/api-reference/business-solutions/e-commerce\"\n - Events: \"https://dev.wix.com/docs/api-reference/business-solutions/events\"\n - Blog: \"https://dev.wix.com/docs/api-reference/business-solutions/blog\"\n - Pricing Plans: \"https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans\"\n - Restaurants: \"https://dev.wix.com/docs/api-reference/business-solutions/restaurants\"\n - Media: \"https://dev.wix.com/docs/api-reference/assets/media\"\n - Site Properties: \"https://dev.wix.com/docs/api-reference/business-management/site-properties\"\n ${reminder}\n `,\n\n WixSiteCreation: dedent`\n ${SITE_GUIDANCE}\n\n Opens the in-chat Wix site creation chooser as an interactive widget where the user chooses between \"Build with AI\" and \"Pick a template.\"\n\n **Once you can tell what the site is for, call this tool directly** \u2014 no ${includeReadme ? 'WixREADME, skill,' : 'skill'} or docs search first.${includeReadme ? ' Any other Wix request still starts with WixREADME as usual.' : ''}\n\n Call this for normal new Wix site creation requests when the user's site intent is clear, but they have not chosen AI, templates, or Wix Studio.\n Do not guess, and never default to AI \u2014 even after the user answers a clarifying question about the site's purpose or features.\n This chooser is how the builder choice gets made \u2014 never ask in chat whether they want AI or a template; that choice is made in the widget.\n The widget also does the creating: once the user picks, it runs that path itself and the site is created there, so never call \\`WixSiteBuilder\\`, \\`SearchSiteTemplates\\`, or \\`CreateSiteFromTemplate\\` yourself after opening it.\n After calling, reply with the message it returns, which presents both options and the next steps.\n\n Do not call this if the user explicitly asks to build with AI; call \\`WixSiteBuilder\\` instead.\n Do not call this if the user asks for templates or Wix Studio; call \\`SearchSiteTemplates\\` instead.\n\n When calling this tool, infer \\`customActions\\` from the user's request so the reply can be tailored \u2014 2-3 concrete, industry-specific setup actions for the site (see the input's guidance).\n\n After calling, you MUST speak the message provided in the tool result to the user as your reply \u2014 do not stay silent and do not replace it with a one-line pointer to the widget. Write out ALL of it, word for word: its opening line (the \"Ready to set up your \u2026 site?\" question INCLUDING \"Choose your path in the widget above:\"), BOTH of its option bullets, and its \"Next up:\" line, each on its own line and in that order. Do not summarize, shorten, drop any line, invent your own opener, rename the options, or add an intro or outro.\n `,\n\n 'import-claude-design-from-url': dedent`\n Import a design into Wix from a publicly fetchable URL. The file is a self-contained HTML bundle with all images, fonts, and styles inlined. Creates a live Wix-hosted site and returns its URL.\n `,\n\n RunWixCliCommand: dedent`\n Executes Wix CLI commands for Wix app development and management.\n Use this tool to run commands like 'wix app generate' (adds new extensions), 'wix app build' (builds your app), 'wix app preview' (creates shareable preview), 'wix app release' (releases a new version of your app), and more.\n\n IMPORTANT: Before using this tool, check if the command is mapped in package.json scripts:\n * Use this tool for npm/yarn scripts that map to Wix CLI commands as well.\n * Do not use this tool for starting the local development server.\n \n Before using this tool, you MUST search the Wix documentation for the command you want to run.\n \n DO NOT USE THIS TOOL FOR ANY OTHER PURPOSE. IT IS ONLY FOR WIX CLI COMMANDS.\n `,\n\n VeloREADME: dedent`\n This tool is set for providing Velo context in order to be used by the agent for executing Velo-related tasks.\n `,\n\n SearchWixCLIDocumentation: dedent`\n Searches the Wix CLI documentation for website development and CLI commands.\n Use this tool when you need information about Wix CLI commands, local development workflows, or CLI-based website development.\n Specify what you need information about (e.g., 'wix dev command', 'local development setup', 'CLI authentication', 'wix deploy').\n If you can't find what you need, try to rephrase your search term or use bigger maxResults value.\n ${reminder}\n `,\n\n SearchWixWDSDocumentation: dedent`\n Searches the Wix Design System (WDS) documentation.\n `,\n\n SearchWixSDKDocumentation: dedent`\n Searches the Wix JavaScript SDK documentation.\n `,\n\n SearchBuildAppsDocumentation: dedent`\n Searches the Wix Build Apps documentation.\n `,\n\n SearchOverviewDocumentation: dedent`\n Searches high-level Wix platform and business overview documentation.\n `,\n\n SearchWixHeadlessDocumentation: dedent`\n Searches the Wix Headless documentation.\n `,\n\n // Note: The raw schema also contains sdkData (JS SDK package name, namespace, and\n // code examples) but it's intentionally omitted from the tool description. Currently\n // this MCP is focused on REST API calls via ExecuteWixAPI. We may want to expose\n // sdkData in the future \u2014 needs further thought on use cases and presentation.\n SearchWixAPISpec: dedent`\n Inspect the Wix REST API spec by writing JavaScript code that runs in a sandboxed read-only environment.\n **Precondition:** you already have a method \\`docsUrl\\` \u2014 from \\`SearchWixRESTDocumentation\\`, \\`BrowseWixRESTDocsMenu\\`, \\`ReadFullDocsArticle\\`, ${includeReadme ? 'a `WixREADME` recipe, ' : ''}or a prior tool result / the user's message in this conversation. If you don't have one yet, call \\`SearchWixRESTDocumentation\\` FIRST to discover it; do not use this tool to search for or choose an endpoint.\n **Never pass a \\`docsUrl\\` you produced from memory.** If the exact URL you are about to pass to \\`getResourceSchemaByUrl\\` did not appear verbatim in an earlier tool result (or the user's message), it is a guess \u2014 call \\`SearchWixRESTDocumentation\\` first and use a URL from its ranked results. A guessed URL that merely looks plausible routinely resolves to the WRONG sibling method (e.g. \\`.../products-v3/create-product\\` when the task needs \\`.../products-v3/create-product-with-inventory\\`), sending the whole turn down a dead end. When in doubt, discover \u2014 don't guess.\n **This tool's job is to INSPECT the exact schema of a method you have ALREADY located \u2014 its request/response shape, nested types, and enums. It is NOT a discovery tool for choosing which method to use.**\n With a method \\`docsUrl\\` in hand, call \\`getResourceSchemaByUrl(methodDocsUrl)\\` to get the resource schema, then read the target method from \\`schema.methods\\` and resolve any nested \\`{ $circular: name }\\` types via \\`schema.components.schemas[name]\\`.\n **If you don't already have a \\`docsUrl\\` in context, your FIRST action MUST be \\`SearchWixRESTDocumentation\\` (ranked semantic search) \u2014 not this tool.** Then pass the resulting \\`docsUrl\\` to \\`getResourceSchemaByUrl\\` here. Do NOT discover endpoints by hand-filtering or scanning \\`lightIndex\\` (e.g. \\`lightIndex.filter(...)\\` / \\`lightIndex.flatMap(...)\\` on a substring): it has no relevance ranking, matches only at resource-name granularity, and misses composite or method-level operations whose parent resource is named after a different noun than your intent. \\`lightIndex\\` is for resolving a \\`docsUrl\\` you already have, not for finding one.\n Prefer \\`SearchWixAPISpec\\` over \\`ReadFullDocsMethodSchema\\` for REST method schemas when it is available, especially once you already have a docs URL from semantic search, menu browsing, or conversation context.\n\n Prefer URL-first results:\n - If you have a docs URL or partial docs URL, search \\`resource.docsUrl\\` and \\`method.docsUrl\\` first.\n - If you have a method docs URL and need the request/response shape, call \\`getResourceSchemaByUrl(methodDocsUrl)\\` in this tool and return the selected method schema directly.\n - For API execution, return and use \\`method.publicUrl\\` when available. It is the preferred executable \\`https://www.wixapis.com/...\\` URL.\n - Return \\`docsUrl\\` for relevant resources/methods when the next step needs an article or API call source URL; do not hand off to \\`ReadFullDocsMethodSchema\\` just to inspect a REST method schema.\n - Use \\`resourceId\\` only as the internal handle for low-level loaders; prefer URL helpers when you have a docs URL.\n - \\`getResourceSchemaByUrl\\` resolves only **API resource/method** docs (e.g. \\`.../bookings/services/services-v2/create-service\\`). It does NOT work on **skill** pages (\\`.../skills/...\\`) or **article** pages \u2014 those have no schema. For an article, use \\`getArticleContentByUrl(docsUrl)\\`. Never pass a \\`.../skills/...\\` URL (skill recipes often cross-link sibling skill pages) \u2014 use \\`SearchWixRESTDocumentation\\` to find the real API method instead. If a lookup misses, don't retry the same URL; rediscover it with \\`SearchWixRESTDocumentation\\`.\n\n Your code has access to these globals:\n\n **lightIndex** \u2014 Current lightweight REST API resource array:\n \\`\\`\\`typescript\n interface LightIndex extends Array<LightResource> {\n updatedAt?: string; // ISO timestamp for when spec sync generated this index\n }\n\n interface LightResource {\n name: string; // resource display name, e.g. \"<Resource> V3\"\n resourceId: string; // internal handle for getResourceSchema()\n docsUrl: string; // e.g. \"https://dev.wix.com/docs/api-reference/.../<resource>\"\n menuPath: string[]; // e.g. [\"business-solutions\", \"<vertical>\", \"<resource>\"]\n methods: Array<{\n operationId: string; // e.g. \"wix.<vertical>.v3.<Api>.<Operation>\"\n summary: string; // human-readable method name\n httpMethod: string; // \"get\" | \"post\" | \"patch\" | \"delete\"\n path: string; // partial relative path, e.g. \"/v3/<resources>\"\n docsUrl?: string; // e.g. \"https://dev.wix.com/docs/api-reference/.../query-products\"\n publicUrl?: string; // preferred executable URL for ExecuteWixAPI, when available after spec sync\n publicBaseUrl?: string;\n description: string; // truncated to 200 chars\n }>;\n }\n \\`\\`\\`\n\n **getResourceSchemaByUrl(docsUrl)** and **getResourceSchema(resourceId)** return the full schema for a resource:\n \\`\\`\\`typescript\n interface FullSchema {\n title: string;\n description: string;\n fqdn: string;\n docsUrl?: string;\n methods: Array<{\n summary: string;\n description: string;\n operationId: string;\n httpMethod: string;\n path: string;\n docsUrl?: string;\n publicUrl?: string; // Preferred executable URL for ExecuteWixAPI, e.g. \"https://www.wixapis.com/...\"\n publicBaseUrl?: string; // Public Wix APIs base URL used to derive publicUrl\n servers: Array<{ url: string }>; // Base URLs (e.g. \"https://www.wixapis.com/...\")\n requestBody: object | null;\n responses: object;\n parameters: Array<object>;\n permissions: string[];\n legacyExamples: Array<{ // Curl examples\n content: { title: string; request: string; response: string };\n }>;\n }>;\n components: { schemas: object };\n }\n \\`\\`\\`\n\n **articles** \u2014 Array of all Wix documentation articles (~1000 guides, tutorials, concepts):\n \\`\\`\\`typescript\n interface LightArticle {\n name: string; // e.g. \"About the Wix API Query Language\"\n resourceId: string;\n docsUrl: string; // e.g. \"https://dev.wix.com/docs/api-reference/articles/...\"\n menuPath: string[]; // e.g. [\"work-with-wix-apis\", \"data-retrieval\", \"about-the-wix-api-query-language\"]\n description: string; // first ~200 chars of the article content\n }\n \\`\\`\\`\n\n **getResourceSchemaByUrl(docsUrl)** \u2014 Async function returning the full schema for the resource or method docs URL. Nested types appear as \\`{ $circular: name }\\` pointers into \\`components.schemas\\`; resolve them via \\`schema.components.schemas[name]\\`.\n\n **getResourceSchema(resourceId)** \u2014 Lower-level async function returning the full schema for a resource ID. Prefer \\`getResourceSchemaByUrl(docsUrl)\\` when you have a docs URL.\n\n **getArticleContentByUrl(docsUrl)** \u2014 Async function returning the full markdown content of an article docs URL (string).\n\n **getArticleContent(resourceId)** \u2014 Lower-level async function returning the full markdown content of an article resource ID. Prefer \\`getArticleContentByUrl(docsUrl)\\` when you have a docs URL.\n\n Articles and API resources share the same menuPath hierarchy. Use menuPath to find related articles and APIs within the same domain.\n\n Your code MUST be an \\`async function()\\` expression that returns a value.\n\n Top-level verticals: business-solutions (stores, e-commerce, bookings, events, restaurants, pricing-plans, coupons), crm (contacts, members, loyalty-program, forms, community), business-management (payments, invoices, automations), assets (media, files), app-management (oauth, billing), account-level, site.\n\n Important schema guidance:\n - For ExecuteWixAPI, ALWAYS use \\`method.publicUrl\\`. It is the complete, executable \\`https://www.wixapis.com/...\\` URL for that method. When \\`publicUrl\\` is present, never build the execution URL by hand and never expose any other field as \"the endpoint\".\n - Do not use \\`method.servers[0]\\` to build execution URLs. \\`method.servers\\` includes internal Wix hosts such as \\`www.wix.com\\`, \\`manage.wix.com\\`, and editor hosts.\n - \\`method.path\\` is a PARTIAL, relative path (e.g. \\`/v2/coupons/query\\`). It OMITS the gateway prefix that the real URL requires: many APIs are served under a prefix such as \\`/stores\\` or \\`/ecom\\` (for example, \\`path\\` \\`/v2/coupons/query\\` is actually served at \\`https://www.wixapis.com/stores/v2/coupons/query\\`). Prepending \\`https://www.wixapis.com\\` to \\`method.path\\` will 404 for these APIs. Treat \\`method.path\\` as a matching/debugging key only \u2014 never as an execution URL, and never surface it as the endpoint of a method.\n - If \u2014 and only if \u2014 \\`publicUrl\\` is absent and you must construct the URL: recover the gateway prefix from \\`method.publicBaseUrl\\` (it is the segment(s) before the API version, e.g. \\`https://www.wixapis.com/stores/v2/coupons\\` \u2192 prefix \\`/stores\\`) and build \\`https://www.wixapis.com\\` + prefix + \\`method.path\\`. Do NOT simply concatenate \\`publicBaseUrl\\` + \\`path\\`; they overlap on the version/resource segments and would duplicate them.\n - Do not exact-match full Wix API URLs against \\`method.path\\`.\n - If you already have a docs URL, match it against \\`resource.docsUrl\\`/\\`method.docsUrl\\` first. Only as a fallback \u2014 when \\`SearchWixRESTDocumentation\\` is unavailable \u2014 filter \\`lightIndex\\` at method granularity across \\`method.summary\\`, \\`method.operationId\\`, \\`method.description\\`, and \\`method.docsUrl\\`, not just \\`resource.name\\`.\n - Schemas use \\`{ \"$circular\": \"TypeName\" }\\` to reference a type defined in \\`schema.components.schemas\\`. The marker appears both in method bodies and *inside dictionary entries themselves*, so a looked-up type's nested fields may contain further \\`$circular\\` refs. **The \\`schema.components.schemas\\` dictionary returned in THIS call is complete \u2014 every \\`$circular\\` name resolves against it right here. Resolve every ref your task needs in this one call; do NOT make another \\`SearchWixAPISpec\\` call just to read a type you already have.** Expand **as much or as little as you need**, not the whole schema:\n - Partial / targeted: from the \\`schema.components.schemas\\` you already have, look up only the specific types on the path you care about, e.g. \\`[\"\u2026SeoSchema\"]\\` then its \\`settings\\` type \\`[\"\u2026SeoSchema.Settings\"]\\` (see the \"Expand selected nested schema refs\" example) \u2014 all in the same call.\n - Recursive: expand an entire subtree when you really need it (see the \\`expandRefs\\` example), but keep depth small and avoid dumping huge fully-expanded schemas.\n - When inspecting a specific method schema (i.e. you have found a single method and are returning its details), always include \\`responses: method.responses\\` alongside \\`requestBody\\`. Knowing the response shape up front prevents speculative re-runs of mutations just to see what the API returned.\n - Query/search methods: the declared map is \\`method.queryMethodData.queryFieldsCapabilitiesMap\\`, or \\`method.searchMethodData.searchFieldsCapabilitiesMap\\` on search methods. Each entry declares one field's allowed \\`operators\\` and \\`sort\\` directions \u2014 a closed list, valid for that method alone, so another endpoint's map or a field's presence in the response proves nothing here. Each listed operator is valid on its own \u2014 a field takes one \u2014 so combine conditions with the logical operators instead: \\`$and\\` and \\`$or\\` take an array of expressions, \\`$not\\` takes one, and they can nest. They are WQL syntax rather than a field capability, so they never appear in the map, and its silence about them is no restriction. An undeclared field or unlisted operator are rejected; some endpoints instead ignore the filter or sort and return the wrong rows. \\`sort: []\\` means not sortable; no map means nothing is declared, so try what you need and filter in code if it isn't supported.\n\n Examples:\n\n Inspect one method schema by exact docs URL:\n \\`\\`\\`javascript\n async function() {\n const methodUrl = \"https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products\";\n\n const schema = await getResourceSchemaByUrl(methodUrl);\n const method = schema.methods.find(method => method.docsUrl === methodUrl);\n\n if (!method) {\n return {\n message: \"Found the resource, but no exact method URL match. Returning available methods.\",\n resourceDocsUrl: schema.docsUrl,\n methods: schema.methods.map(method => ({\n title: method.summary,\n docsUrl: method.docsUrl,\n httpMethod: method.httpMethod.toUpperCase(),\n publicUrl: method.publicUrl\n }))\n };\n }\n\n return {\n title: method.summary,\n docsUrl: method.docsUrl,\n resourceDocsUrl: schema.docsUrl,\n publicUrl: method.publicUrl,\n publicBaseUrl: method.publicBaseUrl,\n httpMethod: method.httpMethod.toUpperCase(),\n operationId: method.operationId,\n permissions: method.permissions,\n parameters: method.parameters,\n requestBody: method.requestBody,\n responses: method.responses,\n // Query methods: which fields are filterable (allowed operators) and sortable.\n queryFieldsCapabilities: method.queryMethodData?.queryFieldsCapabilitiesMap,\n // Search methods carry the same thing under their own key \u2014 read both, they never overlap.\n searchFieldsCapabilities: method.searchMethodData?.searchFieldsCapabilitiesMap,\n curlExamples: method.legacyExamples?.map(example => example.content)\n };\n }\n \\`\\`\\`\n\n Inspect one resource by resource docs URL:\n \\`\\`\\`javascript\n async function() {\n const resourceUrl = \"https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3\";\n\n const schema = await getResourceSchemaByUrl(resourceUrl);\n\n return {\n resource: schema.title,\n docsUrl: schema.docsUrl,\n description: schema.description,\n methods: schema.methods.map(method => ({\n title: method.summary,\n docsUrl: method.docsUrl,\n httpMethod: method.httpMethod.toUpperCase(),\n publicUrl: method.publicUrl,\n operationId: method.operationId\n }))\n };\n }\n \\`\\`\\`\n\n Inspect one method from a partial docs URL:\n \\`\\`\\`javascript\n async function() {\n const partialUrl = \"stores/catalog-v3/products-v3/query-products\";\n\n const resource = lightIndex.find(resource =>\n resource.docsUrl.includes(partialUrl) ||\n resource.methods.some(method => method.docsUrl?.includes(partialUrl))\n );\n\n if (!resource) return \"No API resource found for this partial docs URL\";\n\n const schema = await getResourceSchemaByUrl(\n resource.methods.find(method => method.docsUrl?.includes(partialUrl))?.docsUrl ??\n resource.docsUrl\n );\n const method = schema.methods.find(method =>\n method.docsUrl?.includes(partialUrl)\n );\n\n if (!method) {\n return {\n message: \"Found the resource, but no exact method match.\",\n resource: resource.name,\n resourceDocsUrl: resource.docsUrl,\n methods: schema.methods.map(method => ({\n title: method.summary,\n docsUrl: method.docsUrl,\n httpMethod: method.httpMethod.toUpperCase(),\n publicUrl: method.publicUrl\n }))\n };\n }\n\n return {\n title: method.summary,\n docsUrl: method.docsUrl,\n resource: resource.name,\n resourceDocsUrl: resource.docsUrl,\n httpMethod: method.httpMethod.toUpperCase(),\n publicUrl: method.publicUrl,\n publicBaseUrl: method.publicBaseUrl,\n requestBody: method.requestBody,\n responses: method.responses,\n curlExamples: method.legacyExamples?.map(example => example.content)\n };\n }\n \\`\\`\\`\n\n Expand selected nested schema refs:\n \\`\\`\\`javascript\n async function() {\n const methodUrl = \"https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products\";\n const schema = await getResourceSchemaByUrl(methodUrl);\n const method = schema.methods.find(method => method.docsUrl === methodUrl);\n\n return {\n title: method.summary,\n docsUrl: method.docsUrl,\n requestBody: method.requestBody,\n selectedNestedTypes: {\n product: schema.components.schemas[\"com.wix.stores.catalog.product.api.v3.Product\"],\n cursorPaging: schema.components.schemas[\"wix.stores.catalog.v3.upstream.wix.common.CursorPaging\"],\n sorting: schema.components.schemas[\"wix.stores.catalog.v3.upstream.wix.common.Sorting\"]\n }\n };\n }\n \\`\\`\\`\n\n Advanced: bounded recursive expansion for one method. Use only when top-level schema and selected nested refs are not enough; keep depth small because schemas can become very large.\n \\`\\`\\`javascript\n async function() {\n const methodUrl = \"https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products\";\n const schema = await getResourceSchemaByUrl(methodUrl);\n const method = schema.methods.find(method => method.docsUrl === methodUrl);\n\n function expandRefs(value, depth = 0, seen = []) {\n if (depth > 3) return value;\n if (Array.isArray(value)) return value.map(item => expandRefs(item, depth, seen));\n if (!value || typeof value !== \"object\") return value;\n\n if (value.$circular) {\n const refName = value.$circular;\n if (seen.includes(refName)) return { $ref: refName, circular: true };\n\n const target = schema.components?.schemas?.[refName];\n if (!target) return { $ref: refName, missing: true };\n\n return {\n $ref: refName,\n schema: expandRefs(target, depth + 1, seen.concat(refName))\n };\n }\n\n return Object.fromEntries(\n Object.entries(value).map(([key, nested]) => [\n key,\n expandRefs(nested, depth, seen)\n ])\n );\n }\n\n return {\n title: method.summary,\n docsUrl: method.docsUrl,\n httpMethod: method.httpMethod.toUpperCase(),\n publicUrl: method.publicUrl,\n requestBody: expandRefs(method.requestBody),\n responses: expandRefs(method.responses)\n };\n }\n \\`\\`\\`\n\n You do NOT discover endpoints in this tool. When you don't have a \\`docsUrl\\`, call \\`SearchWixRESTDocumentation\\` first, then inspect the method it points you to \u2014 pass its \\`docsUrl\\` to \\`getResourceSchemaByUrl\\` and read the method from \\`schema.methods\\`:\n \\`\\`\\`javascript\n // docsUrl came from SearchWixRESTDocumentation (or conversation context) \u2014 NOT from scanning lightIndex.\n async function() {\n const docsUrl = \"https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products\";\n const schema = await getResourceSchemaByUrl(docsUrl);\n const method = schema.methods.find(m => m.docsUrl === docsUrl);\n return {\n publicUrl: method.publicUrl,\n httpMethod: method.httpMethod.toUpperCase(),\n requestBody: method.requestBody,\n responses: method.responses\n };\n }\n \\`\\`\\`\n `,\n\n ExecuteWixAPI: executeWixApiDescription,\n\n WixSiteBuilder: dedent`\n ${SITE_GUIDANCE}\n\n Tool for generating a Wix site with AI (creating / building a site in Wix Harmony).\n\n Call this ONLY when the user's own words name AI (for example \"create a site using AI\" or \"build it with AI\") and the site intent is clear. A description of what the site should do \u2014 reservations, online ordering, a store, bookings, menus, a portfolio, and the like \u2014 is NOT a request for AI and NOT enough to call this tool; never infer AI from features or industry.\n Never default to this tool: if the user hasn't explicitly named AI, don't call this tool \u2014 ${SITE_CREATION_COPY.unstatedMethod.nonWidget}.\n\n For templates or Wix Studio, call \\`SearchSiteTemplates\\`; for a specific template by \\`metaSiteId\\` or \\`templateId\\`, call \\`CreateSiteFromTemplate\\`; for a headless or classic Wix Editor site, or manual/account-API creation, call \\`CreateWixBusinessGuide\\`.\n\n Do NOT suggest HTML code, prompt templates, or alternative approaches \u2014 actually build the site through this tool.\n `,\n\n SearchSiteTemplates: dedent`\n ${SITE_GUIDANCE}\n\n Searches Wix templates and shows the template gallery, from the Harmony or the Studio template source.\n\n Call this ONLY when the user's own words ask for a template or for Wix Studio (for example \"start from a template\", \"show me some templates\", \"build it in Wix Studio\") and you can already tell what the site is for. If they mention Wix Studio, search Studio templates; otherwise search Harmony templates.\n ${SITE_CREATION_COPY.templatePick.nonWidget}\n\n A description of what the site should do \u2014 bookings, a store, a menu, a portfolio, and the like \u2014 is NOT a request for templates or for Wix Studio; never infer either from features or industry. Templates are not the default: if the site intent is clear but no method is named, do not guess \u2014 ${SITE_CREATION_COPY.unstatedMethod.nonWidget}.`,\n\n CreateSiteFromTemplate: dedent`\n Creates a Wix site from a specific template (by \\`metaSiteId\\` or \\`templateId\\`), publishes it when possible, and shows a live preview with links to the editor and the published site.\n\n Call this when the user provides a specific template by \\`metaSiteId\\` or \\`templateId\\`. Use this only when the user gives a valid \\`metaSiteId\\` or \\`templateId\\` directly. To browse or choose a template first, call \\`SearchSiteTemplates\\`.\n\n `,\n\n CreateWixBusinessGuide: dedent`\n Provides comprehensive documentation for creating a new Wix business (site, app, etc.).\n Call this ONLY when the user explicitly asks for a headless site, a Wix Classic Editor site, or manual/advanced account/API-based site creation \u2014 these don't need the site's purpose first. For normal site-creation ${SITE_CREATION_COPY.normalCreationRoute.nonWidget}; for a specific template id, call \\`CreateSiteFromTemplate\\`.\n\n ## What This Tool Contains\n\n This tool provides complete documentation including:\n - Template selection (empty sites or designed templates)\n - Wix Editor vs Wix Studio options\n - Regular vs Headless site creation (CLI-based; returns setup instructions)\n - API endpoint details and parameters\n - Post-creation steps (OAuth for headless, publishing for regular sites)\n - App installation instructions\n\n ## After Reading This Documentation\n\n **After reading this documentation:**\n 1. Use ManageWixSite for account-level site creation API calls\n 2. Use CallWixSiteAPI / ExecuteWixAPI for site-level follow-up API calls (like install apps if needed)`\n };\n}\n\n/**\n * Canonical (README-inclusive) tool descriptions used by the live MCP server and\n * all existing importers.\n */\nexport const defaultToolDescriptions: Record<string, string> =\n buildToolDescriptions(true);\n\nexport const executeCodeModeToolDescriptions: Record<string, string> = {\n ExecuteWixAPI: executeWixApiDescription\n};\n\nconst recipesIndexDoc: ReadmeDocConfig = {\n url: 'https://dev.wix.com/docs/api-reference/articles/ai-tools/wix-mcp/skills/wix-management-recipes-index',\n action: 'include'\n};\n\nconst README_INTRO = dedent`\n <agent-mandatory-instructions>\n\n YOU MUST READ AND FOLLOW THE AGENT-MANDATORY-INSTRUCTIONS BELOW:\n\n <source-of-truth>\n Do not answer from memory about anything Wix-specific \u2014 this covers every part of your answer, not only API calls: any URL, link, ID, setting location, or product fact you give the user must come from the docs tools, the recipes below, a previous tool result in this conversation, or the user's own message (identifiers and URLs the user supplies are fine to use as given). If a recipe in the index below matches what the user asked for, read it before answering. For APIs, use the search, browse, read-docs, and schema tools as the source of truth for the exact URL, HTTP method, request body shape, response shape, field names, required fields, and enum values before calling an API.\n </source-of-truth>\n\n <management-flow>\n <goal>\n`;\n\nconst README_FLOWS_HEADING = dedent`\n </goal>\n\n ## Wix MCP Site Management Flows\n`;\n\nconst README_BODY = dedent`\n ### Discovery & Call Flow\n\n Common paths (use the highest you can satisfy for each method you'll call):\n - Already have what you need from previous tool results in this conversation (not from memory) \u2192 ExecuteWixAPI\n - Pick a matching article from the Recipes index below \u2192 ReadFullDocsArticle (find relevant code examples) \u2192 (probe SearchWixAPISpec for response shapes if needed) \u2192 ExecuteWixAPI\n - SearchWixRESTDocumentation or BrowseWixRESTDocsMenu \u2192 ReadFullDocsArticle (find relevant code examples) \u2192 (probe SearchWixAPISpec for response shapes if needed) \u2192 ExecuteWixAPI\n - SearchWixRESTDocumentation or BrowseWixRESTDocsMenu \u2192 ReadFullDocsArticle (no usable example) \u2192 SearchWixAPISpec for request schemas \u2192 ExecuteWixAPI\n\n Fallbacks: use ReadFullDocsMethodSchema in place of SearchWixAPISpec when SearchWixAPISpec is unavailable or didn't return enough detail; use CallWixSiteAPI in place of ExecuteWixAPI when a single REST call is enough and code adds no value.\n\n Tools (relevant for the management flow):\n - SearchWixRESTDocumentation \u2014 semantic search over the Wix REST docs by keywords or natural-language queries.\n - BrowseWixRESTDocsMenu \u2014 navigate the Wix REST docs by menu hierarchy; alternative to keyword search.\n - ReadFullDocsArticle \u2014 fetch a full docs article by its docs URL; returns prose, fields, and code examples.\n - SearchWixAPISpec \u2014 JS-sandboxed query over the REST API spec; returns request schema, response schema, and the executable \\`method.publicUrl\\`.\n - ExecuteWixAPI \u2014 runs an async JS function in a sandbox with \\`wix.request()\\`; a single invocation can chain multiple API calls, paginate, loop, transform, and branch.\n\n Steps:\n\n 1. A single user task may need one or more API methods. For each method you'll call, find a code example that fits the user's intent \u2014 you'll model the API call (URL, method, body) on it. An example only \"fits\" if it is **complete** (not truncated) AND matches your exact case \u2014 same operation and same variant/shape (e.g. the same \\`productType\\`), with every field your case needs actually shown. **If the closest example is truncated (it shows a \\`... N more lines ...\\` marker), do NOT call the API off it; continue discovery first: \\`ReadFullDocsArticle\\` for the complete example, or \\`SearchWixAPISpec\\` for the exact request schema.** Never fill in required fields from memory. Skip this step for any method you already have from a previous tool result in this conversation (not from memory):\n a. First try the WixREADME Recipes index below (pre-curated guides for common tasks). If a recipe matches, ReadFullDocsArticle on its docs URL to find relevant code examples; many recipes cover multi-step flows and supply code examples for several methods in one article.\n b. If no recipe matches the user's intent, or the matched recipe didn't yield the code examples you need, discover each missing method's docs URL via SearchWixRESTDocumentation (semantic search) or BrowseWixRESTDocsMenu (menu hierarchy), then ReadFullDocsArticle on each to find relevant code examples.\n c. If neither path turns up a usable code example for some method, continue without one for that method \u2014 step 2 will derive its request directly from the schema. Make sure you've still captured the docs URL of each method.\n\n 2. Before calling, fill any remaining gaps with SearchWixAPISpec on each method's docs URL. It returns both request and response schemas. For each method, check:\n - **Request** (URL, HTTP method, body fields) \u2014 skip the probe if a code example already shows them; otherwise SearchWixAPISpec returns publicUrl + exact request shape.\n - **Response shape** (field paths your code will read) \u2014 only relevant if your code reads response fields; skip the probe if the article(s) already made it clear; otherwise probe SearchWixAPISpec for the response schema.\n - **Filter and sort** (query/search methods only) \u2014 an example proves only the fields and operators it uses. Each method declares which fields it can filter and sort by, and with which operators; that list is closed for fields and their operators and covers that method only \u2014 \\`$and\\`/\\`$or\\`/\\`$not\\` are filter syntax and never appear in it. Anything else errors or silently returns the wrong rows. A listed operator is valid on its own, since a field takes a single operator; to combine conditions, use the logical operators instead \u2014 \\`$and\\` and \\`$or\\` take an array of expressions, \\`$not\\` takes one, and they can nest.\n - Never guess any of this from memory.\n\n 3. Before calling: collapse ALL planned steps \u2014 preliminary reads AND mutations \u2014 into a single async function. Step numbers in any guide or skill doc describe logical order for human comprehension \u2014 they do NOT define invocation boundaries. Steps that feed into each other belong in a single invocation: read, use the result, write, and return. A read that fetches IDs or checks existence before a create/update is part of that mutation's invocation, not a separate preceding call. This includes any read whose result feeds directly into a subsequent write \u2014 fetching a required ID, checking whether a record already exists, listing items to choose one \u2014 all belong in the same invocation as the write that follows. Set hasMutations: true whenever any step in the function writes. Return the mutation response directly \u2014 do not follow up with a read to confirm what was just created or updated; trust the response. Only split into multiple invocations when a later step genuinely depends on information you cannot resolve in code (e.g. a user decision or an out-of-band event). A single invocation can chain several related calls, paginate, \"list all\", loop, transform, and branch on responses.\n\n </management-flow>\n\n <other-uses>\n Beyond managing user sites, the Wix MCP tools can be used for any other purpose they support \u2014 for example, reading Wix SDK docs to write code against the SDK, using the Wix CLI to create apps, answering documentation questions, and so on.\n </other-uses>\n </agent-mandatory-instructions>\n`;\n\n/**\n * Default readme docs - content for WixREADME tool response.\n * Assumes both ExecuteWixAPI and SearchWixAPISpec are available (execute-and-search mode).\n *\n * Joined rather than interpolated into one `dedent` \u2014 `dedent` reads indentation from the literal\n * parts only, so a multi-line interpolation gets flattened.\n */\nexport const defaultReadmeDocs: ReadmeDocConfig[] = [\n {\n action: 'text',\n content: [\n README_INTRO,\n AGENT_GOAL,\n README_FLOWS_HEADING,\n '',\n README_BODY\n ].join('\\n')\n },\n recipesIndexDoc\n];\n\n/**\n * Merge base config with overrides\n * @param base - Base configuration\n * @param overrides - Partial overrides to apply\n * @returns Merged configuration\n */\nexport function mergeConfig(\n base: ModeDefaultConfig,\n overrides: Partial<ModeDefaultConfig>\n): ModeDefaultConfig {\n return {\n toolDescriptions: {\n ...base.toolDescriptions,\n ...overrides.toolDescriptions\n },\n disableTools: [...base.disableTools, ...(overrides.disableTools ?? [])],\n enableTools: [...base.enableTools, ...(overrides.enableTools ?? [])],\n readmeDocs: overrides.readmeDocs ?? base.readmeDocs,\n toolHints: { ...base.toolHints, ...overrides.toolHints },\n docsTools: overrides.docsTools ?? base.docsTools,\n getToKnowWixEnabled:\n overrides.getToKnowWixEnabled ?? base.getToKnowWixEnabled,\n createWixBusinessGuideEnabled:\n overrides.createWixBusinessGuideEnabled ??\n base.createWixBusinessGuideEnabled,\n codeModeEnabled: overrides.codeModeEnabled ?? base.codeModeEnabled,\n maxResponseSize: overrides.maxResponseSize ?? base.maxResponseSize,\n dynamicContextEnabled:\n overrides.dynamicContextEnabled ?? base.dynamicContextEnabled,\n partnerContextEnabled:\n overrides.partnerContextEnabled ?? base.partnerContextEnabled,\n usePlatformizedSearch:\n overrides.usePlatformizedSearch ?? base.usePlatformizedSearch,\n skillsPrOverrideEnabled:\n overrides.skillsPrOverrideEnabled ?? base.skillsPrOverrideEnabled\n };\n}\n\n/**\n * Default config - used by both /mcp and /v2 endpoints\n * All tools enabled, all descriptions, good readmeDocs\n */\nexport const defaultConfig: ModeDefaultConfig = {\n toolDescriptions: defaultToolDescriptions,\n disableTools: [],\n enableTools: [],\n readmeDocs: defaultReadmeDocs,\n // docsTools not set - defaults to all docs tools in addDocsTools()\n getToKnowWixEnabled: true,\n createWixBusinessGuideEnabled: true,\n dynamicContextEnabled: true,\n partnerContextEnabled: true,\n usePlatformizedSearch: true,\n skillsPrOverrideEnabled: true\n};\n\n/**\n * Delta for clients that declared the MCP-Apps UI extension. Merged over the mode config at\n * request time, since the mode override and the widget variant have to compose.\n */\nexport const widgetSiteCreationConfig: Pick<\n ModeDefaultConfig,\n 'toolDescriptions'\n> = {\n toolDescriptions: Object.fromEntries(\n [\n 'WixSiteBuilder',\n 'WixSiteCreation',\n 'SearchSiteTemplates',\n 'CreateSiteFromTemplate',\n 'CreateWixBusinessGuide'\n ].map((tool) => [tool, toWidget(defaultToolDescriptions[tool])])\n )\n};\n", "// Wix app IDs \u2192 human-readable names.\n// Loaded at runtime from known-apps.json (passed in by getDynamicContext).\n// Only apps present in this map are shown; others are silently ignored (whitelist).\nexport type KnownApps = Record<string, string>;\n\nexport interface EnrichDynamicContextOptions {\n includePartnerContext?: boolean;\n includeAccountContext?: boolean;\n /** Cap the number of sites rendered. When more sites exist, a note is added. */\n maxSites?: number;\n /**\n * Total number of sites on the account (e.g. from CountSites). Used to decide\n * whether to show the \"more sites available\" note and its exact count. Falls\n * back to the number of sites returned in the response when omitted.\n */\n totalSiteCount?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Response types\n// ---------------------------------------------------------------------------\n\ninterface DynamicContextResponse {\n account?: Account;\n sites?: Site[];\n pagingMetadata?: PagingMetadata;\n partnerContext?: PartnerContext;\n}\n\ninterface PartnerContext {\n partner?: boolean;\n dashboardSiteId?: string;\n dashboardUrl?: string;\n}\n\ninterface PagingMetadata {\n cursors?: { next?: string; prev?: string };\n count?: number;\n}\n\ninterface Account {\n id?: string;\n createdDate?: string;\n updatedDate?: string;\n displayName?: string;\n status?: string;\n coBranding?: string;\n}\n\ninterface SiteProperties {\n locale?: { languageCode?: string; country?: string };\n language?: string;\n paymentCurrency?: string;\n timeZone?: string;\n email?: string;\n phone?: string;\n}\n\ninterface CmsField {\n key?: string;\n displayName?: string;\n type?: string;\n description?: string;\n systemField?: boolean;\n referencedCollection?: string;\n}\n\ninterface CmsCollection {\n id?: string;\n displayName?: string;\n fields?: CmsField[];\n}\n\ninterface Site {\n id?: string;\n displayName?: string;\n url?: string;\n createdDate?: string;\n updatedDate?: string;\n published?: boolean;\n premium?: boolean;\n ownerAccountId?: string;\n editorType?: string;\n namespace?: string;\n domainConnected?: boolean;\n installedApps?: InstalledApp[];\n veloEnabled?: boolean;\n properties?: SiteProperties;\n cmsCollections?: CmsCollection[];\n}\n\ninterface InstalledApp {\n appId?: string;\n catalogVersion?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Snake_case \u2192 camelCase normalizer (Wix API returns snake_case)\n// ---------------------------------------------------------------------------\n\nfunction snakeToCamel(obj: unknown): unknown {\n if (Array.isArray(obj)) return obj.map(snakeToCamel);\n if (obj !== null && typeof obj === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n const camelKey = key.replace(/_([a-z])/g, (_, c) => c.toUpperCase());\n result[camelKey] = snakeToCamel(value);\n }\n return result;\n }\n return obj;\n}\n\n// ---------------------------------------------------------------------------\n// Formatting helpers\n// ---------------------------------------------------------------------------\n\nfunction formatTimestamp(value: string | undefined): string {\n if (!value) return '';\n try {\n const date = new Date(value);\n return date.toLocaleDateString('en-US', {\n month: 'short',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n timeZone: 'UTC'\n });\n } catch {\n return value;\n }\n}\n\nfunction capitalize(s: string): string {\n if (!s) return s;\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n// ---------------------------------------------------------------------------\n// Section renderers\n// ---------------------------------------------------------------------------\n\nfunction renderAccountHeader(account: Account): string {\n const lines: string[] = [];\n\n if (account.displayName) {\n lines.push(`**Account**: ${account.displayName}`);\n }\n if (account.id) {\n lines.push(`**Account ID**: \\`${account.id}\\``);\n }\n\n const meta: string[] = [];\n if (account.status) meta.push(`Status: **${account.status}**`);\n if (\n account.coBranding &&\n account.coBranding !== 'None' &&\n account.coBranding !== 'CO_BRANDING_UNSPECIFIED'\n ) {\n meta.push('Co-branded');\n }\n if (meta.length) lines.push(meta.join(' \u00B7 '));\n\n if (account.createdDate) {\n let dateLine = `**Created**: ${formatTimestamp(account.createdDate)}`;\n if (account.updatedDate) {\n dateLine += ` \u00B7 **Updated**: ${formatTimestamp(account.updatedDate)}`;\n }\n lines.push(dateLine);\n }\n\n return lines.length ? lines.join('\\n') : '';\n}\n\nfunction hasPartnerContext(\n partnerContext: PartnerContext | undefined\n): partnerContext is PartnerContext {\n return partnerContext?.partner === true;\n}\n\nfunction\nrenderPartnerContext(\n partnerContext: PartnerContext | undefined\n): string {\n if (!hasPartnerContext(partnerContext)) return '';\n\n const dashboardUrl = partnerContext.dashboardUrl;\n const dashboardSiteId = partnerContext.dashboardSiteId;\n const lines = [\n '## Partner Account',\n '',\n 'This user is a **Wix Partner** \u2014 a professional who creates, manages, or maintains Wix sites and digital assets at scale. Wix Partners fall into one of these types:',\n '',\n '- **Agency / Freelancer**: Web professionals managing client sites from Wix Studio. Members of the Wix Partner Program.',\n '- **Channel Partner (DIY)**: Businesses that resell Wix subscriptions; customers build their own sites. No edit access to customer sites.',\n '- **Channel Partner (DIFM)**: Businesses that create and maintain Wix sites in large numbers for their customers.',\n '- **Enterprise Partner**: Large organizations needing advanced features and support for building and maintaining websites.',\n ];\n\n if (dashboardUrl) {\n lines.push(\n `**Partner Dashboard**: [${dashboardUrl}](${dashboardUrl})`\n );\n }\n if (dashboardSiteId) {\n lines.push(\n `**Partner Dashboard Site ID**: \\`${dashboardSiteId}\\``\n );\n }\n\n if (dashboardUrl) {\n lines.push(\n '',\n '**Account-level features** (accessible across all managed sites):',\n `- [Contacts](${dashboardUrl}/contacts)`,\n `- [Inbox](${dashboardUrl}/inbox)`,\n `- [Meetings](${dashboardUrl}/wix-meetings)`,\n `- [Triggers](${dashboardUrl}/triggers)`\n );\n }\n\n if (dashboardSiteId) {\n lines.push(\n '',\n `**API access**: Account-level Wix APIs (contacts, inbox, etc.) are scoped to the Partner Dashboard site. When calling these APIs via \\`CallWixSiteAPI\\`, use site ID \\`${dashboardSiteId}\\`.`\n );\n }\n\n return lines.join('\\n');\n}\n\nfunction renderStatusBadges(site: Site): string {\n const tags: string[] = [];\n tags.push(site.published ? 'Published' : 'Draft');\n if (site.premium != null) tags.push(site.premium ? 'Plan: Premium' : 'Plan: Free');\n if (site.domainConnected) tags.push('Custom Domain');\n return tags.join(' \u00B7 ');\n}\n\nfunction renderEditorType(editorType: string | undefined): string {\n if (\n !editorType ||\n editorType === 'EDITOR_TYPE_UNSPECIFIED' ||\n editorType === 'UNKNOWN'\n ) {\n return '';\n }\n return capitalize(editorType.replace(/_/g, ' ').toLowerCase());\n}\n\nfunction renderApps(apps: InstalledApp[], knownApps: KnownApps): string {\n const relevant = apps\n .filter((a) => a.appId && knownApps[a.appId])\n .sort((a, b) =>\n (knownApps[a.appId!] ?? '').localeCompare(knownApps[b.appId!] ?? '')\n );\n\n if (!relevant.length) return '';\n\n const lines: string[] = [];\n for (const app of relevant) {\n let line = `- **${knownApps[app.appId!]}** (ID: \\`${app.appId}\\`)`;\n if (app.catalogVersion) {\n line += ` \u2014 Catalog app version: **${app.catalogVersion}**`;\n }\n lines.push(line);\n }\n\n return lines.join('\\n');\n}\n\nfunction renderProperties(props: SiteProperties): string {\n const sections: string[] = [];\n\n // Locale & Region\n const locale: string[] = [];\n if (props.language) locale.push(`- Language: **${props.language}**`);\n if (props.locale?.country) locale.push(`- Country: **${props.locale.country}**`);\n if (props.timeZone) locale.push(`- Timezone: **${props.timeZone}**`);\n if (props.paymentCurrency) locale.push(`- Currency: **${props.paymentCurrency}**`);\n if (locale.length) {\n sections.push(`**Locale & Region**\\n${locale.join('\\n')}`);\n }\n\n // Contact\n const contact: string[] = [];\n if (props.email) contact.push(`- Email: **${props.email}**`);\n if (props.phone) contact.push(`- Phone: **${props.phone}**`);\n if (contact.length) {\n sections.push(`**Contact**\\n${contact.join('\\n')}`);\n }\n\n return sections.join('\\n\\n');\n}\n\nfunction renderCmsCollections(collections: CmsCollection[]): string {\n const nonEmpty = collections.filter(\n (c) => c.displayName || (c.fields && c.fields.length > 0)\n );\n if (!nonEmpty.length) return '';\n\n const lines: string[] = [];\n for (const col of nonEmpty) {\n const name = col.displayName ?? col.id ?? 'Unnamed';\n lines.push(`- **${name}**`);\n\n const customFields = (col.fields ?? []).filter((f) => !f.systemField);\n if (customFields.length) {\n for (const field of customFields) {\n const fieldName = field.displayName ?? field.key ?? '';\n let fieldLine = ` - ${fieldName}`;\n if (field.type) fieldLine += ` (\\`${field.type}\\`)`;\n if (field.referencedCollection) {\n fieldLine += ` \u2192 \\`${field.referencedCollection}\\``;\n }\n lines.push(fieldLine);\n }\n }\n }\n\n return lines.join('\\n');\n}\n\nfunction renderSite(site: Site, index: number, knownApps: KnownApps): string {\n const lines: string[] = [];\n\n const heading = site.displayName ?? `Site ${index}`;\n lines.push(`## ${index}. ${heading}`);\n lines.push('');\n\n if (site.id) lines.push(`**ID**: \\`${site.id}\\``);\n if (site.url) lines.push(`**URL**: [${site.url}](${site.url})`);\n lines.push(`**Status**: ${renderStatusBadges(site)}`);\n const editorLabel = renderEditorType(site.editorType);\n if (editorLabel) lines.push(`**Editor Type**: ${editorLabel}`);\n if (site.createdDate) {\n let dateLine = `**Created**: ${formatTimestamp(site.createdDate)}`;\n if (site.updatedDate) {\n dateLine += ` \u00B7 **Updated**: ${formatTimestamp(site.updatedDate)}`;\n }\n lines.push(dateLine);\n }\n if (site.veloEnabled !== undefined && site.veloEnabled !== null) {\n lines.push(`**Velo**: ${site.veloEnabled ? 'Enabled' : 'Disabled'}`);\n }\n\n if (site.properties) {\n const propsContent = renderProperties(site.properties);\n if (propsContent) {\n lines.push('');\n lines.push('### Properties');\n lines.push('');\n lines.push(propsContent);\n }\n }\n\n const appsContent = renderApps(site.installedApps ?? [], knownApps);\n if (appsContent) {\n lines.push('');\n lines.push('### Apps');\n lines.push('');\n lines.push(appsContent);\n }\n\n lines.push('');\n lines.push('---');\n lines.push('');\n\n return lines.join('\\n');\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\nexport function enrichDynamicContext(\n data: unknown,\n knownApps: KnownApps = {},\n options: EnrichDynamicContextOptions = {}\n): string {\n let parsed: unknown = data;\n if (typeof data === 'string') {\n try {\n parsed = JSON.parse(data);\n } catch {\n return data;\n }\n }\n\n if (parsed === null || parsed === undefined) return '';\n if (typeof parsed !== 'object') return '';\n\n const response = snakeToCamel(parsed) as DynamicContextResponse;\n const includePartnerContext = options.includePartnerContext ?? false;\n const includeAccountContext = options.includeAccountContext ?? false;\n const sections: string[] = [];\n\n const allSites = response.sites ?? [];\n const maxSites = options.maxSites ?? Infinity;\n const sitesToRender = allSites.slice(0, maxSites);\n const siteCount = sitesToRender.length;\n // Total across the account (from CountSites); fall back to what the API returned.\n const totalSiteCount = options.totalSiteCount ?? allSites.length;\n const hasNext = Boolean(response.pagingMetadata?.cursors?.next);\n const hasMoreSites = totalSiteCount > siteCount || hasNext;\n\n const partnerSection = includePartnerContext\n ? renderPartnerContext(response.partnerContext)\n : '';\n\n // Only render the top-level header and site count when there are actual sites\n const hasSiteData = Boolean(siteCount);\n if (hasSiteData) {\n sections.push('# My Wix Sites Context');\n sections.push('');\n }\n\n // Account header\n if (includeAccountContext && response.account) {\n const accountSection = renderAccountHeader(response.account);\n if (accountSection) {\n sections.push(accountSection);\n }\n }\n\n if (partnerSection) {\n sections.push(partnerSection);\n sections.push('');\n sections.push('---');\n sections.push('');\n }\n\n if (hasSiteData) {\n let countLine = `_Showing ${siteCount} site${siteCount === 1 ? '' : 's'}`;\n if (hasMoreSites) {\n countLine +=\n totalSiteCount > siteCount\n ? ` of ${totalSiteCount} total`\n : ' (more available)';\n }\n countLine += '_';\n sections.push(countLine);\n sections.push('');\n\n if (hasMoreSites) {\n sections.push(\n `> **This account has more than the ${siteCount} sites shown above.** To load context for any site not listed here, call \\`GetSiteContext\\` with its \\`siteName\\` or \\`siteId\\`.`\n );\n sections.push('');\n }\n\n sections.push('---');\n sections.push('');\n }\n\n // Check if any site has a catalog version \u2014 add a single top-level note\n const hasCatalogVersion = sitesToRender.some((site) =>\n site.installedApps?.some((app) => app.appId && knownApps[app.appId] && app.catalogVersion)\n );\n if (hasCatalogVersion) {\n sections.push(\n '> **Wix Stores \u2014 Catalog Version**: Some sites below have Wix Stores installed and show their catalog version (V1/V3). When working on a Stores task, check the version for that site \u2014 only read recipes and call endpoints that match its version. Never open a Catalog V3 recipe or call a `/stores/v3/` endpoint on a CATALOG_V1 site, and vice versa.'\n );\n sections.push('');\n }\n\n // Sites\n if (sitesToRender.length) {\n for (let i = 0; i < sitesToRender.length; i++) {\n sections.push(renderSite(sitesToRender[i], i + 1, knownApps));\n }\n }\n\n // If there's absolutely nothing useful, return empty\n if (\n !response.account &&\n !siteCount &&\n (!includePartnerContext || !hasPartnerContext(response.partnerContext))\n ) {\n return '';\n }\n\n return sections.join('\\n');\n}\n", "export { enrichDynamicContext } from './enrich.js';\nexport type { EnrichDynamicContextOptions, KnownApps } from './enrich.js';\n\nimport knownApps from './known-apps.json';\n\nconst DYNAMIC_CONTEXT_URL =\n 'https://dev.wix.com/_api/dynamic-context/v1/dynamic-context';\n\nconst COUNT_SITES_URL =\n 'https://www.wixapis.com/site-list/v2/sites/count';\n\nconst MAX_SITES_FOR_DYNAMIC_CONTEXT = 10;\n\nconst DYNAMIC_CONTEXT_PETRI_OVERRIDE = 'shouldReturnDynamicContextInMCP#B';\n\nexport type DynamicContextHeaders = Record<string, string>;\n\nexport interface DynamicContextAuth {\n getAccountAuthHeaders: (\n accountId?: string\n ) => Promise<DynamicContextHeaders> | DynamicContextHeaders;\n}\n\nexport interface DynamicContextHttpClient {\n request: (config: Record<string, unknown>) => Promise<{ data: unknown }>;\n}\n\nexport interface DynamicContextFilter {\n siteId?: string;\n siteName?: string;\n}\n\nfunction mergePetriOverride(\n existingOverrides: string | undefined,\n override: string\n): string {\n const overrides = (existingOverrides ?? '')\n .split(',')\n .map((value) => value.trim())\n .filter(Boolean);\n\n if (!overrides.includes(override)) {\n overrides.push(override);\n }\n\n return overrides.join(',');\n}\n\n/**\n * Fetch dynamic context from the Wix API and return it as enriched markdown.\n * Returns empty string on failure.\n */\nexport async function getDynamicContext(\n auth: DynamicContextAuth,\n httpClient: DynamicContextHttpClient,\n filter?: DynamicContextFilter,\n options?:\n | boolean\n | {\n partnerContextEnabled?: boolean;\n includeAccountContext?: boolean;\n }\n): Promise<string> {\n const { enrichDynamicContext } = await import('./enrich.js');\n const contextOptions =\n typeof options === 'boolean'\n ? {\n partnerContextEnabled: options,\n includeAccountContext: options\n }\n : options;\n const includePartnerContext = contextOptions?.partnerContextEnabled ?? false;\n const includeAccountContext = contextOptions?.includeAccountContext ?? false;\n\n try {\n const accountHeaders = await auth.getAccountAuthHeaders();\n const noFilter = !filter?.siteId && !filter?.siteName;\n\n const fetchTotalSiteCount = async (): Promise<number | undefined> => {\n try {\n const countResponse = await httpClient.request({\n url: COUNT_SITES_URL,\n method: 'POST',\n headers: {\n ...accountHeaders,\n 'Content-Type': 'application/json'\n },\n data: {}\n });\n const totalSiteCount = (countResponse.data as { count?: number })\n ?.count;\n if (\n totalSiteCount &&\n totalSiteCount > MAX_SITES_FOR_DYNAMIC_CONTEXT\n ) {\n console.log(\n `[dynamic-context-enricher] Account has ${totalSiteCount} sites; rendering first ${MAX_SITES_FOR_DYNAMIC_CONTEXT} with a \"more sites\" note`\n );\n }\n return totalSiteCount;\n } catch (countError) {\n console.error(\n `[dynamic-context-enricher] CountSites failed, proceeding without count: ${(countError as Error).message}`\n );\n return undefined;\n }\n };\n\n const totalSiteCountPromise: Promise<number | undefined> = noFilter\n ? fetchTotalSiteCount()\n : Promise.resolve(undefined);\n\n const body: Record<string, unknown> = {};\n if (filter?.siteId) body.site_id = filter.siteId;\n else if (filter?.siteName) body.site_name = filter.siteName;\n\n const dynamicContextPromise = httpClient.request({\n url: DYNAMIC_CONTEXT_URL,\n method: 'POST',\n headers: {\n ...accountHeaders,\n 'Content-Type': 'application/json',\n 'Petri_ovr': mergePetriOverride(\n accountHeaders.Petri_ovr,\n DYNAMIC_CONTEXT_PETRI_OVERRIDE\n ),\n 'X-Wix-Office': '1',\n },\n data: body\n });\n\n const [totalSiteCount, response] = await Promise.all([\n totalSiteCountPromise,\n dynamicContextPromise\n ]);\n\n const context = enrichDynamicContext(response.data, knownApps, {\n includePartnerContext,\n includeAccountContext,\n // Cap the account-wide view to the first N sites; a targeted fetch returns one site.\n ...(noFilter\n ? { maxSites: MAX_SITES_FOR_DYNAMIC_CONTEXT, totalSiteCount }\n : {})\n });\n\n if (context) {\n return context;\n }\n\n if (filter?.siteId || filter?.siteName) {\n const target = filter.siteId\n ? `siteId \\`${filter.siteId}\\``\n : `siteName \"${filter.siteName}\"`;\n return `No site context found for the specified ${target}. This site is either not owned by the current user or we do not have any information about it.`;\n }\n\n return '';\n } catch (error) {\n console.error(\n `[dynamic-context-enricher] Fetch failed: ${(error as Error).message}`\n );\n return '';\n }\n}\n", "{\n \"deb18ef1-e0c6-4668-a7bc-4a13785eb5b7\": \"Instagram Feed\",\n \"14bcded7-0066-7c35-14d7-466cb3f09103\": \"Wix Blog\",\n \"13d21c63-b5ec-5912-8397-c3a5ddb27a97\": \"Wix Bookings\",\n \"14517e1a-3ff0-af98-408e-2bd6953c36a2\": \"Wix Chat\",\n \"333b456e-dd48-4d6b-b32b-9fd48d74e163\": \"Wix Donations\",\n \"9142e27e-2e30-4948-ad8f-7e128939efc4\": \"Wix eCommerce\",\n \"140603ad-af8d-84a5-2c80-a0f60cb47351\": \"Wix Events & Tickets\",\n \"1537b24e-29d1-6d8f-b8e1-d6860f2f70b9\": \"Wix File Share\",\n \"14ce1214-b278-a7e4-1373-00cebd1bef7c\": \"Wix Forms & Payments\",\n \"225dd912-7dea-4738-8688-4b8c6955ffc2\": \"Wix Forms\",\n \"d80111c5-a0f4-47a8-b63a-65b54d774a27\": \"Wix Gift Cards\",\n \"148c2287-c669-d849-d153-463c7486a694\": \"Wix Groups\",\n \"13ee94c1-b635-8505-3391-97919052c16f\": \"Wix Invoices\",\n \"14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9\": \"Wix Members Area\",\n \"14d84998-ae09-1abf-c6fc-3f3cace5bf19\": \"Wix Multilingual\",\n \"13bb5d67-1add-e770-a71f-001277e17c57\": \"Wix Music\",\n \"2936472a-a1ed-4ae5-9f71-614313a9f4e7\": \"Wix Online Programs\",\n \"324cf725-53d9-4bb2-b8f6-0c8ec9a77f45\": \"Wix Pay Links\",\n \"d90652a2-f5a1-4c7c-84c4-d4cdcc41f130\": \"Wix Portfolio\",\n \"1522827f-c56c-a5c9-2ac9-00f9e6ae12d3\": \"Wix Pricing Plans\",\n \"b68c2f3d-8a70-4e1f-9432-3cd1fd011965\": \"Wix Proposals\",\n \"b278a256-2757-4f19-9313-c05c783bec92\": \"Wix Restaurants Menus\",\n \"9a5d83fd-8570-482e-81ab-cfa88942ee60\": \"Wix Restaurants Orders\",\n \"215238eb-22a5-4c36-9e7b-e7c08025e04e\": \"Wix Stores\",\n \"f9c07de2-5341-40c6-b096-8eb39de391fb\": \"Wix Table Reservations\",\n \"14409595-f076-4753-8303-9a86f9f71469\": \"Wix Video\",\n \"1480c568-5cbd-9392-5604-1148f5faffa0\": \"Promote SEO\",\n \"ff5d6eb1-65e4-4f9a-8b14-64d34c12cc2e\": \"Wix Rentals\"\n}\n", "export const ALLOWED_HOSTNAMES = [\n 'wix.com',\n 'dev.wix.com',\n 'manage.wix.com',\n 'editor.wix.com',\n 'wixapis.com'\n];\n\nexport function isApiUrlAllowed(url: string) {\n let parsedUrl: URL;\n\n try {\n parsedUrl = new URL(url);\n } catch {\n return {\n isAllowed: false,\n error: `Invalid URL format: ${url}`\n };\n }\n\n const hostname = parsedUrl.hostname.replace('www.', '');\n const isAllowedHostname = ALLOWED_HOSTNAMES.some(\n (domain) => hostname === domain\n );\n\n if (!isAllowedHostname) {\n return {\n isAllowed: false,\n error: `Unsupported URL domain: ${hostname}. URL must be from one of the allowed domains: ${ALLOWED_HOSTNAMES.join(', ')}`\n };\n }\n\n return {\n isAllowed: true\n };\n}\n", "import { ALLOWED_HOSTNAMES } from '../api-call/validation.js';\n\n/**\n * Centralized parameter descriptions organized by tool.\n * Each tool has all its parameter descriptions in one place.\n */\nexport const paramDescriptions = {\n CallWixSiteAPI: {\n siteId: 'The id of the site selected using site selection tool',\n url: [\n 'The url of the api to call - ALWAYS get the API url from the Wix REST docs or from the conversation context, the URL MUST BE ABSOLUTE URL',\n 'NEVER guess the API url, ALWAYS get it from the conversation context, i.e from the user prompt or from the \"WixREADME\" tool or from the \"SearchWixRESTDocumentation\" tool or from the \"BrowseWixRESTDocsMenu\" tool or from the \"ReadFullDocsArticle\" tool',\n `Allowed API urls are: ${ALLOWED_HOSTNAMES.join(', ')}`,\n `Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the \"ReadFullDocsArticle\" tool`\n ].join('\\n'),\n method:\n 'The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)',\n body: 'The request body as a JSON object or array with all the required fields and values, including nested objects. Pass the actual value (object or array), NOT a JSON string. YOU MUST NEVER MAKE UP A BODY - the body should be based on the conversation context, i.e from the user prompt OR got into the conversation context by the \"ReadFullDocsArticle\" tool OR by the \"SearchWixAPISpec\" tool OR by the \"ReadFullDocsMethodSchema\" tool - i.e based on the API docs, a relevant recipe you read (preferably), a code example you found in the docs, a schema you read etc.. YOU MUST NEVER ASSUME YOU KNOW WHAT THE BODY SCHEMA IS WITHOUT CONCRETE EXAMPLES OR SCHEMA DEFINITIONS FROM THE CONVERSATION CONTEXT. Prefer reading relevant recipes if you have them in context for understand the body schema for API calls.',\n reason:\n 'One sentence explaining the original user request and why you are calling this API to complete it.',\n sourceDocUrl: [\n 'The URL of the documentation or recipe where you found this API endpoint.',\n 'MAKE SURE THE ENDPOINT URL IS REALLY THERE AND YOUR ARE NOT GUESSING IT !!!',\n 'Must be a valid URL like:',\n '- https://dev.wix.com/docs/api-reference/... (REST API reference docs)',\n 'Use \"user-provided\" if the user gave you the endpoint directly.',\n 'Use \"other\" ONLY IF YOU HAVE A VERY GOOD REASON TO DO SO'\n ].join('\\n')\n },\n\n ListWixSites: {\n nameSearch:\n 'optional filter by name, if not provided all sites will be returned',\n limit: 'Maximum number of sites to return per page. Default is 21.',\n cursor:\n 'Cursor for pagination. Use the nextCursor value from the previous response to fetch the next page of results.'\n },\n\n GetSiteContext: {\n siteId:\n 'The ID of the site to fetch context for. One of siteId or siteName is required. Preferred when the ID is already known.',\n siteName:\n 'The display name of the site to fetch context for. One of siteId or siteName is required. Use when the site ID is unknown.'\n },\n\n ManageWixSite: {\n url: 'The url of the api to call - ALWAYS get the information from the Wix REST docs DONT GUESS IT, the URL MUST BE ABSOLUTE URL',\n method:\n 'The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)',\n body: 'The request body as a JSON object or array with all the required fields and values, including nested objects. Pass the actual value (object or array), NOT a JSON string. YOU MUST NEVER MAKE UP A BODY - this should be based on the conversation context, i.e from the user prompt or from the \"WixREADME\" tool or from the \"SearchWixRESTDocumentation\" tool or from the \"BrowseWixRESTDocsMenu\" tool or from the \"ReadFullDocsArticle\" tool or from the \"SearchWixAPISpec\" tool or from the \"ReadFullDocsMethodSchema\" tool - i.e based on the API docs. YOU MUST NEVER ASSUME YOU KNOW WHAT THE SCHEMA IS WITHOUT CONCRETE EXAMPLES OR SCHEMA DEFINITIONS FROM THE CONVERSATION CONTEXT.',\n reason:\n 'One sentence explaining the original user request and why you are calling this account level API to complete it.'\n },\n\n ExecuteWixAPI: {\n sourceDocUrls: [\n 'The URLs of the documentation, recipes, API articles, or schema sources where you confirmed the Wix REST endpoints, HTTP methods, request body shapes, auth contexts, and required fields used by this code.',\n 'Include every docs/schema source needed for the endpoints and request shapes used in the code.',\n 'MAKE SURE THE ENDPOINT URLS AND REQUEST SHAPES ARE REALLY THERE AND YOU ARE NOT GUESSING THEM !!!',\n 'Each value must be a valid URL like:',\n '- https://dev.wix.com/docs/api-reference/... (REST API reference docs)',\n 'Use [\"user-provided\"] if the user gave you all endpoint and request details directly.',\n 'Use [\"other\"] ONLY IF YOU HAVE A VERY GOOD REASON TO DO SO'\n ].join('\\n')\n },\n\n SupportAndFeedback: {\n message: [\n 'The composed feedback message to send to Wix. Wix receives only free text, so a bare sentence is low-signal \u2014 send a summary of the whole session, not just the last error. Structure it in three layers:',\n '1. Provenance \u2014 labelled lines (omit ones that do not apply): agent/model, Wix tooling used, Wix areas/APIs touched, Wix products (stores, bookings, ...), site id, relevant links (dashboard, docs pages read, live site) and other ids created this run.',\n '2. Narrative \u2014 \"In the user\\'s words\": anything the user added when you offered, quoted verbatim (redact secrets only). Then user intent + run summary (what they set out to build, what worked vs. what fought back), a condensed play-by-play of the session (key exchanges, tool calls, decisions), and the friction points \u2014 every place something got in the way, each with specifics: the step/endpoint, HTTP status and error message, the gap, the workaround, and what you expected instead. Include issues you recovered from.',\n '3. Attribution \u2014 for each significant friction point, your best diagnosis of where the fault lives: API behavior / API schema / API reference docs / docs articles or examples / Wix tooling (MCP tools, auth flow) / other-unsure \u2014 plus whether you confirmed it or are assuming. Do not force a tag; \"unsure\" beats a wrong route.',\n 'End with a bottom line: one or two sentences naming the single most important problem and its impact \u2014 a concise engineering assessment, not softened or hedged.',\n 'Write it as a scannable few paragraphs or a short bulleted list \u2014 thorough on the friction, distilled rather than a transcript dump.',\n 'NEVER include secrets \u2014 no bearer tokens, API keys, or credentials \u2014 and no personal data beyond what the feedback needs.'\n ].join('\\n'),\n requestId:\n 'Optional request id (x-wix-request-id) returned from a failed Wix API call this feedback relates to.'\n },\n\n SearchWixWDSDocumentation: {\n searchTerm:\n 'The search term to search for in the Wix Design System Documentation',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15'\n },\n\n SearchWixRESTDocumentation: {\n searchTerm:\n 'The search term to look up in the Wix REST API Documentation \u2014 a natural-language description of the endpoint, resource, or action you need across any Wix domain (Stores, eCommerce, Bookings, CRM, Members, CMS, Events, Blog, Forms, Media, site settings, etc.), e.g. \"create a catalog item with inventory\", \"book a service\", \"update data collection items\". Match the wording to how many entities you will act on: a plural term (\"update products\") surfaces the resource\\'s bulk methods, which a singular term (\"update a product\") ranks lower or leaves out. Results are ranked by relevance, so describe the goal rather than guessing an exact API name.',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15',\n reason:\n 'One sentence describing the original user request and the task you are trying to accomplish with this search.'\n },\n\n WixBusinessFlowsDocumentation: {\n searchTerm:\n 'The search term for the required sample flow (e.g. \"setup a new business\")',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15'\n },\n\n SearchWixSDKDocumentation: {\n searchTerm: 'The search term to search for in the Wix SDK Documentation',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15'\n },\n\n SearchBuildAppsDocumentation: {\n searchTerm: 'The search term to search for in the Build Apps Documentation',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15'\n },\n\n SearchOverviewDocumentation: {\n searchTerm:\n 'The search term to search for in the Wix Overview Documentation',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15'\n },\n\n SearchWixHeadlessDocumentation: {\n searchTerm: 'The search term to search for in the Headless Documentation',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15'\n },\n\n SearchWixVeloDocumentation: {\n searchTerm: 'The search term to search for in the Velo Documentation',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15'\n },\n\n SearchWixCLIDocumentation: {\n searchTerm: 'The search term to search for in the Wix CLI Documentation',\n maxResults:\n 'The maximum number of results to return, default is 10, max is 15',\n reason:\n 'One sentence describing the original user request and the task you are trying to accomplish with this search.'\n },\n\n ReadFullDocsArticle: {\n articleUrl:\n 'The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../...' +\n ' For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include the query param ?apiView=SDK (e.g. https://dev.wix.com/docs/...?apiView=SDK).'\n },\n\n ReadFullDocsMethodSchema: {\n articleUrl:\n 'The URL of the documentation to fetch. Should be something like https://dev.wix.com/docs/.../...' +\n ' For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include the query param ?apiView=SDK (e.g. https://dev.wix.com/docs/...?apiView=SDK).',\n reason:\n 'One sentence describing the original user request, the task you are trying to accomplish, and why you need the full schema (e.g., no relevant code example found in docs or recipes).'\n },\n\n BrowseWixRESTDocsMenu: {\n menuUrl: [\n 'URL of the menu to browse. Empty/omitted returns the root menu.',\n 'Copy the URL from links in previous responses of this tool.',\n 'Example: \"https://dev.wix.com/docs/api-reference/ecommerce\" or \"https://dev.wix.com/docs/api-reference/ecommerce/catalog\"'\n ].join(' '),\n reason:\n 'One sentence describing the original user request and why you are browsing this part of the docs menu.'\n },\n\n UploadImageToWixSite: {\n siteId:\n 'The ID (UUID) of the Wix site to upload to. REQUIRED. If the user has not clearly specified which site, ASK them which site to upload to (or use ListWixSites to help them pick) BEFORE calling this tool. NEVER call this tool with a missing, empty, placeholder, or guessed siteId \u2014 ask first instead.',\n image:\n 'Array of file ATTACHMENTS the user uploaded in the chat. Each item requires download_url and file_id, and may optionally include file_name and mime_type \u2014 attached files are automatically resolved to these fields by the platform, so just include them here. For plain image URLs the user pasted, use imageUrls instead. ALWAYS pass ALL attachments together in a single call \u2014 NEVER call this tool once per image. Do NOT use together with imageBase64.',\n imageUrls:\n 'Array of publicly accessible image URLs (e.g. links the user pasted or URLs produced by other tools). Use this for plain URLs that are NOT chat attachments \u2014 no file_id is needed. ALWAYS pass ALL URLs together in a single call. Can be combined with image; do NOT use together with imageBase64.',\n imageBase64:\n 'Base64-encoded image data. Use when the client can read a file and encode it as base64. May include a data URL prefix (e.g. \"data:image/jpeg;base64,...\") or be raw base64. Do NOT use together with image.',\n mimeType:\n 'MIME type of the image (e.g. \"image/jpeg\", \"image/png\", \"image/webp\"). Required when imageBase64 does not include a data URL prefix.',\n displayName:\n 'Optional display name for the file in Media Manager. If not provided, uses the original filename.'\n },\n\n RunWixCliCommand: {\n appPath: 'The full path to the Wix CLI app to run the command on.',\n extensionType:\n 'The type of extension to generate. You MUST provide this for commands that generate extensions.',\n extensionName:\n 'The name of the extension to generate, e.g. My Dashboard Page. You MUST provide this for commands that generate extensions.',\n searchedDocs:\n 'Whether you have already searched the Wix documentation for the command you want to run.',\n command:\n \"The Wix CLI command to execute (e.g. 'wix app generate', 'wix app build', 'wix app preview', 'wix app release', etc.), or a script that maps to a Wix CLI command (e.g. 'npm run generate', 'yarn generate', etc.).\"\n }\n};\n\n/**\n * Helper to get all param descriptions for a tool.\n * Usage: const d = desc('CallWixSiteAPI'); then d.siteId, d.url, etc.\n */\nexport const desc = <T extends keyof typeof paramDescriptions>(\n toolName: T\n): (typeof paramDescriptions)[T] => paramDescriptions[toolName];\n", "import { z } from 'zod';\nimport dedent from 'dedent';\nimport { WixMcpServer } from '../wix-mcp-server.js';\nimport { fetchArticleContent, RECIPES_INDEX_URL } from './fetch-article.js';\nimport { getSkillsByPortal, GetSkillsByPortalRequest } from './fetch-skills.js';\nimport { REST_PORTAL_ID } from '../constants.js';\n// import { generateDocsNavigationTree } from './normalize-menu-content.js';\nimport {\n McpAuthenticationStrategy,\n rethrowIfUnauthorized\n} from '../auth/index.js';\nimport {\n defaultToolDescriptions,\n defaultReadmeDocs\n} from '../config/default-config.js';\nimport { getDynamicContext } from '@wix/dynamic-context-enricher';\nimport { desc } from '../config/param-descriptions.js';\n\nexport { getDynamicContext };\n\n/**\n * Configuration for a README doc entry\n */\nexport interface ReadmeDocConfig {\n url?: string;\n action: 'include' | 'index' | 'text' | 'api';\n title?: string;\n description?: string;\n content?: string;\n /** HTTP method for API calls (only used when action is 'api'). Defaults to 'GET' */\n method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n /** Request body for API calls (only used when action is 'api' with POST/PUT/PATCH) */\n body?: Record<string, unknown>;\n}\n\nexport interface AddGetToKnowTools {\n server: WixMcpServer;\n disableTools?: string[];\n toolDescriptions?: Record<string, string>;\n readmeDocs?: ReadmeDocConfig[];\n authStrategy?: McpAuthenticationStrategy;\n skillsPortalUrl?: string;\n dynamicContextEnabled?: boolean;\n partnerContextEnabled?: boolean;\n repo?: string;\n commitHash?: string;\n skillsTags?: string[];\n}\n\ninterface AddGetSiteContextTool {\n server: WixMcpServer;\n authStrategy: McpAuthenticationStrategy;\n partnerContextEnabled?: boolean;\n toolDescriptions?: Record<string, string>;\n disableTools?: string[];\n}\n\nexport function addGetSiteContextTool({\n server,\n authStrategy,\n toolDescriptions\n}: AddGetSiteContextTool) {\n const d = desc('GetSiteContext');\n server.tool(\n 'GetSiteContext',\n toolDescriptions?.['GetSiteContext'] ??\n defaultToolDescriptions.GetSiteContext,\n {\n siteId: z.string().optional().describe(d.siteId),\n siteName: z.string().optional().describe(d.siteName)\n },\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ siteId, siteName }, { httpClient }) => {\n if (!siteId && !siteName) {\n return {\n content: [\n {\n type: 'text' as const,\n text: 'Provide either siteId or siteName to identify the site.'\n }\n ]\n };\n }\n\n const filter: { siteId?: string; siteName?: string } = {};\n if (siteId) filter.siteId = siteId;\n else filter.siteName = siteName;\n\n let context: string;\n try {\n context = await getDynamicContext(authStrategy, httpClient, filter, {\n partnerContextEnabled: false,\n includeAccountContext: false\n });\n } catch (err: unknown) {\n rethrowIfUnauthorized(err);\n console.error('[GetSiteContext] getDynamicContext failed:', err);\n const msg = err instanceof Error ? err.message : String(err);\n return {\n content: [\n {\n type: 'text' as const,\n text: `Error fetching site context: ${msg}`\n }\n ]\n };\n }\n\n return {\n content: [\n {\n type: 'text' as const,\n text: context || 'No context found for the specified site.'\n }\n ]\n };\n }\n );\n}\n\nexport async function addGetToKnowTools({\n server,\n disableTools = [],\n toolDescriptions,\n readmeDocs,\n authStrategy,\n skillsPortalUrl,\n dynamicContextEnabled,\n repo,\n commitHash,\n skillsTags\n}: AddGetToKnowTools) {\n if (disableTools.includes('WixREADME')) {\n return;\n }\n\n // Use provided docs or fall back to defaults. The Recipes block is appended\n // at the end so the hand-authored agent-mandatory-instructions stay on top.\n const baseDocs = readmeDocs ?? defaultReadmeDocs;\n const baseDocsWithoutRecipes = baseDocs.filter(\n (doc) => doc.url !== RECIPES_INDEX_URL\n );\n\n server.tool(\n 'WixREADME',\n toolDescriptions?.['WixREADME'] ?? defaultToolDescriptions.WixREADME,\n {},\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async (args, { httpClient }) => {\n // The schema is intentionally argless so the LLM always calls WixREADME\n // account-wide. A specific site can still be targeted programmatically\n // (e.g. the toolkit merges `defaults.siteId` into the execution args).\n const { siteId, siteName } = args as {\n siteId?: string;\n siteName?: string;\n };\n\n const isVisitorFlow =\n skillsTags?.length === 1 && skillsTags[0] === 'visitors';\n\n // Fetch + render a single README doc entry (extracted so docs can run concurrently).\n const fetchDoc = async ({\n url,\n action,\n description,\n title,\n content,\n method,\n body\n }: ReadmeDocConfig): Promise<{ type: 'text'; text: string } | null> => {\n // Fetch auth headers before try/catch so UnauthorizedError propagates\n const accountHeaders =\n action === 'api' && authStrategy\n ? await authStrategy.getAccountAuthHeaders()\n : undefined;\n\n try {\n if (action === 'index') {\n return {\n type: 'text' as const,\n text: `## ${title}\\n\\n<urls>\\n${url}\\n</urls>\\n\\n${description ?? ''}`\n };\n }\n\n if (action === 'text') {\n const textContent = title\n ? `## ${title}\\n\\n${content ?? ''}`\n : (content ?? '');\n return {\n type: 'text' as const,\n text: textContent\n };\n }\n\n if (action === 'api') {\n if (!url) {\n throw new Error('URL is required for \"api\" action');\n }\n if (!authStrategy) {\n throw new Error(\n 'Authentication strategy is required for \"api\" action. ' +\n 'The \"api\" action cannot be used without proper authentication configuration.'\n );\n }\n\n const httpMethod = method ?? 'GET';\n\n const response = await httpClient.request({\n url,\n method: httpMethod as any,\n headers: {\n ...accountHeaders,\n ...(body ? { 'Content-Type': 'application/json' } : {})\n },\n data: httpMethod === 'GET' ? undefined : body\n });\n\n const responseText =\n typeof response.data === 'string'\n ? response.data\n : JSON.stringify(response.data, null, 2);\n\n const textContent = title\n ? `## ${title}\\n\\n${responseText}`\n : responseText;\n\n return {\n type: 'text' as const,\n text: textContent\n };\n }\n\n // action === 'include'\n if (!url) {\n throw new Error('URL is required for \"include\" action');\n }\n const fetchedContent = await fetchArticleContent(\n httpClient,\n url,\n 'article',\n true,\n skillsPortalUrl,\n repo,\n commitHash\n );\n return {\n type: 'text' as const,\n text: fetchedContent\n };\n } catch (error) {\n rethrowIfUnauthorized(error);\n const errorMsg = (error as Error).message;\n const identifier = title ?? url ?? action;\n\n if (action === 'api') {\n console.error(\n `[WixREADME] API call failed for \"${identifier}\": ${errorMsg}`\n );\n return null;\n }\n\n return {\n type: 'text' as const,\n text: `## Error loading \"${identifier}\"\\n\\nFailed to fetch content: ${errorMsg}`\n };\n }\n };\n\n // Kick off base docs, skills index, and dynamic context concurrently.\n\n // TODO: Re-enable docs navigation tree once we add caching.\n // Currently makes ~40-50 HTTP calls to dev.wix.com which adds ~6-7s latency.\n // Options: in-memory TTL cache, pre-compute at build time, or session-level cache.\n // const treeStart = Date.now();\n // const treePromise = generateDocsNavigationTree(httpClient)\n // .then((tree) => {\n // console.log(\n // `[WixREADME] Docs navigation tree generated in ${Date.now() - treeStart}ms (${tree.length} chars)`\n // );\n // return tree;\n // })\n // .catch((err) => {\n // console.error(\n // `[WixREADME] Failed to generate docs navigation tree in ${Date.now() - treeStart}ms: ${err}`\n // );\n // return '';\n // });\n\n const baseContentsPromise = Promise.all(\n baseDocsWithoutRecipes.map(fetchDoc)\n );\n\n // Fetch the skills index from the portal. In PR mode, pass repo+commitHash\n // to get the PR-aware index (includes recipes added via YAML in the PR).\n const skillsContentPromise = getSkillsByPortal(httpClient, {\n portalId: REST_PORTAL_ID,\n ...(repo && { repo }),\n ...(commitHash && { commitHash }),\n ...(skillsTags && skillsTags.length > 0 && { tags: skillsTags })\n } satisfies GetSkillsByPortalRequest).catch((err: unknown) => {\n console.error('[WixREADME] Failed to fetch skills by portal:', err);\n return null;\n });\n\n // Auto-inject site context. With no site targeted this is the account-wide\n // view: single-site accounts \"just work\", and accounts with more than the\n // cap show the first N sites plus a note to use GetSiteContext for the rest.\n // A targeted siteId/siteName (e.g. from toolkit defaults) fetches that one\n // site; ad-hoc site lookups by the LLM go through the GetSiteContext tool.\n const filter: { siteId?: string; siteName?: string } = {};\n if (siteId) filter.siteId = siteId;\n else if (siteName) filter.siteName = siteName;\n\n const dynamicContextPromise =\n dynamicContextEnabled && authStrategy\n ? getDynamicContext(\n authStrategy,\n httpClient,\n Object.keys(filter).length ? filter : undefined,\n { partnerContextEnabled: true, includeAccountContext: true }\n ).catch((err: unknown) => {\n console.error('[WixREADME] getDynamicContext failed:', err);\n return '';\n })\n : Promise.resolve('');\n\n const [baseContents, skillsContent] = await Promise.all([\n baseContentsPromise,\n skillsContentPromise\n ]);\n\n // Recipes tail: text splice on success, else fall back to the filtered-out recipes doc.\n const recipesIntro = dedent`\n Reusable how-to guides for common ${isVisitorFlow ? 'Wix site visitor' : 'Wix management'} tasks, grouped by product area. Each recipe is a Wix docs article that bundles the right endpoints, request shapes, field names, and step ordering for one real-world use case.\n\n Scan the index below and open any relevant article with \\`ReadFullDocsArticle\\`. If the article contains a code example that fits the user's intent \u2014 a **complete** example (not a truncated \\`... N more lines ...\\` snippet) that matches your exact case, same variant/shape \u2014 call the API directly. If the closest example is truncated or omits a field your case needs, do NOT call the API off it \u2014 continue discovery first: \\`ReadFullDocsArticle\\` for the complete example, or \\`SearchWixAPISpec\\` for the exact schema. On query and search methods an example proves only the fields and operators it uses; the endpoint's own declared list covers the rest. Otherwise (no fitting recipe, no usable code example, or persistent errors after retrying), fall back to docs discovery: \\`SearchWixRESTDocumentation\\` or \\`BrowseWixRESTDocsMenu\\` to find the right method, then \\`SearchWixAPISpec\\` for the exact schema.\n `;\n\n const recipesContents =\n skillsContent !== null\n ? [\n await fetchDoc({\n action: 'text' as const,\n title: isVisitorFlow ? 'Visitor Recipes' : 'Management Recipes',\n content: `${recipesIntro}\\n\\n${skillsContent}`\n })\n ]\n : await Promise.all(\n baseDocs\n .filter((doc) => doc.url === RECIPES_INDEX_URL)\n .map(fetchDoc)\n );\n\n const contents = [...baseContents, ...recipesContents];\n\n const dynamicContext = await dynamicContextPromise;\n\n const parts = [\n ...contents\n .filter(\n (item): item is { type: 'text'; text: string } => item !== null\n )\n .map((item) => item.text),\n ...(dynamicContext ? [dynamicContext] : [])\n ];\n\n const text = parts.join('\\n\\n');\n\n return {\n content: [{ type: 'text' as const, text }]\n };\n }\n );\n}\n", "import { z } from 'zod';\nimport { WixMcpServer } from '../wix-mcp-server.js';\nimport { fetchArticleContent } from './fetch-article.js';\nimport { defaultToolDescriptions } from '../config/default-config.js';\n\nfunction isHeadlessRequest(prompt?: string): boolean {\n return !!prompt && /headless/i.test(prompt);\n}\n\nconst HEADLESS_NON_CLI_INSTRUCTIONS = `# Creating a Wix Headless Site\n\nWix Headless sites require the **Wix CLI** and cannot be created from the Wix dashboard or via REST API alone. Let the user know they need to set up a local development environment with the Wix CLI before proceeding.\n\n## Prerequisites\n- Node.js 18+\n- A terminal / command-line environment\n\n## Steps to Get Started\n\n1. **Install and authenticate the Wix CLI:**\n \\`\\`\\`\n npx @wix/cli login\n \\`\\`\\`\n2. **Follow the quick-start guide:** https://dev.wix.com/docs/go-headless\n3. **For a complete orchestrated setup** (commerce, CMS, bookings, identity), use the Wix Headless skill: https://www.wix-headless.dev/skill.md`;\n\nconst HEADLESS_CLI_INSTRUCTIONS = `# Creating a Wix Headless Site (CLI Flow)\n\nFollow these steps using the \\`RunWixCliCommand\\` tool to scaffold and configure a Wix Headless site.\n\n## Before You Start\nAsk the user:\n1. What is the brand/site name?\n2. Which local directory should the project be created in?\n\n## Steps\n\n### Step 1 \u2014 Authenticate (if not already done)\nRun: \\`npx @wix/cli login\\`\nSkip if the user is already authenticated.\n\n### Step 2 \u2014 Scaffold the project\nUse a Wix headless starter template. Ask the user which starter they prefer, or use the default Next.js starter. Follow the scaffolding instructions at: https://dev.wix.com/docs/go-headless\n\n### Step 3 \u2014 Install dependencies\nRun: \\`npm install\\` in the project directory.\n\n### Step 4 \u2014 Pull environment variables\nRun: \\`npx @wix/cli env pull\\`\nThis writes the \\`.env.local\\` file with the site's environment variables.\n\n### Step 5 \u2014 Build and verify\nRun: \\`npx @wix/cli build\\`\n\n### Step 6 \u2014 Release (optional)\nRun: \\`npx @wix/cli release\\` to deploy.\n\n## Full Orchestration\nFor a complete multi-wave headless setup (commerce, CMS, bookings, design system, content seeding), refer to the Wix Headless skill: https://www.wix-headless.dev/skill.md\n\nUse \\`RunWixCliCommand\\` for each CLI step above.`;\n\nconst CREATE_SITE_DOCS = [\n {\n url: 'https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/TRAIN_create_a_new_site_from_template',\n title: 'How to Create a New Wix Site',\n nextSteps:\n '\\n\\n**Next Steps:** Use the ManageWixSite tool to make the API call for creating the Wix site.'\n },\n {\n url: 'https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/TRAIN_wix.devcenter.apps.installer.v1.AppsInstallerService.InstallApp',\n title: 'How to Install App on a Wix Site',\n nextSteps:\n '\\n\\n**Next Steps:** Use the CallWixSiteAPI tool to make the API call for installing apps on the Wix site.'\n }\n];\n\nexport async function addCreateWixBusinessGuideTools(\n server: WixMcpServer,\n disableTools: string[] = [],\n toolDescriptions?: Record<string, string>,\n cliEnabled: boolean | (() => boolean) = false\n) {\n if (disableTools.includes('CreateWixBusinessGuide')) {\n return;\n }\n server.tool(\n 'CreateWixBusinessGuide',\n toolDescriptions?.['CreateWixBusinessGuide'] ??\n defaultToolDescriptions.CreateWixBusinessGuide,\n {\n userPrompt: z\n .string()\n .optional()\n .describe('The user prompt that triggered this tool')\n },\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async (args, { httpClient }) => {\n if (isHeadlessRequest(args.userPrompt)) {\n const isCli =\n typeof cliEnabled === 'function' ? cliEnabled() : cliEnabled;\n const text = isCli\n ? HEADLESS_CLI_INSTRUCTIONS\n : HEADLESS_NON_CLI_INSTRUCTIONS;\n return { content: [{ type: 'text' as const, text }] };\n }\n\n try {\n const contents = await Promise.all(\n CREATE_SITE_DOCS.map(async ({ url, title, nextSteps }) => {\n const articleContent = await fetchArticleContent(\n httpClient,\n url,\n 'article',\n true\n );\n const fullContent = `# ${title}\\n\\n${articleContent}${nextSteps}`;\n return { type: 'text' as const, text: fullContent };\n })\n );\n return { content: contents };\n } catch (error) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Error fetching create site documentation: ${(error as Error).message}`\n }\n ]\n };\n }\n }\n );\n}\n", "import { z } from 'zod';\nimport { runSemanticSearchAndFormat } from './semanticSearch.js';\nimport { logger } from '../infra/logger.js';\nimport type { WixMcpServer } from '../wix-mcp-server.js';\nimport { captureException } from '@sentry/node';\nimport { fetchArticleContent } from './fetch-article.js';\nimport {\n normalizeMenuContent,\n summarizeLargeMenu,\n fetchMenuContent,\n MENU_CONTENT_THRESHOLD\n} from './normalize-menu-content.js';\nimport { fetchPlatformizedMenu, MenuNotFoundError } from './browse-menu.js';\nimport {\n isQueryOrSearchEndpoint,\n QUERY_CAPABILITY_MARKER\n} from './searchFormatting.js';\nimport { addGetToKnowTools, addGetSiteContextTool } from './get-to-know.js';\nimport { addCreateWixBusinessGuideTools } from './create-site-guide.js';\nimport { McpAuthenticationStrategy } from '../auth/index.js';\nimport { defaultToolDescriptions } from '../config/default-config.js';\nimport { desc } from '../config/param-descriptions.js';\nimport dedent from 'dedent';\n\nexport const VALID_DOCS_TOOLS = [\n 'WDS',\n 'REST',\n 'SDK',\n 'BUILD_APPS',\n 'WIX_HEADLESS',\n 'VELO',\n 'BUSINESS_SOLUTIONS',\n 'CLI',\n 'OVERVIEW'\n] as const;\nexport type DocsTool = (typeof VALID_DOCS_TOOLS)[number];\n\nconst REST_SEARCH_API_GROUNDING_REMINDER = dedent`\n # Before calling a Wix API\n\n Search results are partial excerpts. Before calling a Wix API tool, make sure the API call is grounded in concrete context: a user-provided endpoint/example, a docs code example, or the official method article/schema.\n\n Do not rely on memory or previous training for Wix REST endpoints, HTTP methods, request bodies, query parameters, field masks, auth context, or site/account scope.\n\n If you found a candidate REST method through this search and the excerpt does not fully confirm the endpoint and request shape, read the matching method article with ReadFullDocsArticle. If required body fields, query parameters, filters, paging, revisions, or response shape are still unclear, prefer SearchWixAPISpec to inspect the method schema by docs URL; use ReadFullDocsMethodSchema only if SearchWixAPISpec is unavailable or insufficient.\n\n A code example here is a partial excerpt: if the example you intend to model the call on is truncated (it contains a \"... N more lines ...\" marker), the excerpt does NOT confirm the request shape. Do not assemble a request body from a clipped example. Before any ExecuteWixAPI/CallWixSiteAPI mutation, ReadFullDocsArticle for the full example or SearchWixAPISpec for the method schema first \u2014 this is how you catch required fields and ONE_OF/required-together constraints that the truncated excerpt hides.\n`;\n\n// A code example proves the request shape but says nothing about which fields and operators the\n// endpoint accepts, which is what agents over-generalise from.\nconst QUERY_CAPABILITY_REMINDER = dedent`\n For query and search endpoints: each endpoint declares which fields it can filter, sort and search by, and with which operators. That list is closed and covers that endpoint only. Examples show part of it, and a field's presence in the response is no evidence it can be filtered on. Anything else errors or silently returns the wrong rows. Where nothing is declared, try what you need, and filter the rest in your own code. Filters are WQL \u2014 the method article covers its syntax.\n`;\n\n// Appended to a query/search article, which carries no capability list at all \u2014 only examples.\nconst ARTICLE_CAPABILITY_NOTE = dedent`\n The examples above are working combinations, not the full set. This endpoint declares which fields it can filter and sort by, and with which operators; that list is closed and covers this endpoint only. Anything else errors or silently returns the wrong rows. The filter is written in WQL, where each field takes a single operator, so conditions are combined with the logical operators instead: \"$and\" and \"$or\" take an array of expressions, \"$not\" takes one, and they can nest. They are WQL syntax, not field capabilities.\n`;\n\nfunction getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : 'Unknown error';\n}\n\nfunction shouldTryMenuFallbackForDocsRead(\n error: unknown,\n articleUrl: string\n): boolean {\n const message = getErrorMessage(error);\n\n if (!message.includes('404') || !articleUrl.includes('/api-reference/')) {\n return false;\n }\n\n return !['This resource is deprecated', 'No schema found'].some(\n (knownArticleError) => message.includes(knownArticleError)\n );\n}\n\nfunction formatDocsReadError(toolAction: string, error: unknown): string {\n return `Could not fetch ${toolAction}: \"${getErrorMessage(error)}\".`;\n}\n\n/**\n * Configuration for a README doc entry\n */\nexport interface ReadmeDocConfig {\n url?: string;\n action: 'include' | 'index' | 'text' | 'api';\n title?: string;\n description?: string;\n content?: string;\n /** HTTP method for API calls (only used when action is 'api'). Defaults to 'GET' */\n method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n /** Request body for API calls (only used when action is 'api' with POST/PUT/PATCH) */\n body?: Record<string, unknown>;\n}\n\nexport interface DocsToolsOptions {\n getToKnowWixEnabled?: boolean;\n createWixBusinessGuideEnabled?: boolean;\n disableTools?: string[];\n /** Custom descriptions for tools, keyed by tool name */\n toolDescriptions?: Record<string, string>;\n /** Custom list of docs that compose the WixREADME tool output */\n readmeDocs?: ReadmeDocConfig[];\n /** Authentication strategy for API calls (required if using 'api' action in readmeDocs) */\n authStrategy?: McpAuthenticationStrategy;\n /** Override base URL for skills docs (e.g., \"http://localhost:4000\" for local dev) */\n skillsPortalUrl?: string;\n /** GitHub repo (e.g. \"wix-private/docs\") to fetch skill overrides from a PR */\n skillsRepo?: string;\n /** GitHub repo (e.g. \"wix-private/docs\") to fetch skill overrides from. Preferred alias for `skillsRepo`; takes precedence when both are supplied. */\n repo?: string;\n /** PR number to fetch skill content overrides from */\n skillsPr?: string;\n /** Commit hash to fetch content overrides from. Preferred alias for `skillsPr`; takes precedence when both are supplied. */\n commitHash?: string;\n /** Tags to filter skills by (e.g. ['velo', 'cms']) */\n skillsTags?: string[];\n /** Enable dynamic context fetch */\n dynamicContextEnabled?: boolean;\n /** Enable partner context section in dynamic context output */\n partnerContextEnabled?: boolean;\n /** Whether the client is a CLI environment (e.g. Claude Code) where users can run terminal commands.\n * Accepts a boolean or a function for lazy evaluation (useful when client name is only known after MCP init). */\n cliEnabled?: boolean | (() => boolean);\n /** Use the new platformized semantic search API (POST /v1/docs/search) instead of the legacy GET endpoint */\n usePlatformizedSearch?: boolean;\n /** Use the platformized menu browse API (POST /v1/docs/menu/browse) instead of scraping the legacy get-menu-content markdown. Falls back to legacy on transport errors. */\n usePlatformizedBrowse?: boolean;\n}\n\nexport const addDocsTools = (\n server: WixMcpServer,\n allowedTools: DocsTool[] = [\n 'WDS',\n 'REST',\n 'SDK',\n 'BUILD_APPS',\n 'WIX_HEADLESS',\n 'BUSINESS_SOLUTIONS',\n 'CLI',\n 'OVERVIEW'\n ],\n options: DocsToolsOptions = {}\n) => {\n const {\n getToKnowWixEnabled = false,\n createWixBusinessGuideEnabled = true,\n disableTools,\n toolDescriptions,\n readmeDocs,\n authStrategy,\n skillsPortalUrl,\n skillsRepo,\n repo,\n skillsPr,\n commitHash,\n skillsTags,\n dynamicContextEnabled,\n cliEnabled = false,\n usePlatformizedSearch = true,\n usePlatformizedBrowse = true\n } = options;\n\n const effectiveRepo = repo ?? skillsRepo;\n const effectiveCommitHash = commitHash ?? skillsPr;\n\n // Helper to get description (custom or default)\n const getDescription = (toolName: string, defaultDesc: string): string =>\n toolDescriptions?.[toolName] ?? defaultDesc;\n\n // Menu text for a docs URL, shared by BrowseWixRESTDocsMenu and the\n // ReadFullDocs* category fallbacks. Platformized browse first \u2014 its 404 is a\n // real answer (null, no such menu); any other failure falls back to the\n // legacy get-menu-content scrape, which keeps its original thresholding.\n const fetchMenuTextForUrl = async (\n httpClient: { get: (url: string) => Promise<{ data: string }> },\n url: string\n ): Promise<string | null> => {\n if (usePlatformizedBrowse) {\n try {\n return await fetchPlatformizedMenu(url);\n } catch (error) {\n if (error instanceof MenuNotFoundError) return null;\n logger.error(\n `[browse-menu] falling back to get-menu-content for ${url}: ${error}`\n );\n }\n }\n const menuContent = await fetchMenuContent(httpClient, url);\n if (!menuContent || menuContent.includes('No matching node found')) {\n return null;\n }\n return menuContent.length > MENU_CONTENT_THRESHOLD\n ? summarizeLargeMenu(menuContent, url)\n : normalizeMenuContent(menuContent);\n };\n\n if (\n dynamicContextEnabled &&\n authStrategy &&\n !disableTools?.includes('GetSiteContext')\n ) {\n addGetSiteContextTool({\n server,\n authStrategy,\n toolDescriptions,\n disableTools: disableTools || []\n });\n }\n\n if (getToKnowWixEnabled && !disableTools?.includes('WixREADME')) {\n addGetToKnowTools({\n server,\n disableTools: disableTools || [],\n toolDescriptions,\n readmeDocs,\n authStrategy,\n skillsPortalUrl,\n dynamicContextEnabled,\n repo: effectiveRepo,\n commitHash: effectiveCommitHash,\n skillsTags\n });\n }\n if (\n createWixBusinessGuideEnabled &&\n !disableTools?.includes('CreateWixBusinessGuide')\n ) {\n addCreateWixBusinessGuideTools(\n server,\n disableTools || [],\n toolDescriptions,\n cliEnabled\n );\n }\n\n // WDS Documentation\n if (\n allowedTools.includes('WDS') &&\n !disableTools?.includes('SearchWixWDSDocumentation')\n ) {\n server.tool(\n 'SearchWixWDSDocumentation',\n getDescription(\n 'SearchWixWDSDocumentation',\n defaultToolDescriptions.SearchWixWDSDocumentation ?? ''\n ),\n (() => {\n const d = desc('SearchWixWDSDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults }, { panorama }) => {\n try {\n logger.log(`Searching for ${searchTerm} in Wix WDS`);\n\n const result = await runSemanticSearchAndFormat({\n toolName: 'WDS',\n toolParams: {\n searchTerm: searchTerm\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n usePlatformizedSearch\n });\n\n return {\n content: [\n {\n type: 'text',\n text: result\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchWixWDSDocumentation',\n toolName: 'SearchWixWDSDocumentation'\n }\n });\n logger.error(\n `Error searching for ${searchTerm} in Wix WDS: ${error}`\n );\n return {\n isError: true,\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n // REST Documentation\n if (\n allowedTools.includes('REST') &&\n !disableTools?.includes('SearchWixRESTDocumentation')\n ) {\n server.tool(\n 'SearchWixRESTDocumentation',\n getDescription(\n 'SearchWixRESTDocumentation',\n defaultToolDescriptions.SearchWixRESTDocumentation\n ),\n (() => {\n const d = desc('SearchWixRESTDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15),\n reason: z.string().describe(d.reason)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults, reason }, { panorama }) => {\n try {\n logger.log(\n `[SearchWixRESTDocumentation] searchTerm=\"${searchTerm}\", reason=\"${reason}\"`\n );\n\n const result = await runSemanticSearchAndFormat({\n toolName: 'REST',\n toolParams: {\n searchTerm: searchTerm\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n linesInEachResult: 30,\n usePlatformizedSearch\n });\n\n // Only when a result actually carried the marker. Re-deriving it here would also fire on\n // an article that merely references a query endpoint, with no such endpoint in the results.\n const grounding = result.includes(QUERY_CAPABILITY_MARKER)\n ? [\n REST_SEARCH_API_GROUNDING_REMINDER,\n QUERY_CAPABILITY_REMINDER\n ].join('\\n\\n')\n : REST_SEARCH_API_GROUNDING_REMINDER;\n\n return {\n content: [\n {\n type: 'text',\n text: [result, grounding].join('\\n\\n---\\n\\n')\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchWixRESTDocumentation',\n toolName: 'SearchWixRESTDocumentation'\n }\n });\n logger.error(\n `Error searching for ${searchTerm} in Wix REST API: ${error}`\n );\n return {\n isError: true,\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n if (\n allowedTools.includes('BUSINESS_SOLUTIONS') &&\n !getToKnowWixEnabled &&\n !disableTools?.includes('WixBusinessFlowsDocumentation')\n ) {\n server.tool(\n 'WixBusinessFlowsDocumentation',\n getDescription(\n 'WixBusinessFlowsDocumentation',\n defaultToolDescriptions.WixBusinessFlowsDocumentation ?? ''\n ),\n (() => {\n const d = desc('WixBusinessFlowsDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults }, { panorama }) => {\n try {\n logger.log(`Searching for ${searchTerm} in Wix Sample Flows`);\n\n const result = await runSemanticSearchAndFormat({\n toolName: 'BUSINESS_SOLUTIONS',\n toolParams: {\n searchTerm:\n '**RECIPE**: Business Recipes - full setup flow for::: ' +\n searchTerm\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n usePlatformizedSearch\n });\n\n return {\n content: [\n {\n type: 'text',\n text: [\n result,\n `Out of the included list of articles, you **MUST** select the one that is most relevant to the user's request and use the ReadFullDocsArticle tool to fetch it.`\n ].join('\\n\\n')\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchWixSampleFlowsDocumentation',\n toolName: 'SearchWixSampleFlowsDocumentation'\n }\n });\n logger.error(\n `Error searching for ${searchTerm} in Wix Sample Flows: ${error}`\n );\n return {\n isError: true,\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n // SDK Documentation\n if (\n allowedTools.includes('SDK') &&\n !disableTools?.includes('SearchWixSDKDocumentation')\n ) {\n server.tool(\n 'SearchWixSDKDocumentation',\n getDescription(\n 'SearchWixSDKDocumentation',\n defaultToolDescriptions.SearchWixSDKDocumentation ?? ''\n ),\n (() => {\n const d = desc('SearchWixSDKDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults }, { panorama }) => {\n try {\n logger.log(`Searching for ${searchTerm} in Wix SDK`);\n\n panorama\n .transaction('SearchWixSDKDocumentation')\n .start({ maxResults });\n const result = await runSemanticSearchAndFormat({\n toolName: 'SDK',\n toolParams: {\n searchTerm: searchTerm\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n linesInEachResult: 30,\n usePlatformizedSearch\n });\n panorama\n .transaction('SearchWixSDKDocumentation')\n .finish({ maxResults });\n\n return {\n content: [\n {\n type: 'text',\n text: [\n result,\n 'you should use ReadFullDocsArticle tool if you want to read full documentation for a specific article or method.'\n ].join('\\n---\\n')\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchWixSDKDocumentation',\n toolName: 'SearchWixSDKDocumentation'\n }\n });\n logger.error(\n `Error searching for ${searchTerm} in Wix SDK: ${error}`\n );\n return {\n isError: true,\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n // Build Apps Documentation\n if (\n allowedTools.includes('BUILD_APPS') &&\n !disableTools?.includes('SearchBuildAppsDocumentation')\n ) {\n server.tool(\n 'SearchBuildAppsDocumentation',\n getDescription(\n 'SearchBuildAppsDocumentation',\n defaultToolDescriptions.SearchBuildAppsDocumentation ?? ''\n ),\n (() => {\n const d = desc('SearchBuildAppsDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults }, { panorama }) => {\n try {\n logger.log(`Searching for ${searchTerm} in Build Apps`);\n\n const result = await runSemanticSearchAndFormat({\n toolName: 'BUILD_APPS',\n toolParams: {\n searchTerm: `wix cli docs for ${searchTerm}`\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n usePlatformizedSearch\n });\n\n return {\n content: [\n {\n type: 'text',\n text: result\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchBuildAppsDocumentation',\n toolName: 'SearchBuildAppsDocumentation'\n }\n });\n logger.error(\n `Error searching for ${searchTerm} in Build Apps: ${error}`\n );\n return {\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n // Overview Documentation\n if (\n allowedTools.includes('OVERVIEW') &&\n !disableTools?.includes('SearchOverviewDocumentation')\n ) {\n server.tool(\n 'SearchOverviewDocumentation',\n getDescription(\n 'SearchOverviewDocumentation',\n defaultToolDescriptions.SearchOverviewDocumentation ?? ''\n ),\n (() => {\n const d = desc('SearchOverviewDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults }, { panorama }) => {\n try {\n logger.log(`Searching for ${searchTerm} in Wix Overview`);\n\n const result = await runSemanticSearchAndFormat({\n toolName: 'OVERVIEW',\n toolParams: {\n searchTerm: searchTerm\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n usePlatformizedSearch\n });\n\n return {\n content: [\n {\n type: 'text',\n text: result\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchOverviewDocumentation',\n toolName: 'SearchOverviewDocumentation'\n }\n });\n logger.error(\n `Error searching for ${searchTerm} in Wix Overview: ${error}`\n );\n return {\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n // Wix Headless Documentation\n if (\n allowedTools.includes('WIX_HEADLESS') &&\n !disableTools?.includes('SearchWixHeadlessDocumentation')\n ) {\n server.tool(\n 'SearchWixHeadlessDocumentation',\n getDescription(\n 'SearchWixHeadlessDocumentation',\n defaultToolDescriptions.SearchWixHeadlessDocumentation ?? ''\n ),\n (() => {\n const d = desc('SearchWixHeadlessDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults }, { panorama }) => {\n try {\n logger.log(`Searching for ${searchTerm} in Headless`);\n\n const result = await runSemanticSearchAndFormat({\n toolName: 'WIX_HEADLESS',\n toolParams: {\n searchTerm: searchTerm\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n usePlatformizedSearch\n });\n\n return {\n content: [\n {\n type: 'text',\n text: result\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchWixHeadlessDocumentation',\n toolName: 'SearchWixHeadlessDocumentation'\n }\n });\n logger.error(\n `Error searching for ${searchTerm} in Wix Headless: ${error}`\n );\n return {\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n // Velo Documentation\n if (\n allowedTools.includes('VELO') &&\n !disableTools?.includes('SearchWixVeloDocumentation')\n ) {\n server.tool(\n 'SearchWixVeloDocumentation',\n getDescription(\n 'SearchWixVeloDocumentation',\n defaultToolDescriptions.SearchWixVeloDocumentation ?? ''\n ),\n (() => {\n const d = desc('SearchWixVeloDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults }, { panorama }) => {\n try {\n logger.log(`Searching for ${searchTerm} in Velo`);\n\n panorama\n .transaction('SearchWixVeloDocumentation')\n .start({ maxResults });\n const result = await runSemanticSearchAndFormat({\n toolName: 'VELO',\n toolParams: {\n searchTerm: searchTerm\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n linesInEachResult: 30,\n usePlatformizedSearch\n });\n panorama\n .transaction('SearchWixVeloDocumentation')\n .finish({ maxResults });\n\n return {\n content: [\n {\n type: 'text',\n text: [\n result,\n 'you should use ReadFullDocsArticle tool if you want to read full documentation for a specific article or method.'\n ].join('\\n---\\n')\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchWixVeloDocumentation',\n toolName: 'SearchWixVeloDocumentation'\n }\n });\n logger.error(`Error searching for ${searchTerm} in Velo: ${error}`);\n return {\n isError: true,\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n // CLI Documentation\n if (\n allowedTools.includes('CLI') &&\n !disableTools?.includes('SearchWixCLIDocumentation')\n ) {\n server.tool(\n 'SearchWixCLIDocumentation',\n getDescription(\n 'SearchWixCLIDocumentation',\n defaultToolDescriptions.SearchWixCLIDocumentation ?? ''\n ),\n (() => {\n const d = desc('SearchWixCLIDocumentation');\n return {\n searchTerm: z.string().describe(d.searchTerm),\n maxResults: z\n .number()\n .describe(d.maxResults)\n .min(1)\n .max(15)\n .optional()\n .default(15),\n reason: z.string().describe(d.reason)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ searchTerm, maxResults, reason }, { panorama }) => {\n try {\n logger.log(\n `[SearchWixCLIDocumentation] searchTerm=\"${searchTerm}\", reason=\"${reason}\"`\n );\n\n const result = await runSemanticSearchAndFormat({\n toolName: 'CLI',\n toolParams: {\n searchTerm: searchTerm\n },\n maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),\n linesInEachResult: 30,\n usePlatformizedSearch\n });\n\n return {\n content: [\n {\n type: 'text',\n text: result\n }\n ]\n };\n } catch (error: any) {\n panorama.errorMonitor().reportError(error);\n captureException(error, {\n tags: {\n componentId: 'SearchWixCLIDocumentation',\n toolName: 'SearchWixCLIDocumentation'\n }\n });\n logger.error(\n `Error searching for ${searchTerm} in Wix CLI: ${error}`\n );\n return {\n isError: true,\n content: [{ type: 'text', text: 'Error: ' + error.message }]\n };\n }\n }\n );\n }\n\n if (!disableTools?.includes('ReadFullDocsArticle')) {\n server.tool(\n 'ReadFullDocsArticle',\n getDescription(\n 'ReadFullDocsArticle',\n defaultToolDescriptions.ReadFullDocsArticle\n ),\n (() => {\n const d = desc('ReadFullDocsArticle');\n return {\n articleUrl: z.string().url().describe(d.articleUrl)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ articleUrl }, { httpClient }) => {\n // URL validation: only allow known docs prefixes\n const validPrefixes = ['https://dev.wix.com/docs/'];\n if (skillsPortalUrl) validPrefixes.push(skillsPortalUrl);\n if (!validPrefixes.some((p) => articleUrl.startsWith(p))) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Invalid article URL: must start with https://dev.wix.com/docs/. Got: \"${articleUrl}\"`\n }\n ]\n };\n }\n\n // Every docs page has a .md twin whose menu pages link children WITH\n // the .md suffix, so agents that navigated the .md tree pass .md URLs\n // here \u2014 which 404 in get-article-content. Read the canonical page.\n // (dev.wix.com only: on the skills portal .md is the real path.)\n if (articleUrl.startsWith('https://dev.wix.com/docs/')) {\n articleUrl = articleUrl.replace(/\\.md$/, '');\n }\n\n try {\n const articleContent = await fetchArticleContent(\n httpClient,\n articleUrl,\n 'article',\n false,\n skillsPortalUrl,\n effectiveRepo,\n effectiveCommitHash\n );\n\n if (!articleContent) {\n throw new Error('Article content is empty');\n }\n\n return {\n content: [\n {\n type: 'text',\n // The article's own URL, never its body \u2014 a filter/sort reference page links query\n // methods in its prose but isn't one.\n text: isQueryOrSearchEndpoint(articleUrl)\n ? [articleContent, ARTICLE_CAPABILITY_NOTE].join('\\n\\n')\n : articleContent\n }\n ]\n };\n } catch (error) {\n logger.error(\n `Error fetching article content for ${articleUrl}: ${error}`\n );\n\n // Auto-fallback: if 404 on an api-reference URL, try fetching as menu\n if (shouldTryMenuFallbackForDocsRead(error, articleUrl)) {\n try {\n const text = await fetchMenuTextForUrl(httpClient, articleUrl);\n if (text) {\n return {\n content: [\n {\n type: 'text',\n text: `Note: \"${articleUrl}\" is a documentation category, not an article. Showing its menu contents below. For category URLs, use BrowseWixRESTDocsMenu directly next time.\\n\\n${text}`\n }\n ]\n };\n }\n } catch {\n // menu fallback failed too \u2014 fall through to error below\n }\n }\n\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: formatDocsReadError('article content', error)\n }\n ]\n };\n }\n }\n );\n }\n\n if (!disableTools?.includes('ReadFullDocsMethodSchema')) {\n server.tool(\n 'ReadFullDocsMethodSchema',\n getDescription(\n 'ReadFullDocsMethodSchema',\n defaultToolDescriptions.ReadFullDocsMethodSchema\n ),\n (() => {\n const d = desc('ReadFullDocsMethodSchema');\n return {\n articleUrl: z.string().url().describe(d.articleUrl),\n reason: z.string().describe(d.reason)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ articleUrl, reason }, { httpClient }) => {\n // URL validation: only allow known docs prefixes\n const validPrefixes = ['https://dev.wix.com/docs/'];\n if (skillsPortalUrl) validPrefixes.push(skillsPortalUrl);\n if (!validPrefixes.some((p) => articleUrl.startsWith(p))) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Invalid article URL: must start with https://dev.wix.com/docs/. Got: \"${articleUrl}\"`\n }\n ]\n };\n }\n\n // Same .md-twin normalization as ReadFullDocsArticle above.\n if (articleUrl.startsWith('https://dev.wix.com/docs/')) {\n articleUrl = articleUrl.replace(/\\.md$/, '');\n }\n\n try {\n logger.log(\n `[ReadFullDocsMethodSchema] url=\"${articleUrl}\", reason=\"${reason}\"`\n );\n const articleContent = await fetchArticleContent(\n httpClient,\n articleUrl,\n 'methodSchema',\n false,\n skillsPortalUrl,\n effectiveRepo,\n effectiveCommitHash,\n true\n );\n\n if (!articleContent) {\n throw new Error('Method schema is empty');\n }\n\n return {\n content: [\n {\n type: 'text',\n text: articleContent\n }\n ]\n };\n } catch (error) {\n logger.error(\n `Error fetching method schema for ${articleUrl}: ${error}`\n );\n\n // Auto-fallback: if 404 on an api-reference URL, try fetching as menu\n if (shouldTryMenuFallbackForDocsRead(error, articleUrl)) {\n try {\n const text = await fetchMenuTextForUrl(httpClient, articleUrl);\n if (text) {\n return {\n content: [\n {\n type: 'text',\n text: `Note: \"${articleUrl}\" is a documentation category, not an article. Showing its menu contents below. For category URLs, use BrowseWixRESTDocsMenu directly next time.\\n\\n${text}`\n }\n ]\n };\n }\n } catch {\n // menu fallback failed too \u2014 fall through to error below\n }\n }\n\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: formatDocsReadError('method schema', error)\n }\n ]\n };\n }\n }\n );\n }\n\n if (!disableTools?.includes('BrowseWixRESTDocsMenu')) {\n server.tool(\n 'BrowseWixRESTDocsMenu',\n getDescription(\n 'BrowseWixRESTDocsMenu',\n defaultToolDescriptions.BrowseWixRESTDocsMenu\n ),\n (() => {\n const d = desc('BrowseWixRESTDocsMenu');\n return {\n menuUrl: z.string().optional().describe(d.menuUrl),\n reason: z.string().describe(d.reason)\n };\n })(),\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ menuUrl, reason }, { httpClient }) => {\n try {\n if (menuUrl && !menuUrl.startsWith('https://dev.wix.com/docs/')) {\n return {\n content: [\n {\n type: 'text',\n text: `Invalid menuUrl: must start with \"https://dev.wix.com/docs/\".`\n }\n ]\n };\n }\n\n const targetUrl = menuUrl || 'https://dev.wix.com/docs/api-reference';\n\n logger.log(\n `[BrowseWixRESTDocsMenu] url=\"${menuUrl || '(root)'}\", reason=\"${reason}\"`\n );\n\n const menuText = await fetchMenuTextForUrl(httpClient, targetUrl);\n\n if (!menuText) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Menu not found: \"${menuUrl}\". Try browsing from the root (no menuUrl) or check the URL is correct.`\n }\n ]\n };\n }\n\n // Browsing is the other discovery route into a query endpoint, so it\n // needs the same reminder as search \u2014 only on a page that actually\n // lists query/search methods.\n return {\n content: [\n {\n type: 'text',\n text: isQueryOrSearchEndpoint(menuText)\n ? [menuText, QUERY_CAPABILITY_REMINDER].join('\\n\\n---\\n\\n')\n : menuText\n }\n ]\n };\n } catch (error) {\n logger.error(`Error browsing docs menu for \"${menuUrl}\": ${error}`);\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Could not browse docs menu: \"${(error as Error).message}\".`\n }\n ]\n };\n }\n }\n );\n }\n};\n", "import type { HttpResponse } from '@wix/http-client';\n\nconst REST_METHOD_CONTRACT_RETRY_HINT =\n 'Before retrying, make sure you have everything needed for a correct call: the right endpoint URL, HTTP method, request body shape, and response shape. ' +\n 'Use the SearchWixRESTDocumentation tool or BrowseWixRESTDocsMenu tool to find the correct method or relevant related articles, the ReadFullDocsArticle tool to read the method description and all code examples, and the SearchWixAPISpec tool for precise field names and schema details.';\n\nexport const DEFAULT_OPENAI_SECURITY_SCHEMES = [\n { type: 'oauth2' as const, scopes: ['offline_access'] }\n];\n\nconst safeParseJSON = (text: string) => {\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n};\n\nexport const buildErrorMessage = ({\n status,\n statusText,\n requestId,\n responseData\n}: {\n status?: number;\n statusText?: string;\n requestId: string | null;\n responseData?: any;\n}) => {\n const responseDataObject =\n typeof responseData === 'string'\n ? safeParseJSON(responseData)\n : responseData;\n\n const errorDetails: string =\n typeof responseDataObject === 'object'\n ? JSON.stringify(responseDataObject)\n : responseDataObject;\n\n const baseMessage = [\n `Failed to call Wix API:${status ? ` ${status}` : ''}${statusText ? ` ${statusText}` : ''}.`,\n requestId ? `request id: ${requestId}` : '',\n // Wix 404 for API does not exist is huge (generic 404 page) and loaded to the context\n status === 404 && errorDetails.includes('<html')\n ? 'Not found'\n : errorDetails\n ]\n .filter((str) => !!str)\n .join('\\n');\n\n return `${baseMessage}\\n\\n${REST_METHOD_CONTRACT_RETRY_HINT}`;\n};\n\nexport const handleWixAPIResponse = async <T = any>(response: HttpResponse) => {\n const requestId = response.headers?.['x-wix-request-id'];\n\n if (!response.status.toString().startsWith('2')) {\n const errorMessage = buildErrorMessage({\n status: response.status,\n statusText: response.statusText,\n requestId: requestId,\n responseData: response.data\n });\n throw new Error(errorMessage);\n }\n\n const responseData =\n typeof response.data === 'string'\n ? safeParseJSON(response.data)\n : response.data;\n return responseData as T;\n};\n\nexport function withJsonContent(result: any): any {\n if (result.structuredContent) {\n return {\n ...result,\n content: [\n ...result.content,\n {\n type: 'text' as const,\n text: JSON.stringify(result.structuredContent)\n }\n ]\n };\n }\n return result;\n}\n", "export class WixFetchError extends Error {\n readonly status: number;\n readonly response: { status: number; data: string };\n\n constructor(status: number, statusText: string, body: string) {\n super(body || `Wix API failed: ${status} ${statusText}`);\n this.name = 'WixFetchError';\n this.status = status;\n this.response = { status, data: body };\n }\n}\n", "import { fileTypeFromBuffer } from 'file-type';\nimport { WixFetchError } from '../wix-fetch-error.js';\n\nconst IMAGE_MIME_TO_EXT: Record<string, string> = {\n 'image/jpeg': 'jpg',\n 'image/jpg': 'jpg',\n 'image/pjpeg': 'jpg',\n 'image/png': 'png',\n 'image/gif': 'gif',\n 'image/webp': 'webp',\n 'image/bmp': 'bmp',\n 'image/x-ms-bmp': 'bmp',\n 'image/tiff': 'tiff',\n 'image/svg+xml': 'svg',\n 'image/heic': 'heic',\n 'image/heif': 'heif',\n 'image/avif': 'avif',\n 'image/x-icon': 'ico',\n 'image/vnd.microsoft.icon': 'ico'\n};\n\nconst EXTENSION_ALIASES: Record<string, string> = {\n jpeg: 'jpg',\n tif: 'tiff'\n};\n\nconst SUPPORTED_EXTENSIONS = new Set([\n ...Object.values(IMAGE_MIME_TO_EXT),\n ...Object.keys(EXTENSION_ALIASES)\n]);\n\nfunction normalizeMimeType(mimeType: string): string {\n return (mimeType ?? '').split(';')[0].trim().toLowerCase();\n}\n\nfunction canonicalExtension(ext: string): string {\n return EXTENSION_ALIASES[ext] ?? ext;\n}\n\nfunction extensionForMimeType(mimeType: string): string | undefined {\n return IMAGE_MIME_TO_EXT[normalizeMimeType(mimeType)];\n}\n\nfunction buildFileName(mimeType: string, displayName?: string): string {\n const ext = extensionForMimeType(mimeType) ?? 'jpg';\n const name = displayName?.trim();\n if (!name) return `upload.${ext}`;\n const currentExt = name.includes('.')\n ? name.split('.').pop()!.toLowerCase()\n : '';\n if (\n currentExt &&\n canonicalExtension(currentExt) === canonicalExtension(ext)\n ) {\n return name;\n }\n const base =\n currentExt && SUPPORTED_EXTENSIONS.has(currentExt)\n ? name.slice(0, name.length - currentExt.length - 1)\n : name;\n return `${base}.${ext}`;\n}\n\nexport function looksLikeHtml(data: Uint8Array): boolean {\n const head = new TextDecoder('utf-8', { fatal: false })\n .decode(data.subarray(0, 512))\n .trim()\n .toLowerCase();\n if (!head.startsWith('<')) return false;\n if (head.includes('<svg')) return false;\n return (\n head.startsWith('<!doctype html') ||\n head.startsWith('<!doctype>') ||\n /<html[\\s>]/.test(head) ||\n /<head[\\s>]/.test(head) ||\n /<body[\\s>]/.test(head)\n );\n}\n\nexport async function detectImageMimeFromBytes(\n b: Uint8Array\n): Promise<string | undefined> {\n const detected = await fileTypeFromBuffer(b);\n return detected?.mime.startsWith('image/') ? detected.mime : undefined;\n}\n\nexport async function uploadBinaryToMediaManager(\n data: Uint8Array,\n mimeType: string,\n authHeaders: Record<string, string>,\n displayName?: string\n): Promise<string> {\n if (data.byteLength === 0) {\n throw new Error('Cannot upload an empty file (0 bytes).');\n }\n\n const extension = extensionForMimeType(mimeType);\n if (!extension) {\n throw new Error(\n `Unsupported image type \"${mimeType || 'unknown'}\". The source did not resolve to a supported image ` +\n `(jpg, png, gif, webp, bmp, tiff, svg, heic, avif). ` +\n `If a URL was used, it may have returned an HTML/error page instead of the image bytes.`\n );\n }\n if (looksLikeHtml(data)) {\n throw new Error(\n `The provided bytes are an HTML page, not an image. The source URL is likely expired, private, or requires authentication.`\n );\n }\n\n const fileName = buildFileName(mimeType, displayName);\n\n const generateRes = await fetch(\n 'https://www.wixapis.com/site-media/v1/files/generate-upload-url',\n {\n method: 'POST',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({ mimeType: normalizeMimeType(mimeType), fileName })\n }\n );\n\n if (!generateRes.ok) {\n const body = await generateRes.text();\n console.error('[upload-image] generate-upload-url failed', {\n status: generateRes.status,\n fileName,\n mimeType: normalizeMimeType(mimeType),\n fileNameLength: fileName.length,\n hasSiteHeader:\n 'wix-site-id' in authHeaders || 'wix-account-id' in authHeaders,\n bodyIsHtml: body.trimStart().startsWith('<'),\n bodySnippet: body.slice(0, 200)\n });\n throw new WixFetchError(generateRes.status, generateRes.statusText, body);\n }\n\n const generateData = (await generateRes.json()) as { uploadUrl?: string };\n const uploadUrl = generateData?.uploadUrl;\n if (!uploadUrl) throw new Error('Failed to generate upload URL from Wix API');\n\n const uploadRes = await fetch(uploadUrl, {\n method: 'PUT',\n headers: { 'Content-Type': normalizeMimeType(mimeType) },\n body: data.buffer.slice(\n data.byteOffset,\n data.byteOffset + data.byteLength\n ) as ArrayBuffer\n });\n\n const uploadResText = await uploadRes.text();\n if (!uploadRes.ok) {\n const bodyIsHtml = uploadResText.trimStart().startsWith('<');\n const detail = bodyIsHtml\n ? 'Wix returned an HTML error page (the request was rejected at the edge)'\n : uploadResText.slice(0, 300);\n throw new Error(\n `Upload failed (HTTP ${uploadRes.status}) for \"${fileName}\" [${normalizeMimeType(mimeType)}]: ${detail}`\n );\n }\n\n const uploadData = JSON.parse(uploadResText) as { file?: { url: string } };\n const url = uploadData?.file?.url;\n if (!url) throw new Error('No file URL in upload response');\n\n return url;\n}\n\ntype ImportedFile = { id: string; url: string; operationStatus: string };\n\n// Import a public image URL into the Media Manager by having WIX fetch it\n// (POST /site-media/v1/files/import). Wix downloads from its own infrastructure,\n// so this avoids fetching arbitrary caller-supplied URLs from our own runtime\n// (no SSRF surface here) and side-steps source hosts that block our egress IP.\nexport async function importFileFromUrl(\n fileUrl: string,\n authHeaders: Record<string, string>,\n opts?: { displayName?: string; mimeType?: string }\n): Promise<ImportedFile> {\n const body: Record<string, unknown> = {\n url: fileUrl,\n mediaType: 'IMAGE',\n // Forwarded by Wix when it fetches the URL, in case the source requires a UA.\n urlHeaders: {\n 'User-Agent': 'Wix-MCP-ImageUpload/1.0 (+https://www.wix.com)'\n }\n };\n const displayName = opts?.displayName?.trim();\n if (displayName) body.displayName = displayName;\n if (opts?.mimeType) body.mimeType = normalizeMimeType(opts.mimeType);\n\n const res = await fetch(\n 'https://www.wixapis.com/site-media/v1/files/import',\n {\n method: 'POST',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify(body)\n }\n );\n\n const text = await res.text();\n if (!res.ok) {\n throw new WixFetchError(res.status, res.statusText, text);\n }\n\n const data = JSON.parse(text) as {\n file?: { id?: string; url?: string; operationStatus?: string };\n };\n const file = data?.file;\n if (!file?.url || !file?.id) {\n throw new Error('Import response missing file id/url');\n }\n return {\n id: file.id,\n url: file.url,\n operationStatus: file.operationStatus ?? 'PENDING'\n };\n}\n", "/**\n * Upload image tool for Wix Media Manager.\n *\n * Upload flows (all fetch/decode to binary, then upload in parallel):\n * - Attachments (`image`, array): ChatGPT file attachments. Tagged as an\n * `openai/fileParams` field, so per OpenAI's file-params contract each item is\n * { download_url, file_id, file_name?, mime_type? } (download_url + file_id required).\n * @see https://developers.openai.com/apps-sdk/build/mcp-server#files-out-file-params\n * - Public URLs (`imageUrls`, array of strings): plain URLs that are NOT chat\n * attachments (pasted links, URLs from other tools) \u2014 no file_id, not a fileParams field.\n * - Base64 (`imageBase64`, single string + `mimeType`): clients that can read and encode files.\n */\nimport { z } from 'zod';\nimport { logger } from '../infra/logger.js';\nimport {\n uploadBinaryToMediaManager,\n importFileFromUrl\n} from './upload-image-utils.js';\nimport { WixFetchError } from '../wix-fetch-error.js';\nimport { WixMcpServer } from '../wix-mcp-server.js';\nimport {\n McpAuthenticationStrategy,\n rethrowIfUnauthorized\n} from '../auth/index.js';\nimport type { ToolHintsConfig } from './index.js';\nimport { defaultToolDescriptions } from '../config/default-config.js';\nimport { desc } from '../config/param-descriptions.js';\n\nexport const UPLOAD_IMAGE_TOOL_NAME = 'UploadImageToWixSite';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype UploadSuccess = {\n success: true;\n id: string;\n url: string;\n operationStatus: string;\n};\ntype UploadFailure = { success: false; error: string };\ntype UploadResult = UploadSuccess | UploadFailure;\n\ntype ImageItem = {\n download_url: string;\n file_id: string;\n file_name?: string;\n mime_type?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction detectMimeTypeFromBase64(base64: string): string | undefined {\n if (base64.startsWith('/9j/')) return 'image/jpeg';\n if (base64.startsWith('iVBORw0KGgo')) return 'image/png';\n if (base64.startsWith('R0lGOD')) return 'image/gif';\n if (base64.startsWith('UklGR')) return 'image/webp';\n if (base64.startsWith('Qk0')) return 'image/bmp';\n return undefined;\n}\n\nfunction resolveBase64Image(\n imageBase64: string,\n mimeType?: string\n): { base64Data: string; resolvedMimeType: string | undefined } {\n const base64Data = imageBase64.includes(',')\n ? imageBase64.split(',')[1]\n : imageBase64;\n const resolvedMimeType =\n mimeType ??\n (imageBase64.includes(',')\n ? imageBase64.split(',')[0].match(/:(.*?);/)?.[1]\n : undefined) ??\n detectMimeTypeFromBase64(base64Data);\n return { base64Data, resolvedMimeType };\n}\n\nfunction errorResponse(text: string) {\n return { isError: true as const, content: [{ type: 'text' as const, text }] };\n}\n\n// ---------------------------------------------------------------------------\n// Upload flows\n// ---------------------------------------------------------------------------\n\nasync function uploadFromUrl(\n item: ImageItem,\n authHeaders: Record<string, string>,\n displayName?: string\n): Promise<UploadResult> {\n if (!item.download_url) {\n return {\n success: false,\n error: `No download_url provided (file_id: ${item.file_id ?? 'unknown'}). Cannot upload without a publicly accessible URL.`\n };\n }\n if (!/^https?:\\/\\//i.test(item.download_url)) {\n return {\n success: false,\n error: `download_url must be a publicly accessible http(s) URL, not a local or sandbox file path (got: \"${item.download_url}\"). For a user-attached file, pass the file so the platform resolves it to a real download_url; if you only have the raw bytes, use imageBase64 instead.`\n };\n }\n try {\n const imported = await importFileFromUrl(item.download_url, authHeaders, {\n displayName: displayName ?? item.file_name,\n mimeType: item.mime_type\n });\n return {\n success: true,\n id: imported.id,\n url: imported.url,\n operationStatus: imported.operationStatus\n };\n } catch (err) {\n // Auth failures propagate so the tool can trigger re-authentication;\n // everything else is reported as a per-item failure.\n if (\n err instanceof WixFetchError &&\n (err.status === 401 || err.status === 403)\n ) {\n throw err;\n }\n const detail =\n err instanceof WixFetchError\n ? `HTTP ${err.status}`\n : err instanceof Error\n ? err.message\n : String(err);\n return {\n success: false,\n error: `Failed to import image from URL (${detail}): ${item.download_url}`\n };\n }\n}\n\nasync function uploadFromBase64(\n imageBase64: string,\n mimeType: string | undefined,\n authHeaders: Record<string, string>,\n displayName?: string\n): Promise<UploadResult | { validationError: string }> {\n const { base64Data, resolvedMimeType } = resolveBase64Image(\n imageBase64,\n mimeType\n );\n if (!resolvedMimeType) {\n return {\n validationError:\n 'Could not determine mimeType. Provide mimeType explicitly (e.g. \"image/jpeg\").'\n };\n }\n try {\n const normalized = base64Data\n .replace(/\\s/g, '')\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n const padded =\n normalized.length % 4\n ? normalized + '='.repeat(4 - (normalized.length % 4))\n : normalized;\n const binaryString = atob(padded);\n const binaryData = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++)\n binaryData[i] = binaryString.charCodeAt(i);\n const url = await uploadBinaryToMediaManager(\n binaryData,\n resolvedMimeType,\n authHeaders,\n displayName\n );\n return {\n success: true,\n id: url.split('/').pop() ?? url,\n url,\n operationStatus: 'READY'\n };\n } catch (err) {\n if (err instanceof WixFetchError) throw err;\n return { success: false, error: String(err) };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Response formatting\n// ---------------------------------------------------------------------------\n\nfunction formatSingleResult(r: UploadResult) {\n if (!r.success) return errorResponse(`Failed to upload image: ${r.error}`);\n let text = `Image uploaded successfully!\\n\\n`;\n text += `**Media ID:** ${r.id}\\n`;\n text += `**URL:** ${r.url}\\n`;\n text += `**Status:** ${r.operationStatus}\\n`;\n if ('width' in r && r.width && 'height' in r && r.height)\n text += `**Dimensions:** ${r.width}x${r.height}\\n`;\n return {\n content: [{ type: 'text' as const, text }],\n structuredContent: r\n };\n}\n\nfunction formatBatchResults(results: UploadResult[]) {\n const successCount = results.filter((r) => r.success).length;\n const failureCount = results.length - successCount;\n let text =\n failureCount === 0\n ? `Uploaded ${successCount} image(s) successfully!\\n\\n`\n : `Uploaded ${successCount} of ${results.length} image(s) (${failureCount} failed).\\n\\n`;\n results.forEach((r, i) => {\n text += r.success\n ? `${i + 1}. OK \u2014 ID: ${r.id}, URL: ${r.url}\\n`\n : `${i + 1}. FAILED \u2014 ${r.error}\\n`;\n });\n return {\n isError: successCount === 0 ? (true as const) : undefined,\n content: [{ type: 'text' as const, text }],\n structuredContent: { results }\n };\n}\n\n// ---------------------------------------------------------------------------\n// Tool registration\n// ---------------------------------------------------------------------------\n\nexport function addUploadImageTool(\n server: WixMcpServer,\n strategy: McpAuthenticationStrategy,\n options?: {\n description?: string;\n hints?: ToolHintsConfig;\n }\n) {\n const description =\n options?.description ?? defaultToolDescriptions.UploadImageToWixSite;\n const hints = {\n readOnlyHint: options?.hints?.readOnlyHint ?? false,\n destructiveHint: options?.hints?.destructiveHint ?? false,\n openWorldHint: options?.hints?.openWorldHint ?? true\n };\n\n server.registerTool(\n UPLOAD_IMAGE_TOOL_NAME,\n {\n title: 'Upload Image to Wix Site',\n description,\n inputSchema: (() => {\n const d = desc('UploadImageToWixSite');\n return {\n siteId: z\n .string()\n .uuid('siteId must be a valid Wix site ID (UUID)')\n .describe(d.siteId),\n displayName: z.string().optional().describe(d.displayName),\n // Flow 1: ChatGPT file attachments. Item shape MUST match OpenAI's\n // documented file schema (enforced by the scanner for `openai/fileParams`):\n // download_url + file_id required, file_name + mime_type optional.\n // Declaring this exact shape is also what makes the platform resolve an\n // attachment into { download_url, file_id, ... } instead of a bare file-id.\n image: z\n .array(\n z.object({\n download_url: z.string(),\n file_id: z.string(),\n file_name: z.string().optional(),\n mime_type: z.string().optional()\n })\n )\n .optional()\n .describe(d.image),\n // Flow 1b: plain public URLs (not chat attachments, so no file_id).\n // NOT an `openai/fileParams` field \u2014 the model passes raw URL strings.\n imageUrls: z.array(z.string()).optional().describe(d.imageUrls),\n // Flow 2: base64-encoded image (clients that can read and encode files)\n imageBase64: z.string().optional().describe(d.imageBase64),\n mimeType: z.string().optional().describe(d.mimeType)\n };\n })(),\n _meta: {\n 'openai/fileParams': ['image'],\n 'openai/toolInvocation/invoking':\n 'Uploading image to Wix Media Manager...',\n 'openai/toolInvocation/invoked': 'Image uploaded successfully'\n },\n annotations: hints\n },\n async (\n {\n siteId,\n image,\n imageUrls,\n imageBase64,\n mimeType,\n displayName\n }: {\n siteId: string;\n image?: ImageItem[];\n imageUrls?: string[];\n imageBase64?: string;\n mimeType?: string;\n displayName?: string;\n },\n { setToolBiParams }\n ) => {\n setToolBiParams({ siteId });\n\n // Attachments (image) and plain URLs (imageUrls) both upload via download_url.\n // ChatGPT resolves each `image` attachment into { download_url, file_id }\n // (fileParams); imageUrls carries plain public URLs the user pasted.\n const urlItems: ImageItem[] = [\n ...(image ?? []),\n ...(imageUrls ?? []).map((url) => ({ download_url: url, file_id: url }))\n ];\n const total = urlItems.length + (imageBase64 ? 1 : 0);\n\n if (total === 0) {\n return errorResponse(\n 'Provide one of: image (attachments), imageUrls (public URLs), or imageBase64 + mimeType.'\n );\n }\n\n logger.log(`[WixMCP] Uploading ${total} image(s) to Wix site: ${siteId}`);\n\n try {\n const authHeaders = await strategy.getSiteAuthHeaders(siteId);\n\n const urlResults = await Promise.all(\n urlItems.map((item) => uploadFromUrl(item, authHeaders, displayName))\n );\n\n let base64Result: UploadResult | null = null;\n if (imageBase64) {\n const result = await uploadFromBase64(\n imageBase64,\n mimeType,\n authHeaders,\n displayName\n );\n if ('validationError' in result)\n return errorResponse(result.validationError);\n base64Result = result;\n }\n\n const results = [\n ...urlResults,\n ...(base64Result ? [base64Result] : [])\n ];\n return results.length === 1\n ? formatSingleResult(results[0])\n : formatBatchResults(results);\n } catch (error) {\n const raw = error instanceof Error ? error.message : String(error);\n const detail = raw.trimStart().startsWith('<')\n ? 'Wix returned an HTML error page (the request was rejected \u2014 usually a bad file name/type or an invalid siteId).'\n : raw;\n const message = `Failed to upload image(s) to Wix: ${detail}`;\n logger.error(message);\n rethrowIfUnauthorized(error);\n await strategy.enforceValidWixToken?.(error);\n return errorResponse(message);\n }\n }\n );\n}\n", "/**\n * Hard ceiling shared by every tool-result truncation path (code-mode's\n * truncateResponse and api-call's formatApiResponse), applied on top of\n * whatever maxResponseSize a caller requests via createWixToolkit. Protects\n * this process from buffering an unbounded string even when a host opts into\n * a much larger limit (e.g. to hand the full payload to its own\n * artifact-upload guard instead of a truncated blob).\n */\nexport const MAX_ALLOWED_RESPONSE_CHARS = 2_000_000;\n", "import { z } from 'zod';\nimport { HttpClient, HttpError } from '@wix/http-client';\nimport { logger } from '../infra/logger.js';\nimport { WixMcpServer } from '../wix-mcp-server.js';\nimport { handleWixAPIResponse } from '../tool-utils.js';\nimport {\n McpAuthenticationStrategy,\n rethrowIfUnauthorized\n} from '../auth/index.js';\nimport { isApiUrlAllowed } from './validation.js';\nimport { addUploadImageTool } from './upload-image-tool.js';\nimport { defaultToolDescriptions } from '../config/default-config.js';\nimport { desc } from '../config/param-descriptions.js';\nimport { MAX_ALLOWED_RESPONSE_CHARS } from '../infra/response-size-limits.js';\n\nexport interface ToolHintsConfig {\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n openWorldHint?: boolean;\n}\n\nexport { addUploadImageTool } from './upload-image-tool.js';\n\nconst DEFAULT_MAX_RESPONSE_SIZE = 50000; // ~50KB cap\n\nfunction formatApiResponse(\n responseData: unknown,\n maxResponseSize = DEFAULT_MAX_RESPONSE_SIZE\n): {\n text: string;\n isError: boolean;\n} {\n // Detect if response is HTML (likely wrong endpoint or auth redirect)\n if (\n typeof responseData === 'string' &&\n responseData.trim().startsWith('<!DOCTYPE')\n ) {\n return {\n text: 'Error: API returned HTML instead of JSON. This usually means the URL is incorrect or points to a web page instead of an API endpoint. Please verify the URL.',\n isError: true\n };\n }\n\n let responseText = JSON.stringify(responseData);\n const effectiveMax = Math.min(maxResponseSize, MAX_ALLOWED_RESPONSE_CHARS);\n\n if (responseText.length > effectiveMax) {\n responseText =\n responseText.slice(0, effectiveMax) +\n `\\n...[TRUNCATED - response was ${responseText.length} chars, showing first ${effectiveMax}]`;\n }\n\n return { text: responseText, isError: false };\n}\n\nexport function addApiCallTool(\n server: WixMcpServer,\n strategy: McpAuthenticationStrategy,\n allowedTools: string[] = ['CallWixSiteAPI', 'ListWixSites', 'ManageWixSite'],\n disableTools: string[] = [],\n enableTools: string[] = [],\n toolDescriptions?: Record<string, string>,\n toolHints?: Record<string, ToolHintsConfig>,\n maxResponseSize?: number\n) {\n // Compute effective allowed tools: (default + enableTools) - disableTools\n const effectiveAllowedTools = [\n ...new Set([...allowedTools, ...enableTools])\n ].filter((tool) => !disableTools.includes(tool));\n // Helper to get tool hints with defaults\n const getHints = (\n toolName: string,\n defaults: {\n readOnlyHint: boolean;\n destructiveHint: boolean;\n openWorldHint: boolean;\n }\n ) => ({\n readOnlyHint: toolHints?.[toolName]?.readOnlyHint ?? defaults.readOnlyHint,\n destructiveHint:\n toolHints?.[toolName]?.destructiveHint ?? defaults.destructiveHint,\n openWorldHint:\n toolHints?.[toolName]?.openWorldHint ?? defaults.openWorldHint\n });\n // Helper to get description (custom or default)\n const getDescription = (toolName: string, defaultDesc: string): string =>\n toolDescriptions?.[toolName] ?? defaultDesc;\n\n if (\n effectiveAllowedTools.includes('CallWixSiteAPI') &&\n !disableTools.includes('CallWixSiteAPI')\n ) {\n server.tool(\n 'CallWixSiteAPI',\n getDescription('CallWixSiteAPI', defaultToolDescriptions.CallWixSiteAPI),\n (() => {\n const d = desc('CallWixSiteAPI');\n return {\n siteId: z.string().describe(d.siteId),\n url: z.string().url().describe(d.url),\n method: z.string().describe(d.method),\n body: z\n .union([z.object({}).passthrough(), z.array(z.unknown())])\n .optional()\n .describe(d.body),\n reason: z.string().describe(d.reason),\n sourceDocUrl: z.string().describe(d.sourceDocUrl)\n };\n })(),\n getHints('CallWixSiteAPI', {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: false\n }),\n async (\n { url, body, method, siteId, reason, sourceDocUrl },\n { httpClient, setToolBiParams }\n ) => {\n logger.log(\n `[CallWixSiteAPI] siteId=${siteId}, method=${method}, url=${url}, sourceDocUrl=${sourceDocUrl}, reason=\"${reason}\", body=${JSON.stringify(body)}`\n );\n const requestHeaders = {\n // Ask the Wix API edge for JSON error bodies (it serves a branded HTML\n // error page on 4xx otherwise); */* keeps non-JSON responses working.\n Accept: 'application/json, text/plain, */*',\n ...(await strategy.getSiteAuthHeaders(siteId)),\n ...(body ? { 'Content-Type': 'application/json' } : {})\n };\n\n const { isAllowed, error: urlError } = isApiUrlAllowed(url);\n if (!isAllowed) {\n return {\n content: [\n {\n isError: true,\n type: 'text',\n text: `Error validating URL: ${urlError}`\n }\n ]\n };\n }\n\n try {\n const response = await httpClient.request({\n url,\n method: method as any,\n headers: requestHeaders,\n data: method === 'GET' ? undefined : body\n });\n\n const requestId = response.headers?.['x-wix-request-id'];\n setToolBiParams({ requestId, siteId });\n\n const responseData = await handleWixAPIResponse(response);\n const formatted = formatApiResponse(responseData, maxResponseSize);\n\n if (formatted.isError) {\n return {\n content: [\n {\n type: 'text',\n text: formatted.text\n }\n ],\n isError: true\n };\n }\n\n return {\n content: [\n {\n type: 'text',\n text: `Wix Site API call successful: ${formatted.text}`\n }\n ]\n };\n } catch (error) {\n let requestId: string | undefined;\n if (HttpClient.isHttpError(error)) {\n requestId = error.requestId;\n }\n\n setToolBiParams({ requestId, siteId });\n\n const errorMessage = `Failed to call Wix Site API: ${error}. ${requestId ? `Request ID: ${requestId}` : ''}`;\n logger.error(errorMessage);\n\n await strategy.enforceValidWixToken?.(error);\n\n const response = (error as HttpError).response;\n if (!response) {\n throw new Error(errorMessage);\n }\n\n return handleWixAPIResponse(response);\n }\n }\n );\n }\n\n if (\n effectiveAllowedTools.includes('ListWixSites') &&\n !disableTools.includes('ListWixSites')\n ) {\n server.tool(\n 'ListWixSites',\n getDescription('ListWixSites', defaultToolDescriptions.ListWixSites),\n (() => {\n const d = desc('ListWixSites');\n return {\n nameSearch: z.string().optional().describe(d.nameSearch),\n limit: z.number().optional().describe(d.limit),\n cursor: z.string().optional().describe(d.cursor)\n };\n })(),\n getHints('ListWixSites', {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false\n }),\n async ({ nameSearch, limit, cursor }, { httpClient }) => {\n try {\n const cursorPaging: { limit: number; cursor?: string } = {\n limit: limit ?? 21\n };\n if (cursor) {\n cursorPaging.cursor = cursor;\n }\n\n const sitesRes = await httpClient.post(\n 'https://www.wixapis.com/site-list/v2/sites/query',\n {\n query: {\n cursorPaging,\n filter: {\n ...(nameSearch\n ? {\n name: nameSearch\n }\n : {}),\n namespace: {\n $in: ['WIX', 'DASHBOARD_FIRST', 'ANYWHERE', 'HEADLESS']\n }\n }\n }\n },\n {\n headers: {\n ...(await strategy.getAccountAuthHeaders()),\n 'Content-Type': 'application/json',\n Accept: 'application/json, text/plain, */*'\n }\n }\n );\n\n const result =\n sitesRes.data.sites?.map(({ id, displayName }: any) => ({\n id,\n name: displayName\n })) ?? [];\n\n const pagingMetadata = sitesRes.data.metadata;\n const nextCursor = pagingMetadata?.cursors?.next;\n const hasNext = !!nextCursor;\n const count = pagingMetadata?.count;\n\n const responseData = {\n sites: result,\n pagination: {\n hasNext,\n nextCursor: nextCursor || null,\n count: count\n }\n };\n\n const instructionText =\n 'if there is more than one site returned, the user should pick one from a list, list the sites (only name) for the user and ask them to pick one, ' +\n `If more than 20 are found you should list all 20 and suggest to search by the name of the site they are looking for. To fetch the next batch of sites, call ListWixSites again with the cursor parameter set to \"${nextCursor}\"`;\n\n return {\n content: [\n {\n type: 'text',\n text: [JSON.stringify(responseData), instructionText].join(\n '\\n\\n'\n )\n }\n ]\n };\n } catch (error) {\n rethrowIfUnauthorized(error);\n await strategy.enforceValidWixToken?.(error);\n throw error;\n }\n }\n );\n }\n\n if (\n effectiveAllowedTools.includes('ManageWixSite') &&\n !disableTools.includes('ManageWixSite')\n ) {\n server.tool(\n 'ManageWixSite',\n getDescription('ManageWixSite', defaultToolDescriptions.ManageWixSite),\n (() => {\n const d = desc('ManageWixSite');\n return {\n url: z.string().url().describe(d.url),\n method: z.string().describe(d.method),\n body: z\n .union([z.object({}).passthrough(), z.array(z.unknown())])\n .optional()\n .describe(d.body),\n reason: z.string().optional().describe(d.reason)\n };\n })(),\n getHints('ManageWixSite', {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: false\n }),\n async ({ url, body, method, reason }, { httpClient }) => {\n logger.log(\n `Calling Wix Account level API: ${url}, reason=\"${reason}\", body: ${JSON.stringify(body)}`\n );\n\n const { isAllowed, error: urlError } = isApiUrlAllowed(url);\n if (!isAllowed) {\n return {\n content: [\n {\n isError: true,\n type: 'text',\n text: `Error validating URL: ${urlError}`\n }\n ]\n };\n }\n\n // Fetch auth headers before try/catch so UnauthorizedError propagates to wrapToolCallback\n const accountAuthHeaders = await strategy.getAccountAuthHeaders();\n try {\n // if we would like to allow the user to manage multiple accounts, we should add accountId to the params\n const response = await httpClient.request({\n url,\n method: method as any,\n headers: {\n ...accountAuthHeaders,\n ...(body ? { 'Content-Type': 'application/json' } : {})\n },\n data: method === 'GET' ? undefined : body\n });\n\n const responseData = await handleWixAPIResponse(response);\n const formatted = formatApiResponse(responseData, maxResponseSize);\n\n if (formatted.isError) {\n return {\n content: [\n {\n type: 'text',\n text: formatted.text\n }\n ],\n isError: true\n };\n }\n\n return {\n content: [\n {\n type: 'text',\n text: `Wix Account API call successful: ${formatted.text}`\n }\n ]\n };\n } catch (error) {\n logger.error(`Failed to call Wix Account API: ${error}`);\n rethrowIfUnauthorized(error);\n await strategy.enforceValidWixToken?.(error);\n\n const response = (error as HttpError).response;\n if (!response) {\n throw new Error(`Failed to call Wix Account API: ${error}`);\n }\n\n return handleWixAPIResponse(response);\n }\n }\n );\n }\n\n if (\n effectiveAllowedTools.includes('UploadImageToWixSite') &&\n !disableTools.includes('UploadImageToWixSite')\n ) {\n addUploadImageTool(server, strategy, {\n description: getDescription('UploadImageToWixSite', ''),\n hints: toolHints?.['UploadImageToWixSite']\n });\n }\n}\n", "import { MAX_ALLOWED_RESPONSE_CHARS } from '../infra/response-size-limits.js';\n\nconst CHARS_PER_TOKEN = 4;\nconst DEFAULT_MAX_TOKENS = 6000;\nconst DEFAULT_MAX_CHARS = DEFAULT_MAX_TOKENS * CHARS_PER_TOKEN;\n\n/**\n * @param maxChars Caller-supplied ceiling (e.g. a host that wants the full\n * result to hand off to its own artifact-upload guard instead of a truncated\n * blob). Always clamped to MAX_ALLOWED_RESPONSE_CHARS regardless of what's\n * requested, so this process never buffers an unbounded string.\n */\nexport function truncateResponse(\n content: unknown,\n maxChars: number = DEFAULT_MAX_CHARS\n): string {\n const text = typeof content === 'string' ? content : JSON.stringify(content);\n\n const effectiveMax = Math.min(maxChars, MAX_ALLOWED_RESPONSE_CHARS);\n\n if (!text || text.length <= effectiveMax) {\n return text ?? '';\n }\n\n const truncated = text.slice(0, effectiveMax);\n const estimatedTokens = Math.ceil(text.length / CHARS_PER_TOKEN);\n const limitTokens = Math.ceil(effectiveMax / CHARS_PER_TOKEN);\n\n return `${truncated}\\n\\n--- TRUNCATED ---\\nResponse was ~${estimatedTokens.toLocaleString()} tokens (limit: ${limitTokens.toLocaleString()}). Refine your code to return less data.`;\n}\n", "// Shared validation for the `code` argument of ExecuteWixAPI. Used both by the\n// tool (packages/public-mcp/src/code-mode/index.ts) to reject malformed code\n// before the network round-trip, and by the runtime executor\n// (packages/public-mcp-remote-server/src/code-mode/executor.ts) which imports\n// this to reject at execution time \u2014 one source of truth, same hint.\nexport const EXECUTE_FUNCTION_EXPRESSION_HINT =\n 'ExecuteWixAPI code must be a function expression, not a script body. ' +\n 'Pass code like: async () => { const response = await wix.request({ scope: \"site\", method: \"GET\", url: \"https://www.wixapis.com/...\" }); return response.data; }. ' +\n 'Do not write top-level const/await/return outside the function and do not invoke the function yourself.';\n\nexport interface CodeValidationResult {\n isValid: boolean;\n error?: string;\n}\n\nexport function validateExecuteCode(code: string): CodeValidationResult {\n const trimmed = code.trim();\n const expression = trimmed.startsWith('(')\n ? trimmed.slice(1).trimStart()\n : trimmed;\n const isAsyncFunctionExpression =\n /^async\\s+function(?:\\s+\\w+)?\\s*\\(/.test(expression) ||\n /^async\\s*\\([^)]*\\)\\s*=>/.test(expression) ||\n /^async\\s+\\w+\\s*=>/.test(expression);\n const invokesFunctionExpression = /\\)\\s*\\(\\s*\\)\\s*;?\\s*$/.test(trimmed);\n const namedFunctionWithTrailingCode =\n /^async\\s+function\\s+\\w+\\s*\\(/.test(expression) &&\n !expression.endsWith('}');\n\n if (\n !isAsyncFunctionExpression ||\n invokesFunctionExpression ||\n namedFunctionWithTrailingCode\n ) {\n return { isValid: false, error: EXECUTE_FUNCTION_EXPRESSION_HINT };\n }\n return { isValid: true };\n}\n", "import { z } from 'zod';\nimport { WixMcpServer } from '../wix-mcp-server.js';\nimport { logger } from '../infra/logger.js';\nimport { defaultToolDescriptions } from '../config/default-config.js';\nimport { truncateResponse } from './truncate-response.js';\nimport { validateExecuteCode } from './validation.js';\nimport { desc } from '../config/param-descriptions.js';\nimport {\n type McpAuthenticationStrategy,\n type McpHeaders,\n rethrowIfUnauthorized\n} from '../auth/index.js';\nimport { WixFetchError } from '../wix-fetch-error.js';\n\nexport interface CodeModeOptions {\n codeModeBaseUrl: string;\n authStrategy?: McpAuthenticationStrategy;\n /**\n * Visitor mode: pin ExecuteWixAPI to one site and take an agent-supplied\n * visitor token (a site-scoped bearer token) instead of an account/site auth\n * strategy. Mutually used in place of `authStrategy`.\n */\n visitor?: { siteId: string };\n disableTools?: string[];\n toolDescriptions?: Record<string, string>;\n /** Max response size in chars before truncation (default: 24,000, ~6,000 tokens). */\n maxResponseSize?: number;\n}\n\nconst SEARCH_TOOL_NAME = 'SearchWixAPISpec';\nexport const EXECUTE_TOOL_NAME = 'ExecuteWixAPI';\n\nexport async function addCodeModeTools(\n server: WixMcpServer,\n options: CodeModeOptions\n) {\n const {\n codeModeBaseUrl,\n authStrategy,\n disableTools = [],\n toolDescriptions,\n maxResponseSize\n } = options;\n\n if (!disableTools.includes(SEARCH_TOOL_NAME)) {\n await addSearchTool(\n server,\n codeModeBaseUrl,\n disableTools,\n toolDescriptions,\n maxResponseSize,\n authStrategy\n );\n }\n\n if (!disableTools.includes(EXECUTE_TOOL_NAME) && authStrategy) {\n addExecuteCodeModeTool(server, {\n codeModeBaseUrl,\n authStrategy,\n disableTools,\n toolDescriptions,\n maxResponseSize\n });\n }\n}\n\n/**\n * Sync registration of SearchWixAPISpec without the optional\n * fetchCategoryTree description enrichment. Use this from sync entry points\n * such as createWixToolkit; use addCodeModeTools when you can await and want\n * the description enriched with the live top-level vertical tree.\n */\nexport function addSearchCodeModeTool(\n server: WixMcpServer,\n options: CodeModeOptions\n) {\n const {\n codeModeBaseUrl,\n authStrategy,\n disableTools = [],\n toolDescriptions,\n maxResponseSize\n } = options;\n\n if (disableTools.includes(SEARCH_TOOL_NAME)) {\n return;\n }\n\n const description =\n toolDescriptions?.[SEARCH_TOOL_NAME] ??\n defaultToolDescriptions.SearchWixAPISpec;\n registerSearchTool(\n server,\n codeModeBaseUrl,\n description,\n maxResponseSize,\n authStrategy\n );\n}\n\nexport function addExecuteCodeModeTool(\n server: WixMcpServer,\n options: CodeModeOptions\n) {\n const {\n codeModeBaseUrl,\n authStrategy,\n visitor,\n disableTools = [],\n toolDescriptions,\n maxResponseSize\n } = options;\n\n if ((!authStrategy && !visitor) || disableTools.includes(EXECUTE_TOOL_NAME)) {\n return;\n }\n\n addExecuteTool(server, {\n codeModeBaseUrl,\n authStrategy,\n visitor,\n toolDescriptions,\n maxResponseSize\n });\n}\n\nconst CATEGORY_TREE_CODE = `async function() {\n const tree = {};\n lightIndex.forEach(r => {\n const top = r.menuPath[0];\n const sub = r.menuPath[1];\n if (!tree[top]) tree[top] = {};\n if (sub) { if (!tree[top][sub]) tree[top][sub] = 0; tree[top][sub]++; }\n });\n return Object.entries(tree).map(([cat, subs]) => {\n const total = Object.values(subs).reduce((a, b) => a + b, 0);\n return cat + ' [' + total + ' resources]: ' + Object.keys(subs).join(', ');\n }).join('\\\\n');\n}`;\n\nasync function fetchCategoryTree(\n codeModeBaseUrl: string,\n authorization?: string\n): Promise<string | null> {\n // Precomputed by the server's spec-sync cron. The legacy path below ran\n // CATEGORY_TREE_CODE in a Dynamic Worker on every tool registration \u2014\n // one billable isolate per MCP session; keep it only as a fallback for\n // servers that predate the category-tree endpoint.\n try {\n const resp = await fetch(`${codeModeBaseUrl}/api/code-mode/category-tree`, {\n headers: authorization ? { Authorization: authorization } : {}\n });\n if (resp.ok) {\n const data = (await resp.json()) as { result?: unknown };\n if (typeof data.result === 'string') return data.result;\n }\n } catch {\n // fall through to the search-based fallback\n }\n return fetchCategoryTreeViaSearch(\n `${codeModeBaseUrl}/api/code-mode/search`,\n authorization\n );\n}\n\nasync function fetchCategoryTreeViaSearch(\n searchUrl: string,\n authorization?: string\n): Promise<string | null> {\n try {\n const resp = await fetch(searchUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...(authorization ? { Authorization: authorization } : {})\n },\n body: JSON.stringify({ code: CATEGORY_TREE_CODE })\n });\n if (!resp.ok) return null;\n const data = (await resp.json()) as { result?: unknown };\n return typeof data.result === 'string' ? data.result : null;\n } catch {\n return null;\n }\n}\n\nasync function addSearchTool(\n server: WixMcpServer,\n codeModeBaseUrl: string,\n _disableTools: string[],\n toolDescriptions?: Record<string, string>,\n maxResponseSize?: number,\n authStrategy?: McpAuthenticationStrategy\n) {\n let description =\n toolDescriptions?.[SEARCH_TOOL_NAME] ??\n defaultToolDescriptions.SearchWixAPISpec;\n\n const categoryTree = await fetchCategoryTree(\n codeModeBaseUrl,\n await resolveLoopbackAuthorization(authStrategy)\n );\n if (categoryTree) {\n description = description.replace(/Top-level verticals:.*$/m, categoryTree);\n }\n\n registerSearchTool(\n server,\n codeModeBaseUrl,\n description,\n maxResponseSize,\n authStrategy\n );\n}\n\nconst SEARCH_MAX_RESPONSE_CHARS = 64_000;\n\n/**\n * Search needs no auth of its own; without a header the call is bucketed by the\n * Worker's own IP (see postExecute). Anonymous sessions throw here and stay on\n * that bucket rather than failing.\n */\nasync function resolveLoopbackAuthorization(\n authStrategy?: McpAuthenticationStrategy\n): Promise<string | undefined> {\n try {\n return (await authStrategy?.getAccountAuthHeaders())?.Authorization;\n } catch {\n return undefined;\n }\n}\n\nfunction registerSearchTool(\n server: WixMcpServer,\n codeModeBaseUrl: string,\n description: string,\n maxResponseSize?: number,\n authStrategy?: McpAuthenticationStrategy\n) {\n const searchUrl = `${codeModeBaseUrl}/api/code-mode/search`;\n\n server.tool(\n SEARCH_TOOL_NAME,\n description,\n {\n code: z\n .string()\n .describe(\n 'JavaScript async function() expression to search the Wix API index. Has access to `lightIndex` (array of resources) and `getResourceSchema(resourceId)` (returns full schema).'\n ),\n reason: z\n .string()\n .describe(\n 'One sentence describing the original user request and why you are searching or inspecting the Wix API spec.'\n )\n },\n { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async ({ code, reason }) => {\n logger.log(\n `[SearchWixAPISpec] Executing search (${code.length} chars), reason=\"${reason}\"`\n );\n\n try {\n const authorization = await resolveLoopbackAuthorization(authStrategy);\n const resp = await fetch(searchUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...(authorization ? { Authorization: authorization } : {})\n },\n body: JSON.stringify({ code })\n });\n\n if (!resp.ok) {\n const errorBody = await resp.text();\n logger.log(`[SearchWixAPISpec] HTTP ${resp.status}: ${errorBody}`);\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Search error (${resp.status}): ${errorBody}`\n }\n ]\n };\n }\n\n const data = (await resp.json()) as {\n result?: unknown;\n error?: string;\n };\n\n if (data.error) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Search error: ${data.error}`\n }\n ]\n };\n }\n\n const text = truncateResponse(\n data.result,\n maxResponseSize ?? SEARCH_MAX_RESPONSE_CHARS\n );\n\n return {\n content: [{ type: 'text', text }]\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n logger.log(`[SearchWixAPISpec] Error: ${message}`);\n return {\n isError: true,\n content: [{ type: 'text', text: `Search error: ${message}` }]\n };\n }\n }\n );\n}\n\ninterface ExecuteResponse {\n result?: unknown;\n error?: string;\n authErrorStatus?: number;\n}\n\ntype ToolTextResult = {\n content: { type: 'text'; text: string }[];\n isError?: boolean;\n};\n\n/**\n * POST agent code to the runtime execute endpoint. Throws WixFetchError on a\n * transport-level failure (non-2xx HTTP); a sandbox/user error comes back as\n * `{ error }` in the parsed body with HTTP 200 (see endpoints.ts handleExecute).\n *\n * `authorization` is forwarded as a real header: tokens otherwise ride only in\n * the body, and `codeModeBaseUrl` loops back through the same public Worker, so\n * the call looked anonymous to `rateLimiterMiddleware` and shared its IP-keyed\n * bucket \u2014 it comes from the Durable Object, not the client.\n */\nasync function postExecute(\n executeUrl: string,\n body: Record<string, unknown>,\n authorization?: string\n): Promise<ExecuteResponse> {\n const resp = await fetch(executeUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...(authorization ? { Authorization: authorization } : {})\n },\n body: JSON.stringify(body)\n });\n\n if (!resp.ok) {\n const errorBody = await resp.text();\n logger.log(`[ExecuteWixAPI] HTTP ${resp.status}: ${errorBody}`);\n throw new WixFetchError(resp.status, resp.statusText, errorBody);\n }\n\n return (await resp.json()) as ExecuteResponse;\n}\n\nfunction executeErrorResult(message: string): ToolTextResult {\n return {\n isError: true,\n content: [{ type: 'text', text: `Execute error: ${message}` }]\n };\n}\n\nfunction executeTextResult(message: string): ToolTextResult {\n return {\n content: [{ type: 'text', text: message }]\n };\n}\n\nfunction formatExecuteResult(\n data: ExecuteResponse,\n maxResponseSize?: number\n): ToolTextResult {\n if (data.error) {\n return executeErrorResult(data.error);\n }\n return {\n content: [\n { type: 'text', text: truncateResponse(data.result, maxResponseSize) }\n ]\n };\n}\n\ninterface AddExecuteToolOptions {\n codeModeBaseUrl: string;\n authStrategy?: McpAuthenticationStrategy;\n visitor?: { siteId: string };\n toolDescriptions?: Record<string, string>;\n maxResponseSize?: number;\n}\n\n/**\n * Register ExecuteWixAPI. Two modes share one tool name:\n * - account/site (default): tokens come from the `authStrategy`; the agent may\n * pass a `siteId` and pick `scope`.\n * - visitor (`options.visitor`): no auth strategy \u2014 the agent passes a\n * `visitorToken` (from GenerateVisitorToken). A visitor token is a\n * site-scoped bearer token, so it is sent as `siteToken` with the pinned\n * `siteId` (and as `accountToken` only to satisfy the runtime's required\n * field). No runtime change is needed; account scope is not exposed.\n */\ninterface ExecuteToolArgs {\n code: string;\n reason: string;\n hasMutations: boolean;\n sourceDocUrls: string[];\n siteId?: string;\n visitorToken?: string;\n}\n\nfunction addExecuteTool(server: WixMcpServer, options: AddExecuteToolOptions) {\n const {\n codeModeBaseUrl,\n authStrategy,\n visitor,\n toolDescriptions,\n maxResponseSize\n } = options;\n const executeUrl = `${codeModeBaseUrl}/api/code-mode/execute`;\n const d = desc('ExecuteWixAPI');\n\n server.tool(\n EXECUTE_TOOL_NAME,\n toolDescriptions?.[EXECUTE_TOOL_NAME] ??\n defaultToolDescriptions.ExecuteWixAPI,\n {\n code: z\n .string()\n .describe(\n [\n 'JavaScript async function expression to execute against the Wix REST API. The value must be the function itself, for example `async function() { ... }` or `async () => { ... }`, not a script body and not an invoked function.',\n 'Return the final answer from inside the function. Do not write top-level `const`, top-level `await`, or top-level `return` outside the function body.',\n 'Do not import Node.js built-ins such as `fs`, `path`, or `node:*`, and do not try to write files from this code; ExecuteWixAPI only returns data from the function.',\n visitor\n ? 'Use `wix.request({ method, url, body })` for Wix API calls. Every call runs against the current visitor site; do not set `scope`, `siteId`, or auth headers. Full Wix API URLs and paths starting with `/` are supported.'\n : 'Use `wix.request({ method, url, body })` for Wix API calls. Scope defaults to `site` when a `siteId` is available \u2014 either the ExecuteWixAPI `siteId` parameter or a per-request `siteId` on the `wix.request` call \u2014 and to `account` when neither is set; set `scope` explicitly when needed. Full Wix API URLs and paths starting with `/` are supported. For MULTIPLE sites, handle them all in this ONE call: map over the site IDs and fan out with `Promise.allSettled`, passing a per-request `siteId` to each `wix.request({ scope: \"site\", siteId, method, url, body })`; the runtime obtains each site\\'s token automatically. Do NOT invoke ExecuteWixAPI once per site. When `siteId` is omitted, the tool-level `siteId` is used.',\n 'Wix REST API page size limits vary \u2014 use 100 as a safe default unless the method schema (via SearchWixAPISpec) confirms a higher limit is supported. For cursor-based APIs, pass the next cursor as `cursorPaging: { limit: 100, cursor: pagingMetadata.cursors.next }` \u2014 not inside `paging`. Check the method schema to confirm whether the API uses `paging` (offset-based) or `cursorPaging` (cursor-based) before paginating.'\n ].join(' ')\n ),\n reason: z\n .string()\n .describe(\n 'One sentence explaining the original user request and why you are executing code to complete it.'\n ),\n hasMutations: z\n .boolean()\n .describe(\n visitor\n ? 'Whether this code creates, updates, deletes, publishes, imports, uploads, or otherwise mutates site data on the visitor\u2019s behalf. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false.'\n : 'Whether this code creates, updates, deletes, publishes, installs, imports, uploads, or otherwise mutates Wix data or site/account state. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false.'\n ),\n sourceDocUrls: z.array(z.string()).describe(d.sourceDocUrls),\n // Visitor mode takes an agent-supplied token and pins the site; account/site\n // mode lets the agent pick the site.\n ...(visitor\n ? {\n visitorToken: z\n .string()\n .describe(\n 'Visitor access token. If you have it in your context, ALWAYS use it and do not create a new one. If you do not have it in your context, use the GenerateVisitorToken tool to get it.'\n )\n }\n : {\n siteId: z\n .string()\n .optional()\n .describe(\n 'Default Wix site ID for the `wix.request()` calls in this execution. Optional in the schema, but required for site-level work: supply a `siteId` either here, as the default for every request, or on an individual request. Without one, a request runs at account scope, where site-level endpoints fail. Setting `scope: \"account\"` on a request runs it at account scope and ignores any `siteId`. Determine the target site with GetSiteContext or ListWixSites before calling; do not pass a guessed or empty value.'\n )\n })\n },\n { readOnlyHint: false, destructiveHint: true, openWorldHint: false },\n async (\n rawArgs: ExecuteToolArgs,\n // Partial: duck-typed servers (the toolkit's capturing server, test\n // doubles) build their own extra and may not supply every field.\n extra?: { toolInvocationId?: string }\n ) => {\n const { code, reason, hasMutations, sourceDocUrls, visitorToken } =\n rawArgs;\n // In visitor mode the site is pinned; otherwise it comes from the param.\n const siteId = visitor ? visitor.siteId : rawArgs.siteId;\n\n logger.log(\n `[ExecuteWixAPI]${visitor ? ' (visitor)' : ''} Executing code (${code.length} chars), siteId=${siteId ?? 'none'}, hasMutations=${hasMutations}, sourceDocUrls=${JSON.stringify(sourceDocUrls)}, reason=\"${reason}\"`\n );\n\n // Reject malformed code up front (before any token fetch) with the same\n // hint the runtime returns, so the agent gets an actionable error without\n // a wasted round-trip.\n const validation = validateExecuteCode(code);\n if (!validation.isValid) {\n logger.log(\n `[ExecuteWixAPI]${visitor ? ' (visitor)' : ''} Rejected invalid code: ${validation.error}`\n );\n return executeTextResult(validation.error!);\n }\n\n // Account/site mode resolves tokens from the strategy (before the try so\n // an UnauthorizedError propagates to wrapToolCallback). Visitor mode has no\n // strategy \u2014 these stay undefined and the visitor token is used instead.\n const accountHeaders = await authStrategy?.getAccountAuthHeaders();\n // Lets the runtime obtain per-site tokens for multi-site calls. Resolved\n // before the try so an UnauthorizedError propagates to wrapToolCallback.\n const siteAuthContext =\n !visitor && authStrategy?.getSiteAuthContext\n ? await authStrategy.getSiteAuthContext()\n : undefined;\n // Pre-resolve the default site's token (fast path). When siteAuthContext\n // is present the runtime can resolve any site on demand, so a stale\n // tool-level siteId must not fail the whole call \u2014 the per-request targets\n // may all be valid. Without it (single-site), let the error propagate.\n let siteHeaders: McpHeaders | undefined;\n if (authStrategy && siteId) {\n if (siteAuthContext) {\n try {\n siteHeaders = await authStrategy.getSiteAuthHeaders(siteId);\n } catch {\n siteHeaders = undefined;\n }\n } else {\n siteHeaders = await authStrategy.getSiteAuthHeaders(siteId);\n }\n }\n\n // Identity for the runtime's fetch-failure BI events. Telemetry-only \u2014 the\n // runtime must never treat these as auth. Optional-called because this tool\n // is also registered against duck-typed servers (the toolkit's capturing\n // server, test doubles) that implement only tool()/registerTool().\n const userId = server.getUserId?.();\n const sessionId = server.getSessionId?.();\n // Per-invocation, so it can only come from `extra` \u2014 the server has no\n // accessor for it. Joins these API-call rows to their tool row.\n const toolInvocationId = extra?.toolInvocationId;\n\n try {\n const data = await postExecute(\n executeUrl,\n {\n code,\n siteId,\n userId,\n sessionId,\n toolInvocationId,\n clientName: server.server?.getClientVersion?.()?.name,\n // A visitor token is a site-scoped bearer token: sent as siteToken\n // (\u2192 Authorization + wix-site-id) and as accountToken only to satisfy\n // the runtime's required field. Account/site mode uses strategy tokens.\n siteToken: visitor ? visitorToken : siteHeaders?.Authorization,\n accountToken: visitor\n ? visitorToken\n : accountHeaders?.Authorization,\n accountId: accountHeaders?.['wix-account-id'],\n siteAuthContext\n },\n visitor\n ? visitorToken\n : (accountHeaders?.Authorization ?? siteHeaders?.Authorization)\n );\n\n // Visitor mode can't refresh server-side, so steer the agent to regenerate.\n if (data.authErrorStatus && visitor) {\n return executeErrorResult(\n `Visitor token rejected (HTTP ${data.authErrorStatus}). Call GenerateVisitorToken to obtain a fresh token, then retry.`\n );\n }\n if (data.authErrorStatus) {\n await authStrategy?.enforceValidWixToken?.({\n status: data.authErrorStatus\n });\n }\n\n return formatExecuteResult(data, maxResponseSize);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n logger.log(\n `[ExecuteWixAPI]${visitor ? ' (visitor)' : ''} Error: ${message}`\n );\n // No-ops in visitor mode: visitor errors aren't UnauthorizedError and\n // there is no strategy to enforce.\n rethrowIfUnauthorized(err);\n await authStrategy?.enforceValidWixToken?.(err);\n\n return executeErrorResult(message);\n }\n }\n );\n}\n", null, "// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}", "import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;", "const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};", "import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;", null, null, "function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };", "import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };", "import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };", "import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };", null, "export const last = (arr?: any[]) =>\n Array.isArray(arr) ? arr[arr.length - 1] : undefined;\n\nexport const union = <T>(...args: T[][]) => [...new Set(args.flat()).values()];\n\n/**\n * The reason spread operator is not used here is because of its behavior when passing an entry with undefined value explicitly:\n * const a = { hello: 'world' }\n * const b = {...a, hello: undefined }; // {hello: undefined}\n * We want to ignore the undefined value and use the defined value from the previous object instead.\n */\nexport const defaults = <T extends Record<string, any>>(\n ...args: (T | undefined)[]\n) =>\n args.reduce<T>(\n (res, obj) =>\n Object.entries(obj ?? {}).reduce((_res, [key, value]) => {\n if (typeof _res[key] === 'undefined' && typeof value !== 'undefined') {\n (_res as Record<string, any>)[key] = value;\n }\n\n return _res;\n }, res),\n {} as T,\n );\n\nexport const deepDefaults = <T extends Record<string, any>>(\n dest?: T,\n ...rest: (T | undefined)[]\n): T | undefined => {\n const keys = union<keyof T>(...rest.map((value) => Object.keys(value ?? {})));\n const all = [dest, ...rest];\n\n return keys.reduce<T | undefined>(\n (res, key) => {\n const values = all.map((value) => value?.[key]);\n const merged = defaults(...(values as [T[keyof T]]));\n\n const hasValues =\n Object.values(merged).filter((value) => typeof value !== 'undefined')\n .length > 0;\n\n if (hasValues) {\n res = res ?? ({} as T);\n res[key] = merged;\n } else {\n delete res?.[key];\n }\n\n return res;\n },\n dest ? { ...dest } : dest,\n );\n};\n", "import { bindPrototypeMethodsToSelf } from '@wix/panorama-common/utils';\nimport type { ErrorUserData } from '@wix/panorama-common-shared/types';\nimport type { Breadcrumb, ErrorMonitorOptions } from './types';\nimport { BasePanoramaClient } from './panorama-client-base';\n\nexport interface PanoramaErrorMonitor<T extends ErrorUserData> {\n reportError(error: Error, data?: T): void;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n}\n\nexport class PanoramaErrorMonitorImpl<T extends ErrorUserData> {\n constructor(\n private readonly baseClient: BasePanoramaClient,\n private readonly options?: ErrorMonitorOptions,\n ) {\n bindPrototypeMethodsToSelf(this);\n }\n\n reportError(error: Error, data?: T) {\n this.baseClient.reportError(error, data, this.options);\n }\n\n addBreadcrumb(breadcrumb: Breadcrumb) {\n this.baseClient.addBreadcrumb(breadcrumb);\n }\n}\n", "import { bindPrototypeMethodsToSelf } from '@wix/panorama-common/utils';\nimport { BasePanoramaClient } from './panorama-client-base';\nimport { LogLevel } from '@wix/panorama-common-shared/types';\n\nexport interface PanoramaLogger {\n info(message: string, data?: Record<string, any>): void;\n\n warn(message: string, data?: Record<string, any>): void;\n\n error(message: string, data?: Record<string, any>): void;\n\n debug(message: string, data?: Record<string, any>): void;\n}\n\nexport class PanoramaLoggerImpl implements PanoramaLogger {\n constructor(private readonly baseClient: BasePanoramaClient) {\n bindPrototypeMethodsToSelf(this);\n }\n\n public info(message: string, data?: Record<string, any>): void {\n this.baseClient.log(LogLevel.Info, message, data);\n }\n\n public warn(message: string, data?: Record<string, any>): void {\n this.baseClient.log(LogLevel.Warn, message, data);\n }\n\n public error(message: string, data?: Record<string, any>): void {\n this.baseClient.log(LogLevel.Error, message, data);\n }\n\n public debug(message: string, data?: Record<string, any>): void {\n this.baseClient.log(LogLevel.Debug, message, data);\n }\n}\n", null, "import { bindPrototypeMethodsToSelf } from '@wix/panorama-common/utils';\nimport type { TransactionUserData } from '@wix/panorama-common-shared/types';\nimport {\n type CustomTransactionName,\n isCustomTransactionName,\n} from '@wix/panorama-common-shared/utils';\nimport { type BasePanoramaClient } from './panorama-client-base';\nimport type { TransactionOptions } from './types';\nimport { defaults } from './utils/general-utils';\n\nexport interface PanoramaTransaction {\n start: (data?: TransactionUserData, options?: TransactionOptions) => void;\n finish: (data?: TransactionUserData, options?: TransactionOptions) => void;\n}\n\nexport class PanoramaTransactionImpl implements PanoramaTransaction {\n constructor(\n private readonly baseClient: BasePanoramaClient,\n private readonly name: CustomTransactionName<string>,\n private readonly options?: TransactionOptions,\n ) {\n if (!isCustomTransactionName(name)) {\n throw new Error(`\"${name}\" is an internal transaction and can't be used`);\n }\n\n this.baseClient = baseClient;\n\n bindPrototypeMethodsToSelf(this);\n }\n\n start(data?: TransactionUserData, options?: TransactionOptions) {\n return this.baseClient.reportTransactionStart(\n this.name,\n defaults(options, this.options),\n data,\n );\n }\n\n finish(data?: TransactionUserData, options?: TransactionOptions) {\n return this.baseClient.reportTransactionFinish(\n this.name,\n defaults(options, this.options),\n data,\n );\n }\n}\n", "import { bindPrototypeMethodsToSelf } from '@wix/panorama-common/utils';\nimport { type CustomTransactionName } from '@wix/panorama-common-shared/utils';\nimport { type BasePanoramaClient } from './panorama-client-base';\nimport {\n type PanoramaErrorMonitor,\n PanoramaErrorMonitorImpl,\n} from './panorama-error-monitor';\nimport { type PanoramaLogger, PanoramaLoggerImpl } from './panorama-logger';\nimport type {\n ErrorMonitorOptionsForComponent,\n ErrorMonitorUserData,\n TransactionOptions,\n} from './types';\nimport {\n type PanoramaTransaction,\n PanoramaTransactionImpl,\n} from './panorama-transaction';\n\ninterface Options {\n baseClient: BasePanoramaClient;\n}\n\nexport interface PanoramaClientForComponent {\n transaction<T extends string>(\n name: CustomTransactionName<T>,\n options?: TransactionOptions,\n ): PanoramaTransaction;\n\n errorMonitor(\n options?: ErrorMonitorOptionsForComponent,\n ): PanoramaErrorMonitor<ErrorMonitorUserData>;\n\n logger(): PanoramaLogger;\n}\n\nexport class PanoramaClientForComponentImpl\n implements PanoramaClientForComponent\n{\n private baseClient: BasePanoramaClient;\n\n constructor({ baseClient }: Options) {\n this.baseClient = baseClient;\n\n bindPrototypeMethodsToSelf(this);\n }\n\n transaction(\n name: CustomTransactionName<string>,\n options?: TransactionOptions,\n ) {\n return new PanoramaTransactionImpl(this.baseClient, name, options);\n }\n\n errorMonitor(\n options?: ErrorMonitorOptionsForComponent,\n ): PanoramaErrorMonitor<ErrorMonitorUserData> {\n return new PanoramaErrorMonitorImpl(this.baseClient, options);\n }\n\n logger(): PanoramaLogger {\n return new PanoramaLoggerImpl(this.baseClient);\n }\n}\n", "import type {\n EventPayload,\n ErrorUserData,\n TransactionUserData,\n PhaseUserData,\n} from '@wix/panorama-common-shared/types';\nimport { LogLevel } from '@wix/panorama-common-shared/types';\nimport type { PanoramaClientForComponent } from '../panorama-client-component';\nimport type { Breadcrumb, ErrorData, ErrorMonitorOptions } from '../types';\n\nexport enum Hook {\n afterCreateClientForComponent,\n beforeReport,\n beforeReportTransactionStart,\n afterReportTransactionStart,\n beforeReportTransactionFinish,\n afterReportTransactionFinish,\n beforeReportPhaseStart,\n afterReportPhaseStart,\n beforeReportPhaseFinish,\n afterReportPhaseFinish,\n beforeReportError,\n afterReportError,\n beforeAddBreadcrumb,\n afterAddBreadcrumb,\n beforeReportLog,\n afterReportLog,\n beforeUnhandledError,\n}\n\ntype Subscriber<T extends any[]> = (...args: T) => false | void;\n\ntype ArgsByHook = {\n [Hook.afterCreateClientForComponent]: [client: PanoramaClientForComponent];\n [Hook.beforeReport]: [eventPayload: EventPayload];\n [Hook.beforeReportTransactionStart]: [\n transactionName: string,\n data?: TransactionUserData,\n ];\n [Hook.beforeReportTransactionFinish]: [\n transactionName: string,\n data?: TransactionUserData,\n ];\n [Hook.afterReportTransactionStart]: [\n transactionName: string,\n eventPayload: EventPayload,\n ];\n [Hook.afterReportTransactionFinish]: [\n transactionName: string,\n eventPayload: EventPayload,\n ];\n [Hook.beforeReportPhaseStart]: [\n transactionName: string,\n data?: PhaseUserData,\n ];\n [Hook.beforeReportPhaseFinish]: [\n transactionName: string,\n data?: PhaseUserData,\n ];\n [Hook.afterReportPhaseStart]: [\n transactionName: string,\n eventPayload: EventPayload,\n ];\n [Hook.afterReportPhaseFinish]: [\n transactionName: string,\n eventPayload: EventPayload,\n ];\n [Hook.beforeReportError]: [\n error: Error,\n data?: ErrorData & ErrorUserData,\n errorMonitorOptions?: ErrorMonitorOptions,\n ];\n [Hook.afterReportError]: [\n error: Error,\n data?: ErrorData & ErrorUserData,\n errorMonitorOptions?: ErrorMonitorOptions,\n ];\n [Hook.beforeAddBreadcrumb]: [Breadcrumb];\n [Hook.afterAddBreadcrumb]: [Breadcrumb];\n [Hook.beforeReportLog]: [\n logLevel: LogLevel,\n message: string,\n data?: Record<string, any>,\n ];\n [Hook.afterReportLog]: [\n logLevel: LogLevel,\n message: string,\n data?: Record<string, any>,\n ];\n [Hook.beforeUnhandledError]: [error?: Error];\n};\n\ntype SubscribersByHook = {\n [P in Hook]?: Subscriber<ArgsByHook[P]>[];\n};\n\nexport type SubscriberByHook = {\n [P in Hook]: Subscriber<ArgsByHook[P]>;\n};\n\nexport class HooksManager {\n private readonly subscribers: SubscribersByHook = {};\n\n tap<T extends Hook>(hook: T, subscriber: Subscriber<ArgsByHook[T]>) {\n this.subscribers[hook] = this.subscribers[hook] || [];\n this.subscribers[hook]!.push(subscriber);\n }\n\n invoke<T extends Hook>(hook: T, ...args: ArgsByHook[T]): boolean {\n const subscribers = this.subscribers[hook];\n\n if (!subscribers) {\n return true;\n }\n\n for (const subscriber of subscribers) {\n if (subscriber(...args) === false) {\n return false;\n }\n }\n\n return true;\n }\n}\n", "import { bindPrototypeMethodsToSelf } from '@wix/panorama-common/utils';\nimport {\n PhaseName,\n type TransactionUserData,\n} from '@wix/panorama-common-shared/types';\nimport { type BasePanoramaClient } from './panorama-client-base';\n\nexport interface PanoramaPhase {\n start: (data?: TransactionUserData) => void;\n finish: (data?: TransactionUserData) => void;\n}\n\nexport class PanoramaPhaseImpl implements PanoramaPhase {\n constructor(\n private readonly name: PhaseName,\n private readonly baseClient: BasePanoramaClient,\n ) {\n this.baseClient = baseClient;\n\n bindPrototypeMethodsToSelf(this);\n }\n\n start(data?: TransactionUserData) {\n return this.baseClient.reportPhaseStart(this.name, data);\n }\n\n finish(data?: TransactionUserData) {\n return this.baseClient.reportPhaseFinish(this.name, data);\n }\n}\n", "import { bindPrototypeMethodsToSelf } from '@wix/panorama-common/utils';\nimport {\n InternalTransactions,\n type PhaseName,\n type TransactionUserData,\n} from '@wix/panorama-common-shared/types';\nimport { type CustomTransactionName } from '@wix/panorama-common-shared/utils';\nimport {\n type PanoramaClientForComponent,\n PanoramaClientForComponentImpl,\n} from './panorama-client-component';\nimport type { BasePanoramaClient } from './panorama-client-base';\nimport {\n Hook,\n type HooksManager,\n type SubscriberByHook,\n} from './plugins/hooks-manager';\nimport {\n type PanoramaErrorMonitor,\n PanoramaErrorMonitorImpl,\n} from './panorama-error-monitor';\nimport { PanoramaLogger, PanoramaLoggerImpl } from './panorama-logger';\nimport type {\n ErrorMonitorOptions,\n ErrorMonitorUserData,\n TransactionOptions,\n} from './types';\nimport {\n type PanoramaTransaction,\n PanoramaTransactionImpl,\n} from './panorama-transaction';\nimport { type PanoramaPhase, PanoramaPhaseImpl } from './panorama-phase';\n\ninterface Options {\n hooksManager: HooksManager;\n baseClient: BasePanoramaClient;\n}\n\nexport interface PanoramaClient {\n onUnhandledError(\n subscriber: SubscriberByHook[Hook.beforeUnhandledError],\n ): void;\n\n reportLoadStart(\n data?: TransactionUserData,\n options?: TransactionOptions,\n ): void;\n\n reportLoadFinish(\n data?: TransactionUserData,\n options?: TransactionOptions,\n ): void;\n\n phase(name: PhaseName): PanoramaPhase;\n\n transaction<T extends string>(\n name: CustomTransactionName<T>,\n options?: TransactionOptions,\n ): PanoramaTransaction;\n\n errorMonitor(\n options?: ErrorMonitorOptions,\n ): PanoramaErrorMonitor<ErrorMonitorUserData>;\n\n logger(): PanoramaLogger;\n\n createClientForComponent(): PanoramaClientForComponent;\n}\n\nexport class PanoramaClientImpl implements PanoramaClient {\n private baseClient: BasePanoramaClient;\n private hooksManager: HooksManager;\n\n constructor({ hooksManager, baseClient }: Options) {\n this.baseClient = baseClient;\n this.hooksManager = hooksManager;\n\n bindPrototypeMethodsToSelf(this);\n }\n\n onUnhandledError(subscriber: SubscriberByHook[Hook.beforeUnhandledError]) {\n this.hooksManager.tap(Hook.beforeUnhandledError, subscriber);\n }\n\n reportLoadStart(data?: TransactionUserData, options?: TransactionOptions) {\n const { ComponentLoad } = InternalTransactions;\n\n return this.baseClient.reportTransactionStart(ComponentLoad, options, data);\n }\n\n reportLoadFinish(data?: TransactionUserData, options?: TransactionOptions) {\n const { ComponentLoad } = InternalTransactions;\n\n return this.baseClient.reportTransactionFinish(\n ComponentLoad,\n options,\n data,\n );\n }\n\n phase(name: PhaseName) {\n return new PanoramaPhaseImpl(name, this.baseClient);\n }\n\n transaction(\n name: CustomTransactionName<string>,\n options?: TransactionOptions,\n ) {\n return new PanoramaTransactionImpl(this.baseClient, name, options);\n }\n\n errorMonitor(\n options?: ErrorMonitorOptions,\n ): PanoramaErrorMonitor<ErrorMonitorUserData> {\n return new PanoramaErrorMonitorImpl<ErrorMonitorUserData>(\n this.baseClient,\n options,\n );\n }\n\n logger(): PanoramaLogger {\n return new PanoramaLoggerImpl(this.baseClient);\n }\n\n createClientForComponent(): PanoramaClientForComponent {\n const client = new PanoramaClientForComponentImpl({\n baseClient: this.baseClient,\n });\n\n this.hooksManager.invoke(Hook.afterCreateClientForComponent, client);\n\n return client;\n }\n}\n", "import type { Event } from '@sentry/browser';\nimport type { IHttpError } from '@wix/http-client';\nimport { WixHttpErrorDetails } from '../types';\nimport { defaults } from './general-utils';\n\nconst extractWixHttpErrorDetailsRec = (\n error?: Error | IHttpError,\n): WixHttpErrorDetails => {\n if (!(error instanceof Error)) {\n return {};\n }\n\n const res = extractWixHttpErrorDetailsRec(error.cause as any);\n const httpClientError = error as IHttpError;\n\n return defaults<WixHttpErrorDetails>(res, {\n isWixHttpError: httpClientError.isWixHttpError,\n requestId:\n httpClientError.response?.headers?.['x-wix-request-id'] ??\n httpClientError.requestId,\n });\n};\n\nexport const extractWixHttpErrorDetails = (\n error?: Error | IHttpError,\n): WixHttpErrorDetails =>\n defaults<WixHttpErrorDetails>(extractWixHttpErrorDetailsRec(error), {\n isWixHttpError: false,\n requestId: '',\n });\n\nexport const normalizeError = (event: Event, error?: unknown): Error => {\n if (!(error instanceof Error)) {\n const err = new Error(typeof error === 'string' ? error : event.message);\n\n delete err.stack;\n\n return err;\n }\n\n return error;\n};\n\nexport const createUndedupableError = (error: Error) => {\n const { message, stack, cause } = error;\n\n const res = Object.assign(Object.create(Object.getPrototypeOf(error)), {\n name: `${Date.now() + Math.random()}`,\n message,\n stack,\n cause,\n });\n\n return res;\n};\n", "export const MAX_STACK_TRACE_SIZE_BYTES = 32 * 1024;\nexport const MAX_SESSION_TIME_MS = 24 * 60 * 60 * 1000; // 1 day\n", "import type { EventPayload } from '@wix/panorama-common-shared/types';\nimport { MAX_SESSION_TIME_MS, MAX_STACK_TRACE_SIZE_BYTES } from '../constants';\n\nexport const sanitizePayload = (payload: EventPayload) => {\n const { errorStack, sessionTime } = payload;\n\n if (errorStack && errorStack.length > MAX_STACK_TRACE_SIZE_BYTES) {\n const truncationMessage = `...[truncated by Panorama client to ${\n MAX_STACK_TRACE_SIZE_BYTES / 1024\n }kb]`;\n\n const truncatedErrorStack = errorStack.substring(\n 0,\n MAX_STACK_TRACE_SIZE_BYTES - truncationMessage.length,\n );\n\n payload = {\n ...payload,\n errorStack: `${truncatedErrorStack}${truncationMessage}`,\n };\n }\n\n if (sessionTime && sessionTime > MAX_SESSION_TIME_MS) {\n payload = {\n ...payload,\n sessionTime: MAX_SESSION_TIME_MS,\n };\n }\n\n return payload;\n};\n", "import {\n InternalTransactions,\n LogLevel,\n} from '@wix/panorama-common-shared/types';\nimport type {\n BaseParams,\n TransactionParams,\n InternalParams,\n ErrorUserData,\n TransactionUserData,\n EventPayload,\n TransactionEventPayload,\n ErrorEventPayload,\n LoggerParams,\n PhaseUserData,\n PhaseParams,\n PhaseEventPayload,\n} from '@wix/panorama-common-shared/types';\nimport type { GlobalConfig } from '@wix/panorama-common/global-config';\nimport { extractWixHttpErrorDetails } from '../utils/error-utils';\nimport { sanitizePayload } from './payload-sanitizer';\n\nconst getSessionParams = (\n globalConfig: GlobalConfig,\n): Pick<InternalParams, 'sessionId' | 'sessionTime'> => {\n const sessionId = globalConfig.getSessionId();\n const sessionTime = Math.round(globalConfig.getSessionTime());\n\n return { sessionId, sessionTime };\n};\n\nexport const buildTransactionPayload = (\n globalConfig: GlobalConfig,\n baseParams: BaseParams,\n transactionParams: TransactionParams,\n data?: TransactionUserData,\n): TransactionEventPayload => {\n const { transactionName, transactionAction } = transactionParams;\n\n const { sessionId, sessionTime } = getSessionParams(globalConfig);\n const logLevel = LogLevel.Info;\n const message = `Panorama ${transactionName} ${transactionAction}`;\n const requestId = '';\n\n return sanitizePayload({\n ...baseParams,\n ...transactionParams,\n sessionId,\n sessionTime,\n logLevel,\n requestId,\n message,\n data,\n });\n};\n\nexport const buildPhasePayload = (\n globalConfig: GlobalConfig,\n baseParams: BaseParams,\n phaseParams: PhaseParams,\n data?: PhaseUserData,\n): PhaseEventPayload => {\n const transactionName = InternalTransactions.ComponentPhase;\n const { phaseName, transactionAction } = phaseParams;\n\n const { sessionId, sessionTime } = getSessionParams(globalConfig);\n const logLevel = LogLevel.Info;\n const message = `Panorama ${phaseName} phase ${transactionAction}`;\n const requestId = '';\n\n return sanitizePayload({\n ...baseParams,\n ...phaseParams,\n transactionName,\n sessionId,\n sessionTime,\n logLevel,\n requestId,\n message,\n data,\n });\n};\n\nexport const buildErrorPayload = (\n globalConfig: GlobalConfig,\n baseParams: BaseParams,\n error: Error,\n data?: ErrorUserData,\n): ErrorEventPayload => {\n const { sessionId, sessionTime } = getSessionParams(globalConfig);\n const { constructor, message, stack = '' } = error;\n const logLevel = LogLevel.Error;\n const { requestId } = extractWixHttpErrorDetails(error);\n\n return sanitizePayload({\n ...baseParams,\n sessionId,\n sessionTime,\n logLevel,\n requestId,\n data,\n errorName: data?.errorName ?? constructor.name,\n errorStack: stack,\n message,\n });\n};\n\nexport const buildLoggerPayload = (\n globalConfig: GlobalConfig,\n baseParams: BaseParams,\n loggerParams: LoggerParams,\n): EventPayload => {\n const { sessionId, sessionTime } = getSessionParams(globalConfig);\n const requestId = '';\n\n return sanitizePayload({\n ...baseParams,\n ...loggerParams,\n sessionId,\n sessionTime,\n requestId,\n });\n};\n", "// import type { IHttpError } from '@wix/http-client';\nimport type {\n Reporter,\n BaseParams,\n LogLevel,\n ErrorUserData,\n TransactionUserData,\n EventPayload,\n UserParams,\n PhaseUserData,\n} from '@wix/panorama-common-shared/types';\nimport { TransactionAction } from '@wix/panorama-common-shared/types';\nimport type { GlobalConfig } from '@wix/panorama-common/global-config';\nimport {\n createDurationTracker,\n type DurationTracker,\n} from '@wix/panorama-common/duration-tracker';\nimport {\n buildErrorPayload,\n buildLoggerPayload,\n buildPhasePayload,\n buildTransactionPayload,\n} from './lib/payload-builder';\nimport { Hook, type HooksManager } from './plugins/hooks-manager';\nimport type {\n Breadcrumb,\n ErrorMonitorOptions,\n TransactionOptions,\n} from './types';\nimport type { Scope } from './lib/scope';\n\ninterface Options {\n baseParams: BaseParams;\n globalConfig: GlobalConfig;\n reporter: Reporter;\n hooksManager: HooksManager;\n data: Scope<NonNullable<UserParams['data']>>;\n isMuted: () => boolean;\n}\n\nexport class BasePanoramaClient {\n private durationTracker: DurationTracker;\n private readonly baseParams: BaseParams;\n private readonly globalConfig: GlobalConfig;\n private readonly reporter: Reporter;\n private readonly hooksManager: HooksManager;\n private readonly data: Scope<NonNullable<UserParams['data']>>;\n private readonly isMuted: () => boolean;\n\n constructor({\n baseParams,\n globalConfig,\n reporter,\n hooksManager,\n data,\n isMuted,\n }: Options) {\n this.baseParams = baseParams;\n this.globalConfig = globalConfig;\n this.reporter = reporter;\n this.hooksManager = hooksManager;\n this.data = data;\n this.isMuted = isMuted;\n\n // For backward compatibility in cases where GlobalConfig version is older than what we expect\n this.durationTracker =\n typeof globalConfig.getDurationTracker === 'function'\n ? globalConfig.getDurationTracker()\n : createDurationTracker();\n }\n\n private report(eventPayload: EventPayload) {\n if (this.isMuted()) {\n return;\n }\n\n const reporterOverride = this.globalConfig.getReporter();\n const beforeReportHookResult = this.hooksManager.invoke(\n Hook.beforeReport,\n eventPayload,\n );\n\n if (typeof reporterOverride === 'function') {\n reporterOverride(eventPayload);\n return;\n }\n\n if (!beforeReportHookResult) {\n return;\n }\n\n this.reporter(eventPayload);\n }\n\n getErrorMonitorDataWithDefaults = (\n ...args: (ErrorUserData | undefined)[]\n ) => {\n return this.data.addDataScope(args).getData();\n };\n\n reportTransactionStart(\n name: string,\n options: TransactionOptions = {},\n data?: TransactionUserData,\n ) {\n const { id } = options;\n const dataWithDefault = this.data.addDataScope(data).getData();\n\n if (\n !this.hooksManager.invoke(\n Hook.beforeReportTransactionStart,\n name,\n dataWithDefault,\n )\n ) {\n return;\n }\n\n const { fullArtifactId, componentId } = this.baseParams;\n\n this.durationTracker.markTransactionStart(\n fullArtifactId!,\n componentId!,\n name,\n id,\n );\n\n const payload = buildTransactionPayload(\n this.globalConfig,\n this.baseParams,\n {\n transactionName: name,\n transactionAction: TransactionAction.Start,\n },\n dataWithDefault,\n );\n\n this.report(payload);\n\n this.hooksManager.invoke(Hook.afterReportTransactionStart, name, payload);\n }\n\n reportTransactionFinish(\n name: string,\n options: TransactionOptions = {},\n data?: TransactionUserData,\n ) {\n const { id } = options;\n const dataWithDefault = this.data.addDataScope(data).getData();\n\n if (\n !this.hooksManager.invoke(\n Hook.beforeReportTransactionFinish,\n name,\n dataWithDefault,\n )\n ) {\n return;\n }\n\n const { fullArtifactId, componentId } = this.baseParams;\n\n const duration = this.durationTracker.markTransactionFinish(\n fullArtifactId!,\n componentId!,\n name,\n id,\n );\n\n const payload = buildTransactionPayload(\n this.globalConfig,\n this.baseParams,\n {\n transactionName: name,\n transactionAction: TransactionAction.Finish,\n transactionDuration: duration,\n },\n dataWithDefault,\n );\n\n this.report(payload);\n\n this.hooksManager.invoke(Hook.afterReportTransactionFinish, name, payload);\n }\n\n reportPhaseStart(name: string, data?: PhaseUserData) {\n const dataWithDefault = this.data.addDataScope(data).getData();\n\n if (\n !this.hooksManager.invoke(\n Hook.beforeReportPhaseStart,\n name,\n dataWithDefault,\n )\n ) {\n return;\n }\n\n const { fullArtifactId, componentId } = this.baseParams;\n\n this.durationTracker.markPhaseStart(fullArtifactId!, componentId!, name);\n\n const payload = buildPhasePayload(\n this.globalConfig,\n this.baseParams,\n {\n phaseName: name,\n transactionAction: TransactionAction.Start,\n },\n dataWithDefault,\n );\n\n this.report(payload);\n\n this.hooksManager.invoke(Hook.afterReportPhaseStart, name, payload);\n }\n\n reportPhaseFinish(name: string, data?: TransactionUserData) {\n const dataWithDefault = this.data.addDataScope(data).getData();\n\n if (\n !this.hooksManager.invoke(\n Hook.beforeReportPhaseFinish,\n name,\n dataWithDefault,\n )\n ) {\n return;\n }\n\n const { fullArtifactId, componentId } = this.baseParams;\n\n const duration = this.durationTracker.markPhaseFinish(\n fullArtifactId!,\n componentId!,\n name,\n );\n\n const payload = buildPhasePayload(\n this.globalConfig,\n this.baseParams,\n {\n phaseName: name,\n transactionAction: TransactionAction.Finish,\n transactionDuration: duration,\n },\n dataWithDefault,\n );\n\n this.report(payload);\n\n this.hooksManager.invoke(Hook.afterReportPhaseFinish, name, payload);\n }\n\n reportError(\n error: Error,\n data?: ErrorUserData,\n options?: ErrorMonitorOptions,\n ) {\n if (!(error instanceof Error)) {\n return;\n }\n\n data = this.data.addDataScope([data, options?.data]).getData();\n\n if (\n !this.hooksManager.invoke(Hook.beforeReportError, error, data, options)\n ) {\n return;\n }\n\n const payload = buildErrorPayload(\n this.globalConfig,\n this.baseParams,\n error,\n data,\n );\n\n this.report(payload);\n\n this.hooksManager.invoke(Hook.afterReportError, error, data, options);\n }\n\n addBreadcrumb(breadcrumb: Breadcrumb) {\n if (!this.hooksManager.invoke(Hook.beforeAddBreadcrumb, breadcrumb)) {\n return;\n }\n\n // Currently the default implementation does nothing, we only invoke hooks\n\n this.hooksManager.invoke(Hook.afterAddBreadcrumb, breadcrumb);\n }\n\n log(logLevel: LogLevel, message: string, data?: Record<string, any>) {\n if (!message) {\n return;\n }\n\n const dataWithDefault = this.data.addDataScope(data).getData();\n\n const loggerParams = {\n message,\n data: dataWithDefault,\n logLevel,\n };\n\n if (\n !this.hooksManager.invoke(\n Hook.beforeReportLog,\n logLevel,\n message,\n dataWithDefault,\n )\n ) {\n return;\n }\n\n const payload = buildLoggerPayload(\n this.globalConfig,\n this.baseParams,\n loggerParams,\n );\n this.report(payload);\n\n this.hooksManager.invoke(\n Hook.afterReportLog,\n logLevel,\n message,\n dataWithDefault,\n );\n }\n}\n", "import { defaults, deepDefaults } from '../utils/general-utils';\n\nexport class Scope<T extends Record<string, any>> {\n private readonly data: T | undefined;\n private static readonly KEYS_TO_DEEP_DEFAULTS = ['tags', 'context'];\n\n constructor(data: T | undefined) {\n this.data = data;\n }\n\n private getEntriesToDeepDefaults(data: T | undefined): T | undefined {\n if (!data) {\n return undefined;\n }\n return Object.fromEntries(\n Object.entries(data).filter(([key]) =>\n Scope.KEYS_TO_DEEP_DEFAULTS.includes(key),\n ),\n ) as unknown as T;\n }\n\n addDataScope(data: T | undefined | (T | undefined)[]): Scope<T> {\n const outerDataArray = Array.isArray(data) ? data : [data];\n const deepDefaultData = deepDefaults(\n ...outerDataArray.map((_data) => this.getEntriesToDeepDefaults(_data)),\n this.getEntriesToDeepDefaults(this.data),\n );\n return new Scope(defaults(deepDefaultData, ...outerDataArray, this.data));\n }\n\n getData() {\n return this.data;\n }\n}\n", "import { bindPrototypeMethodsToSelf } from '@wix/panorama-common/utils';\nimport type {\n Reporter,\n BaseParams,\n EventPayload,\n} from '@wix/panorama-common-shared/types';\nimport {\n createGlobalConfig,\n type GlobalConfig,\n} from '@wix/panorama-common/global-config';\nimport { defaults } from './utils/general-utils';\nimport { type PanoramaClient, PanoramaClientImpl } from './panorama-client';\nimport type { PluginArgs, PluginFunction } from './plugins';\nimport type { ClientOptions, FactoryOptions } from './types';\nimport { HooksManager } from './plugins/hooks-manager';\nimport { BasePanoramaClient } from './panorama-client-base';\nimport { Scope } from './lib/scope';\n\nexport interface PanoramaClientFactory<Payload extends unknown = EventPayload> {\n withGlobalConfig(\n globalConfig: GlobalConfig<Payload>,\n ): PanoramaClientFactory<Payload>;\n\n withReporter(reporter: Reporter<Payload>): PanoramaClientFactory<Payload>;\n\n setMuted(isMuted: boolean): PanoramaClientFactory<Payload>;\n\n use(\n plugin: (args: PluginArgs<Payload>) => void,\n ): PanoramaClientFactory<Payload>;\n\n client(options?: ClientOptions): PanoramaClient;\n}\n\nclass PanoramaClientFactoryImpl<Payload extends unknown = EventPayload>\n implements PanoramaClientFactory<Payload>\n{\n private globalConfig?: GlobalConfig<Payload>;\n private reporter: Reporter<Payload> = () => true;\n private plugins: PluginFunction<Payload>[] = [];\n private isMuted: boolean = false;\n\n constructor(private readonly options: FactoryOptions) {\n bindPrototypeMethodsToSelf(this);\n }\n\n withGlobalConfig(globalConfig: GlobalConfig<Payload>) {\n this.globalConfig = globalConfig;\n\n return this;\n }\n\n withReporter(reporter: Reporter<Payload>) {\n this.reporter = reporter;\n\n return this;\n }\n\n setMuted(isMuted: boolean) {\n this.isMuted = isMuted;\n\n return this;\n }\n\n use(plugin: (args: PluginArgs<Payload>) => void) {\n this.plugins.push(plugin);\n\n return this;\n }\n\n client(options: ClientOptions = {}) {\n const { pluginParams } = options;\n\n const globalConfig = this.globalConfig ?? createGlobalConfig();\n const reporter = this.reporter as any;\n const hooksManager = new HooksManager();\n const baseParams = defaults(\n options.baseParams,\n this.options.baseParams,\n ) as Required<BaseParams>;\n const data = new Scope(this.options.data).addDataScope(options.data);\n\n const pluginClientParams = pluginParams ?? {};\n\n const baseClient = new BasePanoramaClient({\n baseParams,\n globalConfig: globalConfig as unknown as GlobalConfig,\n isMuted: () => this.isMuted,\n reporter,\n hooksManager,\n data,\n });\n\n const client = new PanoramaClientImpl({\n baseClient,\n hooksManager,\n });\n\n this.plugins.forEach((plugin) =>\n plugin({\n hooksManager,\n globalConfig,\n reporter,\n baseClient,\n baseParams,\n pluginParams: pluginClientParams,\n }),\n );\n\n return client;\n }\n}\n\nexport const panoramaClient = <Payload extends unknown = EventPayload>(\n options: FactoryOptions = {},\n): PanoramaClientFactory<Payload> =>\n new PanoramaClientFactoryImpl<Payload>(options);\n", null, "import { EventPayload } from '@wix/panorama-common-shared/types';\nimport { ReporterOptions } from './types';\n\nexport const nodeReporter =\n (url: string, { silent = false }: ReporterOptions = { silent: false }) =>\n (eventPayload: EventPayload): boolean => {\n const body = JSON.stringify({ logMessage: eventPayload });\n\n fetch(url, { method: 'POST', body })\n .then((res) => {\n if (res.ok || silent) {\n return;\n }\n\n console.error('Panorama report failed', res.statusText);\n })\n .catch((e) => {\n if (silent) {\n return;\n }\n\n console.error('Panorama report failed', e);\n });\n\n return true;\n };\n", "import {\n panoramaClient,\n type PanoramaClientFactory,\n type PluginParams,\n} from '@wix/panorama-client';\nimport type {\n EventPayload,\n BaseParams,\n UserParams,\n} from '@wix/panorama-common-shared/types';\nimport { CLICKHOUSE_REPORT_URL } from '@wix/panorama-common-shared/constants';\nimport { nodeReporter } from './reporter';\nimport type { ReporterOptions } from './types';\n\ninterface FactoryOptions {\n baseParams?: BaseParams;\n data?: UserParams['data'];\n pluginParams?: PluginParams;\n reporterOptions?: ReporterOptions;\n}\n\nexport type Factory = Omit<PanoramaClientFactory, 'use'>;\n\nexport const panoramaClientFactory = (options: FactoryOptions): Factory => {\n const { baseParams, reporterOptions, data } = options;\n\n const factory = panoramaClient<EventPayload>({\n baseParams,\n data,\n }).withReporter(nodeReporter(CLICKHOUSE_REPORT_URL, reporterOptions));\n\n // @ts-expect-error\n factory.use = undefined;\n\n return factory;\n};\n", "// import { createRequire } from 'module';\nimport {\n createGlobalConfig,\n panoramaClientFactory,\n PanoramaPlatform\n} from '@wix/panorama-client-node';\nimport type { ENV } from './environment.js';\nimport type { Implementation } from '@modelcontextprotocol/sdk/types.js';\n\n// const require = createRequire(import.meta.url);\n// const packageJson = require('../package.json');\n\n// TODO: use real package.json\n// I temporarily disabled this because it's not working in the remote server\nconst packageJson = {\n version: '1.0.0'\n};\n\nexport const createPanoramaClient = (opts: {\n environment: ENV;\n sessionId: string;\n componentId: string;\n uuid?: string;\n serverInfo?: Implementation;\n}) => {\n const globalPanoramaConfig = createGlobalConfig();\n globalPanoramaConfig.setSessionId(opts.sessionId);\n\n const panoramaFactory = panoramaClientFactory({\n reporterOptions: {\n silent: true\n },\n baseParams: {\n uuid: opts.uuid,\n componentId: opts.componentId,\n platform: PanoramaPlatform.Standalone,\n fullArtifactId: 'com.wixpress.spartans.wix-mcp',\n artifactVersion: packageJson.version\n },\n data: {\n environment: opts.environment,\n serverInfo: opts.serverInfo,\n runtime: {\n packageVersion: packageJson.version,\n // Browsers have no `process` global; report only the package version there.\n ...(typeof process !== 'undefined'\n ? {\n versions: process.versions,\n platform: process.platform,\n arch: process.arch\n }\n : {})\n }\n }\n }).withGlobalConfig(globalPanoramaConfig);\n\n return panoramaFactory.client();\n};\n", "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "[\n \"wix.com\",\n \"editorx.com\",\n \"wix-code.com\",\n \"wixapps.net\",\n \"wixprod.net\"\n]\n", null, null, null, null, "import { StandaloneNodeLogger } from '@wix/standalone-node-bi-logger';\nimport type { BiEvent, BiLogger } from '@wix/wix-bi-logger-client';\n\nexport function createBiLogger(defaultFields?: BiEvent): BiLogger {\n return new StandaloneNodeLogger()\n .factory({})\n .updateDefaults({\n localTime: () => Date.now(),\n ...defaultFields\n })\n .logger();\n}\n", "export enum ENV {\n DEV = 'DEV',\n TEST = 'TEST',\n LOCAL = 'LOCAL',\n REMOTE = 'REMOTE',\n PICASSO = 'PICASSO',\n VISITOR_MCP = 'VISITOR_MCP'\n}\n\nconst DEFAULT_ENV = ENV.LOCAL;\n\nexport const DEV_ENVIRONMENTS = [ENV.DEV, ENV.TEST];\n\nexport function getEnvironment(nodeEnv?: string): ENV {\n // `typeof` guard: browsers have no `process` global.\n const env =\n nodeEnv ||\n (typeof process !== 'undefined' ? process.env.NODE_ENV : undefined);\n switch (env?.toUpperCase()) {\n case 'DEV':\n return ENV.DEV;\n case 'TEST':\n return ENV.TEST;\n case 'LOCAL':\n return ENV.LOCAL;\n case 'REMOTE':\n return ENV.REMOTE;\n case 'PICASSO':\n return ENV.PICASSO;\n case 'VISITOR_MCP':\n return ENV.VISITOR_MCP;\n default:\n return DEFAULT_ENV;\n }\n}\n", "import { LogObject, apiBlockGaRuleParams, apiExampleGenerationCompletedByAiToolParams, apiKeysClickOnActionFromThe3DotsParams, apiKeysClickOnCopyAccountIdParams, apiKeysClickOnGenerateKeyEmptyStateParams, apiKeysClickOnGenerateKeyTopButtonParams, apiKeysClickOnOauthPageLinkParams, apiKeysClickOnSendCodeAgainParams, apiKeysClickOnSendCodeParams, apiKeysClickOnViewApiReferencesParams, apiKeysFinishDeleteKeyParams, apiKeysFinishDuplicateKeyParams, apiKeysFinishEditKeyParams, apiKeysFinishGenerateKeyParams, apiKeysFinishRotateKeyParams, apiKeysStartDeleteKeyParams, apiKeysStartDuplicateKeyParams, apiKeysStartEditKeyParams, apiKeysStartGenerateKeyParams, apiKeysStartRotateKeyParams, appsSettingsDeletionCandidateParams, astraCmdEnteredSrc11Evid4001Params, autoVeloSiteCallForAMethodParams, codegenAgentSessionEndSrc11Evid304Params, codegenAgentSessionErrorSrc11Evid305Params, codegenAgentSessionStartSrc11Evid299Params, copyOfHeadlessResumeSetUpDialogClickParams, devCenterWebhookSentTriggeredParams, docsAiAssistantAnswerSrc112Evid14Params, docsAiAssistantClickSrc112Evid13Params, docsAiAssistantCostSrc112Evid1436Params, docsAiAssistantOpenCloseSrc112Evid1435Params, docsRedirectFailureParams, docsSsrRequestParams, executeWixApiToolRequestSrc39Evid1612Params, gitToResourceUpdateSrc112Evid30Params, graphqlCallParams, headlessAddWixToYourProjectDialogClickParams, headlessAddWixToYourProjectDialogIsShownParams, headlessDeployThisTemplatePageClickParams, headlessDeployThisTemplatePageIsShownParams, headlessMigrationTourModalShownParams, headlessOAuthInstalledParams, headlessPlaygroundModalFinishedLoadingParams, headlessQuickStartModalShownParams, headlessResumeSetUpDialogIsShownParams, n8NTriggerActionSrc154Evid810Params, oauthAppClickAtTheCreateEditOauthAppPageParams, oauthAppClickAtTheDeleteOauthAppDialogParams, oauthAppClickAtTheGenerateClientSecretDialogParams, oauthAppClickAtTheOauthAppMainPageParams, oauthAppClickNextCloseAtTheCreateOauthAppDialogParams, oauthAppClickOnCloseFromCreateEditOauthAppPageParams, oauthAppClickOnOauthAppActionParams, oauthAppClickOnSaveFromCreateEditOauthAppPageParams, oauthAppOauthAppActionWasMadeParams, oauthAppOauthAppActionWasMadeServerParams, papiCleanExampleRunSrc11Evid290Params, prodTablesToolActionStatusSrc11Evid1999Params, prodTablesToolCtaClickSrc11Evid2000Params, publicSdkCallParams, relativeLinksFailureParams, settingsAccessParams, spiExternalInvocationSrc96Evid199Params, testSrc184Evid9999Params, testTokenTokenGeneratedServerlessParams, triggerValueWasSelectedParams, veloNamespacesInvocationSrc72Evid521Params, webMcpLoadedSrc39Evid1611Params, webhooksDispatcherResponseChannelTopicSrc155Evid3Params, webhooksInDcCodeExampleWindowClicksParams, webhooksInDcCodeExampleWindowScrollParams, webhooksInDcCreateEventPageClicksParams, webhooksInDcMainPageClicksParams, webhooksInDcTriggeredTestModalClicksParams, wixDocs404PageLoadedParams, wixDocsChangelogFilterUsageParams, wixDocsChangelogItemSeenParams, wixDocsChangelogRssModalActionsParams, wixDocsChooseASearchResultParams, wixDocsClickInPageParams, wixDocsClickOnGiveFeedbackParams, wixDocsClickOnItemParams, wixDocsClickOnLinksParams, wixDocsClickOnSidebarItemParams, wixDocsClickedOnNavbarParams, wixDocsCloseSearchDialogParams, wixDocsContactOwnerLinkClickedParams, wixDocsCopyCodeParams, wixDocsDocsWasPublishedParams, wixDocsFeedbackSubmittedServerParams, wixDocsFinishLoadingPageParams, wixDocsGiveFeedbackClickParams, wixDocsHoverOnContentTermsParams, wixDocsHoverOverASearchResultItemParams, wixDocsHoverParams, wixDocsMainPageClickParams, wixDocsMainPageScrollParams, wixDocsMenuEditorContentFilterChangeParams, wixDocsMenuEditorEditModeStatusChangeParams, wixDocsMenuEditorInstructionsClicksParams, wixDocsMenuEditorReviewSaveModalClicksParams, wixDocsMenuEditorSideBarActionClickParams, wixDocsMenuEditorSideBarActionFinishedParams, wixDocsMenuEditorSideBarActionMoveToReviewParams, wixDocsMenuEditorSideBarPositionChangedParams, wixDocsMenuEditorVersionsSideBarClicksParams, wixDocsMenuEditorVersionsSideBarLoadedParams, wixDocsModalClickParams, wixDocsModalWasCloseParams, wixDocsModalWasOpenParams, wixDocsNavbarLoadedParams, wixDocsNavigationClickParams, wixDocsObjectShowMembersClickParams, wixDocsOpenCloseExamplesParams, wixDocsPlaygroundLinksDropdownClickParams, wixDocsRedirectByExternalIdSrc112Evid1601Params, wixDocsRelatedSiteClickParams, wixDocsScrollingInSearchResultViewParams, wixDocsSearchOpenedParams, wixDocsSearchResultsParams, wixDocsSendRequestClientParams, wixDocsSendRequestServerParams, wixDocsShareableLinkClickParams, wixDocsSidebarStateParams, wixDocsSiteVisitParams, wixDocsStartLoadingPageParams, wixDocsSubmitFeedbackParams, wixDocsToggleClickParams, wixDocsTryItOutClickParams, wixDocsTypeASearchTermParams, wixDocsViewLiveSiteClickParams, wixDocsViewSourceClickParams, wixDocsVisitLocalViewerParams, wixMcpRequestSrc39Evid1607Params, zapierCustomZapCreatedOrDeletedParams, zapierTestDataClickParams } from '../types';\n\n/**\n * A function to create a log object for the 'wixDocsSendRequestClient' event (evid: 11)\n *\n * Event description: Wix Docs - Send Request (Client)\n *\n * @param {wixDocsSendRequestClientParams} params - The parameters for this event\n * @property {string} body - body type\n * @property {string} customer_id - customer id\n * @property {string} category_name - category name\n * @property {Url} article_url - article_url\n * @property {Url} invoked_url - invoked_url\n * @property {string} http_method - http method type - GET/POST/DELETE/PATCH etc)\n * @property {string} article_name - article name\n * @property {boolean} is_test_token_used - is_test_token_used\n * @return {LogObject<wixDocsSendRequestClientParams>} LogObject<wixDocsSendRequestClientParams>\n */\nexport function wixDocsSendRequestClient(params: wixDocsSendRequestClientParams): LogObject<wixDocsSendRequestClientParams> {\n return { evid: 11, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsPlaygroundLinksDropdownClick' event (evid: 12)\n *\n * Event description: Click on Playground Links Dropdown\n *\n * @param {wixDocsPlaygroundLinksDropdownClickParams} params - The parameters for this event\n * @property {string} customer_id - customer_id\n * @property {string} article_url - article url\n * @property {string} article_name - article name\n * @property {boolean} is_main_url_broken - is main url broken\n * @property {string} urls_count - urls count\n * @property {string} selected_url - selected url\n * @return {LogObject<wixDocsPlaygroundLinksDropdownClickParams>} LogObject<wixDocsPlaygroundLinksDropdownClickParams>\n */\nexport function wixDocsPlaygroundLinksDropdownClick(params: wixDocsPlaygroundLinksDropdownClickParams): LogObject<wixDocsPlaygroundLinksDropdownClickParams> {\n return { evid: 12, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsViewLiveSiteClick' event (evid: 1300)\n *\n * Event description: User clicks on 'View Live Site'\n *\n * @param {wixDocsViewLiveSiteClickParams} params - The parameters for this event\n * @property {string} page - page\n * @return {LogObject<wixDocsViewLiveSiteClickParams>} LogObject<wixDocsViewLiveSiteClickParams>\n */\nexport function wixDocsViewLiveSiteClick(params: wixDocsViewLiveSiteClickParams): LogObject<wixDocsViewLiveSiteClickParams> {\n return { evid: 1300, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsStartLoadingPage' event (evid: 1400)\n *\n * Event description: Tracks each time a user starts to load a page within the Wix Docs platform. It captures details about the article being viewed, such as its type, name, and category. The event also includes context about the user's session, including the navigation source, view mode, and whether it is their first access.\n *\n * @param {wixDocsStartLoadingPageParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} source - redirect (link) / social / referral (navigation inside the platform )/ organic search (google)\n * @property {string} session_id - The current user`s session in the product\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {number} screen_width - Screen width for resolution\n * @property {string} object - The object of the article, can be empty\n * @property {boolean} has_edit_permission - True if the user has edit permission for the current article\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - the article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {number} screen_height - Screen height for resolution\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {boolean} is_first_access - True if this is the first time that the user opened the Wix Docs platform for this session\n * @property {string} nav_type - search result click, side bar click, tab click, internal link navigation ,scroll\n * @property {string} page_url - The url of the current page\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {boolean} is_triggered_by_toggle - it this page load triggered by the REST/SDK toggle, instead of a regular page reload\n * @property {boolean} page_exists - True if the page exists - false if the user landed on resource that is not exists\n * @property {string} deprecation_status - deprecation status of the item/page\n * @return {LogObject<wixDocsStartLoadingPageParams>} LogObject<wixDocsStartLoadingPageParams>\n */\nexport function wixDocsStartLoadingPage(params: wixDocsStartLoadingPageParams): LogObject<wixDocsStartLoadingPageParams> {\n return { evid: 1400, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsFinishLoadingPage' event (evid: 1401)\n *\n * Event description: Loading time of the first page finished load in Wix Docs.\n *\n * @param {wixDocsFinishLoadingPageParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} source - redirect (link) / social / referral (navigation inside the platform )/ organic search (google)\n * @property {string} session_id - The current user`s session in the product\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {number} screen_width - Screen width for resolution\n * @property {string} object - The object of the article, can be empty\n * @property {boolean} has_edit_permission - True if the user has edit permission for the current article\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - the article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {number} screen_height - Screen height for resolution\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {boolean} is_first_access - True if this is the first time that the user opened the Wix Docs platform for this session\n * @property {string} page_url - The url of the current page\n * @property {number} loading_time - Loading time of page (from evid 112:1400 start loading page)\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {boolean} is_triggered_by_toggle - it this page load triggered by the REST/SDK toggle, instead of a regular page reload\n * @property {number} TTFB - the TTFB measure of web vitals\n * @property {number} FCP - the FCP measure of web vitals\n * @return {LogObject<wixDocsFinishLoadingPageParams>} LogObject<wixDocsFinishLoadingPageParams>\n */\nexport function wixDocsFinishLoadingPage(params: wixDocsFinishLoadingPageParams): LogObject<wixDocsFinishLoadingPageParams> {\n return { evid: 1401, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsSearchOpened' event (evid: 1403)\n *\n * Event description: Sends when the search dialog is open, and the user still didnt type a search term\n *\n * @param {wixDocsSearchOpenedParams} params - The parameters for this event\n * @property {boolean} no_connection - True if the search dialog is with a message of no connection\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} recently_viewed - A list of all recently viewed articles that appear in the search dialog, by it`s order\n * @property {string} portal - The current portal\n * @property {string} recent_searches - A list of all recent searches that appear in the search dialog, by it`s order\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {boolean} was_success - True if the dialog was open currectly\n * @property {string} page_url - The url of the current page\n * @property {string} action - The action that the user did to open the search dialog - press the search button \\ press \"/\" at the keyword\n * @return {LogObject<wixDocsSearchOpenedParams>} LogObject<wixDocsSearchOpenedParams>\n */\nexport function wixDocsSearchOpened(params: wixDocsSearchOpenedParams): LogObject<wixDocsSearchOpenedParams> {\n return { evid: 1403, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsTypeASearchTerm' event (evid: 1404)\n *\n * Event description: When a user is searching in search dialog send event at the end of the results\n *\n * @param {wixDocsTypeASearchTermParams} params - The parameters for this event\n * @property {boolean} no_connection - True if the search dialog is with a message of no connection\n * @property {number} recent_searches_index - The index of the recent\\suggested search that was choosen, can be empty\n * @property {string} session_id - The current user`s session in the product\n * @property {string} type_action - The way the user typed the search term - typing \\ choosing a recent search \\ choosing suggested searches\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {number} num_of_results - The number of total results who return on time\n * @property {string} search_term - The users's search term in the dialog\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {number} total_loading_time - The total time in ms for all results to return\n * @property {string} seen_results - Send only results who were seen in search -> category: article: type: time to load\n * @property {string} page_url - The url of the current page\n * @property {boolean} is_empty - True if the search results is empty from results after finish typing (there was no result found)\n * @property {string} search_results - Send all results who return on time by their order, in the following way -> category: article: type: time to load\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} filters - The search box filters - Json\n * @return {LogObject<wixDocsTypeASearchTermParams>} LogObject<wixDocsTypeASearchTermParams>\n */\nexport function wixDocsTypeASearchTerm(params: wixDocsTypeASearchTermParams): LogObject<wixDocsTypeASearchTermParams> {\n return { evid: 1404, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsScrollingInSearchResultView' event (evid: 1405)\n *\n * Event description: Sends an event when a user scrolls in the search's result\n *\n * @param {wixDocsScrollingInSearchResultViewParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {boolean} is_recently_viewed - True if the search term is empty and the user is hovering over the recently viewed items \\ 'what other are searching'\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {number} num_of_results - The number of total results who return on time\n * @property {string} search_term - The users's search term in the dialog, if it is null then the user still didnt wrote a search term but he can scroll in the recently viewed articles\n * @property {boolean} first_search_ever - True if it is the first search of the user ever, and the search dialog contains 'what other are searching' articles\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} page_url - The url of the current page\n * @property {string} search_results - Send all results who return on time by their order, in the following way -> category: article: type: time to load. example: (category: article: type: time to load)\n * [{\"category\":\"Answers\",\"article\":\"Ab\",\"type\":\"post\",\"time_to_load_ms\":512},{\"category\":\"Business Manager\",\"article\":\"Cd\",\"type\":\"get\",\"time_to_load_ms\":514]\n * @return {LogObject<wixDocsScrollingInSearchResultViewParams>} LogObject<wixDocsScrollingInSearchResultViewParams>\n */\nexport function wixDocsScrollingInSearchResultView(params: wixDocsScrollingInSearchResultViewParams): LogObject<wixDocsScrollingInSearchResultViewParams> {\n return { evid: 1405, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsHoverOverASearchResultItem' event (evid: 1406)\n *\n * Event description: When a user is focused on a result\n *\n * @param {wixDocsHoverOverASearchResultItemParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} result_article - The name of the result\n * @property {boolean} is_recently_viewed - True if the search term is empty and the user is hovering over the recently viewed items \\ 'what other are searching'\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} search_term - The users's search term in the dialog, if it is null then the user still didnt wrote a search term but he can scroll in the recently viewed articles\n * @property {boolean} first_search_ever - True if it is the first search of the user ever, and the search dialog contains 'what other are searching' articles\n * @property {string} result_category - The category of the result\n * @property {boolean} is_first_hover - True if it is the first item that was hovered\n * @property {string} article_id - The ID of the current article\n * @property {string} result_article_id - The ID of the result article\n * @property {string} article_name - The name of the current article\n * @property {string} page_url - The url of the current page\n * @property {number} item_index - item's index in all results\n * @property {string} search_results - Send all results who return on time by their order, in the following way -> category: article: type: time to load. example: (category: article: type: time to load) [{\"category\":\"Answers\",\"article\":\"Ab\",\"type\":\"post\",\"time_to_load_ms\":512},{\"category\":\"Business Manager\",\"article\":\"Cd\",\"type\":\"get\",\"time_to_load_ms\":514]\n * @return {LogObject<wixDocsHoverOverASearchResultItemParams>} LogObject<wixDocsHoverOverASearchResultItemParams>\n */\nexport function wixDocsHoverOverASearchResultItem(params: wixDocsHoverOverASearchResultItemParams): LogObject<wixDocsHoverOverASearchResultItemParams> {\n return { evid: 1406, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsChooseASearchResult' event (evid: 1407)\n *\n * Event description: Sends an event when a user chose a search result\n *\n * @param {wixDocsChooseASearchResultParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} chosen_article_type - the chosen article type - get \\ webhook \\ post \\ ..\n * @property {string} session_id - The current user`s session in the product\n * @property {string} chosen_category - The category of the chosen result\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} chosen_article - The name of the chosen result\n * @property {string} choose_type - The way the user chose the result - from an active search \\ from the recently viewed options \\ from the 'what other are searching' options\n * @property {string} chosen_article_id - The ID of the chosen result article\n * @property {string} object - The object of the article, can be empty\n * @property {string} search_term - The users's search term in the dialog, if it is null then the user still didnt wrote a search term but he can scroll in the recently viewed articles\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {string} chosen_article_url - The url of the chosen result article\n * @property {string} page_url - The url of the current page\n * @property {number} item_index - item's index in all results of the chosen result\n * @property {string} search_results - Send all results who return on time by their order, in the following way -> category: article: type: time to load. example: (category: article: type: time to load) [{\"category\":\"Answers\",\"article\":\"Ab\",\"type\":\"post\",\"time_to_load_ms\":512},{\"category\":\"Business Manager\",\"article\":\"Cd\",\"type\":\"get\",\"time_to_load_ms\":514]\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - Deprecation mode is ON\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} chosen_portal - The portal of the chosen article\n * @property {string} result_deprecation_status - clicked on deprecated/ about to be deprecated result\n * @return {LogObject<wixDocsChooseASearchResultParams>} LogObject<wixDocsChooseASearchResultParams>\n */\nexport function wixDocsChooseASearchResult(params: wixDocsChooseASearchResultParams): LogObject<wixDocsChooseASearchResultParams> {\n return { evid: 1407, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsCloseSearchDialog' event (evid: 1408)\n *\n * Event description: Sends an event when a user close the search dialog\n *\n * @param {wixDocsCloseSearchDialogParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} is_search_term_empty - True if the user closed the search dialog while the search box was empty from any term\n * @property {string} search_term - The users's search term in the dialog, if it is null then the user still didnt wrote a search term but he can scroll in the recently viewed articles\n * @property {number} time_in_dialog - Show in ms the time spent in the dialog, from finish typing\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} page_url - The url of the current page\n * @property {string} action - The user`s click for closing the dialog - click on a result/ click somewhere else/ click on x to clear search \\ press esc\n * @property {boolean} is_empty - True if the search results is empty from results after finish typing (there was no result found)\n * @property {string} search_results - Send all results who return on time by their order, in the following way -> category: article: type: time to load. example: (category: article: type: time to load) [{\"category\":\"Answers\",\"article\":\"Ab\",\"type\":\"post\",\"time_to_load_ms\":512},{\"category\":\"Business Manager\",\"article\":\"Cd\",\"type\":\"get\",\"time_to_load_ms\":514]\n * @return {LogObject<wixDocsCloseSearchDialogParams>} LogObject<wixDocsCloseSearchDialogParams>\n */\nexport function wixDocsCloseSearchDialog(params: wixDocsCloseSearchDialogParams): LogObject<wixDocsCloseSearchDialogParams> {\n return { evid: 1408, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsSidebarState' event (evid: 1409)\n *\n * Event description: On each page, the event is sent when the side bar is loaded and it also sends the current state of the sidebar - Internal \\ Velo \\ REST\n *\n * @param {wixDocsSidebarStateParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} category_items_list - List of category items in the main sidebar menu\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} current_sidebar_state - The current state of sidebar - Internal \\ Velo \\ REST\n * @property {string} article_type - The current article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {boolean} is_first_access - True if this is the first time that the user opened the Wix Docs platform for this session\n * @property {string} page_url - The url of the current page\n * @return {LogObject<wixDocsSidebarStateParams>} LogObject<wixDocsSidebarStateParams>\n */\nexport function wixDocsSidebarState(params: wixDocsSidebarStateParams): LogObject<wixDocsSidebarStateParams> {\n return { evid: 1409, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsClickOnSidebarItem' event (evid: 1410)\n *\n * Event description: When a user click on sidebar item (to expand drop down \\ open an article \\ move to other function\n *\n * @param {wixDocsClickOnSidebarItemParams} params - The parameters for this event\n * @property {string} clicked_sidebar_name - The sidebar item the user clicked on (category\\article\\function)\n * @property {string} clicked_sidebar_article - The sidebar item article the user clicked on, can be empty\n * @property {string} method - The method of the article, can be empty\n * @property {string} current_sidebar_name - The current item name appears in the sidebar - can be changed\n * @property {string} session_id - The current user`s session in the product\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} clicked_sidebar_url - The url of the page that the user clicked on\n * @property {string} category_items_list - List of category items in the main sidebar menu\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} current_sidebar_state - The current state of sidebar - Internal \\ Velo \\ REST\n * @property {string} object - The object of the article, can be empty\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - The current article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {string} clicked_sidebar_category - The sidebar item category the user clicked on, can be empty\n * @property {string} page_url - The url of the current page\n * @property {string} action - The action the user did - expand drop down \\ open an article \\ clicked on category \\ move to other function \\ back to last sidebar state\n * @return {LogObject<wixDocsClickOnSidebarItemParams>} LogObject<wixDocsClickOnSidebarItemParams>\n */\nexport function wixDocsClickOnSidebarItem(params: wixDocsClickOnSidebarItemParams): LogObject<wixDocsClickOnSidebarItemParams> {\n return { evid: 1410, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsNavbarLoaded' event (evid: 1411)\n *\n * Event description: The event is sent when the navbar is finish loading\n *\n * @param {wixDocsNavbarLoadedParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} article_type - The current article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} current_navbar_state - The current state of sidebar - Velo \\ REST \\ APIs & SDKs \\ Wix Docs\n * @property {string} page_url - The url of the current page\n * @return {LogObject<wixDocsNavbarLoadedParams>} LogObject<wixDocsNavbarLoadedParams>\n */\nexport function wixDocsNavbarLoaded(params: wixDocsNavbarLoadedParams): LogObject<wixDocsNavbarLoadedParams> {\n return { evid: 1411, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsClickedOnNavbar' event (evid: 1412)\n *\n * Event description: The event is sent when the user make any action on the navbar\n *\n * @param {wixDocsClickedOnNavbarParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} article_type - The current article type - get \\ webhook \\ post \\ ..\n * @property {string} navigate_to - The url that the click navigate to\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} current_navbar_state - The current state of sidebar - Velo \\ REST \\ APIs & SDKs \\ Wix Docs\n * @property {string} page_url - The url of the current page\n * @property {string} action - The action that the user clicked on - APIs & SDKs dropdown \\ Wix Docs \\ Build a Website\\ Build an App \\ Velo APIs \\ REST APIs \\ Client SDK \\ sign in \\ user dropdown \\ light brightness \\ dark brightness / log out / undo / review & save\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsClickedOnNavbarParams>} LogObject<wixDocsClickedOnNavbarParams>\n */\nexport function wixDocsClickedOnNavbar(params: wixDocsClickedOnNavbarParams): LogObject<wixDocsClickedOnNavbarParams> {\n return { evid: 1412, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsClickOnGiveFeedback' event (evid: 1413)\n *\n * Event description: Sends an event when a user click on a feedback button (yes \\ not)\n *\n * @param {wixDocsClickOnGiveFeedbackParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} session_id - session_id\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} object - The object of the article, can be empty\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - The current article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {string} page_url - The url of the current page\n * @property {string} action - The user feedback - yes \\ not\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsClickOnGiveFeedbackParams>} LogObject<wixDocsClickOnGiveFeedbackParams>\n */\nexport function wixDocsClickOnGiveFeedback(params: wixDocsClickOnGiveFeedbackParams): LogObject<wixDocsClickOnGiveFeedbackParams> {\n return { evid: 1413, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsSubmitFeedback' event (evid: 1414)\n *\n * Event description: Sends an event when a user click on submit feedback\n *\n * @param {wixDocsSubmitFeedbackParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} session_id - The current user`s session in the product\n * @property {string} email - The email that was filled in the feedback\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} object - The object of the article, can be empty\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - The current article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} content - The content of the feedback that the user wrote\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {string} page_url - The url of the current page\n * @property {string} action - The user feedback - yes \\ not\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} feedback_tag - The tag that the user choose\n * @property {boolean} is_logged_in - True if the user was logged in to wix\n * @return {LogObject<wixDocsSubmitFeedbackParams>} LogObject<wixDocsSubmitFeedbackParams>\n */\nexport function wixDocsSubmitFeedback(params: wixDocsSubmitFeedbackParams): LogObject<wixDocsSubmitFeedbackParams> {\n return { evid: 1414, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsClickInPage' event (evid: 1415)\n *\n * Event description: Sends an event when a user click on any Button: copy link icon \\ copy code \\ open example \\ close example \\ in this article navigation click \\ view source \\ contact owner \\ try it out \\ syntax REST \\ syntax RPC\n *\n * @param {wixDocsClickInPageParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} function_name - The name of the function that relate to the click, can be empty\n * @property {string} click_name - The name of the link, can be empty\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} object - The object of the article, can be empty\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - The current article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} attribute_name - The name of the attribute that relate to the click, can be empty\n * @property {string} click_url - The url of the link, can be empty\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {string} code_type - The code type that was copied - javascript \\ js..., can be empty\n * @property {string} page_url - The url of the current page\n * @property {string} action - Click on > in tables \\ links \\ copy link icon \\ copy code \\ open example \\ close example \\ in this article navigation click \\ view source \\ contact owner \\ try it out \\ syntax REST \\ syntax RPC \\ show members \\ hide members \\ tabs in tables \\ click on path navigation header\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsClickInPageParams>} LogObject<wixDocsClickInPageParams>\n */\nexport function wixDocsClickInPage(params: wixDocsClickInPageParams): LogObject<wixDocsClickInPageParams> {\n return { evid: 1415, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorSideBarActionClick' event (evid: 1416)\n *\n * Event description: The event is sent when a Side bar action click\n *\n * @param {wixDocsMenuEditorSideBarActionClickParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {boolean} is_public - True if the item is already public\n * @property {string} sub_category_name - The sub category name\n * @property {string} item_location - Running number of the item location\n * @property {string} change_id - random number that will present all this action flow (finish, move to review)\n * @property {string} version - The article version, can be null\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} item_type - The item that was clicked from\n * @property {string} page_url - The url of the current page\n * @property {string} action - rename / delete / add category / add sub category / connect resource / unpublish / hide from public / unhide from public / manage resources\n * @return {LogObject<wixDocsMenuEditorSideBarActionClickParams>} LogObject<wixDocsMenuEditorSideBarActionClickParams>\n */\nexport function wixDocsMenuEditorSideBarActionClick(params: wixDocsMenuEditorSideBarActionClickParams): LogObject<wixDocsMenuEditorSideBarActionClickParams> {\n return { evid: 1416, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorSideBarActionFinished' event (evid: 1417)\n *\n * Event description: The event is sent when a Side bar action finished - approved in the review & save modal\n *\n * @param {wixDocsMenuEditorSideBarActionFinishedParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {boolean} is_public - True if the item is already public\n * @property {string} sub_category_name - The sub category name\n * @property {string} item_location - Running number of the item location\n * @property {string} change_id - random number that will present all this action flow (finish, move to review)\n * @property {string} version - The article version, can be null\n * @property {string} article_id - The ID of the current article\n * @property {string} cta - remove / publish\n * @property {string} article_name - The name of the current article\n * @property {boolean} was_success - True if the action was completed well\n * @property {string} item_type - The item that was clicked from\n * @property {string} md - The md that was connected, will be null unless the action is connect\n * @property {string} page_url - The url of the current page\n * @property {string} action - rename / delete / add category / add sub category / connect resource / unpublish / hide from public / unhide from public / manage resources / item position changed\n * @return {LogObject<wixDocsMenuEditorSideBarActionFinishedParams>} LogObject<wixDocsMenuEditorSideBarActionFinishedParams>\n */\nexport function wixDocsMenuEditorSideBarActionFinished(params: wixDocsMenuEditorSideBarActionFinishedParams): LogObject<wixDocsMenuEditorSideBarActionFinishedParams> {\n return { evid: 1417, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorSideBarPositionChanged' event (evid: 1418)\n *\n * Event description: The event is sent when a Side bar position changed\n *\n * @param {wixDocsMenuEditorSideBarPositionChangedParams} params - The parameters for this event\n * @property {string} item_location_before - Running number of the item location, before it was moved\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the clicked item, after it was moved\n * @property {string} item_location_after - Running number of the item location, after it was moved\n * @property {string} portal - The current portal\n * @property {boolean} is_public - True if the item is already public\n * @property {string} sub_category_name - The sub category name, after it was moved\n * @property {string} change_id - random number that will present all this action flow (finish, move to review)\n * @property {string} version - The article version, can be null\n * @property {string} article_id - The ID of the current article, after it was moved\n * @property {string} article_name - The name of the current article that was clicked, after it was moved\n * @property {string} item_type - The item that was clicked from\n * @property {string} page_url - The url of the current page\n * @return {LogObject<wixDocsMenuEditorSideBarPositionChangedParams>} LogObject<wixDocsMenuEditorSideBarPositionChangedParams>\n */\nexport function wixDocsMenuEditorSideBarPositionChanged(params: wixDocsMenuEditorSideBarPositionChangedParams): LogObject<wixDocsMenuEditorSideBarPositionChangedParams> {\n return { evid: 1418, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsDocsWasPublished' event (evid: 1419)\n *\n * Event description: The event is sent when a tech writer is publishing the docs\n *\n * @param {wixDocsDocsWasPublishedParams} params - The parameters for this event\n * @property {string} failure_reason - The reason for the failure, can be empty\n * @property {string} portal - The published area - velo \\ rest \\ internal\n * @property {string} doc_url - The url of the published doc\n * @property {boolean} was_success - True if the docs were published successfully\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} publishedResourceId - The resource id that was published\n * @property {string} fqdn - The fqdn\n * @property {string} namespace - resource name\n * @property {string} publishedRevisionId - The published revision id\n * @return {LogObject<wixDocsDocsWasPublishedParams>} LogObject<wixDocsDocsWasPublishedParams>\n */\nexport function wixDocsDocsWasPublished(params: wixDocsDocsWasPublishedParams): LogObject<wixDocsDocsWasPublishedParams> {\n return { evid: 1419, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMainPageClick' event (evid: 1420)\n *\n * Event description: The event is sent when the user clicks on any link at the main page of the wix docs\n *\n * @param {wixDocsMainPageClickParams} params - The parameters for this event\n * @property {string} click_name - The name of the link\n * @property {string} portal - portal\n * @property {string} click_url - The url of the clicked link\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsMainPageClickParams>} LogObject<wixDocsMainPageClickParams>\n */\nexport function wixDocsMainPageClick(params: wixDocsMainPageClickParams): LogObject<wixDocsMainPageClickParams> {\n return { evid: 1420, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMainPageScroll' event (evid: 1421)\n *\n * Event description: The event is sent when the user scrolls the main page of the wix docs\n *\n * @param {wixDocsMainPageScrollParams} params - The parameters for this event\n * @property {string} page_part - what is the part in the page that was exposed\n * @property {string} portal - portal\n * @return {LogObject<wixDocsMainPageScrollParams>} LogObject<wixDocsMainPageScrollParams>\n */\nexport function wixDocsMainPageScroll(params: wixDocsMainPageScrollParams): LogObject<wixDocsMainPageScrollParams> {\n return { evid: 1421, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsModalWasOpen' event (evid: 1422)\n *\n * Event description: The event is sent when a docs modal was open\n *\n * @param {wixDocsModalWasOpenParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {boolean} has_edit_permission - True if the user has edit permission for the current article\n * @property {string} modal_name - API playground\n * @property {string} article_type - the article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} page_url - The url of the current page\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsModalWasOpenParams>} LogObject<wixDocsModalWasOpenParams>\n */\nexport function wixDocsModalWasOpen(params: wixDocsModalWasOpenParams): LogObject<wixDocsModalWasOpenParams> {\n return { evid: 1422, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsModalWasClose' event (evid: 1423)\n *\n * Event description: The event is sent when a docs modal was close\n *\n * @param {wixDocsModalWasCloseParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {boolean} has_edit_permission - True if the user has edit permission for the current article\n * @property {string} modal_name - API playground\n * @property {string} article_type - the article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} cta - X / click outside the modal\n * @property {string} article_name - The name of the current article\n * @property {string} page_url - The url of the current page\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsModalWasCloseParams>} LogObject<wixDocsModalWasCloseParams>\n */\nexport function wixDocsModalWasClose(params: wixDocsModalWasCloseParams): LogObject<wixDocsModalWasCloseParams> {\n return { evid: 1423, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsModalClick' event (evid: 1424)\n *\n * Event description: The event is sent when the user clicks on any cta at a docs modal\n *\n * @param {wixDocsModalClickParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} token_type - Empty / Test Token / Access Token\n * @property {boolean} has_edit_permission - True if the user has edit permission for the current article\n * @property {string} modal_name - API playground\n * @property {string} article_type - the article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} cta - Select Base Url click / Select Base Url change / \n * Choose a site / Access Token / Generated Test Token type / Access Token type / setting up OAuth link / send request / shareable link\n * @property {string} article_name - The name of the current article\n * @property {boolean} was_success - True if the action successed, relevant only for send request, generate token and generate new token clicks, can be null\n * @property {string} page_url - The url of the current page\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsModalClickParams>} LogObject<wixDocsModalClickParams>\n */\nexport function wixDocsModalClick(params: wixDocsModalClickParams): LogObject<wixDocsModalClickParams> {\n return { evid: 1424, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorEditModeStatusChange' event (evid: 1425)\n *\n * Event description: The event is sent when a Edit mode status change\n *\n * @param {wixDocsMenuEditorEditModeStatusChangeParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} portal - The current portal\n * @property {string} page_url - The url of the current page\n * @return {LogObject<wixDocsMenuEditorEditModeStatusChangeParams>} LogObject<wixDocsMenuEditorEditModeStatusChangeParams>\n */\nexport function wixDocsMenuEditorEditModeStatusChange(params: wixDocsMenuEditorEditModeStatusChangeParams): LogObject<wixDocsMenuEditorEditModeStatusChangeParams> {\n return { evid: 1425, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorSideBarActionMoveToReview' event (evid: 1426)\n *\n * Event description: The event is sent when a Side bar action moved to review\n *\n * @param {wixDocsMenuEditorSideBarActionMoveToReviewParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {boolean} is_public - True if the item is already public\n * @property {string} sub_category_name - The sub category name\n * @property {string} item_location - Running number of the item location\n * @property {string} change_id - random number that will present all this action flow (finish, move to review)\n * @property {string} version - The article version, can be null\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {boolean} was_success - True if the action was completed well\n * @property {string} item_type - The item that was clicked from\n * @property {string} md - The md that was connected, will be null unless the action is connect\n * @property {string} page_url - The url of the current page\n * @property {string} action - rename / delete / add category / add sub category / connect resource / unpublish / hide from public / unhide from public / manage resources / item position changed\n * @return {LogObject<wixDocsMenuEditorSideBarActionMoveToReviewParams>} LogObject<wixDocsMenuEditorSideBarActionMoveToReviewParams>\n */\nexport function wixDocsMenuEditorSideBarActionMoveToReview(params: wixDocsMenuEditorSideBarActionMoveToReviewParams): LogObject<wixDocsMenuEditorSideBarActionMoveToReviewParams> {\n return { evid: 1426, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorVersionsSideBarLoaded' event (evid: 1427)\n *\n * Event description: The event is sent when the versions side bar finish loaded\n *\n * @param {wixDocsMenuEditorVersionsSideBarLoadedParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {boolean} is_public - True if the item is already public\n * @property {string} sub_category_name - The sub category name\n * @property {string} item_location - Running number of the item location\n * @property {string} change_id - random number that will present all this action flow (finish, move to review)\n * @property {string} version - The article version, can be null\n * @property {string} article_id - The ID of the current article\n * @property {string} cta - the cta that opened the sidebar (manage version click / right icon to open)\n * @property {string} article_name - The name of the current article\n * @property {boolean} was_success - True if the action was completed well\n * @property {string} item_type - The item that was clicked from\n * @property {string} page_url - The url of the current page\n * @return {LogObject<wixDocsMenuEditorVersionsSideBarLoadedParams>} LogObject<wixDocsMenuEditorVersionsSideBarLoadedParams>\n */\nexport function wixDocsMenuEditorVersionsSideBarLoaded(params: wixDocsMenuEditorVersionsSideBarLoadedParams): LogObject<wixDocsMenuEditorVersionsSideBarLoadedParams> {\n return { evid: 1427, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorVersionsSideBarClicks' event (evid: 1428)\n *\n * Event description: The event is sent when the user click on the versions side bar\n *\n * @param {wixDocsMenuEditorVersionsSideBarClicksParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {boolean} is_public - True if the item is already public\n * @property {string} sub_category_name - The sub category name\n * @property {string} item_location - Running number of the item location\n * @property {string} change_id - random number that will present all this action flow (finish, move to review)\n * @property {string} version - The article version, can be null\n * @property {string} article_id - The ID of the current article\n * @property {string} cta - X / add to publish list / remove from publish list / version\n * @property {string} article_name - The name of the current article\n * @property {boolean} was_success - True if the action was completed well\n * @property {string} item_type - The item that was clicked from\n * @property {string} page_url - The url of the current page\n * @property {string} new_version - The clicked version / the version that was chosen to add to publish list / null\n * @return {LogObject<wixDocsMenuEditorVersionsSideBarClicksParams>} LogObject<wixDocsMenuEditorVersionsSideBarClicksParams>\n */\nexport function wixDocsMenuEditorVersionsSideBarClicks(params: wixDocsMenuEditorVersionsSideBarClicksParams): LogObject<wixDocsMenuEditorVersionsSideBarClicksParams> {\n return { evid: 1428, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorContentFilterChange' event (evid: 1429)\n *\n * Event description: The event is sent when the user change any content filter\n *\n * @param {wixDocsMenuEditorContentFilterChangeParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} portal - The current portal\n * @property {string} cta - beta / ga / internal\n * @property {string} page_url - The url of the current page\n * @property {string} action - show / hide\n * @return {LogObject<wixDocsMenuEditorContentFilterChangeParams>} LogObject<wixDocsMenuEditorContentFilterChangeParams>\n */\nexport function wixDocsMenuEditorContentFilterChange(params: wixDocsMenuEditorContentFilterChangeParams): LogObject<wixDocsMenuEditorContentFilterChangeParams> {\n return { evid: 1429, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorInstructionsClicks' event (evid: 1430)\n *\n * Event description: The event is sent when the user clicks next at any instruction message\n *\n * @param {wixDocsMenuEditorInstructionsClicksParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} portal - The current portal\n * @property {number} instruction_num - num of instruction\n * @property {string} page_url - The url of the current page\n * @return {LogObject<wixDocsMenuEditorInstructionsClicksParams>} LogObject<wixDocsMenuEditorInstructionsClicksParams>\n */\nexport function wixDocsMenuEditorInstructionsClicks(params: wixDocsMenuEditorInstructionsClicksParams): LogObject<wixDocsMenuEditorInstructionsClicksParams> {\n return { evid: 1430, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsMenuEditorReviewSaveModalClicks' event (evid: 1431)\n *\n * Event description: The event is sent when the user clicks on any button at the review & save modal\n *\n * @param {wixDocsMenuEditorReviewSaveModalClicksParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} change_ids - a list of all cange_ids that the action was made on\n * @property {string} portal - The current portal\n * @property {string} cta - X / preview all / preview specific change / copy link / cancel / save / remove\n * @property {boolean} was_success - True if the action successed\n * @property {string} page_url - The url of the current page\n * @return {LogObject<wixDocsMenuEditorReviewSaveModalClicksParams>} LogObject<wixDocsMenuEditorReviewSaveModalClicksParams>\n */\nexport function wixDocsMenuEditorReviewSaveModalClicks(params: wixDocsMenuEditorReviewSaveModalClicksParams): LogObject<wixDocsMenuEditorReviewSaveModalClicksParams> {\n return { evid: 1431, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'relativeLinksFailure' event (evid: 1432)\n *\n * Event description: The event is sent when a relative link was broken\n *\n * @param {relativeLinksFailureParams} params - The parameters for this event\n * @property {string} pageUrl - The url of the current page\n * @property {string} sourceUrl - relative link\n * @property {string} destinationUrl - rendered link\n * @return {LogObject<relativeLinksFailureParams>} LogObject<relativeLinksFailureParams>\n */\nexport function relativeLinksFailure(params: relativeLinksFailureParams): LogObject<relativeLinksFailureParams> {\n return { evid: 1432, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsClickOnLinks' event (evid: 1433)\n *\n * Event description: Sends an event when a user click on any Link: in this article navigation click \\ view source \\ contact owner \\ try it out \\ syntax REST \\ syntax RPC\n *\n * @param {wixDocsClickOnLinksParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} click_name - The name of the link, can be empty\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} object - The object of the article, can be empty\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - The current article type - api / md / object / get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} click_url - The url of the link, can be empty\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {string} page_url - The url of the current page\n * @property {string} action - Click on > in tables \\ links \\ copy link icon \\ copy code \\ open example \\ close example \\ in this article navigation click \\ view source \\ contact owner \\ try it out \\ syntax REST \\ syntax RPC \\ show members \\ hide members \\ tabs in tables \\ click on path navigation header\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsClickOnLinksParams>} LogObject<wixDocsClickOnLinksParams>\n */\nexport function wixDocsClickOnLinks(params: wixDocsClickOnLinksParams): LogObject<wixDocsClickOnLinksParams> {\n return { evid: 1433, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiExampleGenerationCompletedByAiTool' event (evid: 1434)\n *\n * Event description: The event will be sent in any new revision in docs when the example generation is finished per method (successfully or not) and will send the example generation details.\n *\n * @param {apiExampleGenerationCompletedByAiToolParams} params - The parameters for this event\n * @property {string} method - The method name of the example being generated\n * @property {string} namespace - The method namespace\n * @property {string} fqdn - The method fqdn\n * @property {number} numRetries - The number of retries made until the example was generated or failed to generate (limitation of 3)\n * @property {boolean} wasSuccess - True if an example was generated\n * @property {string} portal - REST/ SDK / Velo - where the example was generate to\n * @property {string} failureReasons - A Json of the failure reasons. for example - {retry 1: \"reason\", retry 2: \"reason\",.....}\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} packageName - The method Package name\n * @property {string} publishedDocRevisionId - the publishedDocRevisionId\n * @return {LogObject<apiExampleGenerationCompletedByAiToolParams>} LogObject<apiExampleGenerationCompletedByAiToolParams>\n */\nexport function apiExampleGenerationCompletedByAiTool(params: apiExampleGenerationCompletedByAiToolParams): LogObject<apiExampleGenerationCompletedByAiToolParams> {\n return { evid: 1434, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsVisitLocalViewer' event (evid: 15)\n *\n * Event description: User visit the local viewer\n *\n * @param {wixDocsVisitLocalViewerParams} params - The parameters for this event\n * @property {string} local_viewer_id - local_viewer_id\n * @property {string} customer_id - customer id\n * @return {LogObject<wixDocsVisitLocalViewerParams>} LogObject<wixDocsVisitLocalViewerParams>\n */\nexport function wixDocsVisitLocalViewer(params: wixDocsVisitLocalViewerParams): LogObject<wixDocsVisitLocalViewerParams> {\n return { evid: 15, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsOpenCloseExamples' event (evid: 16)\n *\n * Event description: User open/close examples in wix docs\n *\n * @param {wixDocsOpenCloseExamplesParams} params - The parameters for this event\n * @property {string} customer_id - customer id\n * @property {string} categoryName - category name\n * @property {string} articleUrl - url of article\n * @property {number} exampleId - number of example in the list\n * @property {string} articleName - article name\n * @property {string} action - 'open' or 'close'\n * @return {LogObject<wixDocsOpenCloseExamplesParams>} LogObject<wixDocsOpenCloseExamplesParams>\n */\nexport function wixDocsOpenCloseExamples(params: wixDocsOpenCloseExamplesParams): LogObject<wixDocsOpenCloseExamplesParams> {\n return { evid: 16, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'docsRedirectFailure' event (evid: 1600)\n *\n * Event description: The event will be sent when there is a docs redirect , and it will send the result\n *\n * @param {docsRedirectFailureParams} params - The parameters for this event\n * @property {string} url - The url\n * @property {boolean} isSuccess - True if the redirect works correct\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<docsRedirectFailureParams>} LogObject<docsRedirectFailureParams>\n */\nexport function docsRedirectFailure(params: docsRedirectFailureParams): LogObject<docsRedirectFailureParams> {\n return { evid: 1600, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsRelatedSiteClick' event (evid: 17)\n *\n * Event description: Wix Docs - Related Site Click\n *\n * @param {wixDocsRelatedSiteClickParams} params - The parameters for this event\n * @property {string} customer_id - customer_id\n * @property {string} selected_name - selected_name\n * @property {string} selected_url - selected_url\n * @return {LogObject<wixDocsRelatedSiteClickParams>} LogObject<wixDocsRelatedSiteClickParams>\n */\nexport function wixDocsRelatedSiteClick(params: wixDocsRelatedSiteClickParams): LogObject<wixDocsRelatedSiteClickParams> {\n return { evid: 17, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsViewSourceClick' event (evid: 18)\n *\n * Event description: Wix Docs - View Source Click\n *\n * @param {wixDocsViewSourceClickParams} params - The parameters for this event\n * @property {string} customer_id - customer id\n * @property {string} article_url - article url\n * @property {string} article_name - article name\n * @return {LogObject<wixDocsViewSourceClickParams>} LogObject<wixDocsViewSourceClickParams>\n */\nexport function wixDocsViewSourceClick(params: wixDocsViewSourceClickParams): LogObject<wixDocsViewSourceClickParams> {\n return { evid: 18, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsObjectShowMembersClick' event (evid: 19)\n *\n * Event description: Click on Show Members\n *\n * @param {wixDocsObjectShowMembersClickParams} params - The parameters for this event\n * @property {string} customer_id - customer_id\n * @property {string} category_name - category name\n * @property {string} article_url - article url\n * @property {string} article_name - article name\n * @property {string} action - action\n * @return {LogObject<wixDocsObjectShowMembersClickParams>} LogObject<wixDocsObjectShowMembersClickParams>\n */\nexport function wixDocsObjectShowMembersClick(params: wixDocsObjectShowMembersClickParams): LogObject<wixDocsObjectShowMembersClickParams> {\n return { evid: 19, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsSiteVisit' event (evid: 2)\n *\n * Event description: Visit to Wix Docs page\n *\n * @param {wixDocsSiteVisitParams} params - The parameters for this event\n * @property {string} customer_id - customer id of our business client (app_builder, dev center,\n * @property {Url} referral_url - referral_url\n * @property {string} category_name - category\n * @property {number} screen_width - screen_width\n * @property {number} screen_height - screen height\n * @property {string} article_name - article name\n * @property {Url} page_url - page url of customer\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsSiteVisitParams>} LogObject<wixDocsSiteVisitParams>\n */\nexport function wixDocsSiteVisit(params: wixDocsSiteVisitParams): LogObject<wixDocsSiteVisitParams> {\n return { evid: 2, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsGiveFeedbackClick' event (evid: 3)\n *\n * Event description: User clicks on \"yes\" or \"no\" feedback click for articles.\n *\n * @param {wixDocsGiveFeedbackClickParams} params - The parameters for this event\n * @property {string} customer_id - customer_id\n * @property {Url} article_url - article_url\n * @property {string} article_name - article_name\n * @property {boolean} positive_feedback - feedback given, Yes or No - for helpful\n * @return {LogObject<wixDocsGiveFeedbackClickParams>} LogObject<wixDocsGiveFeedbackClickParams>\n */\nexport function wixDocsGiveFeedbackClick(params: wixDocsGiveFeedbackClickParams): LogObject<wixDocsGiveFeedbackClickParams> {\n return { evid: 3, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsSearchResults' event (evid: 4)\n *\n * Event description: Search results returned (search action performed)\n *\n * @param {wixDocsSearchResultsParams} params - The parameters for this event\n * @property {string} chosen_article_name - Chosen article name\n * @property {string} user_action - action taken by user = [exit_search, result_click, clear_button]\n * @property {string} customer_id - customer id of our business client (app_builder, dev center,\n * @property {Url} first_article_url - url of first url returned in search\n * @property {string} first_article_category - the category of the the first search result\n * @property {Url} chosen_article - the url of the article that the user clicked, if clicked\n * @property {string} first_article_name - the first name of the article\n * @property {number} num_of_results - how many articles were found for the search?\n * @property {string} search_term - search term used in search action\n * @property {string} chosen_category_name - name of chosen category\n * @property {Url} chosen_article_url - chosen article url\n * @return {LogObject<wixDocsSearchResultsParams>} LogObject<wixDocsSearchResultsParams>\n */\nexport function wixDocsSearchResults(params: wixDocsSearchResultsParams): LogObject<wixDocsSearchResultsParams> {\n return { evid: 4, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsNavigationClick' event (evid: 5)\n *\n * Event description: Menu navigation click\n *\n * @param {wixDocsNavigationClickParams} params - The parameters for this event\n * @property {string} customer_id - customer id of our business client (app_builder, dev center,\n * @property {string} category_name - name of category in menu\n * @property {Url} article_url - article url\n * @property {string} article_name - name of article inside of category\n * @property {string} nav_type - breadcrumb, category, article, scroll (after 5 secs)\n * @return {LogObject<wixDocsNavigationClickParams>} LogObject<wixDocsNavigationClickParams>\n */\nexport function wixDocsNavigationClick(params: wixDocsNavigationClickParams): LogObject<wixDocsNavigationClickParams> {\n return { evid: 5, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsContactOwnerLinkClicked' event (evid: 6)\n *\n * Event description: Link to contact owner clicked\n *\n * @param {wixDocsContactOwnerLinkClickedParams} params - The parameters for this event\n * @property {string} customer_id - customer id\n * @property {string} article_url - article url\n * @property {string} article_name - article name\n * @property {string} link_type - link type clicked\n * @return {LogObject<wixDocsContactOwnerLinkClickedParams>} LogObject<wixDocsContactOwnerLinkClickedParams>\n */\nexport function wixDocsContactOwnerLinkClicked(params: wixDocsContactOwnerLinkClickedParams): LogObject<wixDocsContactOwnerLinkClickedParams> {\n return { evid: 6, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsCopyCode' event (evid: 7)\n *\n * Event description: Copy the code given in the article example\n *\n * @param {wixDocsCopyCodeParams} params - The parameters for this event\n * @property {string} customer_id - customer id of our business client (app_builder, dev center,\n * @property {string} category_name - name of category\n * @property {Url} article_url - the url of the article that was copied\n * @property {string} id - id of copied data\n * @property {string} article_name - name of article\n * @return {LogObject<wixDocsCopyCodeParams>} LogObject<wixDocsCopyCodeParams>\n */\nexport function wixDocsCopyCode(params: wixDocsCopyCodeParams): LogObject<wixDocsCopyCodeParams> {\n return { evid: 7, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsTryItOutClick' event (evid: 8)\n *\n * Event description: Wix Docs - Try it Out - Click\n *\n * @param {wixDocsTryItOutClickParams} params - The parameters for this event\n * @property {string} customer_id - customer id\n * @property {string} category_name - category name\n * @property {Url} article_url - article_url\n * @property {string} article_name - article name\n * @return {LogObject<wixDocsTryItOutClickParams>} LogObject<wixDocsTryItOutClickParams>\n */\nexport function wixDocsTryItOutClick(params: wixDocsTryItOutClickParams): LogObject<wixDocsTryItOutClickParams> {\n return { evid: 8, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsShareableLinkClick' event (evid: 9)\n *\n * Event description: Wix Docs - Shareable Link - Click\n *\n * @param {wixDocsShareableLinkClickParams} params - The parameters for this event\n * @property {string} customer_id - customer id\n * @property {string} category_name - category name\n * @property {Url} article_url - article_url\n * @property {string} article_name - article name\n * @return {LogObject<wixDocsShareableLinkClickParams>} LogObject<wixDocsShareableLinkClickParams>\n */\nexport function wixDocsShareableLinkClick(params: wixDocsShareableLinkClickParams): LogObject<wixDocsShareableLinkClickParams> {\n return { evid: 9, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'publicSdkCall' event (evid: 1606)\n *\n * Event description: This technical event is sent when an API call occurs, primarily for actions taken by users within the APIs Montioring context. It captures key details for monitoring API performance and usage, including the destination URL, latency, HTTP method, and response status code.\n *\n * @param {publicSdkCallParams} params - The parameters for this event\n * @property {string} http_code - status response : 200 / 401 / 403 / 404 / 500\n * @property {Url} url - The url of the destination of the call (URL/URI)\n * @property {number} latency - The API latency\n * @property {string} auth_type - API Keys / OAuth app / ..\n * @property {string} app_def_id - The app_def_id of the caller\n * @property {string} package_version - bi-package-version\n * @property {string} http_method - REST protocol (Post / delete / patch / put / delete)\n * @property {string} entity_name - The name of the entity that was called (fqdn)\n * @property {string} package_name - bi-package-name\n * @property {string} origin_url - The url that the call was from\n * @property {string} environment - js-sdk (sdk before we changed the field) / velo-frontend (auto velo) / velo-backend (auto velo) / vanilla (rest) / js-dashboard / js-api_key / js-velo-backend / js-velo-frontend / js-app (TPA using sdk - for example cli apps) / js-site / js-editor\n * @property {string} method_name - The name of the method that was called (fqn)\n * @property {string} msid - The ID of the site\n * @property {string} mcp_tool_execution_id - wix mcp server tool execution id\n * @property {string} entity_name_fw - entity_name_fw\n * @property {string} method_name_fw - method_name_fw\n * @property {GUID} instance_id - The instance id - msid+app_id\n * @property {string} integration_type - Wix / TPA (headless, api keys, blocks) / Velo\n * @return {LogObject<publicSdkCallParams>} LogObject<publicSdkCallParams>\n */\nexport function publicSdkCall(params: publicSdkCallParams): LogObject<publicSdkCallParams> {\n return { evid: 1606, src: 11, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppClickOnOauthAppAction' event (evid: 100)\n *\n * Event description: The event is sent when the user click to create/delete/edit OAuth app\n *\n * @param {oauthAppClickOnOauthAppActionParams} params - The parameters for this event\n * @property {string} app_description - The app description, can be empty\n * @property {string} allowed_domains - The app allowed domains, can be empty\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} app_name - The app name, can be empty\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} login_urls - List of the login URLs, can be empty\n * @property {string} app_id - The id of the app, can be empty\n * @property {string} msid - The msid of the site\n * @property {string} action - create / create from empty state / edit / delete\n * @return {LogObject<oauthAppClickOnOauthAppActionParams>} LogObject<oauthAppClickOnOauthAppActionParams>\n */\nexport function oauthAppClickOnOauthAppAction(params: oauthAppClickOnOauthAppActionParams): LogObject<oauthAppClickOnOauthAppActionParams> {\n return { evid: 100, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppClickAtTheOauthAppMainPage' event (evid: 101)\n *\n * Event description: The event is sent when the user clicks on any action from the OAuth app main page, other than apps actions (copy account ID button, referral link)\n *\n * @param {oauthAppClickAtTheOauthAppMainPageParams} params - The parameters for this event\n * @property {string} url_clicked - The URL that the user opened by a click on the link, can be empty\n * @property {string} field_value - The redirect URL, can be null\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} cta - copy account id button / referral link / edit domain\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} msid - The msid of the site\n * @return {LogObject<oauthAppClickAtTheOauthAppMainPageParams>} LogObject<oauthAppClickAtTheOauthAppMainPageParams>\n */\nexport function oauthAppClickAtTheOauthAppMainPage(params: oauthAppClickAtTheOauthAppMainPageParams): LogObject<oauthAppClickAtTheOauthAppMainPageParams> {\n return { evid: 101, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppClickNextCloseAtTheCreateOauthAppDialog' event (evid: 102)\n *\n * Event description: The event is sent when the user click on next button at the Create a OAuth app dialog\n *\n * @param {oauthAppClickNextCloseAtTheCreateOauthAppDialogParams} params - The parameters for this event\n * @property {string} app_description - The app description, can be empty\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} app_name - The app name\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} app_id - The id of the app, can be empty\n * @property {string} msid - The msid of the site\n * @property {string} action - next / close\n * @return {LogObject<oauthAppClickNextCloseAtTheCreateOauthAppDialogParams>} LogObject<oauthAppClickNextCloseAtTheCreateOauthAppDialogParams>\n */\nexport function oauthAppClickNextCloseAtTheCreateOauthAppDialog(params: oauthAppClickNextCloseAtTheCreateOauthAppDialogParams): LogObject<oauthAppClickNextCloseAtTheCreateOauthAppDialogParams> {\n return { evid: 102, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppClickAtTheCreateEditOauthAppPage' event (evid: 103)\n *\n * Event description: The event is sent when the user click on any action from the edit / create OAuth app page, other then close / save (copy account ID button, refferal link, show client secret, hide client secret, rotate client secret, add redirect URL)\n *\n * @param {oauthAppClickAtTheCreateEditOauthAppPageParams} params - The parameters for this event\n * @property {string} url_clicked - The URL that the user opend by a click on the link, can be empty\n * @property {string} app_description - The app description, can be empty\n * @property {string} app_action - create / edit\n * @property {string} allowed_domains - The app allowed domains, can be empty\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} cta - copy account ID button, refferal link, show client secret, hide client secret, rotate client secret, add redirect URL\n * @property {string} app_name - The app name\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} login_urls - List of the login URLs, can be empty\n * @property {string} app_id - The id of the app, can be empty\n * @property {string} allowed_authorize_urls - The app allowed_authorize_urls, can be empty\n * @property {string} msid - The msid of the site\n * @return {LogObject<oauthAppClickAtTheCreateEditOauthAppPageParams>} LogObject<oauthAppClickAtTheCreateEditOauthAppPageParams>\n */\nexport function oauthAppClickAtTheCreateEditOauthAppPage(params: oauthAppClickAtTheCreateEditOauthAppPageParams): LogObject<oauthAppClickAtTheCreateEditOauthAppPageParams> {\n return { evid: 103, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppClickOnCloseFromCreateEditOauthAppPage' event (evid: 104)\n *\n * Event description: The event is sent when the user clicks on close from edit OAuth app page (didnt save changes \\ didnt create an app)\n *\n * @param {oauthAppClickOnCloseFromCreateEditOauthAppPageParams} params - The parameters for this event\n * @property {string} app_action - create / edit\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} app_name - The app name\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} app_id - The id of the app, can be empty\n * @property {string} msid - The msid of the site\n * @return {LogObject<oauthAppClickOnCloseFromCreateEditOauthAppPageParams>} LogObject<oauthAppClickOnCloseFromCreateEditOauthAppPageParams>\n */\nexport function oauthAppClickOnCloseFromCreateEditOauthAppPage(params: oauthAppClickOnCloseFromCreateEditOauthAppPageParams): LogObject<oauthAppClickOnCloseFromCreateEditOauthAppPageParams> {\n return { evid: 104, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppClickOnSaveFromCreateEditOauthAppPage' event (evid: 105)\n *\n * Event description: The event is sent when the user clicks on save from edit OAuth app page (create an app \\ save changes of an app)\n *\n * @param {oauthAppClickOnSaveFromCreateEditOauthAppPageParams} params - The parameters for this event\n * @property {string} old_login_urls - List of the old login URLs, can be empty if there were no changes\n * @property {string} app_description - The current app description\n * @property {string} app_action - create / edit\n * @property {string} old_allowed_domains - The old app allowed domains, can be empty if there were no changes\n * @property {string} old_app_name - The old app name, can be empty if there were no changes\n * @property {string} allowed_domains - The current app allowed domains\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} app_name - The current app name\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} login_urls - The current list of the login URLs\n * @property {string} app_id - The current id of the app\n * @property {string} allowed_authorize_urls - The app allowed_authorize_urls, can be empty\n * @property {string} old_app_description - The old app description, can be empty if there were no changes\n * @property {string} msid - The msid of the site\n * @return {LogObject<oauthAppClickOnSaveFromCreateEditOauthAppPageParams>} LogObject<oauthAppClickOnSaveFromCreateEditOauthAppPageParams>\n */\nexport function oauthAppClickOnSaveFromCreateEditOauthAppPage(params: oauthAppClickOnSaveFromCreateEditOauthAppPageParams): LogObject<oauthAppClickOnSaveFromCreateEditOauthAppPageParams> {\n return { evid: 105, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppClickAtTheDeleteOauthAppDialog' event (evid: 106)\n *\n * Event description: The event is sent when the user slick on some button at the delete app dialog - (delete \\ send code \\ send code again \\ verify and delete an app)\n *\n * @param {oauthAppClickAtTheDeleteOauthAppDialogParams} params - The parameters for this event\n * @property {string} app_description - The app description\n * @property {string} allowed_domains - The app allowed domains\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} app_name - The app name\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} login_urls - List of the login URLs\n * @property {string} app_id - The id of the app\n * @property {string} msid - The msid of the site\n * @property {string} action - delete / send code / send code again / verify and delete an app\n * @return {LogObject<oauthAppClickAtTheDeleteOauthAppDialogParams>} LogObject<oauthAppClickAtTheDeleteOauthAppDialogParams>\n */\nexport function oauthAppClickAtTheDeleteOauthAppDialog(params: oauthAppClickAtTheDeleteOauthAppDialogParams): LogObject<oauthAppClickAtTheDeleteOauthAppDialogParams> {\n return { evid: 106, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppOauthAppActionWasMade' event (evid: 107)\n *\n * Event description: The event is sent when an OAuth app was created / deleted / edited\n *\n * @param {oauthAppOauthAppActionWasMadeParams} params - The parameters for this event\n * @property {string} old_login_urls - List of the old login URLs, can be empty if there were no changes\n * @property {string} failure_reason - The failure reason, can be empty\n * @property {string} app_description - The current app description\n * @property {string} app_action - create / edit / delete\n * @property {string} old_allowed_domains - The old app allowed domains, can be empty if there were no changes\n * @property {string} old_app_name - The old app name, can be empty if there were no changes\n * @property {string} allowed_domains - The current app allowed domains\n * @property {string} old_allowed_authorize_urls - The old app allowed_authorize_urls, can be empty\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} app_name - The current app name\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} login_urls - The current list of the login URLs\n * @property {string} app_id - The current id of the app\n * @property {string} allowed_authorize_urls - The app allowed_authorize_urls, can be empty\n * @property {boolean} was_success - True if the action was finished successfully\n * @property {number} time_to_finish - The time it took to finish the action in ms\n * @property {string} old_app_description - The old app description, can be empty if there were no changes\n * @property {string} msid - The msid of the site\n * @property {boolean} is_new_flow - True is it was created by the new flow\n * @return {LogObject<oauthAppOauthAppActionWasMadeParams>} LogObject<oauthAppOauthAppActionWasMadeParams>\n */\nexport function oauthAppOauthAppActionWasMade(params: oauthAppOauthAppActionWasMadeParams): LogObject<oauthAppOauthAppActionWasMadeParams> {\n return { evid: 107, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppClickAtTheGenerateClientSecretDialog' event (evid: 108)\n *\n * Event description: The event is sent when the user click at the generate client secret dialog\n *\n * @param {oauthAppClickAtTheGenerateClientSecretDialogParams} params - The parameters for this event\n * @property {string} app_description - The app description\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} app_name - The app name\n * @property {string} app_id - The id of the app\n * @property {string} msid - The msid of the site\n * @property {string} action - Copy & close / copy icon / learn more link\n * @return {LogObject<oauthAppClickAtTheGenerateClientSecretDialogParams>} LogObject<oauthAppClickAtTheGenerateClientSecretDialogParams>\n */\nexport function oauthAppClickAtTheGenerateClientSecretDialog(params: oauthAppClickAtTheGenerateClientSecretDialogParams): LogObject<oauthAppClickAtTheGenerateClientSecretDialogParams> {\n return { evid: 108, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'oauthAppOauthAppActionWasMadeServer' event (evid: 151)\n *\n * Event description: The event is sent when an OAuth app was created / deleted / edited, server event\n *\n * @param {oauthAppOauthAppActionWasMadeServerParams} params - The parameters for this event\n * @property {string} old_login_urls - List of the old login URLs, can be empty if there were no changes\n * @property {string} failure_reason - The failure reason, can be empty\n * @property {string} app_description - The current app description\n * @property {string} app_action - create / edit / delete\n * @property {string} old_allowed_domains - The old app allowed domains, can be empty if there were no changes\n * @property {string} old_app_name - The old app name, can be empty if there were no changes\n * @property {string} allowed_domains - The current app allowed domains\n * @property {string} old_allowed_authorize_urls - The old app allowed_authorize_urls, can be empty\n * @property {string} account_id - The ID of the account that the site owned by\n * @property {string} app_name - The current app name\n * @property {number} num_apps - The number of Apps that already exists for this site\n * @property {string} login_urls - The current list of the login URLs\n * @property {string} app_id - The current id of the app\n * @property {string} allowed_authorize_urls - The app allowed_authorize_urls, can be empty\n * @property {boolean} was_success - True if the action was finished successfully\n * @property {number} time_to_finish - time_to_finish\n * @property {string} old_app_description - The old app description, can be empty if there were no changes\n * @property {string} msid - The msid of the site\n * @property {string} action_initiator - the initiator of the action (user/developer/picasso)\n * @property {string} app_creation_initiator - was the Oauth app created by user/system\n * @property {string} origin - The orchestrating system that created the OAuth App.\n * @return {LogObject<oauthAppOauthAppActionWasMadeServerParams>} LogObject<oauthAppOauthAppActionWasMadeServerParams>\n */\nexport function oauthAppOauthAppActionWasMadeServer(params: oauthAppOauthAppActionWasMadeServerParams): LogObject<oauthAppOauthAppActionWasMadeServerParams> {\n return { evid: 151, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysStartGenerateKey' event (evid: 202)\n *\n * Event description: The event is sent when the user click on verify & generate key, to start generate key\n *\n * @param {apiKeysStartGenerateKeyParams} params - The parameters for this event\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysStartGenerateKeyParams>} LogObject<apiKeysStartGenerateKeyParams>\n */\nexport function apiKeysStartGenerateKey(params: apiKeysStartGenerateKeyParams): LogObject<apiKeysStartGenerateKeyParams> {\n return { evid: 202, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysFinishGenerateKey' event (evid: 203)\n *\n * Event description: The event is sent when a key is finish the generating process, regardless it was a success or not\n *\n * @param {apiKeysFinishGenerateKeyParams} params - The parameters for this event\n * @property {string} failure_reason - The reason for the failure, can be empty\n * @property {string} app_def_id - the app_def_id of the key\n * @property {string} key_id - The current app ID\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {number} time_to_generate - The time it took to generate the key in ms (from evid 202 start generate key)\n * @property {boolean} was_success - True if the key was generate successfully\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysFinishGenerateKeyParams>} LogObject<apiKeysFinishGenerateKeyParams>\n */\nexport function apiKeysFinishGenerateKey(params: apiKeysFinishGenerateKeyParams): LogObject<apiKeysFinishGenerateKeyParams> {\n return { evid: 203, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysClickOnActionFromThe3Dots' event (evid: 204)\n *\n * Event description: The event is sent when the user clicks on the top button 'generate api key'\n *\n * @param {apiKeysClickOnActionFromThe3DotsParams} params - The parameters for this event\n * @property {string} key_id - The current app ID\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {string} action - The action the user press on - edit \\ duplicate \\ rotate \\ delete\n * @return {LogObject<apiKeysClickOnActionFromThe3DotsParams>} LogObject<apiKeysClickOnActionFromThe3DotsParams>\n */\nexport function apiKeysClickOnActionFromThe3Dots(params: apiKeysClickOnActionFromThe3DotsParams): LogObject<apiKeysClickOnActionFromThe3DotsParams> {\n return { evid: 204, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysClickOnGenerateKeyTopButton' event (evid: 205)\n *\n * Event description: The event is sent when the user clicks on the 'generate API key' top button on the main page\n *\n * @param {apiKeysClickOnGenerateKeyTopButtonParams} params - The parameters for this event\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysClickOnGenerateKeyTopButtonParams>} LogObject<apiKeysClickOnGenerateKeyTopButtonParams>\n */\nexport function apiKeysClickOnGenerateKeyTopButton(params: apiKeysClickOnGenerateKeyTopButtonParams): LogObject<apiKeysClickOnGenerateKeyTopButtonParams> {\n return { evid: 205, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysClickOnGenerateKeyEmptyState' event (evid: 206)\n *\n * Event description: The event is sent when the user clicks on the '+ generate key' when he has an empty state - while the user has 0 keys\n *\n * @param {apiKeysClickOnGenerateKeyEmptyStateParams} params - The parameters for this event\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysClickOnGenerateKeyEmptyStateParams>} LogObject<apiKeysClickOnGenerateKeyEmptyStateParams>\n */\nexport function apiKeysClickOnGenerateKeyEmptyState(params: apiKeysClickOnGenerateKeyEmptyStateParams): LogObject<apiKeysClickOnGenerateKeyEmptyStateParams> {\n return { evid: 206, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysClickOnViewApiReferences' event (evid: 207)\n *\n * Event description: The event is sent when the user clicks one of the 'view preference options.\n * main page top button, main page API button, main page top learn how to link, key page permissions links, key page learn more, key page top learn how to link, learn more - generate key completed window, learn more - rotate key request window, learn more - rotate key completed window\n *\n * @param {apiKeysClickOnViewApiReferencesParams} params - The parameters for this event\n * @property {string} button_type - Click on one of the API references button - main page top button, main page API button, main page top learn how to link, key page permissions links, key page learn more, key page top learn how to link, learn more - generate key completed window, learn more - rotate key request window, learn more - rotate key completed window\n * @property {string} page_name - The current page name - main page \\ key page\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysClickOnViewApiReferencesParams>} LogObject<apiKeysClickOnViewApiReferencesParams>\n */\nexport function apiKeysClickOnViewApiReferences(params: apiKeysClickOnViewApiReferencesParams): LogObject<apiKeysClickOnViewApiReferencesParams> {\n return { evid: 207, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysClickOnCopyAccountId' event (evid: 208)\n *\n * Event description: The event is sent when the user clicks on the copy account ID button\n *\n * @param {apiKeysClickOnCopyAccountIdParams} params - The parameters for this event\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysClickOnCopyAccountIdParams>} LogObject<apiKeysClickOnCopyAccountIdParams>\n */\nexport function apiKeysClickOnCopyAccountId(params: apiKeysClickOnCopyAccountIdParams): LogObject<apiKeysClickOnCopyAccountIdParams> {\n return { evid: 208, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysStartEditKey' event (evid: 209)\n *\n * Event description: The event is sent when the user clicks on verify & save changes, to start editing a key\n *\n * @param {apiKeysStartEditKeyParams} params - The parameters for this event\n * @property {string} old_key_permissions - The old permissions for the key\n * @property {string} new_key_name - The new api key name\n * @property {string} change_taken - The type of change taken - name\\permisions\\null\n * @property {string} key_id - The current app ID\n * @property {string} old_key_name - The old api name\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} new_key_permissions - The new permissions for the key\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysStartEditKeyParams>} LogObject<apiKeysStartEditKeyParams>\n */\nexport function apiKeysStartEditKey(params: apiKeysStartEditKeyParams): LogObject<apiKeysStartEditKeyParams> {\n return { evid: 209, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysFinishEditKey' event (evid: 210)\n *\n * Event description: The event is sent when a key is finished the editing process, regardless it was a success or not\n *\n * @param {apiKeysFinishEditKeyParams} params - The parameters for this event\n * @property {number} time_to_edit - The time it took to edit the key in ms (from evid 209 start edit key)\n * @property {string} failure_reason - The reason for the failure, can be empty\n * @property {string} old_key_permissions - The old permissions for the key\n * @property {string} new_key_name - The new api key name\n * @property {string} change_taken - The type of change taken - name\\permisions\\null\n * @property {string} key_id - The current app ID\n * @property {string} old_key_name - The old api name\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} new_key_permissions - The new permissions for the key\n * @property {boolean} was_success - True if the key was edited successfully\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysFinishEditKeyParams>} LogObject<apiKeysFinishEditKeyParams>\n */\nexport function apiKeysFinishEditKey(params: apiKeysFinishEditKeyParams): LogObject<apiKeysFinishEditKeyParams> {\n return { evid: 210, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysStartDuplicateKey' event (evid: 211)\n *\n * Event description: The event is sent when the user clicks on verify & save changes, to start duplicating a key\n *\n * @param {apiKeysStartDuplicateKeyParams} params - The parameters for this event\n * @property {string} duplicated_key_permissions - The permissions of the key that was duplicated\n * @property {string} change_taken - The type of change taken - name\\permisions\\null\n * @property {string} duplicated_key_id - The id of the key that was duplicated\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} duplicated_key_name - The name of the key that was duplicated\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysStartDuplicateKeyParams>} LogObject<apiKeysStartDuplicateKeyParams>\n */\nexport function apiKeysStartDuplicateKey(params: apiKeysStartDuplicateKeyParams): LogObject<apiKeysStartDuplicateKeyParams> {\n return { evid: 211, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysFinishDuplicateKey' event (evid: 212)\n *\n * Event description: The event is sent when a key is finished the duplicating process, regardless it was a success or not\n *\n * @param {apiKeysFinishDuplicateKeyParams} params - The parameters for this event\n * @property {string} failure_reason - The reason for the failure, can be empty\n * @property {string} app_def_id - the app_def_id of the key\n * @property {string} duplicated_key_permissions - The permissions of the key that was duplicated\n * @property {string} change_taken - The type of change taken - name\\permisions\\null\n * @property {string} duplicated_key_id - The id of the key that was duplicated\n * @property {number} time_to_duplicate - The time it took to duplicate the key in ms (from evid 2011 start duplicate key)\n * @property {string} key_id - The current api key ID\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} duplicated_key_name - The name of the key that was duplicated\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {boolean} was_success - True if the key was duplicated successfully\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysFinishDuplicateKeyParams>} LogObject<apiKeysFinishDuplicateKeyParams>\n */\nexport function apiKeysFinishDuplicateKey(params: apiKeysFinishDuplicateKeyParams): LogObject<apiKeysFinishDuplicateKeyParams> {\n return { evid: 212, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysStartRotateKey' event (evid: 213)\n *\n * Event description: The event is sent when the user clicks on validate & rotate key, to start rotate a key\n *\n * @param {apiKeysStartRotateKeyParams} params - The parameters for this event\n * @property {string} key_id - The current api ID\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysStartRotateKeyParams>} LogObject<apiKeysStartRotateKeyParams>\n */\nexport function apiKeysStartRotateKey(params: apiKeysStartRotateKeyParams): LogObject<apiKeysStartRotateKeyParams> {\n return { evid: 213, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysFinishRotateKey' event (evid: 214)\n *\n * Event description: The event is sent when a key is finished the rotate process, regardless it was a success or not\n *\n * @param {apiKeysFinishRotateKeyParams} params - The parameters for this event\n * @property {string} failure_reason - The reason for the failure, can be empty\n * @property {number} time_to_rotate - The time it took to rotate the key in ms (from evid 2013 start rotate key)\n * @property {string} key_id - The current api ID\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {boolean} was_success - True if the key was rotated successfully\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysFinishRotateKeyParams>} LogObject<apiKeysFinishRotateKeyParams>\n */\nexport function apiKeysFinishRotateKey(params: apiKeysFinishRotateKeyParams): LogObject<apiKeysFinishRotateKeyParams> {\n return { evid: 214, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysStartDeleteKey' event (evid: 215)\n *\n * Event description: The event is sent when the user clicks on verify & delete key, to start delete a key\n *\n * @param {apiKeysStartDeleteKeyParams} params - The parameters for this event\n * @property {string} key_id - The current api ID\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysStartDeleteKeyParams>} LogObject<apiKeysStartDeleteKeyParams>\n */\nexport function apiKeysStartDeleteKey(params: apiKeysStartDeleteKeyParams): LogObject<apiKeysStartDeleteKeyParams> {\n return { evid: 215, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysFinishDeleteKey' event (evid: 216)\n *\n * Event description: The event is sent when a key is finished the delete process, regardless it was a success or not\n *\n * @param {apiKeysFinishDeleteKeyParams} params - The parameters for this event\n * @property {string} failure_reason - The reason for the failure, can be empty\n * @property {number} time_to_delete - The time it took to delete the key in ms (from evid 2015 start delete key)\n * @property {string} key_id - The current api ID\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {boolean} was_success - True if the key was deleted successfully\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysFinishDeleteKeyParams>} LogObject<apiKeysFinishDeleteKeyParams>\n */\nexport function apiKeysFinishDeleteKey(params: apiKeysFinishDeleteKeyParams): LogObject<apiKeysFinishDeleteKeyParams> {\n return { evid: 216, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysClickOnSendCode' event (evid: 217)\n *\n * Event description: The event is sent when the user clicks on send code button, for the next actions - generate \\ edit \\ duplicate \\ rotate \\ delete\n *\n * @param {apiKeysClickOnSendCodeParams} params - The parameters for this event\n * @property {number} request_number - Running number of the send code request, for this api key\n * @property {string} key_id - The current api ID, will be null if it is duplicate \\ generate action\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {string} request_id - The unique request id, same as the request id for identity and email marketing\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {string} action - The action the user is doing - generate \\ edit \\ duplicate \\ rotate \\ delete\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysClickOnSendCodeParams>} LogObject<apiKeysClickOnSendCodeParams>\n */\nexport function apiKeysClickOnSendCode(params: apiKeysClickOnSendCodeParams): LogObject<apiKeysClickOnSendCodeParams> {\n return { evid: 217, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysClickOnSendCodeAgain' event (evid: 218)\n *\n * Event description: The event is sent when the user clicks on send code again button, for the next actions - generate \\ edit \\ duplicate \\ rotate \\ delete\n *\n * @param {apiKeysClickOnSendCodeAgainParams} params - The parameters for this event\n * @property {string} key_id - The current api ID, will be null if it is duplicate \\ generate action\n * @property {boolean} is_wix_employee - True if the user is wix employee\n * @property {number} num_of_keys - The number of keys in the account\n * @property {string} key_permissions - The chosen permissions for the key\n * @property {boolean} is_premium - True if the user has at least 1 premium package\n * @property {string} key_name - The current api name\n * @property {string} action - The action the user is doing - generate \\ edit \\ duplicate \\ rotate \\ delete\n * @property {number} number_sites - The number of sites in the account\n * @return {LogObject<apiKeysClickOnSendCodeAgainParams>} LogObject<apiKeysClickOnSendCodeAgainParams>\n */\nexport function apiKeysClickOnSendCodeAgain(params: apiKeysClickOnSendCodeAgainParams): LogObject<apiKeysClickOnSendCodeAgainParams> {\n return { evid: 218, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiKeysClickOnOauthPageLink' event (evid: 227)\n *\n * Event description: The event is sent when the user clicks on OAuth page link\n *\n * @param {apiKeysClickOnOauthPageLinkParams} params - The parameters for this event\n * @property {number} num_of_keys - The number of keys in the account\n * @return {LogObject<apiKeysClickOnOauthPageLinkParams>} LogObject<apiKeysClickOnOauthPageLinkParams>\n */\nexport function apiKeysClickOnOauthPageLink(params: apiKeysClickOnOauthPageLinkParams): LogObject<apiKeysClickOnOauthPageLinkParams> {\n return { evid: 227, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'triggerValueWasSelected' event (evid: 400)\n *\n * Event description: The event will be sent any time the user selects a trigger value in zapier creation flow\n *\n * @param {triggerValueWasSelectedParams} params - The parameters for this event\n * @property {string} triggerValues - A json of the trigger that was selected earlier\n * @property {boolean} isAppInstall - True if the app install at the site\n * @property {string} appName - The name of the app that was chosen (for example - booking)\n * @property {GUID} uuid - The uuid that made the action\n * @property {string} fieldLabel - The lable of the field that the user changed\n * @property {string} fieldValue - The value of the field that the user selected\n * @property {string} groupName - The name of the group that was chosen (for example - sub category of booking)\n * @property {string} appId - The guid of the app that was chosen (for example - booking guid)\n * @property {GUID} msid - The guid of the site\n * @return {LogObject<triggerValueWasSelectedParams>} LogObject<triggerValueWasSelectedParams>\n */\nexport function triggerValueWasSelected(params: triggerValueWasSelectedParams): LogObject<triggerValueWasSelectedParams> {\n return { evid: 400, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'zapierTestDataClick' event (evid: 401)\n *\n * Event description: The event will be sent any time the user test a zap in zapier\n *\n * @param {zapierTestDataClickParams} params - The parameters for this event\n * @property {string} triggerValues - A json of the trigger that was selected earlier\n * @property {boolean} isAppInstall - True if the app install at the site\n * @property {string} appName - The name of the app that was chosen (for example - booking)\n * @property {GUID} uuid - The uuid that made the action\n * @property {string} groupName - The name of the group that was chosen (for example - sub category of booking)\n * @property {string} appId - The guid of the app that was chosen (for example - booking guid)\n * @property {GUID} msid - The guid of the site\n * @return {LogObject<zapierTestDataClickParams>} LogObject<zapierTestDataClickParams>\n */\nexport function zapierTestDataClick(params: zapierTestDataClickParams): LogObject<zapierTestDataClickParams> {\n return { evid: 401, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'zapierCustomZapCreatedOrDeleted' event (evid: 402)\n *\n * Event description: the event will be sent when a custom zap was created or deleted from the zapier website.\n *\n * @param {zapierCustomZapCreatedOrDeletedParams} params - The parameters for this event\n * @property {string} ruleId - The rule id\n * @property {string} zapId - The zap id\n * @property {string} action - Detele / Cerate\n * @return {LogObject<zapierCustomZapCreatedOrDeletedParams>} LogObject<zapierCustomZapCreatedOrDeletedParams>\n */\nexport function zapierCustomZapCreatedOrDeleted(params: zapierCustomZapCreatedOrDeletedParams): LogObject<zapierCustomZapCreatedOrDeletedParams> {\n return { evid: 402, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'graphqlCall' event (evid: 400)\n *\n * Event description: Tracks GraphQL API calls initiated by users, clients, and internal systems. This event captures details about the call itself, including the operation type, the source type, whether it was successful, and the time it took to resolve.\n *\n * @param {graphqlCallParams} params - The parameters for this event\n * @property {string} client_artifact_id - The artifact that was making the call\n * @property {string} operation_type - query / mutation\n * @property {GUID} metasiteId - msid of the site\n * @property {string} entity_call_breakdown - { \"fqdn1\": { \"method1\": [\"field_1\", \"field_2\"] \"method2\": [\"field_3\", \"field_4\"] ... }\n * @property {string} source_type - headless/ TPA/ Internal site / Internal App\n * @property {GUID} appDefId - the app guid\n * @property {string} schema_name - The schema name - Internal / external / demo\n * @property {string} origin_url - The source url\n * @property {number} time_to_resolve - The time it takes to the resolver to obtain answer, in ms\n * @property {boolean} is_success - True if the call succeeded\n * @return {LogObject<graphqlCallParams>} LogObject<graphqlCallParams>\n */\nexport function graphqlCall(params: graphqlCallParams): LogObject<graphqlCallParams> {\n return { evid: 400, src: 155, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'autoVeloSiteCallForAMethod' event (evid: 401)\n *\n * Event description: The event is sent when the server gets a call for a method, from a site\n *\n * @param {autoVeloSiteCallForAMethodParams} params - The parameters for this event\n * @property {string} http_code - The http code for this call - 200\\404\\..\n * @property {string} api_owner - The API owner (company)\n * @property {string} failure_reason - The reason for the failure, can be empty\n * @property {string} service_name - The name of the service of the method\n * @property {string} entity_name - The FQDN of the entity\n * @property {string} environment - The type of development - front-end \\ back-end\n * @property {string} module_name - The module name of the entity - edm name\n * @property {string} method_name - The name of the method that was in use\n * @property {string} msid - The msid of the site that made the call\n * @return {LogObject<autoVeloSiteCallForAMethodParams>} LogObject<autoVeloSiteCallForAMethodParams>\n */\nexport function autoVeloSiteCallForAMethod(params: autoVeloSiteCallForAMethodParams): LogObject<autoVeloSiteCallForAMethodParams> {\n return { evid: 401, src: 155, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'appsSettingsDeletionCandidate' event (evid: 700)\n *\n * Event description: Apps Settings - Deletion Candidate.\n *\n * @param {appsSettingsDeletionCandidateParams} params - The parameters for this event\n * @property {GUID} instance - .\n * @property {GUID} external_id - .\n * @property {GUID} app_id - .\n * @return {LogObject<appsSettingsDeletionCandidateParams>} LogObject<appsSettingsDeletionCandidateParams>\n */\nexport function appsSettingsDeletionCandidate(params: appsSettingsDeletionCandidateParams): LogObject<appsSettingsDeletionCandidateParams> {\n return { evid: 700, src: 155, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'settingsAccess' event (evid: 800)\n *\n * Event description: Settings Access.\n *\n * @param {settingsAccessParams} params - The parameters for this event\n * @property {GUID} instance - .\n * @property {GUID} external_id - .\n * @property {GUID} app_id - .\n * @return {LogObject<settingsAccessParams>} LogObject<settingsAccessParams>\n */\nexport function settingsAccess(params: settingsAccessParams): LogObject<settingsAccessParams> {\n return { evid: 800, src: 155, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'apiBlockGaRule' event (evid: 801)\n *\n * Event description: The event will be sent when an API is blocked GA rule/passed it - the API is blocked due to not following the rule condition\n *\n * @param {apiBlockGaRuleParams} params - The parameters for this event\n * @property {string} fqdn - The fqdn that was blocked\n * @property {boolean} isBlocked - True if the API was blocked\n * @property {string} method - The API method (function)\n * @property {string} namespace - The namespace of the method\n * @property {string} blockReason - If the API was blocked - the block reason\n * @property {string} serviceArtifactId - the service artifact id\n * @return {LogObject<apiBlockGaRuleParams>} LogObject<apiBlockGaRuleParams>\n */\nexport function apiBlockGaRule(params: apiBlockGaRuleParams): LogObject<apiBlockGaRuleParams> {\n return { evid: 801, src: 155, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessAddWixToYourProjectDialogIsShown' event (evid: 13)\n *\n * Event description: reported when user clicks to open \u2018Add Wix to your Project\u2019 dialog from Vercel/Netlify\n *\n * @param {headlessAddWixToYourProjectDialogIsShownParams} params - The parameters for this event\n * @property {string} provider - Netlify/Vercel\n * @property {string} business_type - The Business type that was chosen, relevant only for Netlify\n * @property {string} template_id - The template ID that was chosen, relevant only for Netlify\n * @return {LogObject<headlessAddWixToYourProjectDialogIsShownParams>} LogObject<headlessAddWixToYourProjectDialogIsShownParams>\n */\nexport function headlessAddWixToYourProjectDialogIsShown(params: headlessAddWixToYourProjectDialogIsShownParams): LogObject<headlessAddWixToYourProjectDialogIsShownParams> {\n return { evid: 13, src: 160, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessOAuthInstalled' event (evid: 15)\n *\n * Event description: reported when the user approve the app market dialog and an OAuth installed and redirect to Netlify/Vercel - the funnel was finished successfuly\n *\n * @param {headlessOAuthInstalledParams} params - The parameters for this event\n * @property {string} source - New to Wix / Existing Wix Business\n * @property {string} provider - Netlify/Vercel\n * @property {string} business_type - The Business type that was chosen, relevant only for Netlify\n * @property {string} template_id - The template ID that was chosen, relevant only for Netlify\n * @return {LogObject<headlessOAuthInstalledParams>} LogObject<headlessOAuthInstalledParams>\n */\nexport function headlessOAuthInstalled(params: headlessOAuthInstalledParams): LogObject<headlessOAuthInstalledParams> {\n return { evid: 15, src: 160, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessAddWixToYourProjectDialogClick' event (evid: 16)\n *\n * Event description: reported when user clicks on any button at the \u2018Add Wix to your Project\u2019 dialog from Vercel/Netlify\n *\n * @param {headlessAddWixToYourProjectDialogClickParams} params - The parameters for this event\n * @property {string} provider - Netlify/Vercel\n * @property {GUID} uuid - The uuid of the user\n * @property {GUID} client_id - client_id\n * @property {string} cta - Sign Up / Login / watch video\n * @property {string} business_type - The Business type that was chosen, relevant only for Netlify\n * @property {string} template_id - The template ID that was chosen, relevant only for Netlify\n * @return {LogObject<headlessAddWixToYourProjectDialogClickParams>} LogObject<headlessAddWixToYourProjectDialogClickParams>\n */\nexport function headlessAddWixToYourProjectDialogClick(params: headlessAddWixToYourProjectDialogClickParams): LogObject<headlessAddWixToYourProjectDialogClickParams> {\n return { evid: 16, src: 160, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessDeployThisTemplatePageIsShown' event (evid: 17)\n *\n * Event description: reported when the deploy this template page is shown\n *\n * @param {headlessDeployThisTemplatePageIsShownParams} params - The parameters for this event\n * @property {string} business_type - The Business type that was chosen, relevant only for Netlify\n * @property {string} template_id - The template ID that was chosen, relevant only for Netlify\n * @return {LogObject<headlessDeployThisTemplatePageIsShownParams>} LogObject<headlessDeployThisTemplatePageIsShownParams>\n */\nexport function headlessDeployThisTemplatePageIsShown(params: headlessDeployThisTemplatePageIsShownParams): LogObject<headlessDeployThisTemplatePageIsShownParams> {\n return { evid: 17, src: 160, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessDeployThisTemplatePageClick' event (evid: 18)\n *\n * Event description: reported when the user clicks on any cta at the deploy this template page\n *\n * @param {headlessDeployThisTemplatePageClickParams} params - The parameters for this event\n * @property {string} provider - Netlify / Vercel, will be sent only when the cta is continue\n * @property {string} cta - Deploy to Netlify / Deploy to Vercel / Continue / View Template Repo\n * @property {string} business_type - The Business type that was chosen, relevant only for Netlify\n * @property {string} template_id - The template ID that was chosen, relevant only for Netlify\n * @return {LogObject<headlessDeployThisTemplatePageClickParams>} LogObject<headlessDeployThisTemplatePageClickParams>\n */\nexport function headlessDeployThisTemplatePageClick(params: headlessDeployThisTemplatePageClickParams): LogObject<headlessDeployThisTemplatePageClickParams> {\n return { evid: 18, src: 160, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessResumeSetUpDialogIsShown' event (evid: 19)\n *\n * Event description: reported when user clicks to open \u2018Resume Set Up dialog from Vercel/Netlify\n *\n * @param {headlessResumeSetUpDialogIsShownParams} params - The parameters for this event\n * @property {string} provider - Netlify/Vercel\n * @property {string} business_type - The Business type that was chosen, relevant only for Netlify\n * @property {string} template_id - The template ID that was chosen, relevant only for Netlify\n * @return {LogObject<headlessResumeSetUpDialogIsShownParams>} LogObject<headlessResumeSetUpDialogIsShownParams>\n */\nexport function headlessResumeSetUpDialogIsShown(params: headlessResumeSetUpDialogIsShownParams): LogObject<headlessResumeSetUpDialogIsShownParams> {\n return { evid: 19, src: 160, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'copyOfHeadlessResumeSetUpDialogClick' event (evid: 20)\n *\n * Event description: reported when user clicks on any button at the \u2018Resume Set Up\u2019 dialog from Vercel/Netlify\n *\n * @param {copyOfHeadlessResumeSetUpDialogClickParams} params - The parameters for this event\n * @property {string} provider - Netlify/Vercel\n * @property {string} cta - Resume / Cancle\n * @property {string} business_type - The Business type that was chosen, relevant only for Netlify\n * @property {string} template_id - The template ID that was chosen, relevant only for Netlify\n * @return {LogObject<copyOfHeadlessResumeSetUpDialogClickParams>} LogObject<copyOfHeadlessResumeSetUpDialogClickParams>\n */\nexport function copyOfHeadlessResumeSetUpDialogClick(params: copyOfHeadlessResumeSetUpDialogClickParams): LogObject<copyOfHeadlessResumeSetUpDialogClickParams> {\n return { evid: 20, src: 160, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'webhooksInDcCodeExampleWindowClicks' event (evid: 11905)\n *\n * Event description: The event will be sent on any click at the code example window at the webhooks page in DC \n *\n * @param {webhooksInDcCodeExampleWindowClicksParams} params - The parameters for this event\n * @property {string} codeType - node.sj / etc... - what was chosen when the user clicked on the cta\n * @property {string} webhookApiCategory - The API category that the user is currently works on\n * @property {string} webhookEventType - The event type that the user is currently works on\n * @property {string} webhookSlug - The webhook_slug that the user is currently works on\n * @property {string} cta - The click name that the user clicked on (X, node.js, copy, etc))\n * @property {string} displayType - side bar / modal\n * @property {string} extra_values - Any extra value. for example - when the user chose a different lang, it will sent the lan that was choosen. can be null.\n * @return {LogObject<webhooksInDcCodeExampleWindowClicksParams>} LogObject<webhooksInDcCodeExampleWindowClicksParams>\n */\nexport function webhooksInDcCodeExampleWindowClicks(params: webhooksInDcCodeExampleWindowClicksParams): LogObject<webhooksInDcCodeExampleWindowClicksParams> {\n return { evid: 11905, src: 96, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'webhooksInDcTriggeredTestModalClicks' event (evid: 11906)\n *\n * Event description: The event will be sent on any click at the triggered test modal at the webhooks page in DC \n *\n * @param {webhooksInDcTriggeredTestModalClicksParams} params - The parameters for this event\n * @property {string} cta - The click name that the user clicked on (copy / close / X)\n * @property {string} webhookApiCategory - The API category that the user is currently works on\n * @property {string} webhookEventType - The event type that the user is currently works on\n * @property {string} webhookSlug - The webhook_slug that the user is currently works on\n * @return {LogObject<webhooksInDcTriggeredTestModalClicksParams>} LogObject<webhooksInDcTriggeredTestModalClicksParams>\n */\nexport function webhooksInDcTriggeredTestModalClicks(params: webhooksInDcTriggeredTestModalClicksParams): LogObject<webhooksInDcTriggeredTestModalClicksParams> {\n return { evid: 11906, src: 96, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'webhooksInDcCodeExampleWindowScroll' event (evid: 11907)\n *\n * Event description: The event will be sent a scroll at the code example window at the webhooks page in DC \n *\n * @param {webhooksInDcCodeExampleWindowScrollParams} params - The parameters for this event\n * @property {string} codeType - node.sj / etc... - what was chosen when the user clicked on the cta\n * @property {string} webhookApiCategory - The API category that the user is currently works on\n * @property {string} webhookEventType - The event type that the user is currently works on\n * @property {string} webhookSlug - The webhook_slug that the user is currently works on\n * @property {string} scrollType - vertical/horizontal\n * @property {string} displayType - side bar / modal\n * @return {LogObject<webhooksInDcCodeExampleWindowScrollParams>} LogObject<webhooksInDcCodeExampleWindowScrollParams>\n */\nexport function webhooksInDcCodeExampleWindowScroll(params: webhooksInDcCodeExampleWindowScrollParams): LogObject<webhooksInDcCodeExampleWindowScrollParams> {\n return { evid: 11907, src: 96, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'webhooksInDcCreateEventPageClicks' event (evid: 11908)\n *\n * Event description: The event will be sent on any click at the create event page at the webhooks page in DC \n *\n * @param {webhooksInDcCreateEventPageClicksParams} params - The parameters for this event\n * @property {string} webhookApiCategory - The API category that the user is currently works on\n * @property {string} webhookEventType - The event type that the user is currently works on\n * @property {string} webhookSlug - The webhook_slug that the user is currently works on\n * @property {string} cta - The click name that the user clicked on (code sample / trigger test / view guide / api reference)\n * @return {LogObject<webhooksInDcCreateEventPageClicksParams>} LogObject<webhooksInDcCreateEventPageClicksParams>\n */\nexport function webhooksInDcCreateEventPageClicks(params: webhooksInDcCreateEventPageClicksParams): LogObject<webhooksInDcCreateEventPageClicksParams> {\n return { evid: 11908, src: 96, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'webhooksInDcMainPageClicks' event (evid: 12301)\n *\n * Event description: The event will be sent on any click at the webhooks main page in DC \n *\n * @param {webhooksInDcMainPageClicksParams} params - The parameters for this event\n * @property {string} webhookApiCategory - The API category that the user is currently works on\n * @property {string} webhookEventType - The event type that the user is currently works on\n * @property {string} clickType - Navigation, action, expend, colapsed\n * @property {string} location - popover, top, bottom, table\n * @property {string} clickName - the name of the button that was clicked\n * @property {string} pageViewType - webhook list / webhook log\n * @return {LogObject<webhooksInDcMainPageClicksParams>} LogObject<webhooksInDcMainPageClicksParams>\n */\nexport function webhooksInDcMainPageClicks(params: webhooksInDcMainPageClicksParams): LogObject<webhooksInDcMainPageClicksParams> {\n return { evid: 12301, src: 96, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocs404PageLoaded' event (evid: 10)\n *\n * Event description: 404 page was loaded\n *\n * @param {wixDocs404PageLoadedParams} params - The parameters for this event\n * @property {string} source - redirect (link) / social / referral (navigation inside the platform )/ organic search (google)\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} portal - The current portal\n * @property {boolean} is_first_access - True if this is the first time that the user opened the Wix Docs platform for this session - external nav / internal\n * @property {string} page_url - The url of the current page\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {boolean} is_deprecation_error - 404 due to deprecated content without deprecation mode on \n * @return {LogObject<wixDocs404PageLoadedParams>} LogObject<wixDocs404PageLoadedParams>\n */\nexport function wixDocs404PageLoaded(params: wixDocs404PageLoadedParams): LogObject<wixDocs404PageLoadedParams> {\n return { evid: 10, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsSendRequestServer' event (evid: 111)\n *\n * Event description: Wix Docs - Send Request (server)\n *\n * @param {wixDocsSendRequestServerParams} params - The parameters for this event\n * @property {Url} invoked_url - invoked_url\n * @property {string} http_method - http_method\n * @property {string} response - response\n * @property {boolean} is_success - is_success\n * @return {LogObject<wixDocsSendRequestServerParams>} LogObject<wixDocsSendRequestServerParams>\n */\nexport function wixDocsSendRequestServer(params: wixDocsSendRequestServerParams): LogObject<wixDocsSendRequestServerParams> {\n return { evid: 111, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsFeedbackSubmittedServer' event (evid: 112)\n *\n * Event description: Wix Docs - Feedback Submitted (Server)\n *\n * @param {wixDocsFeedbackSubmittedServerParams} params - The parameters for this event\n * @property {string} customer_id - customer id\n * @property {Url} article_url - article url\n * @property {string} article_name - article name\n * @property {GUID} app_id - app_id\n * @property {GUID} msid - msid\n * @property {boolean} email_filled - was email filled in by user\n * @return {LogObject<wixDocsFeedbackSubmittedServerParams>} LogObject<wixDocsFeedbackSubmittedServerParams>\n */\nexport function wixDocsFeedbackSubmittedServer(params: wixDocsFeedbackSubmittedServerParams): LogObject<wixDocsFeedbackSubmittedServerParams> {\n return { evid: 112, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'testTokenTokenGeneratedServerless' event (evid: 1200)\n *\n * Event description: token generated to user's site\n *\n * @param {testTokenTokenGeneratedServerlessParams} params - The parameters for this event\n * @property {string} token - token\n * @property {GUID} selectedMsid - selected_msid\n * @return {LogObject<testTokenTokenGeneratedServerlessParams>} LogObject<testTokenTokenGeneratedServerlessParams>\n */\nexport function testTokenTokenGeneratedServerless(params: testTokenTokenGeneratedServerlessParams): LogObject<testTokenTokenGeneratedServerlessParams> {\n return { evid: 1200, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'docsAiAssistantClickSrc112Evid13' event (evid: 13)\n *\n * Event description: The event is sent when the Docs AI Assistant was clicked on any button related\n *\n * @param {docsAiAssistantClickSrc112Evid13Params} params - The parameters for this event\n * @property {string} cta - startover, click on the typing box, send-message, copy, feedback-open, feedback-close, feedback-submit, new-conversation, link (copy-code example, link from code not implemented for now)\n * @property {string} portal - The Docs portal\n * @property {string} page_url - The current page url\n * @property {string} session_id - Docs session id\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} ai_session_id - ai session id\n * @property {string} extra_values - for example - {feedback answer: yes, feedback content: XXX}\n * @return {LogObject<docsAiAssistantClickSrc112Evid13Params>} LogObject<docsAiAssistantClickSrc112Evid13Params>\n */\nexport function docsAiAssistantClickSrc112Evid13(params: docsAiAssistantClickSrc112Evid13Params): LogObject<docsAiAssistantClickSrc112Evid13Params> {\n return { evid: 13, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsChangelogFilterUsage' event (evid: 1301)\n *\n * Event description: Tracks when a user applies a filter within the Wix Docs Changelog. It captures details about the user's click and the specific filters applied, such as by status, feature type, or product.\n *\n * @param {wixDocsChangelogFilterUsageParams} params - The parameters for this event\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {string} status_filter - filter the type of the item New/Updated/\n * Deprecated\n * @property {string} feature_type_filter - filter like portal.. Go Headless/Build apps/ Rest & SDK etc.\n * @property {string} product_filter - filter on the level of business solution/edm/vertical\n * @property {string} user_click - the click that triggered the event - the filter name / reset filter button\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsChangelogFilterUsageParams>} LogObject<wixDocsChangelogFilterUsageParams>\n */\nexport function wixDocsChangelogFilterUsage(params: wixDocsChangelogFilterUsageParams): LogObject<wixDocsChangelogFilterUsageParams> {\n return { evid: 1301, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsClickOnItem' event (evid: 1302)\n *\n * Event description: Fires when a client or user clicks on an item within the Wix Docs Changelog. This event captures details about the interaction, including the specific URL clicked, the user's view mode, and the API toggle status for API references.\n *\n * @param {wixDocsClickOnItemParams} params - The parameters for this event\n * @property {string} item_id - The ID of the Changelog item. Use the Changelog Items table to get the item's characteristics and dimensions\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {string} clicked_url - the URL that the user clicked on inside of the item\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsClickOnItemParams>} LogObject<wixDocsClickOnItemParams>\n */\nexport function wixDocsClickOnItem(params: wixDocsClickOnItemParams): LogObject<wixDocsClickOnItemParams> {\n return { evid: 1302, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsChangelogItemSeen' event (evid: 1303)\n *\n * Event description: Includes json of item id's, that loaded on the user's screen.\n * the event is sent every time a new item entered the user screen, after at least 2 seconds of being static (stopped scrolling).\n *\n * @param {wixDocsChangelogItemSeenParams} params - The parameters for this event\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {string} Item_ids - json of item id's that seen by the user (appeared on his screen) after 2 sec of being static (stopped scrolling)\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsChangelogItemSeenParams>} LogObject<wixDocsChangelogItemSeenParams>\n */\nexport function wixDocsChangelogItemSeen(params: wixDocsChangelogItemSeenParams): LogObject<wixDocsChangelogItemSeenParams> {\n return { evid: 1303, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsChangelogRssModalActions' event (evid: 1304)\n *\n * Event description: RSS Modal opened / User Clicked on item inside the RSS modal\n *\n * @param {wixDocsChangelogRssModalActionsParams} params - The parameters for this event\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {string} action - Click / Modal open / Modal close\n * @property {string} click_name - Learn more / Feed format JSON / feed format RSS / Copy URL / Clear filters \n * @property {string} feed_format - Status of feed format in the time of the action\n * @property {string} url - The URL in the time of the action\n * @property {string} statuses_filter - Status of the filter in the time of the action \n * @property {string} categories_filter - Status of the filter in the time of the action\n * @property {string} products_filter - Status of the filter in the time of the action\n * @return {LogObject<wixDocsChangelogRssModalActionsParams>} LogObject<wixDocsChangelogRssModalActionsParams>\n */\nexport function wixDocsChangelogRssModalActions(params: wixDocsChangelogRssModalActionsParams): LogObject<wixDocsChangelogRssModalActionsParams> {\n return { evid: 1304, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'docsAiAssistantAnswerSrc112Evid14' event (evid: 14)\n *\n * Event description: The event is sent when the Docs AI Assistant is answering the user\n *\n * @param {docsAiAssistantAnswerSrc112Evid14Params} params - The parameters for this event\n * @property {string} portal - The Docs portal\n * @property {string} page_url - The current page url\n * @property {number} response_time - The time it took to the AI to give answer in ms\n * @property {boolean} success - true if the AI gave any answer, if it failed - false\n * @property {string} answer - The AI answer\n * @property {string} question - The user question\n * @property {string} session_id - Docs session id\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} ai_session_id - ai session id\n * @return {LogObject<docsAiAssistantAnswerSrc112Evid14Params>} LogObject<docsAiAssistantAnswerSrc112Evid14Params>\n */\nexport function docsAiAssistantAnswerSrc112Evid14(params: docsAiAssistantAnswerSrc112Evid14Params): LogObject<docsAiAssistantAnswerSrc112Evid14Params> {\n return { evid: 14, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'docsSsrRequest' event (evid: 140)\n *\n * Event description: A server-side request to read from wix-docs\n *\n * @param {docsSsrRequestParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} source - redirect (link) / social / referral (navigation inside the platform )/ organic search (google)\n * @property {string} session_id - The current user`s session in the product\n * @property {string} referral_url - The url of the last page the users have seen, if he open the page by link it will send null\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {number} screen_width - Screen width for resolution\n * @property {string} object - The object of the article, can be empty\n * @property {boolean} has_edit_permission - True if the user has edit permission for the current article\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - the article type - get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {number} screen_height - Screen height for resolution\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {boolean} is_first_access - True if this is the first time that the user opened the Wix Docs platform for this session\n * @property {string} nav_type - search result click, side bar click, tab click, internal link navigation ,scroll\n * @property {string} page_url - The url of the current page\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {boolean} is_bot - is the traffic origin identified as AI/Smart agent\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {boolean} page_exists - True if the page exists - false if the user landed on resource that is not exists\n * @property {string} deprecation_status - deprecation status of the item/page\n * @return {LogObject<docsSsrRequestParams>} LogObject<docsSsrRequestParams>\n */\nexport function docsSsrRequest(params: docsSsrRequestParams): LogObject<docsSsrRequestParams> {\n return { evid: 140, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'docsAiAssistantOpenCloseSrc112Evid1435' event (evid: 1435)\n *\n * Event description: The event is sent when the Docs AI Assistant is Opened / Closed\n *\n * @param {docsAiAssistantOpenCloseSrc112Evid1435Params} params - The parameters for this event\n * @property {string} action - open / close\n * @property {string} portal - The Docs portal\n * @property {string} page_url - The current page url\n * @property {number} interaction_time - when the action is close - the time the session took \n * @property {string} session_id - Docs session id\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} ai_session_id - The ai session id\n * @return {LogObject<docsAiAssistantOpenCloseSrc112Evid1435Params>} LogObject<docsAiAssistantOpenCloseSrc112Evid1435Params>\n */\nexport function docsAiAssistantOpenCloseSrc112Evid1435(params: docsAiAssistantOpenCloseSrc112Evid1435Params): LogObject<docsAiAssistantOpenCloseSrc112Evid1435Params> {\n return { evid: 1435, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'docsAiAssistantCostSrc112Evid1436' event (evid: 1436)\n *\n * Event description: The event is sent when the Docs AI Assistant is sending a response - with the cost it had\n *\n * @param {docsAiAssistantCostSrc112Evid1436Params} params - The parameters for this event\n * @property {string} type - call type\n * @property {number} cost - The cost in dollar\n * @property {number} response_time - in ms\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<docsAiAssistantCostSrc112Evid1436Params>} LogObject<docsAiAssistantCostSrc112Evid1436Params>\n */\nexport function docsAiAssistantCostSrc112Evid1436(params: docsAiAssistantCostSrc112Evid1436Params): LogObject<docsAiAssistantCostSrc112Evid1436Params> {\n return { evid: 1436, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsHoverOnContentTerms' event (evid: 1437)\n *\n * Event description: Sends an event when a user hovers on wix docs content term, more that 3 sec.\n *\n * @param {wixDocsHoverOnContentTermsParams} params - The parameters for this event\n * @property {string} session_id - The current user`s session in the product\n * @property {string} portal - The current portal\n * @property {string} article_type - The current article type - api / md / object / get \\ webhook \\ post \\ ..\n * @property {string} page_url - The url of the current page\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @return {LogObject<wixDocsHoverOnContentTermsParams>} LogObject<wixDocsHoverOnContentTermsParams>\n */\nexport function wixDocsHoverOnContentTerms(params: wixDocsHoverOnContentTermsParams): LogObject<wixDocsHoverOnContentTermsParams> {\n return { evid: 1437, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsHover' event (evid: 1438)\n *\n * Event description: Sends an event when a user is hovering over content on Docs\n *\n * @param {wixDocsHoverParams} params - The parameters for this event\n * @property {string} method - The method of the article, can be empty\n * @property {string} hover_name - The name of the content\n * @property {string} session_id - The current user`s session in the product\n * @property {string} category_name - The category of the current article\n * @property {string} portal - The current portal\n * @property {string} object - The object of the article, can be empty\n * @property {string} fqdn - The fqdn of the article, can be empty\n * @property {string} article_type - The current article type - api / md / object / get \\ webhook \\ post \\ ..\n * @property {string} article_id - The ID of the current article\n * @property {string} article_name - The name of the current article\n * @property {string} webhook - The webhook of the article, can be empty\n * @property {string} page_url - The url of the current page\n * @property {string} view_mode - Logged in / Internal Mode / Edit Mode / logged out\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @property {string} hover_content - The content of the hovered object\n * @return {LogObject<wixDocsHoverParams>} LogObject<wixDocsHoverParams>\n */\nexport function wixDocsHover(params: wixDocsHoverParams): LogObject<wixDocsHoverParams> {\n return { evid: 1438, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsRedirectByExternalIdSrc112Evid1601' event (evid: 1601)\n *\n * Event description: Tracks redirects triggered by an external ID within the Wix Docs platform. The event captures whether the redirect was successful and from which platform it was initiated, such as the CLI or Dev Center, along with the API toggle status for API reference portals.\n *\n * @param {wixDocsRedirectByExternalIdSrc112Evid1601Params} params - The parameters for this event\n * @property {boolean} is_success - a valid resource was found by the portal and external id data\n * @property {string} redirect_url - the url that was redirect\n * @property {string} external_id - Docs metadata on the resource\n * @property {string} platform - cli/dev center/blocks\n * @property {string} portal_slug - the docs portal\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsRedirectByExternalIdSrc112Evid1601Params>} LogObject<wixDocsRedirectByExternalIdSrc112Evid1601Params>\n */\nexport function wixDocsRedirectByExternalIdSrc112Evid1601(params: wixDocsRedirectByExternalIdSrc112Evid1601Params): LogObject<wixDocsRedirectByExternalIdSrc112Evid1601Params> {\n return { evid: 1601, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixDocsToggleClick' event (evid: 22)\n *\n * Event description: Click on a toggle to change View mode/Deprecation mode/Edit mode...\n *\n * @param {wixDocsToggleClickParams} params - The parameters for this event\n * @property {string} toggle_name - the name of the toggle that was clicked\n * @property {string} toggle_status - the current status of the toggle (before clicking)\n * @property {string} page_url - the url of the current page (when clicking on the toggle)\n * @property {string} article_name - the name of the current item\n * @property {boolean} is_deprecation_mode - deprecation mode is on\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<wixDocsToggleClickParams>} LogObject<wixDocsToggleClickParams>\n */\nexport function wixDocsToggleClick(params: wixDocsToggleClickParams): LogObject<wixDocsToggleClickParams> {\n return { evid: 22, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'gitToResourceUpdateSrc112Evid30' event (evid: 30)\n *\n * Event description: Tracks the git-to-resource update pipeline for operations executed by internal tools within Wix Docs. This event provides details on each specific step and flow within the pipeline, such as which resources were updated and from which Git repository.\n *\n * @param {gitToResourceUpdateSrc112Evid30Params} params - The parameters for this event\n * @property {string} flow - the consumed/produced event topic (REST/SDK/MD)\n * @property {string} step - the name of the step\n * @property {string} revision_id_1 - revision id\n * @property {string} resource_id_1 - resource id\n * @property {string} entity_id - fqdn (for open api resolver) \n * @property {string} repository_full_name - repository name (for md resolver and repo whitlist in autogen)\n * @property {string} package_name - package name (for public sdk and auto velo)\n * @property {string} module_name - module name (for legacy velo)\n * @property {string} git_commit_hash - unique identifier of the current pipeline. consistent over the pipeline\n * @property {string} api_toggle_status - REST/SDK on api references portal\n * @return {LogObject<gitToResourceUpdateSrc112Evid30Params>} LogObject<gitToResourceUpdateSrc112Evid30Params>\n */\nexport function gitToResourceUpdateSrc112Evid30(params: gitToResourceUpdateSrc112Evid30Params): LogObject<gitToResourceUpdateSrc112Evid30Params> {\n return { evid: 30, src: 112, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'prodTablesToolActionStatusSrc11Evid1999' event (evid: 1999)\n *\n * Event description: Tracks when a user clicks a call-to-action button in the production tables tool in Wix Docs to request a database management action. It captures details of the action, such as migrating a table or dropping a column between the sandbox and production catalogs, and tracks its status as it progresses (e.g., queued, running, success, failed).\n *\n * @param {prodTablesToolActionStatusSrc11Evid1999Params} params - The parameters for this event\n * @property {string} request_id - The requset id of the action\n * @property {string} submitter - The user email requsted the action\n * @property {string} action_type - migrate / drop_column / \u2026\n * @property {string} from_catalog - sandbox\n * @property {string} to_catalog - prod / prod_encrypted\n * @property {string} schema - The schema of the table the action is executed on\n * @property {string} from_table_name - The name of the table in sandbox\n * @property {string} to_table_name - The name of the table in prod / prod_encrypted\n * @property {string} error_message - The error message, can be null\n * @property {string} action_status - ACCEPTED, QUEUED, RUNNING, SUCCESS, FAILED, CANCELLED, ROLLED_BACK\n * @property {string} pre_migration_snapshot_id - pre_migration_snapshot_id from iceberg\n * @property {string} executer_sa - The executer_sa \n * @return {LogObject<prodTablesToolActionStatusSrc11Evid1999Params>} LogObject<prodTablesToolActionStatusSrc11Evid1999Params>\n */\nexport function prodTablesToolActionStatusSrc11Evid1999(params: prodTablesToolActionStatusSrc11Evid1999Params): LogObject<prodTablesToolActionStatusSrc11Evid1999Params> {\n return { evid: 1999, src: 11, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'prodTablesToolCtaClickSrc11Evid2000' event (evid: 2000)\n *\n * Event description: Tracks when a user clicks a call-to-action button in the production tables tool. It captures details of the requested database management action, such as migrating a table or dropping a column between the sandbox and production catalogs.\n *\n * @param {prodTablesToolCtaClickSrc11Evid2000Params} params - The parameters for this event\n * @property {string} cta - start, cancel, rollback, etc\n * @property {string} request_id - The requset id of the action\n * @property {string} submitter - The user email requsted the action\n * @property {string} action_type - migrate / drop_column / \u2026\n * @property {string} from_catalog - sandbox\n * @property {string} to_catalog - prod / prod_encrypted\n * @property {string} schema - The schema of the table the action is executed on\n * @property {string} from_table_name - The name of the table in sandbox\n * @property {string} to_table_name - The name of the table in prod / prod_encrypted\n * @return {LogObject<prodTablesToolCtaClickSrc11Evid2000Params>} LogObject<prodTablesToolCtaClickSrc11Evid2000Params>\n */\nexport function prodTablesToolCtaClickSrc11Evid2000(params: prodTablesToolCtaClickSrc11Evid2000Params): LogObject<prodTablesToolCtaClickSrc11Evid2000Params> {\n return { evid: 2000, src: 11, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'papiCleanExampleRunSrc11Evid290' event (evid: 290)\n *\n * Event description: Every 3 hours, Papi runs on all of our documented methods trying get successful response\n *\n * @param {papiCleanExampleRunSrc11Evid290Params} params - The parameters for this event\n * @property {string} fqdn - entity name\n * @property {string} method_name - method name\n * @property {string} service_name - service name\n * @property {string} flavour - REST/SDK\n * @property {string} run_result - Success/Fail\n * @return {LogObject<papiCleanExampleRunSrc11Evid290Params>} LogObject<papiCleanExampleRunSrc11Evid290Params>\n */\nexport function papiCleanExampleRunSrc11Evid290(params: papiCleanExampleRunSrc11Evid290Params): LogObject<papiCleanExampleRunSrc11Evid290Params> {\n return { evid: 290, src: 11, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'codegenAgentSessionStartSrc11Evid299' event (evid: 299)\n *\n * Event description: fires when a user trigger codegen (wix code) job.\n *\n * @param {codegenAgentSessionStartSrc11Evid299Params} params - The parameters for this event\n * @property {string} job_id - job ID is unique for each user-prompt\n * @property {string} job_input - the user prompt that initiated the codegen process \n * @property {string} extra_data - additional run data\n * @property {number} Job_cost - The cost of the current job (in micro dollars)\n * @property {string} dev_machine_session_id - identifier of a single dev-machine session\n * @property {string} run_kind - Initiate / Iterate / Ask\n * @property {string} environment - app_builder / studio2 \u2026\n * @property {string} app_id - app_id\n * @property {string} msid - msid\n * @return {LogObject<codegenAgentSessionStartSrc11Evid299Params>} LogObject<codegenAgentSessionStartSrc11Evid299Params>\n */\nexport function codegenAgentSessionStartSrc11Evid299(params: codegenAgentSessionStartSrc11Evid299Params): LogObject<codegenAgentSessionStartSrc11Evid299Params> {\n return { evid: 299, src: 11, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'codegenAgentSessionEndSrc11Evid304' event (evid: 304)\n *\n * Event description: fires when codegen (wix code) job finished.\n *\n * @param {codegenAgentSessionEndSrc11Evid304Params} params - The parameters for this event\n * @property {string} job_id - job ID is unique for each user-prompt\n * @property {string} extra_data - additional run data\n * @property {number} job_cost - The cost of the current job (in micro dollars)\n * @property {string} dev_machine_session_id - identifier of a single dev-machine session\n * @property {string} run_kind - Initiate / Iterate / Ask\n * @property {string} environment - app_builder / studio2 \u2026\n * @property {string} agent_output - the output for the agent - list of changed files. Per changed file:\n * { Path (relative path of the file within the app e.g src/dashboard/extension.ts),\n * Operation (create/updated) }\n *\n * @property {string} job_status - \u2018stopped\u2019 if the user clicked on stop button, \u2018error\u2019, or \u2018successfull\u2019\n *\n * @property {string} job_skills_used - map of (key:value) where key is the name and value is # times called in job (tasks/skills)\n * @property {string} job_extensions_created - An array of all the extensions created\n * @property {string} job_duration - duration of the job (from user prompt to finish) in milliseconds \n * @property {string} app_id - app_id\n * @property {string} msid - msid\n * @return {LogObject<codegenAgentSessionEndSrc11Evid304Params>} LogObject<codegenAgentSessionEndSrc11Evid304Params>\n */\nexport function codegenAgentSessionEndSrc11Evid304(params: codegenAgentSessionEndSrc11Evid304Params): LogObject<codegenAgentSessionEndSrc11Evid304Params> {\n return { evid: 304, src: 11, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'codegenAgentSessionErrorSrc11Evid305' event (evid: 305)\n *\n * Event description: fires when codegen (wix code) job finished with error status - provide additional info about the error.\n *\n * @param {codegenAgentSessionErrorSrc11Evid305Params} params - The parameters for this event\n * @property {string} job_id - job ID is unique for each user-prompt\n * @property {string} dev_machine_session_id - identifier of a single dev-machine session\n * @property {string} run_kind - Initiate / Iterate / Ask\n * @property {string} environment - app_builder / studio2 \u2026\n * @property {string} agent_output - the output for the agent - the error object\n * @property {string} error_desc - Unique description of the error - the unique identifier of the error (14 different types)\n * @property {string} error_massage - error description from the system\n * @property {string} validation_type - typescript error/ build error validation/ dev center validation (relevant for validation errors)\n * @property {string} error_json - full errors details\n * @property {string} is_retryble - (try_again_presented) True/false\n * @property {boolean} is_expected - True/false\n * @property {string} extra_data - additional run data\n *\n * @property {string} msid - msid\n * @property {string} app_id - app_id\n * @return {LogObject<codegenAgentSessionErrorSrc11Evid305Params>} LogObject<codegenAgentSessionErrorSrc11Evid305Params>\n */\nexport function codegenAgentSessionErrorSrc11Evid305(params: codegenAgentSessionErrorSrc11Evid305Params): LogObject<codegenAgentSessionErrorSrc11Evid305Params> {\n return { evid: 305, src: 11, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'astraCmdEnteredSrc11Evid4001' event (evid: 4001)\n *\n * Event description: a user enters a command in Astra\n *\n *\n * @param {astraCmdEnteredSrc11Evid4001Params} params - The parameters for this event\n * @property {string} cmd - the command that the user entered\n * @property {string} message_id - the id of the flow of the current command\n * @property {string} sender_uuid - the uuid of the sender\n * @property {string} repository - Git rep that the user is working from\n * @property {string} feature_toggle_name - names of the feature toggles used\n * @property {string} files_added - all file names that are attached by the user to the command massage\n *\n * @return {LogObject<astraCmdEnteredSrc11Evid4001Params>} LogObject<astraCmdEnteredSrc11Evid4001Params>\n */\nexport function astraCmdEnteredSrc11Evid4001(params: astraCmdEnteredSrc11Evid4001Params): LogObject<astraCmdEnteredSrc11Evid4001Params> {\n return { evid: 4001, src: 11, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessQuickStartModalShown' event (evid: 11)\n *\n * Event description: The Headless quick-start modal shown - will be sent in any step of the modal\n *\n * @param {headlessQuickStartModalShownParams} params - The parameters for this event\n * @property {string} step - create an OAuth app / install SDK / call our API\n * @property {string} technology - javascript / react/ / others / null if it wasnt chosen yet\n * @property {string} appType - web / mobile / other / null if it wasn't chosen yet\n * @property {string} entryPoint - where the modal opened from - focus widget / create oauth from settings\n * @property {boolean} isNewFlow - True if new \n * @return {LogObject<headlessQuickStartModalShownParams>} LogObject<headlessQuickStartModalShownParams>\n */\nexport function headlessQuickStartModalShown(params: headlessQuickStartModalShownParams): LogObject<headlessQuickStartModalShownParams> {\n return { evid: 11, src: 151, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessPlaygroundModalFinishedLoading' event (evid: 12)\n *\n * Event description: The event will be sent when the user clicks on any button of the modal\n *\n * @param {headlessPlaygroundModalFinishedLoadingParams} params - The parameters for this event\n * @property {string} step - create an OAuth app / install SDK / call our API\n * @property {string} cta - learn more, create&cont, tech, copy code, any wix api tool link, go to settings, close, app_type (the type will be sent in \"value\" field)\n * X, etc\n *\n * @property {string} value - name, app type, copy code type, etc (can be null)\n * @property {string} technology - javascript / react/ / others / null if it wasnt chosen yet\n *\n * @property {string} appType - web / mobile / other / null if it wasnt chosen yet\n *\n * @property {string} entryPoint - where the modal opened from - focus widget / create oauth from settings\n *\n * @return {LogObject<headlessPlaygroundModalFinishedLoadingParams>} LogObject<headlessPlaygroundModalFinishedLoadingParams>\n */\nexport function headlessPlaygroundModalFinishedLoading(params: headlessPlaygroundModalFinishedLoadingParams): LogObject<headlessPlaygroundModalFinishedLoadingParams> {\n return { evid: 12, src: 151, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'headlessMigrationTourModalShown' event (evid: 8)\n *\n * Event description: The event will be sent each time the migration-tour-modal will be shown - so we will not show it twice per user (using active group)\n *\n * @param {headlessMigrationTourModalShownParams} params - The parameters for this event\n * @return {LogObject<headlessMigrationTourModalShownParams>} LogObject<headlessMigrationTourModalShownParams>\n */\nexport function headlessMigrationTourModalShown(params: headlessMigrationTourModalShownParams): LogObject<headlessMigrationTourModalShownParams> {\n return { evid: 8, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'n8NTriggerActionSrc154Evid810' event (evid: 810)\n *\n * Event description: Tracks when a trigger is created or deleted within the Zapier integration. This event captures whether the automation is in test or production mode through the 'mode' field.\n *\n * @param {n8NTriggerActionSrc154Evid810Params} params - The parameters for this event\n * @property {string} wixAutomationId - wix automation id\n * @property {string} triggerKey - the chosen trigger key\n * @property {string} mode - the automation working mode (test/prod)\n * @property {string} triggerAppId - the relevant app id of the trigger\n * @return {LogObject<n8NTriggerActionSrc154Evid810Params>} LogObject<n8NTriggerActionSrc154Evid810Params>\n */\nexport function n8NTriggerActionSrc154Evid810(params: n8NTriggerActionSrc154Evid810Params): LogObject<n8NTriggerActionSrc154Evid810Params> {\n return { evid: 810, src: 154, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'webhooksDispatcherResponseChannelTopicSrc155Evid3' event (evid: 3)\n *\n * Event description: Webhooks dispatcher response channel topic\n *\n * @param {webhooksDispatcherResponseChannelTopicSrc155Evid3Params} params - The parameters for this event\n * @property {string} topic - The webhook topic\n * @property {string} callbackUrl - The callback Url\n * @property {GUID} appDefId - the app def id made the call\n * @property {DateTime} kafkaTime - timestamp of the original kafka message\n * @property {number} retryNumber - retry attempt (the first one should be 0)\n * @property {string} statusCode - responded tatus code\n * @property {number} responseTime - time to response in ms\n * @property {DateTime} webhookTime - timestamp of firing the webhook\n * @property {string} originalTimestamp - The originalTimestamp\n * @property {string} retryAttempt - retryAttempt\n * @property {string} responseDuration - responseDuration\n * @return {LogObject<webhooksDispatcherResponseChannelTopicSrc155Evid3Params>} LogObject<webhooksDispatcherResponseChannelTopicSrc155Evid3Params>\n */\nexport function webhooksDispatcherResponseChannelTopicSrc155Evid3(params: webhooksDispatcherResponseChannelTopicSrc155Evid3Params): LogObject<webhooksDispatcherResponseChannelTopicSrc155Evid3Params> {\n return { evid: 3, src: 155, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'testSrc184Evid9999' event (evid: 9999)\n *\n * Event description: test\n *\n * @param {testSrc184Evid9999Params} params - The parameters for this event\n * @return {LogObject<testSrc184Evid9999Params>} LogObject<testSrc184Evid9999Params>\n */\nexport function testSrc184Evid9999(params: testSrc184Evid9999Params): LogObject<testSrc184Evid9999Params> {\n return { evid: 9999, src: 184, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'wixMcpRequestSrc39Evid1607' event (evid: 1607)\n *\n * Event description: Fires when a user runs a query through the Wix MCP, capturing activity at the tool execution level.\n *\n *\n *\n * @param {wixMcpRequestSrc39Evid1607Params} params - The parameters for this event\n * @property {string} sessionId - the relevant session_id (multiple questions in a session)\n * @property {string} queryId - the request id (per user question - many to one with session)\n * @property {string} toolInvocationId - the tool execution id (per tool execution - many to one with user question)\n *\n * @property {string} query - the actual user query string being passed (prompt)\n * @property {string} toolName - The name of the MCP tool that was triggered\n * @property {string} params - the params sent in the tool invocation\n * @property {string} origin - relevant source/agent calling the MCP server (remote/local/picasso)\n * @property {number} duration - duration time per execution (ms)\n * @property {string} executionResult - Success/Error (defined by the tool)\n * @property {string} errorBody - for cases where the execution result was an error\n * @property {string} clientName - cursor, claude desktop etc\n * @property {string} requestId - the request id for the mcp for visitors\n * @property {string} jobId - job id\n * @property {string} First_prompt - user prompt \n * @property {string} additional_fields - additional_fields\n * @property {GUID} ai_conversation_id - conversation id from aria chat \n * @return {LogObject<wixMcpRequestSrc39Evid1607Params>} LogObject<wixMcpRequestSrc39Evid1607Params>\n */\nexport function wixMcpRequestSrc39Evid1607(params: wixMcpRequestSrc39Evid1607Params): LogObject<wixMcpRequestSrc39Evid1607Params> {\n return { evid: 1607, src: 39, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'webMcpLoadedSrc39Evid1611' event (evid: 1611)\n *\n * Event description: Tracks the loading of the WebMCP app script on a Wix site for a visitor. This API Quality event captures the total loading time in seconds, the number of tools loaded, and their names.\n *\n * @param {webMcpLoadedSrc39Evid1611Params} params - The parameters for this event\n * @property {string} numOfTools - num of tools\n * @property {string} toolNames - tool names seperated by commas\n * @property {number} duration - total loading time in miliseconds\n * @return {LogObject<webMcpLoadedSrc39Evid1611Params>} LogObject<webMcpLoadedSrc39Evid1611Params>\n */\nexport function webMcpLoadedSrc39Evid1611(params: webMcpLoadedSrc39Evid1611Params): LogObject<webMcpLoadedSrc39Evid1611Params> {\n return { evid: 1611, src: 39, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'executeWixApiToolRequestSrc39Evid1612' event (evid: 1612)\n *\n * Event description: Fires when a dynamic worker of Wix MCP runs a query through ExecuteWixAPI Tool , capturing activity at the tool execution level.\n *\n *\n *\n * @param {executeWixApiToolRequestSrc39Evid1612Params} params - The parameters for this event\n * @property {string} sessionId - the relevant session_id (multiple questions in a session)\n * @property {string} queryId - the request id (per user question - many to one with session)\n * @property {string} toolInvocationId - the tool execution id (per tool execution - many to one with user question)\n *\n * @property {string} query - the actual user query string being passed (prompt)\n * @property {string} toolName - The name of the MCP tool that was triggered\n * @property {string} params - the params sent in the tool invocation\n * @property {string} origin - relevant source/agent calling the MCP server (remote/local/picasso)\n * @property {number} duration - duration time per execution (ms)\n * @property {string} executionResult - Success/Error (defined by the tool)\n * @property {string} errorBody - for cases where the execution result was an error\n * @property {string} clientName - cursor, claude desktop etc\n * @property {string} requestId - the request id for the mcp for visitors\n * @property {string} jobId - job id\n * @property {string} First_prompt - user prompt \n * @property {string} additional_fields - additional_fields\n * @property {GUID} ai_conversation_id - conversation id from aria chat \n * @return {LogObject<executeWixApiToolRequestSrc39Evid1612Params>} LogObject<executeWixApiToolRequestSrc39Evid1612Params>\n */\nexport function executeWixApiToolRequestSrc39Evid1612(params: executeWixApiToolRequestSrc39Evid1612Params): LogObject<executeWixApiToolRequestSrc39Evid1612Params> {\n return { evid: 1612, src: 39, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'veloNamespacesInvocationSrc72Evid521' event (evid: 521)\n *\n * Event description: Usage of TPAs that invoke Velo namespace APIs under the hood when rendering custom elements or embed scripts\n *\n * @param {veloNamespacesInvocationSrc72Evid521Params} params - The parameters for this event\n * @property {string} app_id - The API caller app ID\n * @property {string} namespace - The API namespace\n * @property {string} method - The method name \n * @return {LogObject<veloNamespacesInvocationSrc72Evid521Params>} LogObject<veloNamespacesInvocationSrc72Evid521Params>\n */\nexport function veloNamespacesInvocationSrc72Evid521(params: veloNamespacesInvocationSrc72Evid521Params): LogObject<veloNamespacesInvocationSrc72Evid521Params> {\n return { evid: 521, src: 72, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'devCenterWebhookSentTriggered' event (evid: 1300)\n *\n * Event description: Tracks when a webhook is sent or triggered from the Dev Center for operations executed by internal tools. The event captures details about the webhook call, including the event type that triggered it, the target URL, the HTTP method, and the response status.\n *\n * @param {devCenterWebhookSentTriggeredParams} params - The parameters for this event\n * @property {GUID} instanceId - guid\n * @property {GUID} webhookId - guid\n * @property {string} url - url\n * @property {string} httpMethod - http method\n * @property {string} webhookEventType - webhook_event_type\n * @property {string} responseStatus - response_status\n * @property {string} topic - topic\n * @property {GUID} appId - app id\n * @property {string} originalTimestamp - originalTimestamp\n * @property {string} retryAttempt - retryAttempt\n * @property {string} statusCode - statusCode\n * @property {string} responseDuration - responseDuration\n * @property {string} kafkaEventId - unique identifier for each kafka attempt\n * @property {string} KafkaWebhookId - unique id to each webhook call (if there are 2 attempts - 2 row with this id)\n * @property {string} startHandlingTimestamp - start_handling_timestamp. when the webhook dispatcher started to work on the message\n * @return {LogObject<devCenterWebhookSentTriggeredParams>} LogObject<devCenterWebhookSentTriggeredParams>\n */\nexport function devCenterWebhookSentTriggered(params: devCenterWebhookSentTriggeredParams): LogObject<devCenterWebhookSentTriggeredParams> {\n return { evid: 1300, src: 96, endpoint: '', params };\n}\n\n/**\n * A function to create a log object for the 'spiExternalInvocationSrc96Evid199' event (evid: 199)\n *\n * Event description: Tracks external REST calls to third-party applications initiated by internal systems via the Service Provider Interface (SPI). It captures key details about the invocation, including the specific function called, the response status code, and the duration of the call.\n *\n * @param {spiExternalInvocationSrc96Evid199Params} params - The parameters for this event\n * @property {string} appId - The app id used the spi\n * @property {string} msid - The msid used the spi\n * @property {string} componentId - per unique app & component (there can be 2 same spis to the same app)\n * @property {string} componentType - spi identifier\n * @property {string} statusCode - the status_code of the invocation\n * @property {string} instanceId - The instance (msid+app_id) that trigger the spi\n * @property {string} responseDuration - in ms\n * @property {string} functionName - the action that the spi does\n * @property {string} appDefId - The app def id\n * @return {LogObject<spiExternalInvocationSrc96Evid199Params>} LogObject<spiExternalInvocationSrc96Evid199Params>\n */\nexport function spiExternalInvocationSrc96Evid199(params: spiExternalInvocationSrc96Evid199Params): LogObject<spiExternalInvocationSrc96Evid199Params> {\n return { evid: 199, src: 96, endpoint: '', params };\n}\n", "import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport {\n wixMcpRequestSrc39Evid1607,\n executeWixApiToolRequestSrc39Evid1612\n} from '@wix/bi-logger-api-infra-data/v2';\n\n/**\n * Safely extract all text content from a CallToolResult.\n * Filters out non-text content blocks (images, audio, resources)\n * and concatenates text blocks with newlines.\n */\nexport function extractText(result: CallToolResult): string {\n return (result.content as Array<{ type: string; text?: string }>)\n .filter((content) => content.type === 'text' && content.text != null)\n .map((content) => content.text!)\n .join('\\n');\n}\n\nconst TOOL_RESULT_PREVIEW_MAX_CHARS = 4000;\n\nexport function formatToolResultAdditionalFields(\n result: CallToolResult\n): string | undefined {\n const resultText = extractText(result);\n const contentTypes = [\n ...new Set(\n (result.content as Array<{ type: string }> | undefined)?.map(\n (content) => content.type\n ) ?? []\n )\n ];\n\n if (!resultText && contentTypes.length === 0) {\n return undefined;\n }\n\n return JSON.stringify({\n resultPreview: resultText.slice(0, TOOL_RESULT_PREVIEW_MAX_CHARS),\n resultTextLength: resultText.length,\n resultPreviewTruncated: resultText.length > TOOL_RESULT_PREVIEW_MAX_CHARS,\n resultContentTypes: contentTypes\n });\n}\n\nexport function createToolBiEvent(\n params: Parameters<typeof wixMcpRequestSrc39Evid1607>[0]\n) {\n return wixMcpRequestSrc39Evid1607(params);\n}\n\nexport function createExecuteWixAPICallToolBiEvent(\n params: Parameters<typeof executeWixApiToolRequestSrc39Evid1612>[0]\n) {\n return executeWixApiToolRequestSrc39Evid1612(params);\n}\n", "/**\n * WixToolkit - First-class API for using @wix/mcp tools in-process.\n *\n * Eliminates the \"fake server\" pattern used by consumers like assistant-domains,\n * Picasso, and agent-maker. Instead of intercepting WixMcpServer.tool() registrations,\n * consumers create a toolkit and get pre-wired tool objects with real Panorama/BI telemetry.\n *\n * @example\n * ```typescript\n * import { createWixToolkit, extractText } from '@wix/mcp';\n *\n * const toolkit = createWixToolkit({\n * auth: {\n * siteToken: async (siteId) => ({ Authorization: 'Bearer ...' }),\n * accountToken: async () => ({ Authorization: 'Bearer ...' }),\n * },\n * docs: { tools: ['REST'], getToKnowWixEnabled: true },\n * api: { tools: ['CallWixSiteAPI'] },\n * defaults: { siteId: 'my-site-id' },\n * clientName: 'my-consumer',\n * });\n *\n * for (const tool of toolkit.getTools()) {\n * const result = await tool.execute({ searchTerm: 'products' });\n * console.log(extractText(result));\n * }\n * ```\n */\n\nimport type {\n CallToolResult,\n ToolAnnotations\n} from '@modelcontextprotocol/sdk/types.js';\nimport { z } from 'zod';\nimport { zodToJsonSchema } from 'zod-to-json-schema';\nimport { v4 as uuidv4 } from 'uuid';\nimport { HttpClient } from '@wix/http-client';\n\nimport {\n addDocsTools,\n type DocsToolsOptions,\n type DocsTool\n} from './docs/docs.js';\nimport { addApiCallTool, type ToolHintsConfig } from './api-call/index.js';\nimport {\n addExecuteCodeModeTool,\n addSearchCodeModeTool\n} from './code-mode/index.js';\nimport {\n defaultReadmeDocs,\n executeCodeModeToolDescriptions,\n buildToolDescriptions\n} from './config/default-config.js';\nimport type { McpAuthenticationStrategy, McpHeaders } from './auth/index.js';\nimport { getDynamicContext } from './docs/get-to-know.js';\nimport type { WixMcpServer } from './wix-mcp-server.js';\nimport { createPanoramaClient } from './infra/panorama.js';\nimport { createBiLogger } from './infra/bi-logger.js';\nimport { DEV_ENVIRONMENTS, getEnvironment } from './infra/environment.js';\nimport { logger } from './infra/logger.js';\nimport {\n createToolBiEvent,\n extractText,\n formatToolResultAdditionalFields\n} from './infra/tool-bi.js';\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\n/** A single tool extracted from @wix/mcp, ready to execute. */\nexport interface WixTool {\n /** Tool name (e.g. 'CallWixSiteAPI', 'SearchWixRESTDocumentation') */\n name: string;\n /** Tool description for the LLM */\n description: string;\n /** Zod schema for tool input parameters */\n inputSchema: z.ZodObject<any>;\n /**\n * JSON Schema for tool input parameters \u2014 for consumers that speak JSON\n * Schema rather than Zod (WebMCP's `document.modelContext`, OpenAI tool\n * definitions, etc.). Computed lazily from `inputSchema` on first access;\n * `$ref`s are inlined so the object is self-contained.\n */\n readonly inputJsonSchema: Record<string, unknown>;\n /** MCP tool annotations (readOnlyHint, destructiveHint, etc.) */\n annotations?: ToolAnnotations;\n /** Execute the tool with the given arguments. Returns native MCP CallToolResult. */\n execute(args: Record<string, any>): Promise<CallToolResult>;\n}\n\n/** The toolkit object returned by createWixToolkit. */\nexport interface WixToolkit {\n /** All registered tools as plain objects */\n getTools(): WixTool[];\n /** Get a single tool by name */\n getTool(name: string): WixTool | undefined;\n /** Just the tool names */\n getToolNames(): string[];\n /** Pre-load WixREADME content (calls the WixREADME tool internally).\n * Site context is resolved from `defaults` passed to createWixToolkit. */\n preloadReadme(): Promise<string | null>;\n /** Pre-load dynamic context (site info, installed apps, etc.).\n * Site context is resolved from `defaults` passed to createWixToolkit. */\n preloadDynamicContext(): Promise<string | null>;\n}\n\n/** Lifecycle hooks for consumer-side observability. */\nexport interface WixToolkitHooks {\n /** Called before a tool callback is invoked */\n beforeExecute?: (toolName: string, args: Record<string, any>) => void;\n /** Called after a tool callback returns (success or isError) */\n afterExecute?: (\n toolName: string,\n result: CallToolResult,\n durationMs: number\n ) => void;\n /** Called when a tool callback throws an exception */\n onError?: (toolName: string, error: Error, durationMs: number) => void;\n}\n\n/** Auth configuration -- either a full McpAuthenticationStrategy or token functions. */\nexport type WixToolkitAuth =\n | McpAuthenticationStrategy\n | {\n siteToken: (siteId: string) => Promise<McpHeaders> | McpHeaders;\n accountToken: () => Promise<McpHeaders> | McpHeaders;\n };\n\n/**\n * Docs tools configuration.\n *\n * Note: `WixREADME` and `GetSiteContext` register only when\n * `getToKnowWixEnabled: true` is set here \u2014 it defaults to false and is\n * independent of `readmeDocs` and of which API tools are requested.\n */\nexport interface WixToolkitDocsConfig extends DocsToolsOptions {\n /** Which doc sources to register (default: all) */\n tools?: DocsTool[];\n}\n\n/** API tools configuration. */\nexport interface WixToolkitApiConfig {\n /** Which API tools to register (default: all three) */\n tools?: string[];\n /** Disable specific tools by name */\n disableTools?: string[];\n /** Enable additional tools */\n enableTools?: string[];\n /** Custom descriptions per tool */\n toolDescriptions?: Record<string, string>;\n /** Tool hint overrides */\n toolHints?: Record<string, ToolHintsConfig>;\n /**\n * Max response size in chars before truncation. Applies to CallWixSiteAPI/\n * ListWixSites/ManageWixSite (default: 50,000) and to ExecuteWixAPI/\n * SearchWixAPISpec (default: 24,000). Always clamped to a hard ceiling\n * regardless of what's requested here \u2014 see MAX_ALLOWED_RESPONSE_CHARS.\n */\n maxResponseSize?: number;\n /** Base URL for code-mode tools such as ExecuteWixAPI */\n codeModeBaseUrl?: string;\n}\n\n/** Options for createWixToolkit. */\nexport interface WixToolkitOptions {\n /** Authentication -- required for API call tools */\n auth: WixToolkitAuth;\n /** Docs tools configuration */\n docs?: WixToolkitDocsConfig;\n /** API tools configuration */\n api?: WixToolkitApiConfig;\n /**\n * Default values to inject at execute time.\n * Fields listed here are removed from the tool's inputSchema and\n * automatically merged into args when execute() is called.\n *\n * Common use: `defaults: { siteId: 'my-site-id' }` to hide siteId from\n * the LLM's schema and auto-inject it on every tool execution.\n */\n defaults?: Record<string, any>;\n /** Tool names to exclude after registration */\n exclude?: string[];\n /** Consumer name -- shows up in BI events for tracking usage per consumer */\n clientName?: string;\n /**\n * Environment name (DEV/TEST/LOCAL/REMOTE/PICASSO/VISITOR_MCP). Defaults to\n * `process.env.NODE_ENV` where a `process` global exists; pass explicitly in\n * browsers. Unknown/absent values resolve to LOCAL (telemetry on).\n */\n nodeEnv?: string;\n /** Consumer-side observability hooks (separate from library Panorama/BI telemetry) */\n hooks?: WixToolkitHooks;\n /** Conversation ID \u2014 passed to BI events for tracking */\n conversationId?: string;\n /**\n * Keep WixREADME mentions in tool descriptions. Defaults to `false` (mentions\n * scrubbed, for consumers that don't expose WixREADME); set `true` for the live\n * MCP server's text. Only affects description text \u2014 never the tool set itself.\n */\n includeReadmeMentions?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Internals\n// ---------------------------------------------------------------------------\n\n/** A captured tool registration from the fake server. */\ninterface CapturedTool {\n name: string;\n description: string;\n paramsSchema: Record<string, any>;\n annotations?: ToolAnnotations;\n callback: (...args: any[]) => CallToolResult | Promise<CallToolResult>;\n}\n\n/**\n * Normalize auth config into a McpAuthenticationStrategy.\n */\nfunction normalizeAuth(auth: WixToolkitAuth): McpAuthenticationStrategy {\n if ('getSiteAuthHeaders' in auth && 'getAccountAuthHeaders' in auth) {\n return auth;\n }\n return {\n getSiteAuthHeaders: auth.siteToken,\n getAccountAuthHeaders: auth.accountToken\n };\n}\n\n/**\n * Create a lightweight server that captures tool() registrations\n * without actually running an MCP server.\n */\nfunction createCapturingServer(): {\n server: WixMcpServer;\n captured: CapturedTool[];\n} {\n const captured: CapturedTool[] = [];\n\n const server = {\n registerTool: (name: string, config: any, callback: any) => {\n captured.push({\n name,\n description: config.description ?? '',\n paramsSchema: config.inputSchema ?? {},\n annotations: config.annotations,\n callback\n });\n return { update: () => {} } as any;\n },\n tool: (...args: any[]) => {\n // Parse the multiple overloads of WixMcpServer.tool():\n // The callback is always the last argument (a function).\n // name is always args[0].\n const name = args[0] as string;\n const cbIndex = args.findIndex((arg: any) => typeof arg === 'function');\n const callback = args[cbIndex];\n\n // Find description (string at index 1, if not the schema/callback)\n let description = '';\n let paramsSchema: Record<string, any> = {};\n let annotations: ToolAnnotations | undefined;\n\n for (let i = 1; i < cbIndex; i++) {\n const arg = args[i];\n if (typeof arg === 'string') {\n description = arg;\n } else if (arg && typeof arg === 'object' && !Array.isArray(arg)) {\n // Distinguish annotations from Zod schema shapes:\n // Annotations have keys like readOnlyHint, destructiveHint, openWorldHint\n // Zod shape objects have Zod type values\n const keys = Object.keys(arg);\n const isAnnotations = keys.some(\n (k) =>\n k === 'readOnlyHint' ||\n k === 'destructiveHint' ||\n k === 'openWorldHint' ||\n k === 'title' ||\n k === 'idempotentHint'\n );\n\n if (isAnnotations) {\n annotations = arg as ToolAnnotations;\n } else {\n paramsSchema = arg;\n }\n }\n }\n\n captured.push({\n name,\n description,\n paramsSchema,\n annotations,\n callback\n });\n }\n } as WixMcpServer;\n\n return { server, captured };\n}\n\n/**\n * Remove specified fields from a Zod shape object and build a new ZodObject.\n */\nfunction buildSchemaWithout(\n shape: Record<string, any>,\n fieldsToRemove: string[]\n): z.ZodObject<any> {\n const filtered: Record<string, any> = {};\n for (const [key, value] of Object.entries(shape)) {\n if (!fieldsToRemove.includes(key)) {\n filtered[key] = value;\n }\n }\n return z.object(filtered);\n}\n\nfunction isExecuteWixApiRequested(api?: WixToolkitApiConfig): boolean {\n if (!api || api.disableTools?.includes('ExecuteWixAPI')) {\n return false;\n }\n\n const requestedTools = new Set([\n ...(api.tools ?? []),\n ...(api.enableTools ?? [])\n ]);\n return requestedTools.has('ExecuteWixAPI');\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\nexport { extractText, formatToolResultAdditionalFields };\n\n/**\n * Create a WixToolkit that provides pre-wired tool objects for in-process use.\n *\n * This is the recommended way to use @wix/mcp tools outside of a full MCP server.\n * It handles tool registration, context building, Panorama/BI telemetry, and\n * schema manipulation (defaults) internally.\n */\nexport function createWixToolkit(options: WixToolkitOptions): WixToolkit {\n const {\n auth,\n docs,\n api,\n defaults = {},\n exclude = [],\n clientName,\n hooks,\n conversationId,\n includeReadmeMentions = false\n } = options;\n\n const authStrategy = normalizeAuth(auth);\n const executeWixApiRequested = isExecuteWixApiRequested(api);\n\n // Descriptions with WixREADME mentions removed, fed through the toolDescriptions\n // override path. WixREADME is left out so its own description keeps its default text.\n let descriptionsWithoutReadme: Record<string, string> | undefined;\n if (!includeReadmeMentions) {\n descriptionsWithoutReadme = buildToolDescriptions(false);\n delete descriptionsWithoutReadme.WixREADME;\n }\n const sessionId = uuidv4();\n const nodeEnv = getEnvironment(options.nodeEnv);\n const isDevEnvironment = DEV_ENVIRONMENTS.includes(nodeEnv);\n\n // Create real BI logger (same as WixMcpServer)\n const biLogger = createBiLogger({ _client_id: sessionId });\n\n // --- Step 1: Capture tool registrations ---\n const { server, captured } = createCapturingServer();\n\n // Register docs tools\n if (docs) {\n const { tools: docsTools, ...docsOptions } = docs;\n const readmeDocs =\n docsOptions.readmeDocs ??\n (executeWixApiRequested ? defaultReadmeDocs : undefined);\n // Pass auth strategy for README 'api' action sections\n addDocsTools(server, docsTools, {\n ...docsOptions,\n readmeDocs,\n authStrategy,\n dynamicContextEnabled: true,\n // README-free defaults first so consumer overrides still win.\n toolDescriptions: descriptionsWithoutReadme\n ? { ...descriptionsWithoutReadme, ...docsOptions.toolDescriptions }\n : docsOptions.toolDescriptions\n });\n } else {\n // Default: register all docs tools\n addDocsTools(server, undefined, {\n authStrategy,\n dynamicContextEnabled: true,\n ...(descriptionsWithoutReadme\n ? { toolDescriptions: descriptionsWithoutReadme }\n : {})\n });\n }\n\n // Register API tools\n if (api) {\n const {\n tools: apiTools,\n disableTools,\n enableTools,\n toolDescriptions,\n toolHints,\n maxResponseSize,\n codeModeBaseUrl = 'https://mcp.wix.com'\n } = api;\n // Precedence (low \u2192 high): README-free defaults, code-mode variant, consumer overrides.\n const effectiveToolDescriptions = includeReadmeMentions\n ? executeWixApiRequested\n ? { ...executeCodeModeToolDescriptions, ...toolDescriptions }\n : toolDescriptions\n : {\n ...descriptionsWithoutReadme,\n ...(executeWixApiRequested ? executeCodeModeToolDescriptions : {}),\n ...toolDescriptions\n };\n addApiCallTool(\n server,\n authStrategy,\n apiTools,\n disableTools,\n enableTools,\n effectiveToolDescriptions,\n toolHints,\n maxResponseSize\n );\n const requestedTools = new Set([\n ...(apiTools ?? []),\n ...(enableTools ?? [])\n ]);\n if (\n requestedTools.has('SearchWixAPISpec') &&\n !disableTools?.includes('SearchWixAPISpec')\n ) {\n addSearchCodeModeTool(server, {\n codeModeBaseUrl,\n authStrategy,\n disableTools,\n toolDescriptions: effectiveToolDescriptions,\n maxResponseSize\n });\n }\n if (\n requestedTools.has('ExecuteWixAPI') &&\n !disableTools?.includes('ExecuteWixAPI')\n ) {\n addExecuteCodeModeTool(server, {\n codeModeBaseUrl,\n authStrategy,\n disableTools,\n toolDescriptions: effectiveToolDescriptions,\n maxResponseSize\n });\n }\n } else {\n // Default: register all API tools\n addApiCallTool(\n server,\n authStrategy,\n undefined,\n undefined,\n undefined,\n descriptionsWithoutReadme\n );\n }\n\n // --- Step 2: Compute fields to remove from schemas ---\n const fieldsToRemove = Object.keys(defaults);\n\n // --- Step 3: Build WixTool objects ---\n const allTools: WixTool[] = captured\n .filter((t) => !exclude.includes(t.name))\n .map((captured) => {\n const inputSchema =\n fieldsToRemove.length > 0\n ? buildSchemaWithout(captured.paramsSchema, fieldsToRemove)\n : z.object(captured.paramsSchema);\n\n const execute = async (\n args: Record<string, any>\n ): Promise<CallToolResult> => {\n const toolName = captured.name;\n const toolInvocationId = uuidv4();\n\n // Merge defaults into args\n const mergedArgs = { ...defaults, ...args };\n\n // Consumer hooks: beforeExecute\n hooks?.beforeExecute?.(toolName, mergedArgs);\n\n // Create fresh HttpClient per invocation (same as wrapToolCallback).\n // The x-wix-mcp tracing header is never sent from a browser page:\n // www.wixapis.com's CORS preflight does not allow it, and sending it\n // would fail the whole request there.\n const httpClient = new HttpClient({\n headers:\n typeof window === 'undefined'\n ? { 'x-wix-mcp': `execution-id=${toolInvocationId}` }\n : {}\n });\n\n // Create real Panorama client (silent: true, won't crash on network failure)\n const panorama = createPanoramaClient({\n environment: nodeEnv,\n sessionId,\n componentId: toolName,\n serverInfo: {\n name: clientName ?? 'wix-mcp-toolkit',\n version: '1.0.0'\n }\n });\n\n const panoramaComponent = panorama.createClientForComponent();\n\n // Build the extra context expected by tool callbacks. Keep in sync with\n // wrappedExtra in wix-mcp-server.ts \u2014 a field missing here is silently\n // undefined for every toolkit consumer.\n let toolBiParams: Record<string, any> = {};\n const extra = {\n panorama: panoramaComponent,\n httpClient,\n biLogger,\n logger,\n setToolBiParams: (params: Record<string, any>) => {\n toolBiParams = params;\n },\n toolInvocationId\n };\n\n // Start Panorama transaction\n if (!isDevEnvironment) {\n biLogger.updateDefaults({ _uuid: '' });\n panorama.transaction(toolName).start({\n toolInvocationId,\n params: JSON.stringify(mergedArgs)\n });\n }\n\n const startTime = performance.now();\n let toolSucceeded = false;\n let errorBody: string | undefined;\n let additionalFields: string | undefined;\n\n try {\n // Call the original @wix/mcp tool callback\n // All callbacks expect (args, extra) -- even no-param tools get (_, extra)\n const cbResult: CallToolResult = await captured.callback(\n mergedArgs,\n extra\n );\n\n toolSucceeded = !cbResult.isError;\n if (!toolSucceeded) {\n errorBody = extractText(cbResult);\n } else {\n additionalFields = formatToolResultAdditionalFields(cbResult);\n }\n\n // Panorama: finish or report error\n if (!isDevEnvironment) {\n if (toolSucceeded) {\n panorama.transaction(toolName).finish({ toolInvocationId });\n } else {\n panorama\n .errorMonitor()\n .reportError(\n new Error(`Tool ${toolName} returned isError: true`),\n {\n context: {\n toolName,\n toolInvocationId,\n params: JSON.stringify(mergedArgs),\n error: JSON.stringify(cbResult, null, 2)\n }\n }\n );\n }\n }\n\n // Consumer hooks: afterExecute\n const durationMs = Math.round(performance.now() - startTime);\n hooks?.afterExecute?.(toolName, cbResult, durationMs);\n\n return cbResult;\n } catch (e) {\n toolSucceeded = false;\n errorBody = (e as Error).message;\n\n if (!isDevEnvironment) {\n panorama.errorMonitor().reportError(e as Error, {\n context: {\n toolName,\n toolInvocationId,\n params: JSON.stringify(mergedArgs),\n error: errorBody\n }\n });\n }\n\n // Consumer hooks: onError\n const durationMs = Math.round(performance.now() - startTime);\n hooks?.onError?.(toolName, e as Error, durationMs);\n\n // Return error result (same as wrapToolCallback)\n const mcpMeta = (e as Error & { mcpMeta?: Record<string, unknown> })\n .mcpMeta;\n\n return {\n isError: true,\n content: [{ type: 'text', text: (e as Error).message }],\n ...(mcpMeta && { _meta: mcpMeta })\n };\n } finally {\n const endTime = performance.now();\n const duration = Math.round(endTime - startTime);\n\n // BI event (same as wrapToolCallback)\n if (!isDevEnvironment) {\n biLogger.updateDefaults({\n _msid: toolBiParams.siteId ?? defaults.siteId ?? '',\n _visitorId: toolBiParams.visitorId ?? '',\n _request_id: toolBiParams.requestId ?? ''\n });\n\n const biParams = {\n clientName: clientName ?? 'toolkit',\n duration,\n errorBody,\n toolInvocationId,\n toolName,\n params: JSON.stringify(mergedArgs),\n origin: nodeEnv,\n sessionId,\n executionResult: toolSucceeded ? 'Success' : 'Error',\n requestId: toolBiParams.requestId,\n jobId: toolBiParams.jobId,\n additional_fields: additionalFields\n };\n Object.assign(biParams, { ai_conversation_id: conversationId });\n\n biLogger.report(createToolBiEvent(biParams));\n }\n }\n };\n\n // Lazily converted and cached: most consumers read either the Zod or the\n // JSON Schema form, rarely both, and never for every tool.\n let jsonSchema: Record<string, unknown> | undefined;\n\n return {\n name: captured.name,\n description: captured.description,\n inputSchema,\n get inputJsonSchema() {\n jsonSchema ??= zodToJsonSchema(inputSchema, {\n $refStrategy: 'none'\n }) as Record<string, unknown>;\n return jsonSchema;\n },\n annotations: captured.annotations,\n execute\n };\n });\n\n // --- Step 4: Build and return WixToolkit ---\n const toolsByName = new Map(allTools.map((t) => [t.name, t]));\n\n return {\n getTools: () => allTools,\n getTool: (name: string) => toolsByName.get(name),\n getToolNames: () => allTools.map((t) => t.name),\n preloadReadme: async () => {\n const readmeTool = toolsByName.get('WixREADME');\n if (!readmeTool) return null;\n try {\n const result = await readmeTool.execute({});\n return extractText(result);\n } catch {\n return null;\n }\n },\n preloadDynamicContext: async () => {\n try {\n const httpClient = new HttpClient();\n return (\n (await getDynamicContext(authStrategy, httpClient, defaults, {\n partnerContextEnabled: true,\n includeAccountContext: true\n })) || null\n );\n } catch {\n return null;\n }\n }\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AACC,KAAC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B;AAAA,UACrB;AACA,iBAAO,OAAO,UAAU,EAAE,oBAAoB,eAAe,CAAC;AAE9D,mBAAS,OAAO,kBAAkB,QAAQ,CAAC;AAAA,QAC7C;AAAA,MACF;AAAA,IACF;AAIA,QAAI;AAEJ,WAAO;AAAA,MACL,MAAMC,UAAS;AAAA,MACf,aAAaA,UAAS;AAAA,MACtB;AAAA,MACA,IAAI,kBAAkB;AACpB,uBAAe,gBAAgB,aAAa;AAAA,UAC1C,cAAc;AAAA,QAChB,CAAC;AACD,eAAO;AAAA,MACT;AAAA,MACA,aAAaA,UAAS;AAAA,MACtB;AAAA,IACF;AAAA,EACF,CAAC;AAGH,QAAM,cAAc,IAAI,IAAI,SAAS,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5D,SAAO;AAAA,IACL,UAAU,MAAM;AAAA,IAChB,SAAS,CAAC,SAAiB,YAAY,IAAI,IAAI;AAAA,IAC/C,cAAc,MAAM,SAAS,IAAI,CAAC,MAAM,EAAE,IAAI;AAAA,IAC9C,eAAe,YAAY;AACzB,YAAM,aAAa,YAAY,IAAI,WAAW;AAC9C,UAAI,CAAC,WAAY,QAAO;AACxB,UAAI;AACF,cAAM,SAAS,MAAM,WAAW,QAAQ,CAAC,CAAC;AAC1C,eAAO,YAAY,MAAM;AAAA,MAC3B,QAAQ;AACN,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,uBAAuB,YAAY;AACjC,UAAI;AACF,cAAM,aAAa,IAAI,WAAW;AAClC,eACG,MAAM,kBAAkB,cAAc,YAAYD,WAAU;AAAA,UAC3D,uBAAuB;AAAA,UACvB,uBAAuB;AAAA,QACzB,CAAC,KAAM;AAAA,MAEX,QAAQ;AACN,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
-
"names": ["base64", "isUndefined", "isFormData", "isPlainObject", "isStandardBrowserEnv", "merge", "buildURL", "enhanceError", "require_bind", "require_utils", "isUndefined", "isFormData", "isPlainObject", "isStandardBrowserEnv", "merge", "require_buildURL", "buildURL", "require_InterceptorManager", "require_normalizeHeaderName", "require_enhanceError", "enhanceError", "enhanceError", "defaults", "defaults", "transformData", "transformData", "defaults", "mergeConfig", "merge", "desc", "buildURL", "mergeConfig", "mergeConfig", "defaults", "defaultConfig", "axios", "require_axios", "enhanceError", "createError", "createError", "settle", "buildFullPath", "settle", "buildFullPath", "buildURL", "axios", "import_utils", "fetchAdapter", "require_defaults", "enhanceError", "defaults", "require_transformData", "defaults", "transformData", "require_isCancel", "require_dispatchRequest", "transformData", "defaults", "require_mergeConfig", "mergeConfig", "merge", "require_validator", "desc", "require_Axios", "buildURL", "mergeConfig", "require_Cancel", "require_CancelToken", "require_spread", "require_isAxiosError", "require_axios", "mergeConfig", "defaults", "defaultConfig", "axios", "require_axios", "AssertionError", "message", "name", "constructor", "Error", "assertDefined", "target", "undefined", "assertObject", "_typeof", "Array", "isArray", "assertOk", "assertFunc", "assertBoolean", "assertNumber", "assertArray", "Object", "prototype", "toString", "call", "module", "exports", "defined", "object", "ok", "func", "boolean", "number", "array", "module", "exports", "mapValues", "collection", "iteratee", "Object", "keys", "reduce", "acc", "key", "filterValues", "keep", "module", "exports", "timedPromise", "promise", "message", "timeout", "timeoutPromise", "Promise", "resolve", "reject", "setTimeout", "race", "allAsObject", "promiseObject", "keys", "Object", "all", "map", "key", "then", "resolved", "reduce", "acc", "value", "i", "module", "exports", "error", "console", "debounce", "func", "wait", "immediate", "timeout", "context", "args", "arguments", "later", "apply", "callNow", "clearTimeout", "setTimeout", "module", "exports", "throttle", "func", "wait", "timeout", "args", "setTimeout", "module", "exports", "debounce", "require", "throttle", "createEvent", "event", "context", "startTime", "dt", "Date", "now", "f", "createBatch", "events", "e", "g", "optimizeBatch", "fieldCounts", "batchLen", "batch", "length", "map", "fields", "Object", "keys", "value", "field", "key", "globalFields", "reduce", "res", "BatchQueue", "_initilized", "_startTime", "_resolve", "_promise", "Promise", "resolve", "flushHandler", "delayMs", "maxBatchSize", "useThrottle", "_maxBatchSize", "_optimizeBatch", "_queue", "_flushHandler", "_flushDebounced", "flush", "_reset", "splice", "then", "push", "module", "exports", "DefaultConsentPolicy", "functional", "analytics", "__default", "getPolicy", "consentPolicyGetter", "shouldMuteNonEssentials", "policy", "shouldMuteByCategory", "category", "module", "exports", "assert", "require", "mapValues", "filterValues", "promise", "log", "BatchQueue", "shouldMuteByCategory", "shouldMuteNonEssentials", "getPolicy", "BiLogger", "options", "context", "_publishers", "publishers", "_validators", "validators", "_defaults", "defaults", "_ownDefaults", "_events", "events", "_context", "_defaultValueTimeout", "defaultValueTimeout", "_defaultContinueOnFail", "defaultContinueOnFail", "_onPublisherFailHandler", "onPublisherFailHandler", "_defaultPublisherFailHandler", "_isMuted", "isMuted", "_eventTransformer", "eventTransformer", "event", "_payloadTransformer", "payloadTransformer", "payload", "_consentPolicyGetter", "consentPolicyGetter", "_nonEssentialDefaults", "nonEssentialDefaults", "_maxBatchSize", "maxBatchSize", "_globalBatchQueue", "globalBatchQueue", "data", "defined", "object", "src", "evid", "params", "eventOrKey", "eventOrContextOrUndefined", "contextOrUndefined", "_extractEventAndContext", "policy", "fullContext", "category", "Promise", "resolve", "useBatch", "queue", "_initQueue", "transformAndQueue", "transformedEvent", "_event", "feed", "_getDefaults", "then", "fullEvent", "_getDynamicNonEssentialDefaults", "_getStaticNonEssentialDefaults", "_getPolicyFields", "_getDynamicDefaults", "Object", "assign", "validatorsResult", "length", "some", "validator", "match", "execute", "Error", "evtId", "_send", "_queue", "flush", "all", "map", "cloned", "publisher", "catch", "error", "publisherName", "name", "undefined", "AssertionError", "onFlush", "batch", "g", "_getStaticDefaults", "transformedPayload", "init", "delayMs", "useThrottle", "optimizeBatch", "err", "reject", "_withOwnDefaults", "dynamicDefaults", "v", "staticDefaults", "promises", "value", "key", "_handleDefaultsError", "timedPromise", "message", "timeout", "allAsObject", "_isca", "_encodePolicyValue", "_iscf", "_ispd", "__default", "_ise", "module", "exports", "assert", "require", "BiLoggerManager", "reset", "_handlers", "handler", "defined", "func", "push", "index", "indexOf", "splice", "logger", "forEach", "module", "exports", "manager", "assert", "require", "BiLogger", "biLoggerManager", "BatchQueue", "BiLoggerFactory", "_publishers", "_validators", "_defaults", "_nonEssentialDefaults", "_events", "_isMuted", "_eventTransformer", "_payloadTransformer", "_consentPolicyGetter", "_maxBatchSize", "_batchQueue", "publisher", "defined", "ok", "push", "validator", "_typeof", "execute", "match", "defaults", "object", "Object", "assign", "events", "defaultValueTimeout", "_defaultValueTimeout", "defaultContinueOnFail", "_defaultContinueOnFail", "onPublisherFailHandler", "_onPublisherFailHandler", "isMuted", "boolean", "maxBatchSize", "number", "batchQueue", "_globalBatchQueue", "transformer", "func", "getter", "context", "logger", "publishers", "validators", "eventTransformer", "payloadTransformer", "consentPolicyGetter", "nonEssentialDefaults", "globalBatchQueue", "manager", "notifyLoggerCreated", "module", "exports", "BiLoggerClientFactory", "require", "BiLogger", "biLoggerManager", "BatchQueue", "module", "exports", "BiLoggerFactory", "BiLoggerManager", "factory", "manager", "createBatchQueue", "require_bind", "require_utils", "isUndefined", "isFormData", "isPlainObject", "isStandardBrowserEnv", "merge", "require_buildURL", "buildURL", "require_InterceptorManager", "require_normalizeHeaderName", "require_enhanceError", "enhanceError", "require_defaults", "enhanceError", "defaults", "require_transformData", "defaults", "transformData", "require_isCancel", "require_dispatchRequest", "transformData", "defaults", "require_mergeConfig", "mergeConfig", "merge", "require_package", "require_validator", "desc", "require_Axios", "buildURL", "mergeConfig", "require_Cancel", "require_CancelToken", "require_spread", "require_isAxiosError", "require_axios", "mergeConfig", "defaults", "defaultConfig", "axios", "require_axios", "util", "objectUtil", "errorUtil", "errorMap", "base64", "ctx", "result", "issues", "elements", "processed", "result", "r", "ZodFirstPartyTypeKind", "emojiRegex", "types", "x", "base", "name", "schema", "base64", "isNode", "defaultConfig", "isNode", "import_axios", "axios", "isNode", "hint", "console", "logger", "logger", "crypto", "performance", "lastEventId", "logger", "data", "dedent", "__export", "__esm", "enrichDynamicContext", "totalSiteCount", "base64", "defaults", "authorization", "AlertType", "AlertStatus", "LogLevel", "TransactionAction", "Platform", "ErrorSeverity", "getRandomValues", "rnds8", "rng", "byteToHex", "unsafeStringify", "randomUUID", "native_default", "v4", "native_default", "rng", "unsafeStringify", "v4_default", "v4_default", "o", "_defineProperty", "union", "_len", "arguments", "length", "args", "Array", "_key", "Set", "flat", "values", "defaults", "_len2", "_key2", "reduce", "res", "obj", "Object", "entries", "_res", "_ref", "key", "value", "deepDefaults", "dest", "_len3", "rest", "_key3", "keys", "map", "all", "merged", "hasValues", "filter", "_res2", "PanoramaErrorMonitorImpl", "constructor", "baseClient", "options", "bindPrototypeMethodsToSelf", "reportError", "error", "data", "addBreadcrumb", "breadcrumb", "PanoramaLoggerImpl", "constructor", "baseClient", "bindPrototypeMethodsToSelf", "info", "message", "data", "log", "LogLevel", "Info", "warn", "Warn", "error", "Error", "debug", "Debug", "PanoramaTransactionImpl", "constructor", "baseClient", "name", "options", "isCustomTransactionName", "Error", "bindPrototypeMethodsToSelf", "start", "data", "reportTransactionStart", "defaults", "finish", "reportTransactionFinish", "PanoramaClientForComponentImpl", "constructor", "_ref", "baseClient", "_defineProperty", "bindPrototypeMethodsToSelf", "transaction", "name", "options", "PanoramaTransactionImpl", "errorMonitor", "PanoramaErrorMonitorImpl", "logger", "PanoramaLoggerImpl", "Hook", "HooksManager", "constructor", "_defineProperty", "tap", "hook", "subscriber", "subscribers", "push", "invoke", "_len", "arguments", "length", "args", "Array", "_key", "PanoramaPhaseImpl", "constructor", "name", "baseClient", "bindPrototypeMethodsToSelf", "start", "data", "reportPhaseStart", "finish", "reportPhaseFinish", "PanoramaClientImpl", "constructor", "_ref", "hooksManager", "baseClient", "_defineProperty", "bindPrototypeMethodsToSelf", "onUnhandledError", "subscriber", "tap", "Hook", "beforeUnhandledError", "reportLoadStart", "data", "options", "ComponentLoad", "InternalTransactions", "reportTransactionStart", "reportLoadFinish", "reportTransactionFinish", "phase", "name", "PanoramaPhaseImpl", "transaction", "PanoramaTransactionImpl", "errorMonitor", "PanoramaErrorMonitorImpl", "logger", "PanoramaLoggerImpl", "createClientForComponent", "client", "PanoramaClientForComponentImpl", "invoke", "afterCreateClientForComponent", "extractWixHttpErrorDetailsRec", "error", "_httpClientError$resp", "Error", "res", "cause", "httpClientError", "defaults", "isWixHttpError", "requestId", "response", "headers", "extractWixHttpErrorDetails", "MAX_STACK_TRACE_SIZE_BYTES", "MAX_SESSION_TIME_MS", "sanitizePayload", "payload", "errorStack", "sessionTime", "length", "MAX_STACK_TRACE_SIZE_BYTES", "truncationMessage", "truncatedErrorStack", "substring", "MAX_SESSION_TIME_MS", "getSessionParams", "globalConfig", "sessionId", "getSessionId", "sessionTime", "Math", "round", "getSessionTime", "buildTransactionPayload", "baseParams", "transactionParams", "data", "transactionName", "transactionAction", "logLevel", "LogLevel", "Info", "message", "requestId", "sanitizePayload", "buildPhasePayload", "phaseParams", "InternalTransactions", "ComponentPhase", "phaseName", "buildErrorPayload", "error", "constructor", "stack", "Error", "extractWixHttpErrorDetails", "errorName", "name", "errorStack", "buildLoggerPayload", "loggerParams", "BasePanoramaClient", "constructor", "_ref", "_this", "baseParams", "globalConfig", "reporter", "hooksManager", "data", "isMuted", "_defineProperty", "_len", "arguments", "length", "args", "Array", "_key", "addDataScope", "getData", "durationTracker", "getDurationTracker", "createDurationTracker", "report", "eventPayload", "reporterOverride", "getReporter", "beforeReportHookResult", "invoke", "Hook", "beforeReport", "reportTransactionStart", "name", "options", "id", "dataWithDefault", "beforeReportTransactionStart", "fullArtifactId", "componentId", "markTransactionStart", "payload", "buildTransactionPayload", "transactionName", "transactionAction", "TransactionAction", "Start", "afterReportTransactionStart", "reportTransactionFinish", "beforeReportTransactionFinish", "duration", "markTransactionFinish", "Finish", "transactionDuration", "afterReportTransactionFinish", "reportPhaseStart", "beforeReportPhaseStart", "markPhaseStart", "buildPhasePayload", "phaseName", "afterReportPhaseStart", "reportPhaseFinish", "beforeReportPhaseFinish", "markPhaseFinish", "afterReportPhaseFinish", "reportError", "error", "Error", "beforeReportError", "buildErrorPayload", "afterReportError", "addBreadcrumb", "breadcrumb", "beforeAddBreadcrumb", "afterAddBreadcrumb", "log", "logLevel", "message", "loggerParams", "beforeReportLog", "buildLoggerPayload", "afterReportLog", "Scope", "constructor", "data", "_defineProperty", "getEntriesToDeepDefaults", "undefined", "Object", "fromEntries", "entries", "filter", "_ref", "key", "KEYS_TO_DEEP_DEFAULTS", "includes", "addDataScope", "outerDataArray", "Array", "isArray", "deepDefaultData", "deepDefaults", "map", "_data", "defaults", "getData", "PanoramaClientFactoryImpl", "constructor", "options", "_defineProperty", "bindPrototypeMethodsToSelf", "withGlobalConfig", "globalConfig", "withReporter", "reporter", "setMuted", "isMuted", "use", "plugin", "plugins", "push", "client", "pluginParams", "createGlobalConfig", "hooksManager", "HooksManager", "baseParams", "defaults", "data", "Scope", "addDataScope", "pluginClientParams", "baseClient", "BasePanoramaClient", "PanoramaClientImpl", "forEach", "panoramaClient", "nodeReporter", "url", "_temp", "silent", "eventPayload", "body", "JSON", "stringify", "logMessage", "fetch", "method", "then", "res", "ok", "console", "error", "statusText", "catch", "e", "panoramaClientFactory", "options", "baseParams", "reporterOptions", "data", "factory", "panoramaClient", "withReporter", "nodeReporter", "CLICKHOUSE_REPORT_URL", "use", "undefined", "__assign", "NO_SCENARIO_FOUND", "SSR_HOST", "SSR_PROTOCOL", "ORIGINAL_URL_HEADER", "ORIGINAL_HOST_HEADER", "ORIGINAL_PROTOCOL_HEADER", "maybeGetDocument", "maybeGetGlobal", "readCookie", "getCookieByName", "loadCookies", "maybeGetDocument", "XSRF_TOKEN_COOKIE_NAME", "XSRF_HEADER_NAME", "csrf", "readCookie", "X_WIX_BRAND_NAME", "xWixBrand", "extractBrand", "maybeGetGlobal", "consentPolicy", "tryResolveNativeAPI", "tryResolveJsSDK", "none", "maybeGetGlobal", "authorization", "isCI", "isNode", "artifactId", "isCI", "IGNORE_KEYS", "COMMON_CONFIG_NAME", "MAP_KEYS", "extractCommonConfigValues", "maybeGetGlobal", "commonConfig", "import_base_64", "LINGUIST_HEADER_KEY", "linguistHeader", "isMultilingualOptionsAreValid", "getInstanceIdFromSignedInstance", "base64", "WixHeadersValidationError", "assertBoolean", "WixHeadersValidationError", "assertString", "createHeaders", "verifyOptsOrThrow", "xWixBrand", "consentPolicy", "authorization", "artifactId", "commonConfig", "linguistHeader", "csrf", "assertBoolean", "assertString", "isBrowser", "isWebWorker", "isNode", "isAbsoluteUrl", "silent", "extractProp", "resolveHost", "extractHost", "SSR_HOST", "resolveProtocol", "extractProtocol", "SSR_PROTOCOL", "extractHostAndProtocolUsingRegExp", "changeHost", "getGlobalConfig", "defaultConfig", "isNode", "isBrowser", "isWebWorker", "isHttpMockServerEnabled", "shouldAllowUnmocked", "toSearchQueryParams", "whitelist_default", "requestIdOrEmptyString", "composeHeaders", "isWixDomain", "createHeaders", "isAbsoluteUrl", "extractHost", "whitelist_default", "axiosErrorFields", "HttpError", "requestIdOrEmptyString", "createHttpError", "import_axios", "buildOptions", "maybeRedirectToMockServer", "buildAllHeaders", "composeHeaders", "getUrlHeaders", "lowerAllJsonKeys", "ORIGINAL_URL_HEADER", "buildUrlFromRequest", "ORIGINAL_HOST_HEADER", "isAbsoluteUrl", "extractHost", "ORIGINAL_PROTOCOL_HEADER", "extractProtocol", "changeHost", "toSearchQueryParams", "HttpClient", "defaultClientOptions", "axios", "checkSanitizerPocEnabled", "resolveHost", "resolveProtocol", "buildOptions", "getGlobalConfig", "SSR_PROTOCOL", "SSR_HOST", "buildAllHeaders", "isWixDomain", "getUrlHeaders", "createHttpError", "silent", "isHttpMockServerEnabled", "shouldAllowUnmocked", "NO_SCENARIO_FOUND", "requestIdOrEmptyString", "transformData", "isNode", "getNodeAdapter", "sanitizeResponse", "extractProp", "isBrowser", "defaultOptions", "StandaloneNodeLogger", "biLoggerClient", "HttpClient", "defaults", "captured"]
|
|
7
|
-
}
|