@remit/backend 0.0.37 → 0.0.38
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import { describe, it } from "node:test";
|
|
3
|
-
import type { UpdateFilterInput } from "@remit/
|
|
3
|
+
import type { UpdateFilterInput as UpdateFilterRequestBody } from "@remit/api-openapi-types";
|
|
4
4
|
import { FilterScope, FilterState } from "@remit/domain-enums";
|
|
5
5
|
import {
|
|
6
6
|
pickFilterUpdate,
|
|
@@ -35,7 +35,7 @@ describe("pickFilterUpdate", () => {
|
|
|
35
35
|
ruleChangedAt: 999,
|
|
36
36
|
filterId: "sneaky",
|
|
37
37
|
};
|
|
38
|
-
const patch = pickFilterUpdate(raw as Partial<
|
|
38
|
+
const patch = pickFilterUpdate(raw as Partial<UpdateFilterRequestBody>);
|
|
39
39
|
assert.deepEqual(patch, { name: "Receipts" });
|
|
40
40
|
});
|
|
41
41
|
});
|
package/src/handlers/filter.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
CreateFilterInput,
|
|
3
3
|
FilterResponse,
|
|
4
|
+
UpdateFilterInput as UpdateFilterRequestBody,
|
|
4
5
|
} from "@remit/api-openapi-types";
|
|
5
6
|
import type { FilterItem, UpdateFilterInput } from "@remit/data-ports";
|
|
6
7
|
import { BadRequestError } from "@remit/data-ports/errors";
|
|
@@ -93,19 +94,9 @@ export const deriveFilterTtl = (
|
|
|
93
94
|
* dropped. `scope`/`expiresAt` land here as the caller sent them; a patch that
|
|
94
95
|
* touches either still needs `resolveFilterScopeExpiry` to merge them against
|
|
95
96
|
* the stored row and derive `ttl`/`state` before this reaches the repo.
|
|
96
|
-
*
|
|
97
|
-
* Typed against the internal `@remit/data-ports` `UpdateFilterInput`, not the
|
|
98
|
-
* generated `@remit/api-openapi-types` one: that package publishes separately
|
|
99
|
-
* from this repo, so a PR that both widens the TypeSpec model and reads the
|
|
100
|
-
* new field in the same change would typecheck in-tree (fresh local codegen)
|
|
101
|
-
* but fail `check-consumer-typecheck`/`release:dry-run`, which resolve
|
|
102
|
-
* generated `@remit/*` packages off the registry, not the local `build/`
|
|
103
|
-
* output. The data-ports shape carries every field this reads regardless —
|
|
104
|
-
* it derives from the full `Filter` row, which has never gated `scope` or
|
|
105
|
-
* `expiresAt` behind an API-visibility distinction.
|
|
106
97
|
*/
|
|
107
98
|
export const pickFilterUpdate = (
|
|
108
|
-
body: Partial<
|
|
99
|
+
body: Partial<UpdateFilterRequestBody>,
|
|
109
100
|
): Partial<UpdateFilterInput> => {
|
|
110
101
|
const patch: Partial<UpdateFilterInput> = {};
|
|
111
102
|
if (Object.hasOwn(body, "name")) patch.name = body.name;
|
|
@@ -368,7 +359,7 @@ export const FilterDetailOperations: Record<
|
|
|
368
359
|
assertAccountOwnership(account, accountConfigId, "act");
|
|
369
360
|
|
|
370
361
|
const { filter } = client;
|
|
371
|
-
const patch = pickFilterUpdate(body as Partial<
|
|
362
|
+
const patch = pickFilterUpdate(body as Partial<UpdateFilterRequestBody>);
|
|
372
363
|
const touchesScopeOrExpiry =
|
|
373
364
|
Object.hasOwn(patch, "scope") || Object.hasOwn(patch, "expiresAt");
|
|
374
365
|
const resolvedPatch: Partial<UpdateFilterInput> = touchesScopeOrExpiry
|
package/src/service/filter.ts
CHANGED
|
@@ -28,10 +28,7 @@ const build = (): BuildFilterAnchor => {
|
|
|
28
28
|
const embedder = buildEmbeddingServiceFromEnv();
|
|
29
29
|
const store = buildVectorStoreFromEnv(embedder.dimensions);
|
|
30
30
|
return (accountConfigId, anchorMessageId) =>
|
|
31
|
-
buildMessageAnchor(
|
|
32
|
-
{ store, embedder },
|
|
33
|
-
{ accountConfigId, anchorMessageId },
|
|
34
|
-
);
|
|
31
|
+
buildMessageAnchor({ store }, { accountConfigId, anchorMessageId });
|
|
35
32
|
};
|
|
36
33
|
|
|
37
34
|
export const buildFilterAnchor: BuildFilterAnchor = (
|
package/src/service/organize.ts
CHANGED
|
@@ -341,10 +341,7 @@ const buildSemanticFromEnv = (): OrganizeSemanticDeps => {
|
|
|
341
341
|
const store = buildVectorStoreFromEnv(embedder.dimensions);
|
|
342
342
|
cachedSemantic = {
|
|
343
343
|
buildAnchor: (accountConfigId, anchorMessageId) =>
|
|
344
|
-
buildMessageAnchor(
|
|
345
|
-
{ store, embedder },
|
|
346
|
-
{ accountConfigId, anchorMessageId },
|
|
347
|
-
),
|
|
344
|
+
buildMessageAnchor({ store }, { accountConfigId, anchorMessageId }),
|
|
348
345
|
vectorStore: store,
|
|
349
346
|
};
|
|
350
347
|
return cachedSemantic;
|