@junobuild/config 2.10.1 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -9
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/satellite/configs/satellite.config.d.ts +44 -1
- package/dist/types/satellite/juno.config.d.ts +34 -0
- package/dist/types/shared/automation.config.d.ts +162 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -364,7 +364,7 @@ References:
|
|
|
364
364
|
|
|
365
365
|
- SatelliteId
|
|
366
366
|
|
|
367
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
367
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L21)
|
|
368
368
|
|
|
369
369
|
#### :gear: SatelliteIdsSchema
|
|
370
370
|
|
|
@@ -376,19 +376,19 @@ References:
|
|
|
376
376
|
|
|
377
377
|
- SatelliteIds
|
|
378
378
|
|
|
379
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
379
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L40)
|
|
380
380
|
|
|
381
381
|
#### :gear: SatelliteConfigOptionsSchema
|
|
382
382
|
|
|
383
383
|
| Constant | Type |
|
|
384
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>>; ...
|
|
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<...>]>` |
|
|
386
386
|
|
|
387
387
|
References:
|
|
388
388
|
|
|
389
389
|
- JunoConsoleConfig
|
|
390
390
|
|
|
391
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
391
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L80)
|
|
392
392
|
|
|
393
393
|
### :tropical_drink: Interfaces
|
|
394
394
|
|
|
@@ -706,7 +706,7 @@ Represents the unique identifier for a satellite.
|
|
|
706
706
|
| -------- | -------- | -------------------------------------------------------------------------------- |
|
|
707
707
|
| `id` | `string` | The unique identifier (ID) of the satellite for this application. type: {string} |
|
|
708
708
|
|
|
709
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
709
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L29)
|
|
710
710
|
|
|
711
711
|
#### :gear: SatelliteIds
|
|
712
712
|
|
|
@@ -716,13 +716,13 @@ Represents a mapping of satellite identifiers to different configurations based
|
|
|
716
716
|
| -------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
717
717
|
| `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>} |
|
|
718
718
|
|
|
719
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
719
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L48)
|
|
720
720
|
|
|
721
721
|
#### :gear: SatelliteConfigOptions
|
|
722
722
|
|
|
723
723
|
SatelliteConfigOptions interface provides configuration settings that allow for fine-tuning
|
|
724
724
|
the operational behavior of various aspects of a Satellite, such as storage, datastore,
|
|
725
|
-
authentication, and deployment assertions.
|
|
725
|
+
authentication, automation, and deployment assertions.
|
|
726
726
|
|
|
727
727
|
These options affect specific modules of the Satellite and may require manual application of
|
|
728
728
|
changes, typically through CLI commands (e.g., `juno config`).
|
|
@@ -732,11 +732,12 @@ changes, typically through CLI commands (e.g., `juno config`).
|
|
|
732
732
|
| `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 |
|
|
733
733
|
| `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 |
|
|
734
734
|
| `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 |
|
|
735
|
+
| `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 |
|
|
735
736
|
| `assertions` | `SatelliteAssertions or undefined` | Optional configurations to override default assertions made by the CLI regarding satellite deployment conditions. type: {SatelliteAssertions}optional |
|
|
736
737
|
| `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 |
|
|
737
738
|
| `collections` | `Collections or undefined` | Optional configuration for the Datastore and Storage collections. type: {Collections}optional |
|
|
738
739
|
|
|
739
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
740
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L112)
|
|
740
741
|
|
|
741
742
|
### :cocktail: Types
|
|
742
743
|
|
|
@@ -849,7 +850,7 @@ The configuration for running the Juno emulator.
|
|
|
849
850
|
| ----------------- | ---------------------------------------------------------------------------- |
|
|
850
851
|
| `SatelliteConfig` | `Either<SatelliteId, SatelliteIds> and CliConfig and SatelliteConfigOptions` |
|
|
851
852
|
|
|
852
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
853
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L176)
|
|
853
854
|
|
|
854
855
|
<!-- TSDOC_END -->
|
|
855
856
|
|
package/dist/browser/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as F from"zod";import*as bt from"zod";var N=e=>bt.custom(t=>e.implement(t));import*as b from"zod";import*as Rt from"zod";import{PrincipalTextSchema as ae}from"@dfinity/zod-schemas";var G="abcdefghijklmnopqrstuvwxyz234567",P=Object.create(null);for(let e=0;e<G.length;e++)P[G[e]]=e;P[0]=P.o;P[1]=P.i;function mt(e){let t=0,o=0,n="";function i(r){return t<0?o|=r>>-t:o=r<<t&248,t>3?(t-=8,1):(t<4&&(n+=G[o>>3],t+=5),0)}for(let r=0;r<e.length;)r+=i(e[r]);return n+(t<0?G[o>>3]:"")}function ht(e){let t=0,o=0,n=new Uint8Array(e.length*4/3|0),i=0;function r(a){let s=P[a.toLowerCase()];if(s===void 0)throw new Error(`Invalid character: ${JSON.stringify(a)}`);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 a of e)r(a);return n.slice(0,i)}var Yt=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 gt(e){let t=-1;for(let o=0;o<e.length;o++){let i=(e[o]^t)&255;t=Yt[i]^t>>>8}return(t^-1)>>>0}function Zt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function L(e,...t){if(!Zt(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 ot(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 Ct(e,t){L(e);let o=t.outputLen;if(e.length<o)throw new Error("digestInto() expects output buffer of length at least "+o)}function J(...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 h(e,t){return e<<32-t|e>>>t}var St=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",te=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function zt(e){if(L(e),St)return e.toHex();let t="";for(let o=0;o<e.length;o++)t+=te[e[o]];return t}var S={_0:48,_9:57,A:65,F:70,a:97,f:102};function yt(e){if(e>=S._0&&e<=S._9)return e-S._0;if(e>=S.A&&e<=S.F)return e-(S.A-10);if(e>=S.a&&e<=S.f)return e-(S.a-10)}function Et(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(St)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,r=0;i<o;i++,r+=2){let a=yt(e.charCodeAt(r)),s=yt(e.charCodeAt(r+1));if(a===void 0||s===void 0){let l=e[r]+e[r+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+r)}n[i]=a*16+s}return n}function ee(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function nt(e){return typeof e=="string"&&(e=ee(e)),L(e),e}var V=class{};function At(e){let t=n=>e().update(nt(n)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}function oe(e,t,o,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,o,n);let i=BigInt(32),r=BigInt(4294967295),a=Number(o>>i&r),s=Number(o&r),l=n?4:0,m=n?0:4;e.setUint32(t+l,a,n),e.setUint32(t+m,s,n)}function wt(e,t,o){return e&t^~e&o}function Ot(e,t,o){return e&t^e&o^t&o}var K=class extends V{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){ot(this),t=nt(t),L(t);let{view:o,buffer:n,blockLen:i}=this,r=t.length;for(let a=0;a<r;){let s=Math.min(i-this.pos,r-a);if(s===i){let l=W(t);for(;i<=r-a;a+=i)this.process(l,a);continue}n.set(t.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===i&&(this.process(o,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ot(this),Ct(t,this),this.finished=!0;let{buffer:o,view:n,blockLen:i,isLE:r}=this,{pos:a}=this;o[a++]=128,J(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(n,0),a=0);for(let x=a;x<i;x++)o[x]=0;oe(n,i-8,BigInt(this.length*8),r),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 m=l/4,w=this.get();if(m>w.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;x<m;x++)s.setUint32(4*x,w[x],r)}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:r,destroyed:a,pos:s}=this;return t.destroyed=a,t.finished=r,t.length=i,t.pos=s,i%o&&t.buffer.set(n),t}clone(){return this._cloneInto()}},z=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),E=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]);var ne=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]),O=new Uint32Array(64),it=class extends K{constructor(t=32){super(64,t,8,!1),this.A=z[0]|0,this.B=z[1]|0,this.C=z[2]|0,this.D=z[3]|0,this.E=z[4]|0,this.F=z[5]|0,this.G=z[6]|0,this.H=z[7]|0}get(){let{A:t,B:o,C:n,D:i,E:r,F:a,G:s,H:l}=this;return[t,o,n,i,r,a,s,l]}set(t,o,n,i,r,a,s,l){this.A=t|0,this.B=o|0,this.C=n|0,this.D=i|0,this.E=r|0,this.F=a|0,this.G=s|0,this.H=l|0}process(t,o){for(let x=0;x<16;x++,o+=4)O[x]=t.getUint32(o,!1);for(let x=16;x<64;x++){let v=O[x-15],j=O[x-2],ut=h(v,7)^h(v,18)^v>>>3,et=h(j,17)^h(j,19)^j>>>10;O[x]=et+O[x-7]+ut+O[x-16]|0}let{A:n,B:i,C:r,D:a,E:s,F:l,G:m,H:w}=this;for(let x=0;x<64;x++){let v=h(s,6)^h(s,11)^h(s,25),j=w+v+wt(s,l,m)+ne[x]+O[x]|0,et=(h(n,2)^h(n,13)^h(n,22))+Ot(n,i,r)|0;w=m,m=l,l=s,s=a+j|0,a=r,r=i,i=n,n=j+et|0}n=n+this.A|0,i=i+this.B|0,r=r+this.C|0,a=a+this.D|0,s=s+this.E|0,l=l+this.F|0,m=m+this.G|0,w=w+this.H|0,this.set(n,i,r,a,s,l,m,w)}roundClean(){J(O)}destroy(){this.set(0,0,0,0,0,0,0,0),J(this.buffer)}},rt=class extends it{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 It=At(()=>new rt);var q="__principal__",ie=2,_t=4,re="aaaaa-aa",k=class e{static anonymous(){return new this(new Uint8Array([_t]))}static managementCanister(){return this.fromText(re)}static selfAuthenticating(t){let o=It(t);return new this(new Uint8Array([...o,ie]))}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(q)){let a=JSON.parse(t);q in a&&(o=a[q])}let n=o.toLowerCase().replace(/-/g,""),i=ht(n);i=i.slice(4,i.length);let r=new this(i);if(r.toText()!==o)throw new Error(`Principal "${r.toText()}" does not have a valid checksum (original value "${o}" may not be a valid Principal ID).`);return r}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]===_t}toUint8Array(){return this._arr}toHex(){return zt(this._arr).toUpperCase()}toText(){let t=new ArrayBuffer(4);new DataView(t).setUint32(0,gt(this._arr));let n=new Uint8Array(t),i=new Uint8Array([...n,...this._arr]),a=mt(i).match(/.{1,5}/g);if(!a)throw new Error;return a.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*as U from"zod";var H=U.string().refine(e=>ae.safeParse(e).success,{message:"Invalid textual representation of a Principal."}),D=U.unknown().transform((e,t)=>k.isPrincipal(e)?k.from(e):(t.issues.push({code:"custom",message:"Invalid Principal",input:e}),U.NEVER));var Tt=Rt.unknown().refine(e=>e!=null&&typeof e=="object"&&"transformRequest"in e&&typeof e.transformRequest=="function"&&"getPrincipal"in e&&typeof e.getPrincipal=="function"&&D.safeParse(e.getPrincipal()).success,{message:"Invalid Identity"});var at=b.strictObject({satelliteId:D,orbiterId:D.optional(),identity:Tt,container:b.string().optional()}),ce=b.function({input:b.tuple([at]),output:b.promise(b.void()).or(b.void())}),ct=b.strictObject({run:N(ce)});var se=F.function({input:F.tuple([at]),output:ct}),uo=F.union([ct,N(se)]);function bo(e){return e}import*as Pt from"zod";import*as I from"zod";var R=I.union([I.literal("production"),I.string()]),jt=I.object({mode:R});var yo=jt.extend({profile:Pt.string().optional()});function So(e){return e}import{PrincipalTextSchema as me}from"@dfinity/zod-schemas";import*as g from"zod";import*as Q from"zod";var $=Q.strictObject({url:Q.url()});import{PrincipalTextSchema as Ut}from"@dfinity/zod-schemas";import*as d from"zod";var fe=d.strictObject({derivationOrigin:d.url().optional(),externalAlternativeOrigins:d.array(d.url()).optional()}),Ht=d.strictObject({allowedTargets:d.array(Ut).nullable().optional(),sessionDuration:d.bigint().max(30n*24n*60n*60n*1000000000n,"The maximal length of a defined session duration - maxTimeToLive - cannot exceed 30 days").optional()}),xe=d.strictObject({clientId:d.string().trim().regex(/^[0-9]+-[a-z0-9]+\.apps\.googleusercontent\.com$/,"Invalid Google client ID format").max(128,"Google clientId too long"),delegation:Ht.optional()}),pe=d.strictObject({clientId:d.string().trim().min(1,"GitHub clientId cannot be empty").max(128,"GitHub clientId too long"),delegation:Ht.optional()}),le=d.strictObject({allowedCallers:d.array(Ut)}),X=d.strictObject({internetIdentity:fe.optional(),google:xe.optional(),github:pe.optional(),rules:le.optional(),version:d.bigint().optional()});import*as f from"zod";import*as M from"zod";var Y=M.object({heap:M.bigint().optional(),stable:M.bigint().optional()}).strict();var st=f.string(),de=f.object({source:st,headers:f.array(f.tuple([f.string(),f.string()]))}).strict(),ue=f.object({source:st,destination:f.string()}).strict(),be=f.object({source:st,location:f.string(),code:f.union([f.literal(301),f.literal(302)])}).strict(),Z=f.object({headers:f.array(de).optional(),rewrites:f.array(ue).optional(),redirects:f.array(be).optional(),iframe:f.enum(["deny","same-origin","allow-any"]).optional(),rawAccess:f.boolean().optional(),maxMemorySize:Y.optional(),version:f.bigint().optional()});import*as p from"zod";import*as Ft from"zod";var vt=Ft.enum(["identity","gzip","compress","deflate","br"]);var Lt=p.strictObject({pattern:p.string().optional(),mode:p.enum(["both","replace"]).optional(),algorithm:p.enum(["gzip","brotli"]).optional()}),Jt=p.strictObject({source:p.string().optional(),ignore:p.array(p.string()).optional(),precompress:p.union([Lt,p.array(Lt),p.literal(!1)]).optional(),encoding:p.array(p.tuple([p.string(),vt])).optional(),predeploy:p.array(p.string()).optional(),postdeploy:p.array(p.string()).optional()});var he=g.object({id:me}),ge=g.object({ids:g.record(R,H)}),kt=g.object({...Jt.shape,storage:Z.optional(),authentication:X.optional(),api:$.optional()}),ko=g.union([g.object({...he.shape,...kt.shape}).strict(),g.object({...ge.shape,...kt.shape}).strict()]);import*as A from"zod";var ye=A.record(A.string(),A.string()),Mo=A.object({name:A.string(),version:A.string(),dependencies:ye.optional()});var No="@junobuild/satellite",Go="@junobuild/sputnik",Vo="@junobuild/mission-control",Wo="@junobuild/orbiter";function qo(e){return e}import*as _ from"zod";var Dt=_.strictObject({heapMemory:_.union([_.bigint(),_.boolean()]).optional()});import*as B from"zod";import*as u from"zod";var Mt=u.enum(["public","private","managed","controllers"]),Ce=u.enum(["heap","stable"]),Xo=u.enum(["db","storage"]),ft=u.strictObject({collection:u.string(),read:Mt,write:Mt,memory:Ce,createdAt:u.bigint().optional(),updatedAt:u.bigint().optional(),version:u.bigint().optional(),maxSize:u.bigint().optional(),maxChangesPerUser:u.number().optional(),maxCapacity:u.number().optional(),mutablePermissions:u.boolean().optional().default(!0),maxTokens:u.bigint().optional()});var Se=ft.omit({createdAt:!0,updatedAt:!0,maxSize:!0}),ze=ft.omit({createdAt:!0,updatedAt:!0,maxCapacity:!0}),Bt=B.strictObject({datastore:B.array(Se).optional(),storage:B.array(ze).optional()});import*as tt from"zod";var Nt=tt.strictObject({maxMemorySize:Y.optional(),version:tt.bigint().optional()});import*as c from"zod";var xt={registry:!1,cmc:!0,icp:!0,cycles:!0,nns:!0,sns:!1,internet_identity:!0,nns_dapp:!1},Gt={...xt,cycles:!1,cmc:!1,nns:!1};var Ee=["icp"],Ae=["icp","nns"],we=["cmc","icp","nns"],Oe=["cmc","icp","nns","sns","internet_identity"],Ie=(e,t)=>{let n={..."satellite"in e?Gt:xt,...e.network?.services??{}},i=({requiredServices:r,key:a})=>{r.find(l=>n[l]===!1)!==void 0&&t.addIssue({code:"custom",path:["network","services",a],message:`${a} requires: ${r.join(", ")}`})};n.nns_dapp&&i({requiredServices:Oe,key:"nns_dapp"}),n.cmc&&i({requiredServices:Ae,key:"cmc"}),n.cycles&&i({requiredServices:we,key:"cycles"}),n.nns&&i({requiredServices:Ee,key:"nns"})},Vt=(e,t)=>{e.network!==void 0&&e.network.services!==void 0&&Ie(e,t)};var dt=c.strictObject({server:c.number().optional(),admin:c.number().optional(),timeoutInSeconds:c.number().int().positive().optional()}),_e=c.strictObject({console:c.number().optional()}),Re=c.strictObject({ports:dt.extend(_e.shape).optional()}),Te=c.strictObject({ports:dt.optional()}),je=c.strictObject({ports:dt.optional()}),pt=c.strictObject({type:c.enum(["docker","podman"]),image:c.string().optional(),name:c.string().optional(),volume:c.string().optional(),target:c.string().optional(),platform:c.enum(["linux/amd64","linux/arm64"]).optional()}),Pe=c.strictObject({registry:c.boolean().optional(),cmc:c.boolean().optional(),icp:c.boolean().optional(),cycles:c.boolean().optional(),nns:c.boolean().optional(),sns:c.boolean().optional(),internet_identity:c.boolean().optional(),nns_dapp:c.boolean().optional()}),lt=c.strictObject({services:Pe}),Wt=c.union([c.strictObject({runner:pt.optional(),network:lt.optional(),skylab:Re}),c.strictObject({runner:pt.optional(),network:lt.optional(),console:Te}),c.strictObject({runner:pt.optional(),network:lt.optional(),satellite:je})]).superRefine(Vt);import*as y from"zod";var Ue=y.enum(["controllers","public"]),Kt=y.strictObject({freezingThreshold:y.bigint().optional(),reservedCyclesLimit:y.bigint().optional(),logVisibility:Ue.optional(),heapMemoryLimit:y.bigint().optional(),memoryAllocation:y.bigint().optional(),computeAllocation:y.bigint().optional()});import{PrincipalTextSchema as He}from"@dfinity/zod-schemas";import*as T from"zod";var Fe=T.object({id:He}),ve=T.object({ids:T.record(R,H)}),qt=T.union([Fe.strict(),ve.strict()]);import{PrincipalTextSchema as Le}from"@dfinity/zod-schemas";import*as C from"zod";var Je=C.object({id:Le}),ke=C.object({ids:C.record(R,H)}),Qt=C.object({storage:Z.optional(),datastore:Nt.optional(),authentication:X.optional(),assertions:Dt.optional(),settings:Kt.optional(),collections:Bt.optional()}),$t=C.union([C.object({...Je.shape,...Qt.shape}).strict(),C.object({...ke.shape,...Qt.shape}).strict()]);import*as Xt from"zod";var _n=Xt.strictObject({satellite:$t,orbiter:qt.optional(),emulator:Wt.optional(),api:$.optional()});export{Ht as AuthenticationConfigDelegationSchema,pe as AuthenticationConfigGitHubSchema,xe as AuthenticationConfigGoogleSchema,fe as AuthenticationConfigInternetIdentitySchema,le as AuthenticationConfigRulesSchema,X as AuthenticationConfigSchema,Jt as CliConfigSchema,Bt as CollectionsSchema,he as ConsoleIdSchema,ge as ConsoleIdsSchema,xt as DEFAULT_NETWORK_SERVICES,Gt as DEFAULT_SATELLITE_NETWORK_SERVICES,Se as DatastoreCollectionSchema,Nt as DatastoreConfigSchema,Wt as EmulatorConfigSchema,vt as EncodingTypeSchema,Vo as JUNO_PACKAGE_MISSION_CONTROL_ID,Wo as JUNO_PACKAGE_ORBITER_ID,No as JUNO_PACKAGE_SATELLITE_ID,Go as JUNO_PACKAGE_SPUTNIK_ID,jt as JunoConfigEnvSchema,R as JunoConfigModeSchema,_n as JunoConfigSchema,ko as JunoConsoleConfigSchema,ye as JunoPackageDependenciesSchema,Mo as JunoPackageSchema,Y as MaxMemorySizeConfigSchema,Ce as MemoryTextSchema,Ue as ModuleLogVisibilitySchema,Kt as ModuleSettingsSchema,at as OnRunContextSchema,yo as OnRunEnvSchema,ct as OnRunSchema,qt as OrbiterConfigSchema,Fe as OrbiterIdSchema,ve as OrbiterIdsSchema,Mt as PermissionTextSchema,Lt as PrecompressSchema,ft as RuleSchema,Xo as RulesTypeSchema,uo as RunFnOrObjectSchema,se as RunFnSchema,Dt as SatelliteAssertionsSchema,$t as SatelliteConfigOptionsSchema,Je as SatelliteIdSchema,ke as SatelliteIdsSchema,ze as StorageCollectionSchema,de as StorageConfigHeaderSchema,be as StorageConfigRedirectSchema,ue as StorageConfigRewriteSchema,Z as StorageConfigSchema,st as StorageConfigSourceGlobSchema,qo as defineConfig,So as defineConsoleConfig,bo as defineRun};
|
|
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";import{PrincipalTextSchema as se}from"@dfinity/zod-schemas";var V="abcdefghijklmnopqrstuvwxyz234567",H=Object.create(null);for(let e=0;e<V.length;e++)H[V[e]]=e;H[0]=H.o;H[1]=H.i;function ht(e){let t=0,o=0,n="";function i(r){return t<0?o|=r>>-t:o=r<<t&248,t>3?(t-=8,1):(t<4&&(n+=V[o>>3],t+=5),0)}for(let r=0;r<e.length;)r+=i(e[r]);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 r(a){let s=H[a.toLowerCase()];if(s===void 0)throw new Error(`Invalid character: ${JSON.stringify(a)}`);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 a of e)r(a);return n.slice(0,i)}var te=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=te[i]^t>>>8}return(t^-1)>>>0}function ee(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function J(e,...t){if(!ee(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",oe=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+=oe[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,r=0;i<o;i++,r+=2){let a=Ct(e.charCodeAt(r)),s=Ct(e.charCodeAt(r+1));if(a===void 0||s===void 0){let l=e[r]+e[r+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+r)}n[i]=a*16+s}return n}function ne(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=ne(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 ie(e,t,o,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,o,n);let i=BigInt(32),r=BigInt(4294967295),a=Number(o>>i&r),s=Number(o&r),l=n?4:0,h=n?0:4;e.setUint32(t+l,a,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,r=t.length;for(let a=0;a<r;){let s=Math.min(i-this.pos,r-a);if(s===i){let l=W(t);for(;i<=r-a;a+=i)this.process(l,a);continue}n.set(t.subarray(a,a+s),this.pos),this.pos+=s,a+=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:r}=this,{pos:a}=this;o[a++]=128,k(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(n,0),a=0);for(let x=a;x<i;x++)o[x]=0;ie(n,i-8,BigInt(this.length*8),r),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],r)}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:r,destroyed:a,pos:s}=this;return t.destroyed=a,t.finished=r,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 re=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:r,F:a,G:s,H:l}=this;return[t,o,n,i,r,a,s,l]}set(t,o,n,i,r,a,s,l){this.A=t|0,this.B=o|0,this.C=n|0,this.D=i|0,this.E=r|0,this.F=a|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],P=I[x-2],mt=g(F,7)^g(F,18)^F>>>3,ot=g(P,17)^g(P,19)^P>>>10;I[x]=ot+I[x-7]+mt+I[x-16]|0}let{A:n,B:i,C:r,D:a,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),P=O+F+Ot(s,l,h)+re[x]+I[x]|0,ot=(g(n,2)^g(n,13)^g(n,22))+It(n,i,r)|0;O=h,h=l,l=s,s=a+P|0,a=r,r=i,i=n,n=P+ot|0}n=n+this.A|0,i=i+this.B|0,r=r+this.C|0,a=a+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,r,a,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__",ae=2,Rt=4,ce="aaaaa-aa",D=class e{static anonymous(){return new this(new Uint8Array([Rt]))}static managementCanister(){return this.fromText(ce)}static selfAuthenticating(t){let o=_t(t);return new this(new Uint8Array([...o,ae]))}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 a=JSON.parse(t);$ in a&&(o=a[$])}let n=o.toLowerCase().replace(/-/g,""),i=gt(n);i=i.slice(4,i.length);let r=new this(i);if(r.toText()!==o)throw new Error(`Principal "${r.toText()}" does not have a valid checksum (original value "${o}" may not be a valid Principal ID).`);return r}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]),a=ht(i).match(/.{1,5}/g);if(!a)throw new Error;return a.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*as v from"zod";var U=v.string().refine(e=>se.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()}),fe=b.function({input:b.tuple([ct]),output:b.promise(b.void()).or(b.void())}),st=b.strictObject({run:G(fe)});var xe=L.function({input:L.tuple([ct]),output:st}),Co=L.union([st,G(xe)]);function So(e){return e}import*as Ht from"zod";import*as _ from"zod";var T=_.union([_.literal("production"),_.string()]),Pt=_.object({mode:T});var wo=Pt.extend({profile:Ht.string().optional()});function Io(e){return e}import{PrincipalTextSchema as ge}from"@dfinity/zod-schemas";import*as y from"zod";import*as Q from"zod";var X=Q.strictObject({url:Q.url()});import{PrincipalTextSchema as vt}from"@dfinity/zod-schemas";import*as u from"zod";var pe=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()}),le=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()}),ue=u.strictObject({clientId:u.string().trim().min(1,"GitHub clientId cannot be empty").max(128,"GitHub clientId too long"),delegation:Ut.optional()}),de=u.strictObject({allowedCallers:u.array(vt)}),Y=u.strictObject({internetIdentity:pe.optional(),google:le.optional(),github:ue.optional(),rules:de.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(),me=f.object({source:ft,headers:f.array(f.tuple([f.string(),f.string()]))}).strict(),be=f.object({source:ft,destination:f.string()}).strict(),he=f.object({source:ft,location:f.string(),code:f.union([f.literal(301),f.literal(302)])}).strict(),tt=f.object({headers:f.array(me).optional(),rewrites:f.array(be).optional(),redirects:f.array(he).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 ye=y.object({id:ge}),Ce=y.object({ids:y.record(T,U)}),Dt=y.object({...kt.shape,storage:tt.optional(),authentication:Y.optional(),api:X.optional()}),Vo=y.union([y.object({...ye.shape,...Dt.shape}).strict(),y.object({...Ce.shape,...Dt.shape}).strict()]);import*as w from"zod";var Se=w.record(w.string(),w.string()),Wo=w.object({name:w.string(),version:w.string(),dependencies:Se.optional()});var $o="@junobuild/satellite",Qo="@junobuild/sputnik",Xo="@junobuild/mission-control",Yo="@junobuild/orbiter";function tn(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"]),ze=d.enum(["heap","stable"]),nn=d.enum(["db","storage"]),xt=d.strictObject({collection:d.string(),read:Bt,write:Bt,memory:ze,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 Ae=xt.omit({createdAt:!0,updatedAt:!0,maxSize:!0}),Ee=xt.omit({createdAt:!0,updatedAt:!0,maxCapacity:!0}),Nt=N.strictObject({datastore:N.array(Ae).optional(),storage:N.array(Ee).optional()});import*as et from"zod";var Gt=et.strictObject({maxMemorySize:Z.optional(),version:et.bigint().optional()});import*as c 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 we=["icp"],Oe=["icp","nns"],Ie=["cmc","icp","nns"],_e=["cmc","icp","nns","sns","internet_identity"],Re=(e,t)=>{let n={..."satellite"in e?Vt:pt,...e.network?.services??{}},i=({requiredServices:r,key:a})=>{r.find(l=>n[l]===!1)!==void 0&&t.addIssue({code:"custom",path:["network","services",a],message:`${a} requires: ${r.join(", ")}`})};n.nns_dapp&&i({requiredServices:_e,key:"nns_dapp"}),n.cmc&&i({requiredServices:Oe,key:"cmc"}),n.cycles&&i({requiredServices:Ie,key:"cycles"}),n.nns&&i({requiredServices:we,key:"nns"})},Kt=(e,t)=>{e.network!==void 0&&e.network.services!==void 0&&Re(e,t)};var dt=c.strictObject({server:c.number().optional(),admin:c.number().optional(),timeoutInSeconds:c.number().int().positive().optional()}),Te=c.strictObject({console:c.number().optional()}),je=c.strictObject({ports:dt.extend(Te.shape).optional()}),Pe=c.strictObject({ports:dt.optional()}),He=c.strictObject({ports:dt.optional()}),lt=c.strictObject({type:c.enum(["docker","podman"]),image:c.string().optional(),name:c.string().optional(),volume:c.string().optional(),target:c.string().optional(),platform:c.enum(["linux/amd64","linux/arm64"]).optional()}),ve=c.strictObject({registry:c.boolean().optional(),cmc:c.boolean().optional(),icp:c.boolean().optional(),cycles:c.boolean().optional(),nns:c.boolean().optional(),sns:c.boolean().optional(),internet_identity:c.boolean().optional(),nns_dapp:c.boolean().optional()}),ut=c.strictObject({services:ve}),Wt=c.union([c.strictObject({runner:lt.optional(),network:ut.optional(),skylab:je}),c.strictObject({runner:lt.optional(),network:ut.optional(),console:Pe}),c.strictObject({runner:lt.optional(),network:ut.optional(),satellite:He})]).superRefine(Kt);import*as C from"zod";var Ue=C.enum(["controllers","public"]),qt=C.strictObject({freezingThreshold:C.bigint().optional(),reservedCyclesLimit:C.bigint().optional(),logVisibility:Ue.optional(),heapMemoryLimit:C.bigint().optional(),memoryAllocation:C.bigint().optional(),computeAllocation:C.bigint().optional()});import{PrincipalTextSchema as Le}from"@dfinity/zod-schemas";import*as j from"zod";var Fe=j.object({id:Le}),Je=j.object({ids:j.record(T,U)}),$t=j.union([Fe.strict(),Je.strict()]);import{PrincipalTextSchema as Ne}from"@dfinity/zod-schemas";import*as S from"zod";import*as m from"zod";var ke=m.enum(["Write","Submit"]),De=m.strictObject({scope:ke.optional(),timeToLive:m.bigint().max(60n*60n*1000000000n,"The maximal length of a defined session duration - maxTimeToLive - cannot exceed 1 hour").optional()}),Me=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()}),Be=m.strictObject({repositories:m.array(Me).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:De.optional()}),Qt=m.strictObject({github:Be.optional(),version:m.bigint().optional()});var Ge=S.object({id:Ne}),Ve=S.object({ids:S.record(T,U)}),Xt=S.object({storage:tt.optional(),datastore:Gt.optional(),authentication:Y.optional(),automation:Qt.optional(),assertions:Mt.optional(),settings:qt.optional(),collections:Nt.optional()}),Yt=S.union([S.object({...Ge.shape,...Xt.shape}).strict(),S.object({...Ve.shape,...Xt.shape}).strict()]);import*as Zt from"zod";var Ln=Zt.strictObject({satellite:Yt,orbiter:$t.optional(),emulator:Wt.optional(),api:X.optional()});export{Ut as AuthenticationConfigDelegationSchema,ue as AuthenticationConfigGitHubSchema,le as AuthenticationConfigGoogleSchema,pe as AuthenticationConfigInternetIdentitySchema,de as AuthenticationConfigRulesSchema,Y as AuthenticationConfigSchema,De as AutomationAccessKeysConfigSchema,Be as AutomationConfigGitHubSchema,Me as AutomationConfigRepositorySchema,Qt as AutomationConfigSchema,ke as AutomationScopeSchema,kt as CliConfigSchema,Nt as CollectionsSchema,ye as ConsoleIdSchema,Ce as ConsoleIdsSchema,pt as DEFAULT_NETWORK_SERVICES,Vt as DEFAULT_SATELLITE_NETWORK_SERVICES,Ae as DatastoreCollectionSchema,Gt as DatastoreConfigSchema,Wt as EmulatorConfigSchema,Ft as EncodingTypeSchema,Xo as JUNO_PACKAGE_MISSION_CONTROL_ID,Yo as JUNO_PACKAGE_ORBITER_ID,$o as JUNO_PACKAGE_SATELLITE_ID,Qo as JUNO_PACKAGE_SPUTNIK_ID,Pt as JunoConfigEnvSchema,T as JunoConfigModeSchema,Ln as JunoConfigSchema,Vo as JunoConsoleConfigSchema,Se as JunoPackageDependenciesSchema,Wo as JunoPackageSchema,Z as MaxMemorySizeConfigSchema,ze as MemoryTextSchema,Ue as ModuleLogVisibilitySchema,qt as ModuleSettingsSchema,ct as OnRunContextSchema,wo as OnRunEnvSchema,st as OnRunSchema,$t as OrbiterConfigSchema,Fe as OrbiterIdSchema,Je as OrbiterIdsSchema,Bt as PermissionTextSchema,Jt as PrecompressSchema,xt as RuleSchema,nn as RulesTypeSchema,Co as RunFnOrObjectSchema,xe as RunFnSchema,Mt as SatelliteAssertionsSchema,Yt as SatelliteConfigOptionsSchema,Ge as SatelliteIdSchema,Ve as SatelliteIdsSchema,Ee as StorageCollectionSchema,me as StorageConfigHeaderSchema,he as StorageConfigRedirectSchema,be as StorageConfigRewriteSchema,tt as StorageConfigSchema,ft as StorageConfigSourceGlobSchema,tn as defineConfig,Io as defineConsoleConfig,So as defineRun};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@noble/hashes/esm/utils.js:
|