@tinycloud/sdk-services 3.8.0-beta.9 → 3.8.1
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/dist/{BaseService-DO7vZ67k.d.ts → BaseService-Ma2MwJAd.d.ts} +1 -1
- package/dist/{BaseService-D-29xShG.d.cts → BaseService-O0iyuFLk.d.cts} +1 -1
- package/dist/IHooksService-4QNODVy6.d.cts +120 -0
- package/dist/IHooksService-CvTpJbQD.d.ts +120 -0
- package/dist/ISQLService-Aly1CBsW.d.ts +242 -0
- package/dist/ISQLService-BOgWzHLT.d.cts +242 -0
- package/dist/context.d.cts +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/encryption/index.cjs +80 -7
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.d.cts +23 -11
- package/dist/encryption/index.d.ts +23 -11
- package/dist/encryption/index.js +79 -7
- package/dist/encryption/index.js.map +1 -1
- package/dist/encryption/named-keys.cjs.map +1 -1
- package/dist/encryption/named-keys.d.cts +2 -2
- package/dist/encryption/named-keys.d.ts +2 -2
- package/dist/encryption/named-keys.js.map +1 -1
- package/dist/encryption/resource.cjs.map +1 -1
- package/dist/encryption/resource.js.map +1 -1
- package/dist/feed/index.cjs +1309 -0
- package/dist/feed/index.cjs.map +1 -0
- package/dist/feed/index.d.cts +238 -0
- package/dist/feed/index.d.ts +238 -0
- package/dist/feed/index.js +1258 -0
- package/dist/feed/index.js.map +1 -0
- package/dist/index.cjs +131 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -116
- package/dist/index.d.ts +16 -116
- package/dist/index.js +130 -15
- package/dist/index.js.map +1 -1
- package/dist/internal/decrypt-transport-response-error.d.cts +1 -1
- package/dist/internal/decrypt-transport-response-error.d.ts +1 -1
- package/dist/kv/index.cjs.map +1 -1
- package/dist/kv/index.d.cts +4 -4
- package/dist/kv/index.d.ts +4 -4
- package/dist/kv/index.js.map +1 -1
- package/dist/kv/replication/index.d.cts +3 -3
- package/dist/kv/replication/index.d.ts +3 -3
- package/dist/{scope-1-8skVDk.d.ts → scope-BZr0QwxX.d.ts} +1 -1
- package/dist/{scope-Dv3IAXMr.d.cts → scope-DEgc9f-W.d.cts} +1 -1
- package/dist/sql/index.cjs +21 -6
- package/dist/sql/index.cjs.map +1 -1
- package/dist/sql/index.d.cts +6 -236
- package/dist/sql/index.d.ts +6 -236
- package/dist/sql/index.js +21 -6
- package/dist/sql/index.js.map +1 -1
- package/dist/telemetry/requestLog.d.cts +1 -1
- package/dist/telemetry/requestLog.d.ts +1 -1
- package/dist/{types-BGRzS1ob.d.ts → types-Bf91gup6.d.ts} +7 -2
- package/dist/{types-DAOyIbXu.d.cts → types-CSd0RYir.d.cts} +1 -1
- package/dist/{types-DAOyIbXu.d.ts → types-CSd0RYir.d.ts} +1 -1
- package/dist/{types-B_rbS4XE.d.cts → types-D4XbIfFJ.d.cts} +7 -2
- package/package.json +6 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { K as KVReplicationDeps, a as KVReplicationController, R as ReplicationIdentity, P as PendingWriteStore } from '../../scope-
|
|
2
|
-
export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, b as KVListPage, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, m as PinnedKey, n as ProfileReplicaApprovalEntry, o as ProfileReplicaDeferredDenyOutcome, p as ProfileReplicaDeferredToken, q as ProfileReplicaLogoutPending, r as ProfileReplicaPreflight, s as ProfileReplicaPurge, t as ProfileReplicaRemoteLogoutState, u as ProfileReplicaRootIdentity, v as ProfileReplicaUnknownEntry, w as PurgeTarget, x as ReplicaAccountGate, y as ReplicaAdmitHook, z as ReplicaAuthorityState, B as ReplicaBrowserGateAccess, D as ReplicaBrowserGateSnapshot, E as ReplicaBrowserGateTx, F as ReplicaBrowserPageAdmission, G as ReplicaClock, H as ReplicaCoverage, I as ReplicaDeliveryDecision, J as ReplicaDenyInput, M as ReplicaDenyOutcome, N as ReplicaDevice, O as ReplicaEraseReport, Q as ReplicaGateAccess, S as ReplicaGateReason, T as ReplicaGateScope, U as ReplicaGateSnapshot, V as ReplicaGateTx, W as ReplicaGatedError, X as ReplicaGatedHandle, Y as ReplicaGatedSpec, Z as ReplicaGatedStorage, _ as ReplicaGrantInfo, $ as ReplicaGuardedStore, a0 as ReplicaInspectedStatus, a1 as ReplicaLifecycleGate, a2 as ReplicaLocalEraseOutcome, a3 as ReplicaPageAdmission, a4 as ReplicaPartitionEraser, a5 as ReplicaPartitionIndexEntry, a6 as ReplicaPeerCommit, a7 as ReplicaPrivateGateHash, a8 as ReplicaPurgeError, a9 as ReplicaPurgeFailedEvent, aa as ReplicaPurgeIntent, ab as ReplicaPurgeLocalCopyResult, ac as ReplicaPurgeTrigger, ad as ReplicaQuotaLedger, ae as ReplicaQuotaSpec, af as ReplicaSessionStamp, ag as ReplicaStampedReply, ah as ReplicaState, ai as ReplicaStatusEntry, aj as ReplicationAuthority, ak as ReplicationControl, al as ReplicationEvent, am as ReplicationOptions, an as ReplicationPurgeReport, ao as ReplicationReason, ap as ReplicationScheduler, aq as ResolvedReplicationOptions, ar as SaltedHash, as as canonicalReplicationIdentity, at as replicationIdentityKey, au as requiresSecretsOptIn } from '../../scope-
|
|
1
|
+
import { K as KVReplicationDeps, a as KVReplicationController, R as ReplicationIdentity, P as PendingWriteStore } from '../../scope-DEgc9f-W.cjs';
|
|
2
|
+
export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, b as KVListPage, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, m as PinnedKey, n as ProfileReplicaApprovalEntry, o as ProfileReplicaDeferredDenyOutcome, p as ProfileReplicaDeferredToken, q as ProfileReplicaLogoutPending, r as ProfileReplicaPreflight, s as ProfileReplicaPurge, t as ProfileReplicaRemoteLogoutState, u as ProfileReplicaRootIdentity, v as ProfileReplicaUnknownEntry, w as PurgeTarget, x as ReplicaAccountGate, y as ReplicaAdmitHook, z as ReplicaAuthorityState, B as ReplicaBrowserGateAccess, D as ReplicaBrowserGateSnapshot, E as ReplicaBrowserGateTx, F as ReplicaBrowserPageAdmission, G as ReplicaClock, H as ReplicaCoverage, I as ReplicaDeliveryDecision, J as ReplicaDenyInput, M as ReplicaDenyOutcome, N as ReplicaDevice, O as ReplicaEraseReport, Q as ReplicaGateAccess, S as ReplicaGateReason, T as ReplicaGateScope, U as ReplicaGateSnapshot, V as ReplicaGateTx, W as ReplicaGatedError, X as ReplicaGatedHandle, Y as ReplicaGatedSpec, Z as ReplicaGatedStorage, _ as ReplicaGrantInfo, $ as ReplicaGuardedStore, a0 as ReplicaInspectedStatus, a1 as ReplicaLifecycleGate, a2 as ReplicaLocalEraseOutcome, a3 as ReplicaPageAdmission, a4 as ReplicaPartitionEraser, a5 as ReplicaPartitionIndexEntry, a6 as ReplicaPeerCommit, a7 as ReplicaPrivateGateHash, a8 as ReplicaPurgeError, a9 as ReplicaPurgeFailedEvent, aa as ReplicaPurgeIntent, ab as ReplicaPurgeLocalCopyResult, ac as ReplicaPurgeTrigger, ad as ReplicaQuotaLedger, ae as ReplicaQuotaSpec, af as ReplicaSessionStamp, ag as ReplicaStampedReply, ah as ReplicaState, ai as ReplicaStatusEntry, aj as ReplicationAuthority, ak as ReplicationControl, al as ReplicationEvent, am as ReplicationOptions, an as ReplicationPurgeReport, ao as ReplicationReason, ap as ReplicationScheduler, aq as ResolvedReplicationOptions, ar as SaltedHash, as as canonicalReplicationIdentity, at as replicationIdentityKey, au as requiresSecretsOptIn } from '../../scope-DEgc9f-W.cjs';
|
|
3
3
|
export { ClampConsentAnchor, ConsentDeadlineMs, EffectiveGrantExpiry, EffectiveGrantExpiryInput, MintRemainingMs, NeedsSilentRenewal, ReplicaConsentAnchor, ReplicaConsentSource, ReplicaGrantPolicy } from './grantPolicyTypes.cjs';
|
|
4
4
|
export { kvPrefixCovers } from './prefix.cjs';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-CSd0RYir.cjs';
|
|
6
6
|
import './contractConstants.cjs';
|
|
7
7
|
import './grantPolicyConstants.cjs';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { K as KVReplicationDeps, a as KVReplicationController, R as ReplicationIdentity, P as PendingWriteStore } from '../../scope-
|
|
2
|
-
export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, b as KVListPage, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, m as PinnedKey, n as ProfileReplicaApprovalEntry, o as ProfileReplicaDeferredDenyOutcome, p as ProfileReplicaDeferredToken, q as ProfileReplicaLogoutPending, r as ProfileReplicaPreflight, s as ProfileReplicaPurge, t as ProfileReplicaRemoteLogoutState, u as ProfileReplicaRootIdentity, v as ProfileReplicaUnknownEntry, w as PurgeTarget, x as ReplicaAccountGate, y as ReplicaAdmitHook, z as ReplicaAuthorityState, B as ReplicaBrowserGateAccess, D as ReplicaBrowserGateSnapshot, E as ReplicaBrowserGateTx, F as ReplicaBrowserPageAdmission, G as ReplicaClock, H as ReplicaCoverage, I as ReplicaDeliveryDecision, J as ReplicaDenyInput, M as ReplicaDenyOutcome, N as ReplicaDevice, O as ReplicaEraseReport, Q as ReplicaGateAccess, S as ReplicaGateReason, T as ReplicaGateScope, U as ReplicaGateSnapshot, V as ReplicaGateTx, W as ReplicaGatedError, X as ReplicaGatedHandle, Y as ReplicaGatedSpec, Z as ReplicaGatedStorage, _ as ReplicaGrantInfo, $ as ReplicaGuardedStore, a0 as ReplicaInspectedStatus, a1 as ReplicaLifecycleGate, a2 as ReplicaLocalEraseOutcome, a3 as ReplicaPageAdmission, a4 as ReplicaPartitionEraser, a5 as ReplicaPartitionIndexEntry, a6 as ReplicaPeerCommit, a7 as ReplicaPrivateGateHash, a8 as ReplicaPurgeError, a9 as ReplicaPurgeFailedEvent, aa as ReplicaPurgeIntent, ab as ReplicaPurgeLocalCopyResult, ac as ReplicaPurgeTrigger, ad as ReplicaQuotaLedger, ae as ReplicaQuotaSpec, af as ReplicaSessionStamp, ag as ReplicaStampedReply, ah as ReplicaState, ai as ReplicaStatusEntry, aj as ReplicationAuthority, ak as ReplicationControl, al as ReplicationEvent, am as ReplicationOptions, an as ReplicationPurgeReport, ao as ReplicationReason, ap as ReplicationScheduler, aq as ResolvedReplicationOptions, ar as SaltedHash, as as canonicalReplicationIdentity, at as replicationIdentityKey, au as requiresSecretsOptIn } from '../../scope-
|
|
1
|
+
import { K as KVReplicationDeps, a as KVReplicationController, R as ReplicationIdentity, P as PendingWriteStore } from '../../scope-BZr0QwxX.js';
|
|
2
|
+
export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, b as KVListPage, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, m as PinnedKey, n as ProfileReplicaApprovalEntry, o as ProfileReplicaDeferredDenyOutcome, p as ProfileReplicaDeferredToken, q as ProfileReplicaLogoutPending, r as ProfileReplicaPreflight, s as ProfileReplicaPurge, t as ProfileReplicaRemoteLogoutState, u as ProfileReplicaRootIdentity, v as ProfileReplicaUnknownEntry, w as PurgeTarget, x as ReplicaAccountGate, y as ReplicaAdmitHook, z as ReplicaAuthorityState, B as ReplicaBrowserGateAccess, D as ReplicaBrowserGateSnapshot, E as ReplicaBrowserGateTx, F as ReplicaBrowserPageAdmission, G as ReplicaClock, H as ReplicaCoverage, I as ReplicaDeliveryDecision, J as ReplicaDenyInput, M as ReplicaDenyOutcome, N as ReplicaDevice, O as ReplicaEraseReport, Q as ReplicaGateAccess, S as ReplicaGateReason, T as ReplicaGateScope, U as ReplicaGateSnapshot, V as ReplicaGateTx, W as ReplicaGatedError, X as ReplicaGatedHandle, Y as ReplicaGatedSpec, Z as ReplicaGatedStorage, _ as ReplicaGrantInfo, $ as ReplicaGuardedStore, a0 as ReplicaInspectedStatus, a1 as ReplicaLifecycleGate, a2 as ReplicaLocalEraseOutcome, a3 as ReplicaPageAdmission, a4 as ReplicaPartitionEraser, a5 as ReplicaPartitionIndexEntry, a6 as ReplicaPeerCommit, a7 as ReplicaPrivateGateHash, a8 as ReplicaPurgeError, a9 as ReplicaPurgeFailedEvent, aa as ReplicaPurgeIntent, ab as ReplicaPurgeLocalCopyResult, ac as ReplicaPurgeTrigger, ad as ReplicaQuotaLedger, ae as ReplicaQuotaSpec, af as ReplicaSessionStamp, ag as ReplicaStampedReply, ah as ReplicaState, ai as ReplicaStatusEntry, aj as ReplicationAuthority, ak as ReplicationControl, al as ReplicationEvent, am as ReplicationOptions, an as ReplicationPurgeReport, ao as ReplicationReason, ap as ReplicationScheduler, aq as ResolvedReplicationOptions, ar as SaltedHash, as as canonicalReplicationIdentity, at as replicationIdentityKey, au as requiresSecretsOptIn } from '../../scope-BZr0QwxX.js';
|
|
3
3
|
export { ClampConsentAnchor, ConsentDeadlineMs, EffectiveGrantExpiry, EffectiveGrantExpiryInput, MintRemainingMs, NeedsSilentRenewal, ReplicaConsentAnchor, ReplicaConsentSource, ReplicaGrantPolicy } from './grantPolicyTypes.js';
|
|
4
4
|
export { kvPrefixCovers } from './prefix.js';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-CSd0RYir.js';
|
|
6
6
|
import './contractConstants.js';
|
|
7
7
|
import './grantPolicyConstants.js';
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as RetryStats,
|
|
1
|
+
import { i as RetryStats, f as Result, F as FetchFunction } from './types-CSd0RYir.js';
|
|
2
2
|
import { REPLICA_KV_STORES } from './kv/replication/contractConstants.js';
|
|
3
3
|
import { ReplicaConsentAnchor, ReplicaGrantPolicy } from './kv/replication/grantPolicyTypes.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as RetryStats,
|
|
1
|
+
import { i as RetryStats, f as Result, F as FetchFunction } from './types-CSd0RYir.cjs';
|
|
2
2
|
import { REPLICA_KV_STORES } from './kv/replication/contractConstants.cjs';
|
|
3
3
|
import { ReplicaConsentAnchor, ReplicaGrantPolicy } from './kv/replication/grantPolicyTypes.cjs';
|
|
4
4
|
|
package/dist/sql/index.cjs
CHANGED
|
@@ -770,12 +770,13 @@ var SQLService = class extends BaseService {
|
|
|
770
770
|
request.signal
|
|
771
771
|
);
|
|
772
772
|
if (!response.ok) {
|
|
773
|
-
|
|
773
|
+
const failure = await this.handleErrorResponse(response, "query", dbName, [action]);
|
|
774
|
+
return this.redactFailure(failure, options?.redactErrors, response.status);
|
|
774
775
|
}
|
|
775
776
|
const data = await response.json();
|
|
776
777
|
return ok(data);
|
|
777
778
|
} catch (error) {
|
|
778
|
-
return err(wrapError("sql", error));
|
|
779
|
+
return this.redactFailure(err(wrapError("sql", error)), options?.redactErrors);
|
|
779
780
|
} finally {
|
|
780
781
|
request.dispose();
|
|
781
782
|
}
|
|
@@ -810,12 +811,13 @@ var SQLService = class extends BaseService {
|
|
|
810
811
|
request.signal
|
|
811
812
|
);
|
|
812
813
|
if (!response.ok) {
|
|
813
|
-
|
|
814
|
+
const failure = await this.handleErrorResponse(response, "execute", dbName, requestedActions);
|
|
815
|
+
return this.redactFailure(failure, options?.redactErrors, response.status);
|
|
814
816
|
}
|
|
815
817
|
const data = await response.json();
|
|
816
818
|
return ok(data);
|
|
817
819
|
} catch (error) {
|
|
818
|
-
return err(wrapError("sql", error));
|
|
820
|
+
return this.redactFailure(err(wrapError("sql", error)), options?.redactErrors);
|
|
819
821
|
} finally {
|
|
820
822
|
request.dispose();
|
|
821
823
|
}
|
|
@@ -836,12 +838,13 @@ var SQLService = class extends BaseService {
|
|
|
836
838
|
request.signal
|
|
837
839
|
);
|
|
838
840
|
if (!response.ok) {
|
|
839
|
-
|
|
841
|
+
const failure = await this.handleErrorResponse(response, "batch", dbName, requestedActions);
|
|
842
|
+
return this.redactFailure(failure, options?.redactErrors, response.status);
|
|
840
843
|
}
|
|
841
844
|
const data = await response.json();
|
|
842
845
|
return ok(data);
|
|
843
846
|
} catch (error) {
|
|
844
|
-
return err(wrapError("sql", error));
|
|
847
|
+
return this.redactFailure(err(wrapError("sql", error)), options?.redactErrors);
|
|
845
848
|
} finally {
|
|
846
849
|
request.dispose();
|
|
847
850
|
}
|
|
@@ -1037,6 +1040,18 @@ var SQLService = class extends BaseService {
|
|
|
1037
1040
|
}))
|
|
1038
1041
|
);
|
|
1039
1042
|
}
|
|
1043
|
+
redactFailure(result, redactErrors, status) {
|
|
1044
|
+
if (!redactErrors || result.ok) return result;
|
|
1045
|
+
const candidate = result.error.code;
|
|
1046
|
+
const code = typeof candidate === "string" && Object.prototype.hasOwnProperty.call(ErrorCodes, candidate) ? candidate : ErrorCodes.SQL_ERROR;
|
|
1047
|
+
const safeStatus = typeof status === "number" && Number.isInteger(status) && status >= 400 && status <= 599 ? status : void 0;
|
|
1048
|
+
return err(serviceError(
|
|
1049
|
+
code,
|
|
1050
|
+
"SQL operation failed",
|
|
1051
|
+
"sql",
|
|
1052
|
+
safeStatus === void 0 ? void 0 : { meta: { status: safeStatus } }
|
|
1053
|
+
));
|
|
1054
|
+
}
|
|
1040
1055
|
async handleErrorResponse(response, operation, dbName, requestedActions) {
|
|
1041
1056
|
const errorText = await response.text();
|
|
1042
1057
|
const meta = responseErrorMeta(response.status, response.statusText, errorText);
|