@superblocksteam/shared 0.9620.0 → 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/constants.d.ts +7 -9
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +11 -13
- 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 +2 -2
- package/dist/database-lifecycle/appDatabaseImport.d.ts.map +1 -1
- package/dist/database-lifecycle/appDatabaseStatus.d.ts +1 -1
- package/dist/database-lifecycle/appDatabaseStatus.d.ts.map +1 -1
- 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 +4 -4
- package/dist/database-lifecycle/dataImport.d.ts.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 +4 -4
- package/dist/database-lifecycle/importCompatibility.d.ts.map +1 -1
- package/dist/database-lifecycle/importCompatibility.test.js.map +1 -1
- package/dist/database-lifecycle/index.d.ts +13 -13
- package/dist/database-lifecycle/index.d.ts.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/jwt/verifier.d.ts.map +1 -1
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/org-features/index.d.ts +2 -2
- package/dist/org-features/index.d.ts.map +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.test.js +1 -1
- package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.d.ts.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.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.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/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/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/refactoring/refactor.test.js +274 -260
- package/dist/refactoring/refactor.test.js.map +1 -1
- package/dist/refactoring/rename.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.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 +6 -1
- 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.map +1 -1
- package/dist/types/ai/builder-caller.js.map +1 -1
- package/dist/types/ai/index.d.ts +16 -4
- package/dist/types/ai/index.d.ts.map +1 -1
- package/dist/types/ai/index.js +1 -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/global.d.ts.map +1 -1
- package/dist/types/api/global.js +1 -2
- 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 +2 -1
- 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 +40 -9
- 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.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.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 +3 -3
- 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/plugin/evaluation.d.ts +12 -5
- package/dist/types/plugin/evaluation.d.ts.map +1 -1
- package/dist/types/plugin/evaluation.js +5 -5
- 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/response/IssueSuperblocksResponseBody.d.ts +6 -0
- package/dist/types/response/IssueSuperblocksResponseBody.d.ts.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.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.js +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 +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -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.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.map +1 -1
- package/package.json +11 -5
- package/src/constants.ts +11 -14
- package/src/pageMigrations/migrations/v4to5.ts +1 -1
- package/src/pageMigrations/migrations/v5to6.test.ts +1 -1
- package/src/pageMigrations/migrations/v6to7/adjustModalCanvases.test.ts +1 -1
- package/src/pageMigrations/migrations/v6to7/migrateToDimensions.test.ts +2 -2
- package/src/pageMigrations/migrations/v7to8.test.ts +1 -1
- package/src/plugins/templates/mcp.test.ts +17 -0
- package/src/plugins/templates/shared/auth.ts +16 -0
- package/src/refactoring/refactor.test.ts +306 -287
- package/src/signing/JSON/portable.ts +2 -2
- package/src/socket/protocol.ts +6 -1
- 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/index.ts +14 -1
- 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/global.ts +1 -3
- package/src/types/application/index.ts +2 -1
- package/src/types/audit/ocsf.ts +1 -0
- package/src/types/branch/index.ts +33 -6
- package/src/types/customAgents.ts +2 -3
- package/src/types/datasource/metadata/index.ts +4 -4
- package/src/types/event/index.ts +1 -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/plugin/evaluation.ts +17 -12
- 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/types/response/IssueSuperblocksResponseBody.ts +6 -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/bytestring.ts +1 -1
- package/src/utils/env.ts +5 -5
- package/src/utils/index.ts +2 -0
- package/src/utils/localNativeBuilderFlags.test.ts +39 -0
- package/src/utils/localNativeBuilderFlags.ts +27 -0
- package/src/utils/page.ts +1 -1
- 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/constants.ts
CHANGED
|
@@ -29,16 +29,13 @@ export const SUPERBLOCKS_LIVE_GIT_BRANCH = 'superblocks/live';
|
|
|
29
29
|
// Baseline branch used after disconnecting from git-backed workflows.
|
|
30
30
|
export const DEFAULT_NON_GIT_BRANCH = 'main';
|
|
31
31
|
export const DEFAULT_BRANCH = DEFAULT_NON_GIT_BRANCH;
|
|
32
|
-
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
/**
|
|
36
|
-
export const
|
|
37
|
-
/**
|
|
38
|
-
export const
|
|
39
|
-
/** The owner of users/<userId> or users/<userId>/<title>. */
|
|
40
|
-
export const userBranchOwnerId = (name: string): string | undefined =>
|
|
41
|
-
isUserBranchName(name) ? name.slice(USER_BRANCH_PREFIX.length).split('/')[0] : undefined;
|
|
32
|
+
/** Lowercase letters, digits and dashes, so a name stays one path segment. */
|
|
33
|
+
export const BRANCH_NAME_PATTERN = /^[a-z0-9][a-z0-9-]{0,39}$/;
|
|
34
|
+
export const isValidBranchName = (name: string): boolean => name !== DEFAULT_BRANCH && BRANCH_NAME_PATTERN.test(name);
|
|
35
|
+
/** Prefixes the lock conflict a dev server gets when its user now holds a different branch of the app. */
|
|
36
|
+
export const LOCK_HELD_ON_OTHER_BRANCH = 'LOCK_HELD_ON_OTHER_BRANCH';
|
|
37
|
+
/** For a pod or the mock, which cannot read branch rows: every branch other than main and the git live branch. */
|
|
38
|
+
export const isFeatureBranchName = (name?: string) => !!name && name !== DEFAULT_BRANCH && name !== SUPERBLOCKS_LIVE_GIT_BRANCH;
|
|
42
39
|
/** main-view: a read-only look at main after the app has branched. */
|
|
43
40
|
export type WorkspaceMode = 'git' | 'single' | 'user-branch' | 'main-view';
|
|
44
41
|
|
|
@@ -59,7 +56,7 @@ export const NULL_AS_STRING = 'null';
|
|
|
59
56
|
|
|
60
57
|
// this is needed due to the migration from ts -> proto objects
|
|
61
58
|
// which have different JSON representations for plugins
|
|
62
|
-
//
|
|
59
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
60
|
export const PLUGIN_ID_TO_PROTO_CLASS: Record<string, any> = {
|
|
64
61
|
cosmosdb: CosmosDbPluginV1.Plugin,
|
|
65
62
|
redis: RedisPluginV1.Plugin,
|
|
@@ -112,7 +109,7 @@ function deserializeRedisDatasourceConfig(serialized: Record<string, unknown>):
|
|
|
112
109
|
|
|
113
110
|
function deserializeRedisActionConfig(serialized: Record<string, unknown>): RedisActionConfiguration {
|
|
114
111
|
const plugin = RedisPluginV1.Plugin.fromJsonString(JSON.stringify(serialized), { ignoreUnknownFields: true });
|
|
115
|
-
//
|
|
112
|
+
// oxlint-disable-next-line @typescript-eslint/no-unused-vars
|
|
116
113
|
const { name, connection, ...rest } = plugin;
|
|
117
114
|
return rest as RedisActionConfiguration;
|
|
118
115
|
}
|
|
@@ -126,7 +123,7 @@ function deserializeSalesforceDatasourceConfig(serialized: Record<string, unknow
|
|
|
126
123
|
|
|
127
124
|
function deserializeSalesforceActionConfig(serialized: Record<string, unknown>): SalesforceActionConfiguration {
|
|
128
125
|
const plugin = SalesforcePluginV1.Plugin.fromJsonString(JSON.stringify(serialized), { ignoreUnknownFields: true });
|
|
129
|
-
//
|
|
126
|
+
// oxlint-disable-next-line @typescript-eslint/no-unused-vars
|
|
130
127
|
const { name, connection, ...rest } = plugin;
|
|
131
128
|
return rest as SalesforceActionConfiguration;
|
|
132
129
|
}
|
|
@@ -139,7 +136,7 @@ function deserializeCosmosDbDatasourceConfig(serialized: Record<string, unknown>
|
|
|
139
136
|
|
|
140
137
|
function deserializeCosmosDbActionConfig(serialized: Record<string, unknown>): CosmosDbActionConfiguration {
|
|
141
138
|
const plugin = CosmosDbPluginV1.Plugin.fromJsonString(JSON.stringify(serialized), { ignoreUnknownFields: true });
|
|
142
|
-
//
|
|
139
|
+
// oxlint-disable-next-line @typescript-eslint/no-unused-vars
|
|
143
140
|
const { name, connection, ...rest } = plugin;
|
|
144
141
|
return rest as CosmosDbActionConfiguration;
|
|
145
142
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// So we are using `!` to assert that `widget.children` is never undefined.
|
|
4
4
|
// Note that `!` does not change the runtime behavior of the code so the code will work the same way as before.
|
|
5
5
|
|
|
6
|
-
/*
|
|
6
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */
|
|
7
7
|
|
|
8
8
|
import type { PageDSL4and5 } from '../../types/index.js';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// So we are using `!` to assert that `widget.children` is never undefined.
|
|
4
4
|
// Note that `!` does not change the runtime behavior of the code so the code will work the same way as before.
|
|
5
5
|
|
|
6
|
-
/*
|
|
6
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */
|
|
7
7
|
|
|
8
8
|
import { cloneDeep } from 'lodash-es';
|
|
9
9
|
import { describe, it, expect } from 'vitest';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// So we are using `!` to assert that `widget.children` is never undefined.
|
|
4
4
|
// Note that `!` does not change the runtime behavior of the code so the code will work the same way as before.
|
|
5
5
|
|
|
6
|
-
/*
|
|
6
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */
|
|
7
7
|
|
|
8
8
|
import { cloneDeep } from 'lodash-es';
|
|
9
9
|
import { describe, test, expect } from 'vitest';
|
|
@@ -10,7 +10,7 @@ import { migrateToSections } from './migrateToSections.js';
|
|
|
10
10
|
|
|
11
11
|
describe('version 7 to version 8', () => {
|
|
12
12
|
test('should migrate a page with a container widget', () => {
|
|
13
|
-
//
|
|
13
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
14
|
const v7 = migrateToSections(migrate5to6(migrate4to5(cloneDeep(containerV4 as any))));
|
|
15
15
|
const v8 = migrateToDimensions(cloneDeep(v7));
|
|
16
16
|
|
|
@@ -21,7 +21,7 @@ describe('version 7 to version 8', () => {
|
|
|
21
21
|
// Check that snapColumns, snapRows have been migrated to gridColumns and don't exist anymore
|
|
22
22
|
// Do this for all children recursively
|
|
23
23
|
|
|
24
|
-
//
|
|
24
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
25
|
const checkWidget = (parent: any, old: any) => {
|
|
26
26
|
if (parent.children) {
|
|
27
27
|
parent.children.forEach((child: WidgetProps7) => {
|
|
@@ -9,7 +9,7 @@ import initialAppV7DSL from '../../utils/pageFixtures/v7/initial_app.js';
|
|
|
9
9
|
import nestedContainers from '../../utils/pageFixtures/v7/nested_containers.js';
|
|
10
10
|
import { migrate7to8 } from './v7to8.js';
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
const getWidgetNameToProperty = (widget: WidgetProps7, widgetTypes: string[], propertyNames: string[], obj: Record<string, any>) => {
|
|
14
14
|
if (widgetTypes.includes(widget.type)) {
|
|
15
15
|
propertyNames.forEach((propertyName) => {
|
|
@@ -80,6 +80,23 @@ describe('MCP Server integration form', () => {
|
|
|
80
80
|
expect(restCheckbox).toBeUndefined();
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
+
test('explains the disabled Connect button only while the token is per user', () => {
|
|
84
|
+
const hint = datasourceFields().find((field) => field.name === 'oauth-per-user-connect-hint');
|
|
85
|
+
const restHint = templateFields(RestApiIntegrationPlugin.datasourceTemplate).find(
|
|
86
|
+
(field) => field.name === 'oauth-per-user-connect-hint'
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
expect(hint?.componentType).toBe(FormComponentType.ALERT);
|
|
90
|
+
expect(hint && 'messageTemplate' in hint ? hint.messageTemplate : undefined).toContain('Share access token across all users');
|
|
91
|
+
// Matches exactly the scope that disables Connect, so the hint and the button agree.
|
|
92
|
+
expect(hint?.display?.show).toEqual({
|
|
93
|
+
authType: [IntegrationAuthType.OAUTH2_CODE],
|
|
94
|
+
'authConfig.tokenScope': [TokenScope.USER]
|
|
95
|
+
});
|
|
96
|
+
// REST API has no Connect button, so it has nothing to explain.
|
|
97
|
+
expect(restHint).toBeUndefined();
|
|
98
|
+
});
|
|
99
|
+
|
|
83
100
|
test('renders the Connect and Revoke buttons for the authorization code flow', () => {
|
|
84
101
|
const fields = datasourceFields();
|
|
85
102
|
const connect = fields.find((field) => field.name === 'oauth-connect-button');
|
|
@@ -1645,6 +1645,22 @@ export const authSections = ({
|
|
|
1645
1645
|
%>`,
|
|
1646
1646
|
type: 'success',
|
|
1647
1647
|
showIcon: true
|
|
1648
|
+
},
|
|
1649
|
+
{
|
|
1650
|
+
label: '',
|
|
1651
|
+
name: 'oauth-per-user-connect-hint',
|
|
1652
|
+
startVersion: startVersion,
|
|
1653
|
+
componentType: FormComponentType.ALERT,
|
|
1654
|
+
messageTemplate: `Each user connects their own ${pluginName} account when they first run this integration in an app, so Connect is off here. To connect one account for all users, check "Share access token across all users".`,
|
|
1655
|
+
type: 'info',
|
|
1656
|
+
showIcon: true,
|
|
1657
|
+
display: {
|
|
1658
|
+
show: {
|
|
1659
|
+
authType: [IntegrationAuthType.OAUTH2_CODE],
|
|
1660
|
+
// Same check that disables Connect in loadButtonSaga, so the hint and the button agree.
|
|
1661
|
+
'authConfig.tokenScope': [TokenScope.USER]
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1648
1664
|
}
|
|
1649
1665
|
],
|
|
1650
1666
|
fieldNamesToHide
|