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

change(core|obj): move SHA256 to objectstore module #157

Merged
merged 1 commit into from
Dec 2, 2024
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
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-45",
"version": "3.0.0-46",
"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-45",
"version": "3.0.0-46",
"files": [
"lib/",
"LICENSE",
Expand Down
2 changes: 0 additions & 2 deletions core/src/internal_mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ export { isIPV4OrHostname, Servers } from "./servers.ts";

export { Base64Codec, Base64UrlCodec, Base64UrlPaddedCodec } from "./base64.ts";

export { SHA256 } from "./sha256.ts";

export { wsconnect, wsUrlParseFn } from "./ws_transport.ts";

export {
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-45";
export const version = "3.0.0-46";
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-32",
"version": "3.0.0-33",
"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-45"
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-46"
}
}
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-45",
"@nats-io/nats-core/internal": "jsr:@nats-io/nats-core@~3.0.0-45/internal",
"@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",
"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-32",
"version": "3.0.0-33",
"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-45"
"@nats-io/nats-core": "3.0.0-46"
},
"devDependencies": {
"@types/node": "^22.7.6",
Expand Down
4 changes: 2 additions & 2 deletions kv/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"test": "deno test -A --parallel --reload --quiet tests/ --import-map=import_map.json"
},
"imports": {
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-45",
"@nats-io/jetstream": "jsr:@nats-io/jetstream@~3.0.0-32"
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-46",
"@nats-io/jetstream": "jsr:@nats-io/jetstream@~3.0.0-33"
}
}
8 changes: 4 additions & 4 deletions kv/import_map.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"imports": {
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-45",
"@nats-io/nats-core/internal": "jsr:@nats-io/nats-core@~3.0.0-45/internal",
"@nats-io/jetstream": "jsr:@nats-io/jetstream@~3.0.0-32",
"@nats-io/jetstream/internal": "jsr:@nats-io/jetstream@~3.0.0-32/internal",
"@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/jetstream": "jsr:@nats-io/jetstream@~3.0.0-33",
"@nats-io/jetstream/internal": "jsr:@nats-io/jetstream@~3.0.0-33/internal",
"test_helpers": "../test_helpers/mod.ts",
"@nats-io/nkeys": "jsr:@nats-io/nkeys@~2.0.0-3",
"@nats-io/nuid": "jsr:@nats-io/nuid@~2.0.1-2",
Expand Down
4 changes: 2 additions & 2 deletions kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
},
"description": "kv library - this library implements all the base functionality for NATS KV javascript clients",
"dependencies": {
"@nats-io/jetstream": "3.0.0-32",
"@nats-io/nats-core": "3.0.0-45"
"@nats-io/jetstream": "3.0.0-33",
"@nats-io/nats-core": "3.0.0-46"
},
"devDependencies": {
"@types/node": "^22.7.6",
Expand Down
1 change: 1 addition & 0 deletions migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ these modules for cross-runtime consumption.
- RequestStrategy "Jitter" is now called "stall" to adopt the term used by new
implementations in other clients and the RequestStrategy enum is now a type
alias to simple strings "timer", "count", "stall", "sentinel".
- `SHA256` a support type for object store has been moved to @nats-io/obj

## Changes in JetStream

Expand Down
6 changes: 3 additions & 3 deletions obj/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nats-io/obj",
"version": "3.0.0-27",
"version": "3.0.0-28",
"exports": {
".": "./src/mod.ts",
"./internal": "./src/internal_mod.ts"
Expand Down Expand Up @@ -33,7 +33,7 @@
"test": "deno test -A --parallel --reload --quiet tests/ --import-map=import_map.json"
},
"imports": {
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-45",
"@nats-io/jetstream": "jsr:@nats-io/jetstream@~3.0.0-32"
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-46",
"@nats-io/jetstream": "jsr:@nats-io/jetstream@~3.0.0-33"
}
}
8 changes: 4 additions & 4 deletions obj/import_map.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"imports": {
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-45",
"@nats-io/nats-core/internal": "jsr:@nats-io/nats-core@~3.0.0-45/internal",
"@nats-io/jetstream": "jsr:@nats-io/jetstream@~3.0.0-32",
"@nats-io/jetstream/internal": "jsr:@nats-io/jetstream@~3.0.0-32/internal",
"@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/jetstream": "jsr:@nats-io/jetstream@~3.0.0-33",
"@nats-io/jetstream/internal": "jsr:@nats-io/jetstream@~3.0.0-33/internal",
"test_helpers": "../test_helpers/mod.ts",
"@nats-io/nkeys": "jsr:@nats-io/nkeys@~2.0.0-3",
"@nats-io/nuid": "jsr:@nats-io/nuid@~2.0.1-2",
Expand Down
6 changes: 3 additions & 3 deletions obj/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nats-io/obj",
"version": "3.0.0-27",
"version": "3.0.0-28",
"files": [
"lib/",
"LICENSE",
Expand Down Expand Up @@ -34,8 +34,8 @@
},
"description": "obj library - this library implements all the base functionality for NATS objectstore for javascript clients",
"dependencies": {
"@nats-io/jetstream": "3.0.0-32",
"@nats-io/nats-core": "3.0.0-45"
"@nats-io/jetstream": "3.0.0-33",
"@nats-io/nats-core": "3.0.0-46"
},
"devDependencies": {
"@types/node": "^22.7.6",
Expand Down
2 changes: 2 additions & 0 deletions obj/src/internal_mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ export type {
export { StorageType } from "./types.ts";

export { Objm } from "./objectstore.ts";

export { SHA256, sha256 } from "./sha256.ts";
2 changes: 1 addition & 1 deletion obj/src/objectstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
MsgHdrsImpl,
nuid,
QueuedIteratorImpl,
SHA256,
} from "@nats-io/nats-core/internal";

import type {
Expand Down Expand Up @@ -70,6 +69,7 @@ import type {
ObjectStoreStatus,
ObjectWatchInfo,
} from "./types.ts";
import { SHA256 } from "./sha256.ts";

export const osPrefix = "OBJ_";
export const digestType = "SHA-256=";
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion obj/tests/objectstore_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import {
headers,
nanos,
nuid,
SHA256,
} from "@nats-io/nats-core/internal";
import type { NatsConnectionImpl } from "@nats-io/nats-core/internal";
import type { ObjectInfo, ObjectStoreMeta } from "../src/types.ts";
import { jetstreamManager, StorageType } from "@nats-io/jetstream";
import { equals } from "https://deno.land/[email protected]/bytes/mod.ts";
import { digestType, Objm } from "../src/objectstore.ts";
import { SHA256 } from "../src/sha256.ts";

function readableStreamFrom(data: Uint8Array): ReadableStream<Uint8Array> {
return new ReadableStream<Uint8Array>({
Expand Down
2 changes: 1 addition & 1 deletion services/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"test": "deno test -A --parallel --reload --quiet tests/ --import-map=import_map.json"
},
"imports": {
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-45"
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-46"
}
}
4 changes: 2 additions & 2 deletions services/import_map.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"imports": {
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-45",
"@nats-io/nats-core/internal": "jsr:@nats-io/nats-core@~3.0.0-45/internal",
"@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",
"test_helpers": "../test_helpers/mod.ts",
"@nats-io/nkeys": "jsr:@nats-io/nkeys@~2.0.0-3",
"@nats-io/nuid": "jsr:@nats-io/nuid@~2.0.1-2",
Expand Down
2 changes: 1 addition & 1 deletion services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"description": "services library - this library implements all the base functionality for NATS services for javascript clients",
"dependencies": {
"@nats-io/nats-core": "3.0.0-45"
"@nats-io/nats-core": "3.0.0-46"
},
"devDependencies": {
"@types/node": "^22.7.6",
Expand Down
2 changes: 1 addition & 1 deletion transport-deno/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"imports": {
"@std/io": "jsr:@std/[email protected]",
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-45",
"@nats-io/nats-core": "jsr:@nats-io/nats-core@~3.0.0-46",
"@nats-io/nkeys": "jsr:@nats-io/nkeys@~2.0.0-3",
"@nats-io/nuid": "jsr:@nats-io/nuid@~2.0.1-2"
}
Expand Down
8 changes: 4 additions & 4 deletions transport-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nats-io/transport-node",
"version": "3.0.0-30",
"version": "3.0.0-31",
"description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system",
"keywords": [
"nats",
Expand Down Expand Up @@ -54,7 +54,7 @@
"node": ">= 18.0.0"
},
"dependencies": {
"@nats-io/nats-core": "3.0.0-45",
"@nats-io/nats-core": "3.0.0-46",
"@nats-io/nkeys": "2.0.0-3",
"@nats-io/nuid": "2.0.1-2"
},
Expand All @@ -63,8 +63,8 @@
"minimist": "^1.2.8",
"shx": "^0.3.3",
"typescript": "5.6.3",
"@nats-io/jetstream": "3.0.0-32",
"@nats-io/jetstream": "3.0.0-33",
"@nats-io/kv": "3.0.0-26",
"@nats-io/obj": "3.0.0-27"
"@nats-io/obj": "3.0.0-28"
}
}
2 changes: 1 addition & 1 deletion transport-node/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-30";
export const version = "3.0.0-31";