@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
|
@@ -1,298 +1,317 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { describe, it, expect } from 'vitest';
|
|
1
|
+
import { it, expect } from 'vitest';
|
|
3
2
|
|
|
4
3
|
import { type EvaluationPair, extractJsEvaluationPairsWithTokenizer, LanguagePluginID } from '../types/index.js';
|
|
4
|
+
import { tokenizeJs } from '../types/plugin/js-tokenizer.js';
|
|
5
5
|
import { refactorNameInCode, refactorNameInString, refactorNameInValue, refactorNameInStep } from './refactor.js';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
newName,
|
|
22
|
-
dataTree,
|
|
23
|
-
extractPairs: extractJsEvaluationPairs
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
expect(result).toEqual('return newName;');
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe('refactorNameInString', () => {
|
|
31
|
-
it('should refactor the old name to the new name in the string', async () => {
|
|
32
|
-
const value = 'Hello, {{oldName}}!';
|
|
33
|
-
const oldName = 'oldName';
|
|
34
|
-
const newName = 'newName';
|
|
35
|
-
const dataTree = {
|
|
36
|
-
oldName: {}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const result = await refactorNameInString({
|
|
40
|
-
value,
|
|
41
|
-
oldName,
|
|
42
|
-
newName,
|
|
43
|
-
dataTree,
|
|
44
|
-
extractPairs: extractJsEvaluationPairs
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
expect(result).toEqual('Hello, {{newName}}!');
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
describe('refactorNameInValue', () => {
|
|
52
|
-
it('in object', async () => {
|
|
53
|
-
const oldValue = {
|
|
54
|
-
name: '{{oldName}}',
|
|
55
|
-
age: 30
|
|
56
|
-
};
|
|
57
|
-
const oldName = 'oldName';
|
|
58
|
-
const newName = 'newName';
|
|
59
|
-
const dataTree = {
|
|
60
|
-
oldName: {}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const result = await refactorNameInValue({
|
|
64
|
-
oldValue,
|
|
65
|
-
oldName,
|
|
66
|
-
newName,
|
|
67
|
-
dataTree,
|
|
68
|
-
extractPairs: extractJsEvaluationPairs
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
expect(result).toEqual({
|
|
72
|
-
name: '{{newName}}',
|
|
73
|
-
age: 30
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('in array', async () => {
|
|
79
|
-
const oldValue = ['{{oldName}}', 30];
|
|
80
|
-
const oldName = 'oldName';
|
|
81
|
-
const newName = 'newName';
|
|
82
|
-
const dataTree = {
|
|
83
|
-
oldName: {}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const result = await refactorNameInValue({
|
|
87
|
-
oldValue,
|
|
88
|
-
oldName,
|
|
89
|
-
newName,
|
|
90
|
-
dataTree,
|
|
91
|
-
extractPairs: extractJsEvaluationPairs
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
expect(result).toEqual(['{{newName}}', 30]);
|
|
95
|
-
});
|
|
96
|
-
it('in string', async () => {
|
|
97
|
-
const oldValue = '{{oldName}}';
|
|
98
|
-
const oldName = 'oldName';
|
|
99
|
-
const newName = 'newName';
|
|
100
|
-
const dataTree = {
|
|
101
|
-
oldName: {}
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const result = await refactorNameInValue({
|
|
105
|
-
oldValue,
|
|
106
|
-
oldName,
|
|
107
|
-
newName,
|
|
108
|
-
dataTree,
|
|
109
|
-
extractPairs: extractJsEvaluationPairs
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
expect(result).toEqual('{{newName}}');
|
|
113
|
-
});
|
|
7
|
+
it('Page Scope refactorNameInCode should refactor the old name to the new name in the code', async () => {
|
|
8
|
+
const value = 'return oldName;';
|
|
9
|
+
const oldName = 'oldName';
|
|
10
|
+
const newName = 'newName';
|
|
11
|
+
const dataTree = {
|
|
12
|
+
oldName: {}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const result = await refactorNameInCode({
|
|
16
|
+
value,
|
|
17
|
+
oldName,
|
|
18
|
+
newName,
|
|
19
|
+
dataTree,
|
|
20
|
+
extractPairs: extractJsEvaluationPairs
|
|
114
21
|
});
|
|
115
22
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
expect(result).toEqual('return App.newName;');
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
describe('refactorNameInString', () => {
|
|
140
|
-
it('should refactor the old name to the new name in the string', async () => {
|
|
141
|
-
const value = 'Hello, {{App.oldName}}!';
|
|
142
|
-
const oldName = 'oldName';
|
|
143
|
-
const newName = 'newName';
|
|
144
|
-
const dataTree = {
|
|
145
|
-
oldName: {}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const result = await refactorNameInString({
|
|
149
|
-
value,
|
|
150
|
-
oldName,
|
|
151
|
-
newName,
|
|
152
|
-
dataTree,
|
|
153
|
-
namespace: 'App',
|
|
154
|
-
extractPairs: extractJsEvaluationPairs
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
expect(result).toEqual('Hello, {{App.newName}}!');
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
describe('refactorNameInValue', () => {
|
|
162
|
-
it('in object', async () => {
|
|
163
|
-
const oldValue = {
|
|
164
|
-
name: '{{App.oldName}}',
|
|
165
|
-
age: 30
|
|
166
|
-
};
|
|
167
|
-
const oldName = 'oldName';
|
|
168
|
-
const newName = 'newName';
|
|
169
|
-
const dataTree = {
|
|
170
|
-
oldName: {}
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const result = await refactorNameInValue({
|
|
174
|
-
oldValue,
|
|
175
|
-
oldName,
|
|
176
|
-
newName,
|
|
177
|
-
dataTree,
|
|
178
|
-
namespace: 'App',
|
|
179
|
-
extractPairs: extractJsEvaluationPairs
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
expect(result).toEqual({
|
|
183
|
-
name: '{{App.newName}}',
|
|
184
|
-
age: 30
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
it('in array', async () => {
|
|
190
|
-
const oldValue = ['{{App.oldName}}', 30];
|
|
191
|
-
const oldName = 'oldName';
|
|
192
|
-
const newName = 'newName';
|
|
193
|
-
const dataTree = {
|
|
194
|
-
oldName: {}
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
const result = await refactorNameInValue({
|
|
198
|
-
oldValue,
|
|
199
|
-
oldName,
|
|
200
|
-
newName,
|
|
201
|
-
dataTree,
|
|
202
|
-
namespace: 'App',
|
|
203
|
-
extractPairs: extractJsEvaluationPairs
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
expect(result).toEqual(['{{App.newName}}', 30]);
|
|
207
|
-
});
|
|
208
|
-
it('in string', async () => {
|
|
209
|
-
const oldValue = '{{App.oldName}}';
|
|
210
|
-
const oldName = 'oldName';
|
|
211
|
-
const newName = 'newName';
|
|
212
|
-
const dataTree = {
|
|
213
|
-
oldName: {}
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
const result = await refactorNameInValue({
|
|
217
|
-
oldValue,
|
|
218
|
-
oldName,
|
|
219
|
-
newName,
|
|
220
|
-
dataTree,
|
|
221
|
-
namespace: 'App',
|
|
222
|
-
extractPairs: extractJsEvaluationPairs
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
expect(result).toEqual('{{App.newName}}');
|
|
226
|
-
});
|
|
23
|
+
expect(result).toEqual('return newName;');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('Page Scope refactorNameInString should refactor the old name to the new name in the string', async () => {
|
|
27
|
+
const value = 'Hello, {{oldName}}!';
|
|
28
|
+
const oldName = 'oldName';
|
|
29
|
+
const newName = 'newName';
|
|
30
|
+
const dataTree = {
|
|
31
|
+
oldName: {}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const result = await refactorNameInString({
|
|
35
|
+
value,
|
|
36
|
+
oldName,
|
|
37
|
+
newName,
|
|
38
|
+
dataTree,
|
|
39
|
+
extractPairs: extractJsEvaluationPairs
|
|
227
40
|
});
|
|
228
41
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
42
|
+
expect(result).toEqual('Hello, {{newName}}!');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('Page Scope refactorNameInValue in object', async () => {
|
|
46
|
+
const oldValue = {
|
|
47
|
+
name: '{{oldName}}',
|
|
48
|
+
age: 30
|
|
49
|
+
};
|
|
50
|
+
const oldName = 'oldName';
|
|
51
|
+
const newName = 'newName';
|
|
52
|
+
const dataTree = {
|
|
53
|
+
oldName: {}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const result = await refactorNameInValue({
|
|
57
|
+
oldValue,
|
|
58
|
+
oldName,
|
|
59
|
+
newName,
|
|
60
|
+
dataTree,
|
|
61
|
+
extractPairs: extractJsEvaluationPairs
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
expect(result).toEqual({
|
|
65
|
+
name: '{{newName}}',
|
|
66
|
+
age: 30
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('Page Scope refactorNameInValue in array', async () => {
|
|
71
|
+
const oldValue = ['{{oldName}}', 30];
|
|
72
|
+
const oldName = 'oldName';
|
|
73
|
+
const newName = 'newName';
|
|
74
|
+
const dataTree = {
|
|
75
|
+
oldName: {}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const result = await refactorNameInValue({
|
|
79
|
+
oldValue,
|
|
80
|
+
oldName,
|
|
81
|
+
newName,
|
|
82
|
+
dataTree,
|
|
83
|
+
extractPairs: extractJsEvaluationPairs
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
expect(result).toEqual(['{{newName}}', 30]);
|
|
87
|
+
});
|
|
88
|
+
it('Page Scope refactorNameInValue in string', async () => {
|
|
89
|
+
const oldValue = '{{oldName}}';
|
|
90
|
+
const oldName = 'oldName';
|
|
91
|
+
const newName = 'newName';
|
|
92
|
+
const dataTree = {
|
|
93
|
+
oldName: {}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const result = await refactorNameInValue({
|
|
97
|
+
oldValue,
|
|
98
|
+
oldName,
|
|
99
|
+
newName,
|
|
100
|
+
dataTree,
|
|
101
|
+
extractPairs: extractJsEvaluationPairs
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
expect(result).toEqual('{{newName}}');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('App Scope refactorNameInCode should refactor the old name to the new name in the code', async () => {
|
|
108
|
+
const value = 'return App.oldName;';
|
|
109
|
+
const oldName = 'oldName';
|
|
110
|
+
const newName = 'newName';
|
|
111
|
+
const dataTree = {
|
|
112
|
+
oldName: {}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const result = await refactorNameInCode({
|
|
116
|
+
value,
|
|
117
|
+
oldName,
|
|
118
|
+
newName,
|
|
119
|
+
dataTree,
|
|
120
|
+
namespace: 'App',
|
|
121
|
+
extractPairs: extractJsEvaluationPairs
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
expect(result).toEqual('return App.newName;');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('refactorNameInCode leaves a name inside a regex on the line after a block alone', async () => {
|
|
128
|
+
const value = '{}\n/App.oldName/.test(x)';
|
|
129
|
+
|
|
130
|
+
const result = await refactorNameInCode({
|
|
131
|
+
value,
|
|
132
|
+
oldName: 'oldName',
|
|
133
|
+
newName: 'newName',
|
|
134
|
+
dataTree: { oldName: {} },
|
|
135
|
+
namespace: 'App',
|
|
136
|
+
extractPairs: extractJsEvaluationPairs
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
expect(result).toEqual(value);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it('App Scope refactorNameInString should refactor the old name to the new name in the string', async () => {
|
|
143
|
+
const value = 'Hello, {{App.oldName}}!';
|
|
144
|
+
const oldName = 'oldName';
|
|
145
|
+
const newName = 'newName';
|
|
146
|
+
const dataTree = {
|
|
147
|
+
oldName: {}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const result = await refactorNameInString({
|
|
151
|
+
value,
|
|
152
|
+
oldName,
|
|
153
|
+
newName,
|
|
154
|
+
dataTree,
|
|
155
|
+
namespace: 'App',
|
|
156
|
+
extractPairs: extractJsEvaluationPairs
|
|
295
157
|
});
|
|
158
|
+
|
|
159
|
+
expect(result).toEqual('Hello, {{App.newName}}!');
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it('App Scope refactorNameInValue in object', async () => {
|
|
163
|
+
const oldValue = {
|
|
164
|
+
name: '{{App.oldName}}',
|
|
165
|
+
age: 30
|
|
166
|
+
};
|
|
167
|
+
const oldName = 'oldName';
|
|
168
|
+
const newName = 'newName';
|
|
169
|
+
const dataTree = {
|
|
170
|
+
oldName: {}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const result = await refactorNameInValue({
|
|
174
|
+
oldValue,
|
|
175
|
+
oldName,
|
|
176
|
+
newName,
|
|
177
|
+
dataTree,
|
|
178
|
+
namespace: 'App',
|
|
179
|
+
extractPairs: extractJsEvaluationPairs
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
expect(result).toEqual({
|
|
183
|
+
name: '{{App.newName}}',
|
|
184
|
+
age: 30
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('App Scope refactorNameInValue in array', async () => {
|
|
189
|
+
const oldValue = ['{{App.oldName}}', 30];
|
|
190
|
+
const oldName = 'oldName';
|
|
191
|
+
const newName = 'newName';
|
|
192
|
+
const dataTree = {
|
|
193
|
+
oldName: {}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const result = await refactorNameInValue({
|
|
197
|
+
oldValue,
|
|
198
|
+
oldName,
|
|
199
|
+
newName,
|
|
200
|
+
dataTree,
|
|
201
|
+
namespace: 'App',
|
|
202
|
+
extractPairs: extractJsEvaluationPairs
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
expect(result).toEqual(['{{App.newName}}', 30]);
|
|
206
|
+
});
|
|
207
|
+
it('App Scope refactorNameInValue in string', async () => {
|
|
208
|
+
const oldValue = '{{App.oldName}}';
|
|
209
|
+
const oldName = 'oldName';
|
|
210
|
+
const newName = 'newName';
|
|
211
|
+
const dataTree = {
|
|
212
|
+
oldName: {}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const result = await refactorNameInValue({
|
|
216
|
+
oldValue,
|
|
217
|
+
oldName,
|
|
218
|
+
newName,
|
|
219
|
+
dataTree,
|
|
220
|
+
namespace: 'App',
|
|
221
|
+
extractPairs: extractJsEvaluationPairs
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
expect(result).toEqual('{{App.newName}}');
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it('refactorNameInStep should refactor names in JS steps', async () => {
|
|
228
|
+
const oldName = 'oldName';
|
|
229
|
+
const newName = 'newName';
|
|
230
|
+
const dataTree = {
|
|
231
|
+
oldName: {}
|
|
232
|
+
};
|
|
233
|
+
const configuration = {
|
|
234
|
+
body: 'return {{oldName}};'
|
|
235
|
+
};
|
|
236
|
+
await refactorNameInStep({
|
|
237
|
+
configuration,
|
|
238
|
+
oldName,
|
|
239
|
+
newName,
|
|
240
|
+
dataTree,
|
|
241
|
+
namespace: undefined,
|
|
242
|
+
pluginId: LanguagePluginID.JavaScript,
|
|
243
|
+
extractor: extractJsEvaluationPairs
|
|
244
|
+
});
|
|
245
|
+
expect(configuration.body).toEqual('return {{newName}};');
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
it('refactorNameInStep should refactor names in steps with nested configurations, i.e. Databricks, Kinesis, etc', async () => {
|
|
249
|
+
const oldName = 'oldName';
|
|
250
|
+
const newName = 'newName';
|
|
251
|
+
const dataTree = {
|
|
252
|
+
oldName: {}
|
|
253
|
+
};
|
|
254
|
+
const configuration = {
|
|
255
|
+
get: {
|
|
256
|
+
limit: 10,
|
|
257
|
+
pollingCooldownMs: 1000,
|
|
258
|
+
shardIteratorType: 'SHARD_ITERATOR_TYPE_LATEST',
|
|
259
|
+
streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
|
|
260
|
+
},
|
|
261
|
+
put: {
|
|
262
|
+
data: '"test": {{oldName.text}}',
|
|
263
|
+
streamName: '{{oldName.text}}',
|
|
264
|
+
streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
|
|
265
|
+
},
|
|
266
|
+
operationType: 'OPERATION_TYPE_PUT'
|
|
267
|
+
};
|
|
268
|
+
await refactorNameInStep({
|
|
269
|
+
configuration,
|
|
270
|
+
oldName,
|
|
271
|
+
newName,
|
|
272
|
+
dataTree,
|
|
273
|
+
namespace: undefined,
|
|
274
|
+
pluginId: '12345',
|
|
275
|
+
extractor: extractJsEvaluationPairs
|
|
276
|
+
});
|
|
277
|
+
expect(configuration).toEqual({
|
|
278
|
+
get: {
|
|
279
|
+
limit: 10,
|
|
280
|
+
pollingCooldownMs: 1000,
|
|
281
|
+
shardIteratorType: 'SHARD_ITERATOR_TYPE_LATEST',
|
|
282
|
+
streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
|
|
283
|
+
},
|
|
284
|
+
put: {
|
|
285
|
+
data: '"test": {{newName.text}}',
|
|
286
|
+
streamName: '{{newName.text}}',
|
|
287
|
+
streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
|
|
288
|
+
},
|
|
289
|
+
operationType: 'OPERATION_TYPE_PUT'
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it.each([
|
|
294
|
+
// Syntax the old tokenizer also read: results must not change.
|
|
295
|
+
['return oldName?.value ?? fallback;', 'return newName?.value ?? fallback;'],
|
|
296
|
+
['return other?.oldName;', 'return other?.oldName;'],
|
|
297
|
+
['x ??= oldName.value; y ||= oldName; z &&= oldName;', 'x ??= newName.value; y ||= newName; z &&= newName;'],
|
|
298
|
+
['class Counter { count = oldName.value; static label = "n"; }', 'class Counter { count = newName.value; static label = "n"; }'],
|
|
299
|
+
['return `${oldName.value}-${other}`;', 'return `${newName.value}-${other}`;'],
|
|
300
|
+
['return oldName.value / 2 + /old/.test(oldName.text);', 'return newName.value / 2 + /old/.test(newName.text);'],
|
|
301
|
+
// Syntax the old tokenizer rejected, which left the code unrenamed.
|
|
302
|
+
['return 1_000 + oldName.value;', 'return 1_000 + newName.value;'],
|
|
303
|
+
['return BigInt(oldName.value) * 10n;', 'return BigInt(newName.value) * 10n;'],
|
|
304
|
+
['class Counter { #count = oldName.value; }', 'class Counter { #count = newName.value; }']
|
|
305
|
+
])('refactorNameInCode renames page scope references in %s', async (value, expected) => {
|
|
306
|
+
const result = await refactorNameInCode({
|
|
307
|
+
value,
|
|
308
|
+
oldName: 'oldName',
|
|
309
|
+
newName: 'newName',
|
|
310
|
+
dataTree: { oldName: {} },
|
|
311
|
+
extractPairs: extractJsEvaluationPairs
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
expect(result).toEqual(expected);
|
|
296
315
|
});
|
|
297
316
|
|
|
298
317
|
async function extractJsEvaluationPairs(
|
|
@@ -301,5 +320,5 @@ async function extractJsEvaluationPairs(
|
|
|
301
320
|
dataTree: Record<Exclude<string, 'API' | 'WIDGETS'>, unknown>,
|
|
302
321
|
namespacedEntitiesToExtract?: Record<string, Set<string>>
|
|
303
322
|
): Promise<EvaluationPair[]> {
|
|
304
|
-
return extractJsEvaluationPairsWithTokenizer(jsSnippet, entitiesToExtract, dataTree,
|
|
323
|
+
return extractJsEvaluationPairsWithTokenizer(jsSnippet, entitiesToExtract, dataTree, tokenizeJs, namespacedEntitiesToExtract);
|
|
305
324
|
}
|
|
@@ -36,7 +36,7 @@ function escapeChar(char: string): string {
|
|
|
36
36
|
// * surrogate code points (U+D800 through U+DFFF), which should only match when unpaired, which is are actually invalid in unicode, but RFC 8259 suggests to escape them when they appear because of errors
|
|
37
37
|
// We use the `u` flag to match surrogates only when they are unpaired
|
|
38
38
|
// Note: this is one of the rare occasions where we do want control characters in a regex, so we disable the eslint rule
|
|
39
|
-
//
|
|
39
|
+
// oxlint-disable-next-line no-control-regex
|
|
40
40
|
const charsToEscape = /[\u0000-\u001f\ud800-\udfff"\\]/gu;
|
|
41
41
|
|
|
42
42
|
function JSONStringifyString(str: string) {
|
|
@@ -63,7 +63,7 @@ function compareObjectKeys(a: string, b: string): number {
|
|
|
63
63
|
export function stableJSONStringify_portable(data: unknown): string | undefined {
|
|
64
64
|
// track the objects being serialized, so that we don't get into an infinite cycle
|
|
65
65
|
const seen = new Set<unknown>();
|
|
66
|
-
//
|
|
66
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
67
|
return (function stringify(node: any) {
|
|
68
68
|
if (typeof node?.toJSON === 'function') {
|
|
69
69
|
node = node.toJSON();
|
package/src/socket/protocol.ts
CHANGED
|
@@ -154,9 +154,14 @@ export interface ServerMethods {
|
|
|
154
154
|
>;
|
|
155
155
|
/** Id of the active chat session, created if the app has none yet. Reads no messages. */
|
|
156
156
|
resolveBuilderBinding: ServerMethodSchema<
|
|
157
|
-
{ applicationId: string; branchName: string; preferredHarness: 'clark' | 'codex' },
|
|
157
|
+
{ applicationId: string; branchName: string; preferredHarness: 'clark' | 'codex' | 'claude_code' },
|
|
158
158
|
import('../types/ai/index.js').AiBuilderBinding
|
|
159
159
|
>;
|
|
160
|
+
/** Workspace placement for an app branch from the primary chat's existing binding. Creates nothing. */
|
|
161
|
+
resolveWorkspacePlacement: ServerMethodSchema<
|
|
162
|
+
{ applicationId: string; branchName: string },
|
|
163
|
+
import('../types/ai/index.js').WorkspaceBinding
|
|
164
|
+
>;
|
|
160
165
|
saveBuilderSession: ServerMethodSchema<
|
|
161
166
|
{ applicationId: string; branchName: string; chatSessionId: string; runtimeSessionId: string; nativeSessionId: string },
|
|
162
167
|
void
|
package/src/socket/socket.ts
CHANGED
|
@@ -248,7 +248,7 @@ export class ISocket<ImplementedMethods, CallableMethods, RequestContext extends
|
|
|
248
248
|
this.clearPendingRequestState(message.response.id);
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
|
-
//
|
|
251
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
252
252
|
responseHandler.resolve(message.response.payload as any);
|
|
253
253
|
this.clearPendingRequestState(message.response.id);
|
|
254
254
|
} else {
|
|
@@ -500,7 +500,7 @@ export function createISocketClient<CallableMethods, ImplementedMethods, Request
|
|
|
500
500
|
return {
|
|
501
501
|
close: (reason?: string) => socket.close(reason),
|
|
502
502
|
closeAndRejectPendingRequests: (reason?: string) => socket.closeAndRejectPendingRequests(reason),
|
|
503
|
-
//
|
|
503
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
504
504
|
call: createIsocketProxy(socket, undefined) as any,
|
|
505
505
|
requestWithTracing: <Params, Result>(
|
|
506
506
|
method: string,
|
package/src/socket/types.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type MethodHandler<Params, Result, PeerMethods, RequestContext> = (
|
|
|
12
12
|
) => Promise<Result>;
|
|
13
13
|
|
|
14
14
|
// A generic middleware is a method handler that can be chained with any other method handler, so it uses `any` for the params and result types
|
|
15
|
-
//
|
|
15
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
export type GenericMiddleware<PeerMethods, RequestContext> = MethodHandler<any, any, PeerMethods, RequestContext>;
|
|
17
17
|
|
|
18
18
|
type NonEmptyArray<T> = [...T[], T];
|
|
@@ -12,7 +12,7 @@ import { sanitizeError } from './errorSanitizer.js';
|
|
|
12
12
|
export function traceMethod(className: string, methodName: string, descriptor: PropertyDescriptor, tracer: Tracer): PropertyDescriptor {
|
|
13
13
|
const originalMethod = descriptor.value;
|
|
14
14
|
|
|
15
|
-
//
|
|
15
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
descriptor.value = function (...args: any[]) {
|
|
17
17
|
// Potentially, we can pass this from tracing middleware to req and then to ActionHandler
|
|
18
18
|
const parentSpan = trace.getActiveSpan() as Span | undefined;
|