Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove subject_transform_dest #592

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions jetstream/jsapi_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,8 @@ export interface StreamSource {
* if external is set.
*/
domain?: string;
/**
* Apply a subject transform to sourced messages before doing anything else.
* This option is exclusive of {@link subject_transforms}.
* This feature only supported on 2.10.x and better.
*/
subject_transform_dest?: string;
/**
* Apply a subject transforms to sourced messages before doing anything else.
* This option is exclusive of {@link subject_transform_dest}.
* This feature only supported on 2.10.x and better.
*/
subject_transforms?: SubjectTransformConfig[];
Expand Down Expand Up @@ -574,15 +567,8 @@ export interface StreamSourceInfo {
* A possible error
*/
error?: ApiError;
/**
* Subject transform configuration to sourced messages before doing anything else.
* This option is exclusive of {@link subject_transforms}.
* This feature only supported on 2.10.x and better.
*/
subject_transform_dest?: string;
/**
* Apply a subject transforms to sourced messages before doing anything else.
* This option is exclusive of {@link subject_transform_dest}.
* This feature only supported on 2.10.x and better.
*/
subject_transforms?: SubjectTransformConfig[];
Expand Down
10 changes: 0 additions & 10 deletions jetstream/jsmstream_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,6 @@ export class StreamAPIImpl extends BaseApiClient implements StreamAPI {
context: string,
src: Partial<StreamSource>,
): void {
if (src.subject_transform_dest) {
const { min, ok } = nci.features.get(
Feature.JS_STREAM_SUBJECT_TRANSFORM,
);
if (!ok) {
throw new Error(
`${context} 'subject_transform_dest' requires server ${min}`,
);
}
}
const count = src.subject_transforms?.length || 0;
if (count > 0) {
const { min, ok } = nci.features.get(
Expand Down
4 changes: 2 additions & 2 deletions jetstream/tests/jetstream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4429,7 +4429,7 @@ Deno.test("jetstream - input transform", async () => {
await cleanup(ns, nc);
});

Deno.test("jetstream - source transform", async () => {
Deno.test("jetstream - source transforms", async () => {
const { ns, nc } = await setup(jetstreamServerConf());
if (await notCompatible(ns, nc, "2.10.0")) {
return;
Expand All @@ -4456,7 +4456,7 @@ Deno.test("jetstream - source transform", async () => {
name: "sourced",
storage: StorageType.Memory,
sources: [
{ name: "foo", subject_transform_dest: "foo2.>" },
{ name: "foo", subject_transforms: [{ src: ">", dest: "foo2.>" }] },
{ name: "bar" },
{ name: "baz" },
],
Expand Down
17 changes: 0 additions & 17 deletions jetstream/tests/jsm_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2520,23 +2520,6 @@ Deno.test("jsm - source transforms rejected on old servers", async () => {
"stream mirror 'subject_transforms' requires server 2.10.0",
);

await assertRejects(
async () => {
await jsm.streams.add(
{
name: "n",
storage: StorageType.Memory,
sources: [{
name: "src",
subject_transform_dest: "foo-transformed.>",
}],
},
);
},
Error,
"stream sources 'subject_transform_dest' requires server 2.10.0",
);

await assertRejects(
async () => {
await jsm.streams.add(
Expand Down
Loading