@purpleschool/rugpt-lib-common 0.0.76 → 0.0.78

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.
Files changed (30) hide show
  1. package/build/common/command-response.schema.d.ts +7 -0
  2. package/build/common/index.d.ts +1 -0
  3. package/build/enums/ai-model-status.enum.d.ts +4 -0
  4. package/build/enums/locale.enum.d.ts +5 -0
  5. package/{enums/statistics/index.ts → build/enums/statistics/index.d.ts} +1 -1
  6. package/build/enums/statistics/statistics-billing-origin.enum.d.ts +4 -0
  7. package/build/enums/statistics/statistics-call-origin.enum.d.ts +4 -0
  8. package/build/errors/errors.d.ts +7235 -0
  9. package/build/tools-api/commands/save-file.command.d.ts +27 -0
  10. package/build/tools-api/tools-api.amqp.routes.d.ts +3 -0
  11. package/package.json +5 -2
  12. package/.githooks/pre-commit +0 -3
  13. package/.github/workflows/deploy-lib.yml +0 -124
  14. package/.github/workflows/pachca-notification.yml +0 -20
  15. package/common/command-response.schema.ts +0 -9
  16. package/common/index.ts +0 -1
  17. package/enums/ai-model-status.enum.ts +0 -4
  18. package/enums/locale.enum.ts +0 -5
  19. package/enums/statistics/statistics-billing-origin.enum.ts +0 -4
  20. package/enums/statistics/statistics-call-origin.enum.ts +0 -4
  21. package/errors/errors.ts +0 -7413
  22. package/scripts/check-errors-structure.js +0 -149
  23. package/tools-api/commands/save-file.command.ts +0 -28
  24. package/tools-api/tools-api.amqp.routes.ts +0 -3
  25. package/tsconfig.json +0 -103
  26. /package/{enums/index.ts → build/enums/index.d.ts} +0 -0
  27. /package/{errors/index.ts → build/errors/index.d.ts} +0 -0
  28. /package/{index.ts → build/index.d.ts} +0 -0
  29. /package/{tools-api/commands/index.ts → build/tools-api/commands/index.d.ts} +0 -0
  30. /package/{tools-api/index.ts → build/tools-api/index.d.ts} +0 -0
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ export declare namespace SaveFileCommand {
3
+ const RequestSchema: z.ZodObject<{
4
+ userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
+ unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
+ jobId: z.ZodString;
7
+ fileUrls: z.ZodArray<z.ZodString>;
8
+ }, z.core.$strip>;
9
+ type Request = z.infer<typeof RequestSchema>;
10
+ const ResponseSchema: z.ZodObject<{
11
+ isSuccess: z.ZodBoolean;
12
+ data: z.ZodOptional<z.ZodType<{
13
+ data: {
14
+ uuid: string;
15
+ url: string;
16
+ }[];
17
+ }, unknown, z.core.$ZodTypeInternals<{
18
+ data: {
19
+ uuid: string;
20
+ url: string;
21
+ }[];
22
+ }, unknown>>>;
23
+ code: z.ZodOptional<z.ZodString>;
24
+ message: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ type Response = z.infer<typeof ResponseSchema>;
27
+ }
@@ -0,0 +1,3 @@
1
+ export declare const TOOLS_API_AMQP_ROUTES: {
2
+ readonly SAVE_FILES: "tools-api.save-files.rpc";
3
+ };
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@purpleschool/rugpt-lib-common",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
+ "files": [
8
+ "build"
9
+ ],
7
10
  "scripts": {
8
11
  "check:errors": "node scripts/check-errors-structure.js",
9
12
  "prepublish": "rm -rf build && tsc",
@@ -13,7 +16,7 @@
13
16
  "author": "",
14
17
  "license": "ISC",
15
18
  "dependencies": {
16
- "zod": "^3.25.67"
19
+ "zod": "^4.4.3"
17
20
  },
18
21
  "devDependencies": {
19
22
  "typescript": "^5.9.3"
@@ -1,3 +0,0 @@
1
- #!/bin/sh
2
-
3
- npm run check:errors -- --staged
@@ -1,124 +0,0 @@
1
- name: Deploy Library Package
2
-
3
- on:
4
- push:
5
- branches: [main]
6
-
7
- jobs:
8
- check-version:
9
- name: Check package version
10
- runs-on: ubuntu-latest
11
- outputs:
12
- should_publish: ${{ steps.local.outputs.should_publish }}
13
- version: ${{ steps.local.outputs.version }}
14
- steps:
15
- - name: Checkout code
16
- uses: actions/checkout@v6
17
-
18
- - name: Setup Node.js
19
- uses: actions/setup-node@v6
20
- with:
21
- node-version: '24.x'
22
-
23
- - name: Get local version
24
- working-directory: '.'
25
- id: local
26
- run: |
27
- PACKAGE_NAME=$(node -p "require('./package.json').name")
28
- LOCAL_VERSION=$(node -p "require('./package.json').version")
29
-
30
- echo "version=$LOCAL_VERSION" >> $GITHUB_OUTPUT
31
- echo "Local package: $PACKAGE_NAME@$LOCAL_VERSION"
32
-
33
- if npm view "$PACKAGE_NAME@$LOCAL_VERSION" version > /dev/null 2>&1; then
34
- echo "Version $LOCAL_VERSION already exists on npm. Stopping job."
35
- echo "should_publish=false" >> $GITHUB_OUTPUT
36
- else
37
- echo "Version $LOCAL_VERSION does not exist on npm. Publishing."
38
- echo "should_publish=true" >> $GITHUB_OUTPUT
39
- fi
40
-
41
- send-already-exists:
42
- name: Send exists message
43
- needs: [check-version]
44
- if: needs.check-version.outputs.should_publish == 'false'
45
- uses: ./.github/workflows/pachca-notification.yml
46
- with:
47
- message: |
48
- ✅ Публикация контрактов **${{ github.REPOSITORY }}** не требуется
49
- 📝 Текущая версия пакета: **${{ needs.check-version.outputs.version }}**
50
- secrets: inherit
51
-
52
- send-start:
53
- name: Send start message
54
- needs: [check-version]
55
- if: needs.check-version.outputs.should_publish == 'true'
56
- uses: ./.github/workflows/pachca-notification.yml
57
- with:
58
- message: |
59
- 🏹 Публикация контрактов **${{ github.REPOSITORY }}** началась
60
-
61
- 📝 Commit message: **${{ github.event.head_commit.message }}**
62
- ✍🏻 Author: **${{ github.event.head_commit.author.name }}**
63
- 🕐 Commit timestamp: **${{ github.event.head_commit.timestamp }}**
64
-
65
- 🔗 **Links:**
66
- [View CI/CD Run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
67
- secrets: inherit
68
-
69
- publish:
70
- name: Publish package
71
- needs: [check-version]
72
- if: needs.check-version.outputs.should_publish == 'true'
73
- runs-on: ubuntu-latest
74
- steps:
75
- - name: Checkout
76
- uses: actions/checkout@v6
77
-
78
- - name: Setup Node
79
- uses: actions/setup-node@v6
80
- with:
81
- node-version: '24.x'
82
- registry-url: 'https://registry.npmjs.org'
83
-
84
- - name: Install dependencies and build
85
- working-directory: '.'
86
- run: npm ci && npm run prepublish
87
-
88
- - name: Publish package on NPM
89
- working-directory: '.'
90
- run: |
91
- if [[ "$VERSION" == *"-"* ]]; then
92
- TAG="next"
93
- else
94
- TAG="latest"
95
- fi
96
-
97
- npm publish --tag "$TAG" --access public
98
- env:
99
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
100
- VERSION: ${{ needs.check-version.outputs.version }}
101
-
102
- notify-success:
103
- needs: [publish, check-version]
104
- if: success()
105
- uses: ./.github/workflows/pachca-notification.yml
106
- with:
107
- message: |
108
- ✅ **${{ github.repository }}** контракты успешно опубликованы 😎
109
- 📝 Опубликованная версия: **${{ needs.check-version.outputs.version }}**
110
- secrets: inherit
111
-
112
- notify-failure:
113
- needs: [publish]
114
- if: failure()
115
- uses: ./.github/workflows/pachca-notification.yml
116
- with:
117
- message: |
118
- ❌ Публикация контрактов **${{ github.repository }}** упала с ошибкой 😡
119
- 📝 Version: **${{ needs.check-version.outputs.version }}**
120
- ✍🏻 Author: **${{ github.event.head_commit.author.name }}**
121
-
122
- 🔗 **Links:**
123
- [View CI/CD Run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
124
- secrets: inherit
@@ -1,20 +0,0 @@
1
- name: Pachca Notification Template
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- message:
7
- required: true
8
- type: string
9
-
10
- jobs:
11
- notify:
12
- runs-on: self-hosted
13
- steps:
14
- - name: Send webhook message
15
- run: |
16
- PAYLOAD=$(node -e 'let d="";process.stdin.setEncoding("utf8");process.stdin.on("data",c=>d+=c);process.stdin.on("end",()=>process.stdout.write(JSON.stringify({ message: d })));' <<'EOF'
17
- ${{ inputs.message }}
18
- EOF
19
- )
20
- curl -sS -X POST "https://api.pachca.com/webhooks/${{ secrets.DEPLOY_WEBHOOK }}" -H "Content-Type: application/json" -d "$PAYLOAD"
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const ICommandResponseSchema = <T>(dataSchema: z.ZodType<T>) =>
4
- z.object({
5
- isSuccess: z.boolean(),
6
- data: dataSchema.optional(),
7
- code: z.string().optional(),
8
- message: z.string().optional(),
9
- });
package/common/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './command-response.schema';
@@ -1,4 +0,0 @@
1
- export enum AI_MODEL_STATUS {
2
- ACTIVE = 'active',
3
- INACTIVE = 'inactive',
4
- }
@@ -1,5 +0,0 @@
1
- export enum LOCALE {
2
- RU = 'ru',
3
- EN = 'en',
4
- ES = 'es',
5
- }
@@ -1,4 +0,0 @@
1
- export enum STATISTICS_BILLING_ORIGIN {
2
- PERSONAL = 'personal',
3
- TEAM_ACCOUNT = 'team_account',
4
- }
@@ -1,4 +0,0 @@
1
- export enum STATISTICS_CALL_ORIGIN {
2
- API = 'api',
3
- WEB = 'web',
4
- }