@helia/interface 4.3.1-f5a03fc → 5.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.
@@ -6,7 +6,7 @@ export type PinType = 'recursive' | 'direct' | 'indirect';
6
6
  export interface Pin {
7
7
  cid: CID;
8
8
  depth: number;
9
- metadata: Record<string, any>;
9
+ metadata: Record<string, string | number | boolean>;
10
10
  }
11
11
  export type AddPinEvents = ProgressEvent<'helia:pin:add', CID>;
12
12
  export interface AddOptions extends AbortOptions, ProgressOptions<AddPinEvents | GetBlockProgressEvents> {
@@ -28,22 +28,31 @@ export interface IsPinnedOptions extends AbortOptions {
28
28
  }
29
29
  export interface Pins {
30
30
  /**
31
- * Pin a block in the blockstore. It will not be deleted
32
- * when garbage collection is run.
31
+ * Pin a block in the blockstore. It will not be deleted when garbage
32
+ * collection is run.
33
33
  */
34
34
  add(cid: CID, options?: AddOptions): AsyncGenerator<CID, void, undefined>;
35
35
  /**
36
- * Unpin the block that corresponds to the passed CID. The block will
37
- * be deleted when garbage collection is run.
36
+ * Unpin the block that corresponds to the passed CID. The block will be
37
+ * deleted when garbage collection is run.
38
38
  */
39
39
  rm(cid: CID, options?: RmOptions): AsyncGenerator<CID, void, undefined>;
40
40
  /**
41
41
  * List all blocks that have been pinned.
42
42
  */
43
43
  ls(options?: LsOptions): AsyncGenerator<Pin, void, undefined>;
44
+ /**
45
+ * If the CID is pinned, return details of the pin, otherwise throw an error
46
+ */
47
+ get(cid: CID, options?: AbortOptions): Promise<Pin>;
44
48
  /**
45
49
  * Return true if the passed CID is pinned
46
50
  */
47
51
  isPinned(cid: CID, options?: IsPinnedOptions): Promise<boolean>;
52
+ /**
53
+ * If the CID is pinned, update the metadata associated with the pin,
54
+ * otherwise throw an error
55
+ */
56
+ setMetadata(cid: CID, metadata: Record<string, string | number | boolean> | undefined, options?: AbortOptions): Promise<void>;
48
57
  }
49
58
  //# sourceMappingURL=pins.d.ts.map
@@ -1 +1 @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AAW,SAAU,SAAQ,YAAY;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAA;CACV;AAED,MAAM,WAAW,eAAgB,SAAQ,YAAY;CAEpD;AAED,MAAM,WAAW,IAAI;IACnB;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;IAEzE;;;OAGG;IACH,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;IAEvE;;OAEG;IACH,EAAE,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;IAE7D;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IAEnD;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE/D;;;OAGG;IACH,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9H"}
@@ -0,0 +1,71 @@
1
+ {
2
+ "InsufficientProvidersError": "https://ipfs.github.io/helia/classes/helia.InsufficientProvidersError.html",
3
+ "NoRoutersAvailableError": "https://ipfs.github.io/helia/classes/helia.NoRoutersAvailableError.html",
4
+ "UnknownCodecError": "https://ipfs.github.io/helia/classes/helia.UnknownCodecError.html",
5
+ "UnknownHashAlgorithmError": "https://ipfs.github.io/helia/classes/helia.UnknownHashAlgorithmError.html",
6
+ "AddOptions": "https://ipfs.github.io/helia/interfaces/helia.AddOptions.html",
7
+ "./pins:AddOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.pins.AddOptions.html",
8
+ "BlockAnnounceOptions": "https://ipfs.github.io/helia/interfaces/helia.BlockAnnounceOptions.html",
9
+ "./blocks:BlockAnnounceOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.blocks.BlockAnnounceOptions.html",
10
+ "BlockBroker": "https://ipfs.github.io/helia/interfaces/helia.BlockBroker.html",
11
+ "./blocks:BlockBroker": "https://ipfs.github.io/helia/interfaces/_helia_interface.blocks.BlockBroker.html",
12
+ "BlockRetrievalOptions": "https://ipfs.github.io/helia/interfaces/helia.BlockRetrievalOptions.html",
13
+ "./blocks:BlockRetrievalOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.blocks.BlockRetrievalOptions.html",
14
+ "Blocks": "https://ipfs.github.io/helia/interfaces/helia.Blocks.html",
15
+ "./blocks:Blocks": "https://ipfs.github.io/helia/interfaces/_helia_interface.blocks.Blocks.html",
16
+ "CodecLoader": "https://ipfs.github.io/helia/interfaces/helia.CodecLoader.html",
17
+ ".:CodecLoader": "https://ipfs.github.io/helia/interfaces/_helia_interface.index.CodecLoader.html",
18
+ "CreateSessionOptions": "https://ipfs.github.io/helia/interfaces/helia.CreateSessionOptions.html",
19
+ "./blocks:CreateSessionOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.blocks.CreateSessionOptions.html",
20
+ "GCOptions": "https://ipfs.github.io/helia/interfaces/helia.GCOptions.html",
21
+ ".:GCOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.index.GCOptions.html",
22
+ "GetOfflineOptions": "https://ipfs.github.io/helia/interfaces/helia.GetOfflineOptions.html",
23
+ "./blocks:GetOfflineOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.blocks.GetOfflineOptions.html",
24
+ "HasherLoader": "https://ipfs.github.io/helia/interfaces/helia.HasherLoader.html",
25
+ ".:HasherLoader": "https://ipfs.github.io/helia/interfaces/_helia_interface.index.HasherLoader.html",
26
+ "Helia": "https://ipfs.github.io/helia/interfaces/helia.Helia.html",
27
+ ".:Helia": "https://ipfs.github.io/helia/interfaces/_helia_interface.index.Helia.html",
28
+ "IsPinnedOptions": "https://ipfs.github.io/helia/interfaces/helia.IsPinnedOptions.html",
29
+ "./pins:IsPinnedOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.pins.IsPinnedOptions.html",
30
+ "LsOptions": "https://ipfs.github.io/helia/interfaces/helia.LsOptions.html",
31
+ "./pins:LsOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.pins.LsOptions.html",
32
+ "Pair": "https://ipfs.github.io/helia/interfaces/helia.Pair.html",
33
+ "./blocks:Pair": "https://ipfs.github.io/helia/interfaces/_helia_interface.blocks.Pair.html",
34
+ "Pin": "https://ipfs.github.io/helia/interfaces/helia.Pin.html",
35
+ "./pins:Pin": "https://ipfs.github.io/helia/interfaces/_helia_interface.pins.Pin.html",
36
+ "Pins": "https://ipfs.github.io/helia/interfaces/helia.Pins.html",
37
+ "./pins:Pins": "https://ipfs.github.io/helia/interfaces/_helia_interface.pins.Pins.html",
38
+ "Provider": "https://ipfs.github.io/helia/interfaces/helia.Provider.html",
39
+ "RmOptions": "https://ipfs.github.io/helia/interfaces/helia.RmOptions.html",
40
+ "./pins:RmOptions": "https://ipfs.github.io/helia/interfaces/_helia_interface.pins.RmOptions.html",
41
+ "Routing": "https://ipfs.github.io/helia/interfaces/helia.Routing.html",
42
+ "RoutingOptions": "https://ipfs.github.io/helia/interfaces/helia.RoutingOptions.html",
43
+ "SessionBlockstore": "https://ipfs.github.io/helia/interfaces/helia.SessionBlockstore.html",
44
+ "./blocks:SessionBlockstore": "https://ipfs.github.io/helia/interfaces/_helia_interface.blocks.SessionBlockstore.html",
45
+ "AddPinEvents": "https://ipfs.github.io/helia/types/helia.AddPinEvents.html",
46
+ "./pins:AddPinEvents": "https://ipfs.github.io/helia/types/_helia_interface.pins.AddPinEvents.html",
47
+ "DeleteBlockProgressEvents": "https://ipfs.github.io/helia/types/helia.DeleteBlockProgressEvents.html",
48
+ "./blocks:DeleteBlockProgressEvents": "https://ipfs.github.io/helia/types/_helia_interface.blocks.DeleteBlockProgressEvents.html",
49
+ "DeleteManyBlocksProgressEvents": "https://ipfs.github.io/helia/types/helia.DeleteManyBlocksProgressEvents.html",
50
+ "./blocks:DeleteManyBlocksProgressEvents": "https://ipfs.github.io/helia/types/_helia_interface.blocks.DeleteManyBlocksProgressEvents.html",
51
+ "GcEvents": "https://ipfs.github.io/helia/types/helia.GcEvents.html",
52
+ ".:GcEvents": "https://ipfs.github.io/helia/types/_helia_interface.index.GcEvents.html",
53
+ "GetAllBlocksProgressEvents": "https://ipfs.github.io/helia/types/helia.GetAllBlocksProgressEvents.html",
54
+ "./blocks:GetAllBlocksProgressEvents": "https://ipfs.github.io/helia/types/_helia_interface.blocks.GetAllBlocksProgressEvents.html",
55
+ "GetBlockProgressEvents": "https://ipfs.github.io/helia/types/helia.GetBlockProgressEvents.html",
56
+ "./blocks:GetBlockProgressEvents": "https://ipfs.github.io/helia/types/_helia_interface.blocks.GetBlockProgressEvents.html",
57
+ "GetManyBlocksProgressEvents": "https://ipfs.github.io/helia/types/helia.GetManyBlocksProgressEvents.html",
58
+ "./blocks:GetManyBlocksProgressEvents": "https://ipfs.github.io/helia/types/_helia_interface.blocks.GetManyBlocksProgressEvents.html",
59
+ "HasBlockProgressEvents": "https://ipfs.github.io/helia/types/helia.HasBlockProgressEvents.html",
60
+ "./blocks:HasBlockProgressEvents": "https://ipfs.github.io/helia/types/_helia_interface.blocks.HasBlockProgressEvents.html",
61
+ "PinType": "https://ipfs.github.io/helia/types/helia.PinType.html",
62
+ "./pins:PinType": "https://ipfs.github.io/helia/types/_helia_interface.pins.PinType.html",
63
+ "PutBlockProgressEvents": "https://ipfs.github.io/helia/types/helia.PutBlockProgressEvents.html",
64
+ "./blocks:PutBlockProgressEvents": "https://ipfs.github.io/helia/types/_helia_interface.blocks.PutBlockProgressEvents.html",
65
+ "PutManyBlocksProgressEvents": "https://ipfs.github.io/helia/types/helia.PutManyBlocksProgressEvents.html",
66
+ "./blocks:PutManyBlocksProgressEvents": "https://ipfs.github.io/helia/types/_helia_interface.blocks.PutManyBlocksProgressEvents.html",
67
+ "DEFAULT_SESSION_MAX_PROVIDERS": "https://ipfs.github.io/helia/variables/helia.DEFAULT_SESSION_MAX_PROVIDERS.html",
68
+ "./blocks:DEFAULT_SESSION_MAX_PROVIDERS": "https://ipfs.github.io/helia/variables/_helia_interface.blocks.DEFAULT_SESSION_MAX_PROVIDERS.html",
69
+ "DEFAULT_SESSION_MIN_PROVIDERS": "https://ipfs.github.io/helia/variables/helia.DEFAULT_SESSION_MIN_PROVIDERS.html",
70
+ "./blocks:DEFAULT_SESSION_MIN_PROVIDERS": "https://ipfs.github.io/helia/variables/_helia_interface.blocks.DEFAULT_SESSION_MIN_PROVIDERS.html"
71
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helia/interface",
3
- "version": "4.3.1-f5a03fc",
3
+ "version": "5.0.0",
4
4
  "description": "The Helia API",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/ipfs/helia/tree/main/packages/interface#readme",
@@ -67,6 +67,7 @@
67
67
  "clean": "aegir clean",
68
68
  "lint": "aegir lint",
69
69
  "dep-check": "aegir dep-check",
70
+ "doc-check": "aegir doc-check",
70
71
  "build": "aegir build"
71
72
  },
72
73
  "dependencies": {
package/src/pins.ts CHANGED
@@ -8,7 +8,7 @@ export type PinType = 'recursive' | 'direct' | 'indirect'
8
8
  export interface Pin {
9
9
  cid: CID
10
10
  depth: number
11
- metadata: Record<string, any>
11
+ metadata: Record<string, string | number | boolean>
12
12
  }
13
13
 
14
14
  export type AddPinEvents =
@@ -40,14 +40,14 @@ export interface IsPinnedOptions extends AbortOptions {
40
40
 
41
41
  export interface Pins {
42
42
  /**
43
- * Pin a block in the blockstore. It will not be deleted
44
- * when garbage collection is run.
43
+ * Pin a block in the blockstore. It will not be deleted when garbage
44
+ * collection is run.
45
45
  */
46
46
  add(cid: CID, options?: AddOptions): AsyncGenerator<CID, void, undefined>
47
47
 
48
48
  /**
49
- * Unpin the block that corresponds to the passed CID. The block will
50
- * be deleted when garbage collection is run.
49
+ * Unpin the block that corresponds to the passed CID. The block will be
50
+ * deleted when garbage collection is run.
51
51
  */
52
52
  rm(cid: CID, options?: RmOptions): AsyncGenerator<CID, void, undefined>
53
53
 
@@ -56,8 +56,19 @@ export interface Pins {
56
56
  */
57
57
  ls(options?: LsOptions): AsyncGenerator<Pin, void, undefined>
58
58
 
59
+ /**
60
+ * If the CID is pinned, return details of the pin, otherwise throw an error
61
+ */
62
+ get(cid: CID, options?: AbortOptions): Promise<Pin>
63
+
59
64
  /**
60
65
  * Return true if the passed CID is pinned
61
66
  */
62
67
  isPinned(cid: CID, options?: IsPinnedOptions): Promise<boolean>
68
+
69
+ /**
70
+ * If the CID is pinned, update the metadata associated with the pin,
71
+ * otherwise throw an error
72
+ */
73
+ setMetadata(cid: CID, metadata: Record<string, string | number | boolean> | undefined, options?: AbortOptions): Promise<void>
63
74
  }