@junobuild/config 2.5.0 → 2.6.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 +16 -91
- 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/cli/run.context.d.ts +2 -2
- package/dist/types/console/console.config.d.ts +41 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/satellite/configs/satellite.config.d.ts +15 -1
- package/dist/types/satellite/juno.config.d.ts +14 -0
- package/dist/types/{satellite/configs → shared}/authentication.config.d.ts +78 -0
- package/dist/types/utils/principal.utils.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -15,9 +15,6 @@ Configuration options for [Juno] CLI.
|
|
|
15
15
|
### :wrench: Constants
|
|
16
16
|
|
|
17
17
|
- [SatelliteAssertionsSchema](#gear-satelliteassertionsschema)
|
|
18
|
-
- [AuthenticationConfigInternetIdentitySchema](#gear-authenticationconfiginternetidentityschema)
|
|
19
|
-
- [AuthenticationConfigRulesSchema](#gear-authenticationconfigrulesschema)
|
|
20
|
-
- [AuthenticationConfigSchema](#gear-authenticationconfigschema)
|
|
21
18
|
- [PermissionTextSchema](#gear-permissiontextschema)
|
|
22
19
|
- [MemoryTextSchema](#gear-memorytextschema)
|
|
23
20
|
- [RulesTypeSchema](#gear-rulestypeschema)
|
|
@@ -59,42 +56,6 @@ References:
|
|
|
59
56
|
|
|
60
57
|
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/assertions.config.ts#L6)
|
|
61
58
|
|
|
62
|
-
#### :gear: AuthenticationConfigInternetIdentitySchema
|
|
63
|
-
|
|
64
|
-
| Constant | Type |
|
|
65
|
-
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
-
| `AuthenticationConfigInternetIdentitySchema` | `ZodObject<{ derivationOrigin: ZodOptional<ZodURL>; externalAlternativeOrigins: ZodOptional<ZodArray<ZodURL>>; }, $strict>` |
|
|
67
|
-
|
|
68
|
-
References:
|
|
69
|
-
|
|
70
|
-
- AuthenticationConfigInternetIdentity
|
|
71
|
-
|
|
72
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/authentication.config.ts#L7)
|
|
73
|
-
|
|
74
|
-
#### :gear: AuthenticationConfigRulesSchema
|
|
75
|
-
|
|
76
|
-
| Constant | Type |
|
|
77
|
-
| --------------------------------- | -------------------------------------------------------------- |
|
|
78
|
-
| `AuthenticationConfigRulesSchema` | `ZodObject<{ allowedCallers: ZodArray<ZodString>; }, $strict>` |
|
|
79
|
-
|
|
80
|
-
References:
|
|
81
|
-
|
|
82
|
-
- AuthenticationConfigRules
|
|
83
|
-
|
|
84
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/authentication.config.ts#L36)
|
|
85
|
-
|
|
86
|
-
#### :gear: AuthenticationConfigSchema
|
|
87
|
-
|
|
88
|
-
| Constant | Type |
|
|
89
|
-
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
90
|
-
| `AuthenticationConfigSchema` | `ZodObject<{ internetIdentity: ZodOptional<ZodObject<{ derivationOrigin: ZodOptional<ZodURL>; externalAlternativeOrigins: ZodOptional<ZodArray<ZodURL>>; }, $strict>>; rules: ZodOptional<...>; version: ZodOptional<...>; }, $strict>` |
|
|
91
|
-
|
|
92
|
-
References:
|
|
93
|
-
|
|
94
|
-
- AuthenticationConfig
|
|
95
|
-
|
|
96
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/authentication.config.ts#L59)
|
|
97
|
-
|
|
98
59
|
#### :gear: PermissionTextSchema
|
|
99
60
|
|
|
100
61
|
| Constant | Type |
|
|
@@ -145,9 +106,9 @@ References:
|
|
|
145
106
|
|
|
146
107
|
#### :gear: DatastoreCollectionSchema
|
|
147
108
|
|
|
148
|
-
| Constant | Type
|
|
149
|
-
| --------------------------- |
|
|
150
|
-
| `DatastoreCollectionSchema` | `ZodObject<{
|
|
109
|
+
| Constant | Type |
|
|
110
|
+
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
111
|
+
| `DatastoreCollectionSchema` | `ZodObject<{ collection: ZodString; read: ZodEnum<{ public: "public"; private: "private"; managed: "managed"; controllers: "controllers"; }>; write: ZodEnum<{ public: "public"; private: "private"; managed: "managed"; controllers: "controllers"; }>; ... 5 more ...; maxTokens: ZodOptional<...>; }, $strict>` |
|
|
151
112
|
|
|
152
113
|
References:
|
|
153
114
|
|
|
@@ -157,9 +118,9 @@ References:
|
|
|
157
118
|
|
|
158
119
|
#### :gear: StorageCollectionSchema
|
|
159
120
|
|
|
160
|
-
| Constant | Type
|
|
161
|
-
| ------------------------- |
|
|
162
|
-
| `StorageCollectionSchema` | `ZodObject<{
|
|
121
|
+
| Constant | Type |
|
|
122
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
123
|
+
| `StorageCollectionSchema` | `ZodObject<{ collection: ZodString; read: ZodEnum<{ public: "public"; private: "private"; managed: "managed"; controllers: "controllers"; }>; write: ZodEnum<{ public: "public"; private: "private"; managed: "managed"; controllers: "controllers"; }>; ... 5 more ...; maxTokens: ZodOptional<...>; }, $strict>` |
|
|
163
124
|
|
|
164
125
|
References:
|
|
165
126
|
|
|
@@ -169,9 +130,9 @@ References:
|
|
|
169
130
|
|
|
170
131
|
#### :gear: CollectionsSchema
|
|
171
132
|
|
|
172
|
-
| Constant | Type
|
|
173
|
-
| ------------------- |
|
|
174
|
-
| `CollectionsSchema` | `ZodObject<{ datastore: ZodOptional<ZodArray<ZodObject<{
|
|
133
|
+
| Constant | Type |
|
|
134
|
+
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
135
|
+
| `CollectionsSchema` | `ZodObject<{ datastore: ZodOptional<ZodArray<ZodObject<{ collection: ZodString; read: ZodEnum<{ public: "public"; private: "private"; managed: "managed"; controllers: "controllers"; }>; write: ZodEnum<{ public: "public"; private: "private"; managed: "managed"; controllers: "controllers"; }>; ... 5 more ...; maxTokens...` |
|
|
175
136
|
|
|
176
137
|
References:
|
|
177
138
|
|
|
@@ -403,7 +364,7 @@ References:
|
|
|
403
364
|
|
|
404
365
|
- SatelliteId
|
|
405
366
|
|
|
406
|
-
[: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#L20)
|
|
407
368
|
|
|
408
369
|
#### :gear: SatelliteIdsSchema
|
|
409
370
|
|
|
@@ -415,7 +376,7 @@ References:
|
|
|
415
376
|
|
|
416
377
|
- SatelliteIds
|
|
417
378
|
|
|
418
|
-
[: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#L39)
|
|
419
380
|
|
|
420
381
|
#### :gear: SatelliteConfigOptionsSchema
|
|
421
382
|
|
|
@@ -427,14 +388,11 @@ References:
|
|
|
427
388
|
|
|
428
389
|
- JunoConsoleConfig
|
|
429
390
|
|
|
430
|
-
[: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#L78)
|
|
431
392
|
|
|
432
393
|
### :tropical_drink: Interfaces
|
|
433
394
|
|
|
434
395
|
- [SatelliteAssertions](#gear-satelliteassertions)
|
|
435
|
-
- [AuthenticationConfigInternetIdentity](#gear-authenticationconfiginternetidentity)
|
|
436
|
-
- [AuthenticationConfigRules](#gear-authenticationconfigrules)
|
|
437
|
-
- [AuthenticationConfig](#gear-authenticationconfig)
|
|
438
396
|
- [Rule](#gear-rule)
|
|
439
397
|
- [Collections](#gear-collections)
|
|
440
398
|
- [MaxMemorySizeConfig](#gear-maxmemorysizeconfig)
|
|
@@ -470,39 +428,6 @@ Configuration for satellite assertions.
|
|
|
470
428
|
|
|
471
429
|
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/assertions.config.ts#L14)
|
|
472
430
|
|
|
473
|
-
#### :gear: AuthenticationConfigInternetIdentity
|
|
474
|
-
|
|
475
|
-
Configure the behavior of Internet Identity.
|
|
476
|
-
|
|
477
|
-
| Property | Type | Description |
|
|
478
|
-
| ---------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
479
|
-
| `derivationOrigin` | `string or undefined` | This setting ensures that users are recognized on your app, regardless of whether they use the default URL or any other custom domain. For example, if set to hello.com, a user signing on at https://hello.com will receive the same identifier (principal) as when signing on at https://www.hello.com. type: {string}optional |
|
|
480
|
-
| `externalAlternativeOrigins` | `string[] or undefined` | An optional list of external alternative origins allowed for authentication, which can be useful if you want to reuse the same derivation origin across multiple Satellites. type: {string[]}optional |
|
|
481
|
-
|
|
482
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/authentication.config.ts#L16)
|
|
483
|
-
|
|
484
|
-
#### :gear: AuthenticationConfigRules
|
|
485
|
-
|
|
486
|
-
Configure the rules of the authentication.
|
|
487
|
-
|
|
488
|
-
| Property | Type | Description |
|
|
489
|
-
| ---------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
490
|
-
| `allowedCallers` | `string[]` | This option defines who's allowed to use your app. If you enable this, only the identities you list (in user key, format, like `bj4r4-5cdop-...`) will be allowed to sign in or use any features like Datastore or Storage. type: {PrincipalText[]}optional |
|
|
491
|
-
|
|
492
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/authentication.config.ts#L44)
|
|
493
|
-
|
|
494
|
-
#### :gear: AuthenticationConfig
|
|
495
|
-
|
|
496
|
-
Configures the Authentication options of a Satellite.
|
|
497
|
-
|
|
498
|
-
| Property | Type | Description |
|
|
499
|
-
| ------------------ | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
500
|
-
| `internetIdentity` | `AuthenticationConfigInternetIdentity or undefined` | Optional configuration of Internet Identity authentication method. type: {AuthenticationConfigInternetIdentity}optional |
|
|
501
|
-
| `rules` | `AuthenticationConfigRules or undefined` | Optional configuration for the rules of the authentication. type: {AuthenticationConfigRules}optional |
|
|
502
|
-
| `version` | `bigint or undefined` | The current version of the config. Optional. The CLI will automatically resolve the version and warn you if there's a potential overwrite. You can provide it if you want to manage versioning manually within your config file. type: {bigint}optional |
|
|
503
|
-
|
|
504
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/authentication.config.ts#L69)
|
|
505
|
-
|
|
506
431
|
#### :gear: Rule
|
|
507
432
|
|
|
508
433
|
Represents a rule configuration for a collection.
|
|
@@ -781,7 +706,7 @@ Represents the unique identifier for a satellite.
|
|
|
781
706
|
| -------- | -------- | -------------------------------------------------------------------------------- |
|
|
782
707
|
| `id` | `string` | The unique identifier (ID) of the satellite for this application. type: {string} |
|
|
783
708
|
|
|
784
|
-
[: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#L28)
|
|
785
710
|
|
|
786
711
|
#### :gear: SatelliteIds
|
|
787
712
|
|
|
@@ -791,7 +716,7 @@ Represents a mapping of satellite identifiers to different configurations based
|
|
|
791
716
|
| -------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
792
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>} |
|
|
793
718
|
|
|
794
|
-
[: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#L47)
|
|
795
720
|
|
|
796
721
|
#### :gear: SatelliteConfigOptions
|
|
797
722
|
|
|
@@ -811,7 +736,7 @@ changes, typically through CLI commands (e.g., `juno config`).
|
|
|
811
736
|
| `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 |
|
|
812
737
|
| `collections` | `Collections or undefined` | Optional configuration for the Datastore and Storage collections. type: {Collections}optional |
|
|
813
738
|
|
|
814
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
739
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L109)
|
|
815
740
|
|
|
816
741
|
### :cocktail: Types
|
|
817
742
|
|
|
@@ -924,7 +849,7 @@ The configuration for running the Juno emulator.
|
|
|
924
849
|
| ----------------- | ---------------------------------------------------------------------------- |
|
|
925
850
|
| `SatelliteConfig` | `Either<SatelliteId, SatelliteIds> and CliConfig and SatelliteConfigOptions` |
|
|
926
851
|
|
|
927
|
-
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#
|
|
852
|
+
[:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/configs/satellite.config.ts#L165)
|
|
928
853
|
|
|
929
854
|
<!-- TSDOC_END -->
|
|
930
855
|
|
package/dist/browser/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as H from"zod";import*as lt from"zod";var D=e=>lt.custom(t=>e.implement(t));import*as u from"zod";import*as Ot from"zod";var N="abcdefghijklmnopqrstuvwxyz234567",P=Object.create(null);for(let e=0;e<N.length;e++)P[N[e]]=e;P[0]=P.o;P[1]=P.i;function dt(e){let t=0,o=0,n="";function r(i){return t<0?o|=i>>-t:o=i<<t&248,t>3?(t-=8,1):(t<4&&(n+=N[o>>3],t+=5),0)}for(let i=0;i<e.length;)i+=r(e[i]);return n+(t<0?N[o>>3]:"")}function ut(e){let t=0,o=0,n=new Uint8Array(e.length*4/3|0),r=0;function i(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[r++]=o,t-=8,t>0?o=s<<5-t&255:o=0)}for(let c of e)i(c);return n.slice(0,r)}var qt=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 bt(e){let t=-1;for(let o=0;o<e.length;o++){let r=(e[o]^t)&255;t=qt[r]^t>>>8}return(t^-1)>>>0}function Qt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function J(e,...t){if(!Qt(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 Z(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 ht(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 L(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function G(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function h(e,t){return e<<32-t|e>>>t}var gt=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",$t=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function yt(e){if(J(e),gt)return e.toHex();let t="";for(let o=0;o<e.length;o++)t+=$t[e[o]];return t}var C={_0:48,_9:57,A:65,F:70,a:97,f:102};function mt(e){if(e>=C._0&&e<=C._9)return e-C._0;if(e>=C.A&&e<=C.F)return e-(C.A-10);if(e>=C.a&&e<=C.f)return e-(C.a-10)}function St(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(gt)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 r=0,i=0;r<o;r++,i+=2){let c=mt(e.charCodeAt(i)),s=mt(e.charCodeAt(i+1));if(c===void 0||s===void 0){let l=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+i)}n[r]=c*16+s}return n}function Xt(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function tt(e){return typeof e=="string"&&(e=Xt(e)),J(e),e}var V=class{};function Ct(e){let t=n=>e().update(tt(n)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}function Yt(e,t,o,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,o,n);let r=BigInt(32),i=BigInt(4294967295),c=Number(o>>r&i),s=Number(o&i),l=n?4:0,m=n?0:4;e.setUint32(t+l,c,n),e.setUint32(t+m,s,n)}function zt(e,t,o){return e&t^~e&o}function Et(e,t,o){return e&t^e&o^t&o}var W=class extends V{constructor(t,o,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=o,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(t),this.view=G(this.buffer)}update(t){Z(this),t=tt(t),J(t);let{view:o,buffer:n,blockLen:r}=this,i=t.length;for(let c=0;c<i;){let s=Math.min(r-this.pos,i-c);if(s===r){let l=G(t);for(;r<=i-c;c+=r)this.process(l,c);continue}n.set(t.subarray(c,c+s),this.pos),this.pos+=s,c+=s,this.pos===r&&(this.process(o,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Z(this),ht(t,this),this.finished=!0;let{buffer:o,view:n,blockLen:r,isLE:i}=this,{pos:c}=this;o[c++]=128,L(this.buffer.subarray(c)),this.padOffset>r-c&&(this.process(n,0),c=0);for(let x=c;x<r;x++)o[x]=0;Yt(n,r-8,BigInt(this.length*8),i),this.process(n,0);let s=G(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],i)}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:r,finished:i,destroyed:c,pos:s}=this;return t.destroyed=c,t.finished=i,t.length=r,t.pos=s,r%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 Zt=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),et=class extends W{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:r,E:i,F:c,G:s,H:l}=this;return[t,o,n,r,i,c,s,l]}set(t,o,n,r,i,c,s,l){this.A=t|0,this.B=o|0,this.C=n|0,this.D=r|0,this.E=i|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)O[x]=t.getUint32(o,!1);for(let x=16;x<64;x++){let v=O[x-15],j=O[x-2],pt=h(v,7)^h(v,18)^v>>>3,Y=h(j,17)^h(j,19)^j>>>10;O[x]=Y+O[x-7]+pt+O[x-16]|0}let{A:n,B:r,C:i,D:c,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+zt(s,l,m)+Zt[x]+O[x]|0,Y=(h(n,2)^h(n,13)^h(n,22))+Et(n,r,i)|0;w=m,m=l,l=s,s=c+j|0,c=i,i=r,r=n,n=j+Y|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,c=c+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,r,i,c,s,l,m,w)}roundClean(){L(O)}destroy(){this.set(0,0,0,0,0,0,0,0),L(this.buffer)}},ot=class extends et{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 At=Ct(()=>new ot);var K="__principal__",te=2,wt=4,ee="aaaaa-aa",M=class e{static anonymous(){return new this(new Uint8Array([wt]))}static managementCanister(){return this.fromText(ee)}static selfAuthenticating(t){let o=At(t);return new this(new Uint8Array([...o,te]))}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(St(t))}static fromText(t){let o=t;if(t.includes(K)){let c=JSON.parse(t);K in c&&(o=c[K])}let n=o.toLowerCase().replace(/-/g,""),r=ut(n);r=r.slice(4,r.length);let i=new this(r);if(i.toText()!==o)throw new Error(`Principal "${i.toText()}" does not have a valid checksum (original value "${o}" may not be a valid Principal ID).`);return i}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]===wt}toUint8Array(){return this._arr}toHex(){return yt(this._arr).toUpperCase()}toText(){let t=new ArrayBuffer(4);new DataView(t).setUint32(0,bt(this._arr));let n=new Uint8Array(t),r=new Uint8Array([...n,...this._arr]),c=dt(r).match(/.{1,5}/g);if(!c)throw new Error;return c.join("-")}toString(){return this.toText()}toJSON(){return{[K]: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 oe}from"@dfinity/zod-schemas";import*as U from"zod";var F=U.string().refine(e=>oe.safeParse(e).success,{message:"Invalid textual representation of a Principal."}),q=U.unknown().transform((e,t)=>M.isPrincipal(e)?M.from(e):(t.issues.push({code:"custom",message:"Invalid Principal",input:e}),U.NEVER));var It=Ot.unknown().refine(e=>e!=null&&typeof e=="object"&&"transformRequest"in e&&typeof e.transformRequest=="function"&&"getPrincipal"in e&&typeof e.getPrincipal=="function"&&q.safeParse(e.getPrincipal()).success,{message:"Invalid Identity"});var nt=u.strictObject({satelliteId:q,identity:It,container:u.string().optional()}),ne=u.function({input:u.tuple([nt]),output:u.promise(u.void()).or(u.void())}),rt=u.strictObject({run:D(ne)});var re=H.function({input:H.tuple([nt]),output:rt}),ao=H.union([rt,D(re)]);function so(e){return e}import*as Rt from"zod";import*as I from"zod";var R=I.union([I.literal("production"),I.string()]),_t=I.object({mode:R});var lo=_t.extend({profile:Rt.string().optional()});function bo(e){return e}import{PrincipalTextSchema as se}from"@dfinity/zod-schemas";import*as g from"zod";import*as f from"zod";import*as k from"zod";var Q=k.object({heap:k.bigint().optional(),stable:k.bigint().optional()}).strict();var it=f.string(),ie=f.object({source:it,headers:f.array(f.tuple([f.string(),f.string()]))}).strict(),ce=f.object({source:it,destination:f.string()}).strict(),ae=f.object({source:it,location:f.string(),code:f.union([f.literal(301),f.literal(302)])}).strict(),$=f.object({headers:f.array(ie).optional(),rewrites:f.array(ce).optional(),redirects:f.array(ae).optional(),iframe:f.enum(["deny","same-origin","allow-any"]).optional(),rawAccess:f.boolean().optional(),maxMemorySize:Q.optional(),version:f.bigint().optional()});import*as p from"zod";import*as Tt from"zod";var jt=Tt.enum(["identity","gzip","compress","deflate","br"]);var Pt=p.strictObject({pattern:p.string().optional(),mode:p.enum(["both","replace"]).optional(),algorithm:p.enum(["gzip","brotli"]).optional()}),Ut=p.strictObject({source:p.string().optional(),ignore:p.array(p.string()).optional(),precompress:p.union([Pt,p.array(Pt),p.literal(!1)]).optional(),encoding:p.array(p.tuple([p.string(),jt])).optional(),predeploy:p.array(p.string()).optional(),postdeploy:p.array(p.string()).optional()});var fe=g.object({id:se}),xe=g.object({ids:g.record(R,F)}),Ft=g.object({...Ut.shape,storage:$.optional()}),_o=g.union([g.object({...fe.shape,...Ft.shape}).strict(),g.object({...xe.shape,...Ft.shape}).strict()]);import*as A from"zod";var pe=A.record(A.string(),A.string()),To=A.object({name:A.string(),version:A.string(),dependencies:pe.optional()});var Po="@junobuild/satellite",Uo="@junobuild/sputnik",Fo="@junobuild/mission-control",Ho="@junobuild/orbiter";function Jo(e){return e}import*as _ from"zod";var Ht=_.strictObject({heapMemory:_.union([_.bigint(),_.boolean()]).optional()});import{PrincipalTextSchema as le}from"@dfinity/zod-schemas";import*as b from"zod";var de=b.strictObject({derivationOrigin:b.url().optional(),externalAlternativeOrigins:b.array(b.url()).optional()}),ue=b.strictObject({allowedCallers:b.array(le)}),vt=b.strictObject({internetIdentity:de.optional(),rules:ue.optional(),version:b.bigint().optional()});import*as B from"zod";import*as d from"zod";var Jt=d.enum(["public","private","managed","controllers"]),be=d.enum(["heap","stable"]),Do=d.enum(["db","storage"]),ct=d.strictObject({collection:d.string(),read:Jt,write:Jt,memory:be,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 me=ct.omit({createdAt:!0,updatedAt:!0,maxSize:!0}),he=ct.omit({createdAt:!0,updatedAt:!0,maxCapacity:!0}),Lt=B.strictObject({datastore:B.array(me).optional(),storage:B.array(he).optional()});import*as X from"zod";var Mt=X.strictObject({maxMemorySize:Q.optional(),version:X.bigint().optional()});import*as a from"zod";var at={registry:!1,cmc:!0,icp:!0,cycles:!1,nns:!0,sns:!1,internet_identity:!0,nns_dapp:!1},kt={...at,cmc:!1,nns:!1};var ge=["icp"],ye=["icp","nns"],Se=["cmc","icp","nns","sns","internet_identity"],Ce=(e,t)=>{let n={..."satellite"in e?kt:at,...e.network?.services??{}},r=({requiredServices:i,key:c})=>{i.find(l=>n[l]===!1)!==void 0&&t.addIssue({code:"custom",path:["network","services",c],message:`${c} requires: ${i.join(", ")}`})};n.nns_dapp&&r({requiredServices:Se,key:"nns_dapp"}),n.cmc&&r({requiredServices:ye,key:"cmc"}),n.nns&&r({requiredServices:ge,key:"nns"})},Bt=(e,t)=>{e.network!==void 0&&e.network.services!==void 0&&Ce(e,t)};var xt=a.strictObject({server:a.number().optional(),admin:a.number().optional(),timeoutInSeconds:a.number().int().positive().optional()}),ze=a.strictObject({console:a.number().optional()}),Ee=a.strictObject({ports:xt.extend(ze.shape).optional()}),Ae=a.strictObject({ports:xt.optional()}),we=a.strictObject({ports:xt.optional()}),st=a.strictObject({type:a.enum(["docker","podman"]),image:a.string().optional(),name:a.string().optional(),volume:a.string().optional(),target:a.string().optional(),platform:a.enum(["linux/amd64","linux/arm64"]).optional()}),Oe=a.strictObject({registry:a.boolean().optional(),cmc:a.boolean().optional(),icp:a.boolean().optional(),cycles:a.boolean().optional(),nns:a.boolean().optional(),sns:a.boolean().optional(),internet_identity:a.boolean().optional(),nns_dapp:a.boolean().optional()}),ft=a.strictObject({services:Oe}),Dt=a.union([a.strictObject({runner:st.optional(),network:ft.optional(),skylab:Ee}),a.strictObject({runner:st.optional(),network:ft.optional(),console:Ae}),a.strictObject({runner:st.optional(),network:ft.optional(),satellite:we})]).superRefine(Bt);import*as y from"zod";var Ie=y.enum(["controllers","public"]),Nt=y.strictObject({freezingThreshold:y.bigint().optional(),reservedCyclesLimit:y.bigint().optional(),logVisibility:Ie.optional(),heapMemoryLimit:y.bigint().optional(),memoryAllocation:y.bigint().optional(),computeAllocation:y.bigint().optional()});import{PrincipalTextSchema as _e}from"@dfinity/zod-schemas";import*as T from"zod";var Re=T.object({id:_e}),Te=T.object({ids:T.record(R,F)}),Vt=T.union([Re.strict(),Te.strict()]);import{PrincipalTextSchema as je}from"@dfinity/zod-schemas";import*as S from"zod";var Pe=S.object({id:je}),Ue=S.object({ids:S.record(R,F)}),Gt=S.object({storage:$.optional(),datastore:Mt.optional(),authentication:vt.optional(),assertions:Ht.optional(),settings:Nt.optional(),collections:Lt.optional()}),Wt=S.union([S.object({...Pe.shape,...Gt.shape}).strict(),S.object({...Ue.shape,...Gt.shape}).strict()]);import*as Kt from"zod";var gn=Kt.strictObject({satellite:Wt,orbiter:Vt.optional(),emulator:Dt.optional()});export{de as AuthenticationConfigInternetIdentitySchema,ue as AuthenticationConfigRulesSchema,vt as AuthenticationConfigSchema,Ut as CliConfigSchema,Lt as CollectionsSchema,fe as ConsoleIdSchema,xe as ConsoleIdsSchema,at as DEFAULT_NETWORK_SERVICES,kt as DEFAULT_SATELLITE_NETWORK_SERVICES,me as DatastoreCollectionSchema,Mt as DatastoreConfigSchema,Dt as EmulatorConfigSchema,jt as EncodingTypeSchema,Fo as JUNO_PACKAGE_MISSION_CONTROL_ID,Ho as JUNO_PACKAGE_ORBITER_ID,Po as JUNO_PACKAGE_SATELLITE_ID,Uo as JUNO_PACKAGE_SPUTNIK_ID,_t as JunoConfigEnvSchema,R as JunoConfigModeSchema,gn as JunoConfigSchema,_o as JunoConsoleConfigSchema,pe as JunoPackageDependenciesSchema,To as JunoPackageSchema,Q as MaxMemorySizeConfigSchema,be as MemoryTextSchema,Ie as ModuleLogVisibilitySchema,Nt as ModuleSettingsSchema,nt as OnRunContextSchema,lo as OnRunEnvSchema,rt as OnRunSchema,Vt as OrbiterConfigSchema,Re as OrbiterIdSchema,Te as OrbiterIdsSchema,Jt as PermissionTextSchema,Pt as PrecompressSchema,ct as RuleSchema,Do as RulesTypeSchema,ao as RunFnOrObjectSchema,re as RunFnSchema,Ht as SatelliteAssertionsSchema,Wt as SatelliteConfigOptionsSchema,Pe as SatelliteIdSchema,Ue as SatelliteIdsSchema,he as StorageCollectionSchema,ie as StorageConfigHeaderSchema,ae as StorageConfigRedirectSchema,ce as StorageConfigRewriteSchema,$ as StorageConfigSchema,it as StorageConfigSourceGlobSchema,Jo as defineConfig,bo as defineConsoleConfig,so as defineRun};
|
|
1
|
+
import*as v from"zod";import*as dt from"zod";var B=e=>dt.custom(t=>e.implement(t));import*as b from"zod";import*as It from"zod";import{PrincipalTextSchema as ne}from"@dfinity/zod-schemas";var N="abcdefghijklmnopqrstuvwxyz234567",P=Object.create(null);for(let e=0;e<N.length;e++)P[N[e]]=e;P[0]=P.o;P[1]=P.i;function ut(e){let t=0,o=0,n="";function r(i){return t<0?o|=i>>-t:o=i<<t&248,t>3?(t-=8,1):(t<4&&(n+=N[o>>3],t+=5),0)}for(let i=0;i<e.length;)i+=r(e[i]);return n+(t<0?N[o>>3]:"")}function bt(e){let t=0,o=0,n=new Uint8Array(e.length*4/3|0),r=0;function i(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[r++]=o,t-=8,t>0?o=s<<5-t&255:o=0)}for(let a of e)i(a);return n.slice(0,r)}var $t=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 mt(e){let t=-1;for(let o=0;o<e.length;o++){let r=(e[o]^t)&255;t=$t[r]^t>>>8}return(t^-1)>>>0}function Qt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function J(e,...t){if(!Qt(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 tt(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 gt(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 L(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function V(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function h(e,t){return e<<32-t|e>>>t}var yt=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Xt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function St(e){if(J(e),yt)return e.toHex();let t="";for(let o=0;o<e.length;o++)t+=Xt[e[o]];return t}var C={_0:48,_9:57,A:65,F:70,a:97,f:102};function ht(e){if(e>=C._0&&e<=C._9)return e-C._0;if(e>=C.A&&e<=C.F)return e-(C.A-10);if(e>=C.a&&e<=C.f)return e-(C.a-10)}function Ct(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(yt)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 r=0,i=0;r<o;r++,i+=2){let a=ht(e.charCodeAt(i)),s=ht(e.charCodeAt(i+1));if(a===void 0||s===void 0){let l=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+i)}n[r]=a*16+s}return n}function Yt(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function et(e){return typeof e=="string"&&(e=Yt(e)),J(e),e}var G=class{};function zt(e){let t=n=>e().update(et(n)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}function Zt(e,t,o,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,o,n);let r=BigInt(32),i=BigInt(4294967295),a=Number(o>>r&i),s=Number(o&i),l=n?4:0,m=n?0:4;e.setUint32(t+l,a,n),e.setUint32(t+m,s,n)}function Et(e,t,o){return e&t^~e&o}function At(e,t,o){return e&t^e&o^t&o}var W=class extends G{constructor(t,o,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=o,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(t),this.view=V(this.buffer)}update(t){tt(this),t=et(t),J(t);let{view:o,buffer:n,blockLen:r}=this,i=t.length;for(let a=0;a<i;){let s=Math.min(r-this.pos,i-a);if(s===r){let l=V(t);for(;r<=i-a;a+=r)this.process(l,a);continue}n.set(t.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===r&&(this.process(o,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){tt(this),gt(t,this),this.finished=!0;let{buffer:o,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;o[a++]=128,L(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let x=a;x<r;x++)o[x]=0;Zt(n,r-8,BigInt(this.length*8),i),this.process(n,0);let s=V(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],i)}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:r,finished:i,destroyed:a,pos:s}=this;return t.destroyed=a,t.finished=i,t.length=r,t.pos=s,r%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 te=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),ot=class extends W{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:r,E:i,F:a,G:s,H:l}=this;return[t,o,n,r,i,a,s,l]}set(t,o,n,r,i,a,s,l){this.A=t|0,this.B=o|0,this.C=n|0,this.D=r|0,this.E=i|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 H=O[x-15],j=O[x-2],lt=h(H,7)^h(H,18)^H>>>3,Z=h(j,17)^h(j,19)^j>>>10;O[x]=Z+O[x-7]+lt+O[x-16]|0}let{A:n,B:r,C:i,D:a,E:s,F:l,G:m,H:w}=this;for(let x=0;x<64;x++){let H=h(s,6)^h(s,11)^h(s,25),j=w+H+Et(s,l,m)+te[x]+O[x]|0,Z=(h(n,2)^h(n,13)^h(n,22))+At(n,r,i)|0;w=m,m=l,l=s,s=a+j|0,a=i,i=r,r=n,n=j+Z|0}n=n+this.A|0,r=r+this.B|0,i=i+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,r,i,a,s,l,m,w)}roundClean(){L(O)}destroy(){this.set(0,0,0,0,0,0,0,0),L(this.buffer)}},nt=class extends ot{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 wt=zt(()=>new nt);var K="__principal__",ee=2,Ot=4,oe="aaaaa-aa",k=class e{static anonymous(){return new this(new Uint8Array([Ot]))}static managementCanister(){return this.fromText(oe)}static selfAuthenticating(t){let o=wt(t);return new this(new Uint8Array([...o,ee]))}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(Ct(t))}static fromText(t){let o=t;if(t.includes(K)){let a=JSON.parse(t);K in a&&(o=a[K])}let n=o.toLowerCase().replace(/-/g,""),r=bt(n);r=r.slice(4,r.length);let i=new this(r);if(i.toText()!==o)throw new Error(`Principal "${i.toText()}" does not have a valid checksum (original value "${o}" may not be a valid Principal ID).`);return i}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]===Ot}toUint8Array(){return this._arr}toHex(){return St(this._arr).toUpperCase()}toText(){let t=new ArrayBuffer(4);new DataView(t).setUint32(0,mt(this._arr));let n=new Uint8Array(t),r=new Uint8Array([...n,...this._arr]),a=ut(r).match(/.{1,5}/g);if(!a)throw new Error;return a.join("-")}toString(){return this.toText()}toJSON(){return{[K]: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 F=U.string().refine(e=>ne.safeParse(e).success,{message:"Invalid textual representation of a Principal."}),q=U.unknown().transform((e,t)=>k.isPrincipal(e)?k.from(e):(t.issues.push({code:"custom",message:"Invalid Principal",input:e}),U.NEVER));var _t=It.unknown().refine(e=>e!=null&&typeof e=="object"&&"transformRequest"in e&&typeof e.transformRequest=="function"&&"getPrincipal"in e&&typeof e.getPrincipal=="function"&&q.safeParse(e.getPrincipal()).success,{message:"Invalid Identity"});var rt=b.strictObject({satelliteId:q,identity:_t,container:b.string().optional()}),re=b.function({input:b.tuple([rt]),output:b.promise(b.void()).or(b.void())}),it=b.strictObject({run:B(re)});var ie=v.function({input:v.tuple([rt]),output:it}),fo=v.union([it,B(ie)]);function xo(e){return e}import*as Rt from"zod";import*as I from"zod";var T=I.union([I.literal("production"),I.string()]),Tt=I.object({mode:T});var bo=Tt.extend({profile:Rt.string().optional()});function ho(e){return e}import{PrincipalTextSchema as de}from"@dfinity/zod-schemas";import*as g from"zod";import{PrincipalTextSchema as jt}from"@dfinity/zod-schemas";import*as u from"zod";var ae=u.strictObject({derivationOrigin:u.url().optional(),externalAlternativeOrigins:u.array(u.url()).optional()}),ce=u.strictObject({allowedTargets:u.array(jt).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()}),se=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:ce.optional()}),fe=u.strictObject({allowedCallers:u.array(jt)}),$=u.strictObject({internetIdentity:ae.optional(),google:se.optional(),rules:fe.optional(),version:u.bigint().optional()});import*as f from"zod";import*as M from"zod";var Q=M.object({heap:M.bigint().optional(),stable:M.bigint().optional()}).strict();var at=f.string(),xe=f.object({source:at,headers:f.array(f.tuple([f.string(),f.string()]))}).strict(),pe=f.object({source:at,destination:f.string()}).strict(),le=f.object({source:at,location:f.string(),code:f.union([f.literal(301),f.literal(302)])}).strict(),X=f.object({headers:f.array(xe).optional(),rewrites:f.array(pe).optional(),redirects:f.array(le).optional(),iframe:f.enum(["deny","same-origin","allow-any"]).optional(),rawAccess:f.boolean().optional(),maxMemorySize:Q.optional(),version:f.bigint().optional()});import*as p from"zod";import*as Pt from"zod";var Ut=Pt.enum(["identity","gzip","compress","deflate","br"]);var Ft=p.strictObject({pattern:p.string().optional(),mode:p.enum(["both","replace"]).optional(),algorithm:p.enum(["gzip","brotli"]).optional()}),vt=p.strictObject({source:p.string().optional(),ignore:p.array(p.string()).optional(),precompress:p.union([Ft,p.array(Ft),p.literal(!1)]).optional(),encoding:p.array(p.tuple([p.string(),Ut])).optional(),predeploy:p.array(p.string()).optional(),postdeploy:p.array(p.string()).optional()});var ue=g.object({id:de}),be=g.object({ids:g.record(T,F)}),Ht=g.object({...vt.shape,storage:X.optional(),authentication:$.optional()}),Uo=g.union([g.object({...ue.shape,...Ht.shape}).strict(),g.object({...be.shape,...Ht.shape}).strict()]);import*as A from"zod";var me=A.record(A.string(),A.string()),vo=A.object({name:A.string(),version:A.string(),dependencies:me.optional()});var Jo="@junobuild/satellite",Lo="@junobuild/sputnik",ko="@junobuild/mission-control",Mo="@junobuild/orbiter";function Bo(e){return e}import*as _ from"zod";var Jt=_.strictObject({heapMemory:_.union([_.bigint(),_.boolean()]).optional()});import*as D from"zod";import*as d from"zod";var Lt=d.enum(["public","private","managed","controllers"]),he=d.enum(["heap","stable"]),Vo=d.enum(["db","storage"]),ct=d.strictObject({collection:d.string(),read:Lt,write:Lt,memory:he,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 ge=ct.omit({createdAt:!0,updatedAt:!0,maxSize:!0}),ye=ct.omit({createdAt:!0,updatedAt:!0,maxCapacity:!0}),kt=D.strictObject({datastore:D.array(ge).optional(),storage:D.array(ye).optional()});import*as Y from"zod";var Mt=Y.strictObject({maxMemorySize:Q.optional(),version:Y.bigint().optional()});import*as c from"zod";var st={registry:!1,cmc:!0,icp:!0,cycles:!1,nns:!0,sns:!1,internet_identity:!0,nns_dapp:!1},Dt={...st,cmc:!1,nns:!1};var Se=["icp"],Ce=["icp","nns"],ze=["cmc","icp","nns","sns","internet_identity"],Ee=(e,t)=>{let n={..."satellite"in e?Dt:st,...e.network?.services??{}},r=({requiredServices:i,key:a})=>{i.find(l=>n[l]===!1)!==void 0&&t.addIssue({code:"custom",path:["network","services",a],message:`${a} requires: ${i.join(", ")}`})};n.nns_dapp&&r({requiredServices:ze,key:"nns_dapp"}),n.cmc&&r({requiredServices:Ce,key:"cmc"}),n.nns&&r({requiredServices:Se,key:"nns"})},Bt=(e,t)=>{e.network!==void 0&&e.network.services!==void 0&&Ee(e,t)};var pt=c.strictObject({server:c.number().optional(),admin:c.number().optional(),timeoutInSeconds:c.number().int().positive().optional()}),Ae=c.strictObject({console:c.number().optional()}),we=c.strictObject({ports:pt.extend(Ae.shape).optional()}),Oe=c.strictObject({ports:pt.optional()}),Ie=c.strictObject({ports:pt.optional()}),ft=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()}),_e=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()}),xt=c.strictObject({services:_e}),Nt=c.union([c.strictObject({runner:ft.optional(),network:xt.optional(),skylab:we}),c.strictObject({runner:ft.optional(),network:xt.optional(),console:Oe}),c.strictObject({runner:ft.optional(),network:xt.optional(),satellite:Ie})]).superRefine(Bt);import*as y from"zod";var Te=y.enum(["controllers","public"]),Gt=y.strictObject({freezingThreshold:y.bigint().optional(),reservedCyclesLimit:y.bigint().optional(),logVisibility:Te.optional(),heapMemoryLimit:y.bigint().optional(),memoryAllocation:y.bigint().optional(),computeAllocation:y.bigint().optional()});import{PrincipalTextSchema as Re}from"@dfinity/zod-schemas";import*as R from"zod";var je=R.object({id:Re}),Pe=R.object({ids:R.record(T,F)}),Vt=R.union([je.strict(),Pe.strict()]);import{PrincipalTextSchema as Ue}from"@dfinity/zod-schemas";import*as S from"zod";var Fe=S.object({id:Ue}),ve=S.object({ids:S.record(T,F)}),Wt=S.object({storage:X.optional(),datastore:Mt.optional(),authentication:$.optional(),assertions:Jt.optional(),settings:Gt.optional(),collections:kt.optional()}),Kt=S.union([S.object({...Fe.shape,...Wt.shape}).strict(),S.object({...ve.shape,...Wt.shape}).strict()]);import*as qt from"zod";var Cn=qt.strictObject({satellite:Kt,orbiter:Vt.optional(),emulator:Nt.optional()});export{ce as AuthenticationConfigDelegationSchema,se as AuthenticationConfigGoogleSchema,ae as AuthenticationConfigInternetIdentitySchema,fe as AuthenticationConfigRulesSchema,$ as AuthenticationConfigSchema,vt as CliConfigSchema,kt as CollectionsSchema,ue as ConsoleIdSchema,be as ConsoleIdsSchema,st as DEFAULT_NETWORK_SERVICES,Dt as DEFAULT_SATELLITE_NETWORK_SERVICES,ge as DatastoreCollectionSchema,Mt as DatastoreConfigSchema,Nt as EmulatorConfigSchema,Ut as EncodingTypeSchema,ko as JUNO_PACKAGE_MISSION_CONTROL_ID,Mo as JUNO_PACKAGE_ORBITER_ID,Jo as JUNO_PACKAGE_SATELLITE_ID,Lo as JUNO_PACKAGE_SPUTNIK_ID,Tt as JunoConfigEnvSchema,T as JunoConfigModeSchema,Cn as JunoConfigSchema,Uo as JunoConsoleConfigSchema,me as JunoPackageDependenciesSchema,vo as JunoPackageSchema,Q as MaxMemorySizeConfigSchema,he as MemoryTextSchema,Te as ModuleLogVisibilitySchema,Gt as ModuleSettingsSchema,rt as OnRunContextSchema,bo as OnRunEnvSchema,it as OnRunSchema,Vt as OrbiterConfigSchema,je as OrbiterIdSchema,Pe as OrbiterIdsSchema,Lt as PermissionTextSchema,Ft as PrecompressSchema,ct as RuleSchema,Vo as RulesTypeSchema,fo as RunFnOrObjectSchema,ie as RunFnSchema,Jt as SatelliteAssertionsSchema,Kt as SatelliteConfigOptionsSchema,Fe as SatelliteIdSchema,ve as SatelliteIdsSchema,ye as StorageCollectionSchema,xe as StorageConfigHeaderSchema,le as StorageConfigRedirectSchema,pe as StorageConfigRewriteSchema,X as StorageConfigSchema,at as StorageConfigSourceGlobSchema,Bo as defineConfig,ho as defineConsoleConfig,xo as defineRun};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@noble/hashes/esm/utils.js:
|