@solarpunkltd/swarm-id 0.8.1 → 0.8.2

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.
@@ -43,8 +43,9 @@ export declare const DeviceStateSnapshotSchemaV1: z.ZodObject<{
43
43
  appDescription: z.ZodOptional<z.ZodString>;
44
44
  connectedUntil: z.ZodOptional<z.ZodNumber>;
45
45
  appSecret: z.ZodOptional<z.ZodString>;
46
- postageStampBatchID: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<BatchId, string>>>;
46
+ postageStampBatchID: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodPipe<z.ZodString, z.ZodTransform<BatchId, string>>]>>;
47
47
  postageStampBatchIDAt: z.ZodOptional<z.ZodNumber>;
48
+ stampPending: z.ZodOptional<z.ZodLiteral<true>>;
48
49
  revokedAt: z.ZodOptional<z.ZodNumber>;
49
50
  disconnectedAt: z.ZodOptional<z.ZodNumber>;
50
51
  chatBinding: z.ZodOptional<z.ZodObject<{
package/dist/types.d.ts CHANGED
@@ -537,8 +537,10 @@ export type UploadMode = z.infer<typeof UploadModeSchema>;
537
537
  /**
538
538
  * Why a session cannot upload, when `uploadMode` is `"unavailable"`.
539
539
  *
540
- * - `no-stamp` — no stamp resolved: the account has no drive, or its pointers
541
- * name one that is gone
540
+ * - `no-stamp`: the site has no stamp to use. The account has no drive (or
541
+ * its pointers name only drives that are gone), the person set this site to
542
+ * no drive, or the person has not yet confirmed the site's drive in the
543
+ * connect window since the site signed in.
542
544
  * - `stamper-failed` — the stamp resolved and the stamper still did not build.
543
545
  * `initializeStamper` logs and returns rather than throwing, so without this
544
546
  * the symptom is indistinguishable from having no stamp at all.
@@ -654,6 +656,7 @@ export declare const ConnectionInfoSchema: z.ZodObject<{
654
656
  signature: z.ZodString;
655
657
  }, z.core.$strip>>;
656
658
  beeApiUrl: z.ZodOptional<z.ZodString>;
659
+ postageBatchId: z.ZodOptional<z.ZodString>;
657
660
  }, z.core.$strip>;
658
661
  export type ConnectionInfo = z.infer<typeof ConnectionInfoSchema>;
659
662
  export declare const AppMetadataSchema: z.ZodObject<{
@@ -2143,6 +2146,7 @@ export declare const ConnectionInfoChangedMessageSchema: z.ZodObject<{
2143
2146
  signature: z.ZodString;
2144
2147
  }, z.core.$strip>>;
2145
2148
  beeApiUrl: z.ZodOptional<z.ZodString>;
2149
+ postageBatchId: z.ZodOptional<z.ZodString>;
2146
2150
  }, z.core.$strip>;
2147
2151
  export declare const ConnectResponseMessageSchema: z.ZodObject<{
2148
2152
  type: z.ZodLiteral<"connectResponse">;
@@ -2511,6 +2515,7 @@ export declare const IframeToParentMessageSchema: z.ZodDiscriminatedUnion<[z.Zod
2511
2515
  signature: z.ZodString;
2512
2516
  }, z.core.$strip>>;
2513
2517
  beeApiUrl: z.ZodOptional<z.ZodString>;
2518
+ postageBatchId: z.ZodOptional<z.ZodString>;
2514
2519
  }, z.core.$strip>, z.ZodObject<{
2515
2520
  type: z.ZodLiteral<"connectResponse">;
2516
2521
  requestId: z.ZodString;
@@ -2766,8 +2771,9 @@ export declare const AuthDataSchema: z.ZodObject<{
2766
2771
  appDescription: z.ZodOptional<z.ZodString>;
2767
2772
  connectedUntil: z.ZodOptional<z.ZodNumber>;
2768
2773
  appSecret: z.ZodOptional<z.ZodString>;
2769
- postageStampBatchID: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@ethersphere/core-sdk").BatchId, string>>>;
2774
+ postageStampBatchID: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodPipe<z.ZodString, z.ZodTransform<import("@ethersphere/core-sdk").BatchId, string>>]>>;
2770
2775
  postageStampBatchIDAt: z.ZodOptional<z.ZodNumber>;
2776
+ stampPending: z.ZodOptional<z.ZodLiteral<true>>;
2771
2777
  revokedAt: z.ZodOptional<z.ZodNumber>;
2772
2778
  disconnectedAt: z.ZodOptional<z.ZodNumber>;
2773
2779
  chatBinding: z.ZodOptional<z.ZodObject<{
@@ -2806,6 +2812,7 @@ export declare const AuthDataSchema: z.ZodObject<{
2806
2812
  message: z.ZodString;
2807
2813
  signature: z.ZodString;
2808
2814
  }, z.core.$strip>>;
2815
+ stampPending: z.ZodOptional<z.ZodLiteral<true>>;
2809
2816
  }, z.core.$strip>;
2810
2817
  export type AuthData = z.infer<typeof AuthDataSchema>;
2811
2818
  /**
@@ -2879,8 +2886,9 @@ export declare const SetSecretMessageSchema: z.ZodObject<{
2879
2886
  appDescription: z.ZodOptional<z.ZodString>;
2880
2887
  connectedUntil: z.ZodOptional<z.ZodNumber>;
2881
2888
  appSecret: z.ZodOptional<z.ZodString>;
2882
- postageStampBatchID: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@ethersphere/core-sdk").BatchId, string>>>;
2889
+ postageStampBatchID: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodPipe<z.ZodString, z.ZodTransform<import("@ethersphere/core-sdk").BatchId, string>>]>>;
2883
2890
  postageStampBatchIDAt: z.ZodOptional<z.ZodNumber>;
2891
+ stampPending: z.ZodOptional<z.ZodLiteral<true>>;
2884
2892
  revokedAt: z.ZodOptional<z.ZodNumber>;
2885
2893
  disconnectedAt: z.ZodOptional<z.ZodNumber>;
2886
2894
  chatBinding: z.ZodOptional<z.ZodObject<{
@@ -2919,6 +2927,7 @@ export declare const SetSecretMessageSchema: z.ZodObject<{
2919
2927
  message: z.ZodString;
2920
2928
  signature: z.ZodString;
2921
2929
  }, z.core.$strip>>;
2930
+ stampPending: z.ZodOptional<z.ZodLiteral<true>>;
2922
2931
  }, z.core.$strip>;
2923
2932
  }, z.core.$strip>;
2924
2933
  export declare const PopupToIframeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2954,8 +2963,9 @@ export declare const PopupToIframeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodO
2954
2963
  appDescription: z.ZodOptional<z.ZodString>;
2955
2964
  connectedUntil: z.ZodOptional<z.ZodNumber>;
2956
2965
  appSecret: z.ZodOptional<z.ZodString>;
2957
- postageStampBatchID: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@ethersphere/core-sdk").BatchId, string>>>;
2966
+ postageStampBatchID: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodPipe<z.ZodString, z.ZodTransform<import("@ethersphere/core-sdk").BatchId, string>>]>>;
2958
2967
  postageStampBatchIDAt: z.ZodOptional<z.ZodNumber>;
2968
+ stampPending: z.ZodOptional<z.ZodLiteral<true>>;
2959
2969
  revokedAt: z.ZodOptional<z.ZodNumber>;
2960
2970
  disconnectedAt: z.ZodOptional<z.ZodNumber>;
2961
2971
  chatBinding: z.ZodOptional<z.ZodObject<{
@@ -2994,6 +3004,7 @@ export declare const PopupToIframeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodO
2994
3004
  message: z.ZodString;
2995
3005
  signature: z.ZodString;
2996
3006
  }, z.core.$strip>>;
3007
+ stampPending: z.ZodOptional<z.ZodLiteral<true>>;
2997
3008
  }, z.core.$strip>;
2998
3009
  }, z.core.$strip>], "type">;
2999
3010
  export type SetSecretMessage = z.infer<typeof SetSecretMessageSchema>;
@@ -1,10 +1,11 @@
1
- import type { ConnectedApp, PostageStamp, SignedInAccount } from "../schemas";
1
+ import { type ConnectedApp, type PostageStamp, type SignedInAccount } from "../schemas";
2
2
  /**
3
3
  * Resolve which postage stamp an app should upload with.
4
4
  *
5
5
  * An app may carry its own batch override (`postageStampBatchID`); otherwise it
6
6
  * falls back to the account's default stamp. The account owns the stamp set, so
7
- * these pointers are the single source of truth.
7
+ * these pointers are the single source of truth. An app set to
8
+ * `NO_POSTAGE_STAMP` resolves to no stamp, the default included.
8
9
  *
9
10
  * The lookup is existence-checked: a pointer whose stamp is missing (e.g. a
10
11
  * removed or replaced batch) is skipped so resolution falls through to the next
@@ -36,4 +37,4 @@ export declare function resolveStampForApp(app: Pick<ConnectedApp, "postageStamp
36
37
  * cannot upload at all. Tombstones its pointers still name are kept too — a
37
38
  * tombstone is how the session learns the stamp it was spending is deleted.
38
39
  */
39
- export declare function stampsReachableByApp(app: Pick<ConnectedApp, "postageStampBatchID">, account: Pick<SignedInAccount, "defaultPostageStampBatchID">, stamps: PostageStamp[]): PostageStamp[];
40
+ export declare function stampsReachableByApp(app: Pick<ConnectedApp, "postageStampBatchID" | "stampPending">, account: Pick<SignedInAccount, "defaultPostageStampBatchID">, stamps: PostageStamp[]): PostageStamp[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solarpunkltd/swarm-id",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "type": "module",
5
5
  "description": "Swarm ID library for authentication and Bee API operations",
6
6
  "main": "dist/swarm-id.esm.js",
@@ -19,6 +19,25 @@
19
19
  "files": [
20
20
  "dist"
21
21
  ],
22
+ "scripts": {
23
+ "build": "rollup -c",
24
+ "build:watch": "rollup -c -w",
25
+ "clean": "rm -rf dist",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
+ "test:integration": "vitest run --config vitest.integration.config.ts",
29
+ "test:live": "vitest run --config vitest.live.config.ts",
30
+ "test:ui": "vitest --ui",
31
+ "test:coverage": "vitest run --coverage",
32
+ "lint": "eslint .",
33
+ "lint:fix": "eslint . --fix",
34
+ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
35
+ "format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
36
+ "typecheck": "tsc --noEmit -p tsconfig.check.json",
37
+ "check:all": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm test",
38
+ "prepack": "npm run clean && npm run build",
39
+ "check:pack": "node dev/check-pack.js"
40
+ },
22
41
  "keywords": [
23
42
  "swarm",
24
43
  "identity",
@@ -52,6 +71,8 @@
52
71
  "@rollup/plugin-replace": "6.0.3",
53
72
  "@rollup/plugin-terser": "0.4.4",
54
73
  "@rollup/plugin-typescript": "12.3.0",
74
+ "@swarm-id/eslint-rules": "workspace:*",
75
+ "@swarm-id/signaling": "workspace:*",
55
76
  "@types/node": "24.10.1",
56
77
  "@typescript-eslint/eslint-plugin": "8.69.0",
57
78
  "@typescript-eslint/parser": "8.69.0",
@@ -62,9 +83,7 @@
62
83
  "rollup": "4.53.3",
63
84
  "tslib": "2.8.1",
64
85
  "typescript": "5.8.3",
65
- "vitest": "4.0.14",
66
- "@swarm-id/signaling": "0.1.0",
67
- "@swarm-id/eslint-rules": "0.0.0"
86
+ "vitest": "4.0.14"
68
87
  },
69
88
  "engines": {
70
89
  "node": ">=22",
@@ -72,23 +91,5 @@
72
91
  },
73
92
  "publishConfig": {
74
93
  "access": "public"
75
- },
76
- "scripts": {
77
- "build": "rollup -c",
78
- "build:watch": "rollup -c -w",
79
- "clean": "rm -rf dist",
80
- "test": "vitest run",
81
- "test:watch": "vitest",
82
- "test:integration": "vitest run --config vitest.integration.config.ts",
83
- "test:live": "vitest run --config vitest.live.config.ts",
84
- "test:ui": "vitest --ui",
85
- "test:coverage": "vitest run --coverage",
86
- "lint": "eslint .",
87
- "lint:fix": "eslint . --fix",
88
- "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
89
- "format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
90
- "typecheck": "tsc --noEmit -p tsconfig.check.json",
91
- "check:all": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm test",
92
- "check:pack": "node dev/check-pack.js"
93
94
  }
94
- }
95
+ }