@junobuild/core-peer 0.0.28 → 0.0.29
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/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/declarations/satellite/satellite.did.d.ts +10 -1
- package/dist/declarations/satellite/satellite.factory.did.js +28 -19
- package/dist/declarations/satellite/satellite.factory.did.mjs +28 -19
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +3 -3
- package/dist/types/api/doc.api.d.ts +7 -2
- package/dist/types/api/storage.api.d.ts +10 -6
- package/dist/types/services/doc.services.d.ts +17 -2
- package/dist/types/services/identity.services.d.ts +1 -1
- package/dist/types/services/storage.services.d.ts +22 -7
- package/dist/types/utils/data.utils.d.ts +1 -1
- package/dist/types/utils/env.utils.d.ts +2 -2
- package/dist/types/workers/auth.worker.d.ts +0 -1
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ import type { Satellite } from '../types/satellite.types';
|
|
|
4
4
|
export declare const getDoc: <D>({ collection, key, satellite }: {
|
|
5
5
|
collection: string;
|
|
6
6
|
satellite: Satellite;
|
|
7
|
-
} & Pick<Doc<D>,
|
|
7
|
+
} & Pick<Doc<D>, "key">) => Promise<Doc<D> | undefined>;
|
|
8
8
|
export declare const getManyDocs: ({ docs, satellite }: {
|
|
9
9
|
docs: ({
|
|
10
10
|
collection: string;
|
|
11
|
-
} & Pick<Doc<any>,
|
|
11
|
+
} & Pick<Doc<any>, "key">)[];
|
|
12
12
|
satellite: Satellite;
|
|
13
13
|
}) => Promise<(Doc<any> | undefined)[]>;
|
|
14
14
|
export declare const setDoc: <D>({ collection, doc, satellite }: {
|
|
@@ -35,6 +35,11 @@ export declare const deleteManyDocs: ({ docs, satellite }: {
|
|
|
35
35
|
}[];
|
|
36
36
|
satellite: Satellite;
|
|
37
37
|
}) => Promise<void>;
|
|
38
|
+
export declare const deleteFilteredDocs: ({ collection, filter, satellite }: {
|
|
39
|
+
collection: string;
|
|
40
|
+
filter: ListParams;
|
|
41
|
+
satellite: Satellite;
|
|
42
|
+
}) => Promise<void>;
|
|
38
43
|
export declare const listDocs: <D>({ collection, filter, satellite }: {
|
|
39
44
|
collection: string;
|
|
40
45
|
filter: ListParams;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type AssetKey } from '@junobuild/storage';
|
|
1
|
+
import { type AssetKey, type UploadAsset } from '@junobuild/storage';
|
|
3
2
|
import type { AssetNoContent } from '../../declarations/satellite/satellite.did';
|
|
4
3
|
import type { ListParams, ListResults } from '../types/list.types';
|
|
5
4
|
import type { Satellite } from '../types/satellite.types';
|
|
@@ -19,20 +18,25 @@ export declare const countAssets: ({ collection, satellite, filter }: {
|
|
|
19
18
|
export declare const deleteAsset: ({ collection, fullPath, satellite }: {
|
|
20
19
|
collection: string;
|
|
21
20
|
satellite: Satellite;
|
|
22
|
-
} & Pick<AssetKey,
|
|
21
|
+
} & Pick<AssetKey, "fullPath">) => Promise<void>;
|
|
23
22
|
export declare const deleteManyAssets: ({ assets, satellite }: {
|
|
24
23
|
assets: ({
|
|
25
24
|
collection: string;
|
|
26
|
-
} & Pick<AssetKey,
|
|
25
|
+
} & Pick<AssetKey, "fullPath">)[];
|
|
27
26
|
satellite: Satellite;
|
|
28
27
|
}) => Promise<void>;
|
|
28
|
+
export declare const deleteFilteredAssets: ({ collection, satellite, filter }: {
|
|
29
|
+
collection: string;
|
|
30
|
+
satellite: Satellite;
|
|
31
|
+
filter: ListParams;
|
|
32
|
+
}) => Promise<void>;
|
|
29
33
|
export declare const getAsset: ({ collection, fullPath, satellite }: {
|
|
30
34
|
collection: string;
|
|
31
35
|
satellite: Satellite;
|
|
32
|
-
} & Pick<AssetKey,
|
|
36
|
+
} & Pick<AssetKey, "fullPath">) => Promise<AssetNoContent | undefined>;
|
|
33
37
|
export declare const getManyAssets: ({ assets, satellite }: {
|
|
34
38
|
assets: ({
|
|
35
39
|
collection: string;
|
|
36
|
-
} & Pick<AssetKey,
|
|
40
|
+
} & Pick<AssetKey, "fullPath">)[];
|
|
37
41
|
satellite: Satellite;
|
|
38
42
|
}) => Promise<(AssetNoContent | undefined)[]>;
|
|
@@ -13,7 +13,7 @@ import type { SatelliteOptions } from '../types/satellite.types';
|
|
|
13
13
|
export declare const getDoc: <D>({ satellite, ...rest }: {
|
|
14
14
|
collection: string;
|
|
15
15
|
satellite?: SatelliteOptions;
|
|
16
|
-
} & Pick<Doc<D>,
|
|
16
|
+
} & Pick<Doc<D>, "key">) => Promise<Doc<D> | undefined>;
|
|
17
17
|
/**
|
|
18
18
|
* Retrieves multiple documents from a single or different collections in a single call.
|
|
19
19
|
* @param {Object} params - The parameters for retrieving the documents.
|
|
@@ -24,7 +24,7 @@ export declare const getDoc: <D>({ satellite, ...rest }: {
|
|
|
24
24
|
export declare const getManyDocs: ({ satellite, ...rest }: {
|
|
25
25
|
docs: ({
|
|
26
26
|
collection: string;
|
|
27
|
-
} & Pick<Doc<any>,
|
|
27
|
+
} & Pick<Doc<any>, "key">)[];
|
|
28
28
|
satellite?: SatelliteOptions;
|
|
29
29
|
}) => Promise<(Doc<any> | undefined)[]>;
|
|
30
30
|
/**
|
|
@@ -83,6 +83,21 @@ export declare const deleteManyDocs: ({ satellite, ...rest }: {
|
|
|
83
83
|
}[];
|
|
84
84
|
satellite?: SatelliteOptions;
|
|
85
85
|
}) => Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Deletes documents from a collection with optional filtering.
|
|
88
|
+
*
|
|
89
|
+
* @param {Object} params - The parameters for deleting documents.
|
|
90
|
+
* @param {string} params.collection - The name of the collection.
|
|
91
|
+
* @param {ListParams} [params.filter] - The filter criteria to match documents for deletion.
|
|
92
|
+
* @param {SatelliteOptions} [params.satellite] - Options for the satellite (useful for NodeJS usage only).
|
|
93
|
+
*
|
|
94
|
+
* @returns {Promise<void>} A promise that resolves when the documents are deleted.
|
|
95
|
+
*/
|
|
96
|
+
export declare const deleteFilteredDocs: ({ satellite, filter, ...rest }: {
|
|
97
|
+
collection: string;
|
|
98
|
+
filter?: ListParams;
|
|
99
|
+
satellite?: SatelliteOptions;
|
|
100
|
+
}) => Promise<void>;
|
|
86
101
|
/**
|
|
87
102
|
* Lists documents in a collection with optional filtering.
|
|
88
103
|
* @template D
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Identity } from '@dfinity/agent';
|
|
2
2
|
export declare const getIdentity: (identity?: Identity) => Identity;
|
|
@@ -16,7 +16,7 @@ export declare const uploadBlob: (params: Storage & {
|
|
|
16
16
|
* @param {Partial<Pick<Storage, 'filename'>> & Omit<Storage, 'filename' | 'data'> & {data: File} & {satellite?: SatelliteOptions}} params - The storage parameters. Satellite options are required only in NodeJS environment.
|
|
17
17
|
* @returns {Promise<AssetKey>} A promise that resolves to the asset key.
|
|
18
18
|
*/
|
|
19
|
-
export declare const uploadFile: (params: Partial<Pick<Storage,
|
|
19
|
+
export declare const uploadFile: (params: Partial<Pick<Storage, "filename">> & Omit<Storage, "filename" | "data"> & {
|
|
20
20
|
data: File;
|
|
21
21
|
} & {
|
|
22
22
|
satellite?: SatelliteOptions;
|
|
@@ -58,7 +58,7 @@ export declare const countAssets: ({ collection, satellite: satelliteOptions, fi
|
|
|
58
58
|
export declare const deleteAsset: ({ collection, fullPath, satellite }: {
|
|
59
59
|
collection: string;
|
|
60
60
|
satellite?: SatelliteOptions;
|
|
61
|
-
} & Pick<AssetKey,
|
|
61
|
+
} & Pick<AssetKey, "fullPath">) => Promise<void>;
|
|
62
62
|
/**
|
|
63
63
|
* Deletes multiple assets from the storage.
|
|
64
64
|
* @param {Object} params - The parameters for deleting the assets.
|
|
@@ -69,9 +69,24 @@ export declare const deleteAsset: ({ collection, fullPath, satellite }: {
|
|
|
69
69
|
export declare const deleteManyAssets: ({ assets, satellite }: {
|
|
70
70
|
assets: ({
|
|
71
71
|
collection: string;
|
|
72
|
-
} & Pick<AssetKey,
|
|
72
|
+
} & Pick<AssetKey, "fullPath">)[];
|
|
73
73
|
satellite?: SatelliteOptions;
|
|
74
|
-
} & Pick<AssetKey,
|
|
74
|
+
} & Pick<AssetKey, "fullPath">) => Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Deletes multiple assets from a collection based on filtering criteria.
|
|
77
|
+
*
|
|
78
|
+
* @param {Object} params - The parameters for deleting the assets.
|
|
79
|
+
* @param {string} params.collection - The name of the collection from which to delete assets.
|
|
80
|
+
* @param {SatelliteOptions} [params.satellite] - The satellite options (required only in NodeJS environment).
|
|
81
|
+
* @param {ListParams} [params.filter] - The filter criteria to match assets for deletion.
|
|
82
|
+
*
|
|
83
|
+
* @returns {Promise<void>} A promise that resolves when the assets matching the filter criteria are deleted.
|
|
84
|
+
*/
|
|
85
|
+
export declare const deleteFilteredAssets: ({ collection, satellite: satelliteOptions, filter }: {
|
|
86
|
+
collection: string;
|
|
87
|
+
satellite?: SatelliteOptions;
|
|
88
|
+
filter?: ListParams;
|
|
89
|
+
}) => Promise<void>;
|
|
75
90
|
/**
|
|
76
91
|
* Retrieves an asset from the storage.
|
|
77
92
|
* @param {Object} params - The parameters for retrieving the asset.
|
|
@@ -83,7 +98,7 @@ export declare const deleteManyAssets: ({ assets, satellite }: {
|
|
|
83
98
|
export declare const getAsset: ({ satellite, ...rest }: {
|
|
84
99
|
collection: string;
|
|
85
100
|
satellite?: SatelliteOptions;
|
|
86
|
-
} & Pick<AssetKey,
|
|
101
|
+
} & Pick<AssetKey, "fullPath">) => Promise<AssetNoContent | undefined>;
|
|
87
102
|
/**
|
|
88
103
|
* Retrieves multiple assets from the storage.
|
|
89
104
|
* @param {Object} params - The parameters for retrieving the assets.
|
|
@@ -94,7 +109,7 @@ export declare const getAsset: ({ satellite, ...rest }: {
|
|
|
94
109
|
export declare const getManyAssets: ({ satellite, ...rest }: {
|
|
95
110
|
assets: ({
|
|
96
111
|
collection: string;
|
|
97
|
-
} & Pick<AssetKey,
|
|
112
|
+
} & Pick<AssetKey, "fullPath">)[];
|
|
98
113
|
satellite?: SatelliteOptions;
|
|
99
114
|
}) => Promise<(AssetNoContent | undefined)[]>;
|
|
100
115
|
/**
|
|
@@ -109,7 +124,7 @@ export declare const getManyAssets: ({ satellite, ...rest }: {
|
|
|
109
124
|
* @returns {string} The generated download URL.
|
|
110
125
|
*/
|
|
111
126
|
export declare const downloadUrl: ({ assetKey: { fullPath, token }, satellite: satelliteOptions }: {
|
|
112
|
-
assetKey: Pick<Asset,
|
|
127
|
+
assetKey: Pick<Asset, "fullPath" | "token">;
|
|
113
128
|
} & {
|
|
114
129
|
satellite?: SatelliteOptions;
|
|
115
130
|
}) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Doc } from '../../declarations/satellite/satellite.did';
|
|
2
|
-
export declare const mapData: <D>({ data }: Pick<Doc,
|
|
2
|
+
export declare const mapData: <D>({ data }: Pick<Doc, "data">) => Promise<D>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Satellite } from '../types/satellite.types';
|
|
2
2
|
export declare const satelliteUrl: ({ satelliteId: customSatelliteId, container: customContainer }: Satellite) => string;
|
|
3
|
-
export declare const customOrEnvSatelliteId: ({ satelliteId }: Pick<Satellite,
|
|
4
|
-
export declare const customOrEnvContainer: ({ container: customContainer }: Pick<Satellite,
|
|
3
|
+
export declare const customOrEnvSatelliteId: ({ satelliteId }: Pick<Satellite, "satelliteId">) => Pick<Satellite, "satelliteId">;
|
|
4
|
+
export declare const customOrEnvContainer: ({ container: customContainer }: Pick<Satellite, "container">) => Pick<Satellite, "container">;
|
package/package.json
CHANGED