@junobuild/config 2.15.1 → 3.0.0-next-2026-04-13

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
@@ -38,7 +38,6 @@ Configuration options for [Juno] CLI.
38
38
  - [StorageConfigRedirectSchema](#gear-storageconfigredirectschema)
39
39
  - [StorageConfigSchema](#gear-storageconfigschema)
40
40
  - [EncodingTypeSchema](#gear-encodingtypeschema)
41
- - [PrecompressSchema](#gear-precompressschema)
42
41
  - [CliConfigSchema](#gear-cliconfigschema)
43
42
  - [SatelliteIdSchema](#gear-satelliteidschema)
44
43
  - [SatelliteIdsSchema](#gear-satelliteidsschema)
@@ -330,29 +329,17 @@ see EncodingType
330
329
 
331
330
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/encoding.ts#L6)
332
331
 
333
- #### :gear: PrecompressSchema
334
-
335
- | Constant | Type |
336
- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
337
- | `PrecompressSchema` | `ZodObject<{ pattern: ZodOptional<ZodString>; mode: ZodOptional<ZodEnum<{ both: "both"; replace: "replace"; }>>; algorithm: ZodOptional<ZodEnum<{ gzip: "gzip"; brotli: "brotli"; }>>; }, $strict>` |
338
-
339
- References:
340
-
341
- - Precompress
342
-
343
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/cli.config.ts#L7)
344
-
345
332
  #### :gear: CliConfigSchema
346
333
 
347
334
  | Constant | Type |
348
335
  | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
349
- | `CliConfigSchema` | `ZodObject<{ source: ZodOptional<ZodString>; ignore: ZodOptional<ZodArray<ZodString>>; precompress: ZodOptional<ZodUnion<readonly [ZodObject<{ pattern: ZodOptional<ZodString>; mode: ZodOptional<...>; algorithm: ZodOptional<...>; }, $strict>, ZodArray<...>, ZodLiteral<...>]>>; encoding: ZodOptional<...>; predeploy: Zo...` |
336
+ | `CliConfigSchema` | `ZodObject<{ ignore: ZodOptional<ZodArray<ZodString>>; precompress: ZodOptional<ZodUnion<readonly [ZodObject<{ pattern: ZodOptional<ZodString>; mode: ZodOptional<ZodEnum<{ both: "both"; replace: "replace"; }>>; algorithm: ZodOptional<...>; }, $strict>, ZodArray<...>, ZodLiteral<...>]>>; encoding: ZodOptional<...>; pr...` |
350
337
 
351
338
  References:
352
339
 
353
340
  - CliConfig
354
341
 
355
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/cli.config.ts#L16)
342
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/cli.config.ts#L10)
356
343
 
357
344
  #### :gear: SatelliteIdSchema
358
345
 
@@ -364,7 +351,7 @@ References:
364
351
 
365
352
  - SatelliteId
366
353
 
367
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L21)
354
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L22)
368
355
 
369
356
  #### :gear: SatelliteIdsSchema
370
357
 
@@ -376,19 +363,19 @@ References:
376
363
 
377
364
  - SatelliteIds
378
365
 
379
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L40)
366
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L41)
380
367
 
381
368
  #### :gear: SatelliteConfigOptionsSchema
382
369
 
383
- | Constant | Type |
384
- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
385
- | `SatelliteConfigOptionsSchema` | `ZodUnion<readonly [ZodObject<{ storage: ZodOptional<ZodObject<{ headers: ZodOptional<ZodArray<ZodObject<{ source: ZodString; headers: ZodArray<ZodTuple<[ZodString, ZodString], null>>; }, $strict>>>; ... 5 more ...; version: ZodOptional<...>; }, $strip>>; ... 6 more ...; id: ZodString; }, $strict>, ZodObject<...>]>` |
370
+ | Constant | Type |
371
+ | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
372
+ | `SatelliteConfigOptionsSchema` | `ZodUnion<readonly [ZodObject<{ hosting: ZodOptional<ZodObject<{ source: ZodString; ignore: ZodOptional<ZodArray<ZodString>>; precompress: ZodOptional<ZodUnion<readonly [ZodObject<{ pattern: ZodOptional<ZodString>; mode: ZodOptional<...>; algorithm: ZodOptional<...>; }, $strict>, ZodArray<...>, ZodLiteral<...>]>>; en...` |
386
373
 
387
374
  References:
388
375
 
389
376
  - JunoConsoleConfig
390
377
 
391
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L80)
378
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L82)
392
379
 
393
380
  ### :tropical_drink: Interfaces
394
381
 
@@ -412,7 +399,6 @@ References:
412
399
  - [StorageConfigRewrite](#gear-storageconfigrewrite)
413
400
  - [StorageConfigRedirect](#gear-storageconfigredirect)
414
401
  - [StorageConfig](#gear-storageconfig)
415
- - [Precompress](#gear-precompress)
416
402
  - [CliConfig](#gear-cliconfig)
417
403
  - [SatelliteId](#gear-satelliteid)
418
404
  - [SatelliteIds](#gear-satelliteids)
@@ -672,32 +658,18 @@ Configures the hosting behavior of the Storage.
672
658
 
673
659
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/shared/storage.config.ts#L128)
674
660
 
675
- #### :gear: Precompress
676
-
677
- Configuration for compressing files during deployment.
678
-
679
- | Property | Type | Description |
680
- | ----------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | ---- |
681
- | `pattern` | `string or undefined` | Glob pattern for files to precompress. default: any css | js | mjs | html |
682
- | `mode` | `"both" or "replace" or undefined` | Determines what happens to the original files after compression: - `"both"` — upload both original and compressed versions. - `"replace"` — upload only the compressed version (served with `Content-Encoding`). default: "both" |
683
- | `algorithm` | `"gzip" or "brotli" or undefined` | Compression algorithm. default: "gzip" |
684
-
685
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/cli.config.ts#L30)
686
-
687
661
  #### :gear: CliConfig
688
662
 
689
- The configuration used by the CLI to resolve, prepare and deploy your app.
690
-
691
- | Property | Type | Description |
692
- | ------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
693
- | `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} |
694
- | `ignore` | `string[] or undefined` | Specifies files or patterns to ignore during deployment, using glob patterns similar to those in .gitignore. type: {string[]}optional |
695
- | `precompress` | `false or Precompress or Precompress[] or undefined` | Controls compression optimization for files in the source folder. By default, JavaScript (.js), ES Modules (.mjs), CSS (.css), and HTML (.html) are compressed, and both the original and compressed versions are uploaded. Set to `false` to disable, or provide one or more {@link Precompress} objects to customize. type: {Precompress or Precompress[] or false}optional |
696
- | `encoding` | `[string, EncodingType][] 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, EncodingType]>}optional |
697
- | `predeploy` | `string[] or undefined` | Defines a list of scripts or commands to be run before the deployment process begins. This can be useful for tasks such as compiling assets, running tests, or building production-ready files. Example: `json { "predeploy": ["npm run build", "npm run lint"] } ` type: {string[]}optional |
698
- | `postdeploy` | `string[] or undefined` | Defines a list of scripts or commands to be run after the deployment process completes. This can be used for tasks such as notifications, cleanup, or sending confirmation messages to services or team members. Example: `json { "postdeploy": ["./scripts/notify-admins.sh", "echo 'Deployment complete'"] } ` type: {string[]}optional |
663
+ | Property | Type | Description |
664
+ | ------------- | ---------------------------------------------------- | ----------------------------------------- |
665
+ | `source` | `string or undefined` | deprecated: use HostingConfig.source |
666
+ | `ignore` | `string[] or undefined` | deprecated: use HostingConfig.ignore |
667
+ | `precompress` | `false or Precompress or Precompress[] or undefined` | deprecated: use HostingConfig.precompress |
668
+ | `encoding` | `[string, EncodingType][] or undefined` | deprecated: use HostingConfig.encoding |
669
+ | `predeploy` | `string[] or undefined` | deprecated: use HostingConfig.predeploy |
670
+ | `postdeploy` | `string[] or undefined` | deprecated: use HostingConfig.postdeploy |
699
671
 
700
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/cli.config.ts#L56)
672
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/cli.config.ts#L18)
701
673
 
702
674
  #### :gear: SatelliteId
703
675
 
@@ -707,7 +679,7 @@ Represents the unique identifier for a satellite.
707
679
  | -------- | -------- | -------------------------------------------------------------------------------- |
708
680
  | `id` | `string` | The unique identifier (ID) of the satellite for this application. type: {string} |
709
681
 
710
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L29)
682
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L30)
711
683
 
712
684
  #### :gear: SatelliteIds
713
685
 
@@ -717,7 +689,7 @@ Represents a mapping of satellite identifiers to different configurations based
717
689
  | -------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
718
690
  | `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>} |
719
691
 
720
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L48)
692
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L49)
721
693
 
722
694
  #### :gear: SatelliteConfigOptions
723
695
 
@@ -728,17 +700,18 @@ authentication, automation, and deployment assertions.
728
700
  These options affect specific modules of the Satellite and may require manual application of
729
701
  changes, typically through CLI commands (e.g., `juno config`).
730
702
 
731
- | Property | Type | Description |
732
- | ---------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
733
- | `storage` | `StorageConfig or undefined` | Optional configuration parameters for the satellite, affecting the operational behavior of its Storage. Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands. type: {StorageConfig}optional |
734
- | `datastore` | `DatastoreConfig or undefined` | Optional configuration parameters for the satellite, affecting the operational behavior of its Datastore. Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands. type: {DatastoreConfig}optional |
735
- | `authentication` | `AuthenticationConfig or undefined` | Optional configuration parameters for the satellite, affecting the operational behavior of its Authentication. Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands. type: {AuthenticationConfig}optional |
736
- | `automation` | `AutomationConfig or undefined` | Optional configuration parameters for the behavior of the automation. Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands. type: {AutomationConfig}optional |
737
- | `assertions` | `SatelliteAssertions or undefined` | Optional configurations to override default assertions made by the CLI regarding satellite deployment conditions. type: {SatelliteAssertions}optional |
738
- | `settings` | `ModuleSettings or undefined` | Optional configuration parameters for the Satellite. These settings control various aspects of the module's behavior and resource usage. type: {ModuleSettings}optional |
739
- | `collections` | `Collections or undefined` | Optional configuration for the Datastore and Storage collections. type: {Collections}optional |
703
+ | Property | Type | Description |
704
+ | ---------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
705
+ | `hosting` | `HostingConfig or undefined` | Optional deploy-time configuration for bundling and uploading your frontend assets to the satellite. Controls the source folder, file ignoring, compression, encoding, and pre/post deploy hooks. Runs on your machine during `juno deploy`. type: {HostingConfig}optional |
706
+ | `storage` | `StorageConfig or undefined` | Optional serve-time configuration for how the satellite's Storage module handles HTTP requests. Controls headers, rewrites, redirects, iframe policy, and memory limits. Changes must be applied manually afterwards, for example with `juno config apply`. type: {StorageConfig}optional |
707
+ | `datastore` | `DatastoreConfig or undefined` | Optional configuration parameters for the satellite, affecting the operational behavior of its Datastore. Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands. type: {DatastoreConfig}optional |
708
+ | `authentication` | `AuthenticationConfig or undefined` | Optional configuration parameters for the satellite, affecting the operational behavior of its Authentication. Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands. type: {AuthenticationConfig}optional |
709
+ | `automation` | `AutomationConfig or undefined` | Optional configuration parameters for the behavior of the automation. Changes to these parameters must be applied manually afterwards, for example with the CLI using `juno config` commands. type: {AutomationConfig}optional |
710
+ | `assertions` | `SatelliteAssertions or undefined` | Optional configurations to override default assertions made by the CLI regarding satellite deployment conditions. type: {SatelliteAssertions}optional |
711
+ | `settings` | `ModuleSettings or undefined` | Optional configuration parameters for the Satellite. These settings control various aspects of the module's behavior and resource usage. type: {ModuleSettings}optional |
712
+ | `collections` | `Collections or undefined` | Optional configuration for the Datastore and Storage collections. type: {Collections}optional |
740
713
 
741
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L112)
714
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L114)
742
715
 
743
716
  ### :cocktail: Types
744
717
 
@@ -862,7 +835,7 @@ The configuration for running the Juno emulator.
862
835
  | ----------------- | ---------------------------------------------------------------------------- |
863
836
  | `SatelliteConfig` | `Either<SatelliteId, SatelliteIds> and CliConfig and SatelliteConfigOptions` |
864
837
 
865
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L176)
838
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L187)
866
839
 
867
840
  <!-- TSDOC_END -->
868
841
 
@@ -1,4 +1,4 @@
1
- import*as L from"zod";import*as bt from"zod";var G=e=>bt.custom(t=>e.implement(t));import*as b from"zod";import*as Tt from"zod";var V="abcdefghijklmnopqrstuvwxyz234567",P=Object.create(null);for(let e=0;e<V.length;e++)P[V[e]]=e;P[0]=P.o;P[1]=P.i;function ht(e){let t=0,o=0,n="";function i(a){return t<0?o|=a>>-t:o=a<<t&248,t>3?(t-=8,1):(t<4&&(n+=V[o>>3],t+=5),0)}for(let a=0;a<e.length;)a+=i(e[a]);return n+(t<0?V[o>>3]:"")}function gt(e){let t=0,o=0,n=new Uint8Array(e.length*4/3|0),i=0;function a(c){let s=P[c.toLowerCase()];if(s===void 0)throw new Error(`Invalid character: ${JSON.stringify(c)}`);s<<=3,o|=s>>>t,t+=5,t>=8&&(n[i++]=o,t-=8,t>0?o=s<<5-t&255:o=0)}for(let c of e)a(c);return n.slice(0,i)}var ee=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function yt(e){let t=-1;for(let o=0;o<e.length;o++){let i=(e[o]^t)&255;t=ee[i]^t>>>8}return(t^-1)>>>0}function oe(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function J(e,...t){if(!oe(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function nt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function St(e,t){J(e);let o=t.outputLen;if(e.length<o)throw new Error("digestInto() expects output buffer of length at least "+o)}function k(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function W(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function g(e,t){return e<<32-t|e>>>t}var zt=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ne=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function At(e){if(J(e),zt)return e.toHex();let t="";for(let o=0;o<e.length;o++)t+=ne[e[o]];return t}var z={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ct(e){if(e>=z._0&&e<=z._9)return e-z._0;if(e>=z.A&&e<=z.F)return e-(z.A-10);if(e>=z.a&&e<=z.f)return e-(z.a-10)}function Et(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(zt)return Uint8Array.fromHex(e);let t=e.length,o=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(o);for(let i=0,a=0;i<o;i++,a+=2){let c=Ct(e.charCodeAt(a)),s=Ct(e.charCodeAt(a+1));if(c===void 0||s===void 0){let l=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+a)}n[i]=c*16+s}return n}function ie(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function it(e){return typeof e=="string"&&(e=ie(e)),J(e),e}var K=class{};function wt(e){let t=n=>e().update(it(n)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}function re(e,t,o,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,o,n);let i=BigInt(32),a=BigInt(4294967295),c=Number(o>>i&a),s=Number(o&a),l=n?4:0,h=n?0:4;e.setUint32(t+l,c,n),e.setUint32(t+h,s,n)}function Ot(e,t,o){return e&t^~e&o}function It(e,t,o){return e&t^e&o^t&o}var q=class extends K{constructor(t,o,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=o,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(t),this.view=W(this.buffer)}update(t){nt(this),t=it(t),J(t);let{view:o,buffer:n,blockLen:i}=this,a=t.length;for(let c=0;c<a;){let s=Math.min(i-this.pos,a-c);if(s===i){let l=W(t);for(;i<=a-c;c+=i)this.process(l,c);continue}n.set(t.subarray(c,c+s),this.pos),this.pos+=s,c+=s,this.pos===i&&(this.process(o,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){nt(this),St(t,this),this.finished=!0;let{buffer:o,view:n,blockLen:i,isLE:a}=this,{pos:c}=this;o[c++]=128,k(this.buffer.subarray(c)),this.padOffset>i-c&&(this.process(n,0),c=0);for(let x=c;x<i;x++)o[x]=0;re(n,i-8,BigInt(this.length*8),a),this.process(n,0);let s=W(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=l/4,O=this.get();if(h>O.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;x<h;x++)s.setUint32(4*x,O[x],a)}digest(){let{buffer:t,outputLen:o}=this;this.digestInto(t);let n=t.slice(0,o);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:o,buffer:n,length:i,finished:a,destroyed:c,pos:s}=this;return t.destroyed=c,t.finished=a,t.length=i,t.pos=s,i%o&&t.buffer.set(n),t}clone(){return this._cloneInto()}},A=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),E=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]);var ae=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),I=new Uint32Array(64),rt=class extends q{constructor(t=32){super(64,t,8,!1),this.A=A[0]|0,this.B=A[1]|0,this.C=A[2]|0,this.D=A[3]|0,this.E=A[4]|0,this.F=A[5]|0,this.G=A[6]|0,this.H=A[7]|0}get(){let{A:t,B:o,C:n,D:i,E:a,F:c,G:s,H:l}=this;return[t,o,n,i,a,c,s,l]}set(t,o,n,i,a,c,s,l){this.A=t|0,this.B=o|0,this.C=n|0,this.D=i|0,this.E=a|0,this.F=c|0,this.G=s|0,this.H=l|0}process(t,o){for(let x=0;x<16;x++,o+=4)I[x]=t.getUint32(o,!1);for(let x=16;x<64;x++){let F=I[x-15],H=I[x-2],mt=g(F,7)^g(F,18)^F>>>3,ot=g(H,17)^g(H,19)^H>>>10;I[x]=ot+I[x-7]+mt+I[x-16]|0}let{A:n,B:i,C:a,D:c,E:s,F:l,G:h,H:O}=this;for(let x=0;x<64;x++){let F=g(s,6)^g(s,11)^g(s,25),H=O+F+Ot(s,l,h)+ae[x]+I[x]|0,ot=(g(n,2)^g(n,13)^g(n,22))+It(n,i,a)|0;O=h,h=l,l=s,s=c+H|0,c=a,a=i,i=n,n=H+ot|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,c=c+this.D|0,s=s+this.E|0,l=l+this.F|0,h=h+this.G|0,O=O+this.H|0,this.set(n,i,a,c,s,l,h,O)}roundClean(){k(I)}destroy(){this.set(0,0,0,0,0,0,0,0),k(this.buffer)}},at=class extends rt{constructor(){super(28),this.A=E[0]|0,this.B=E[1]|0,this.C=E[2]|0,this.D=E[3]|0,this.E=E[4]|0,this.F=E[5]|0,this.G=E[6]|0,this.H=E[7]|0}};var _t=wt(()=>new at);var $="__principal__",ce=2,Rt=4,se="aaaaa-aa",D=class e{static anonymous(){return new this(new Uint8Array([Rt]))}static managementCanister(){return this.fromText(se)}static selfAuthenticating(t){let o=_t(t);return new this(new Uint8Array([...o,ce]))}static from(t){if(typeof t=="string")return e.fromText(t);if(Object.getPrototypeOf(t)===Uint8Array.prototype)return new e(t);if(e.isPrincipal(t))return new e(t._arr);throw new Error(`Impossible to convert ${JSON.stringify(t)} to Principal.`)}static fromHex(t){return new this(Et(t))}static fromText(t){let o=t;if(t.includes($)){let c=JSON.parse(t);$ in c&&(o=c[$])}let n=o.toLowerCase().replace(/-/g,""),i=gt(n);i=i.slice(4,i.length);let a=new this(i);if(a.toText()!==o)throw new Error(`Principal "${a.toText()}" does not have a valid checksum (original value "${o}" may not be a valid Principal ID).`);return a}static fromUint8Array(t){return new this(t)}static isPrincipal(t){return t instanceof e||typeof t=="object"&&t!==null&&"_isPrincipal"in t&&t._isPrincipal===!0&&"_arr"in t&&t._arr instanceof Uint8Array}constructor(t){this._arr=t,this._isPrincipal=!0}isAnonymous(){return this._arr.byteLength===1&&this._arr[0]===Rt}toUint8Array(){return this._arr}toHex(){return At(this._arr).toUpperCase()}toText(){let t=new ArrayBuffer(4);new DataView(t).setUint32(0,yt(this._arr));let n=new Uint8Array(t),i=new Uint8Array([...n,...this._arr]),c=ht(i).match(/.{1,5}/g);if(!c)throw new Error;return c.join("-")}toString(){return this.toText()}toJSON(){return{[$]:this.toText()}}compareTo(t){for(let o=0;o<Math.min(this._arr.length,t._arr.length);o++){if(this._arr[o]<t._arr[o])return"lt";if(this._arr[o]>t._arr[o])return"gt"}return this._arr.length<t._arr.length?"lt":this._arr.length>t._arr.length?"gt":"eq"}ltEq(t){let o=this.compareTo(t);return o=="lt"||o=="eq"}gtEq(t){let o=this.compareTo(t);return o=="gt"||o=="eq"}};import{PrincipalTextSchema as fe}from"@junobuild/schema";import*as v from"zod";var U=v.string().refine(e=>fe.safeParse(e).success,{message:"Invalid textual representation of a Principal."}),M=v.unknown().transform((e,t)=>D.isPrincipal(e)?D.from(e):(t.issues.push({code:"custom",message:"Invalid Principal",input:e}),v.NEVER));var jt=Tt.unknown().refine(e=>e!=null&&typeof e=="object"&&"transformRequest"in e&&typeof e.transformRequest=="function"&&"getPrincipal"in e&&typeof e.getPrincipal=="function"&&M.safeParse(e.getPrincipal()).success,{message:"Invalid Identity"});var ct=b.strictObject({satelliteId:M,orbiterId:M.optional(),identity:jt,container:b.string().optional()}),xe=b.function({input:b.tuple([ct]),output:b.promise(b.void()).or(b.void())}),st=b.strictObject({run:G(xe)});var pe=L.function({input:L.tuple([ct]),output:st}),So=L.union([st,G(pe)]);function zo(e){return e}import*as Pt from"zod";import*as _ from"zod";var T=_.union([_.literal("production"),_.string()]),Ht=_.object({mode:T});var Oo=Ht.extend({profile:Pt.string().optional()});function _o(e){return e}import{PrincipalTextSchema as ye}from"@junobuild/schema";import*as y from"zod";import*as Q from"zod";var X=Q.strictObject({url:Q.url()});import{PrincipalTextSchema as vt}from"@junobuild/schema";import*as u from"zod";var le=u.strictObject({derivationOrigin:u.url().optional(),externalAlternativeOrigins:u.array(u.url()).optional()}),Ut=u.strictObject({allowedTargets:u.array(vt).nullable().optional(),sessionDuration:u.bigint().max(30n*24n*60n*60n*1000000000n,"The maximal length of a defined session duration - maxTimeToLive - cannot exceed 30 days").optional()}),ue=u.strictObject({clientId:u.string().trim().regex(/^[0-9]+-[a-z0-9]+\.apps\.googleusercontent\.com$/,"Invalid Google client ID format").max(128,"Google clientId too long"),delegation:Ut.optional()}),de=u.strictObject({clientId:u.string().trim().min(1,"GitHub clientId cannot be empty").max(128,"GitHub clientId too long"),delegation:Ut.optional()}),me=u.strictObject({allowedCallers:u.array(vt)}),Y=u.strictObject({internetIdentity:le.optional(),google:ue.optional(),github:de.optional(),rules:me.optional(),version:u.bigint().optional()});import*as f from"zod";import*as B from"zod";var Z=B.object({heap:B.bigint().optional(),stable:B.bigint().optional()}).strict();var ft=f.string(),be=f.object({source:ft,headers:f.array(f.tuple([f.string(),f.string()]))}).strict(),he=f.object({source:ft,destination:f.string()}).strict(),ge=f.object({source:ft,location:f.string(),code:f.union([f.literal(301),f.literal(302)])}).strict(),tt=f.object({headers:f.array(be).optional(),rewrites:f.array(he).optional(),redirects:f.array(ge).optional(),iframe:f.enum(["deny","same-origin","allow-any"]).optional(),rawAccess:f.boolean().optional(),maxMemorySize:Z.optional(),version:f.bigint().optional()});import*as p from"zod";import*as Lt from"zod";var Ft=Lt.enum(["identity","gzip","compress","deflate","br"]);var Jt=p.strictObject({pattern:p.string().optional(),mode:p.enum(["both","replace"]).optional(),algorithm:p.enum(["gzip","brotli"]).optional()}),kt=p.strictObject({source:p.string().optional(),ignore:p.array(p.string()).optional(),precompress:p.union([Jt,p.array(Jt),p.literal(!1)]).optional(),encoding:p.array(p.tuple([p.string(),Ft])).optional(),predeploy:p.array(p.string()).optional(),postdeploy:p.array(p.string()).optional()});var Ce=y.object({id:ye}),Se=y.object({ids:y.record(T,U)}),Dt=y.object({...kt.shape,storage:tt.optional(),authentication:Y.optional(),api:X.optional()}),Ko=y.union([y.object({...Ce.shape,...Dt.shape}).strict(),y.object({...Se.shape,...Dt.shape}).strict()]);import*as w from"zod";var ze=w.record(w.string(),w.string()),qo=w.object({name:w.string(),version:w.string(),dependencies:ze.optional()});var Qo="@junobuild/satellite",Xo="@junobuild/sputnik",Yo="@junobuild/mission-control",Zo="@junobuild/orbiter";function en(e){return e}import*as R from"zod";var Mt=R.strictObject({heapMemory:R.union([R.bigint(),R.boolean()]).optional()});import*as N from"zod";import*as d from"zod";var Bt=d.enum(["public","private","managed","controllers"]),Ae=d.enum(["heap","stable"]),rn=d.enum(["db","storage"]),xt=d.strictObject({collection:d.string(),read:Bt,write:Bt,memory:Ae,createdAt:d.bigint().optional(),updatedAt:d.bigint().optional(),version:d.bigint().optional(),maxSize:d.bigint().optional(),maxChangesPerUser:d.number().optional(),maxCapacity:d.number().optional(),mutablePermissions:d.boolean().optional().default(!0),maxTokens:d.bigint().optional()});var Ee=xt.omit({createdAt:!0,updatedAt:!0,maxSize:!0}),we=xt.omit({createdAt:!0,updatedAt:!0,maxCapacity:!0}),Nt=N.strictObject({datastore:N.array(Ee).optional(),storage:N.array(we).optional()});import*as et from"zod";var Gt=et.strictObject({maxMemorySize:Z.optional(),version:et.bigint().optional()});import*as r from"zod";var pt={registry:!1,cmc:!0,icp:!0,cycles:!0,nns:!0,sns:!1,internet_identity:!0,nns_dapp:!1},Vt={...pt,cycles:!1,cmc:!1,nns:!1};var Oe=["icp"],Ie=["icp","nns"],_e=["cmc","icp","nns"],Re=["cmc","icp","nns","sns","internet_identity"],Te=(e,t)=>{let n={..."satellite"in e?Vt:pt,...e.network?.services??{}},i=({requiredServices:a,key:c})=>{a.find(l=>n[l]===!1)!==void 0&&t.addIssue({code:"custom",path:["network","services",c],message:`${c} requires: ${a.join(", ")}`})};n.nns_dapp&&i({requiredServices:Re,key:"nns_dapp"}),n.cmc&&i({requiredServices:Ie,key:"cmc"}),n.cycles&&i({requiredServices:_e,key:"cycles"}),n.nns&&i({requiredServices:Oe,key:"nns"})},Kt=(e,t)=>{e.network!==void 0&&e.network.services!==void 0&&Te(e,t)};var dt=r.strictObject({server:r.number().optional(),admin:r.number().optional(),timeoutInSeconds:r.number().int().positive().optional()}),je=r.strictObject({console:r.number().optional()}),He=r.strictObject({ports:dt.extend(je.shape).optional()}),Pe=r.strictObject({ports:dt.optional()}),ve=r.strictObject({ports:dt.optional()}),Wt=r.string().min(1),lt=r.strictObject({type:r.enum(["docker","podman"]),image:r.string().optional(),name:r.string().optional(),volume:r.string().optional(),target:r.string().optional(),platform:r.enum(["linux/amd64","linux/arm64"]).optional(),extraHosts:r.array(r.tuple([Wt,r.union([r.ipv4(),r.ipv6(),r.literal("host-gateway"),Wt])])).min(1).optional()}),Ue=r.strictObject({registry:r.boolean().optional(),cmc:r.boolean().optional(),icp:r.boolean().optional(),cycles:r.boolean().optional(),nns:r.boolean().optional(),sns:r.boolean().optional(),internet_identity:r.boolean().optional(),nns_dapp:r.boolean().optional()}),ut=r.strictObject({services:Ue}),qt=r.union([r.strictObject({runner:lt.optional(),network:ut.optional(),skylab:He}),r.strictObject({runner:lt.optional(),network:ut.optional(),console:Pe}),r.strictObject({runner:lt.optional(),network:ut.optional(),satellite:ve})]).superRefine(Kt);import*as C from"zod";var Le=C.enum(["controllers","public"]),$t=C.strictObject({freezingThreshold:C.bigint().optional(),reservedCyclesLimit:C.bigint().optional(),logVisibility:Le.optional(),heapMemoryLimit:C.bigint().optional(),memoryAllocation:C.bigint().optional(),computeAllocation:C.bigint().optional()});import{PrincipalTextSchema as Fe}from"@junobuild/schema";import*as j from"zod";var Je=j.object({id:Fe}),ke=j.object({ids:j.record(T,U)}),Qt=j.union([Je.strict(),ke.strict()]);import{PrincipalTextSchema as Ge}from"@junobuild/schema";import*as S from"zod";import*as m from"zod";var De=m.enum(["Write","Submit"]),Me=m.strictObject({scope:De.optional(),timeToLive:m.bigint().max(60n*60n*1000000000n,"The maximal length of a defined session duration - maxTimeToLive - cannot exceed 1 hour").optional()}),Be=m.strictObject({owner:m.string().trim().min(1,"Repository owner cannot be empty").max(256,"Repository owner too long"),name:m.string().trim().min(1,"Repository name cannot be empty").max(256,"Repository name too long"),refs:m.array(m.string().trim().min(1)).optional()}),Ne=m.strictObject({repositories:m.array(Be).min(1,"At least one repository required").refine(e=>{let t=e.map(o=>`${o.owner}/${o.name}`);return t.length===new Set(t).size},{message:"Duplicate repositories are not allowed"}),accessKeys:Me.optional()}),Xt=m.strictObject({github:Ne.optional(),version:m.bigint().optional()});var Ve=S.object({id:Ge}),Ke=S.object({ids:S.record(T,U)}),Yt=S.object({storage:tt.optional(),datastore:Gt.optional(),authentication:Y.optional(),automation:Xt.optional(),assertions:Mt.optional(),settings:$t.optional(),collections:Nt.optional()}),Zt=S.union([S.object({...Ve.shape,...Yt.shape}).strict(),S.object({...Ke.shape,...Yt.shape}).strict()]);import*as te from"zod";var Fn=te.strictObject({satellite:Zt,orbiter:Qt.optional(),emulator:qt.optional(),api:X.optional()});export{Ut as AuthenticationConfigDelegationSchema,de as AuthenticationConfigGitHubSchema,ue as AuthenticationConfigGoogleSchema,le as AuthenticationConfigInternetIdentitySchema,me as AuthenticationConfigRulesSchema,Y as AuthenticationConfigSchema,Me as AutomationAccessKeysConfigSchema,Ne as AutomationConfigGitHubSchema,Be as AutomationConfigRepositorySchema,Xt as AutomationConfigSchema,De as AutomationScopeSchema,kt as CliConfigSchema,Nt as CollectionsSchema,Ce as ConsoleIdSchema,Se as ConsoleIdsSchema,pt as DEFAULT_NETWORK_SERVICES,Vt as DEFAULT_SATELLITE_NETWORK_SERVICES,Ee as DatastoreCollectionSchema,Gt as DatastoreConfigSchema,qt as EmulatorConfigSchema,Ft as EncodingTypeSchema,Yo as JUNO_PACKAGE_MISSION_CONTROL_ID,Zo as JUNO_PACKAGE_ORBITER_ID,Qo as JUNO_PACKAGE_SATELLITE_ID,Xo as JUNO_PACKAGE_SPUTNIK_ID,Ht as JunoConfigEnvSchema,T as JunoConfigModeSchema,Fn as JunoConfigSchema,Ko as JunoConsoleConfigSchema,ze as JunoPackageDependenciesSchema,qo as JunoPackageSchema,Z as MaxMemorySizeConfigSchema,Ae as MemoryTextSchema,Le as ModuleLogVisibilitySchema,$t as ModuleSettingsSchema,ct as OnRunContextSchema,Oo as OnRunEnvSchema,st as OnRunSchema,Qt as OrbiterConfigSchema,Je as OrbiterIdSchema,ke as OrbiterIdsSchema,Bt as PermissionTextSchema,Jt as PrecompressSchema,xt as RuleSchema,rn as RulesTypeSchema,So as RunFnOrObjectSchema,pe as RunFnSchema,Mt as SatelliteAssertionsSchema,Zt as SatelliteConfigOptionsSchema,Ve as SatelliteIdSchema,Ke as SatelliteIdsSchema,we as StorageCollectionSchema,be as StorageConfigHeaderSchema,ge as StorageConfigRedirectSchema,he as StorageConfigRewriteSchema,tt as StorageConfigSchema,ft as StorageConfigSourceGlobSchema,en as defineConfig,_o as defineConsoleConfig,zo as defineRun};
1
+ import*as L from"zod";import*as ht from"zod";var V=e=>ht.custom(t=>e.implement(t));import*as b from"zod";import*as Ht from"zod";var K="abcdefghijklmnopqrstuvwxyz234567",P=Object.create(null);for(let e=0;e<K.length;e++)P[K[e]]=e;P[0]=P.o;P[1]=P.i;function gt(e){let t=0,o=0,n="";function i(a){return t<0?o|=a>>-t:o=a<<t&248,t>3?(t-=8,1):(t<4&&(n+=K[o>>3],t+=5),0)}for(let a=0;a<e.length;)a+=i(e[a]);return n+(t<0?K[o>>3]:"")}function yt(e){let t=0,o=0,n=new Uint8Array(e.length*4/3|0),i=0;function a(c){let s=P[c.toLowerCase()];if(s===void 0)throw new Error(`Invalid character: ${JSON.stringify(c)}`);s<<=3,o|=s>>>t,t+=5,t>=8&&(n[i++]=o,t-=8,t>0?o=s<<5-t&255:o=0)}for(let c of e)a(c);return n.slice(0,i)}var oe=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function Ct(e){let t=-1;for(let o=0;o<e.length;o++){let i=(e[o]^t)&255;t=oe[i]^t>>>8}return(t^-1)>>>0}function ne(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function k(e,...t){if(!ne(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function it(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function zt(e,t){k(e);let o=t.outputLen;if(e.length<o)throw new Error("digestInto() expects output buffer of length at least "+o)}function D(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function q(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function g(e,t){return e<<32-t|e>>>t}var At=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ie=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Et(e){if(k(e),At)return e.toHex();let t="";for(let o=0;o<e.length;o++)t+=ie[e[o]];return t}var z={_0:48,_9:57,A:65,F:70,a:97,f:102};function St(e){if(e>=z._0&&e<=z._9)return e-z._0;if(e>=z.A&&e<=z.F)return e-(z.A-10);if(e>=z.a&&e<=z.f)return e-(z.a-10)}function wt(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(At)return Uint8Array.fromHex(e);let t=e.length,o=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(o);for(let i=0,a=0;i<o;i++,a+=2){let c=St(e.charCodeAt(a)),s=St(e.charCodeAt(a+1));if(c===void 0||s===void 0){let l=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+a)}n[i]=c*16+s}return n}function re(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function rt(e){return typeof e=="string"&&(e=re(e)),k(e),e}var W=class{};function Ot(e){let t=n=>e().update(rt(n)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}function ae(e,t,o,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,o,n);let i=BigInt(32),a=BigInt(4294967295),c=Number(o>>i&a),s=Number(o&a),l=n?4:0,h=n?0:4;e.setUint32(t+l,c,n),e.setUint32(t+h,s,n)}function It(e,t,o){return e&t^~e&o}function _t(e,t,o){return e&t^e&o^t&o}var $=class extends W{constructor(t,o,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=o,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(t),this.view=q(this.buffer)}update(t){it(this),t=rt(t),k(t);let{view:o,buffer:n,blockLen:i}=this,a=t.length;for(let c=0;c<a;){let s=Math.min(i-this.pos,a-c);if(s===i){let l=q(t);for(;i<=a-c;c+=i)this.process(l,c);continue}n.set(t.subarray(c,c+s),this.pos),this.pos+=s,c+=s,this.pos===i&&(this.process(o,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){it(this),zt(t,this),this.finished=!0;let{buffer:o,view:n,blockLen:i,isLE:a}=this,{pos:c}=this;o[c++]=128,D(this.buffer.subarray(c)),this.padOffset>i-c&&(this.process(n,0),c=0);for(let p=c;p<i;p++)o[p]=0;ae(n,i-8,BigInt(this.length*8),a),this.process(n,0);let s=q(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=l/4,O=this.get();if(h>O.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<h;p++)s.setUint32(4*p,O[p],a)}digest(){let{buffer:t,outputLen:o}=this;this.digestInto(t);let n=t.slice(0,o);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:o,buffer:n,length:i,finished:a,destroyed:c,pos:s}=this;return t.destroyed=c,t.finished=a,t.length=i,t.pos=s,i%o&&t.buffer.set(n),t}clone(){return this._cloneInto()}},A=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),E=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]);var ce=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),I=new Uint32Array(64),at=class extends ${constructor(t=32){super(64,t,8,!1),this.A=A[0]|0,this.B=A[1]|0,this.C=A[2]|0,this.D=A[3]|0,this.E=A[4]|0,this.F=A[5]|0,this.G=A[6]|0,this.H=A[7]|0}get(){let{A:t,B:o,C:n,D:i,E:a,F:c,G:s,H:l}=this;return[t,o,n,i,a,c,s,l]}set(t,o,n,i,a,c,s,l){this.A=t|0,this.B=o|0,this.C=n|0,this.D=i|0,this.E=a|0,this.F=c|0,this.G=s|0,this.H=l|0}process(t,o){for(let p=0;p<16;p++,o+=4)I[p]=t.getUint32(o,!1);for(let p=16;p<64;p++){let J=I[p-15],j=I[p-2],bt=g(J,7)^g(J,18)^J>>>3,nt=g(j,17)^g(j,19)^j>>>10;I[p]=nt+I[p-7]+bt+I[p-16]|0}let{A:n,B:i,C:a,D:c,E:s,F:l,G:h,H:O}=this;for(let p=0;p<64;p++){let J=g(s,6)^g(s,11)^g(s,25),j=O+J+It(s,l,h)+ce[p]+I[p]|0,nt=(g(n,2)^g(n,13)^g(n,22))+_t(n,i,a)|0;O=h,h=l,l=s,s=c+j|0,c=a,a=i,i=n,n=j+nt|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,c=c+this.D|0,s=s+this.E|0,l=l+this.F|0,h=h+this.G|0,O=O+this.H|0,this.set(n,i,a,c,s,l,h,O)}roundClean(){D(I)}destroy(){this.set(0,0,0,0,0,0,0,0),D(this.buffer)}},ct=class extends at{constructor(){super(28),this.A=E[0]|0,this.B=E[1]|0,this.C=E[2]|0,this.D=E[3]|0,this.E=E[4]|0,this.F=E[5]|0,this.G=E[6]|0,this.H=E[7]|0}};var Rt=Ot(()=>new ct);var Q="__principal__",se=2,Tt=4,fe="aaaaa-aa",M=class e{static anonymous(){return new this(new Uint8Array([Tt]))}static managementCanister(){return this.fromText(fe)}static selfAuthenticating(t){let o=Rt(t);return new this(new Uint8Array([...o,se]))}static from(t){if(typeof t=="string")return e.fromText(t);if(Object.getPrototypeOf(t)===Uint8Array.prototype)return new e(t);if(e.isPrincipal(t))return new e(t._arr);throw new Error(`Impossible to convert ${JSON.stringify(t)} to Principal.`)}static fromHex(t){return new this(wt(t))}static fromText(t){let o=t;if(t.includes(Q)){let c=JSON.parse(t);Q in c&&(o=c[Q])}let n=o.toLowerCase().replace(/-/g,""),i=yt(n);i=i.slice(4,i.length);let a=new this(i);if(a.toText()!==o)throw new Error(`Principal "${a.toText()}" does not have a valid checksum (original value "${o}" may not be a valid Principal ID).`);return a}static fromUint8Array(t){return new this(t)}static isPrincipal(t){return t instanceof e||typeof t=="object"&&t!==null&&"_isPrincipal"in t&&t._isPrincipal===!0&&"_arr"in t&&t._arr instanceof Uint8Array}constructor(t){this._arr=t,this._isPrincipal=!0}isAnonymous(){return this._arr.byteLength===1&&this._arr[0]===Tt}toUint8Array(){return this._arr}toHex(){return Et(this._arr).toUpperCase()}toText(){let t=new ArrayBuffer(4);new DataView(t).setUint32(0,Ct(this._arr));let n=new Uint8Array(t),i=new Uint8Array([...n,...this._arr]),c=gt(i).match(/.{1,5}/g);if(!c)throw new Error;return c.join("-")}toString(){return this.toText()}toJSON(){return{[Q]:this.toText()}}compareTo(t){for(let o=0;o<Math.min(this._arr.length,t._arr.length);o++){if(this._arr[o]<t._arr[o])return"lt";if(this._arr[o]>t._arr[o])return"gt"}return this._arr.length<t._arr.length?"lt":this._arr.length>t._arr.length?"gt":"eq"}ltEq(t){let o=this.compareTo(t);return o=="lt"||o=="eq"}gtEq(t){let o=this.compareTo(t);return o=="gt"||o=="eq"}};import{PrincipalTextSchema as pe}from"@junobuild/schema";import*as v from"zod";var U=v.string().refine(e=>pe.safeParse(e).success,{message:"Invalid textual representation of a Principal."}),B=v.unknown().transform((e,t)=>M.isPrincipal(e)?M.from(e):(t.issues.push({code:"custom",message:"Invalid Principal",input:e}),v.NEVER));var jt=Ht.unknown().refine(e=>e!=null&&typeof e=="object"&&"transformRequest"in e&&typeof e.transformRequest=="function"&&"getPrincipal"in e&&typeof e.getPrincipal=="function"&&B.safeParse(e.getPrincipal()).success,{message:"Invalid Identity"});var st=b.strictObject({satelliteId:B,orbiterId:B.optional(),identity:jt,container:b.string().optional()}),xe=b.function({input:b.tuple([st]),output:b.promise(b.void()).or(b.void())}),ft=b.strictObject({run:V(xe)});var le=L.function({input:L.tuple([st]),output:ft}),Eo=L.union([ft,V(le)]);function wo(e){return e}import*as vt from"zod";import*as _ from"zod";var T=_.union([_.literal("production"),_.string()]),Pt=_.object({mode:T});var Ro=Pt.extend({profile:vt.string().optional()});function Ho(e){return e}import{PrincipalTextSchema as Ce}from"@junobuild/schema";import*as y from"zod";import*as X from"zod";var Y=X.strictObject({url:X.url()});import{PrincipalTextSchema as Ut}from"@junobuild/schema";import*as u from"zod";var ue=u.strictObject({derivationOrigin:u.url().optional(),externalAlternativeOrigins:u.array(u.url()).optional()}),Lt=u.strictObject({allowedTargets:u.array(Ut).nullable().optional(),sessionDuration:u.bigint().max(30n*24n*60n*60n*1000000000n,"The maximal length of a defined session duration - maxTimeToLive - cannot exceed 30 days").optional()}),de=u.strictObject({clientId:u.string().trim().regex(/^[0-9]+-[a-z0-9]+\.apps\.googleusercontent\.com$/,"Invalid Google client ID format").max(128,"Google clientId too long"),delegation:Lt.optional()}),me=u.strictObject({clientId:u.string().trim().min(1,"GitHub clientId cannot be empty").max(128,"GitHub clientId too long"),delegation:Lt.optional()}),be=u.strictObject({allowedCallers:u.array(Ut)}),Z=u.strictObject({internetIdentity:ue.optional(),google:de.optional(),github:me.optional(),rules:be.optional(),version:u.bigint().optional()});import*as f from"zod";import*as N from"zod";var tt=N.object({heap:N.bigint().optional(),stable:N.bigint().optional()}).strict();var pt=f.string(),he=f.object({source:pt,headers:f.array(f.tuple([f.string(),f.string()]))}).strict(),ge=f.object({source:pt,destination:f.string()}).strict(),ye=f.object({source:pt,location:f.string(),code:f.union([f.literal(301),f.literal(302)])}).strict(),et=f.object({headers:f.array(he).optional(),rewrites:f.array(ge).optional(),redirects:f.array(ye).optional(),iframe:f.enum(["deny","same-origin","allow-any"]).optional(),rawAccess:f.boolean().optional(),maxMemorySize:tt.optional(),version:f.bigint().optional()});import*as x from"zod";import*as Ft from"zod";var Jt=Ft.enum(["identity","gzip","compress","deflate","br"]);var kt=x.strictObject({pattern:x.string().optional(),mode:x.enum(["both","replace"]).optional(),algorithm:x.enum(["gzip","brotli"]).optional()}),F=x.strictObject({source:x.string(),ignore:x.array(x.string()).optional(),precompress:x.union([kt,x.array(kt),x.literal(!1)]).optional(),encoding:x.array(x.tuple([x.string(),Jt])).optional(),predeploy:x.array(x.string()).optional(),postdeploy:x.array(x.string()).optional()});var Se=y.object({id:Ce}),ze=y.object({ids:y.record(T,U)}),Dt=y.object({hosting:F.optional(),storage:et.optional(),authentication:Z.optional(),api:Y.optional()}),$o=y.union([y.object({...Se.shape,...Dt.shape}).strict(),y.object({...ze.shape,...Dt.shape}).strict()]);import*as w from"zod";var Ae=w.record(w.string(),w.string()),Xo=w.object({name:w.string(),version:w.string(),dependencies:Ae.optional()});var Zo="@junobuild/satellite",tn="@junobuild/sputnik",en="@junobuild/mission-control",on="@junobuild/orbiter";function rn(e){return e}import*as R from"zod";var Mt=R.strictObject({heapMemory:R.union([R.bigint(),R.boolean()]).optional()});import*as G from"zod";import*as d from"zod";var Bt=d.enum(["public","private","managed","controllers"]),Ee=d.enum(["heap","stable"]),sn=d.enum(["db","storage"]),xt=d.strictObject({collection:d.string(),read:Bt,write:Bt,memory:Ee,createdAt:d.bigint().optional(),updatedAt:d.bigint().optional(),version:d.bigint().optional(),maxSize:d.bigint().optional(),maxChangesPerUser:d.number().optional(),maxCapacity:d.number().optional(),mutablePermissions:d.boolean().optional().default(!0),maxTokens:d.bigint().optional()});var we=xt.omit({createdAt:!0,updatedAt:!0,maxSize:!0}),Oe=xt.omit({createdAt:!0,updatedAt:!0,maxCapacity:!0}),Nt=G.strictObject({datastore:G.array(we).optional(),storage:G.array(Oe).optional()});import*as ot from"zod";var Gt=ot.strictObject({maxMemorySize:tt.optional(),version:ot.bigint().optional()});import*as r from"zod";var lt={registry:!1,cmc:!0,icp:!0,cycles:!0,nns:!0,sns:!1,internet_identity:!0,nns_dapp:!1},Vt={...lt,cycles:!1,cmc:!1,nns:!1};var Ie=["icp"],_e=["icp","nns"],Re=["cmc","icp","nns"],Te=["cmc","icp","nns","sns","internet_identity"],He=(e,t)=>{let n={..."satellite"in e?Vt:lt,...e.network?.services??{}},i=({requiredServices:a,key:c})=>{a.find(l=>n[l]===!1)!==void 0&&t.addIssue({code:"custom",path:["network","services",c],message:`${c} requires: ${a.join(", ")}`})};n.nns_dapp&&i({requiredServices:Te,key:"nns_dapp"}),n.cmc&&i({requiredServices:_e,key:"cmc"}),n.cycles&&i({requiredServices:Re,key:"cycles"}),n.nns&&i({requiredServices:Ie,key:"nns"})},Kt=(e,t)=>{e.network!==void 0&&e.network.services!==void 0&&He(e,t)};var mt=r.strictObject({server:r.number().optional(),admin:r.number().optional(),timeoutInSeconds:r.number().int().positive().optional()}),je=r.strictObject({console:r.number().optional()}),Pe=r.strictObject({ports:mt.extend(je.shape).optional()}),ve=r.strictObject({ports:mt.optional()}),Ue=r.strictObject({ports:mt.optional()}),Wt=r.string().min(1),ut=r.strictObject({type:r.enum(["docker","podman"]),image:r.string().optional(),name:r.string().optional(),volume:r.string().optional(),target:r.string().optional(),platform:r.enum(["linux/amd64","linux/arm64"]).optional(),extraHosts:r.array(r.tuple([Wt,r.union([r.ipv4(),r.ipv6(),r.literal("host-gateway"),Wt])])).min(1).optional()}),Le=r.strictObject({registry:r.boolean().optional(),cmc:r.boolean().optional(),icp:r.boolean().optional(),cycles:r.boolean().optional(),nns:r.boolean().optional(),sns:r.boolean().optional(),internet_identity:r.boolean().optional(),nns_dapp:r.boolean().optional()}),dt=r.strictObject({services:Le}),qt=r.union([r.strictObject({runner:ut.optional(),network:dt.optional(),skylab:Pe}),r.strictObject({runner:ut.optional(),network:dt.optional(),console:ve}),r.strictObject({runner:ut.optional(),network:dt.optional(),satellite:Ue})]).superRefine(Kt);import*as C from"zod";var Fe=C.enum(["controllers","public"]),$t=C.strictObject({freezingThreshold:C.bigint().optional(),reservedCyclesLimit:C.bigint().optional(),logVisibility:Fe.optional(),heapMemoryLimit:C.bigint().optional(),memoryAllocation:C.bigint().optional(),computeAllocation:C.bigint().optional()});import{PrincipalTextSchema as Je}from"@junobuild/schema";import*as H from"zod";var ke=H.object({id:Je}),De=H.object({ids:H.record(T,U)}),Qt=H.union([ke.strict(),De.strict()]);import{PrincipalTextSchema as Ve}from"@junobuild/schema";import*as S from"zod";import*as m from"zod";var Me=m.enum(["Write","Submit"]),Be=m.strictObject({scope:Me.optional(),timeToLive:m.bigint().max(60n*60n*1000000000n,"The maximal length of a defined session duration - maxTimeToLive - cannot exceed 1 hour").optional()}),Ne=m.strictObject({owner:m.string().trim().min(1,"Repository owner cannot be empty").max(256,"Repository owner too long"),name:m.string().trim().min(1,"Repository name cannot be empty").max(256,"Repository name too long"),refs:m.array(m.string().trim().min(1)).optional()}),Ge=m.strictObject({repositories:m.array(Ne).min(1,"At least one repository required").refine(e=>{let t=e.map(o=>`${o.owner}/${o.name}`);return t.length===new Set(t).size},{message:"Duplicate repositories are not allowed"}),accessKeys:Be.optional()}),Xt=m.strictObject({github:Ge.optional(),version:m.bigint().optional()});var Ke=S.object({id:Ve}),We=S.object({ids:S.record(T,U)}),Yt=S.object({hosting:F.optional(),storage:et.optional(),datastore:Gt.optional(),authentication:Z.optional(),automation:Xt.optional(),assertions:Mt.optional(),settings:$t.optional(),collections:Nt.optional()}),Zt=S.union([S.object({...Ke.shape,...Yt.shape}).strict(),S.object({...We.shape,...Yt.shape}).strict()]);import*as te from"zod";var Mn=te.strictObject({satellite:Zt,orbiter:Qt.optional(),emulator:qt.optional(),api:Y.optional()});import*as ee from"zod";var{source:qe,...$e}=F.shape,Gn=ee.strictObject({source:qe.optional(),...$e});export{Lt as AuthenticationConfigDelegationSchema,me as AuthenticationConfigGitHubSchema,de as AuthenticationConfigGoogleSchema,ue as AuthenticationConfigInternetIdentitySchema,be as AuthenticationConfigRulesSchema,Z as AuthenticationConfigSchema,Be as AutomationAccessKeysConfigSchema,Ge as AutomationConfigGitHubSchema,Ne as AutomationConfigRepositorySchema,Xt as AutomationConfigSchema,Me as AutomationScopeSchema,Gn as CliConfigSchema,Nt as CollectionsSchema,Se as ConsoleIdSchema,ze as ConsoleIdsSchema,lt as DEFAULT_NETWORK_SERVICES,Vt as DEFAULT_SATELLITE_NETWORK_SERVICES,we as DatastoreCollectionSchema,Gt as DatastoreConfigSchema,qt as EmulatorConfigSchema,Jt as EncodingTypeSchema,F as HostingConfigSchema,en as JUNO_PACKAGE_MISSION_CONTROL_ID,on as JUNO_PACKAGE_ORBITER_ID,Zo as JUNO_PACKAGE_SATELLITE_ID,tn as JUNO_PACKAGE_SPUTNIK_ID,Pt as JunoConfigEnvSchema,T as JunoConfigModeSchema,Mn as JunoConfigSchema,$o as JunoConsoleConfigSchema,Ae as JunoPackageDependenciesSchema,Xo as JunoPackageSchema,tt as MaxMemorySizeConfigSchema,Ee as MemoryTextSchema,Fe as ModuleLogVisibilitySchema,$t as ModuleSettingsSchema,st as OnRunContextSchema,Ro as OnRunEnvSchema,ft as OnRunSchema,Qt as OrbiterConfigSchema,ke as OrbiterIdSchema,De as OrbiterIdsSchema,Bt as PermissionTextSchema,kt as PrecompressSchema,xt as RuleSchema,sn as RulesTypeSchema,Eo as RunFnOrObjectSchema,le as RunFnSchema,Mt as SatelliteAssertionsSchema,Zt as SatelliteConfigOptionsSchema,Ke as SatelliteIdSchema,We as SatelliteIdsSchema,Oe as StorageCollectionSchema,he as StorageConfigHeaderSchema,ye as StorageConfigRedirectSchema,ge as StorageConfigRewriteSchema,et as StorageConfigSchema,pt as StorageConfigSourceGlobSchema,rn as defineConfig,Ho as defineConsoleConfig,wo as defineRun};
2
2
  /*! Bundled license information:
3
3
 
4
4
  @noble/hashes/esm/utils.js: