@tinycloud/operations 0.5.0-beta.1 → 0.5.0-beta.2
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/coverage.json +9 -1
- package/dist/artifacts.d.cts +1 -1
- package/dist/artifacts.d.ts +1 -1
- package/dist/cli-runtime.cjs +728 -135
- package/dist/cli-runtime.cjs.map +1 -1
- package/dist/cli-runtime.d.cts +1 -1
- package/dist/cli-runtime.d.ts +1 -1
- package/dist/cli-runtime.js +726 -134
- package/dist/cli-runtime.js.map +1 -1
- package/dist/{contract-DfyrluLB.d.cts → contract-zRklonbR.d.cts} +6 -3
- package/dist/{contract-DfyrluLB.d.ts → contract-zRklonbR.d.ts} +6 -3
- package/dist/delegation-binding.cjs +7 -0
- package/dist/delegation-binding.cjs.map +1 -1
- package/dist/delegation-binding.d.cts +15 -3
- package/dist/delegation-binding.d.ts +15 -3
- package/dist/delegation-binding.js +6 -0
- package/dist/delegation-binding.js.map +1 -1
- package/dist/index.cjs +756 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +752 -133
- package/dist/index.js.map +1 -1
- package/dist/profile.cjs +5 -0
- package/dist/profile.cjs.map +1 -1
- package/dist/profile.d.cts +14 -2
- package/dist/profile.d.ts +14 -2
- package/dist/profile.js +4 -0
- package/dist/profile.js.map +1 -1
- package/dist/recovery.cjs +67 -0
- package/dist/recovery.cjs.map +1 -0
- package/dist/recovery.d.cts +38 -0
- package/dist/recovery.d.ts +38 -0
- package/dist/recovery.js +39 -0
- package/dist/recovery.js.map +1 -0
- package/dist/secret-request.cjs +271 -0
- package/dist/secret-request.cjs.map +1 -0
- package/dist/secret-request.d.cts +119 -0
- package/dist/secret-request.d.ts +119 -0
- package/dist/secret-request.js +222 -0
- package/dist/secret-request.js.map +1 -0
- package/generated/operations.json +1838 -89
- package/package.json +15 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const OPERATION_ERROR_CODES: readonly ["INPUT_INVALID", "OPERATION_NOT_FOUND", "OPERATION_VERSION_UNSUPPORTED", "PROFILE_NOT_FOUND", "PROFILE_POSTURE_NOT_ALLOWED", "PROFILE_OWNER_OPT_IN_REQUIRED", "AUTH_REQUIRED", "PERMISSION_DENIED", "SESSION_NOT_FOUND", "PERMISSION_HINT_INVALID", "DELEGATION_ARTIFACT_INVALID", "DELEGATION_EXPIRED", "DELEGATION_AUDIENCE_MISMATCH", "DELEGATION_HOST_MISMATCH", "DELEGATION_REJECTED", "ENCRYPTION_NETWORK_UNRESOLVED", "NODE_UNREACHABLE", "NODE_ERROR", "STORAGE_QUOTA_EXCEEDED", "KV_NOT_FOUND", "KV_PRECONDITION_FAILED", "KV_CONFLICT", "KV_RESPONSE_TOO_LARGE", "SQL_QUERY_INVALID", "SQL_EXECUTION_FAILED", "SQL_RESULT_LIMIT_EXCEEDED", "SQL_VALUE_UNSAFE", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
|
|
1
|
+
declare const OPERATION_ERROR_CODES: readonly ["INPUT_INVALID", "OPERATION_NOT_FOUND", "OPERATION_VERSION_UNSUPPORTED", "PROFILE_NOT_FOUND", "PROFILE_POSTURE_NOT_ALLOWED", "PROFILE_OWNER_OPT_IN_REQUIRED", "PROFILE_MIGRATION_REQUIRED", "AUTH_REQUIRED", "PERMISSION_DENIED", "SESSION_NOT_FOUND", "PERMISSION_HINT_INVALID", "DELEGATION_ARTIFACT_INVALID", "DELEGATION_EXPIRED", "DELEGATION_AUDIENCE_MISMATCH", "DELEGATION_HOST_MISMATCH", "DELEGATION_REJECTED", "ENCRYPTION_NETWORK_UNRESOLVED", "NODE_UNREACHABLE", "NODE_ERROR", "STORAGE_QUOTA_EXCEEDED", "KV_NOT_FOUND", "KV_PRECONDITION_FAILED", "KV_CONFLICT", "KV_RESPONSE_TOO_LARGE", "SQL_QUERY_INVALID", "SQL_EXECUTION_FAILED", "SQL_RESULT_LIMIT_EXCEEDED", "SQL_VALUE_UNSAFE", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
|
|
2
2
|
type OperationErrorCode = (typeof OPERATION_ERROR_CODES)[number];
|
|
3
3
|
interface OperationError {
|
|
4
4
|
readonly code: OperationErrorCode;
|
|
@@ -29,9 +29,12 @@ interface OperationContextSummary {
|
|
|
29
29
|
* Why a stored grant was not used. A fixed vocabulary: diagnostics never
|
|
30
30
|
* carry exception text, node responses, URLs or other stored transport data.
|
|
31
31
|
* `unbound`: the record has no valid request binding where one is required;
|
|
32
|
-
* `outside_request`: its signed authority exceeds its binding
|
|
32
|
+
* `outside_request`: its signed authority exceeds its binding;
|
|
33
|
+
* `activation_unavailable`: the node could not be reached, timed out, was
|
|
34
|
+
* rate limited or failed (transport, 408, 429, 5xx) while activating it;
|
|
35
|
+
* `activation_unauthenticated`: the node answered 401 while activating it.
|
|
33
36
|
*/
|
|
34
|
-
declare const STORED_GRANT_SKIP_REASONS: readonly ["malformed", "unbound", "outside_request", "host_mismatch", "expired", "cid_mismatch", "authority_invalid", "proof_missing", "proof_invalid", "owner_mismatch", "audience_mismatch", "resources_mismatch", "unsupported", "activation_rejected", "invalid"];
|
|
37
|
+
declare const STORED_GRANT_SKIP_REASONS: readonly ["malformed", "unbound", "outside_request", "host_mismatch", "expired", "cid_mismatch", "authority_invalid", "proof_missing", "proof_invalid", "owner_mismatch", "audience_mismatch", "resources_mismatch", "unsupported", "activation_rejected", "activation_unavailable", "activation_unauthenticated", "invalid"];
|
|
35
38
|
type StoredGrantSkipReason = typeof STORED_GRANT_SKIP_REASONS[number];
|
|
36
39
|
/**
|
|
37
40
|
* A non-fatal diagnostic attached to a result. `STORED_GRANT_SKIPPED`: a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const OPERATION_ERROR_CODES: readonly ["INPUT_INVALID", "OPERATION_NOT_FOUND", "OPERATION_VERSION_UNSUPPORTED", "PROFILE_NOT_FOUND", "PROFILE_POSTURE_NOT_ALLOWED", "PROFILE_OWNER_OPT_IN_REQUIRED", "AUTH_REQUIRED", "PERMISSION_DENIED", "SESSION_NOT_FOUND", "PERMISSION_HINT_INVALID", "DELEGATION_ARTIFACT_INVALID", "DELEGATION_EXPIRED", "DELEGATION_AUDIENCE_MISMATCH", "DELEGATION_HOST_MISMATCH", "DELEGATION_REJECTED", "ENCRYPTION_NETWORK_UNRESOLVED", "NODE_UNREACHABLE", "NODE_ERROR", "STORAGE_QUOTA_EXCEEDED", "KV_NOT_FOUND", "KV_PRECONDITION_FAILED", "KV_CONFLICT", "KV_RESPONSE_TOO_LARGE", "SQL_QUERY_INVALID", "SQL_EXECUTION_FAILED", "SQL_RESULT_LIMIT_EXCEEDED", "SQL_VALUE_UNSAFE", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
|
|
1
|
+
declare const OPERATION_ERROR_CODES: readonly ["INPUT_INVALID", "OPERATION_NOT_FOUND", "OPERATION_VERSION_UNSUPPORTED", "PROFILE_NOT_FOUND", "PROFILE_POSTURE_NOT_ALLOWED", "PROFILE_OWNER_OPT_IN_REQUIRED", "PROFILE_MIGRATION_REQUIRED", "AUTH_REQUIRED", "PERMISSION_DENIED", "SESSION_NOT_FOUND", "PERMISSION_HINT_INVALID", "DELEGATION_ARTIFACT_INVALID", "DELEGATION_EXPIRED", "DELEGATION_AUDIENCE_MISMATCH", "DELEGATION_HOST_MISMATCH", "DELEGATION_REJECTED", "ENCRYPTION_NETWORK_UNRESOLVED", "NODE_UNREACHABLE", "NODE_ERROR", "STORAGE_QUOTA_EXCEEDED", "KV_NOT_FOUND", "KV_PRECONDITION_FAILED", "KV_CONFLICT", "KV_RESPONSE_TOO_LARGE", "SQL_QUERY_INVALID", "SQL_EXECUTION_FAILED", "SQL_RESULT_LIMIT_EXCEEDED", "SQL_VALUE_UNSAFE", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
|
|
2
2
|
type OperationErrorCode = (typeof OPERATION_ERROR_CODES)[number];
|
|
3
3
|
interface OperationError {
|
|
4
4
|
readonly code: OperationErrorCode;
|
|
@@ -29,9 +29,12 @@ interface OperationContextSummary {
|
|
|
29
29
|
* Why a stored grant was not used. A fixed vocabulary: diagnostics never
|
|
30
30
|
* carry exception text, node responses, URLs or other stored transport data.
|
|
31
31
|
* `unbound`: the record has no valid request binding where one is required;
|
|
32
|
-
* `outside_request`: its signed authority exceeds its binding
|
|
32
|
+
* `outside_request`: its signed authority exceeds its binding;
|
|
33
|
+
* `activation_unavailable`: the node could not be reached, timed out, was
|
|
34
|
+
* rate limited or failed (transport, 408, 429, 5xx) while activating it;
|
|
35
|
+
* `activation_unauthenticated`: the node answered 401 while activating it.
|
|
33
36
|
*/
|
|
34
|
-
declare const STORED_GRANT_SKIP_REASONS: readonly ["malformed", "unbound", "outside_request", "host_mismatch", "expired", "cid_mismatch", "authority_invalid", "proof_missing", "proof_invalid", "owner_mismatch", "audience_mismatch", "resources_mismatch", "unsupported", "activation_rejected", "invalid"];
|
|
37
|
+
declare const STORED_GRANT_SKIP_REASONS: readonly ["malformed", "unbound", "outside_request", "host_mismatch", "expired", "cid_mismatch", "authority_invalid", "proof_missing", "proof_invalid", "owner_mismatch", "audience_mismatch", "resources_mismatch", "unsupported", "activation_rejected", "activation_unavailable", "activation_unauthenticated", "invalid"];
|
|
35
38
|
type StoredGrantSkipReason = typeof STORED_GRANT_SKIP_REASONS[number];
|
|
36
39
|
/**
|
|
37
40
|
* A non-fatal diagnostic attached to a result. `STORED_GRANT_SKIPPED`: a
|
|
@@ -730,6 +730,7 @@ __export(delegation_binding_exports, {
|
|
|
730
730
|
replayLimit: () => replayLimit,
|
|
731
731
|
replayProfileDelegations: () => replayProfileDelegations,
|
|
732
732
|
replayStoredDelegation: () => replayStoredDelegation,
|
|
733
|
+
replayStoredDelegationRecords: () => replayStoredDelegationRecords,
|
|
733
734
|
storedDelegationForAnotherKey: () => storedDelegationForAnotherKey,
|
|
734
735
|
storedDelegationKind: () => storedDelegationKind,
|
|
735
736
|
storedDelegationSource: () => storedDelegationSource,
|
|
@@ -4509,6 +4510,8 @@ var STORED_GRANT_SKIP_REASONS = [
|
|
|
4509
4510
|
"resources_mismatch",
|
|
4510
4511
|
"unsupported",
|
|
4511
4512
|
"activation_rejected",
|
|
4513
|
+
"activation_unavailable",
|
|
4514
|
+
"activation_unauthenticated",
|
|
4512
4515
|
"invalid"
|
|
4513
4516
|
];
|
|
4514
4517
|
var DELEGATION_CID_PATTERN = "^bafkr4i[a-z2-7]{52}$";
|
|
@@ -4742,6 +4745,9 @@ function skipped(reason) {
|
|
|
4742
4745
|
}
|
|
4743
4746
|
async function replayProfileDelegations(profile, node, options) {
|
|
4744
4747
|
await prepareStoredDelegationReplay(profile, node, { host: options.host, migrate: options.migrate });
|
|
4748
|
+
return replayStoredDelegationRecords(profile, node, options);
|
|
4749
|
+
}
|
|
4750
|
+
async function replayStoredDelegationRecords(profile, node, options) {
|
|
4745
4751
|
const installed = [];
|
|
4746
4752
|
const warnings = [];
|
|
4747
4753
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -4933,6 +4939,7 @@ function isRecord(value) {
|
|
|
4933
4939
|
replayLimit,
|
|
4934
4940
|
replayProfileDelegations,
|
|
4935
4941
|
replayStoredDelegation,
|
|
4942
|
+
replayStoredDelegationRecords,
|
|
4936
4943
|
storedDelegationForAnotherKey,
|
|
4937
4944
|
storedDelegationKind,
|
|
4938
4945
|
storedDelegationSource,
|