@deallony/shared 1.2.71 → 1.2.72
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 +64 -43
- package/dist/cjs/types/communication/Chat.d.ts +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,43 +1,64 @@
|
|
|
1
|
-
# @deallony/shared
|
|
2
|
-
|
|
3
|
-
Shared TypeScript types, DTOs, Zod schemas, and utilities for Deallony projects.
|
|
4
|
-
|
|
5
|
-
## One-command releases
|
|
6
|
-
|
|
7
|
-
Run from a clean, synchronized `main` branch with push access to `origin/main`.
|
|
8
|
-
|
|
9
|
-
| Command | Action |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| `npm run deploy` | Bump patch, build, publish to npm, commit/tag/push GitLab |
|
|
12
|
-
| `npm run deploy:minor` | npm + GitLab minor release |
|
|
13
|
-
| `npm run deploy:major` | npm + GitLab major release |
|
|
14
|
-
| `npm run deploy:dry-run` | Preview version and inspect current package, no mutation |
|
|
15
|
-
| `npm run deploy:git` | Bump patch, build, commit/tag/push GitLab without npm publish |
|
|
16
|
-
| `npm run deploy:git:minor` | GitLab-only minor release |
|
|
17
|
-
| `npm run deploy:git:major` | GitLab-only major release |
|
|
18
|
-
| `npm run deploy:git:dry-run` | Preview GitLab-only release |
|
|
19
|
-
|
|
20
|
-
Version increments follow semantic versioning; `1.2.99` becomes `1.2.100`.
|
|
21
|
-
|
|
22
|
-
### Automatic npm login
|
|
23
|
-
|
|
24
|
-
`npm run deploy` first checks `npm whoami`. If npm returns E401 or ENEEDAUTH,
|
|
25
|
-
the script runs `npm login --registry=https://registry.npmjs.org/ --auth-type=web` and
|
|
26
|
-
opens the browser sign-in flow. After you finish logging in, it rechecks your
|
|
27
|
-
identity and continues the same release. Network failures and canceled logins
|
|
28
|
-
stop the release before modifying the package version. `deploy:git` never logs
|
|
29
|
-
into npm.
|
|
30
|
-
|
|
31
|
-
### npm authentication
|
|
32
|
-
|
|
33
|
-
Run `npm login --registry=https://registry.npmjs.org/` and ensure your account has
|
|
34
|
-
publishing permission for the public scoped package `@deallony/shared`.
|
|
35
|
-
Complete any npm 2FA prompts when required. Never commit npm tokens.
|
|
36
|
-
|
|
37
|
-
###
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
# @deallony/shared
|
|
2
|
+
|
|
3
|
+
Shared TypeScript types, DTOs, Zod schemas, and utilities for Deallony projects.
|
|
4
|
+
|
|
5
|
+
## One-command releases
|
|
6
|
+
|
|
7
|
+
Run from a clean, synchronized `main` branch with push access to `origin/main`.
|
|
8
|
+
|
|
9
|
+
| Command | Action |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `npm run deploy` | Bump patch, build, publish to npm, commit/tag/push GitLab |
|
|
12
|
+
| `npm run deploy:minor` | npm + GitLab minor release |
|
|
13
|
+
| `npm run deploy:major` | npm + GitLab major release |
|
|
14
|
+
| `npm run deploy:dry-run` | Preview version and inspect current package, no mutation |
|
|
15
|
+
| `npm run deploy:git` | Bump patch, build, commit/tag/push GitLab without npm publish |
|
|
16
|
+
| `npm run deploy:git:minor` | GitLab-only minor release |
|
|
17
|
+
| `npm run deploy:git:major` | GitLab-only major release |
|
|
18
|
+
| `npm run deploy:git:dry-run` | Preview GitLab-only release |
|
|
19
|
+
|
|
20
|
+
Version increments follow semantic versioning; `1.2.99` becomes `1.2.100`.
|
|
21
|
+
|
|
22
|
+
### Automatic npm login
|
|
23
|
+
|
|
24
|
+
`npm run deploy` first checks `npm whoami`. If npm returns E401 or ENEEDAUTH,
|
|
25
|
+
the script runs `npm login --registry=https://registry.npmjs.org/ --auth-type=web` and
|
|
26
|
+
opens the browser sign-in flow. After you finish logging in, it rechecks your
|
|
27
|
+
identity and continues the same release. Network failures and canceled logins
|
|
28
|
+
stop the release before modifying the package version. `deploy:git` never logs
|
|
29
|
+
into npm.
|
|
30
|
+
|
|
31
|
+
### npm authentication
|
|
32
|
+
|
|
33
|
+
Run `npm login --registry=https://registry.npmjs.org/` and ensure your account has
|
|
34
|
+
publishing permission for the public scoped package `@deallony/shared`.
|
|
35
|
+
Complete any npm 2FA prompts when required. Never commit npm tokens.
|
|
36
|
+
|
|
37
|
+
### Publish without browser approval
|
|
38
|
+
|
|
39
|
+
A normal `npm login` session still makes `npm publish` open the browser for 2FA
|
|
40
|
+
on every release. A granular token with "bypass 2FA" removes that step:
|
|
41
|
+
|
|
42
|
+
1. On npmjs.com open your avatar > **Access Tokens** > **Generate New Token** >
|
|
43
|
+
**Granular Access Token**.
|
|
44
|
+
2. Name it `deallony-shared-publish`, pick an expiration (npm caps write tokens,
|
|
45
|
+
so note the date to renew), and tick **Bypass two-factor authentication (2FA)**.
|
|
46
|
+
3. Under **Packages and scopes** choose **Read and write**, **Only select
|
|
47
|
+
packages and scopes**, and select `@deallony/shared`. Leave organizations at
|
|
48
|
+
no access. Generate and copy the token.
|
|
49
|
+
4. Run `notepad $HOME\.npmrc` (PowerShell) and set this line, replacing any
|
|
50
|
+
existing `//registry.npmjs.org/:_authToken=` line:
|
|
51
|
+
`//registry.npmjs.org/:_authToken=<paste token>`. Save. Editing the file
|
|
52
|
+
keeps the token out of shell history; never paste it into a repo `.npmrc`.
|
|
53
|
+
5. Check with `npm whoami`, then `npm run deploy:dry-run`.
|
|
54
|
+
|
|
55
|
+
When the token expires, `npm whoami` fails and the script falls back to browser
|
|
56
|
+
login; generate a new token and repeat step 4.
|
|
57
|
+
|
|
58
|
+
### Failure recovery
|
|
59
|
+
|
|
60
|
+
If publishing fails, inspect and restore generated local changes before retrying.
|
|
61
|
+
If npm publication succeeds but Git push/commit fails, **do not republish that version**.
|
|
62
|
+
Resolve the Git issue and push the existing release commit and `vX.Y.Z` tag.
|
|
63
|
+
|
|
64
|
+
Merge this feature branch first; merging does not trigger publication automatically.
|
|
@@ -9,12 +9,14 @@ export type IChatRoom = {
|
|
|
9
9
|
name: string;
|
|
10
10
|
phone: string;
|
|
11
11
|
email?: string;
|
|
12
|
+
avatar_url?: string | null;
|
|
12
13
|
};
|
|
13
14
|
provider: {
|
|
14
15
|
id: number;
|
|
15
16
|
name: string;
|
|
16
17
|
phone: string;
|
|
17
18
|
email?: string;
|
|
19
|
+
avatar_url?: string | null;
|
|
18
20
|
};
|
|
19
21
|
ad?: {
|
|
20
22
|
id: number;
|
|
@@ -23,6 +25,8 @@ export type IChatRoom = {
|
|
|
23
25
|
chats?: IChatMessage[];
|
|
24
26
|
lastMessage?: string;
|
|
25
27
|
lastMessageAt?: Date;
|
|
28
|
+
/** Messages in this room the current user has not seen yet. */
|
|
29
|
+
unread_count?: number;
|
|
26
30
|
};
|
|
27
31
|
export type IChatMessage = {
|
|
28
32
|
id: number;
|
|
@@ -30,14 +34,27 @@ export type IChatMessage = {
|
|
|
30
34
|
message_type: MessageTypeEnum;
|
|
31
35
|
payload?: Record<string, any> | null;
|
|
32
36
|
created_at: Date;
|
|
37
|
+
delivered_at?: Date | string | null;
|
|
38
|
+
seen_at?: Date | string | null;
|
|
33
39
|
chat_room_id: number;
|
|
34
40
|
sender_id: number;
|
|
35
41
|
sender: {
|
|
36
42
|
id: number;
|
|
37
43
|
name: string;
|
|
38
44
|
phone: string;
|
|
45
|
+
avatar_url?: string | null;
|
|
39
46
|
};
|
|
40
47
|
};
|
|
48
|
+
/** Live `inboxMessage` socket event sent to the receiver of a new message. */
|
|
49
|
+
export type IChatInboxMessage = {
|
|
50
|
+
chat_room_id: number;
|
|
51
|
+
message_id: number;
|
|
52
|
+
message: string;
|
|
53
|
+
message_type: MessageTypeEnum;
|
|
54
|
+
payload?: Record<string, any> | null;
|
|
55
|
+
sender_id: number;
|
|
56
|
+
created_at: Date | string;
|
|
57
|
+
};
|
|
41
58
|
export declare enum MessageTypeEnum {
|
|
42
59
|
TEXT = 1,
|
|
43
60
|
PRICE_OFFER = 2,
|