From 2e5e76c02f5d88a936b57665a7e982ec0cb826b0 Mon Sep 17 00:00:00 2001 From: CodeMash Date: Mon, 12 Oct 2026 16:41:58 +0300 Subject: [PATCH] feat(code): drop useSetCodeIntegrationAsDefaultMutation, follow @norbix.ai/ts 4.20.0 Code has no default integration any more (gateway refactoringV2 b2303b4d8): the mutation, its endpoint row and its tag test go; README row updated. Co-Authored-By: Claude Fable 5.1 --- README.md | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- src/hooks/hub/code.ts | 10 ---------- tests/code.test.ts | 6 +----- 5 files changed, 7 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 46768ee..961f6b3 100644 --- a/README.md +++ b/README.md @@ -518,7 +518,7 @@ need `@norbix.ai/ts` 4.19.0. | Area | Hooks | Cache tag | | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | Module switch | `useEnableCodeModuleMutation`, `useDisableCodeModuleMutation` | invalidates `Account`, `Projects`, `Code` | -| Integrations | `useGetCodeIntegrationsQuery`, `useGetCodeIntegrationQuery`, `useSaveCodeIntegrationMutation`, `useDeleteCodeIntegrationMutation`, `useEnableCodeIntegrationMutation`, `useDisableCodeIntegrationMutation`, `useSetCodeIntegrationAsDefaultMutation`, `useTestCodeIntegrationMutation` | provides / invalidates `CodeIntegrations/LIST` and `CodeIntegrations/`; `test` touches nothing | +| Integrations | `useGetCodeIntegrationsQuery`, `useGetCodeIntegrationQuery`, `useSaveCodeIntegrationMutation`, `useDeleteCodeIntegrationMutation`, `useEnableCodeIntegrationMutation`, `useDisableCodeIntegrationMutation`, `useTestCodeIntegrationMutation` | provides / invalidates `CodeIntegrations/LIST` and `CodeIntegrations/`; `test` touches nothing | | Cloud functions | `useGetCodeFunctionsQuery`, `useGetCodeFunctionQualifiersQuery`, `useGetCodeFunctionEventSampleQuery`, `useGetCodeFunctionRunsQuery`, `useInvokeCodeFunctionMutation` | provides `CodeFunctions/LIST`, `CodeFunctions/SAMPLE`, `CodeFunctions/RUNS`; `invoke` touches nothing | ```tsx diff --git a/package-lock.json b/package-lock.json index 246904c..70c5778 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@commitlint/cli": "^21.2.2", "@commitlint/config-conventional": "^21.2.2", "@eslint/js": "^10.0.1", - "@norbix.ai/ts": "^4.19.0", + "@norbix.ai/ts": "^4.20.0", "@reduxjs/toolkit": "^2.12.0", "@semantic-release/commit-analyzer": "^13.0.1", "@semantic-release/github": "^12.0.9", @@ -1490,9 +1490,9 @@ } }, "node_modules/@norbix.ai/ts": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/@norbix.ai/ts/-/ts-4.19.0.tgz", - "integrity": "sha512-9NhFFaclsXMLy5kMNgSr5ZqiR8P/kWwsOWAfWoVy9hlrOiw5ovPsF5ipK4qmOGbVEzEMtKFYIUUkniNyFWEuOQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@norbix.ai/ts/-/ts-4.20.0.tgz", + "integrity": "sha512-zJF56+EBULemMivFGfqpbnUYqqHcYd82hkKu0W1p90LaRghhCJvLrdZL058JABgPq8UMkeNIXNL7Ie/GWkyWOg==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 099d08d..c17dca4 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@commitlint/cli": "^21.2.2", "@commitlint/config-conventional": "^21.2.2", "@eslint/js": "^10.0.1", - "@norbix.ai/ts": "^4.19.0", + "@norbix.ai/ts": "^4.20.0", "@reduxjs/toolkit": "^2.12.0", "@semantic-release/commit-analyzer": "^13.0.1", "@semantic-release/github": "^12.0.9", diff --git a/src/hooks/hub/code.ts b/src/hooks/hub/code.ts index 95ba659..2accb57 100644 --- a/src/hooks/hub/code.ts +++ b/src/hooks/hub/code.ts @@ -32,7 +32,6 @@ export const hubCode = (b: Builder) => { type DeleteIntegration = Fn<'deleteCodeIntegration'>; type EnableIntegration = Fn<'enableCodeIntegration'>; type DisableIntegration = Fn<'disableCodeIntegration'>; - type SetIntegrationAsDefault = Fn<'setCodeIntegrationAsDefault'>; type TestIntegration = Fn<'testCodeIntegration'>; type GetFunctions = Fn<'getCodeFunctions'>; type GetQualifiers = Fn<'getCodeFunctionQualifiers'>; @@ -94,15 +93,6 @@ export const hubCode = (b: Builder) => { invalidatesTags: (_res, _err, arg) => integrationTags(arg), }), - setCodeIntegrationAsDefault: b.mutation< - Result, - Arg - >({ - query: (args) => (norbix) => callHC(norbix).setCodeIntegrationAsDefault(args), - // The default flag moves between integrations: the whole list changes. - invalidatesTags: ['CodeIntegrations'], - }), - testCodeIntegration: b.mutation, Arg>({ query: (args) => (norbix) => callHC(norbix).testCodeIntegration(args), }), diff --git a/tests/code.test.ts b/tests/code.test.ts index afd1aaf..31d8b37 100644 --- a/tests/code.test.ts +++ b/tests/code.test.ts @@ -40,7 +40,6 @@ const CODE: Record = { deleteCodeIntegration: ['mutation', 'deleteCodeIntegration'], enableCodeIntegration: ['mutation', 'enableCodeIntegration'], disableCodeIntegration: ['mutation', 'disableCodeIntegration'], - setCodeIntegrationAsDefault: ['mutation', 'setCodeIntegrationAsDefault'], testCodeIntegration: ['mutation', 'testCodeIntegration'], getCodeFunctions: ['query', 'getCodeFunctions'], getCodeFunctionQualifiers: ['query', 'getCodeFunctionQualifiers'], @@ -127,10 +126,7 @@ describe('hubCode', () => { ]); }); - it('setCodeIntegrationAsDefault invalidates every CodeIntegrations entry; test invalidates nothing', () => { - expect(tagsFor(endpoints['setCodeIntegrationAsDefault']!.invalidatesTags, {})).toEqual([ - 'CodeIntegrations', - ]); + it('test invalidates nothing', () => { expect(endpoints['testCodeIntegration']!.invalidatesTags).toBeUndefined(); });