@novasamatech/host-container 0.7.9-3 → 0.7.9-5

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.
@@ -1,4 +1,4 @@
1
- import { ChatBotRegistrationErr, ChatMessagePostingErr, ChatRoomRegistrationErr, CreateProofErr, CreateTransactionErr, DeriveEntropyErr, DevicePermission, GenericError, GetUserIdErr, LoginErr, NavigateToErr, PaymentBalanceErr, PaymentRequestErr, PaymentStatusErr, PaymentTopUpErr, PreimageSubmitErr, RemotePermission, RequestCredentialsErr, ResourceAllocationErr, SigningErr, StatementProofErr, StorageErr, createTransport, enumValue, isEnumVariant, resultErr, resultOk, } from '@novasamatech/host-api';
1
+ import { ChatBotRegistrationErr, ChatMessagePostingErr, ChatRoomRegistrationErr, CreateProofErr, CreateTransactionErr, DeriveEntropyErr, DevicePermission, GenericError, GetUserIdErr, LoginErr, NavigateToErr, PaymentBalanceErr, PaymentRequestErr, PaymentStatusErr, PaymentTopUpErr, PreimageSubmitErr, PushNotificationError, RemotePermission, RequestCredentialsErr, ResourceAllocationErr, SigningErr, StatementProofErr, StorageErr, createTransport, enumValue, isEnumVariant, resultErr, resultOk, } from '@novasamatech/host-api';
2
2
  import { err, errAsync, ok, okAsync } from 'neverthrow';
3
3
  import { createChainConnectionManager } from './chainConnectionManager.js';
4
4
  const UNSUPPORTED_MESSAGE_FORMAT_ERROR = 'Unsupported message format';
@@ -176,7 +176,8 @@ export function createContainer(provider) {
176
176
  const handleFeatureSupportedSlot = makeNotImplementedSlot('host_feature_supported', () => new GenericError({ reason: NOT_IMPLEMENTED }));
177
177
  const handleDevicePermissionSlot = makeNotImplementedSlot('host_device_permission', () => new GenericError({ reason: NOT_IMPLEMENTED }));
178
178
  const handleRemotePermissionSlot = makeNotImplementedSlot('remote_permission', () => new GenericError({ reason: NOT_IMPLEMENTED }));
179
- const handlePushNotificationSlot = makeDevicePermissionGatedRequestSlot('host_push_notification', 'Notifications', () => new GenericError({ reason: NOT_IMPLEMENTED }));
179
+ const handlePushNotificationSlot = makeDevicePermissionGatedRequestSlot('host_push_notification', 'Notifications', () => new PushNotificationError.Unknown({ reason: NOT_IMPLEMENTED }));
180
+ const handlePushNotificationCancelSlot = makeDevicePermissionGatedRequestSlot('host_push_notification_cancel', 'Notifications', () => new GenericError({ reason: NOT_IMPLEMENTED }));
180
181
  const handleNavigateToSlot = makeNotImplementedSlot('host_navigate_to', () => new NavigateToErr.Unknown({ reason: NOT_IMPLEMENTED }));
181
182
  const handleChatCreateRoomSlot = makeNotImplementedSlot('host_chat_create_room', () => new ChatRoomRegistrationErr.Unknown({ reason: NOT_IMPLEMENTED }));
182
183
  const handleChatBotRegistrationSlot = makeNotImplementedSlot('host_chat_register_bot', () => new ChatBotRegistrationErr.Unknown({ reason: NOT_IMPLEMENTED }));
@@ -211,7 +212,10 @@ export function createContainer(provider) {
211
212
  return handleV1Request(handleRemotePermissionSlot, () => new GenericError({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
212
213
  },
213
214
  handlePushNotification(handler) {
214
- return handleV1Request(handlePushNotificationSlot, () => new GenericError({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
215
+ return handleV1Request(handlePushNotificationSlot, () => new PushNotificationError.Unknown({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
216
+ },
217
+ handlePushNotificationCancel(handler) {
218
+ return handleV1Request(handlePushNotificationCancelSlot, () => new GenericError({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
215
219
  },
216
220
  handleNavigateTo(handler) {
217
221
  return handleV1Request(handleNavigateToSlot, () => new NavigateToErr.Unknown({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
package/dist/types.d.ts CHANGED
@@ -57,6 +57,7 @@ export type Container = {
57
57
  handleDevicePermission: InferHandler<'v1', HostApiProtocol['host_device_permission']>;
58
58
  handlePermission: InferHandler<'v1', HostApiProtocol['remote_permission']>;
59
59
  handlePushNotification: InferHandler<'v1', HostApiProtocol['host_push_notification']>;
60
+ handlePushNotificationCancel: InferHandler<'v1', HostApiProtocol['host_push_notification_cancel']>;
60
61
  handleNavigateTo: InferHandler<'v1', HostApiProtocol['host_navigate_to']>;
61
62
  handleDeriveEntropy: InferHandler<'v1', HostApiProtocol['host_derive_entropy']>;
62
63
  handleLocalStorageRead: InferHandler<'v1', HostApiProtocol['host_local_storage_read']>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@novasamatech/host-container",
3
3
  "type": "module",
4
- "version": "0.7.9-3",
4
+ "version": "0.7.9-5",
5
5
  "description": "Host container for hosting and managing products within the Polkadot ecosystem.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "@noble/hashes": "2.2.0",
29
29
  "polkadot-api": ">=2",
30
30
  "@polkadot-api/substrate-client": "^0.7.0",
31
- "@novasamatech/host-api": "0.7.9-3",
31
+ "@novasamatech/host-api": "0.7.9-5",
32
32
  "nanoid": "5.1.9",
33
33
  "neverthrow": "^8.2.0"
34
34
  },