@drxsuperapp/sdk 1.0.0
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/.openapi-generator/FILES +12 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/api.ts +469 -0
- package/base.ts +86 -0
- package/common.ts +150 -0
- package/configuration.ts +115 -0
- package/deploy.log +357 -0
- package/dist/api.d.ts +257 -0
- package/dist/api.js +360 -0
- package/dist/base.d.ts +66 -0
- package/dist/base.js +63 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +133 -0
- package/dist/configuration.d.ts +91 -0
- package/dist/configuration.js +100 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +15 -0
- package/docs/ApiExamplesGet200ResponseInner.md +24 -0
- package/docs/ApiExamplesIdPutRequest.md +22 -0
- package/docs/ApiExamplesPostRequest.md +22 -0
- package/docs/ExampleApi.md +270 -0
- package/ecosystem.config.js +13 -0
- package/git_push.sh +57 -0
- package/hooks.json +26 -0
- package/index.ts +18 -0
- package/openapitools.json +7 -0
- package/package.json +30 -0
- package/tsconfig.json +17 -0
- package/workflow.sh +68 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# ExampleApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**apiExamplesGet**](#apiexamplesget) | **GET** /api/examples | |
|
|
8
|
+
|[**apiExamplesIdDelete**](#apiexamplesiddelete) | **DELETE** /api/examples/{id} | |
|
|
9
|
+
|[**apiExamplesIdGet**](#apiexamplesidget) | **GET** /api/examples/{id} | |
|
|
10
|
+
|[**apiExamplesIdPut**](#apiexamplesidput) | **PUT** /api/examples/{id} | |
|
|
11
|
+
|[**apiExamplesPost**](#apiexamplespost) | **POST** /api/examples | |
|
|
12
|
+
|
|
13
|
+
# **apiExamplesGet**
|
|
14
|
+
> Array<ApiExamplesGet200ResponseInner> apiExamplesGet()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import {
|
|
21
|
+
ExampleApi,
|
|
22
|
+
Configuration
|
|
23
|
+
} from './api';
|
|
24
|
+
|
|
25
|
+
const configuration = new Configuration();
|
|
26
|
+
const apiInstance = new ExampleApi(configuration);
|
|
27
|
+
|
|
28
|
+
let page: number; // (optional) (default to 1)
|
|
29
|
+
let limit: number; // (optional) (default to 10)
|
|
30
|
+
|
|
31
|
+
const { status, data } = await apiInstance.apiExamplesGet(
|
|
32
|
+
page,
|
|
33
|
+
limit
|
|
34
|
+
);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Parameters
|
|
38
|
+
|
|
39
|
+
|Name | Type | Description | Notes|
|
|
40
|
+
|------------- | ------------- | ------------- | -------------|
|
|
41
|
+
| **page** | [**number**] | | (optional) defaults to 1|
|
|
42
|
+
| **limit** | [**number**] | | (optional) defaults to 10|
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Return type
|
|
46
|
+
|
|
47
|
+
**Array<ApiExamplesGet200ResponseInner>**
|
|
48
|
+
|
|
49
|
+
### Authorization
|
|
50
|
+
|
|
51
|
+
No authorization required
|
|
52
|
+
|
|
53
|
+
### HTTP request headers
|
|
54
|
+
|
|
55
|
+
- **Content-Type**: Not defined
|
|
56
|
+
- **Accept**: application/json
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### HTTP response details
|
|
60
|
+
| Status code | Description | Response headers |
|
|
61
|
+
|-------------|-------------|------------------|
|
|
62
|
+
|**200** | List of examples | - |
|
|
63
|
+
|
|
64
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
65
|
+
|
|
66
|
+
# **apiExamplesIdDelete**
|
|
67
|
+
> apiExamplesIdDelete()
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Example
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import {
|
|
74
|
+
ExampleApi,
|
|
75
|
+
Configuration
|
|
76
|
+
} from './api';
|
|
77
|
+
|
|
78
|
+
const configuration = new Configuration();
|
|
79
|
+
const apiInstance = new ExampleApi(configuration);
|
|
80
|
+
|
|
81
|
+
let id: string; // (default to undefined)
|
|
82
|
+
|
|
83
|
+
const { status, data } = await apiInstance.apiExamplesIdDelete(
|
|
84
|
+
id
|
|
85
|
+
);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Parameters
|
|
89
|
+
|
|
90
|
+
|Name | Type | Description | Notes|
|
|
91
|
+
|------------- | ------------- | ------------- | -------------|
|
|
92
|
+
| **id** | [**string**] | | defaults to undefined|
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Return type
|
|
96
|
+
|
|
97
|
+
void (empty response body)
|
|
98
|
+
|
|
99
|
+
### Authorization
|
|
100
|
+
|
|
101
|
+
No authorization required
|
|
102
|
+
|
|
103
|
+
### HTTP request headers
|
|
104
|
+
|
|
105
|
+
- **Content-Type**: Not defined
|
|
106
|
+
- **Accept**: Not defined
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### HTTP response details
|
|
110
|
+
| Status code | Description | Response headers |
|
|
111
|
+
|-------------|-------------|------------------|
|
|
112
|
+
|**204** | Example deleted | - |
|
|
113
|
+
|
|
114
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
115
|
+
|
|
116
|
+
# **apiExamplesIdGet**
|
|
117
|
+
> ApiExamplesGet200ResponseInner apiExamplesIdGet()
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Example
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
import {
|
|
124
|
+
ExampleApi,
|
|
125
|
+
Configuration
|
|
126
|
+
} from './api';
|
|
127
|
+
|
|
128
|
+
const configuration = new Configuration();
|
|
129
|
+
const apiInstance = new ExampleApi(configuration);
|
|
130
|
+
|
|
131
|
+
let id: string; // (default to undefined)
|
|
132
|
+
|
|
133
|
+
const { status, data } = await apiInstance.apiExamplesIdGet(
|
|
134
|
+
id
|
|
135
|
+
);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Parameters
|
|
139
|
+
|
|
140
|
+
|Name | Type | Description | Notes|
|
|
141
|
+
|------------- | ------------- | ------------- | -------------|
|
|
142
|
+
| **id** | [**string**] | | defaults to undefined|
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
### Return type
|
|
146
|
+
|
|
147
|
+
**ApiExamplesGet200ResponseInner**
|
|
148
|
+
|
|
149
|
+
### Authorization
|
|
150
|
+
|
|
151
|
+
No authorization required
|
|
152
|
+
|
|
153
|
+
### HTTP request headers
|
|
154
|
+
|
|
155
|
+
- **Content-Type**: Not defined
|
|
156
|
+
- **Accept**: application/json
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### HTTP response details
|
|
160
|
+
| Status code | Description | Response headers |
|
|
161
|
+
|-------------|-------------|------------------|
|
|
162
|
+
|**200** | Example detail | - |
|
|
163
|
+
|
|
164
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
165
|
+
|
|
166
|
+
# **apiExamplesIdPut**
|
|
167
|
+
> ApiExamplesGet200ResponseInner apiExamplesIdPut()
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Example
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
import {
|
|
174
|
+
ExampleApi,
|
|
175
|
+
Configuration,
|
|
176
|
+
ApiExamplesIdPutRequest
|
|
177
|
+
} from './api';
|
|
178
|
+
|
|
179
|
+
const configuration = new Configuration();
|
|
180
|
+
const apiInstance = new ExampleApi(configuration);
|
|
181
|
+
|
|
182
|
+
let id: string; // (default to undefined)
|
|
183
|
+
let apiExamplesIdPutRequest: ApiExamplesIdPutRequest; // (optional)
|
|
184
|
+
|
|
185
|
+
const { status, data } = await apiInstance.apiExamplesIdPut(
|
|
186
|
+
id,
|
|
187
|
+
apiExamplesIdPutRequest
|
|
188
|
+
);
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Parameters
|
|
192
|
+
|
|
193
|
+
|Name | Type | Description | Notes|
|
|
194
|
+
|------------- | ------------- | ------------- | -------------|
|
|
195
|
+
| **apiExamplesIdPutRequest** | **ApiExamplesIdPutRequest**| | |
|
|
196
|
+
| **id** | [**string**] | | defaults to undefined|
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### Return type
|
|
200
|
+
|
|
201
|
+
**ApiExamplesGet200ResponseInner**
|
|
202
|
+
|
|
203
|
+
### Authorization
|
|
204
|
+
|
|
205
|
+
No authorization required
|
|
206
|
+
|
|
207
|
+
### HTTP request headers
|
|
208
|
+
|
|
209
|
+
- **Content-Type**: application/json
|
|
210
|
+
- **Accept**: application/json
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### HTTP response details
|
|
214
|
+
| Status code | Description | Response headers |
|
|
215
|
+
|-------------|-------------|------------------|
|
|
216
|
+
|**200** | Example updated | - |
|
|
217
|
+
|
|
218
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
219
|
+
|
|
220
|
+
# **apiExamplesPost**
|
|
221
|
+
> ApiExamplesGet200ResponseInner apiExamplesPost()
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
### Example
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
import {
|
|
228
|
+
ExampleApi,
|
|
229
|
+
Configuration,
|
|
230
|
+
ApiExamplesPostRequest
|
|
231
|
+
} from './api';
|
|
232
|
+
|
|
233
|
+
const configuration = new Configuration();
|
|
234
|
+
const apiInstance = new ExampleApi(configuration);
|
|
235
|
+
|
|
236
|
+
let apiExamplesPostRequest: ApiExamplesPostRequest; // (optional)
|
|
237
|
+
|
|
238
|
+
const { status, data } = await apiInstance.apiExamplesPost(
|
|
239
|
+
apiExamplesPostRequest
|
|
240
|
+
);
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Parameters
|
|
244
|
+
|
|
245
|
+
|Name | Type | Description | Notes|
|
|
246
|
+
|------------- | ------------- | ------------- | -------------|
|
|
247
|
+
| **apiExamplesPostRequest** | **ApiExamplesPostRequest**| | |
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
### Return type
|
|
251
|
+
|
|
252
|
+
**ApiExamplesGet200ResponseInner**
|
|
253
|
+
|
|
254
|
+
### Authorization
|
|
255
|
+
|
|
256
|
+
No authorization required
|
|
257
|
+
|
|
258
|
+
### HTTP request headers
|
|
259
|
+
|
|
260
|
+
- **Content-Type**: application/json
|
|
261
|
+
- **Accept**: application/json
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
### HTTP response details
|
|
265
|
+
| Status code | Description | Response headers |
|
|
266
|
+
|-------------|-------------|------------------|
|
|
267
|
+
|**201** | Example created | - |
|
|
268
|
+
|
|
269
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
270
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports = {
|
|
3
|
+
apps: [
|
|
4
|
+
{
|
|
5
|
+
name: 'drx-sdk-webhook',
|
|
6
|
+
script: '/usr/local/bin/webhook', // path to `webhook` binary
|
|
7
|
+
args: '-hooks /root/drx-sdk/hooks.json -port 9000 -verbose',
|
|
8
|
+
cwd: '/root/drx-sdk',
|
|
9
|
+
watch: false,
|
|
10
|
+
autorestart: true
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
};
|
package/git_push.sh
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
|
3
|
+
#
|
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
|
5
|
+
|
|
6
|
+
git_user_id=$1
|
|
7
|
+
git_repo_id=$2
|
|
8
|
+
release_note=$3
|
|
9
|
+
git_host=$4
|
|
10
|
+
|
|
11
|
+
if [ "$git_host" = "" ]; then
|
|
12
|
+
git_host="github.com"
|
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
|
17
|
+
git_user_id="GIT_USER_ID"
|
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
if [ "$release_note" = "" ]; then
|
|
27
|
+
release_note="Minor update"
|
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Initialize the local directory as a Git repository
|
|
32
|
+
git init
|
|
33
|
+
|
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
|
35
|
+
git add .
|
|
36
|
+
|
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
|
38
|
+
git commit -m "$release_note"
|
|
39
|
+
|
|
40
|
+
# Sets the new remote
|
|
41
|
+
git_remote=$(git remote)
|
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
|
43
|
+
|
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
|
47
|
+
else
|
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
git pull origin master
|
|
54
|
+
|
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
package/hooks.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "sdk-deploy",
|
|
4
|
+
"execute-command": "/root/drx-sdk/workflow.sh",
|
|
5
|
+
"command-working-directory": "/root/drx-sdk",
|
|
6
|
+
"response-message": "Triggered SDK deployment.",
|
|
7
|
+
"trigger-rule": {
|
|
8
|
+
"match": {
|
|
9
|
+
"type": "value",
|
|
10
|
+
"value": "supersecret",
|
|
11
|
+
"parameter": {
|
|
12
|
+
"source": "header",
|
|
13
|
+
"name": "X-Hook-Secret"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"include-command-output-in-response": true,
|
|
18
|
+
"pass-environment-to-command": [
|
|
19
|
+
{
|
|
20
|
+
"source": "header",
|
|
21
|
+
"name": "X-Hook-Secret",
|
|
22
|
+
"envname": "HTTP_X_HOOK_SECRET"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
package/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* DRX API
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export * from "./api";
|
|
17
|
+
export * from "./configuration";
|
|
18
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@drxsuperapp/sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.ts",
|
|
5
|
+
"types": "index.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"prepublishOnly": "npm run build"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://gitlab.com/drxsuperapp/drx-sdk.git"
|
|
13
|
+
},
|
|
14
|
+
"author": "DRX Team",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://gitlab.com/drxsuperapp/drx-sdk/issues"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://gitlab.com/drxsuperapp/drx-sdk#readme",
|
|
20
|
+
"description": "Auto-generated DRX API SDK (axios-based)",
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"axios": "^1.9.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"typescript": "^5.8.3"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./dist",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": false,
|
|
9
|
+
"sourceMap": false,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"resolveJsonModule": true
|
|
14
|
+
},
|
|
15
|
+
"include": ["./**/*.ts"],
|
|
16
|
+
"exclude": ["node_modules", "dist"]
|
|
17
|
+
}
|
package/workflow.sh
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
LOCKFILE="/tmp/drx-sdk-deploy.lock"
|
|
4
|
+
LOGFILE="/root/drx-sdk/deploy.log"
|
|
5
|
+
SECRET_HEADER="supersecret"
|
|
6
|
+
|
|
7
|
+
# Optional: Read X-Hook-Secret from env or stdin (e.g. webhook piping)
|
|
8
|
+
if [[ -n "$HTTP_X_HOOK_SECRET" && "$HTTP_X_HOOK_SECRET" != "$SECRET_HEADER" ]]; then
|
|
9
|
+
echo "❌ Invalid hook secret at $(date)" >> "$LOGFILE"
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
(
|
|
14
|
+
flock -n 9 || {
|
|
15
|
+
echo "⚠️ Deploy already running at $(date)" >> "$LOGFILE"
|
|
16
|
+
exit 1
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
echo "🚀 START: $(date)" >> "$LOGFILE"
|
|
20
|
+
cd /root/drx-sdk || exit 1
|
|
21
|
+
|
|
22
|
+
# Step 1: Reset and pull latest code
|
|
23
|
+
git checkout master >> "$LOGFILE" 2>&1
|
|
24
|
+
git reset --hard HEAD >> "$LOGFILE" 2>&1
|
|
25
|
+
git pull origin master >> "$LOGFILE" 2>&1
|
|
26
|
+
|
|
27
|
+
rm -rf apis models >> "$LOGFILE" 2>&1
|
|
28
|
+
|
|
29
|
+
# Step 2: Generate SDK
|
|
30
|
+
openapi-generator-cli generate \
|
|
31
|
+
-i https://master-api.drxasia.com/swagger.json \
|
|
32
|
+
-g typescript-axios \
|
|
33
|
+
-o ./ \
|
|
34
|
+
--auth "Authorization:Basic%20Z2FtYnVsbHM6OGQxbUZKcWJmZTVybVJ6" >> "$LOGFILE" 2>&1
|
|
35
|
+
|
|
36
|
+
if [ $? -ne 0 ]; then
|
|
37
|
+
echo "❌ SDK generation failed at $(date)" >> "$LOGFILE"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
echo "✅ SDK generated" >> "$LOGFILE"
|
|
41
|
+
|
|
42
|
+
# Step 3: Commit and push
|
|
43
|
+
git add . >> "$LOGFILE" 2>&1
|
|
44
|
+
git commit -m "VPS: Generated API SDK" >> "$LOGFILE" 2>&1
|
|
45
|
+
git push >> "$LOGFILE" 2>&1 || {
|
|
46
|
+
echo "❌ Git push failed at $(date)" >> "$LOGFILE"
|
|
47
|
+
exit 1
|
|
48
|
+
}
|
|
49
|
+
echo "✅ Changes committed and pushed" >> "$LOGFILE"
|
|
50
|
+
|
|
51
|
+
# Step 4: Version bump
|
|
52
|
+
npm version patch >> "$LOGFILE" 2>&1
|
|
53
|
+
git push >> "$LOGFILE" 2>&1 || {
|
|
54
|
+
echo "❌ Version push failed" >> "$LOGFILE"
|
|
55
|
+
exit 1
|
|
56
|
+
}
|
|
57
|
+
echo "✅ Version bumped" >> "$LOGFILE"
|
|
58
|
+
|
|
59
|
+
# Step 5: Publish to NPM
|
|
60
|
+
npm publish >> "$LOGFILE" 2>&1 || {
|
|
61
|
+
echo "❌ NPM publish failed" >> "$LOGFILE"
|
|
62
|
+
exit 1
|
|
63
|
+
}
|
|
64
|
+
echo "✅ Package published to NPM" >> "$LOGFILE"
|
|
65
|
+
|
|
66
|
+
echo "🎉 DONE: $(date)" >> "$LOGFILE"
|
|
67
|
+
|
|
68
|
+
) 9> "$LOCKFILE"
|