@atcute/jetstream 1.1.2 → 2.0.0

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,7 +1,6 @@
1
1
  {
2
- "type": "module",
3
2
  "name": "@atcute/jetstream",
4
- "version": "1.1.2",
3
+ "version": "2.0.0",
5
4
  "description": "lightweight and cute Jetstream subscriber for AT Protocol",
6
5
  "license": "0BSD",
7
6
  "repository": {
@@ -12,27 +11,29 @@
12
11
  "dist/",
13
12
  "lib/",
14
13
  "!lib/**/*.bench.ts",
15
- "!lib/**/*.test.ts"
14
+ "!lib/**/*.test.ts",
15
+ "!dist/**/*.{test,bench}.*"
16
16
  ],
17
+ "type": "module",
17
18
  "exports": {
18
19
  ".": "./dist/index.js"
19
20
  },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
20
24
  "dependencies": {
21
- "@badrap/valita": "^0.4.6",
22
25
  "@mary-ext/event-iterator": "^1.0.0",
23
- "@mary-ext/simple-event-emitter": "^1.0.0",
24
- "partysocket": "^1.1.5",
26
+ "@mary-ext/simple-event-emitter": "^1.0.1",
27
+ "partysocket": "^1.1.18",
25
28
  "type-fest": "^4.41.0",
26
- "yocto-queue": "^1.2.1",
27
- "@atcute/lexicons": "^1.2.2"
29
+ "valibot": "^1.4.0",
30
+ "@atcute/lexicons": "^2.0.0"
28
31
  },
29
- "devDependencies": {
30
- "@vitest/coverage-v8": "^3.2.4",
31
- "vitest": "^3.2.4"
32
+ "peerDependencies": {
33
+ "@atcute/lexicons": "^2.0.0"
32
34
  },
33
35
  "scripts": {
34
- "build": "tsc --project tsconfig.build.json",
35
- "test": "vitest run --coverage",
36
+ "build": "tsgo",
36
37
  "prepublish": "rm -rf dist; pnpm run build"
37
38
  }
38
39
  }
package/dist/types.d.ts DELETED
@@ -1,61 +0,0 @@
1
- import type { Cid, Datetime, Did, Handle, Nsid, RecordKey, Tid } from '@atcute/lexicons/syntax';
2
- interface BaseCommit {
3
- rev: Tid;
4
- collection: Nsid;
5
- rkey: RecordKey;
6
- }
7
- export interface CreateCommit extends BaseCommit {
8
- operation: 'create';
9
- cid: Cid;
10
- record: unknown;
11
- }
12
- export interface UpdateCommit extends BaseCommit {
13
- operation: 'update';
14
- cid: Cid;
15
- record: unknown;
16
- }
17
- export interface DeleteCommit extends BaseCommit {
18
- operation: 'delete';
19
- }
20
- export type CommitOperation = CreateCommit | UpdateCommit | DeleteCommit;
21
- interface BaseEvent {
22
- did: Did;
23
- time_us: number;
24
- }
25
- export interface CommitEvent extends BaseEvent {
26
- kind: 'commit';
27
- commit: CommitOperation;
28
- }
29
- export interface IdentityData {
30
- did: Did;
31
- handle: Handle;
32
- seq: number;
33
- time: Datetime;
34
- }
35
- export interface IdentityEvent extends BaseEvent {
36
- kind: 'identity';
37
- identity: IdentityData;
38
- }
39
- export interface AccountData {
40
- did: Did;
41
- active: boolean;
42
- seq: number;
43
- time: Datetime;
44
- }
45
- export interface AccountEvent extends BaseEvent {
46
- kind: 'account';
47
- account: AccountData;
48
- }
49
- export type JetstreamEvent = CommitEvent | IdentityEvent | AccountEvent;
50
- export interface OptionsUpdatePayload {
51
- wantedCollections?: string[];
52
- wantedDids?: Did[];
53
- maxMessageSizeBytes?: number;
54
- }
55
- export interface OptionsUpdateProcedure {
56
- type: 'options_update';
57
- payload: OptionsUpdatePayload;
58
- }
59
- export type JetstreamProcedure = OptionsUpdateProcedure;
60
- export {};
61
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAEhG,UAAU,UAAU;IACnB,GAAG,EAAE,GAAG,CAAC;IACT,UAAU,EAAE,IAAI,CAAC;IACjB,IAAI,EAA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EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC"}
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":""}
package/lib/types.ts DELETED
@@ -1,74 +0,0 @@
1
- import type { Cid, Datetime, Did, Handle, Nsid, RecordKey, Tid } from '@atcute/lexicons/syntax';
2
-
3
- interface BaseCommit {
4
- rev: Tid;
5
- collection: Nsid;
6
- rkey: RecordKey;
7
- }
8
-
9
- export interface CreateCommit extends BaseCommit {
10
- operation: 'create';
11
- cid: Cid;
12
- record: unknown;
13
- }
14
-
15
- export interface UpdateCommit extends BaseCommit {
16
- operation: 'update';
17
- cid: Cid;
18
- record: unknown;
19
- }
20
-
21
- export interface DeleteCommit extends BaseCommit {
22
- operation: 'delete';
23
- }
24
-
25
- export type CommitOperation = CreateCommit | UpdateCommit | DeleteCommit;
26
-
27
- interface BaseEvent {
28
- did: Did;
29
- time_us: number;
30
- }
31
-
32
- export interface CommitEvent extends BaseEvent {
33
- kind: 'commit';
34
- commit: CommitOperation;
35
- }
36
-
37
- export interface IdentityData {
38
- did: Did;
39
- handle: Handle;
40
- seq: number;
41
- time: Datetime;
42
- }
43
-
44
- export interface IdentityEvent extends BaseEvent {
45
- kind: 'identity';
46
- identity: IdentityData;
47
- }
48
-
49
- export interface AccountData {
50
- did: Did;
51
- active: boolean;
52
- seq: number;
53
- time: Datetime;
54
- }
55
-
56
- export interface AccountEvent extends BaseEvent {
57
- kind: 'account';
58
- account: AccountData;
59
- }
60
-
61
- export type JetstreamEvent = CommitEvent | IdentityEvent | AccountEvent;
62
-
63
- export interface OptionsUpdatePayload {
64
- wantedCollections?: string[];
65
- wantedDids?: Did[];
66
- maxMessageSizeBytes?: number;
67
- }
68
-
69
- export interface OptionsUpdateProcedure {
70
- type: 'options_update';
71
- payload: OptionsUpdatePayload;
72
- }
73
-
74
- export type JetstreamProcedure = OptionsUpdateProcedure;