@superblocksteam/shared 0.9619.10 → 0.9620.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bindings/utils.d.ts.map +1 -1
- package/dist/bindings/utils.js +1 -1
- package/dist/bindings/utils.js.map +1 -1
- package/dist/constants.d.ts +10 -8
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +12 -12
- package/dist/constants.js.map +1 -1
- package/dist/database-lifecycle/appDatabaseCompatibility.d.ts +2 -2
- package/dist/database-lifecycle/appDatabaseCompatibility.d.ts.map +1 -1
- package/dist/database-lifecycle/appDatabaseImport.d.ts +18 -2
- package/dist/database-lifecycle/appDatabaseImport.d.ts.map +1 -1
- package/dist/database-lifecycle/appDatabaseImport.js.map +1 -1
- package/dist/database-lifecycle/appDatabaseStatus.d.ts +12 -2
- package/dist/database-lifecycle/appDatabaseStatus.d.ts.map +1 -1
- package/dist/database-lifecycle/appDatabaseStatus.js +8 -2
- package/dist/database-lifecycle/appDatabaseStatus.js.map +1 -1
- package/dist/database-lifecycle/appDatabaseStatus.test.js +2 -0
- package/dist/database-lifecycle/appDatabaseStatus.test.js.map +1 -1
- package/dist/database-lifecycle/capacityPolicy.d.ts +2 -2
- package/dist/database-lifecycle/capacityPolicy.d.ts.map +1 -1
- package/dist/database-lifecycle/capacityPolicy.js.map +1 -1
- package/dist/database-lifecycle/dataImport.d.ts +7 -4
- package/dist/database-lifecycle/dataImport.d.ts.map +1 -1
- package/dist/database-lifecycle/dataImport.js.map +1 -1
- package/dist/database-lifecycle/destructiveMigrations.d.ts +3 -3
- package/dist/database-lifecycle/destructiveMigrations.js.map +1 -1
- package/dist/database-lifecycle/importCompatibility.d.ts +15 -2
- package/dist/database-lifecycle/importCompatibility.d.ts.map +1 -1
- package/dist/database-lifecycle/importCompatibility.js +33 -0
- package/dist/database-lifecycle/importCompatibility.js.map +1 -1
- package/dist/database-lifecycle/importCompatibility.test.js +47 -1
- package/dist/database-lifecycle/importCompatibility.test.js.map +1 -1
- package/dist/database-lifecycle/index.d.ts +18 -14
- package/dist/database-lifecycle/index.d.ts.map +1 -1
- package/dist/database-lifecycle/index.js +4 -0
- package/dist/database-lifecycle/index.js.map +1 -1
- package/dist/database-lifecycle/physicalPoolIdentity.d.ts.map +1 -1
- package/dist/database-lifecycle/physicalPoolIdentity.js.map +1 -1
- package/dist/errors/git.d.ts.map +1 -1
- package/dist/errors/http.d.ts.map +1 -1
- package/dist/errors/integration.d.ts.map +1 -1
- package/dist/errors/integration.js +1 -1
- package/dist/errors/integration.js.map +1 -1
- package/dist/headers.d.ts +9 -0
- package/dist/headers.d.ts.map +1 -0
- package/dist/headers.js +12 -0
- package/dist/headers.js.map +1 -0
- package/dist/jwt/verifier.d.ts.map +1 -1
- package/dist/jwt/verifier.js +1 -1
- package/dist/jwt/verifier.js.map +1 -1
- package/dist/observability/index.d.ts +1 -0
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +1 -0
- package/dist/observability/index.js.map +1 -1
- package/dist/org-features/index.d.ts +2 -2
- package/dist/org-features/index.d.ts.map +1 -1
- package/dist/package.json +1 -1
- package/dist/pageMigrations/migrations/v4to5.d.ts.map +1 -1
- package/dist/pageMigrations/migrations/v5to6.d.ts.map +1 -1
- package/dist/pageMigrations/migrations/v5to6.js +6 -1
- package/dist/pageMigrations/migrations/v5to6.js.map +1 -1
- package/dist/pageMigrations/migrations/v5to6.test.js +1 -1
- package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.d.ts.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.js +1 -1
- package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.js.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.test.js +1 -1
- package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.d.ts.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.js +1 -1
- package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.js.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.test.js +2 -2
- package/dist/pageMigrations/migrations/v6to7/migrateToSections.d.ts.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/v6to7.d.ts.map +1 -1
- package/dist/pageMigrations/migrations/v7to8.d.ts.map +1 -1
- package/dist/pageMigrations/migrations/v7to8.js +2 -1
- package/dist/pageMigrations/migrations/v7to8.js.map +1 -1
- package/dist/pageMigrations/migrations/v7to8.test.js +1 -1
- package/dist/pages/pageV6.d.ts.map +1 -1
- package/dist/pages/pageV7.d.ts.map +1 -1
- package/dist/pages/pageV8.d.ts.map +1 -1
- package/dist/pages/pageV8.js +1 -1
- package/dist/pages/pageV8.js.map +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/templates/constants.d.ts +1 -1
- package/dist/plugins/templates/constants.d.ts.map +1 -1
- package/dist/plugins/templates/graphql.d.ts.map +1 -1
- package/dist/plugins/templates/gsheets.d.ts.map +1 -1
- package/dist/plugins/templates/lakebase.d.ts.map +1 -1
- package/dist/plugins/templates/mcp.d.ts.map +1 -1
- package/dist/plugins/templates/mcp.test.js +13 -0
- package/dist/plugins/templates/mcp.test.js.map +1 -1
- package/dist/plugins/templates/salesforce.d.ts.map +1 -1
- package/dist/plugins/templates/shared/auth.d.ts.map +1 -1
- package/dist/plugins/templates/shared/auth.js +16 -0
- package/dist/plugins/templates/shared/auth.js.map +1 -1
- package/dist/plugins/templates/shared/aws.d.ts.map +1 -1
- package/dist/plugins/templates/shared/db.d.ts.map +1 -1
- package/dist/plugins/templates/shared/openapi.d.ts.map +1 -1
- package/dist/plugins/templates/shared/openapi.js +1 -1
- package/dist/plugins/templates/shared/openapi.js.map +1 -1
- package/dist/plugins/templates/shared/restapiintegration.d.ts.map +1 -1
- package/dist/plugins/templates/shared/sql.d.ts.map +1 -1
- package/dist/plugins/templates/shared/sshtunnel.d.ts.map +1 -1
- package/dist/plugins/templates/snowflakepostgres.d.ts.map +1 -1
- package/dist/plugins/unsupported-integration-types.d.ts +10 -0
- package/dist/plugins/unsupported-integration-types.d.ts.map +1 -0
- package/dist/plugins/unsupported-integration-types.js +29 -0
- package/dist/plugins/unsupported-integration-types.js.map +1 -0
- package/dist/refactoring/application.d.ts.map +1 -1
- package/dist/refactoring/application.js +2 -1
- package/dist/refactoring/application.js.map +1 -1
- package/dist/refactoring/refactor.d.ts.map +1 -1
- package/dist/refactoring/refactor.js +4 -1
- package/dist/refactoring/refactor.js.map +1 -1
- package/dist/refactoring/refactor.test.js +274 -260
- package/dist/refactoring/refactor.test.js.map +1 -1
- package/dist/refactoring/rename.js +1 -1
- package/dist/refactoring/rename.js.map +1 -1
- package/dist/refactoring/updates.d.ts.map +1 -1
- package/dist/refactoring/updates.js +3 -1
- package/dist/refactoring/updates.js.map +1 -1
- package/dist/relay/builder.d.ts.map +1 -1
- package/dist/signing/JSON/portable.js +2 -2
- package/dist/signing/index.js +1 -1
- package/dist/signing/index.js.map +1 -1
- package/dist/socket/dist-entry.test.js +10 -2
- package/dist/socket/dist-entry.test.js.map +1 -1
- package/dist/socket/heartbeat.d.ts.map +1 -1
- package/dist/socket/heartbeat.js.map +1 -1
- package/dist/socket/heartbeat.test.js.map +1 -1
- package/dist/socket/protocol.d.ts +26 -0
- package/dist/socket/protocol.d.ts.map +1 -1
- package/dist/socket/socket.d.ts +1 -1
- package/dist/socket/socket.d.ts.map +1 -1
- package/dist/socket/socket.js +2 -2
- package/dist/socket/socketWithClientAuth.d.ts.map +1 -1
- package/dist/socket/tracedSocket.d.ts.map +1 -1
- package/dist/socket/types.d.ts.map +1 -1
- package/dist/socket/util.js.map +1 -1
- package/dist/tracing/methodTracing.js +1 -1
- package/dist/types/ai/builder-caller.d.ts +16 -0
- package/dist/types/ai/builder-caller.d.ts.map +1 -0
- package/dist/types/ai/builder-caller.js +64 -0
- package/dist/types/ai/builder-caller.js.map +1 -0
- package/dist/types/ai/builder-caller.test.d.ts +2 -0
- package/dist/types/ai/builder-caller.test.d.ts.map +1 -0
- package/dist/types/ai/builder-caller.test.js +40 -0
- package/dist/types/ai/builder-caller.test.js.map +1 -0
- package/dist/types/ai/index.d.ts +25 -3
- package/dist/types/ai/index.d.ts.map +1 -1
- package/dist/types/ai/index.js +3 -0
- package/dist/types/ai/index.js.map +1 -1
- package/dist/types/ai/native-builder-model.d.ts +21 -0
- package/dist/types/ai/native-builder-model.d.ts.map +1 -0
- package/dist/types/ai/native-builder-model.js +26 -0
- package/dist/types/ai/native-builder-model.js.map +1 -0
- package/dist/types/ai/native-builder-model.test.d.ts +2 -0
- package/dist/types/ai/native-builder-model.test.d.ts.map +1 -0
- package/dist/types/ai/native-builder-model.test.js +30 -0
- package/dist/types/ai/native-builder-model.test.js.map +1 -0
- package/dist/types/ai/provider-credential.d.ts +1 -1
- package/dist/types/ai/provider-credential.d.ts.map +1 -1
- package/dist/types/ai/quota-paywall.d.ts.map +1 -1
- package/dist/types/ai/safety-classification.d.ts +1 -1
- package/dist/types/ai/safety-classification.d.ts.map +1 -1
- package/dist/types/api/control-flow.d.ts +12 -12
- package/dist/types/api/control-flow.d.ts.map +1 -1
- package/dist/types/api/control-flow.js.map +1 -1
- package/dist/types/api/execution.d.ts.map +1 -1
- package/dist/types/api/execution.js +4 -1
- package/dist/types/api/execution.js.map +1 -1
- package/dist/types/api/global.d.ts.map +1 -1
- package/dist/types/api/global.js +2 -3
- package/dist/types/api/global.js.map +1 -1
- package/dist/types/api/index.d.ts +1 -1
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/schedule.d.ts.map +1 -1
- package/dist/types/application/index.d.ts +3 -0
- package/dist/types/application/index.d.ts.map +1 -1
- package/dist/types/application/index.js.map +1 -1
- package/dist/types/application/index.test.js.map +1 -1
- package/dist/types/audit/ocsf.d.ts.map +1 -1
- package/dist/types/audit/ocsf.js +1 -0
- package/dist/types/audit/ocsf.js.map +1 -1
- package/dist/types/branch/index.d.ts +107 -0
- package/dist/types/branch/index.d.ts.map +1 -1
- package/dist/types/codeSecurity/index.d.ts +3 -3
- package/dist/types/codeSecurity/index.d.ts.map +1 -1
- package/dist/types/common/env.d.ts.map +1 -1
- package/dist/types/common/response.d.ts +3 -0
- package/dist/types/common/response.d.ts.map +1 -1
- package/dist/types/common/response.js +2 -0
- package/dist/types/common/response.js.map +1 -1
- package/dist/types/credentials/index.d.ts +3 -3
- package/dist/types/credentials/index.d.ts.map +1 -1
- package/dist/types/customAgents.d.ts +2 -3
- package/dist/types/customAgents.d.ts.map +1 -1
- package/dist/types/datasource/auth.d.ts.map +1 -1
- package/dist/types/datasource/auth.js +1 -1
- package/dist/types/datasource/auth.js.map +1 -1
- package/dist/types/datasource/index.d.ts.map +1 -1
- package/dist/types/datasource/metadata/database.d.ts.map +1 -1
- package/dist/types/event/index.d.ts +4 -3
- package/dist/types/event/index.d.ts.map +1 -1
- package/dist/types/event/index.js +1 -0
- package/dist/types/event/index.js.map +1 -1
- package/dist/types/group/index.d.ts.map +1 -1
- package/dist/types/integration/index.d.ts.map +1 -1
- package/dist/types/integration/index.js +2 -2
- package/dist/types/metadata/index.d.ts.map +1 -1
- package/dist/types/organization/agent.d.ts.map +1 -1
- package/dist/types/organization/token.d.ts.map +1 -1
- package/dist/types/page/Dimension.d.ts +7 -7
- package/dist/types/page/Dimension.d.ts.map +1 -1
- package/dist/types/page/Dimension.js +1 -1
- package/dist/types/page/Dimension.js.map +1 -1
- package/dist/types/page/Dimension.test.js +1 -1
- package/dist/types/page/Padding.d.ts +2 -2
- package/dist/types/page/Padding.d.ts.map +1 -1
- package/dist/types/page/Padding.js +1 -1
- package/dist/types/page/event.d.ts.map +1 -1
- package/dist/types/page/event.js +2 -1
- package/dist/types/page/event.js.map +1 -1
- package/dist/types/plugin/evaluation.d.ts +12 -5
- package/dist/types/plugin/evaluation.d.ts.map +1 -1
- package/dist/types/plugin/evaluation.js +8 -6
- package/dist/types/plugin/evaluation.js.map +1 -1
- package/dist/types/plugin/form.d.ts +1 -1
- package/dist/types/plugin/form.d.ts.map +1 -1
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/integration.d.ts.map +1 -1
- package/dist/types/plugin/js-tokenizer.d.ts +14 -0
- package/dist/types/plugin/js-tokenizer.d.ts.map +1 -0
- package/dist/types/plugin/js-tokenizer.js +97 -0
- package/dist/types/plugin/js-tokenizer.js.map +1 -0
- package/dist/types/plugin/js-tokenizer.test.d.ts +2 -0
- package/dist/types/plugin/js-tokenizer.test.d.ts.map +1 -0
- package/dist/types/plugin/js-tokenizer.test.js +126 -0
- package/dist/types/plugin/js-tokenizer.test.js.map +1 -0
- package/dist/types/policyGate/errors.d.ts +23 -23
- package/dist/types/policyGate/errors.d.ts.map +1 -1
- package/dist/types/profile/index.d.ts.map +1 -1
- package/dist/types/publishPipeline/index.d.ts +6 -6
- package/dist/types/publishPipeline/index.d.ts.map +1 -1
- package/dist/types/publishPipeline/policyStatus.js.map +1 -1
- package/dist/types/rbac/index.d.ts +4 -0
- package/dist/types/rbac/index.d.ts.map +1 -1
- package/dist/types/rbac/index.js +4 -0
- package/dist/types/rbac/index.js.map +1 -1
- package/dist/types/repository/index.d.ts.map +1 -1
- package/dist/types/repository/index.js.map +1 -1
- package/dist/types/reviewPolicy/index.d.ts +24 -24
- package/dist/types/reviewPolicy/index.d.ts.map +1 -1
- package/dist/types/user/analytics.d.ts +1 -1
- package/dist/types/user/analytics.d.ts.map +1 -1
- package/dist/utils/apiv2.d.ts.map +1 -1
- package/dist/utils/apiv2.js +1 -1
- package/dist/utils/apiv2.test.js +10 -10
- package/dist/utils/appDSL.d.ts.map +1 -1
- package/dist/utils/attachment-upload.d.ts +1 -1
- package/dist/utils/attachment-upload.d.ts.map +1 -1
- package/dist/utils/attachment-upload.js +3 -1
- package/dist/utils/attachment-upload.js.map +1 -1
- package/dist/utils/attachment-validation.d.ts +6 -6
- package/dist/utils/attachment-validation.d.ts.map +1 -1
- package/dist/utils/attachment-validation.js +5 -4
- package/dist/utils/attachment-validation.js.map +1 -1
- package/dist/utils/azure-devops-workflow.js.map +1 -1
- package/dist/utils/bitbucket-workflow.js.map +1 -1
- package/dist/utils/bytestring.d.ts.map +1 -1
- package/dist/utils/bytestring.js +5 -4
- package/dist/utils/bytestring.js.map +1 -1
- package/dist/utils/bytestring.test.d.ts +2 -0
- package/dist/utils/bytestring.test.d.ts.map +1 -0
- package/dist/utils/bytestring.test.js +23 -0
- package/dist/utils/bytestring.test.js.map +1 -0
- package/dist/utils/configuration.d.ts.map +1 -1
- package/dist/utils/configuration.js +3 -1
- package/dist/utils/configuration.js.map +1 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +4 -4
- package/dist/utils/github-workflow.js.map +1 -1
- package/dist/utils/gitlab-workflow.js.map +1 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/localNativeBuilderFlags.d.ts +9 -0
- package/dist/utils/localNativeBuilderFlags.d.ts.map +1 -0
- package/dist/utils/localNativeBuilderFlags.js +26 -0
- package/dist/utils/localNativeBuilderFlags.js.map +1 -0
- package/dist/utils/localNativeBuilderFlags.test.d.ts +2 -0
- package/dist/utils/localNativeBuilderFlags.test.d.ts.map +1 -0
- package/dist/utils/localNativeBuilderFlags.test.js +35 -0
- package/dist/utils/localNativeBuilderFlags.test.js.map +1 -0
- package/dist/utils/maskCredential.d.ts.map +1 -1
- package/dist/utils/openApiSpecRef.d.ts +3 -0
- package/dist/utils/openApiSpecRef.d.ts.map +1 -0
- package/dist/utils/openApiSpecRef.js +27 -0
- package/dist/utils/openApiSpecRef.js.map +1 -0
- package/dist/utils/openApiSpecRef.test.d.ts +2 -0
- package/dist/utils/openApiSpecRef.test.d.ts.map +1 -0
- package/dist/utils/openApiSpecRef.test.js +16 -0
- package/dist/utils/openApiSpecRef.test.js.map +1 -0
- package/dist/utils/page.js +1 -1
- package/dist/utils/page.js.map +1 -1
- package/dist/utils/pageFixtures/v4/container.d.ts +346 -346
- package/dist/utils/pageFixtures/v4/container.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v4/empty.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v4/form.d.ts +11 -11
- package/dist/utils/pageFixtures/v4/form.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v4/grid.d.ts +9 -9
- package/dist/utils/pageFixtures/v4/grid.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v4/slideout.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v4/tabs.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v5/codeTrigger.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v5/complexTriggers.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v5/duplicateTriggers.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v5/missingTriggers.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v6/initial_app.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v6/nested_modal.d.ts +32 -32
- package/dist/utils/pageFixtures/v6/nested_modal.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v6/slideout_without_child.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v6/with_2_modals.d.ts +30 -30
- package/dist/utils/pageFixtures/v6/with_2_modals.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v6/with_main_canvas_children.d.ts +97 -97
- package/dist/utils/pageFixtures/v6/with_main_canvas_children.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v6/with_slideouts.d.ts +42 -42
- package/dist/utils/pageFixtures/v6/with_slideouts.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v6/with_widgets_named_page.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v7/canvases.d.ts +29 -29
- package/dist/utils/pageFixtures/v7/canvases.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v7/grids_and_forms.d.ts +56 -56
- package/dist/utils/pageFixtures/v7/grids_and_forms.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v7/images.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v7/initial_app.d.ts.map +1 -1
- package/dist/utils/pageFixtures/v7/nested_containers.d.ts +2 -2
- package/dist/utils/pageFixtures/v7/nested_containers.d.ts.map +1 -1
- package/dist/utils/platform-mcp-server-routes.d.ts +23 -0
- package/dist/utils/platform-mcp-server-routes.d.ts.map +1 -0
- package/dist/utils/platform-mcp-server-routes.js +59 -0
- package/dist/utils/platform-mcp-server-routes.js.map +1 -0
- package/dist/utils/platform-mcp-server-routes.test.d.ts +2 -0
- package/dist/utils/platform-mcp-server-routes.test.d.ts.map +1 -0
- package/dist/utils/platform-mcp-server-routes.test.js +21 -0
- package/dist/utils/platform-mcp-server-routes.test.js.map +1 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -1
- package/dist/utils/tracedEventEmitter.d.ts.map +1 -1
- package/dist/utils/tracedEventEmitter.js +3 -3
- package/dist/utils/truncate.d.ts.map +1 -1
- package/dist/utils/truncate.test.js +1 -1
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/url.js +1 -1
- package/dist/utils/url.js.map +1 -1
- package/package.json +25 -19
- package/src/bindings/utils.ts +1 -1
- package/src/constants.ts +15 -12
- package/src/database-lifecycle/appDatabaseImport.ts +34 -0
- package/src/database-lifecycle/appDatabaseStatus.test.ts +2 -0
- package/src/database-lifecycle/appDatabaseStatus.ts +19 -3
- package/src/database-lifecycle/dataImport.ts +6 -0
- package/src/database-lifecycle/importCompatibility.test.ts +60 -1
- package/src/database-lifecycle/importCompatibility.ts +52 -0
- package/src/database-lifecycle/index.ts +6 -0
- package/src/errors/integration.ts +1 -1
- package/src/headers.ts +11 -0
- package/src/jwt/verifier.ts +1 -1
- package/src/observability/index.ts +1 -0
- package/src/pageMigrations/migrations/v4to5.ts +1 -1
- package/src/pageMigrations/migrations/v5to6.test.ts +1 -1
- package/src/pageMigrations/migrations/v5to6.ts +6 -1
- package/src/pageMigrations/migrations/v6to7/adjustModalCanvases.test.ts +1 -1
- package/src/pageMigrations/migrations/v6to7/adjustModalCanvases.ts +1 -1
- package/src/pageMigrations/migrations/v6to7/migrateToDimensions.test.ts +2 -2
- package/src/pageMigrations/migrations/v6to7/migrateToDimensions.ts +1 -1
- package/src/pageMigrations/migrations/v7to8.test.ts +1 -1
- package/src/pageMigrations/migrations/v7to8.ts +2 -1
- package/src/pages/pageV8.ts +1 -1
- package/src/plugins/index.ts +1 -0
- package/src/plugins/templates/mcp.test.ts +17 -0
- package/src/plugins/templates/shared/auth.ts +16 -0
- package/src/plugins/templates/shared/openapi.ts +1 -1
- package/src/plugins/unsupported-integration-types.ts +30 -0
- package/src/refactoring/application.ts +2 -1
- package/src/refactoring/refactor.test.ts +306 -287
- package/src/refactoring/refactor.ts +4 -1
- package/src/refactoring/rename.ts +1 -1
- package/src/refactoring/updates.ts +3 -1
- package/src/signing/JSON/portable.ts +2 -2
- package/src/signing/index.ts +1 -1
- package/src/socket/dist-entry.test.ts +14 -2
- package/src/socket/protocol.ts +17 -0
- package/src/socket/socket.ts +2 -2
- package/src/socket/types.ts +1 -1
- package/src/tracing/methodTracing.ts +1 -1
- package/src/types/ai/builder-caller.test.ts +45 -0
- package/src/types/ai/builder-caller.ts +63 -0
- package/src/types/ai/index.ts +24 -0
- package/src/types/ai/native-builder-model.test.ts +33 -0
- package/src/types/ai/native-builder-model.ts +28 -0
- package/src/types/api/execution.ts +4 -1
- package/src/types/api/global.ts +2 -4
- package/src/types/application/index.ts +3 -0
- package/src/types/audit/ocsf.ts +1 -0
- package/src/types/branch/index.ts +101 -0
- package/src/types/common/response.ts +3 -0
- package/src/types/customAgents.ts +2 -3
- package/src/types/datasource/auth.ts +1 -1
- package/src/types/datasource/metadata/index.ts +4 -4
- package/src/types/event/index.ts +2 -1
- package/src/types/integration/index.ts +3 -3
- package/src/types/page/Dimension.test.ts +1 -1
- package/src/types/page/Dimension.ts +1 -1
- package/src/types/page/Padding.ts +1 -1
- package/src/types/page/event.ts +2 -1
- package/src/types/plugin/evaluation.ts +20 -13
- package/src/types/plugin/form.ts +1 -1
- package/src/types/plugin/js-tokenizer.test.ts +139 -0
- package/src/types/plugin/js-tokenizer.ts +98 -0
- package/src/types/rbac/index.ts +4 -0
- package/src/utils/apiv2.test.ts +10 -10
- package/src/utils/apiv2.ts +1 -1
- package/src/utils/attachment-upload.ts +4 -1
- package/src/utils/attachment-validation.ts +8 -4
- package/src/utils/bytestring.test.ts +31 -0
- package/src/utils/bytestring.ts +7 -4
- package/src/utils/configuration.ts +3 -1
- package/src/utils/env.ts +5 -5
- package/src/utils/index.ts +3 -0
- package/src/utils/localNativeBuilderFlags.test.ts +39 -0
- package/src/utils/localNativeBuilderFlags.ts +27 -0
- package/src/utils/openApiSpecRef.test.ts +20 -0
- package/src/utils/openApiSpecRef.ts +30 -0
- package/src/utils/page.ts +2 -2
- package/src/utils/platform-mcp-server-routes.test.ts +27 -0
- package/src/utils/platform-mcp-server-routes.ts +65 -0
- package/src/utils/string.ts +1 -1
- package/src/utils/tracedEventEmitter.ts +5 -5
- package/src/utils/truncate.test.ts +1 -1
- package/src/utils/url.ts +1 -1
|
@@ -13,7 +13,7 @@ interface DimensionCache<Type extends object> {
|
|
|
13
13
|
clear(): void;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
//
|
|
16
|
+
// oxlint-disable-next-line @typescript-eslint/no-namespace
|
|
17
17
|
export namespace Dimension {
|
|
18
18
|
let enableCaching = false;
|
|
19
19
|
let cache: DimensionCache<Dimension<DimensionModes>>;
|
|
@@ -7,7 +7,7 @@ export type Padding = {
|
|
|
7
7
|
bottom?: Dimension<'px'>; // Default: { value: 0, mode: 'px' }
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
//
|
|
10
|
+
// oxlint-disable-next-line @typescript-eslint/no-namespace
|
|
11
11
|
export namespace Padding {
|
|
12
12
|
export const y = (padding?: Padding): Dimension<'px'> => {
|
|
13
13
|
if (padding === undefined) {
|
package/src/types/page/event.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isArray from 'lodash-es/isArray.js';
|
|
2
|
+
import isPlainObject from 'lodash-es/isPlainObject.js';
|
|
2
3
|
|
|
3
4
|
import type { ApplicationScope } from '../../types/application/index.js';
|
|
4
5
|
import type { NotificationPosition } from './notification.js';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { TreeCursor } from '@lezer/common';
|
|
2
2
|
import type { LRParser } from '@lezer/lr';
|
|
3
|
-
import type { Token, TokenizeOptions } from 'esprima';
|
|
4
3
|
import type { SourceLocation } from 'estree';
|
|
5
|
-
import
|
|
4
|
+
import get from 'lodash-es/get.js';
|
|
5
|
+
import isFunction from 'lodash-es/isFunction.js';
|
|
6
|
+
import isPlainObject from 'lodash-es/isPlainObject.js';
|
|
6
7
|
|
|
7
8
|
export type EvaluationPair = {
|
|
8
9
|
binding: string;
|
|
9
|
-
//
|
|
10
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
11
|
value: any;
|
|
11
12
|
range: {
|
|
12
13
|
start: number;
|
|
@@ -18,7 +19,13 @@ export type EvaluationPair = {
|
|
|
18
19
|
|
|
19
20
|
export type PythonParser = LRParser;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* A JavaScript token in the shape esprima's `tokenize` returns: `type` is a name like
|
|
24
|
+
* 'Identifier', 'Punctuator', 'Numeric', 'String' or 'Template', and `value` is the exact source text.
|
|
25
|
+
*/
|
|
26
|
+
export type JsToken = {
|
|
27
|
+
type: string;
|
|
28
|
+
value: string;
|
|
22
29
|
range?: [number, number];
|
|
23
30
|
loc?: SourceLocation;
|
|
24
31
|
};
|
|
@@ -26,12 +33,12 @@ type TokenWithRangeAndLoc = Token & {
|
|
|
26
33
|
export const extractJsEvaluationPairsWithTokenizer = (
|
|
27
34
|
jsSnippet: string,
|
|
28
35
|
entitiesToExtract: Set<string>,
|
|
29
|
-
//
|
|
36
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
37
|
dataTree: Record<string, any>,
|
|
31
|
-
tokenize: (input: string, config
|
|
38
|
+
tokenize: (input: string, config: { range: true; loc: true }) => JsToken[],
|
|
32
39
|
namespacedEntitiesToExtract: Record<string, Set<string>> = {}
|
|
33
40
|
): EvaluationPair[] => {
|
|
34
|
-
let tokens:
|
|
41
|
+
let tokens: JsToken[] = [];
|
|
35
42
|
const ret: EvaluationPair[] = [];
|
|
36
43
|
try {
|
|
37
44
|
tokens = tokenize(jsSnippet, { range: true, loc: true });
|
|
@@ -104,14 +111,14 @@ export const extractJsEvaluationPairsWithTokenizer = (
|
|
|
104
111
|
// TODO: Move test for this into shared.
|
|
105
112
|
export const extractEntity = (
|
|
106
113
|
indexToStart: number,
|
|
107
|
-
tokens: Array<
|
|
108
|
-
//
|
|
114
|
+
tokens: Array<JsToken>,
|
|
115
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
116
|
dataTree: Record<string, any>
|
|
110
117
|
): EvaluationPair => {
|
|
111
118
|
const currentPropertyPath: string[] = [];
|
|
112
|
-
let previousToken:
|
|
119
|
+
let previousToken: JsToken | null = null;
|
|
113
120
|
let done = false; // cant do break out of switch without state variable
|
|
114
|
-
//
|
|
121
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
115
122
|
let entity: any;
|
|
116
123
|
const removeTrailingPunctuation = () => {
|
|
117
124
|
if (currentPropertyPath[currentPropertyPath.length - 1] === '.' || currentPropertyPath[currentPropertyPath.length - 1] === '[') {
|
|
@@ -236,7 +243,7 @@ export const extractEntity = (
|
|
|
236
243
|
export const extractPythonEvaluationPairsWithParser = (
|
|
237
244
|
code: string,
|
|
238
245
|
entities: Set<string>,
|
|
239
|
-
//
|
|
246
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
240
247
|
dataTree: Record<string, any>,
|
|
241
248
|
parser: PythonParser,
|
|
242
249
|
namespacedEntitiesToExtract: Record<string, Set<string>> = {}
|
|
@@ -248,7 +255,7 @@ export const extractPythonEvaluationPairsWithParser = (
|
|
|
248
255
|
let isCapturing = false;
|
|
249
256
|
const bindingPairs: EvaluationPair[] = [];
|
|
250
257
|
let currentEntityPath: string[] = [];
|
|
251
|
-
//
|
|
258
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
252
259
|
let entity: any;
|
|
253
260
|
let bindingStart = 0;
|
|
254
261
|
let bindingEnd = 0;
|
package/src/types/plugin/form.ts
CHANGED
|
@@ -144,7 +144,7 @@ export interface BaseFormItem {
|
|
|
144
144
|
doNotClearOnDependenciesChange?: boolean;
|
|
145
145
|
initialValue?: InitialValue;
|
|
146
146
|
secondaryInitialValue?: InitialValue;
|
|
147
|
-
//
|
|
147
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
148
148
|
rules?: any[];
|
|
149
149
|
style?: FormItemStyle;
|
|
150
150
|
disabled?: boolean;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { tokenizeJs } from './js-tokenizer.js';
|
|
4
|
+
|
|
5
|
+
// Each token is written as `Type:value` to keep the tables readable.
|
|
6
|
+
function tokenStream(code: string): string[] {
|
|
7
|
+
return tokenizeJs(code).map((token) => `${token.type}:${token.value}`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const templateCases: [string, string, string[]][] = [
|
|
11
|
+
['a template with no substitutions is one token', '`a`', ['Template:`a`']],
|
|
12
|
+
['a template with a substitution is split into head, expression and tail', '`a${x}b`', ['Template:`a${', 'Identifier:x', 'Template:}b`']],
|
|
13
|
+
[
|
|
14
|
+
'a nested template is joined chunk by chunk',
|
|
15
|
+
'`a${`b${c}`}d`',
|
|
16
|
+
['Template:`a${', 'Template:`b${', 'Identifier:c', 'Template:}`', 'Template:}d`']
|
|
17
|
+
],
|
|
18
|
+
['back-to-back templates stay separate', '`a``b`', ['Template:`a`', 'Template:`b`']],
|
|
19
|
+
['a tagged template keeps the tag as an identifier', 'tag`a${x}`', ['Identifier:tag', 'Template:`a${', 'Identifier:x', 'Template:}`']],
|
|
20
|
+
[
|
|
21
|
+
'two substitutions in a row share the middle chunk',
|
|
22
|
+
'`${a}${b}`',
|
|
23
|
+
['Template:`${', 'Identifier:a', 'Template:}${', 'Identifier:b', 'Template:}`']
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
'braces inside a substitution are not mistaken for the template tail',
|
|
27
|
+
'`a${ {b:1}.b }c`',
|
|
28
|
+
[
|
|
29
|
+
'Template:`a${',
|
|
30
|
+
'Punctuator:{',
|
|
31
|
+
'Identifier:b',
|
|
32
|
+
'Punctuator::',
|
|
33
|
+
'Numeric:1',
|
|
34
|
+
'Punctuator:}',
|
|
35
|
+
'Punctuator:.',
|
|
36
|
+
'Identifier:b',
|
|
37
|
+
'Template:}c`'
|
|
38
|
+
]
|
|
39
|
+
]
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
it.each(templateCases)('%s', (_name, code, expected) => {
|
|
43
|
+
expect(tokenStream(code)).toEqual(expected);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Esprima 4 does not know these operators, so it reads each as smaller ones. The extractors rely on
|
|
47
|
+
// the `.` in `a?.b` to avoid treating `b` as a top-level name.
|
|
48
|
+
const operatorCases: [string, string[]][] = [
|
|
49
|
+
['a?.b', ['Identifier:a', 'Punctuator:?', 'Punctuator:.', 'Identifier:b']],
|
|
50
|
+
['a?.[0]', ['Identifier:a', 'Punctuator:?', 'Punctuator:.', 'Punctuator:[', 'Numeric:0', 'Punctuator:]']],
|
|
51
|
+
['f?.()', ['Identifier:f', 'Punctuator:?', 'Punctuator:.', 'Punctuator:(', 'Punctuator:)']],
|
|
52
|
+
['a ?? b', ['Identifier:a', 'Punctuator:?', 'Punctuator:?', 'Identifier:b']],
|
|
53
|
+
['a ??= b', ['Identifier:a', 'Punctuator:?', 'Punctuator:?', 'Punctuator:=', 'Identifier:b']],
|
|
54
|
+
['a ||= b', ['Identifier:a', 'Punctuator:||', 'Punctuator:=', 'Identifier:b']],
|
|
55
|
+
['a &&= b', ['Identifier:a', 'Punctuator:&&', 'Punctuator:=', 'Identifier:b']]
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
it.each(operatorCases)('splits the operators in %j the way esprima did', (code, expected) => {
|
|
59
|
+
expect(tokenStream(code)).toEqual(expected);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('reports let, yield and enum as keywords, like esprima', () => {
|
|
63
|
+
expect(tokenStream('let yield enum')).toEqual(['Keyword:let', 'Keyword:yield', 'Keyword:enum']);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const newSyntaxCases: [string, string, string[]][] = [
|
|
67
|
+
[
|
|
68
|
+
'a private field declaration',
|
|
69
|
+
'class A { #x = 1 }',
|
|
70
|
+
['Keyword:class', 'Identifier:A', 'Punctuator:{', 'PrivateIdentifier:#x', 'Punctuator:=', 'Numeric:1', 'Punctuator:}']
|
|
71
|
+
],
|
|
72
|
+
['a private field brand check', '#x in o', ['PrivateIdentifier:#x', 'Keyword:in', 'Identifier:o']],
|
|
73
|
+
['a numeric separator', '1_000', ['Numeric:1_000']],
|
|
74
|
+
['a BigInt', '10n', ['Numeric:10n']],
|
|
75
|
+
['a BigInt with separators', '0x1_0n', ['Numeric:0x1_0n']]
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
it.each(newSyntaxCases)('reads %s, which esprima 4 throws on', (_name, code, expected) => {
|
|
79
|
+
expect(tokenStream(code)).toEqual(expected);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Acorn decides between a regex and a division from the syntax around the `/`. Esprima guessed from
|
|
83
|
+
// the previous token and got these wrong, so the streams differ from esprima 4 on purpose.
|
|
84
|
+
const regexCases: [string, string, string[]][] = [
|
|
85
|
+
[
|
|
86
|
+
'a regex on the line after a block is one token (esprima read /, foo, /)',
|
|
87
|
+
'{}\n/foo/.test(x)',
|
|
88
|
+
[
|
|
89
|
+
'Punctuator:{',
|
|
90
|
+
'Punctuator:}',
|
|
91
|
+
'RegularExpression:/foo/',
|
|
92
|
+
'Punctuator:.',
|
|
93
|
+
'Identifier:test',
|
|
94
|
+
'Punctuator:(',
|
|
95
|
+
'Identifier:x',
|
|
96
|
+
'Punctuator:)'
|
|
97
|
+
]
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
'a regex on the line after an arrow function body is one token (esprima read /, re, /, g)',
|
|
101
|
+
'a=>{}\n/re/g',
|
|
102
|
+
['Identifier:a', 'Punctuator:=>', 'Punctuator:{', 'Punctuator:}', 'RegularExpression:/re/g']
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
'slashes after a property named return are divisions (esprima read a regex)',
|
|
106
|
+
'x.return /2/ y',
|
|
107
|
+
['Identifier:x', 'Punctuator:.', 'Keyword:return', 'Punctuator:/', 'Numeric:2', 'Punctuator:/', 'Identifier:y']
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
'a division between names stays a division',
|
|
111
|
+
'a / b / c',
|
|
112
|
+
['Identifier:a', 'Punctuator:/', 'Identifier:b', 'Punctuator:/', 'Identifier:c']
|
|
113
|
+
],
|
|
114
|
+
['a regex after an assignment is one token', 'x = /a+/gi', ['Identifier:x', 'Punctuator:=', 'RegularExpression:/a+/gi']]
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
it.each(regexCases)('%s', (_name, code, expected) => {
|
|
118
|
+
expect(tokenStream(code)).toEqual(expected);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('gives range and loc for every token on multi-line input, including split operators and joined templates', () => {
|
|
122
|
+
const code = 'a ??= 1;\n`x${\n y}`';
|
|
123
|
+
|
|
124
|
+
expect(tokenizeJs(code)).toEqual([
|
|
125
|
+
{ type: 'Identifier', value: 'a', range: [0, 1], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } },
|
|
126
|
+
{ type: 'Punctuator', value: '?', range: [2, 3], loc: { start: { line: 1, column: 2 }, end: { line: 1, column: 3 } } },
|
|
127
|
+
{ type: 'Punctuator', value: '?', range: [3, 4], loc: { start: { line: 1, column: 3 }, end: { line: 1, column: 4 } } },
|
|
128
|
+
{ type: 'Punctuator', value: '=', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } },
|
|
129
|
+
{ type: 'Numeric', value: '1', range: [6, 7], loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 7 } } },
|
|
130
|
+
{ type: 'Punctuator', value: ';', range: [7, 8], loc: { start: { line: 1, column: 7 }, end: { line: 1, column: 8 } } },
|
|
131
|
+
{ type: 'Template', value: '`x${', range: [9, 13], loc: { start: { line: 2, column: 0 }, end: { line: 2, column: 4 } } },
|
|
132
|
+
{ type: 'Identifier', value: 'y', range: [16, 17], loc: { start: { line: 3, column: 2 }, end: { line: 3, column: 3 } } },
|
|
133
|
+
{ type: 'Template', value: '}`', range: [17, 19], loc: { start: { line: 3, column: 3 }, end: { line: 3, column: 5 } } }
|
|
134
|
+
]);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('throws on code that is not JavaScript', () => {
|
|
138
|
+
expect(() => tokenizeJs('const = ;;"')).toThrow();
|
|
139
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { type Token as AcornToken, tokenizer, tokTypes } from 'acorn';
|
|
2
|
+
|
|
3
|
+
import type { JsToken } from './evaluation.js';
|
|
4
|
+
|
|
5
|
+
// Published as `@superblocksteam/shared/js-tokenizer` and left out of the package index on purpose.
|
|
6
|
+
// The browser apps import the index and bundle every module it reaches, so exporting this from
|
|
7
|
+
// there would ship acorn to every browser.
|
|
8
|
+
|
|
9
|
+
// Words esprima reports as keywords but acorn reports as plain names.
|
|
10
|
+
const ESPRIMA_ONLY_KEYWORDS = new Set(['let', 'yield', 'enum']);
|
|
11
|
+
|
|
12
|
+
function jsTokenType(token: AcornToken, value: string): string {
|
|
13
|
+
const { type } = token;
|
|
14
|
+
if (type === tokTypes.name) return ESPRIMA_ONLY_KEYWORDS.has(value) ? 'Keyword' : 'Identifier';
|
|
15
|
+
if (type === tokTypes._null) return 'Null';
|
|
16
|
+
if (type === tokTypes._true || type === tokTypes._false) return 'Boolean';
|
|
17
|
+
if (type.keyword) return 'Keyword';
|
|
18
|
+
if (type === tokTypes.num) return 'Numeric';
|
|
19
|
+
if (type === tokTypes.string) return 'String';
|
|
20
|
+
if (type === tokTypes.regexp) return 'RegularExpression';
|
|
21
|
+
if (type === tokTypes.privateId) return 'PrivateIdentifier';
|
|
22
|
+
return 'Punctuator';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function isTemplateChunk(token: AcornToken | undefined): boolean {
|
|
26
|
+
return token?.type === tokTypes.template || token?.type === tokTypes.invalidTemplate;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Operators added after esprima 4. Esprima reads each as smaller operators, for example `a?.b` as
|
|
30
|
+
// `a`, `?`, `.`, `b`. The extractors rely on that: the `.` stops `b` from being read as a top-level name.
|
|
31
|
+
const ESPRIMA_OPERATOR_PARTS = new Map([
|
|
32
|
+
['?.', ['?', '.']],
|
|
33
|
+
['??', ['?', '?']],
|
|
34
|
+
['??=', ['?', '?', '=']],
|
|
35
|
+
['||=', ['||', '=']],
|
|
36
|
+
['&&=', ['&&', '=']]
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Tokenizes JavaScript with acorn, which also reads syntax esprima 4 rejects, such as numeric
|
|
41
|
+
* separators, BigInt and private class fields. For code esprima could read, the tokens match
|
|
42
|
+
* esprima's `tokenize(code, { range: true, loc: true })`, so the extractors in evaluation.ts
|
|
43
|
+
* behave as before. The exception is where esprima guessed wrong between a regex and a division:
|
|
44
|
+
* after a block or arrow body followed by a newline (`{}\n/foo/.test(x)`) acorn returns one regex
|
|
45
|
+
* token where esprima returned `/`, `foo`, `/`, and for `x.return /2/ y` it is the other way round.
|
|
46
|
+
* Acorn is right in both. So the extractors no longer see a name written inside the first kind of
|
|
47
|
+
* regex, and they now see the text between the slashes in the second.
|
|
48
|
+
* Throws on code acorn cannot read.
|
|
49
|
+
*/
|
|
50
|
+
export function tokenizeJs(code: string): JsToken[] {
|
|
51
|
+
const acornTokens = [...tokenizer(code, { ecmaVersion: 'latest', locations: true })];
|
|
52
|
+
const tokens: JsToken[] = [];
|
|
53
|
+
const push = (type: string, first: AcornToken, last: AcornToken) => {
|
|
54
|
+
tokens.push({
|
|
55
|
+
type,
|
|
56
|
+
value: code.slice(first.start, last.end),
|
|
57
|
+
range: [first.start, last.end],
|
|
58
|
+
loc:
|
|
59
|
+
first.loc && last.loc
|
|
60
|
+
? {
|
|
61
|
+
start: { line: first.loc.start.line, column: first.loc.start.column },
|
|
62
|
+
end: { line: last.loc.end.line, column: last.loc.end.column }
|
|
63
|
+
}
|
|
64
|
+
: undefined
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
for (let i = 0; i < acornTokens.length; i++) {
|
|
69
|
+
const token = acornTokens[i];
|
|
70
|
+
const value = code.slice(token.start, token.end);
|
|
71
|
+
// Acorn splits a template literal into backquote, text and `${` tokens, where esprima returns
|
|
72
|
+
// one 'Template' token per run of text, such as "`a${" or "}b`". Join them the same way.
|
|
73
|
+
if (token.type === tokTypes.backQuote || (token.type === tokTypes.braceR && isTemplateChunk(acornTokens[i + 1]))) {
|
|
74
|
+
i += 2;
|
|
75
|
+
push('Template', token, acornTokens[i]);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const parts = ESPRIMA_OPERATOR_PARTS.get(value);
|
|
79
|
+
if (!parts) {
|
|
80
|
+
push(jsTokenType(token, value), token, token);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
let start = token.start;
|
|
84
|
+
for (const part of parts) {
|
|
85
|
+
const end = start + part.length;
|
|
86
|
+
const line = token.loc?.start.line ?? 0;
|
|
87
|
+
const column = (token.loc?.start.column ?? 0) + (start - token.start);
|
|
88
|
+
tokens.push({
|
|
89
|
+
type: 'Punctuator',
|
|
90
|
+
value: part,
|
|
91
|
+
range: [start, end],
|
|
92
|
+
loc: token.loc ? { start: { line, column }, end: { line, column: column + part.length } } : undefined
|
|
93
|
+
});
|
|
94
|
+
start = end;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return tokens;
|
|
98
|
+
}
|
package/src/types/rbac/index.ts
CHANGED
|
@@ -139,6 +139,7 @@ export enum ResourceTypeEnum {
|
|
|
139
139
|
LOGS = 'logs',
|
|
140
140
|
LOGS_STREAMS = 'logs.streams',
|
|
141
141
|
APP_DATABASES = 'app_databases',
|
|
142
|
+
MCP_CLIENTS = 'mcp_clients',
|
|
142
143
|
NPM_REGISTRY = 'npm_registry',
|
|
143
144
|
ORGANIZATION = 'org',
|
|
144
145
|
// ORGANIZATION_REQUESTS = 'org.requests',
|
|
@@ -283,6 +284,9 @@ export const ActionTypeByResourceType = {
|
|
|
283
284
|
MANAGE: ActionTypeEnum.MANAGE,
|
|
284
285
|
USE: ActionTypeEnum.USE
|
|
285
286
|
},
|
|
287
|
+
MCP_CLIENTS: {
|
|
288
|
+
MANAGE: ActionTypeEnum.MANAGE
|
|
289
|
+
},
|
|
286
290
|
NPM_REGISTRY: {
|
|
287
291
|
MANAGE: ActionTypeEnum.MANAGE
|
|
288
292
|
},
|
package/src/utils/apiv2.test.ts
CHANGED
|
@@ -42,7 +42,7 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const sanitizedApiBody = cloneDeep(apiBody);
|
|
45
|
-
//
|
|
45
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
46
|
(sanitizedApiBody as any).blocks[1].conditional.if.blocks[0].step.openai.transcribeAudioToTextTranslateToEnglish = true;
|
|
47
47
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
48
48
|
});
|
|
@@ -399,7 +399,7 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
401
|
const sanitizedApiBody = cloneDeep(apiBody);
|
|
402
|
-
//
|
|
402
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
403
403
|
(sanitizedApiBody as any).blocks[0].step.mariadb.newValues = '';
|
|
404
404
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
405
405
|
});
|
|
@@ -479,7 +479,7 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
const sanitizedApiBody = cloneDeep(apiBody);
|
|
482
|
-
//
|
|
482
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
483
483
|
(sanitizedApiBody as any).blocks[0].step.mysql.newValues = '';
|
|
484
484
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
485
485
|
});
|
|
@@ -585,9 +585,9 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
585
585
|
}
|
|
586
586
|
};
|
|
587
587
|
const sanitizedApiBody = cloneDeep(apiBody);
|
|
588
|
-
//
|
|
588
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
589
589
|
(sanitizedApiBody as any).blocks[0].step.openai.generateTextNewTextMaxTokens = '1';
|
|
590
|
-
//
|
|
590
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
591
591
|
(sanitizedApiBody as any).blocks[0].step.openai.transcribeAudioToTextTranslateToEnglish = false;
|
|
592
592
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
593
593
|
});
|
|
@@ -631,7 +631,7 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
631
631
|
}
|
|
632
632
|
};
|
|
633
633
|
const sanitizedApiBody = cloneDeep(apiBody);
|
|
634
|
-
//
|
|
634
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
635
635
|
(sanitizedApiBody as any).blocks[0].step.gsheets.rowNumber = '0';
|
|
636
636
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
637
637
|
});
|
|
@@ -675,7 +675,7 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
677
|
const sanitizedApiBody = cloneDeep(apiBody);
|
|
678
|
-
//
|
|
678
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
679
679
|
(sanitizedApiBody as any).blocks[0].step.gsheets.rowNumber = '100';
|
|
680
680
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
681
681
|
});
|
|
@@ -787,7 +787,7 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
787
787
|
}
|
|
788
788
|
};
|
|
789
789
|
const sanitizedApiBody = cloneDeep(apiBody);
|
|
790
|
-
//
|
|
790
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
791
791
|
(sanitizedApiBody as any).trigger.workflow.parameters.query[''] = { values: [''] };
|
|
792
792
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
793
793
|
});
|
|
@@ -833,9 +833,9 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
833
833
|
}
|
|
834
834
|
};
|
|
835
835
|
const sanitizedApiBody = cloneDeep(apiBody);
|
|
836
|
-
//
|
|
836
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
837
837
|
(sanitizedApiBody as any).blocks[0].variables.items[0].value = '{{Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}}';
|
|
838
|
-
//
|
|
838
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
839
839
|
(sanitizedApiBody as any).blocks[0].variables.items[1].value = '{{2020,2021,2022,2023}}';
|
|
840
840
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
841
841
|
});
|
package/src/utils/apiv2.ts
CHANGED
|
@@ -11,7 +11,7 @@ export const transcribeAudioToTextTranslateToEnglishTruthyValues = ['checked', '
|
|
|
11
11
|
export const transcribeAudioToTextTranslateToEnglishFalsyValues = [null, undefined, 'false', false];
|
|
12
12
|
|
|
13
13
|
export const sanitizeV2RequestBody = (apiBody: Record<string, unknown>): Record<string, unknown> => {
|
|
14
|
-
//
|
|
14
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
15
|
const traverseJSON = (obj: any) => {
|
|
16
16
|
for (const key in obj) {
|
|
17
17
|
if (key === 'step') {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PlatformMcpServerRequest } from './platform-mcp-server-routes.js';
|
|
2
|
+
|
|
1
3
|
const OFFICE_MIME_SUBSTRINGS = [
|
|
2
4
|
'application/msword',
|
|
3
5
|
'application/vnd.ms-excel',
|
|
@@ -691,7 +693,8 @@ export async function uploadAttachmentToServerApi(params: {
|
|
|
691
693
|
...(commitId != null && { commitId })
|
|
692
694
|
});
|
|
693
695
|
|
|
694
|
-
|
|
696
|
+
// One of the routes the Platform MCP may call, which uploads through here.
|
|
697
|
+
const uploadUrl = new URL(PlatformMcpServerRequest.to('POST /api/v1/files/upload').path, baseUrl);
|
|
695
698
|
uploadUrl.searchParams.set('scopeType', scopeType);
|
|
696
699
|
uploadUrl.searchParams.set('purpose', purpose);
|
|
697
700
|
if (applicationId != null && applicationId.trim() !== '') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PDFDocument, PDFPageLeaf, PDFPageTree } from 'pdf-lib';
|
|
1
|
+
import type { PDFDocument, PDFPageLeaf, PDFPageTree } from 'pdf-lib';
|
|
2
2
|
|
|
3
3
|
import { detectAttachmentArchiveType, isDumpAttachment } from './attachment-delivery.js';
|
|
4
4
|
import { getTextAttachmentType, isOfficeXml, isXlsxAttachmentFile } from './attachment-upload.js';
|
|
@@ -253,7 +253,9 @@ function validateText(bytes: Uint8Array): void {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
type PdfLib = typeof import('pdf-lib');
|
|
257
|
+
|
|
258
|
+
function countPdfPages(document: PDFDocument, { PDFPageLeaf, PDFPageTree }: PdfLib): number {
|
|
257
259
|
const pending: (PDFPageLeaf | PDFPageTree)[] = [document.catalog.Pages()];
|
|
258
260
|
const visited = new Set<PDFPageTree>();
|
|
259
261
|
let pages = 0;
|
|
@@ -287,9 +289,11 @@ async function validatePdf(bytes: Uint8Array): Promise<number> {
|
|
|
287
289
|
if (!new TextDecoder('latin1').decode(bytes.subarray(0, 1028)).includes('%PDF-')) {
|
|
288
290
|
throw new AttachmentValidationError('invalid_content');
|
|
289
291
|
}
|
|
292
|
+
// pdf-lib is large, so load it only when a PDF is actually validated instead of on every import of this package.
|
|
293
|
+
const pdfLib = await import('pdf-lib');
|
|
290
294
|
try {
|
|
291
|
-
const document = await PDFDocument.load(bytes, { throwOnInvalidObject: true, updateMetadata: false });
|
|
292
|
-
return countPdfPages(document);
|
|
295
|
+
const document = await pdfLib.PDFDocument.load(bytes, { throwOnInvalidObject: true, updateMetadata: false });
|
|
296
|
+
return countPdfPages(document, pdfLib);
|
|
293
297
|
} catch (error) {
|
|
294
298
|
if (error instanceof AttachmentValidationError) throw error;
|
|
295
299
|
throw new AttachmentValidationError('invalid_content');
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { expect, test } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { decodeBytestrings } from './bytestring.js';
|
|
4
|
+
|
|
5
|
+
test('decodes nested serialized buffers to Uint8Array and leaves other values alone', () => {
|
|
6
|
+
const decoded = decodeBytestrings(
|
|
7
|
+
{
|
|
8
|
+
file: { type: 'Buffer', data: [104, 105] },
|
|
9
|
+
rows: [{ type: 'Buffer', data: [1] }, null, 'text'],
|
|
10
|
+
notBytes: { type: 'Buffer', data: ['a'] }
|
|
11
|
+
},
|
|
12
|
+
false
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(decoded).toEqual({
|
|
16
|
+
file: new Uint8Array([104, 105]),
|
|
17
|
+
rows: [new Uint8Array([1]), null, 'text'],
|
|
18
|
+
notBytes: { type: 'Buffer', data: ['a'] }
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('decodes a top level serialized buffer to a node.js Buffer', () => {
|
|
23
|
+
expect(decodeBytestrings({ type: 'Buffer', data: [104, 105] }, true)).toEqual(Buffer.from('hi'));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('decodes buffers inside a top level array and keeps it an array', () => {
|
|
27
|
+
const decoded = decodeBytestrings([{ type: 'Buffer', data: [1] }, 2], false);
|
|
28
|
+
|
|
29
|
+
expect(Array.isArray(decoded)).toBe(true);
|
|
30
|
+
expect(decoded).toEqual([new Uint8Array([1]), 2]);
|
|
31
|
+
});
|
package/src/utils/bytestring.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import { isNumber, isObject } from 'lodash-es';
|
|
1
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Convert all objects that represent a bytestring to a node.js Buffer or a Uint8Array.
|
|
@@ -16,8 +15,12 @@ import { isNumber, isObject } from 'lodash-es';
|
|
|
16
15
|
*
|
|
17
16
|
*/
|
|
18
17
|
export function decodeBytestrings<T>(value: T, useNodeJSBuffer: boolean): T {
|
|
19
|
-
if (
|
|
20
|
-
if (
|
|
18
|
+
if (typeof value === 'object' && value !== null) {
|
|
19
|
+
if (
|
|
20
|
+
(value as any).type === 'Buffer' &&
|
|
21
|
+
Array.isArray((value as any).data) &&
|
|
22
|
+
(value as any).data.every((x: unknown) => typeof x === 'number')
|
|
23
|
+
) {
|
|
21
24
|
if (useNodeJSBuffer) {
|
|
22
25
|
return Buffer.from(value as any) as unknown as T;
|
|
23
26
|
} else {
|
package/src/utils/env.ts
CHANGED
|
@@ -2,17 +2,17 @@ import { InvalidConfigurationError } from '../errors/configuration-error.js';
|
|
|
2
2
|
|
|
3
3
|
export type Env = {
|
|
4
4
|
name: string;
|
|
5
|
-
//
|
|
5
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
6
|
defaultValue?: any;
|
|
7
7
|
regex?: string;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export class EnvStore {
|
|
11
11
|
private vars: Record<string, Env>;
|
|
12
|
-
//
|
|
12
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
private values: Record<string, any>;
|
|
14
14
|
|
|
15
|
-
//
|
|
15
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
constructor(values: Record<string, any>) {
|
|
17
17
|
this.vars = {};
|
|
18
18
|
this.values = values;
|
|
@@ -34,14 +34,14 @@ export class EnvStore {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
38
|
get(name: string): any {
|
|
39
39
|
const env = this.vars[name];
|
|
40
40
|
if (env === undefined) {
|
|
41
41
|
throw new InvalidConfigurationError(`Env variable ${name} is missing, use addEnv to add it first`);
|
|
42
42
|
}
|
|
43
43
|
if (env.regex) {
|
|
44
|
-
//
|
|
44
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
45
|
const matchedKeys: Record<string, any> = {};
|
|
46
46
|
Object.entries(this.values).forEach(([key, value]) => {
|
|
47
47
|
if (key.match(env.regex ?? '')) {
|
package/src/utils/index.ts
CHANGED
|
@@ -12,7 +12,9 @@ export * from './launchDarkly.js';
|
|
|
12
12
|
export * from './maskCredential.js';
|
|
13
13
|
export * from './normalize.js';
|
|
14
14
|
export * from './normalizeRoleName.js';
|
|
15
|
+
export * from './openApiSpecRef.js';
|
|
15
16
|
export * from './page.js';
|
|
17
|
+
export * from './platform-mcp-server-routes.js';
|
|
16
18
|
export * from './string.js';
|
|
17
19
|
export * from './time.js';
|
|
18
20
|
export * from './truncate.js';
|
|
@@ -20,3 +22,4 @@ export * from './url.js';
|
|
|
20
22
|
|
|
21
23
|
import gridV4 from './pageFixtures/v4/grid.js';
|
|
22
24
|
export { gridV4 };
|
|
25
|
+
export * from './localNativeBuilderFlags.js';
|