@remit/data-ports 0.0.16 → 0.0.18
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 +1 -1
- package/src/types.ts +7 -3
- package/src/update-manifest.test.ts +30 -0
- package/src/update-manifest.ts +6 -0
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -500,10 +500,14 @@ export type CreateFilterInput = Omit<
|
|
|
500
500
|
};
|
|
501
501
|
|
|
502
502
|
// ruleChangedAt is never client-supplied: FilterService derives it, bumping
|
|
503
|
-
// only when
|
|
504
|
-
// Decision 3.2) — a cosmetic `name` rename must
|
|
503
|
+
// only when the predicate, the action, scope, or expiresAt is present in the
|
|
504
|
+
// update (RFC 034 Decision 3.2, reader #266) — a cosmetic `name` rename must
|
|
505
|
+
// not move it. `scope` is updatable here (reader #266): the handler resolves
|
|
506
|
+
// the merged scope/expiresAt/ttl/state before calling through to the repo, so
|
|
507
|
+
// this type must carry `scope` as a valid key, unlike the API-facing
|
|
508
|
+
// `UpdateFilterInput` for that same reason.
|
|
505
509
|
export type UpdateFilterInput = Partial<
|
|
506
|
-
Omit<CreateFilterInput, "accountConfigId"
|
|
510
|
+
Omit<CreateFilterInput, "accountConfigId">
|
|
507
511
|
>;
|
|
508
512
|
|
|
509
513
|
export type CreateFilterAnchorInput = Omit<
|
|
@@ -97,4 +97,34 @@ describe("UpdateManifestSchema", () => {
|
|
|
97
97
|
const { summary, ...rest } = GOOD_MANIFEST;
|
|
98
98
|
assert.throws(() => UpdateManifestSchema.parse(rest));
|
|
99
99
|
});
|
|
100
|
+
|
|
101
|
+
it("accepts a non-negative integer schemaVersion", () => {
|
|
102
|
+
const withSchema = { ...GOOD_MANIFEST, schemaVersion: 9 };
|
|
103
|
+
assert.deepEqual(UpdateManifestSchema.parse(withSchema), withSchema);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("accepts a manifest without a schemaVersion", () => {
|
|
107
|
+
assert.equal(
|
|
108
|
+
UpdateManifestSchema.parse(GOOD_MANIFEST).schemaVersion,
|
|
109
|
+
undefined,
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("rejects a non-integer schemaVersion", () => {
|
|
114
|
+
assert.throws(() =>
|
|
115
|
+
UpdateManifestSchema.parse({ ...GOOD_MANIFEST, schemaVersion: 9.5 }),
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("rejects a negative schemaVersion", () => {
|
|
120
|
+
assert.throws(() =>
|
|
121
|
+
UpdateManifestSchema.parse({ ...GOOD_MANIFEST, schemaVersion: -1 }),
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("rejects a schemaVersion that is not a number", () => {
|
|
126
|
+
assert.throws(() =>
|
|
127
|
+
UpdateManifestSchema.parse({ ...GOOD_MANIFEST, schemaVersion: "9" }),
|
|
128
|
+
);
|
|
129
|
+
});
|
|
100
130
|
});
|
package/src/update-manifest.ts
CHANGED
|
@@ -13,6 +13,12 @@ export const UpdateManifestSchema = z.object({
|
|
|
13
13
|
message: "releaseNotesUrl must be an https:// URL",
|
|
14
14
|
}),
|
|
15
15
|
registry: z.string().min(1),
|
|
16
|
+
// The highest schema migration the release applies, as a count of the
|
|
17
|
+
// migrations shipped at that release. The updater compares it against the
|
|
18
|
+
// running instance's version to tell whether installing this release runs a
|
|
19
|
+
// migration. Optional so a manifest published before this field validates and
|
|
20
|
+
// reads as an unknown schema version rather than an error.
|
|
21
|
+
schemaVersion: z.number().int().nonnegative().optional(),
|
|
16
22
|
});
|
|
17
23
|
|
|
18
24
|
export type UpdateManifest = z.infer<typeof UpdateManifestSchema>;
|