@purpleschool/rugpt-lib-common 0.0.76 → 0.0.79
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/build/common/command-response.schema.d.ts +7 -0
- package/build/common/index.d.ts +1 -0
- package/build/enums/ai-model-status.enum.d.ts +4 -0
- package/build/enums/locale.enum.d.ts +5 -0
- package/{enums/statistics/index.ts → build/enums/statistics/index.d.ts} +1 -1
- package/build/enums/statistics/statistics-billing-origin.enum.d.ts +4 -0
- package/build/enums/statistics/statistics-call-origin.enum.d.ts +4 -0
- package/build/errors/errors.d.ts +7240 -0
- package/build/errors/errors.js +5 -0
- package/build/tools-api/commands/save-file.command.d.ts +27 -0
- package/build/tools-api/tools-api.amqp.routes.d.ts +3 -0
- package/package.json +5 -2
- package/.githooks/pre-commit +0 -3
- package/.github/workflows/deploy-lib.yml +0 -124
- package/.github/workflows/pachca-notification.yml +0 -20
- package/common/command-response.schema.ts +0 -9
- package/common/index.ts +0 -1
- package/enums/ai-model-status.enum.ts +0 -4
- package/enums/locale.enum.ts +0 -5
- package/enums/statistics/statistics-billing-origin.enum.ts +0 -4
- package/enums/statistics/statistics-call-origin.enum.ts +0 -4
- package/errors/errors.ts +0 -7413
- package/scripts/check-errors-structure.js +0 -149
- package/tools-api/commands/save-file.command.ts +0 -28
- package/tools-api/tools-api.amqp.routes.ts +0 -3
- package/tsconfig.json +0 -103
- /package/{enums/index.ts → build/enums/index.d.ts} +0 -0
- /package/{errors/index.ts → build/errors/index.d.ts} +0 -0
- /package/{index.ts → build/index.d.ts} +0 -0
- /package/{tools-api/commands/index.ts → build/tools-api/commands/index.d.ts} +0 -0
- /package/{tools-api/index.ts → build/tools-api/index.d.ts} +0 -0
package/build/errors/errors.js
CHANGED
|
@@ -4904,6 +4904,11 @@ exports.ERRORS = {
|
|
|
4904
4904
|
},
|
|
4905
4905
|
},
|
|
4906
4906
|
VIDEO_EDITOR: {
|
|
4907
|
+
AUDIO_REFERENCE_REQUIRED: {
|
|
4908
|
+
code: "VIDEO_EDITOR.AUDIO_REFERENCE_REQUIRED",
|
|
4909
|
+
httpCode: 400,
|
|
4910
|
+
message: "Добавление аудиофайла возможно только при наличии изображения-референса.",
|
|
4911
|
+
},
|
|
4907
4912
|
CONFIG_ERROR: {
|
|
4908
4913
|
code: "VIDEO_EDITOR.CONFIG_ERROR",
|
|
4909
4914
|
httpCode: 500,
|
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpleschool/rugpt-lib-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.79",
|
|
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": "^
|
|
19
|
+
"zod": "^4.4.3"
|
|
17
20
|
},
|
|
18
21
|
"devDependencies": {
|
|
19
22
|
"typescript": "^5.9.3"
|
package/.githooks/pre-commit
DELETED
|
@@ -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"
|
package/common/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './command-response.schema';
|
package/enums/locale.enum.ts
DELETED