sealnet 1.4.0 → 1.5.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/index.d.cts CHANGED
@@ -19,7 +19,10 @@ interface Pairing {
19
19
  readonly name: string;
20
20
  }
21
21
 
22
- type TTL = '5m' | '30m' | '1h' | '1d' | '7d';
22
+ /** The lifetimes a seal can have: `ttl_options` of the SEAL contract, which the server checks. */
23
+ declare const TTL_OPTIONS: readonly string[];
24
+ /** A seal's lifetime, one of the contract's `ttl_options`. */
25
+ type TTL = (typeof TTL_OPTIONS)[number];
23
26
  interface CreateAnonymousSealOptions {
24
27
  /** File data (File, ArrayBuffer, Uint8Array, or Blob) */
25
28
  file: File | ArrayBuffer | Uint8Array | Blob;
@@ -27,7 +30,7 @@ interface CreateAnonymousSealOptions {
27
30
  filename: string;
28
31
  /** MIME type (optional, defaults to application/octet-stream) */
29
32
  mimeType?: string;
30
- /** Time to live: 5m, 30m, 1h, 1d, 7d */
33
+ /** Time to live: one of the lifetimes seal.net offers */
31
34
  ttl: TTL;
32
35
  /** Optional password (OTP) for download protection */
33
36
  otp?: string;
@@ -62,9 +65,9 @@ interface CreateAnonymousSealOptions {
62
65
  readonly secretKey: string;
63
66
  };
64
67
  /**
65
- * Over 1 GB: the tier the person pays for once by card (`5gb` $9 90 days,
66
- * `50gb` $29 180 days, `500gb` $99 365 days). Needs `ttl` 1d or 7d and
67
- * `onPaymentRequired`.
68
+ * Over 1 GB: the tier the person pays for once by card (prices and terms:
69
+ * seal.net/pricing). Needs `onPaymentRequired` and a `ttl` the server allows
70
+ * a paid seal.
68
71
  */
69
72
  tier?: '5gb' | '50gb' | '500gb';
70
73
  /**
@@ -129,7 +132,9 @@ interface CreateAnonymousSealResult {
129
132
  */
130
133
  type SealErrorCode = 'AUTH_INVALID_KEY' | 'AUTH_EXPIRED_TOKEN' | 'AUTH_INSUFFICIENT_SCOPE' | 'RESOURCE_NOT_FOUND' | 'VALIDATION_ERROR' | 'RATE_LIMITED' | 'STORAGE_QUOTA_EXCEEDED'
131
134
  /** Over 1 GB: the seal was not paid for in time and was revoked. */
132
- | 'PAYMENT_REQUIRED' | 'ENCRYPTION_ERROR' | 'DECRYPTION_ERROR' | 'INVALID_KEY' | 'INTERNAL_ERROR' | 'SERVICE_UNAVAILABLE' | 'NETWORK_ERROR' | 'TIMEOUT';
135
+ | 'PAYMENT_REQUIRED' | 'ENCRYPTION_ERROR' | 'DECRYPTION_ERROR' | 'INVALID_KEY' | 'INTERNAL_ERROR' | 'SERVICE_UNAVAILABLE' | 'NETWORK_ERROR' | 'TIMEOUT'
136
+ /** The API no longer serves this SDK version: the message says how to update. */
137
+ | 'CLIENT_OUTDATED';
133
138
  /**
134
139
  * Extra context carried by {@link SealError}.
135
140
  *
@@ -379,6 +384,6 @@ declare class SealClient {
379
384
  revokedAt: string | null;
380
385
  }>;
381
386
  }
382
- declare const VERSION = "1.4.0";
387
+ declare const VERSION: string;
383
388
 
384
389
  export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type PairOptions, type PairResult, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SendOptions, type SendResult, type TTL, VERSION };
package/dist/index.d.ts CHANGED
@@ -19,7 +19,10 @@ interface Pairing {
19
19
  readonly name: string;
20
20
  }
21
21
 
22
- type TTL = '5m' | '30m' | '1h' | '1d' | '7d';
22
+ /** The lifetimes a seal can have: `ttl_options` of the SEAL contract, which the server checks. */
23
+ declare const TTL_OPTIONS: readonly string[];
24
+ /** A seal's lifetime, one of the contract's `ttl_options`. */
25
+ type TTL = (typeof TTL_OPTIONS)[number];
23
26
  interface CreateAnonymousSealOptions {
24
27
  /** File data (File, ArrayBuffer, Uint8Array, or Blob) */
25
28
  file: File | ArrayBuffer | Uint8Array | Blob;
@@ -27,7 +30,7 @@ interface CreateAnonymousSealOptions {
27
30
  filename: string;
28
31
  /** MIME type (optional, defaults to application/octet-stream) */
29
32
  mimeType?: string;
30
- /** Time to live: 5m, 30m, 1h, 1d, 7d */
33
+ /** Time to live: one of the lifetimes seal.net offers */
31
34
  ttl: TTL;
32
35
  /** Optional password (OTP) for download protection */
33
36
  otp?: string;
@@ -62,9 +65,9 @@ interface CreateAnonymousSealOptions {
62
65
  readonly secretKey: string;
63
66
  };
64
67
  /**
65
- * Over 1 GB: the tier the person pays for once by card (`5gb` $9 90 days,
66
- * `50gb` $29 180 days, `500gb` $99 365 days). Needs `ttl` 1d or 7d and
67
- * `onPaymentRequired`.
68
+ * Over 1 GB: the tier the person pays for once by card (prices and terms:
69
+ * seal.net/pricing). Needs `onPaymentRequired` and a `ttl` the server allows
70
+ * a paid seal.
68
71
  */
69
72
  tier?: '5gb' | '50gb' | '500gb';
70
73
  /**
@@ -129,7 +132,9 @@ interface CreateAnonymousSealResult {
129
132
  */
130
133
  type SealErrorCode = 'AUTH_INVALID_KEY' | 'AUTH_EXPIRED_TOKEN' | 'AUTH_INSUFFICIENT_SCOPE' | 'RESOURCE_NOT_FOUND' | 'VALIDATION_ERROR' | 'RATE_LIMITED' | 'STORAGE_QUOTA_EXCEEDED'
131
134
  /** Over 1 GB: the seal was not paid for in time and was revoked. */
132
- | 'PAYMENT_REQUIRED' | 'ENCRYPTION_ERROR' | 'DECRYPTION_ERROR' | 'INVALID_KEY' | 'INTERNAL_ERROR' | 'SERVICE_UNAVAILABLE' | 'NETWORK_ERROR' | 'TIMEOUT';
135
+ | 'PAYMENT_REQUIRED' | 'ENCRYPTION_ERROR' | 'DECRYPTION_ERROR' | 'INVALID_KEY' | 'INTERNAL_ERROR' | 'SERVICE_UNAVAILABLE' | 'NETWORK_ERROR' | 'TIMEOUT'
136
+ /** The API no longer serves this SDK version: the message says how to update. */
137
+ | 'CLIENT_OUTDATED';
133
138
  /**
134
139
  * Extra context carried by {@link SealError}.
135
140
  *
@@ -379,6 +384,6 @@ declare class SealClient {
379
384
  revokedAt: string | null;
380
385
  }>;
381
386
  }
382
- declare const VERSION = "1.4.0";
387
+ declare const VERSION: string;
383
388
 
384
389
  export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type PairOptions, type PairResult, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SendOptions, type SendResult, type TTL, VERSION };