Skip to content

Commit

Permalink
feat(jetstream): changed "interfaces" into "types" (#159)
Browse files Browse the repository at this point in the history
change(jetstream): JetStreamManager.streams.add() changed its type to be a Partial<StreamConfig> with a required name property.

Signed-off-by: Alberto Ricart <[email protected]>
  • Loading branch information
aricart authored Dec 5, 2024
1 parent 9add50b commit cd48c79
Show file tree
Hide file tree
Showing 28 changed files with 202 additions and 273 deletions.
2 changes: 1 addition & 1 deletion core/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nats-io/nats-core",
"version": "3.0.0-46",
"version": "3.0.0-47",
"exports": {
".": "./src/mod.ts",
"./internal": "./src/internal_mod.ts"
Expand Down
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nats-io/nats-core",
"version": "3.0.0-46",
"version": "3.0.0-47",
"files": [
"lib/",
"LICENSE",
Expand Down
2 changes: 2 additions & 0 deletions core/src/internal_mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ export type {
Delay,
ErrorResult,
Perf,
Prettify,
Result,
Timeout,
ValueResult,
WithRequired,
} from "./util.ts";
export {
backoff,
Expand Down
12 changes: 12 additions & 0 deletions core/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ import { TD } from "./encoders.ts";
import type { Nanos } from "./core.ts";
import { TimeoutError } from "./errors.ts";

/**
* Allows derived type structures to show through
*/
export type Prettify<T> = {
[K in keyof T]: T[K];
};

/**
* WithRequired is a utility Type allows a type to specify required fields
*/
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };

export type ValueResult<T> = {
isError: false;
value: T;
Expand Down
2 changes: 1 addition & 1 deletion core/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// This file is generated - do not edit
export const version = "3.0.0-46";
export const version = "3.0.0-47";
4 changes: 2 additions & 2 deletions jetstream/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nats-io/jetstream",
"version": "3.0.0-33",
"version": "3.0.0-34",
"exports": {
".": "./src/mod.ts",
"./internal": "./src/internal_mod.ts"
Expand Down Expand Up @@ -33,6 +33,6 @@
"test": "deno test -A --parallel --reload --trace-leaks --quiet tests/ --import-map=import_map.json"
},
"imports": {
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-46"
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-47"
}
}
4 changes: 2 additions & 2 deletions jetstream/import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"imports": {
"@nats-io/nkeys": "jsr:@nats-io/nkeys@~2.0.0-3",
"@nats-io/nuid": "jsr:@nats-io/nuid@~2.0.1-2",
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-46",
"@nats-io/nats-core/internal": "jsr:@nats-io/nats-core@~3.0.0-46/internal",
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-47",
"@nats-io/nats-core/internal": "jsr:@nats-io/nats-core@~3.0.0-47/internal",
"test_helpers": "../test_helpers/mod.ts",
"@std/io": "jsr:@std/[email protected]"
}
Expand Down
4 changes: 2 additions & 2 deletions jetstream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nats-io/jetstream",
"version": "3.0.0-33",
"version": "3.0.0-34",
"files": [
"lib/",
"LICENSE",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"description": "jetstream library - this library implements all the base functionality for NATS JetStream for javascript clients",
"dependencies": {
"@nats-io/nats-core": "3.0.0-46"
"@nats-io/nats-core": "3.0.0-47"
},
"devDependencies": {
"@types/node": "^22.7.6",
Expand Down
Loading

0 comments on commit cd48c79

Please sign in to comment.