@tinycloud/cli 0.9.0-beta.6 → 0.9.0-beta.7

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/index.js CHANGED
@@ -10398,41 +10398,41 @@ var require_ms = __commonJS({
10398
10398
  return void 0;
10399
10399
  }
10400
10400
  }
10401
- function fmtShort(ms3) {
10402
- var msAbs = Math.abs(ms3);
10401
+ function fmtShort(ms2) {
10402
+ var msAbs = Math.abs(ms2);
10403
10403
  if (msAbs >= d) {
10404
- return Math.round(ms3 / d) + "d";
10404
+ return Math.round(ms2 / d) + "d";
10405
10405
  }
10406
10406
  if (msAbs >= h) {
10407
- return Math.round(ms3 / h) + "h";
10407
+ return Math.round(ms2 / h) + "h";
10408
10408
  }
10409
10409
  if (msAbs >= m) {
10410
- return Math.round(ms3 / m) + "m";
10410
+ return Math.round(ms2 / m) + "m";
10411
10411
  }
10412
10412
  if (msAbs >= s) {
10413
- return Math.round(ms3 / s) + "s";
10413
+ return Math.round(ms2 / s) + "s";
10414
10414
  }
10415
- return ms3 + "ms";
10415
+ return ms2 + "ms";
10416
10416
  }
10417
- function fmtLong(ms3) {
10418
- var msAbs = Math.abs(ms3);
10417
+ function fmtLong(ms2) {
10418
+ var msAbs = Math.abs(ms2);
10419
10419
  if (msAbs >= d) {
10420
- return plural(ms3, msAbs, d, "day");
10420
+ return plural(ms2, msAbs, d, "day");
10421
10421
  }
10422
10422
  if (msAbs >= h) {
10423
- return plural(ms3, msAbs, h, "hour");
10423
+ return plural(ms2, msAbs, h, "hour");
10424
10424
  }
10425
10425
  if (msAbs >= m) {
10426
- return plural(ms3, msAbs, m, "minute");
10426
+ return plural(ms2, msAbs, m, "minute");
10427
10427
  }
10428
10428
  if (msAbs >= s) {
10429
- return plural(ms3, msAbs, s, "second");
10429
+ return plural(ms2, msAbs, s, "second");
10430
10430
  }
10431
- return ms3 + " ms";
10431
+ return ms2 + " ms";
10432
10432
  }
10433
- function plural(ms3, msAbs, n, name2) {
10433
+ function plural(ms2, msAbs, n, name2) {
10434
10434
  var isPlural = msAbs >= n * 1.5;
10435
- return Math.round(ms3 / n) + " " + name2 + (isPlural ? "s" : "");
10435
+ return Math.round(ms2 / n) + " " + name2 + (isPlural ? "s" : "");
10436
10436
  }
10437
10437
  }
10438
10438
  });
@@ -10460,10 +10460,10 @@ var require_decrypt_transport_response_error = __commonJS({
10460
10460
  var __toCommonJS = (mod3) => __copyProps2(__defProp4({}, "__esModule", { value: true }), mod3);
10461
10461
  var DecryptTransportResponseError_exports = {};
10462
10462
  __export4(DecryptTransportResponseError_exports, {
10463
- DecryptTransportResponseError: () => DecryptTransportResponseError4
10463
+ DecryptTransportResponseError: () => DecryptTransportResponseError2
10464
10464
  });
10465
10465
  module.exports = __toCommonJS(DecryptTransportResponseError_exports);
10466
- var DecryptTransportResponseError4 = class extends Error {
10466
+ var DecryptTransportResponseError2 = class extends Error {
10467
10467
  constructor(status, permissionHint) {
10468
10468
  super("Node decrypt request failed");
10469
10469
  this.status = status;
@@ -12095,7 +12095,7 @@ function encOk(data) {
12095
12095
  function encErr(error) {
12096
12096
  return { ok: false, error };
12097
12097
  }
12098
- var import_decrypt_transport_response_error, import_decrypt_transport_response_error2, import_decrypt_transport_response_error3, ErrorCodes, defaultRetryPolicy, TelemetryEvents, REDACTED, SAFE_NUMBER_FIELDS, SAFE_BOOLEAN_FIELDS, DEBUG_FLAG, MAX_EVENTS, TinyCloudDebugLogger, tinyCloudDebugLogger, ServiceErrorSchema, GenericResultSchema, KVResponseHeadersSchema, GenericKVResponseSchema, KVListResponseSchema, KVListResultSchema, ServiceRequestEventSchema, ServiceResponseEventSchema, ServiceErrorEventSchema, ServiceRetryEventSchema, TelemetrySpanEventSchema, RetryPolicySchema, ServiceSessionSchema, BaseService, PrefixedKVService, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, KVAction, MAX_KV_BATCH_READ_ITEMS, KVService, SQLMigrations, DatabaseHandle, SQLAction, DDL_TOKENS, MIGRATIONS_TABLE, MIGRATIONS_SCHEMA, MIGRATIONS_META_NAMESPACE, MIGRATIONS_META_ID, SQLService, DuckDbDatabaseHandle, DuckDbAction, DuckDbService, AsyncQueue, HooksService, VaultVersionConfig, CURRENT_VAULT_VERSION, VaultHeaders, DB_NAME, DB_VERSION, STORE_NAME, WRAP_KEY_ID, DataVaultService, HEX, URN_PREFIX, NETWORK_NAME_RE, PKH_EIP155_DID_RE, NetworkIdError, DEFAULT_ENCRYPTION_ALG, ENVELOPE_VERSION, DEFAULT_KEY_VERSION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, EncryptionService;
12098
+ var import_decrypt_transport_response_error, ErrorCodes, defaultRetryPolicy, TelemetryEvents, REDACTED, SAFE_NUMBER_FIELDS, SAFE_BOOLEAN_FIELDS, DEBUG_FLAG, MAX_EVENTS, TinyCloudDebugLogger, tinyCloudDebugLogger, ServiceErrorSchema, GenericResultSchema, KVResponseHeadersSchema, GenericKVResponseSchema, KVListResponseSchema, KVListResultSchema, ServiceRequestEventSchema, ServiceResponseEventSchema, ServiceErrorEventSchema, ServiceRetryEventSchema, TelemetrySpanEventSchema, RetryPolicySchema, ServiceSessionSchema, BaseService, PrefixedKVService, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, KVAction, MAX_KV_BATCH_READ_ITEMS, KVService, SQLMigrations, DatabaseHandle, SQLAction, DDL_TOKENS, MIGRATIONS_TABLE, MIGRATIONS_SCHEMA, MIGRATIONS_META_NAMESPACE, MIGRATIONS_META_ID, SQLService, DuckDbDatabaseHandle, DuckDbAction, DuckDbService, AsyncQueue, HooksService, VaultVersionConfig, CURRENT_VAULT_VERSION, VaultHeaders, DB_NAME, DB_VERSION, STORE_NAME, WRAP_KEY_ID, DataVaultService, HEX, URN_PREFIX, NETWORK_NAME_RE, PKH_EIP155_DID_RE, NetworkIdError, DEFAULT_ENCRYPTION_ALG, ENVELOPE_VERSION, DEFAULT_KEY_VERSION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, EncryptionService;
12099
12099
  var init_dist2 = __esm({
12100
12100
  "../sdk-services/dist/index.js"() {
12101
12101
  "use strict";
@@ -12103,8 +12103,6 @@ var init_dist2 = __esm({
12103
12103
  init_dist();
12104
12104
  init_dist();
12105
12105
  import_decrypt_transport_response_error = __toESM(require_decrypt_transport_response_error(), 1);
12106
- import_decrypt_transport_response_error2 = __toESM(require_decrypt_transport_response_error(), 1);
12107
- import_decrypt_transport_response_error3 = __toESM(require_decrypt_transport_response_error(), 1);
12108
12106
  ErrorCodes = {
12109
12107
  // Common errors
12110
12108
  NOT_FOUND: "NOT_FOUND",
@@ -26156,10 +26154,8 @@ var init_dist4 = __esm({
26156
26154
  init_dist2();
26157
26155
  init_zod();
26158
26156
  init_dist2();
26159
- init_dist();
26160
26157
  init_dist2();
26161
26158
  init_dist2();
26162
- init_dist();
26163
26159
  init_ed25519();
26164
26160
  init_esm();
26165
26161
  __defProp3 = Object.defineProperty;
@@ -29009,38 +29005,6 @@ var init_profiles = __esm({
29009
29005
  }
29010
29006
  });
29011
29007
 
29012
- // ../sdk-core/src/manifest.ts
29013
- var import_ms2, SERVICE_SHORT_TO_LONG2, SERVICE_LONG_TO_SHORT2;
29014
- var init_manifest = __esm({
29015
- "../sdk-core/src/manifest.ts"() {
29016
- "use strict";
29017
- import_ms2 = __toESM(require_ms(), 1);
29018
- init_dist2();
29019
- SERVICE_SHORT_TO_LONG2 = Object.freeze({
29020
- kv: "tinycloud.kv",
29021
- sql: "tinycloud.sql",
29022
- duckdb: "tinycloud.duckdb",
29023
- capabilities: "tinycloud.capabilities",
29024
- hooks: "tinycloud.hooks",
29025
- encryption: "tinycloud.encryption",
29026
- delegation: "tinycloud.delegation"
29027
- });
29028
- SERVICE_LONG_TO_SHORT2 = Object.freeze(
29029
- Object.fromEntries(
29030
- Object.entries(SERVICE_SHORT_TO_LONG2).map(([s, l]) => [l, s])
29031
- )
29032
- );
29033
- }
29034
- });
29035
-
29036
- // ../sdk-core/src/capabilities.ts
29037
- var init_capabilities = __esm({
29038
- "../sdk-core/src/capabilities.ts"() {
29039
- "use strict";
29040
- init_manifest();
29041
- }
29042
- });
29043
-
29044
29008
  // src/lib/permissions.ts
29045
29009
  import { appendFile, readFile as readFile4 } from "fs/promises";
29046
29010
  import { join as join5 } from "path";
@@ -29079,8 +29043,6 @@ async function replayAdditionalDelegations(node, profile) {
29079
29043
  var init_permissions = __esm({
29080
29044
  "src/lib/permissions.ts"() {
29081
29045
  "use strict";
29082
- init_manifest();
29083
- init_capabilities();
29084
29046
  init_constants();
29085
29047
  init_storage();
29086
29048
  init_profiles();
@@ -29370,11 +29332,11 @@ function parseDuration(input) {
29370
29332
  }
29371
29333
  const date = new Date(input);
29372
29334
  if (!isNaN(date.getTime())) {
29373
- const ms3 = date.getTime() - Date.now();
29374
- if (ms3 <= 0) {
29335
+ const ms2 = date.getTime() - Date.now();
29336
+ if (ms2 <= 0) {
29375
29337
  throw new Error(`Expiry date "${input}" is in the past`);
29376
29338
  }
29377
- return ms3;
29339
+ return ms2;
29378
29340
  }
29379
29341
  throw new Error(`Invalid duration: "${input}". Use format like "1h", "7d", or an ISO date.`);
29380
29342
  }