@janssenproject/cedarling_wasm 0.0.473 → 0.0.474
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 +21 -0
- package/dist/browser/index.js +166 -12
- package/dist/browser/index.js.map +2 -2
- package/dist/cjs/index.cjs +166 -12
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/edge/index.js +166 -12
- package/dist/edge/index.js.map +2 -2
- package/dist/esm/index.js +166 -12
- package/dist/esm/index.js.map +2 -2
- package/dist/manual/index.js +167 -12
- package/dist/manual/index.js.map +2 -2
- package/dist/types/cjs/generated.d.ts +69 -5
- package/dist/types/esm/generated.d.ts +69 -5
- package/dist/wasm/cedarling_wasm_bg.wasm +0 -0
- package/package.json +1 -1
|
@@ -330,6 +330,23 @@ export class Cedarling {
|
|
|
330
330
|
* ```
|
|
331
331
|
*/
|
|
332
332
|
clearDataCtx(): void;
|
|
333
|
+
/**
|
|
334
|
+
* Destructive read: returns the telemetry metrics snapshot and resets
|
|
335
|
+
* the counters for the next interval.
|
|
336
|
+
*
|
|
337
|
+
* Fails when `CEDARLING_METRICS_COLLECTION` is disabled or whenever
|
|
338
|
+
* `CEDARLING_LOCK_TELEMETRY_INTERVAL` is set (even if the Lock server
|
|
339
|
+
* has no telemetry endpoint). `interval_secs` is fractional seconds,
|
|
340
|
+
* so sub-second intervals are reported exactly.
|
|
341
|
+
*
|
|
342
|
+
* # Example
|
|
343
|
+
*
|
|
344
|
+
* ```javascript
|
|
345
|
+
* const snapshot = cedarling.drainMetrics();
|
|
346
|
+
* console.log(`Requests: ${snapshot.operational_stats.get("authz.requests_total")}`);
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
349
|
+
drainMetrics(): MetricsSnapshot;
|
|
333
350
|
/**
|
|
334
351
|
* Get trusted issuer identifiers that failed to load.
|
|
335
352
|
*
|
|
@@ -817,6 +834,42 @@ declare class IntoUnderlyingSource {
|
|
|
817
834
|
}
|
|
818
835
|
export type { IntoUnderlyingSource };
|
|
819
836
|
|
|
837
|
+
/**
|
|
838
|
+
* A WASM wrapper for the Rust `cedarling::MetricsSnapshot` struct.
|
|
839
|
+
* Represents a snapshot of the collected telemetry metrics for the current
|
|
840
|
+
* interval. Destructive read: taking a snapshot resets the collected
|
|
841
|
+
* metrics, so use a single consumer.
|
|
842
|
+
*/
|
|
843
|
+
export class MetricsSnapshot {
|
|
844
|
+
private constructor();
|
|
845
|
+
free(): void;
|
|
846
|
+
[Symbol.dispose](): void;
|
|
847
|
+
/**
|
|
848
|
+
* Convert `MetricsSnapshot` to json string value.
|
|
849
|
+
*
|
|
850
|
+
* `policy_stats`, `error_counters` and `operational_stats` are converted
|
|
851
|
+
* from `Map` to plain objects so `JSON.stringify` emits their entries.
|
|
852
|
+
*/
|
|
853
|
+
jsonString(): string;
|
|
854
|
+
/**
|
|
855
|
+
* Classified error counters keyed by error metric key.
|
|
856
|
+
*/
|
|
857
|
+
error_counters: Map<any, any>;
|
|
858
|
+
/**
|
|
859
|
+
* Duration of the snapshot interval in fractional seconds.
|
|
860
|
+
* Exposed as `Number` (not `BigInt`) so plain JS arithmetic works.
|
|
861
|
+
*/
|
|
862
|
+
interval_secs: number;
|
|
863
|
+
/**
|
|
864
|
+
* Operational counters and gauges (authorization, cache, JWT, data, lock).
|
|
865
|
+
*/
|
|
866
|
+
operational_stats: Map<any, any>;
|
|
867
|
+
/**
|
|
868
|
+
* Per-policy evaluation counts (`policy_id`, `policy_id.allow`, `policy_id.deny`).
|
|
869
|
+
*/
|
|
870
|
+
policy_stats: Map<any, any>;
|
|
871
|
+
}
|
|
872
|
+
|
|
820
873
|
/**
|
|
821
874
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
822
875
|
* Represents the result of a multi-issuer authorization request.
|
|
@@ -948,12 +1001,17 @@ export interface InitOutput {
|
|
|
948
1001
|
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
949
1002
|
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
950
1003
|
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
1004
|
+
readonly __wbg_get_metricssnapshot_error_counters: (a: number) => number;
|
|
1005
|
+
readonly __wbg_get_metricssnapshot_interval_secs: (a: number) => number;
|
|
1006
|
+
readonly __wbg_get_metricssnapshot_operational_stats: (a: number) => number;
|
|
1007
|
+
readonly __wbg_get_metricssnapshot_policy_stats: (a: number) => number;
|
|
951
1008
|
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
952
1009
|
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number, b: number) => void;
|
|
953
1010
|
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
954
1011
|
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
955
1012
|
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
956
1013
|
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
1014
|
+
readonly __wbg_metricssnapshot_free: (a: number, b: number) => void;
|
|
957
1015
|
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
958
1016
|
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
959
1017
|
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
@@ -973,6 +1031,10 @@ export interface InitOutput {
|
|
|
973
1031
|
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
974
1032
|
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
975
1033
|
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
1034
|
+
readonly __wbg_set_metricssnapshot_error_counters: (a: number, b: number) => void;
|
|
1035
|
+
readonly __wbg_set_metricssnapshot_interval_secs: (a: number, b: number) => void;
|
|
1036
|
+
readonly __wbg_set_metricssnapshot_operational_stats: (a: number, b: number) => void;
|
|
1037
|
+
readonly __wbg_set_metricssnapshot_policy_stats: (a: number, b: number) => void;
|
|
976
1038
|
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
977
1039
|
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
978
1040
|
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
@@ -1000,6 +1062,7 @@ export interface InitOutput {
|
|
|
1000
1062
|
readonly cedarling_authorizeUnsigned: (a: number, b: number, c: number) => number;
|
|
1001
1063
|
readonly cedarling_authorizeUnsignedBatch: (a: number, b: number, c: number) => number;
|
|
1002
1064
|
readonly cedarling_clearDataCtx: (a: number, b: number) => void;
|
|
1065
|
+
readonly cedarling_drainMetrics: (a: number, b: number) => void;
|
|
1003
1066
|
readonly cedarling_failedTrustedIssuerIds: (a: number) => number;
|
|
1004
1067
|
readonly cedarling_getDataCtx: (a: number, b: number, c: number, d: number) => void;
|
|
1005
1068
|
readonly cedarling_getDataEntryCtx: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -1027,7 +1090,6 @@ export interface InitOutput {
|
|
|
1027
1090
|
readonly diagnostics_errors: (a: number, b: number) => void;
|
|
1028
1091
|
readonly diagnostics_reason: (a: number, b: number) => void;
|
|
1029
1092
|
readonly init: (a: number) => number;
|
|
1030
|
-
readonly initFromArchiveBytes: (a: number, b: number) => number;
|
|
1031
1093
|
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
1032
1094
|
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
1033
1095
|
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
@@ -1036,6 +1098,7 @@ export interface InitOutput {
|
|
|
1036
1098
|
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
1037
1099
|
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
1038
1100
|
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
1101
|
+
readonly initFromArchiveBytes: (a: number, b: number) => number;
|
|
1039
1102
|
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
1040
1103
|
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
1041
1104
|
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
|
|
@@ -1046,13 +1109,14 @@ export interface InitOutput {
|
|
|
1046
1109
|
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
1047
1110
|
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
1048
1111
|
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
1112
|
+
readonly metricssnapshot_jsonString: (a: number, b: number) => void;
|
|
1049
1113
|
readonly multiissuerauthorizeresult_jsonString: (a: number, b: number) => void;
|
|
1050
1114
|
readonly policyevaluationerror_error: (a: number, b: number) => void;
|
|
1051
1115
|
readonly policyevaluationerror_id: (a: number, b: number) => void;
|
|
1052
|
-
readonly
|
|
1053
|
-
readonly
|
|
1054
|
-
readonly
|
|
1055
|
-
readonly
|
|
1116
|
+
readonly __wasm_bindgen_func_elem_8927: (a: number, b: number, c: number, d: number) => void;
|
|
1117
|
+
readonly __wasm_bindgen_func_elem_8982: (a: number, b: number, c: number, d: number) => void;
|
|
1118
|
+
readonly __wasm_bindgen_func_elem_12488: (a: number, b: number, c: number) => void;
|
|
1119
|
+
readonly __wasm_bindgen_func_elem_8761: (a: number, b: number) => void;
|
|
1056
1120
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
1057
1121
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
1058
1122
|
readonly __wbindgen_export3: (a: number) => void;
|
|
@@ -330,6 +330,23 @@ export class Cedarling {
|
|
|
330
330
|
* ```
|
|
331
331
|
*/
|
|
332
332
|
clearDataCtx(): void;
|
|
333
|
+
/**
|
|
334
|
+
* Destructive read: returns the telemetry metrics snapshot and resets
|
|
335
|
+
* the counters for the next interval.
|
|
336
|
+
*
|
|
337
|
+
* Fails when `CEDARLING_METRICS_COLLECTION` is disabled or whenever
|
|
338
|
+
* `CEDARLING_LOCK_TELEMETRY_INTERVAL` is set (even if the Lock server
|
|
339
|
+
* has no telemetry endpoint). `interval_secs` is fractional seconds,
|
|
340
|
+
* so sub-second intervals are reported exactly.
|
|
341
|
+
*
|
|
342
|
+
* # Example
|
|
343
|
+
*
|
|
344
|
+
* ```javascript
|
|
345
|
+
* const snapshot = cedarling.drainMetrics();
|
|
346
|
+
* console.log(`Requests: ${snapshot.operational_stats.get("authz.requests_total")}`);
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
349
|
+
drainMetrics(): MetricsSnapshot;
|
|
333
350
|
/**
|
|
334
351
|
* Get trusted issuer identifiers that failed to load.
|
|
335
352
|
*
|
|
@@ -817,6 +834,42 @@ declare class IntoUnderlyingSource {
|
|
|
817
834
|
}
|
|
818
835
|
export type { IntoUnderlyingSource };
|
|
819
836
|
|
|
837
|
+
/**
|
|
838
|
+
* A WASM wrapper for the Rust `cedarling::MetricsSnapshot` struct.
|
|
839
|
+
* Represents a snapshot of the collected telemetry metrics for the current
|
|
840
|
+
* interval. Destructive read: taking a snapshot resets the collected
|
|
841
|
+
* metrics, so use a single consumer.
|
|
842
|
+
*/
|
|
843
|
+
export class MetricsSnapshot {
|
|
844
|
+
private constructor();
|
|
845
|
+
free(): void;
|
|
846
|
+
[Symbol.dispose](): void;
|
|
847
|
+
/**
|
|
848
|
+
* Convert `MetricsSnapshot` to json string value.
|
|
849
|
+
*
|
|
850
|
+
* `policy_stats`, `error_counters` and `operational_stats` are converted
|
|
851
|
+
* from `Map` to plain objects so `JSON.stringify` emits their entries.
|
|
852
|
+
*/
|
|
853
|
+
jsonString(): string;
|
|
854
|
+
/**
|
|
855
|
+
* Classified error counters keyed by error metric key.
|
|
856
|
+
*/
|
|
857
|
+
error_counters: Map<any, any>;
|
|
858
|
+
/**
|
|
859
|
+
* Duration of the snapshot interval in fractional seconds.
|
|
860
|
+
* Exposed as `Number` (not `BigInt`) so plain JS arithmetic works.
|
|
861
|
+
*/
|
|
862
|
+
interval_secs: number;
|
|
863
|
+
/**
|
|
864
|
+
* Operational counters and gauges (authorization, cache, JWT, data, lock).
|
|
865
|
+
*/
|
|
866
|
+
operational_stats: Map<any, any>;
|
|
867
|
+
/**
|
|
868
|
+
* Per-policy evaluation counts (`policy_id`, `policy_id.allow`, `policy_id.deny`).
|
|
869
|
+
*/
|
|
870
|
+
policy_stats: Map<any, any>;
|
|
871
|
+
}
|
|
872
|
+
|
|
820
873
|
/**
|
|
821
874
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
822
875
|
* Represents the result of a multi-issuer authorization request.
|
|
@@ -948,12 +1001,17 @@ export interface InitOutput {
|
|
|
948
1001
|
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
949
1002
|
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
950
1003
|
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
1004
|
+
readonly __wbg_get_metricssnapshot_error_counters: (a: number) => number;
|
|
1005
|
+
readonly __wbg_get_metricssnapshot_interval_secs: (a: number) => number;
|
|
1006
|
+
readonly __wbg_get_metricssnapshot_operational_stats: (a: number) => number;
|
|
1007
|
+
readonly __wbg_get_metricssnapshot_policy_stats: (a: number) => number;
|
|
951
1008
|
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
952
1009
|
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number, b: number) => void;
|
|
953
1010
|
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
954
1011
|
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
955
1012
|
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
956
1013
|
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
1014
|
+
readonly __wbg_metricssnapshot_free: (a: number, b: number) => void;
|
|
957
1015
|
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
958
1016
|
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
959
1017
|
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
@@ -973,6 +1031,10 @@ export interface InitOutput {
|
|
|
973
1031
|
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
974
1032
|
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
975
1033
|
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
1034
|
+
readonly __wbg_set_metricssnapshot_error_counters: (a: number, b: number) => void;
|
|
1035
|
+
readonly __wbg_set_metricssnapshot_interval_secs: (a: number, b: number) => void;
|
|
1036
|
+
readonly __wbg_set_metricssnapshot_operational_stats: (a: number, b: number) => void;
|
|
1037
|
+
readonly __wbg_set_metricssnapshot_policy_stats: (a: number, b: number) => void;
|
|
976
1038
|
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
977
1039
|
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
978
1040
|
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
@@ -1000,6 +1062,7 @@ export interface InitOutput {
|
|
|
1000
1062
|
readonly cedarling_authorizeUnsigned: (a: number, b: number, c: number) => number;
|
|
1001
1063
|
readonly cedarling_authorizeUnsignedBatch: (a: number, b: number, c: number) => number;
|
|
1002
1064
|
readonly cedarling_clearDataCtx: (a: number, b: number) => void;
|
|
1065
|
+
readonly cedarling_drainMetrics: (a: number, b: number) => void;
|
|
1003
1066
|
readonly cedarling_failedTrustedIssuerIds: (a: number) => number;
|
|
1004
1067
|
readonly cedarling_getDataCtx: (a: number, b: number, c: number, d: number) => void;
|
|
1005
1068
|
readonly cedarling_getDataEntryCtx: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -1027,7 +1090,6 @@ export interface InitOutput {
|
|
|
1027
1090
|
readonly diagnostics_errors: (a: number, b: number) => void;
|
|
1028
1091
|
readonly diagnostics_reason: (a: number, b: number) => void;
|
|
1029
1092
|
readonly init: (a: number) => number;
|
|
1030
|
-
readonly initFromArchiveBytes: (a: number, b: number) => number;
|
|
1031
1093
|
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
1032
1094
|
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
1033
1095
|
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
@@ -1036,6 +1098,7 @@ export interface InitOutput {
|
|
|
1036
1098
|
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
1037
1099
|
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
1038
1100
|
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
1101
|
+
readonly initFromArchiveBytes: (a: number, b: number) => number;
|
|
1039
1102
|
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
1040
1103
|
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
1041
1104
|
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
|
|
@@ -1046,13 +1109,14 @@ export interface InitOutput {
|
|
|
1046
1109
|
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
1047
1110
|
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
1048
1111
|
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
1112
|
+
readonly metricssnapshot_jsonString: (a: number, b: number) => void;
|
|
1049
1113
|
readonly multiissuerauthorizeresult_jsonString: (a: number, b: number) => void;
|
|
1050
1114
|
readonly policyevaluationerror_error: (a: number, b: number) => void;
|
|
1051
1115
|
readonly policyevaluationerror_id: (a: number, b: number) => void;
|
|
1052
|
-
readonly
|
|
1053
|
-
readonly
|
|
1054
|
-
readonly
|
|
1055
|
-
readonly
|
|
1116
|
+
readonly __wasm_bindgen_func_elem_8927: (a: number, b: number, c: number, d: number) => void;
|
|
1117
|
+
readonly __wasm_bindgen_func_elem_8982: (a: number, b: number, c: number, d: number) => void;
|
|
1118
|
+
readonly __wasm_bindgen_func_elem_12488: (a: number, b: number, c: number) => void;
|
|
1119
|
+
readonly __wasm_bindgen_func_elem_8761: (a: number, b: number) => void;
|
|
1056
1120
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
1057
1121
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
1058
1122
|
readonly __wbindgen_export3: (a: number) => void;
|
|
Binary file
|
package/package.json
CHANGED