@napplet/sdk 0.20.1 → 0.21.0
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 +36 -57
- package/dist/index.d.ts +22 -5
- package/dist/index.js +159 -116
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,26 +6,24 @@
|
|
|
6
6
|
|
|
7
7
|
### Prerequisites
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- A NIP-5D runtime injects `window.napplet` before SDK methods are called
|
|
10
10
|
- A shell host running a napplet protocol shell implementation
|
|
11
11
|
|
|
12
12
|
### How It Works
|
|
13
13
|
|
|
14
|
-
1. Import `@napplet/
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
17
|
-
4. If `window.napplet` is not installed when a method is called, a descriptive error is thrown
|
|
14
|
+
1. Import named exports from `@napplet/sdk` -- `relay`, `inc`, `storage`, `keys`, `ble`, `lists`
|
|
15
|
+
2. Each SDK method delegates to its injected `window.napplet.*` counterpart at call time
|
|
16
|
+
3. If `window.napplet` or a requested domain is unavailable when a method is called, a descriptive error is thrown
|
|
18
17
|
|
|
19
18
|
### Installation
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
|
-
npm install @napplet/sdk
|
|
21
|
+
npm install @napplet/sdk
|
|
23
22
|
```
|
|
24
23
|
|
|
25
24
|
## Quick Start
|
|
26
25
|
|
|
27
26
|
```ts
|
|
28
|
-
import '@napplet/shim';
|
|
29
27
|
import { relay, inc, storage, keys, media, notify, config, resource, ble, webrtc, link, lists, type NostrEvent } from '@napplet/sdk';
|
|
30
28
|
|
|
31
29
|
// Subscribe to kind 1 notes
|
|
@@ -210,7 +208,6 @@ Per-napplet declarative configuration (NAP-CONFIG). Mirrors `window.napplet.conf
|
|
|
210
208
|
`json-schema-to-ts` is declared as an optional `peerDependency` of `@napplet/nap` (scoped to the `@napplet/nap/config` domain's `FromSchema` typing). Install it in your napplet to get `FromSchema<typeof schema>` typing for your `config.subscribe` callback -- the `values` parameter is inferred directly from your schema (enums, required fields, defaults all flow through). Authors who skip `json-schema-to-ts` pay no install cost and `config.subscribe` still works with the default `Record<string, unknown>` typing.
|
|
211
209
|
|
|
212
210
|
```ts
|
|
213
|
-
import '@napplet/shim';
|
|
214
211
|
import { config } from '@napplet/sdk';
|
|
215
212
|
import type { FromSchema } from 'json-schema-to-ts';
|
|
216
213
|
|
|
@@ -241,6 +238,7 @@ Sandboxed byte fetching (NAP-RESOURCE). Mirrors `window.napplet.resource`. Requi
|
|
|
241
238
|
|
|
242
239
|
| Method | Returns | Description |
|
|
243
240
|
|--------|---------|-------------|
|
|
241
|
+
| `info()` | `Promise<ResourceInfo>` | Inspect advisory schemes and coarse policy limits. Not required before fetching. |
|
|
244
242
|
| `bytes(url, opts?)` | `Promise<Blob>` | Fetch bytes through the shell. `opts.signal` accepts an `AbortSignal`. |
|
|
245
243
|
| `bytesMany(urls, opts?)` | `Promise<ResourceBytesItem[]>` | Fetch many URLs through one envelope. Items preserve input order and length. |
|
|
246
244
|
| `bytesAsObjectURL(url)` | `{ url: string; revoke: () => void }` | Synchronous handle whose `url` resolves to a blob URL once the fetch completes. |
|
|
@@ -250,8 +248,9 @@ Four canonical schemes: `data:` (in-shim), `https:` (shell-side under policy), `
|
|
|
250
248
|
Bare helper aliases are also re-exported for consumers that prefer functional imports:
|
|
251
249
|
|
|
252
250
|
```ts
|
|
253
|
-
import { resourceBytes, resourceBytesMany, resourceBytesAsObjectURL } from '@napplet/sdk';
|
|
251
|
+
import { resourceInfo, resourceBytes, resourceBytesMany, resourceBytesAsObjectURL } from '@napplet/sdk';
|
|
254
252
|
|
|
253
|
+
const info = await resourceInfo();
|
|
255
254
|
const blob = await resourceBytes('https://example.com/avatar.png');
|
|
256
255
|
const items = await resourceBytesMany(['https://example.com/a.png']);
|
|
257
256
|
const handle = resourceBytesAsObjectURL('blossom:sha256:...');
|
|
@@ -271,7 +270,7 @@ Keyboard forwarding and action keybindings. Mirrors `window.napplet.keys`.
|
|
|
271
270
|
|
|
272
271
|
Read-only user identity queries (NAP-IDENTITY). The identity namespace
|
|
273
272
|
is NOT exported as a top-level SDK object — use `window.napplet.identity.*` directly
|
|
274
|
-
after
|
|
273
|
+
after runtime injection, or use the bare-name helpers below.
|
|
275
274
|
|
|
276
275
|
| Method | Returns | Description |
|
|
277
276
|
|--------|---------|-------------|
|
|
@@ -293,30 +292,16 @@ NAP-IDENTITY is strictly read-only. Signing remains delegated through
|
|
|
293
292
|
`relay.publish()`, encryption through `relay.publishEncrypted()`, and identity
|
|
294
293
|
changes arrive through `identity.changed` rather than polling.
|
|
295
294
|
|
|
296
|
-
###
|
|
295
|
+
### Runtime-Injected Domains
|
|
297
296
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
| Method | Returns | Description |
|
|
303
|
-
|--------|---------|-------------|
|
|
304
|
-
| `supports(capability, protocol?)` | `boolean` | Check shell support for a NAP (`nap:relay`), permission (`perm:popups`), or numbered NAP-NN protocol over an interface (`inc`, `NAP-01`). Bare NAP names are also accepted (`relay`). |
|
|
305
|
-
|
|
306
|
-
**Example:**
|
|
297
|
+
NIP-5D runtimes inject `window.napplet` before napplet code runs. Available NAP
|
|
298
|
+
domains are present as properties; unavailable domains are absent. Gate optional
|
|
299
|
+
behavior with property presence:
|
|
307
300
|
|
|
308
301
|
```ts
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
if (window.napplet.shell.supports('relay')) { /* ... */ }
|
|
313
|
-
if (window.napplet.shell.supports('nap:identity')) { /* ... */ }
|
|
314
|
-
|
|
315
|
-
// Permissions
|
|
316
|
-
if (window.napplet.shell.supports('perm:popups')) { /* ... */ }
|
|
317
|
-
|
|
318
|
-
// Numbered NAP-NN message protocols
|
|
319
|
-
if (window.napplet.shell.supports('inc', 'NAP-01')) { /* ... */ }
|
|
302
|
+
if (window.napplet?.relay) { /* relay API is available */ }
|
|
303
|
+
if (window.napplet?.identity) { /* identity API is available */ }
|
|
304
|
+
if (window.napplet?.inc) { /* inter-napplet channel API is available */ }
|
|
320
305
|
```
|
|
321
306
|
|
|
322
307
|
### Namespace Import
|
|
@@ -344,9 +329,6 @@ import type {
|
|
|
344
329
|
EventTemplate,
|
|
345
330
|
NappletMessage,
|
|
346
331
|
NapDomain,
|
|
347
|
-
NamespacedCapability,
|
|
348
|
-
NapProtocolId,
|
|
349
|
-
ShellSupports,
|
|
350
332
|
// NAP message types (re-exported from NAP packages)
|
|
351
333
|
RelayNapMessage,
|
|
352
334
|
IdentityNapMessage,
|
|
@@ -369,9 +351,6 @@ import type {
|
|
|
369
351
|
| `EventTemplate` | Unsigned event for `relay.publish()` |
|
|
370
352
|
| `NappletMessage` | Base JSON envelope type for all protocol messages |
|
|
371
353
|
| `NapDomain` | String literal union of NAP domain names |
|
|
372
|
-
| `NamespacedCapability` | Union of `NapDomain \| nap:* \| perm:*` for `supports()` |
|
|
373
|
-
| `NapProtocolId` | Numbered NAP protocol id such as `NAP-01` for the optional second `supports()` argument |
|
|
374
|
-
| `ShellSupports` | Interface for the shell capability query API |
|
|
375
354
|
|
|
376
355
|
### NAP Message Types
|
|
377
356
|
|
|
@@ -406,61 +385,61 @@ import { RELAY_DOMAIN, IDENTITY_DOMAIN, STORAGE_DOMAIN, INC_DOMAIN, THEME_DOMAIN
|
|
|
406
385
|
// Values: 'relay', 'identity', 'storage', 'inc', 'theme', 'keys', 'media', 'notify', 'config', 'resource', 'cvm', 'outbox', 'upload', 'intent', 'ble', 'webrtc', 'link', 'lists', 'common', 'serial'
|
|
407
386
|
```
|
|
408
387
|
|
|
409
|
-
These constants are re-exported from the individual domain packages. Use
|
|
410
|
-
|
|
388
|
+
These constants are re-exported from the individual domain packages. Use
|
|
389
|
+
property presence for type-safe conditional logic:
|
|
411
390
|
|
|
412
391
|
```ts
|
|
413
|
-
if (window.napplet
|
|
392
|
+
if (window.napplet?.relay) {
|
|
414
393
|
// relay operations are available
|
|
415
394
|
}
|
|
416
395
|
|
|
417
|
-
if (window.napplet
|
|
396
|
+
if (window.napplet?.identity) {
|
|
418
397
|
// identity queries are available
|
|
419
398
|
}
|
|
420
399
|
|
|
421
|
-
if (window.napplet
|
|
400
|
+
if (window.napplet?.config) {
|
|
422
401
|
// NAP-CONFIG is available -- schema registration and subscribe()
|
|
423
402
|
}
|
|
424
403
|
|
|
425
|
-
if (window.napplet
|
|
426
|
-
// resource.bytes(url) is available
|
|
427
|
-
if (window.napplet.shell.supports('resource:scheme:blossom')) { /* ... */ }
|
|
404
|
+
if (window.napplet?.resource) {
|
|
405
|
+
// resource.bytes(url) is available.
|
|
428
406
|
}
|
|
429
407
|
```
|
|
430
408
|
|
|
431
409
|
## Runtime Guard
|
|
432
410
|
|
|
433
|
-
If `window.napplet` is
|
|
411
|
+
If `window.napplet` or a requested domain is unavailable when an SDK method is
|
|
412
|
+
called, a clear error is thrown:
|
|
434
413
|
|
|
435
414
|
```
|
|
436
|
-
Error: window.napplet
|
|
415
|
+
Error: window.napplet.relay is unavailable -- runtime did not inject this domain
|
|
437
416
|
```
|
|
438
417
|
|
|
439
|
-
This protects
|
|
418
|
+
This protects napplets from assuming optional domains are always present.
|
|
440
419
|
|
|
441
420
|
## SDK vs Shim
|
|
442
421
|
|
|
443
422
|
| | `@napplet/sdk` | `@napplet/shim` |
|
|
444
423
|
|---|---|---|
|
|
445
|
-
| **Import style** | `import { relay } from '@napplet/sdk'` | `import '@napplet/shim'`
|
|
446
|
-
| **What it does** | Named exports wrapping
|
|
424
|
+
| **Import style** | `import { relay } from '@napplet/sdk'` | `import { installNappletGlobal } from '@napplet/shim'` |
|
|
425
|
+
| **What it does** | Named exports wrapping injected domains | Runtime-side global installer |
|
|
447
426
|
| **Dependencies** | `@napplet/core` (types only) | None (types from `@napplet/core`) |
|
|
448
|
-
| **Side effects** | None | Yes -- installs globals
|
|
449
|
-
| **Required** | Optional convenience |
|
|
427
|
+
| **Side effects** | None | Yes -- installs globals on a target window |
|
|
428
|
+
| **Required** | Optional convenience for napplets | Runtime implementation detail |
|
|
450
429
|
|
|
451
|
-
**Typical usage:**
|
|
430
|
+
**Typical napplet usage:** import the SDK for typed API access:
|
|
452
431
|
|
|
453
432
|
```ts
|
|
454
|
-
import '@napplet/
|
|
455
|
-
import { relay, inc, storage, keys, media, notify } from '@napplet/sdk'; // optional: typed API
|
|
433
|
+
import { relay, inc, storage, keys, media, notify } from '@napplet/sdk';
|
|
456
434
|
```
|
|
457
435
|
|
|
458
|
-
If you are writing a vanilla napplet with no build step, use
|
|
436
|
+
If you are writing a vanilla napplet with no build step, use the injected
|
|
437
|
+
`window.napplet.*` namespace directly -- the SDK is not required.
|
|
459
438
|
|
|
460
439
|
## Protocol Reference
|
|
461
440
|
|
|
462
441
|
- [NIP-5D](https://github.com/nostr-protocol/nips/pull/2303) -- Napplet-shell protocol specification
|
|
463
|
-
- [@napplet/shim](../shim/) --
|
|
442
|
+
- [@napplet/shim](../shim/) -- Runtime-side injected global installer
|
|
464
443
|
- [@napplet/core](../core/) -- Shared protocol types
|
|
465
444
|
|
|
466
445
|
## License
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NostrEvent, Subscription, NostrFilter, EventTemplate, ResourceBytesItem, CvmDiscoverQuery, CvmServer, CvmServerRef, McpMessage, CvmRequestOptions, McpTool, McpToolResult, McpResource, McpResourceContent, IntentRequest, IntentResult, IntentAvailability, OutboxQueryOptions, OutboxResult, OutboxSubscribeOptions, OutboxSubscription, OutboxPublishOptions, OutboxPublishResult, OutboxTarget, OutboxRelayPlan, UploadRequest, UploadResult, UploadStatus, WebrtcOpenRequest, WebrtcOpenResult, WebrtcEvent, BleOpenRequest, BleOpenResult, BleService, BleAttribute, BleWriteOptions, BleEvent, CommonNip19EncodeInput, CommonNip19EncodeResult, CommonNip19DecodeResult, CommonProfileTarget, CommonProfileResult, CommonFollowsResult, CommonActionResult, CommonReaction, CommonReportTarget, CommonReportReason, DmStatus, DmConversationQuery, DmConversationPage, DmMessageQuery, DmMessagePage, DmSendRequest, DmSendResult, DmSubscribeRequest, DmSubscription, DmOk, DmMessage, LinkOpenOptions, LinkOpenResult, ListSupport, ListRef, ListItem, ListOptions, ListMutationResult, SerialOpenRequest, SerialOpenResult, SerialEvent } from '@napplet/core';
|
|
2
|
-
export { EventTemplate, NAP_DOMAINS,
|
|
1
|
+
import { NostrEvent, Subscription, NostrFilter, EventTemplate, ResourceInfo, ResourceBytesItem, CvmDiscoverQuery, CvmServer, CvmServerRef, McpMessage, CvmRequestOptions, McpTool, McpToolResult, McpResource, McpResourceContent, IntentRequest, IntentResult, IntentAvailability, OutboxEventOptions, OutboxEventResult, OutboxQueryOptions, OutboxResult, OutboxSubscribeOptions, OutboxSubscription, OutboxPublishOptions, OutboxPublishResult, OutboxTarget, OutboxRelayPlan, UploadInfo, UploadRequest, UploadResult, UploadStatus, WebrtcOpenRequest, WebrtcOpenResult, WebrtcEvent, BleOpenRequest, BleOpenResult, BleService, BleAttribute, BleWriteOptions, BleEvent, CommonNip19EncodeInput, CommonNip19EncodeResult, CommonNip19DecodeResult, CommonProfileTarget, CommonProfileResult, CommonFollowsResult, CommonActionResult, CommonReaction, CommonReportTarget, CommonReportReason, DmStatus, DmConversationQuery, DmConversationPage, DmMessageQuery, DmMessagePage, DmSendRequest, DmSendResult, DmSubscribeRequest, DmSubscription, DmOk, DmMessage, LinkOpenOptions, LinkOpenResult, ListSupport, ListRef, ListItem, ListOptions, ListMutationResult, SerialOpenRequest, SerialOpenResult, SerialEvent } from '@napplet/core';
|
|
2
|
+
export { EventTemplate, NAP_DOMAINS, NapDomain, NappletMessage, NostrEvent, NostrFilter, Subscription } from '@napplet/core';
|
|
3
3
|
import { MediaSessionCreate, MediaSessionResult, MediaMetadata, MediaState, MediaAction } from '@napplet/nap/media';
|
|
4
4
|
export { DOMAIN as MEDIA_DOMAIN, MediaAction, MediaArtwork, MediaCapabilitiesMessage, MediaCommandMessage, MediaControlsMessage, MediaMessage, MediaMetadata, MediaNapMessage, MediaPlaybackOwner, MediaRequestMessage, MediaResultMessage, MediaSessionCreate, MediaSessionCreateMessage, MediaSessionCreateResultMessage, MediaSessionDestroyMessage, MediaSessionResult, MediaSessionUpdateMessage, MediaSourceRef, MediaState, MediaStateMessage, installMediaShim, mediaCreateSession, mediaDestroySession, mediaOnCapabilities, mediaOnCommand, mediaOnControls, mediaOnState, mediaReportCapabilities, mediaReportState, mediaSendCommand, mediaUpdateSession } from '@napplet/nap/media';
|
|
5
5
|
export { DOMAIN as RELAY_DOMAIN, RelayCloseMessage, RelayClosedMessage, RelayEoseMessage, RelayEventMessage, RelayInboundMessage, RelayMessage, RelayNapMessage, RelayOutboundMessage, RelayPublishEncryptedMessage, RelayPublishEncryptedResultMessage, RelayPublishMessage, RelayPublishResultMessage, RelayQueryMessage, RelayQueryResultMessage, RelaySubscribeMessage, installRelayShim, relayPublish, relayPublishEncrypted, relayQuery, relaySubscribe } from '@napplet/nap/relay';
|
|
@@ -11,10 +11,10 @@ export { DOMAIN as THEME_DOMAIN, Theme, ThemeBackground, ThemeChangedMessage, Th
|
|
|
11
11
|
export { Action, DOMAIN as KEYS_DOMAIN, KeyBinding, KeysActionMessage, KeysBindingsMessage, KeysForwardMessage, KeysMessage, KeysNapMessage, KeysRegisterActionMessage, KeysRegisterActionResultMessage, KeysRequestMessage, KeysResultMessage, KeysUnregisterActionMessage, RegisterResult, installKeysShim, keysOnAction, keysRegister, keysRegisterAction, keysUnregisterAction } from '@napplet/nap/keys';
|
|
12
12
|
export { DOMAIN as NOTIFY_DOMAIN, NotificationAction, NotificationChannel, NotificationPriority, NotifyActionMessage, NotifyBadgeMessage, NotifyChannelRegisterMessage, NotifyClickedMessage, NotifyControl, NotifyControlsMessage, NotifyDismissMessage, NotifyDismissedMessage, NotifyMessage, NotifyNapMessage, NotifyPermissionRequestMessage, NotifyPermissionResultMessage, NotifyRequestMessage, NotifyResultMessage, NotifySendMessage, NotifySendResultMessage, installNotifyShim, notifyBadge, notifyDismiss, notifyOnAction, notifyOnClicked, notifyOnControls, notifyOnDismissed, notifyRegisterChannel, notifyRequestPermission, notifySend } from '@napplet/nap/notify';
|
|
13
13
|
export { DOMAIN as CONFIG_DOMAIN, ConfigGetMessage, ConfigMessage, ConfigNapMessage, ConfigOpenSettingsMessage, ConfigRegisterSchemaMessage, ConfigRegisterSchemaResultMessage, ConfigRequestMessage, ConfigResultMessage, ConfigSchema, ConfigSchemaErrorCode, ConfigSchemaErrorMessage, ConfigSubscribeMessage, ConfigUnsubscribeMessage, ConfigValues, ConfigValuesMessage, NappletConfigSchema, NappletConfigSchemaExtensions, installConfigShim } from '@napplet/nap/config';
|
|
14
|
-
export { DOMAIN as RESOURCE_DOMAIN, ResourceBytesErrorItem, ResourceBytesErrorMessage, ResourceBytesItem, ResourceBytesManyErrorMessage, ResourceBytesManyMessage, ResourceBytesManyResultMessage, ResourceBytesMessage, ResourceBytesOkItem, ResourceBytesResultMessage, ResourceCancelMessage, ResourceErrorCode, ResourceMessage, ResourceNapMessage, ResourceRequestMessage, ResourceResultMessage, ResourceScheme, ResourceSidecarEntry, installResourceShim, resourceBytes, resourceBytesAsObjectURL, resourceBytesMany } from '@napplet/nap/resource';
|
|
14
|
+
export { DOMAIN as RESOURCE_DOMAIN, ResourceBytesErrorItem, ResourceBytesErrorMessage, ResourceBytesItem, ResourceBytesManyErrorMessage, ResourceBytesManyMessage, ResourceBytesManyResultMessage, ResourceBytesMessage, ResourceBytesOkItem, ResourceBytesResultMessage, ResourceCancelMessage, ResourceErrorCode, ResourceMessage, ResourceNapMessage, ResourceRequestMessage, ResourceResultMessage, ResourceScheme, ResourceSidecarEntry, installResourceShim, resourceBytes, resourceBytesAsObjectURL, resourceBytesMany, resourceInfo } from '@napplet/nap/resource';
|
|
15
15
|
export { DOMAIN as CVM_DOMAIN, CvmCloseMessage, CvmCloseResultMessage, CvmDiscoverMessage, CvmDiscoverQuery, CvmDiscoverResultMessage, CvmEventMessage, CvmInboundMessage, CvmMessage, CvmNapMessage, CvmOutboundMessage, CvmRequestMessage, CvmRequestOptions, CvmRequestResultMessage, CvmServer, CvmServerRef, McpBlobResourceContents, McpContentBlock, McpMessage, McpResource, McpResourceContent, McpTextResourceContents, McpTool, McpToolResult, cvmCallTool, cvmClose, cvmDiscover, cvmListResources, cvmListTools, cvmOnEvent, cvmReadResource, cvmRequest, installCvmShim } from '@napplet/nap/cvm';
|
|
16
|
-
export { DOMAIN as OUTBOX_DOMAIN, OutboxCloseMessage, OutboxClosedMessage, OutboxEoseMessage, OutboxEventMessage, OutboxInboundMessage, OutboxMessage, OutboxNapMessage, OutboxOutboundMessage, OutboxPublishMessage, OutboxPublishOptions, OutboxPublishResult, OutboxPublishResultMessage, OutboxQueryMessage, OutboxQueryOptions, OutboxQueryResultMessage, OutboxRelayPlan, OutboxResolveRelaysMessage, OutboxResolveRelaysResultMessage, OutboxResult, OutboxStrategy, OutboxSubscribeMessage, OutboxSubscribeOptions, OutboxSubscription, OutboxTarget, installOutboxShim, outboxPublish, outboxQuery, outboxResolveRelays, outboxSubscribe } from '@napplet/nap/outbox';
|
|
17
|
-
export { NostrTag, DOMAIN as UPLOAD_DOMAIN, UploadDimensions, UploadInboundMessage, UploadMessage, UploadNapMessage, UploadOutboundMessage, UploadRail, UploadRequest, UploadResult, UploadState, UploadStatus, UploadStatusChangedMessage, UploadStatusMessage, UploadStatusResultMessage, UploadUploadMessage, UploadUploadResultMessage, installUploadShim, uploadFile, uploadOnStatus, uploadStatus } from '@napplet/nap/upload';
|
|
16
|
+
export { DOMAIN as OUTBOX_DOMAIN, OutboxCloseMessage, OutboxClosedMessage, OutboxEoseMessage, OutboxEventMessage, OutboxEventOptions, OutboxEventResult, OutboxGetEventMessage, OutboxGetEventResultMessage, OutboxInboundMessage, OutboxMessage, OutboxNapMessage, OutboxOutboundMessage, OutboxPublishMessage, OutboxPublishOptions, OutboxPublishResult, OutboxPublishResultMessage, OutboxQueryMessage, OutboxQueryOptions, OutboxQueryResultMessage, OutboxRelayPlan, OutboxResolveRelaysMessage, OutboxResolveRelaysResultMessage, OutboxResult, OutboxStrategy, OutboxSubscribeMessage, OutboxSubscribeOptions, OutboxSubscription, OutboxTarget, installOutboxShim, outboxGetEvent, outboxPublish, outboxQuery, outboxResolveRelays, outboxSubscribe } from '@napplet/nap/outbox';
|
|
17
|
+
export { NostrTag, DOMAIN as UPLOAD_DOMAIN, UploadDimensions, UploadInboundMessage, UploadMessage, UploadNapMessage, UploadOutboundMessage, UploadRail, UploadRequest, UploadResult, UploadState, UploadStatus, UploadStatusChangedMessage, UploadStatusMessage, UploadStatusResultMessage, UploadUploadMessage, UploadUploadResultMessage, installUploadShim, uploadFile, uploadInfo, uploadOnStatus, uploadStatus } from '@napplet/nap/upload';
|
|
18
18
|
export { DOMAIN as INTENT_DOMAIN, IntentAvailability, IntentAvailableMessage, IntentAvailableResultMessage, IntentBehavior, IntentCandidate, IntentChangedMessage, IntentContract, IntentHandlerPreference, IntentHandlersMessage, IntentHandlersResultMessage, IntentInboundMessage, IntentInvokeMessage, IntentInvokeResultMessage, IntentMessage, IntentNapMessage, IntentOutboundMessage, IntentRequest, IntentResult, installIntentShim, intentAvailable, intentHandlers, intentInvoke, intentOnChanged, intentOpen } from '@napplet/nap/intent';
|
|
19
19
|
export { DOMAIN as BLE_DOMAIN, BleApi, BleAttribute, BleCharacteristic, BleCharacteristicProperties, BleCloseMessage, BleCloseResultMessage, BleClosedEvent, BleDeviceFilter, BleDeviceInfo, BleEvent, BleEventMessage, BleInboundMessage, BleManufacturerDataFilter, BleMessage, BleNapMessage, BleNotificationEvent, BleOpenMessage, BleOpenRequest, BleOpenResult, BleOpenResultMessage, BleOutboundMessage, BleReadMessage, BleReadResultMessage, BleService, BleServiceDataFilter, BleServicesMessage, BleServicesResultMessage, BleSession, BleSessionState, BleStateEvent, BleSubscribeMessage, BleSubscribeResultMessage, BleUnsubscribeMessage, BleUnsubscribeResultMessage, BleUuid, BleWriteMessage, BleWriteOptions, BleWriteResultMessage, bleClose, bleOnEvent, bleOpen, bleRead, bleServices, bleSubscribe, bleUnsubscribe, bleWrite, installBleShim } from '@napplet/nap/ble';
|
|
20
20
|
export { DOMAIN as WEBRTC_DOMAIN, WebrtcApi, WebrtcCloseMessage, WebrtcCloseResultMessage, WebrtcClosedEvent, WebrtcDirectScope, WebrtcEvent, WebrtcEventMessage, WebrtcInboundMessage, WebrtcMessage, WebrtcMessageEvent, WebrtcNapMessage, WebrtcOpenMessage, WebrtcOpenRequest, WebrtcOpenResult, WebrtcOpenResultMessage, WebrtcOutboundMessage, WebrtcPeerEvent, WebrtcRoomScope, WebrtcScope, WebrtcSendMessage, WebrtcSendResultMessage, WebrtcSession, WebrtcState, WebrtcStateEvent, installWebrtcShim, webrtcClose, webrtcOnEvent, webrtcOpen, webrtcSend } from '@napplet/nap/webrtc';
|
|
@@ -637,6 +637,11 @@ declare const config: {
|
|
|
637
637
|
* ```
|
|
638
638
|
*/
|
|
639
639
|
declare const resource: {
|
|
640
|
+
/**
|
|
641
|
+
* Inspect resource schemes and coarse runtime policy limits.
|
|
642
|
+
* @returns Promise resolving to advisory resource info.
|
|
643
|
+
*/
|
|
644
|
+
info(): Promise<ResourceInfo>;
|
|
640
645
|
/**
|
|
641
646
|
* Fetch bytes for a URL through the shell's resource pipeline.
|
|
642
647
|
* @param url URL identifying the resource (any registered scheme).
|
|
@@ -758,6 +763,13 @@ declare const cvm: {
|
|
|
758
763
|
* ```
|
|
759
764
|
*/
|
|
760
765
|
declare const outbox: {
|
|
766
|
+
/**
|
|
767
|
+
* Fetch one event by ID through shell-owned outbox routing.
|
|
768
|
+
* @param eventId Event id to fetch
|
|
769
|
+
* @param options Optional author/relay hints, strategy, and timeout
|
|
770
|
+
* @returns Promise resolving to the outbox event result
|
|
771
|
+
*/
|
|
772
|
+
getEvent(eventId: string, options?: OutboxEventOptions): Promise<OutboxEventResult>;
|
|
761
773
|
/**
|
|
762
774
|
* Perform a one-shot outbox-aware query.
|
|
763
775
|
* @param filters NIP-01 filter or filters
|
|
@@ -802,6 +814,11 @@ declare const outbox: {
|
|
|
802
814
|
* ```
|
|
803
815
|
*/
|
|
804
816
|
declare const upload: {
|
|
817
|
+
/**
|
|
818
|
+
* Inspect upload rails and coarse runtime policy limits.
|
|
819
|
+
* @returns Promise resolving to advisory upload info.
|
|
820
|
+
*/
|
|
821
|
+
info(): Promise<UploadInfo>;
|
|
805
822
|
/**
|
|
806
823
|
* Upload bytes through the shell's storage pipeline.
|
|
807
824
|
* @param request The upload request (Blob/ArrayBuffer bytes + intent)
|