@junobuild/config 0.0.13 → 0.0.14

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/README.md CHANGED
@@ -53,20 +53,110 @@ Configuration options for [Juno] CLI.
53
53
 
54
54
  ### :tropical_drink: Interfaces
55
55
 
56
+ - [OrbiterConfig](#gear-orbiterconfig)
57
+ - [ModuleSettings](#gear-modulesettings)
58
+ - [MaxMemorySizeConfig](#gear-maxmemorysizeconfig)
59
+ - [StorageConfigHeader](#gear-storageconfigheader)
60
+ - [StorageConfigRewrite](#gear-storageconfigrewrite)
61
+ - [StorageConfigRedirect](#gear-storageconfigredirect)
62
+ - [StorageConfig](#gear-storageconfig)
56
63
  - [CliConfig](#gear-cliconfig)
57
64
  - [JunoConfigEnv](#gear-junoconfigenv)
58
- - [OrbiterConfig](#gear-orbiterconfig)
65
+ - [SatelliteAssertions](#gear-satelliteassertions)
66
+ - [AuthenticationConfigInternetIdentity](#gear-authenticationconfiginternetidentity)
67
+ - [AuthenticationConfig](#gear-authenticationconfig)
68
+ - [DatastoreConfig](#gear-datastoreconfig)
69
+ - [SatelliteId](#gear-satelliteid)
70
+ - [SatelliteIds](#gear-satelliteids)
59
71
  - [JunoConfig](#gear-junoconfig)
60
72
  - [SatelliteDevCollections](#gear-satellitedevcollections)
61
73
  - [SatelliteDevController](#gear-satellitedevcontroller)
62
74
  - [SatelliteDevConfig](#gear-satellitedevconfig)
63
75
  - [JunoDevConfig](#gear-junodevconfig)
64
76
 
77
+ #### :gear: OrbiterConfig
78
+
79
+ Represents the configuration for an orbiter.
80
+
81
+ | Property | Type | Description |
82
+ | ----------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
83
+ | `id` | `string` | The identifier of the orbiter used in the dApp. type: {string} |
84
+ | `orbiterId` | `string or undefined` | The deprecated identifier of the orbiter. deprecated: `orbiterId` will be removed in the future. Use `id` instead.type: {string} |
85
+
86
+ #### :gear: ModuleSettings
87
+
88
+ Settings for a module - Satellite, Mission Control or Orbiter.
89
+
90
+ These settings control various aspects of the module's behavior and resource usage.
91
+
92
+ | Property | Type | Description |
93
+ | --------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
94
+ | `freezingThreshold` | `bigint or undefined` | The cycle threshold below which the module will automatically stop to avoid running out of cycles.For example, if set to `BigInt(1000000)`, the module will stop when it has fewer than 1,000,000 cycles remaining. type: {bigint} |
95
+ | `reservedCyclesLimit` | `bigint or undefined` | The number of cycles reserved for the module's operations to ensure it has enough cycles to function.For example, setting it to `BigInt(5000000)` reserves 5,000,000 cycles for the module. type: {bigint} |
96
+ | `logVisibility` | `ModuleLogVisibility or undefined` | Controls who can see the module's logs. type: {ModuleLogVisibility} |
97
+ | `heapMemoryLimit` | `bigint or undefined` | The maximum amount of WebAssembly (Wasm) memory the module can use on the heap.For example, setting it to `BigInt(1024 * 1024 * 64)` allows the module to use up to 64 MB of Wasm memory. type: {bigint} |
98
+ | `memoryAllocation` | `bigint or undefined` | The amount of memory explicitly allocated to the module.For example, setting it to `BigInt(1024 * 1024 * 128)` allocates 128 MB of memory to the module. type: {bigint} |
99
+ | `computeAllocation` | `bigint or undefined` | The proportion of compute capacity allocated to the module.This is a fraction of the total compute capacity of the subnet. For example, setting it to `BigInt(10)` allocates 10% of the compute capacity to the module. type: {bigint} |
100
+
101
+ #### :gear: MaxMemorySizeConfig
102
+
103
+ Configuration for granting access to features only if the maximum memory size limits are not reached.
104
+
105
+ The maximum size corresponds to the overall heap or stable memory of the smart contract.
106
+
107
+ | Property | Type | Description |
108
+ | -------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
109
+ | `heap` | `bigint or undefined` | Maximum allowed heap memory size in bytes.This field is optional. If not specified, no limit is enforced on the heap memory size. type: {bigint} |
110
+ | `stable` | `bigint or undefined` | Maximum allowed stable memory size in bytes.This field is optional. If not specified, no limit is enforced on the stable memory size. type: {bigint} |
111
+
112
+ #### :gear: StorageConfigHeader
113
+
114
+ Headers allow the client and the Storage to pass additional information along with a request or a response.
115
+ Some sets of headers can affect how the browser handles the page and its content.
116
+
117
+ | Property | Type | Description |
118
+ | --------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
119
+ | `source` | `string` | The glob pattern used to match files within the Storage that these headers will apply to. type: {StorageConfigSourceGlob} |
120
+ | `headers` | `[string, string][]` | An array of key-value pairs representing the headers to apply.Each pair includes the header name and its value.Example: `[["Cache-Control", "max-age=3600"], ["X-Custom-Header", "value"]]` type: {Array<[string, string]>} |
121
+
122
+ #### :gear: StorageConfigRewrite
123
+
124
+ You can utilize optional rewrites to display the same content for multiple URLs.
125
+ Rewrites are especially useful when combined with pattern matching, allowing acceptance of any URL that matches the pattern.
126
+
127
+ | Property | Type | Description |
128
+ | ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
129
+ | `source` | `string` | The glob pattern or specific path to match for incoming requests.Matches are rewritten to the specified destination. type: {StorageConfigSourceGlob} |
130
+ | `destination` | `string` | The destination path or file to which matching requests should be rewritten. type: {string} |
131
+
132
+ #### :gear: StorageConfigRedirect
133
+
134
+ Use a URL redirect to prevent broken links if you've moved a page or to shorten URLs.
135
+
136
+ | Property | Type | Description |
137
+ | ---------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- | ---- |
138
+ | `source` | `string` | The glob pattern or specific path to match for incoming requests that should be redirected. type: {StorageConfigSourceGlob} |
139
+ | `location` | `string` | The URL or path to which the request should be redirected. type: {string} |
140
+ | `code` | `301 or 302` | The HTTP status code to use for the redirect, typically 301 (permanent redirect) or 302 (temporary redirect). type: {301 | 302} |
141
+
142
+ #### :gear: StorageConfig
143
+
144
+ Configures the hosting behavior of the Storage.
145
+
146
+ | Property | Type | Description |
147
+ | --------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | -------------------- |
148
+ | `headers` | `StorageConfigHeader[] or undefined` | Optional array of `StorageConfigHeader` objects to define custom HTTP headers for specific files or patterns. type: {StorageConfigHeader[]}optional |
149
+ | `rewrites` | `StorageConfigRewrite[] or undefined` | Optional array of `StorageConfigRewrite` objects to define rewrite rules. type: {StorageConfigRewrite[]}optional |
150
+ | `redirects` | `StorageConfigRedirect[] or undefined` | Optional array of `StorageConfigRedirect` objects to define HTTP redirects. type: {StorageConfigRedirect[]}optional |
151
+ | `iframe` | `"deny" or "same-origin" or "allow-any" or undefined` | For security reasons and to prevent click-jacking attacks, dapps deployed with Juno are, by default, set to deny embedding in other sites.Options are:- `deny`: Prevents any content from being displayed in an iframe.- `same-origin`: Allows iframe content from the same origin as the page.- `allow-any`: Allows iframe content from any origin.If not specified, then `deny` is used as default value. type: {'deny' | 'same-origin' | 'allow-any'}optional |
152
+ | `rawAccess` | `boolean or undefined` | Optional flag to enable access for raw URLs.⚠️ **WARNING: Enabling this option is highly discouraged due to security risks.**Enabling this option allows access to raw URLs (e.g., https://satellite-id.raw.icp0.io), bypassing certificate validation.This creates a security vulnerability where a malicious node in the chain can respond to requests with malicious or invalid content.Since there is no validation on raw URLs, the client may receive and process harmful data.If not specified, the default value is `false`. type: {boolean}optional |
153
+ | `maxMemorySize` | `MaxMemorySizeConfig or undefined` | Configuration for maximum memory size limits for the Storage.This is used to specify optional limits on heap and stable memory for the smart contract.When the limit is reached, the Storage and smart contract continue to operate normally but reject the upload of new assets.If not specified, no memory limits are enforced. type: {MaxMemorySizeConfig}optional |
154
+
65
155
  #### :gear: CliConfig
66
156
 
67
157
  | Property | Type | Description |
68
158
  | ---------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
69
- | `source` | `string or undefined` | Specifies the directory from which to deploy to storage.For instance, if `npm run build` outputs files to a `dist` folder, use `source: 'dist'`. default: 'build'type: {string} |
159
+ | `source` | `string or undefined` | Specifies the directory from which to deploy to Storage.For instance, if `npm run build` outputs files to a `dist` folder, use `source: 'dist'`. default: 'build'type: {string} |
70
160
  | `ignore` | `string[] or undefined` | Specifies files or patterns to ignore during deployment, using glob patterns similar to those in .gitignore. type: {string[]}optional |
71
161
  | `gzip` | `string or false or undefined` | Controls the Gzip compression optimization for files in the source folder. By default, it targets JavaScript (js), ES Module (mjs), and CSS (css) files.You can disable this by setting it to `false` or customize it with a different file matching pattern using glob syntax. type: {string | false}optional |
72
162
  | `encoding` | `[string, ENCODING_TYPE][] or undefined` | Customizes file encoding mapping for HTTP response headers `Content-Encoding` based on file extension:- `.Z` for compress,- `.gz` for gzip,- `.br` for brotli,- `.zlib` for deflate,- anything else defaults to `identity`.The "encoding" attribute allows overriding default mappings with an array of glob patterns and encoding types. type: {Array<[string, ENCODING_TYPE]>}optional |
@@ -79,14 +169,54 @@ Represents the environment configuration for Juno.
79
169
  | -------- | -------- | ---------------------------------------------------------- |
80
170
  | `mode` | `string` | The mode of the Juno configuration. type: {JunoConfigMode} |
81
171
 
82
- #### :gear: OrbiterConfig
172
+ #### :gear: SatelliteAssertions
83
173
 
84
- Represents the configuration for an orbiter.
174
+ Configuration for satellite assertions.
85
175
 
86
- | Property | Type | Description |
87
- | ----------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
88
- | `id` | `string` | The identifier of the orbiter used in the dApp. type: {string} |
89
- | `orbiterId` | `string or undefined` | The deprecated identifier of the orbiter. deprecated: `orbiterId` will be removed in the future. Use `id` instead.type: {string} |
176
+ | Property | Type | Description |
177
+ | ------------ | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
178
+ | `heapMemory` | `number or boolean or undefined` | Configuration for the heap memory size check, which can be:- `true` to enable the check with a default threshold of 900MB,- `false` to disable the heap memory size check,- A `number` to specify a custom threshold in MB (megabytes) for the heap memory size check.If not specified, then `true` is used as the default value. type: {number | boolean} |
179
+
180
+ #### :gear: AuthenticationConfigInternetIdentity
181
+
182
+ Configure the behavior of Internet Identity.
183
+
184
+ | Property | Type | Description |
185
+ | ------------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
186
+ | `derivationOrigin` | `string or undefined` | This setting ensures that users are recognized on your app, regardless of whether they use the default URL or any other custom domain.For example, if set to hello.com, a user signing on at https://hello.com will receive the same identifier (principal) as when signing on at https://www.hello.com. type: {string}optional |
187
+
188
+ #### :gear: AuthenticationConfig
189
+
190
+ Configures the Authentication options of a Satellite.
191
+
192
+ | Property | Type | Description |
193
+ | ------------------ | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
194
+ | `internetIdentity` | `AuthenticationConfigInternetIdentity or undefined` | Optional configuration of Internet Identity authentication method. type: {AuthenticationConfigInternetIdentity}optional |
195
+
196
+ #### :gear: DatastoreConfig
197
+
198
+ Configures the behavior of the Datastore.
199
+
200
+ | Property | Type | Description |
201
+ | --------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
202
+ | `maxMemorySize` | `MaxMemorySizeConfig or undefined` | Configuration for maximum memory size limits for the Datastore.This is used to specify optional limits on heap and stable memory for the smart contract.When the limit is reached, the Datastore and smart contract continue to operate normally but reject the creation or updates of documents.If not specified, no memory limits are enforced. type: {MaxMemorySizeConfig}optional |
203
+
204
+ #### :gear: SatelliteId
205
+
206
+ Represents the unique identifier for a satellite.
207
+
208
+ | Property | Type | Description |
209
+ | ------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
210
+ | `id` | `string` | The unique identifier (ID) of the satellite for this application. type: {string} |
211
+ | `satelliteId` | `string or undefined` | The deprecated unique identifier (ID) of the satellite. deprecated: `satelliteId` will be removed in the future. Use `id` instead.type: {string} |
212
+
213
+ #### :gear: SatelliteIds
214
+
215
+ Represents a mapping of satellite identifiers to different configurations based on the mode of the application.
216
+
217
+ | Property | Type | Description |
218
+ | -------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
219
+ | `ids` | `Record<string, string>` | A mapping of satellite identifiers (IDs) to different configurations based on the mode of the application.This allows the application to use different satellite IDs, such as production, staging, etc.Example:{ "production": "xo2hm-lqaaa-aaaal-ab3oa-cai", "staging": "gl6nx-5maaa-aaaaa-qaaqq-cai"} type: {Record<JunoConfigMode, string>} |
90
220
 
91
221
  #### :gear: JunoConfig
92
222
 
@@ -103,9 +233,9 @@ Represents the collections configuration for a satellite in a development enviro
103
233
 
104
234
  | Property | Type | Description |
105
235
  | ----------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
106
- | `datastore` | `SatelliteDevDataStoreCollection[] or undefined` | The datastore collections configuration. type: {SatelliteDevDataStoreCollection[]}optional |
107
- | `db` | `SatelliteDevDataStoreCollection[] or undefined` | The datastore collections configuration.This property is deprecated. Use {@link datastore} instead. deprecatedtype: {SatelliteDevDbCollection[]} |
108
- | `storage` | `SatelliteDevStorageCollection[] or undefined` | The storage collections configuration. type: {SatelliteDevStorageCollection[]}optional |
236
+ | `datastore` | `SatelliteDevDataStoreCollection[] or undefined` | The Datastore collections configuration. type: {SatelliteDevDataStoreCollection[]}optional |
237
+ | `db` | `SatelliteDevDataStoreCollection[] or undefined` | The Datastore collections configuration.This property is deprecated. Use {@link datastore} instead. deprecatedtype: {SatelliteDevDbCollection[]} |
238
+ | `storage` | `SatelliteDevStorageCollection[] or undefined` | The Storage collections configuration. type: {SatelliteDevStorageCollection[]}optional |
109
239
 
110
240
  #### :gear: SatelliteDevController
111
241
 
@@ -135,14 +265,33 @@ Represents the development configuration for Juno.
135
265
 
136
266
  ### :cocktail: Types
137
267
 
268
+ - [ModuleLogVisibility](#gear-modulelogvisibility)
269
+ - [StorageConfigSourceGlob](#gear-storageconfigsourceglob)
138
270
  - [ENCODING_TYPE](#gear-encoding_type)
139
271
  - [JunoConfigMode](#gear-junoconfigmode)
272
+ - [SatelliteConfig](#gear-satelliteconfig)
140
273
  - [SatelliteDevDataStoreCollection](#gear-satellitedevdatastorecollection)
141
274
  - [SatelliteDevDbCollection](#gear-satellitedevdbcollection)
142
275
  - [SatelliteDevStorageCollection](#gear-satellitedevstoragecollection)
143
276
  - [JunoDevConfigFn](#gear-junodevconfigfn)
144
277
  - [JunoDevConfigFnOrObject](#gear-junodevconfigfnorobject)
145
278
 
279
+ #### :gear: ModuleLogVisibility
280
+
281
+ | Type | Type |
282
+ | --------------------- | --------------------------- |
283
+ | `ModuleLogVisibility` | `'controllers' or 'public'` |
284
+
285
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/module/module.settings.ts#L9)
286
+
287
+ #### :gear: StorageConfigSourceGlob
288
+
289
+ | Type | Type |
290
+ | ------------------------- | ---- |
291
+ | `StorageConfigSourceGlob` | |
292
+
293
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/shared/storage.config.ts#L7)
294
+
146
295
  #### :gear: ENCODING_TYPE
147
296
 
148
297
  | Type | Type |
@@ -159,6 +308,56 @@ Represents the development configuration for Juno.
159
308
 
160
309
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/juno.env.ts#L5)
161
310
 
311
+ #### :gear: SatelliteConfig
312
+
313
+ | Type | Type |
314
+ | ----------------- | ------------------------------------ |
315
+ | `SatelliteConfig` | `Either<SatelliteId, SatelliteIds> & |
316
+
317
+ CliConfig and {
318
+ /\*\*
319
+ _ Optional configuration parameters for the satellite, affecting the operational behavior of its Storage.
320
+ _ Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands.
321
+ _ @type {StorageConfig}
322
+ _ @optional
323
+ \*/
324
+ storage?: StorageConfig;
325
+
326
+ /**
327
+ * Optional configuration parameters for the satellite, affecting the operational behavior of its Datastore.
328
+ * Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands.
329
+ * @type {DatastoreConfig}
330
+ * @optional
331
+ */
332
+ datastore?: DatastoreConfig;
333
+
334
+ /**
335
+ * Optional configuration parameters for the satellite, affecting the operational behavior of its Authentication.
336
+ * Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands.
337
+ * @type {AuthenticationConfig}
338
+ * @optional
339
+ */
340
+ authentication?: AuthenticationConfig;
341
+
342
+ /**
343
+ * Optional configurations to override default assertions made by the CLI regarding satellite deployment conditions.
344
+ * @type {SatelliteAssertions}
345
+ * @optional
346
+ */
347
+ assertions?: SatelliteAssertions;
348
+
349
+ /**
350
+ * Optional configuration parameters for the Satellite.
351
+ * These settings control various aspects of the module's behavior and resource usage.
352
+ * @type {ModuleSettings}
353
+ * @optional
354
+ */
355
+ settings?: ModuleSettings;
356
+
357
+ }` |
358
+
359
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/mainnet/configs/satellite.config.ts#L53)
360
+
162
361
  #### :gear: SatelliteDevDataStoreCollection
163
362
 
164
363
  | Type | Type |
@@ -1,2 +1,2 @@
1
- function n(o){return o}function i(o){return o}function f(o){return o}export{f as defineConfig,n as defineConsoleConfig,i as defineDevConfig};
1
+ function n(o){return o}function t(o){return o}function f(o){return o}export{f as defineConfig,n as defineConsoleConfig,t as defineDevConfig};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as topLevelCreateRequire } from 'module';
2
2
  const require = topLevelCreateRequire(import.meta.url);
3
- function n(o){return o}function i(o){return o}function f(o){return o}export{f as defineConfig,n as defineConsoleConfig,i as defineDevConfig};
3
+ function n(o){return o}function t(o){return o}function f(o){return o}export{f as defineConfig,n as defineConsoleConfig,t as defineDevConfig};
4
4
  //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,4 @@
1
- import type { StorageConfig } from '../storage/storage.config';
1
+ import type { StorageConfig } from '../shared/storage.config';
2
2
  import type { CliConfig } from '../types/cli.config';
3
3
  import type { JunoConfigMode } from '../types/juno.env';
4
4
  import type { Either } from '../utils/ts.utils';
@@ -3,11 +3,13 @@ export type * from './module/module.settings';
3
3
  export type * from './satellite/dev/juno.dev.config';
4
4
  export type * from './satellite/mainnet/configs/assertions.config';
5
5
  export type * from './satellite/mainnet/configs/authentication.config';
6
+ export type * from './satellite/mainnet/configs/datastore.config';
6
7
  export type * from './satellite/mainnet/configs/orbiter.config';
7
8
  export type * from './satellite/mainnet/configs/satellite.config';
8
9
  export type * from './satellite/mainnet/juno.config';
9
10
  export type * from './satellite/types/rules';
10
- export type * from './storage/storage.config';
11
+ export type * from './shared/feature.config';
12
+ export type * from './shared/storage.config';
11
13
  export type * from './types/cli.config';
12
14
  export type * from './types/encoding';
13
15
  export type * from './types/juno.env';
@@ -13,7 +13,7 @@ export type SatelliteDevDataStoreCollection = Omit<Rule, 'createdAt' | 'updatedA
13
13
  */
14
14
  export type SatelliteDevDbCollection = SatelliteDevDataStoreCollection;
15
15
  /**
16
- * Represents a storage collection configuration for a satellite in a development environment.
16
+ * Represents a Storage collection configuration for a satellite in a development environment.
17
17
  * @typedef {Omit<Rule, 'createdAt' | 'updatedAt' | 'maxCapacity' | 'version'>} SatelliteDevStorageCollection
18
18
  */
19
19
  export type SatelliteDevStorageCollection = Omit<Rule, 'createdAt' | 'updatedAt' | 'maxCapacity' | 'version'>;
@@ -23,13 +23,13 @@ export type SatelliteDevStorageCollection = Omit<Rule, 'createdAt' | 'updatedAt'
23
23
  */
24
24
  export interface SatelliteDevCollections {
25
25
  /**
26
- * The datastore collections configuration.
26
+ * The Datastore collections configuration.
27
27
  * @type {SatelliteDevDataStoreCollection[]}
28
28
  * @optional
29
29
  */
30
30
  datastore?: SatelliteDevDataStoreCollection[];
31
31
  /**
32
- * The datastore collections configuration.
32
+ * The Datastore collections configuration.
33
33
  * This property is deprecated. Use {@link datastore} instead.
34
34
  *
35
35
  * @deprecated
@@ -37,7 +37,7 @@ export interface SatelliteDevCollections {
37
37
  */
38
38
  db?: SatelliteDevDbCollection[];
39
39
  /**
40
- * The storage collections configuration.
40
+ * The Storage collections configuration.
41
41
  * @type {SatelliteDevStorageCollection[]}
42
42
  * @optional
43
43
  */
@@ -0,0 +1,19 @@
1
+ import type { MaxMemorySizeConfig } from '../../../shared/feature.config';
2
+ /**
3
+ * Configures the behavior of the Datastore.
4
+ * @interface DatastoreConfig
5
+ */
6
+ export interface DatastoreConfig {
7
+ /**
8
+ * Configuration for maximum memory size limits for the Datastore.
9
+ *
10
+ * This is used to specify optional limits on heap and stable memory for the smart contract.
11
+ * When the limit is reached, the Datastore and smart contract continue to operate normally but reject the creation or updates of documents.
12
+ *
13
+ * If not specified, no memory limits are enforced.
14
+ *
15
+ * @type {MaxMemorySizeConfig}
16
+ * @optional
17
+ */
18
+ maxMemorySize?: MaxMemorySizeConfig;
19
+ }
@@ -1,10 +1,11 @@
1
- import { ModuleSettings } from '../../../module/module.settings';
2
- import type { StorageConfig } from '../../../storage/storage.config';
1
+ import type { ModuleSettings } from '../../../module/module.settings';
2
+ import type { StorageConfig } from '../../../shared/storage.config';
3
3
  import type { CliConfig } from '../../../types/cli.config';
4
4
  import type { JunoConfigMode } from '../../../types/juno.env';
5
5
  import type { Either } from '../../../utils/ts.utils';
6
6
  import type { SatelliteAssertions } from './assertions.config';
7
7
  import type { AuthenticationConfig } from './authentication.config';
8
+ import type { DatastoreConfig } from './datastore.config';
8
9
  /**
9
10
  * Represents the unique identifier for a satellite.
10
11
  * @interface SatelliteId
@@ -53,6 +54,13 @@ export type SatelliteConfig = Either<SatelliteId, SatelliteIds> & CliConfig & {
53
54
  * @optional
54
55
  */
55
56
  storage?: StorageConfig;
57
+ /**
58
+ * Optional configuration parameters for the satellite, affecting the operational behavior of its Datastore.
59
+ * Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands.
60
+ * @type {DatastoreConfig}
61
+ * @optional
62
+ */
63
+ datastore?: DatastoreConfig;
56
64
  /**
57
65
  * Optional configuration parameters for the satellite, affecting the operational behavior of its Authentication.
58
66
  * Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands.
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Configuration for granting access to features only if the maximum memory size limits are not reached.
3
+ *
4
+ * The maximum size corresponds to the overall heap or stable memory of the smart contract.
5
+ */
6
+ export interface MaxMemorySizeConfig {
7
+ /**
8
+ * Maximum allowed heap memory size in bytes.
9
+ *
10
+ * This field is optional. If not specified, no limit is enforced on the heap memory size.
11
+ *
12
+ * @type {bigint}
13
+ */
14
+ heap?: bigint;
15
+ /**
16
+ * Maximum allowed stable memory size in bytes.
17
+ *
18
+ * This field is optional. If not specified, no limit is enforced on the stable memory size.
19
+ *
20
+ * @type {bigint}
21
+ */
22
+ stable?: bigint;
23
+ }
@@ -1,16 +1,17 @@
1
+ import type { MaxMemorySizeConfig } from './feature.config';
1
2
  /**
2
- * Represents a glob pattern for matching files in the storage configuration.
3
+ * Represents a glob pattern for matching files in the Storage configuration.
3
4
  * @typedef {string} StorageConfigSourceGlob
4
5
  */
5
6
  export type StorageConfigSourceGlob = string;
6
7
  /**
7
- * Headers allow the client and the storage to pass additional information along with a request or a response.
8
+ * Headers allow the client and the Storage to pass additional information along with a request or a response.
8
9
  * Some sets of headers can affect how the browser handles the page and its content.
9
10
  * @interface StorageConfigHeader
10
11
  */
11
12
  export interface StorageConfigHeader {
12
13
  /**
13
- * The glob pattern used to match files within the storage that these headers will apply to.
14
+ * The glob pattern used to match files within the Storage that these headers will apply to.
14
15
  * @type {StorageConfigSourceGlob}
15
16
  */
16
17
  source: StorageConfigSourceGlob;
@@ -62,7 +63,7 @@ export interface StorageConfigRedirect {
62
63
  code: 301 | 302;
63
64
  }
64
65
  /**
65
- * Configures the hosting behavior of the storage.
66
+ * Configures the hosting behavior of the Storage.
66
67
  * @interface StorageConfig
67
68
  */
68
69
  export interface StorageConfig {
@@ -111,4 +112,16 @@ export interface StorageConfig {
111
112
  * @optional
112
113
  */
113
114
  rawAccess?: boolean;
115
+ /**
116
+ * Configuration for maximum memory size limits for the Storage.
117
+ *
118
+ * This is used to specify optional limits on heap and stable memory for the smart contract.
119
+ * When the limit is reached, the Storage and smart contract continue to operate normally but reject the upload of new assets.
120
+ *
121
+ * If not specified, no memory limits are enforced.
122
+ *
123
+ * @type {MaxMemorySizeConfig}
124
+ * @optional
125
+ */
126
+ maxMemorySize?: MaxMemorySizeConfig;
114
127
  }
@@ -1,7 +1,7 @@
1
1
  import type { ENCODING_TYPE } from './encoding';
2
2
  export interface CliConfig {
3
3
  /**
4
- * Specifies the directory from which to deploy to storage.
4
+ * Specifies the directory from which to deploy to Storage.
5
5
  * For instance, if `npm run build` outputs files to a `dist` folder, use `source: 'dist'`.
6
6
  *
7
7
  * @default 'build'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/config",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Configuration options for Juno CLI",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",