@ezychat/web 0.1.44 → 0.1.45

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.
@@ -0,0 +1,14 @@
1
+ export interface SendPermissions {
2
+ canSend: boolean;
3
+ /** Only meaningful while canSend is on; turning canSend off clears it. */
4
+ canNew: boolean;
5
+ }
6
+ /**
7
+ * "Can send WhatsApp messages" and, under it, "Can also message new numbers", each with its warning.
8
+ * Shared by Create token and the Permissions dialog, so both show the same rules and texts.
9
+ */
10
+ export declare function SendPermissionFields({ value, onChange, disabled, }: Readonly<{
11
+ value: SendPermissions;
12
+ onChange: (next: SendPermissions) => void;
13
+ disabled: boolean;
14
+ }>): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ApiToken } from '@ezychat/shared';
2
+ /**
3
+ * The owner of a token changes whether its AI assistant may send, and message new numbers, without a
4
+ * new token. The same options and warnings as Create token.
5
+ */
6
+ export declare function TokenPermissionsDialog({ token, onClose, }: Readonly<{
7
+ token: ApiToken | null;
8
+ onClose: () => void;
9
+ }>): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { type InfiniteData, type QueryClient } from '@tanstack/react-query';
2
- import { type CreateApiTokenBodyInput, type Chat, type ChatListResponse, type ChatStatus, type Message, type MessageListResponse, type PatchUserBody, type Settings, type User } from '@ezychat/shared';
2
+ import { type CreateApiTokenBodyInput, type UpdateApiTokenBody, type Chat, type ChatListResponse, type ChatStatus, type Message, type MessageListResponse, type PatchUserBody, type Settings, type User } from '@ezychat/shared';
3
3
  export interface ChatFilters {
4
4
  status?: ChatStatus;
5
5
  assigned: 'me' | 'none' | 'any';
@@ -669,5 +669,21 @@ export declare function useCreateApiToken(): import("@tanstack/react-query").Use
669
669
  canSend: boolean;
670
670
  canMessageNewNumbers: boolean;
671
671
  }, Error, CreateApiTokenVars, unknown>;
672
+ /** Changes whether a token may send (and message new numbers); only its owner may. */
673
+ export declare function useUpdateApiToken(): import("@tanstack/react-query").UseMutationResult<{
674
+ id: number;
675
+ userId: number;
676
+ userName: string;
677
+ name: string;
678
+ prefix: string;
679
+ createdAt: number;
680
+ lastUsedAt: number | null;
681
+ expiresAt: number | null;
682
+ canSend: boolean;
683
+ canMessageNewNumbers: boolean;
684
+ }, Error, {
685
+ id: number;
686
+ body: UpdateApiTokenBody;
687
+ }, unknown>;
672
688
  /** Revokes a token; one that is already gone (404) counts as revoked. */
673
689
  export declare function useRevokeApiToken(): import("@tanstack/react-query").UseMutationResult<void, Error, number, unknown>;
@@ -1146,6 +1146,15 @@ export declare const enResources: {
1146
1146
  localOnly: string;
1147
1147
  askHint: string;
1148
1148
  };
1149
+ permissions: {
1150
+ edit: string;
1151
+ editLabel: string;
1152
+ title: string;
1153
+ description: string;
1154
+ takesEffect: string;
1155
+ save: string;
1156
+ saved: string;
1157
+ };
1149
1158
  };
1150
1159
  settings: {
1151
1160
  title: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezychat/web",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "description": "EzyChat core: the team inbox web app (React) as a library, with createInboxApp and its extension API.",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "build:lib": "node ../../scripts/build-web-lib.mjs"
41
41
  },
42
42
  "dependencies": {
43
- "@ezychat/shared": "0.1.44",
43
+ "@ezychat/shared": "0.1.45",
44
44
  "@fontsource-variable/inter": "^5.3.0",
45
45
  "@tanstack/react-query": "^5.104.4",
46
46
  "@types/react": "^19.3.0",