@junobuild/functions 0.7.1 → 0.7.2-next-2026-03-20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,11 +46,9 @@ JavaScript and TypeScript utilities for [Juno] Serverless Functions.
46
46
  - [createListResultsSchema](#gear-createlistresultsschema)
47
47
  - [decodeDocData](#gear-decodedocdata)
48
48
  - [encodeDocData](#gear-encodedocdata)
49
+ - [getAdminAccessKeys](#gear-getadminaccesskeys)
50
+ - [getAccessKeys](#gear-getaccesskeys)
49
51
  - [normalizeCaller](#gear-normalizecaller)
50
- - [getAdminControllers](#gear-getadmincontrollers)
51
- - [getControllers](#gear-getcontrollers)
52
- - [isAdminController](#gear-isadmincontroller)
53
- - [isController](#gear-iscontroller)
54
52
  - [setDocStore](#gear-setdocstore)
55
53
  - [deleteDocStore](#gear-deletedocstore)
56
54
  - [getDocStore](#gear-getdocstore)
@@ -59,6 +57,9 @@ JavaScript and TypeScript utilities for [Juno] Serverless Functions.
59
57
  - [countDocsStore](#gear-countdocsstore)
60
58
  - [deleteDocsStore](#gear-deletedocsstore)
61
59
  - [deleteFilteredDocsStore](#gear-deletefiltereddocsstore)
60
+ - [callerIsAdmin](#gear-callerisadmin)
61
+ - [callerHasWritePermission](#gear-callerhaswritepermission)
62
+ - [callerIsAccessKey](#gear-callerisaccesskey)
62
63
  - [countCollectionAssetsStore](#gear-countcollectionassetsstore)
63
64
  - [countAssetsStore](#gear-countassetsstore)
64
65
  - [setAssetHandler](#gear-setassethandler)
@@ -398,90 +399,52 @@ The serialized raw data.
398
399
 
399
400
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/serializer.sdk.ts#L21)
400
401
 
401
- #### :gear: normalizeCaller
402
-
403
- Normalizes a user ID into a raw `Uint8Array` representation.
404
-
405
- | Function | Type |
406
- | ----------------- | ------------------------------- |
407
- | `normalizeCaller` | `(caller: any) => RawPrincipal` |
408
-
409
- Parameters:
410
-
411
- - `caller`: - The caller identity, either a raw `Uint8Array`
412
- or a `Principal` instance.
413
-
414
- Returns:
415
-
416
- The raw user ID as a `Uint8Array`.
417
-
418
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/utils/caller.utils.ts#L12)
419
-
420
- #### :gear: getAdminControllers
421
-
422
- Gets the list of admin controllers from the Satellite.
423
-
424
- | Function | Type |
425
- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
426
- | `getAdminControllers` | `() => [Uint8Array<ArrayBuffer>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` |
427
-
428
- Returns:
429
-
430
- The list of admin controllers.
431
-
432
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/controllers.sdk.ts#L15)
402
+ #### :gear: getAdminAccessKeys
433
403
 
434
- #### :gear: getControllers
404
+ Gets the list of admin access keys from the Satellite.
435
405
 
436
- Gets the list of controllers from the Satellite.
437
-
438
- | Function | Type |
439
- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
440
- | `getControllers` | `() => [Uint8Array<ArrayBuffer>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` |
406
+ | Function | Type |
407
+ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
408
+ | `getAdminAccessKeys` | `() => [Uint8Array<ArrayBuffer>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` |
441
409
 
442
410
  Returns:
443
411
 
444
- The list of all controllers.
445
-
446
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/controllers.sdk.ts#L24)
412
+ The list of admin acces keys.
447
413
 
448
- #### :gear: isAdminController
414
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/accessKeys.sdk.ts#L10)
449
415
 
450
- Checks if the given caller is an admin among the provided controllers.
416
+ #### :gear: getAccessKeys
451
417
 
452
- | Function | Type |
453
- | ------------------- | -------------------------------------------- |
454
- | `isAdminController` | `(params: ControllerCheckParams) => boolean` |
418
+ Gets the list of access keys from the Satellite.
455
419
 
456
- Parameters:
457
-
458
- - `params`: - The parameters including the caller identity
459
- and the list of controllers to verify against.
420
+ | Function | Type |
421
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
422
+ | `getAccessKeys` | `() => [Uint8Array<ArrayBuffer>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` |
460
423
 
461
424
  Returns:
462
425
 
463
- Whether the caller is an admin.
426
+ The list of all access keys.
464
427
 
465
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/controllers.sdk.ts#L36)
428
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/accessKeys.sdk.ts#L19)
466
429
 
467
- #### :gear: isController
430
+ #### :gear: normalizeCaller
468
431
 
469
- Checks if the given caller exists among the provided controllers.
432
+ Normalizes a user ID into a raw `Uint8Array` representation.
470
433
 
471
- | Function | Type |
472
- | -------------- | -------------------------------------------- |
473
- | `isController` | `(params: ControllerCheckParams) => boolean` |
434
+ | Function | Type |
435
+ | ----------------- | ------------------------------- |
436
+ | `normalizeCaller` | `(caller: any) => RawPrincipal` |
474
437
 
475
438
  Parameters:
476
439
 
477
- - `params`: - The parameters including the caller identity
478
- and the list of controllers to verify against.
440
+ - `caller`: - The caller identity, either a raw `Uint8Array`
441
+ or a `Principal` instance.
479
442
 
480
443
  Returns:
481
444
 
482
- Whether the caller is a controller.
445
+ The raw user ID as a `Uint8Array`.
483
446
 
484
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/controllers.sdk.ts#L56)
447
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/utils/caller.utils.ts#L12)
485
448
 
486
449
  #### :gear: setDocStore
487
450
 
@@ -629,6 +592,36 @@ The context resulting of the deletion of documents that match the provided filte
629
592
 
630
593
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/db.sdk.ts#L175)
631
594
 
595
+ #### :gear: callerIsAdmin
596
+
597
+ Guard that succeeds if the caller is an admin access key of this satellite.
598
+
599
+ | Function | Type |
600
+ | --------------- | ------------ |
601
+ | `callerIsAdmin` | `() => void` |
602
+
603
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/guards.sdk.ts#L10)
604
+
605
+ #### :gear: callerHasWritePermission
606
+
607
+ Guard that succeeds if the caller is an access key with write permission.
608
+
609
+ | Function | Type |
610
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
611
+ | `callerHasWritePermission` | `() => [Uint8Array<ArrayBuffer>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` |
612
+
613
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/guards.sdk.ts#L21)
614
+
615
+ #### :gear: callerIsAccessKey
616
+
617
+ Guard that succeeds if the caller is any recognized access key of this satellite.
618
+
619
+ | Function | Type |
620
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
621
+ | `callerIsAccessKey` | `() => [Uint8Array<ArrayBuffer>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` |
622
+
623
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/guards.sdk.ts#L31)
624
+
632
625
  #### :gear: countCollectionAssetsStore
633
626
 
634
627
  Counts the number of assets in a specific collection.
@@ -916,9 +909,7 @@ The current timestamp.
916
909
  - [CustomFunctionSchema](#gear-customfunctionschema)
917
910
  - [QuerySchema](#gear-queryschema)
918
911
  - [UpdateSchema](#gear-updateschema)
919
- - [Uint8ArraySchema](#gear-uint8arrayschema)
920
912
  - [RawPrincipalSchema](#gear-rawprincipalschema)
921
- - [PrincipalSchema](#gear-principalschema)
922
913
  - [TimestampSchema](#gear-timestampschema)
923
914
  - [VersionSchema](#gear-versionschema)
924
915
  - [RawUserIdSchema](#gear-rawuseridschema)
@@ -981,13 +972,12 @@ The current timestamp.
981
972
  - [ListOrderFieldSchema](#gear-listorderfieldschema)
982
973
  - [ListOrderSchema](#gear-listorderschema)
983
974
  - [ListParamsSchema](#gear-listparamsschema)
984
- - [ControllerScopeSchema](#gear-controllerscopeschema)
985
- - [ControllerKindSchema](#gear-controllerkindschema)
975
+ - [AccessKeyScopeSchema](#gear-accesskeyscopeschema)
976
+ - [AccessKeyKindSchema](#gear-accesskeykindschema)
986
977
  - [MetadataSchema](#gear-metadataschema)
987
- - [ControllerSchema](#gear-controllerschema)
988
- - [ControllerRecordSchema](#gear-controllerrecordschema)
989
- - [ControllersSchema](#gear-controllersschema)
990
- - [ControllerCheckParamsSchema](#gear-controllercheckparamsschema)
978
+ - [AccessKeySchema](#gear-accesskeyschema)
979
+ - [AccessKeyRecordSchema](#gear-accesskeyrecordschema)
980
+ - [AccessKeysSchema](#gear-accesskeysschema)
991
981
  - [CollectionParamsSchema](#gear-collectionparamsschema)
992
982
  - [ListStoreParamsSchema](#gear-liststoreparamsschema)
993
983
  - [GetDocStoreParamsSchema](#gear-getdocstoreparamsschema)
@@ -1122,16 +1112,6 @@ References:
1122
1112
 
1123
1113
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/functions/update.ts#L23)
1124
1114
 
1125
- #### :gear: Uint8ArraySchema
1126
-
1127
- A schema that validates a value is an Uint8Array.
1128
-
1129
- | Constant | Type |
1130
- | ------------------ | ------------------------------------------------------------- |
1131
- | `Uint8ArraySchema` | `ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>` |
1132
-
1133
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/candid.ts#L10)
1134
-
1135
1115
  #### :gear: RawPrincipalSchema
1136
1116
 
1137
1117
  | Constant | Type |
@@ -1142,19 +1122,7 @@ References:
1142
1122
 
1143
1123
  - RawPrincipal
1144
1124
 
1145
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/candid.ts#L15)
1146
-
1147
- #### :gear: PrincipalSchema
1148
-
1149
- | Constant | Type |
1150
- | ----------------- | ------------------------------------------------------------------------------ |
1151
- | `PrincipalSchema` | `ZodPipe<ZodCustom<Principal, Principal>, ZodTransform<Principal, Principal>>` |
1152
-
1153
- References:
1154
-
1155
- - Principal
1156
-
1157
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/candid.ts#L25)
1125
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/principal.ts#L6)
1158
1126
 
1159
1127
  #### :gear: TimestampSchema
1160
1128
 
@@ -1166,7 +1134,7 @@ References:
1166
1134
 
1167
1135
  - Timestamp
1168
1136
 
1169
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L7)
1137
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L8)
1170
1138
 
1171
1139
  #### :gear: VersionSchema
1172
1140
 
@@ -1178,7 +1146,7 @@ References:
1178
1146
 
1179
1147
  - Version
1180
1148
 
1181
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L19)
1149
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L20)
1182
1150
 
1183
1151
  #### :gear: RawUserIdSchema
1184
1152
 
@@ -1190,19 +1158,19 @@ References:
1190
1158
 
1191
1159
  - RawUserId
1192
1160
 
1193
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L31)
1161
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L32)
1194
1162
 
1195
1163
  #### :gear: UserIdSchema
1196
1164
 
1197
- | Constant | Type |
1198
- | -------------- | ------------------------------------------------------------------------------ |
1199
- | `UserIdSchema` | `ZodPipe<ZodCustom<Principal, Principal>, ZodTransform<Principal, Principal>>` |
1165
+ | Constant | Type |
1166
+ | -------------- | ------------------------------------------------------ |
1167
+ | `UserIdSchema` | `ZodPipe<ZodCustom<any, any>, ZodTransform<any, any>>` |
1200
1168
 
1201
1169
  References:
1202
1170
 
1203
1171
  - UserId
1204
1172
 
1205
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L43)
1173
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L44)
1206
1174
 
1207
1175
  #### :gear: CollectionSchema
1208
1176
 
@@ -1214,7 +1182,7 @@ References:
1214
1182
 
1215
1183
  - Collection
1216
1184
 
1217
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L55)
1185
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L56)
1218
1186
 
1219
1187
  #### :gear: KeySchema
1220
1188
 
@@ -1226,7 +1194,7 @@ References:
1226
1194
 
1227
1195
  - Key
1228
1196
 
1229
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L65)
1197
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L66)
1230
1198
 
1231
1199
  #### :gear: DescriptionSchema
1232
1200
 
@@ -1238,7 +1206,7 @@ References:
1238
1206
 
1239
1207
  - Description
1240
1208
 
1241
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L75)
1209
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L76)
1242
1210
 
1243
1211
  #### :gear: CollectionsSchema
1244
1212
 
@@ -1900,29 +1868,29 @@ References:
1900
1868
 
1901
1869
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/list.ts#L103)
1902
1870
 
1903
- #### :gear: ControllerScopeSchema
1871
+ #### :gear: AccessKeyScopeSchema
1904
1872
 
1905
- | Constant | Type |
1906
- | ----------------------- | ---------------------------------------------------------------- |
1907
- | `ControllerScopeSchema` | `ZodEnum<{ write: "write"; admin: "admin"; submit: "submit"; }>` |
1873
+ | Constant | Type |
1874
+ | ---------------------- | ---------------------------------------------------------------- |
1875
+ | `AccessKeyScopeSchema` | `ZodEnum<{ write: "write"; admin: "admin"; submit: "submit"; }>` |
1908
1876
 
1909
1877
  References:
1910
1878
 
1911
- - ControllerScope
1879
+ - AccessKeyScope
1912
1880
 
1913
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L15)
1881
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L8)
1914
1882
 
1915
- #### :gear: ControllerKindSchema
1883
+ #### :gear: AccessKeyKindSchema
1916
1884
 
1917
- | Constant | Type |
1918
- | ---------------------- | -------------------------------------------------------------- |
1919
- | `ControllerKindSchema` | `ZodEnum<{ automation: "automation"; emulator: "emulator"; }>` |
1885
+ | Constant | Type |
1886
+ | --------------------- | -------------------------------------------------------------- |
1887
+ | `AccessKeyKindSchema` | `ZodEnum<{ automation: "automation"; emulator: "emulator"; }>` |
1920
1888
 
1921
1889
  References:
1922
1890
 
1923
- - ControllerKind
1891
+ - AccessKeyKind
1924
1892
 
1925
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L25)
1893
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L18)
1926
1894
 
1927
1895
  #### :gear: MetadataSchema
1928
1896
 
@@ -1934,55 +1902,43 @@ References:
1934
1902
 
1935
1903
  - MetadataSchema
1936
1904
 
1937
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L35)
1938
-
1939
- #### :gear: ControllerSchema
1940
-
1941
- | Constant | Type |
1942
- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1943
- | `ControllerSchema` | `ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; created_at: ZodBigInt; updated_at: ZodBigInt; expires_at: ZodOptional<...>; scope: ZodEnum<...>; kind: ZodOptional<...>; }, $strict>` |
1944
-
1945
- References:
1946
-
1947
- - ControllerSchema
1948
-
1949
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L45)
1905
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L28)
1950
1906
 
1951
- #### :gear: ControllerRecordSchema
1907
+ #### :gear: AccessKeySchema
1952
1908
 
1953
- | Constant | Type |
1954
- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1955
- | `ControllerRecordSchema` | `ZodTuple<[ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; ... 4 more ...; kind: ZodOptional<...>; }, $strict>], null>` |
1909
+ | Constant | Type |
1910
+ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1911
+ | `AccessKeySchema` | `ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; created_at: ZodBigInt; updated_at: ZodBigInt; expires_at: ZodOptional<...>; scope: ZodEnum<...>; kind: ZodOptional<...>; }, $strict>` |
1956
1912
 
1957
1913
  References:
1958
1914
 
1959
- - ControllerRecordSchema
1915
+ - AccessKeySchema
1960
1916
 
1961
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L94)
1917
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L38)
1962
1918
 
1963
- #### :gear: ControllersSchema
1919
+ #### :gear: AccessKeyRecordSchema
1964
1920
 
1965
- | Constant | Type |
1966
- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1967
- | `ControllersSchema` | `ZodArray<ZodTuple<[ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; ... 4 more ...; kind: ZodOptional<...>; }, $strict>], null>>` |
1921
+ | Constant | Type |
1922
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1923
+ | `AccessKeyRecordSchema` | `ZodTuple<[ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; ... 4 more ...; kind: ZodOptional<...>; }, $strict>], null>` |
1968
1924
 
1969
1925
  References:
1970
1926
 
1971
- - ControllersSchema
1927
+ - AccessKeyRecordSchema
1972
1928
 
1973
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L104)
1929
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L87)
1974
1930
 
1975
- #### :gear: ControllerCheckParamsSchema
1931
+ #### :gear: AccessKeysSchema
1976
1932
 
1977
- | Constant | Type |
1978
- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1979
- | `ControllerCheckParamsSchema` | `ZodObject<{ caller: ZodUnion<[ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, ZodPipe<ZodCustom<Principal, Principal>, ZodTransform<...>>]>; controllers: ZodArray<...>; }, $strip>` |
1933
+ | Constant | Type |
1934
+ | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1935
+ | `AccessKeysSchema` | `ZodArray<ZodTuple<[ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; ... 4 more ...; kind: ZodOptional<...>; }, $strict>], null>>` |
1980
1936
 
1981
1937
  References:
1982
1938
 
1983
- - ControllerCheckParamsSchema
1939
+ - AccessKeysSchema
1984
1940
 
1985
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L114)
1941
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L97)
1986
1942
 
1987
1943
  #### :gear: CollectionParamsSchema
1988
1944
 
@@ -2246,7 +2202,7 @@ References:
2246
2202
 
2247
2203
  - IDLType
2248
2204
 
2249
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L9)
2205
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L10)
2250
2206
 
2251
2207
  #### :gear: CallArgSchema
2252
2208
 
@@ -2258,7 +2214,7 @@ References:
2258
2214
 
2259
2215
  - CallArg
2260
2216
 
2261
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L21)
2217
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L22)
2262
2218
 
2263
2219
  #### :gear: CallArgsSchema
2264
2220
 
@@ -2272,7 +2228,7 @@ References:
2272
2228
 
2273
2229
  - CallArgs
2274
2230
 
2275
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L33)
2231
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L34)
2276
2232
 
2277
2233
  #### :gear: CallResultSchema
2278
2234
 
@@ -2284,19 +2240,19 @@ References:
2284
2240
 
2285
2241
  - CallResult
2286
2242
 
2287
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L49)
2243
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L50)
2288
2244
 
2289
2245
  #### :gear: CallParamsSchema
2290
2246
 
2291
- | Constant | Type |
2292
- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2293
- | `CallParamsSchema` | `ZodObject<{ canisterId: ZodUnion<[ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, ZodPipe<ZodCustom<Principal, Principal>, ZodTransform<...>>]>; method: ZodString; args: ZodOptional<...>; result: ZodOptional<...>; }, $strip>` |
2247
+ | Constant | Type |
2248
+ | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2249
+ | `CallParamsSchema` | `ZodObject<{ canisterId: ZodUnion<[ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, ZodPipe<ZodCustom<any, any>, ZodTransform<...>>]>; method: ZodString; args: ZodOptional<...>; result: ZodOptional<...>; }, $strip>` |
2294
2250
 
2295
2251
  References:
2296
2252
 
2297
2253
  - CallParams
2298
2254
 
2299
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L59)
2255
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L60)
2300
2256
 
2301
2257
  ### :factory: CallResponseLengthError
2302
2258
 
@@ -2328,8 +2284,7 @@ References:
2328
2284
  - [ListOrder](#gear-listorder)
2329
2285
  - [ListParams](#gear-listparams)
2330
2286
  - [ListResults](#gear-listresults)
2331
- - [Controller](#gear-controller)
2332
- - [ControllerCheckParams](#gear-controllercheckparams)
2287
+ - [AccessKey](#gear-accesskey)
2333
2288
  - [CollectionParams](#gear-collectionparams)
2334
2289
  - [SetAssetHandlerParams](#gear-setassethandlerparams)
2335
2290
  - [GetContentChunksStoreParams](#gear-getcontentchunksstoreparams)
@@ -2634,31 +2589,20 @@ List results, parameterized by type of returned item.
2634
2589
 
2635
2590
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/list.ts#L142)
2636
2591
 
2637
- #### :gear: Controller
2592
+ #### :gear: AccessKey
2638
2593
 
2639
- Represents a controller with access scope and associated metadata.
2594
+ Represents an access key with access scope and associated metadata.
2640
2595
 
2641
2596
  | Property | Type | Description |
2642
2597
  | ------------ | ----------------------------------------- | ------------------------------------------------------------------ |
2643
- | `metadata` | `[string, string][]` | A list of key-value metadata pairs associated with the controller. |
2644
- | `created_at` | `bigint` | The timestamp when the controller was created. |
2645
- | `updated_at` | `bigint` | The timestamp when the controller was last updated. |
2646
- | `expires_at` | `bigint or undefined` | Optional expiration timestamp for the controller. |
2647
- | `scope` | `"write" or "admin" or "submit"` | The scope assigned to the controller. |
2648
- | `kind` | `"automation" or "emulator" or undefined` | An optional kind identifier of the controller. |
2598
+ | `metadata` | `[string, string][]` | A list of key-value metadata pairs associated with the access key. |
2599
+ | `created_at` | `bigint` | The timestamp when the access key was created. |
2600
+ | `updated_at` | `bigint` | The timestamp when the access key was last updated. |
2601
+ | `expires_at` | `bigint or undefined` | Optional expiration timestamp for the access key. |
2602
+ | `scope` | `"write" or "admin" or "submit"` | The scope assigned to the access key. |
2603
+ | `kind` | `"automation" or "emulator" or undefined` | An optional kind identifier of the access key. |
2649
2604
 
2650
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L59)
2651
-
2652
- #### :gear: ControllerCheckParams
2653
-
2654
- Represents the parameters required to perform controller checks.
2655
-
2656
- | Property | Type | Description |
2657
- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
2658
- | `caller` | `any` | The identity of the caller to verify against the controller list. |
2659
- | `controllers` | `[Uint8Array<ArrayBuffer>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` | The list of controllers to check against. |
2660
-
2661
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L122)
2605
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L52)
2662
2606
 
2663
2607
  #### :gear: CollectionParams
2664
2608
 
@@ -2705,7 +2649,7 @@ Type representing the parameters required to make a canister call.
2705
2649
  | `args` | `[IDL.Type<unknown>, unknown][] or undefined` | The arguments, including types and values, for the canister call. |
2706
2650
  | `result` | `any` | The expected result type used for decoding the response. |
2707
2651
 
2708
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L69)
2652
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L70)
2709
2653
 
2710
2654
  ### :cocktail: Types
2711
2655
 
@@ -2721,7 +2665,6 @@ Type representing the parameters required to make a canister call.
2721
2665
  - [UpdateFn](#gear-updatefn)
2722
2666
  - [UpdateFnOrObject](#gear-updatefnorobject)
2723
2667
  - [RawPrincipal](#gear-rawprincipal)
2724
- - [Principal](#gear-principal)
2725
2668
  - [Timestamp](#gear-timestamp)
2726
2669
  - [Version](#gear-version)
2727
2670
  - [RawUserId](#gear-rawuserid)
@@ -2783,11 +2726,11 @@ Type representing the parameters required to make a canister call.
2783
2726
  - [HookFnOrObject](#gear-hookfnorobject)
2784
2727
  - [TimestampMatcher](#gear-timestampmatcher)
2785
2728
  - [ListOrderField](#gear-listorderfield)
2786
- - [ControllerScope](#gear-controllerscope)
2787
- - [ControllerKind](#gear-controllerkind)
2729
+ - [AccessKeyScope](#gear-accesskeyscope)
2730
+ - [AccessKeyKind](#gear-accesskeykind)
2788
2731
  - [Metadata](#gear-metadata)
2789
- - [ControllerRecord](#gear-controllerrecord)
2790
- - [Controllers](#gear-controllers)
2732
+ - [AccessKeyRecord](#gear-accesskeyrecord)
2733
+ - [AccessKeys](#gear-accesskeys)
2791
2734
  - [ListStoreParams](#gear-liststoreparams)
2792
2735
  - [GetDocStoreParams](#gear-getdocstoreparams)
2793
2736
  - [SetDocStoreParams](#gear-setdocstoreparams)
@@ -2940,17 +2883,7 @@ Represents a raw principal - a Uint8Array representation of a Principal.
2940
2883
  | -------------- | ------------ |
2941
2884
  | `RawPrincipal` | `Uint8Array` |
2942
2885
 
2943
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/candid.ts#L20)
2944
-
2945
- #### :gear: Principal
2946
-
2947
- Represents a principal - i.e. an object instantiated with the class Principal.
2948
-
2949
- | Type | Type |
2950
- | ----------- | --------------------------------- |
2951
- | `Principal` | `z.infer<typeof PrincipalSchema>` |
2952
-
2953
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/candid.ts#L30)
2886
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/principal.ts#L11)
2954
2887
 
2955
2888
  #### :gear: Timestamp
2956
2889
 
@@ -2962,7 +2895,7 @@ Used for tracking when events occur, such as document creation and updates.
2962
2895
  | ----------- | --------------------------------- |
2963
2896
  | `Timestamp` | `z.infer<typeof TimestampSchema>` |
2964
2897
 
2965
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L14)
2898
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L15)
2966
2899
 
2967
2900
  #### :gear: Version
2968
2901
 
@@ -2974,7 +2907,7 @@ This is typically incremented with each update to ensure consistency.
2974
2907
  | --------- | ------------------------------- |
2975
2908
  | `Version` | `z.infer<typeof VersionSchema>` |
2976
2909
 
2977
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L26)
2910
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L27)
2978
2911
 
2979
2912
  #### :gear: RawUserId
2980
2913
 
@@ -2986,7 +2919,7 @@ This is a principal associated with a user.
2986
2919
  | ----------- | -------------- |
2987
2920
  | `RawUserId` | `RawPrincipal` |
2988
2921
 
2989
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L38)
2922
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L39)
2990
2923
 
2991
2924
  #### :gear: UserId
2992
2925
 
@@ -2998,7 +2931,7 @@ This is a principal associated with a user.
2998
2931
  | -------- | ------------------------------ |
2999
2932
  | `UserId` | `z.infer<typeof UserIdSchema>` |
3000
2933
 
3001
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L50)
2934
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L51)
3002
2935
 
3003
2936
  #### :gear: Collection
3004
2937
 
@@ -3008,7 +2941,7 @@ A collection name where data are stored.
3008
2941
  | ------------ | ---------------------------------- |
3009
2942
  | `Collection` | `z.infer<typeof CollectionSchema>` |
3010
2943
 
3011
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L60)
2944
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L61)
3012
2945
 
3013
2946
  #### :gear: Key
3014
2947
 
@@ -3018,7 +2951,7 @@ A key identifier within a collection.
3018
2951
  | ----- | --------------------------- |
3019
2952
  | `Key` | `z.infer<typeof KeySchema>` |
3020
2953
 
3021
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L70)
2954
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L71)
3022
2955
 
3023
2956
  #### :gear: Description
3024
2957
 
@@ -3029,7 +2962,7 @@ Used for document and asset fields which can be useful for search purpose.
3029
2962
  | ------------- | ----------------------------------- |
3030
2963
  | `Description` | `z.infer<typeof DescriptionSchema>` |
3031
2964
 
3032
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L81)
2965
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/satellite.ts#L82)
3033
2966
 
3034
2967
  #### :gear: AssertFunction
3035
2968
 
@@ -3610,25 +3543,25 @@ Enum representing possible fields to order by.
3610
3543
 
3611
3544
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/schemas/list.ts#L80)
3612
3545
 
3613
- #### :gear: ControllerScope
3546
+ #### :gear: AccessKeyScope
3614
3547
 
3615
- Represents the permission scope of a controller.
3548
+ Represents the permission scope of an access key.
3616
3549
 
3617
- | Type | Type |
3618
- | ----------------- | --------------------------------------- |
3619
- | `ControllerScope` | `z.infer<typeof ControllerScopeSchema>` |
3550
+ | Type | Type |
3551
+ | ---------------- | -------------------------------------- |
3552
+ | `AccessKeyScope` | `z.infer<typeof AccessKeyScopeSchema>` |
3620
3553
 
3621
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L20)
3554
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L13)
3622
3555
 
3623
- #### :gear: ControllerKind
3556
+ #### :gear: AccessKeyKind
3624
3557
 
3625
- Represents a specific kind of controller. Meant for informational purposes.
3558
+ Represents a specific kind of access key. Meant for informational purposes.
3626
3559
 
3627
- | Type | Type |
3628
- | ---------------- | -------------------------------------- |
3629
- | `ControllerKind` | `z.infer<typeof ControllerKindSchema>` |
3560
+ | Type | Type |
3561
+ | --------------- | ------------------------------------- |
3562
+ | `AccessKeyKind` | `z.infer<typeof AccessKeyKindSchema>` |
3630
3563
 
3631
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L30)
3564
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L23)
3632
3565
 
3633
3566
  #### :gear: Metadata
3634
3567
 
@@ -3638,27 +3571,27 @@ Represents a single metadata entry as a key-value tuple.
3638
3571
  | ---------- | -------------------------------- |
3639
3572
  | `Metadata` | `z.infer<typeof MetadataSchema>` |
3640
3573
 
3641
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L40)
3574
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L33)
3642
3575
 
3643
- #### :gear: ControllerRecord
3576
+ #### :gear: AccessKeyRecord
3644
3577
 
3645
- Represents a tuple containing the principal ID and associated controller data.
3578
+ Represents a tuple containing the principal ID and associated access key data.
3646
3579
 
3647
- | Type | Type |
3648
- | ------------------ | ---------------------------------------- |
3649
- | `ControllerRecord` | `z.infer<typeof ControllerRecordSchema>` |
3580
+ | Type | Type |
3581
+ | ----------------- | --------------------------------------- |
3582
+ | `AccessKeyRecord` | `z.infer<typeof AccessKeyRecordSchema>` |
3650
3583
 
3651
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L99)
3584
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L92)
3652
3585
 
3653
- #### :gear: Controllers
3586
+ #### :gear: AccessKeys
3654
3587
 
3655
- Represents a list of controllers.
3588
+ Represents a list of access keys.
3656
3589
 
3657
- | Type | Type |
3658
- | ------------- | ----------------------------------- |
3659
- | `Controllers` | `z.infer<typeof ControllersSchema>` |
3590
+ | Type | Type |
3591
+ | ------------ | ---------------------------------- |
3592
+ | `AccessKeys` | `z.infer<typeof AccessKeysSchema>` |
3660
3593
 
3661
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L109)
3594
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/accessKeys.ts#L102)
3662
3595
 
3663
3596
  #### :gear: ListStoreParams
3664
3597
 
@@ -3854,7 +3787,7 @@ Custom validation function to verify if a value is an instance of `IDL.Type` fro
3854
3787
  | --------- | ------------------------------- |
3855
3788
  | `IDLType` | `z.infer<typeof IDLTypeSchema>` |
3856
3789
 
3857
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L16)
3790
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L17)
3858
3791
 
3859
3792
  #### :gear: CallArg
3860
3793
 
@@ -3864,7 +3797,7 @@ A call argument consisting of its IDL type and corresponding value.
3864
3797
  | --------- | ------------------------------- |
3865
3798
  | `CallArg` | `z.infer<typeof CallArgSchema>` |
3866
3799
 
3867
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L26)
3800
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L27)
3868
3801
 
3869
3802
  #### :gear: CallArgs
3870
3803
 
@@ -3880,7 +3813,7 @@ The order of arguments is preserved for the function call.
3880
3813
  | ---------- | -------------------------------- |
3881
3814
  | `CallArgs` | `z.infer<typeof CallArgsSchema>` |
3882
3815
 
3883
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L44)
3816
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L45)
3884
3817
 
3885
3818
  #### :gear: CallResult
3886
3819
 
@@ -3890,7 +3823,7 @@ Defines the type used to decode the result of a canister call.
3890
3823
  | ------------ | ---------------------------------- |
3891
3824
  | `CallResult` | `z.infer<typeof CallResultSchema>` |
3892
3825
 
3893
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L54)
3826
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/ic-cdk/schemas/call.ts#L55)
3894
3827
 
3895
3828
  <!-- TSDOC_END -->
3896
3829