@junobuild/core-peer 0.0.18 → 0.0.19

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.
@@ -1,94 +1,6 @@
1
+ import type { Asset } from '@junobuild/storage';
1
2
  import type { AssetNoContent } from '../../declarations/satellite/satellite.did';
2
3
  import type { ListResults } from './list.types';
3
- /**
4
- * Represents the encoding details of an asset.
5
- * @interface
6
- */
7
- export interface AssetEncoding {
8
- /**
9
- * The timestamp when the encoding was modified.
10
- * @type {bigint}
11
- */
12
- modified: bigint;
13
- /**
14
- * The SHA-256 hash of the encoding.
15
- * @type {string}
16
- */
17
- sha256: string;
18
- /**
19
- * The total length of the encoding.
20
- * @type {bigint}
21
- */
22
- total_length: bigint;
23
- }
24
- /**
25
- * Represents the key details of an asset.
26
- * @interface
27
- */
28
- export interface AssetKey {
29
- /**
30
- * The full path of the asset, i.e., URL.pathname. Except for the dApps assets (HTML, JS, etc.), the full path must start with `/collection/`.
31
- * @type {string}
32
- */
33
- fullPath: string;
34
- /**
35
- * The name of the asset.
36
- * @type {string}
37
- */
38
- name: string;
39
- /**
40
- * The download URL of the asset.
41
- * @type {string}
42
- */
43
- downloadUrl: string;
44
- }
45
- /**
46
- * Type representing the possible encoding types.
47
- * @typedef {('identity' | 'gzip' | 'compress' | 'deflate' | 'br')} ENCODING_TYPE
48
- */
49
- export type ENCODING_TYPE = 'identity' | 'gzip' | 'compress' | 'deflate' | 'br';
50
- /**
51
- * Represents an asset with its key details, encodings, and metadata.
52
- * @interface
53
- * @extends {AssetKey}
54
- */
55
- export interface Asset extends AssetKey {
56
- /**
57
- * An optional description of the asset. A field which can be used to filter assets when listing those.
58
- * @type {string}
59
- */
60
- description?: string;
61
- /**
62
- * An optional token associated with the asset. Tokens are used to protect assets on the web. If a token is provided, the asset is delivered on the web only if the query parameter `token` is provided with a matching value.
63
- * @type {string}
64
- */
65
- token?: string;
66
- /**
67
- * The headers associated with the asset.
68
- * @type {[string, string][]}
69
- */
70
- headers: [string, string][];
71
- /**
72
- * The encodings of the asset.
73
- * @type {Record<ENCODING_TYPE, AssetEncoding>}
74
- */
75
- encodings: Record<ENCODING_TYPE, AssetEncoding>;
76
- /**
77
- * The owner of the asset.
78
- * @type {string}
79
- */
80
- owner?: string;
81
- /**
82
- * The timestamp when the asset was created.
83
- * @type {bigint}
84
- */
85
- created_at?: bigint;
86
- /**
87
- * The timestamp when the asset was last updated.
88
- * @type {bigint}
89
- */
90
- updated_at?: bigint;
91
- }
92
4
  /**
93
5
  * Represents a collection of assets with pagination details.
94
6
  * @interface
@@ -107,49 +19,3 @@ export interface Assets extends Omit<ListResults<AssetNoContent>, 'items'> {
107
19
  */
108
20
  assets: Asset[];
109
21
  }
110
- /**
111
- * Represents the details required to store an asset.
112
- * @interface
113
- */
114
- export interface Storage {
115
- /**
116
- * The filename of the asset.
117
- * @type {string}
118
- */
119
- filename: string;
120
- /**
121
- * The data of the asset.
122
- * @type {Blob}
123
- */
124
- data: Blob;
125
- /**
126
- * The collection to which the asset belongs.
127
- * @type {string}
128
- */
129
- collection: string;
130
- /**
131
- * The full path of the asset, i.e., URL.pathname. Except for the dApps assets (HTML, JS, etc.), the full path must start with `/collection/`.
132
- * @type {string}
133
- */
134
- fullPath?: string;
135
- /**
136
- * The headers associated with the asset.
137
- * @type {[string, string][]}
138
- */
139
- headers?: [string, string][];
140
- /**
141
- * An optional token associated with the asset. Tokens are used to protect assets on the web. If a token is provided, the asset is delivered on the web only if the query parameter `token` is provided with a matching value.
142
- * @type {string}
143
- */
144
- token?: string;
145
- /**
146
- * The encoding type of the asset.
147
- * @type {ENCODING_TYPE}
148
- */
149
- encoding?: ENCODING_TYPE;
150
- /**
151
- * An optional description of the asset. A field which can be used to filter assets when listing those.
152
- * @type {string}
153
- */
154
- description?: string;
155
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/core-peer",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "JavaScript core client for Juno minus DFINITY agent-js dependencies",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -54,7 +54,8 @@
54
54
  ],
55
55
  "homepage": "https://juno.build",
56
56
  "dependencies": {
57
- "@junobuild/utils": "*"
57
+ "@junobuild/utils": "*",
58
+ "@junobuild/storage": "*"
58
59
  },
59
60
  "peerDependencies": {
60
61
  "@dfinity/agent": "^1.3.0",