Skip to content

Commit 59337c3

Browse files
authored
Merge pull request #204 from yandex-cloud/alpha
Beta 3.0
2 parents 9248aaf + fcfcc9a commit 59337c3

903 files changed

Lines changed: 759361 additions & 637119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.commitlintrc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"extends": [
3-
"@commitlint/config-conventional"
4-
]
2+
"extends": ["@commitlint/config-conventional"]
53
}

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
"plugin:@typescript-eslint/recommended"
1212
],
1313
"parser": "@typescript-eslint/parser",
14-
"plugins": [
15-
"@typescript-eslint",
16-
"unicorn",
17-
"import",
18-
"prefer-arrow-functions"
19-
],
14+
"plugins": ["@typescript-eslint", "unicorn", "import", "prefer-arrow-functions"],
2015
"parserOptions": {
2116
"project": "tsconfig.eslint.json"
2217
},
@@ -31,8 +26,8 @@
3126
"import/prefer-default-export": "off",
3227
"comma-dangle": ["error", "always-multiline"],
3328
"indent": "off",
34-
"@typescript-eslint/indent": ["error", 4],
3529
"max-len": ["error", 140],
30+
"@typescript-eslint/indent": ["error", 4],
3631
"@typescript-eslint/ban-ts-comment": "off",
3732
"@typescript-eslint/prefer-optional-chain": "error",
3833
"prefer-arrow-functions/prefer-arrow-functions": ["error"],
@@ -42,14 +37,21 @@
4237
"no-plusplus": "off",
4338
"unicorn/import-style": "off",
4439
"@typescript-eslint/no-var-requires": "off",
45-
"no-underscore-dangle": ["error", {
46-
"allowAfterThis": true,
47-
"allowAfterSuper": false
48-
}],
40+
"no-underscore-dangle": [
41+
"error",
42+
{
43+
"allowAfterThis": true,
44+
"allowAfterSuper": false
45+
}
46+
],
4947
"unicorn/no-null": "off",
50-
"import/no-extraneous-dependencies": ["error", {
51-
"devDependencies": true
52-
}],
53-
"import/no-cycle": "off"
48+
"import/no-extraneous-dependencies": [
49+
"error",
50+
{
51+
"devDependencies": true
52+
}
53+
],
54+
"import/no-cycle": "off",
55+
"@typescript-eslint/no-explicit-any": 1
5456
}
5557
}

.github/actions/checkout-and-install-node/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
description: 'Whether to configure the token or SSH key with the local git config'
66
required: false
77
default: 'true'
8+
submodules:
9+
description: 'Whether to checkout submodules along with specified repo'
10+
required: false
11+
default: 'false'
812
runs:
913
using: 'composite'
1014
steps:

.github/workflows/pr-checks.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,27 @@ jobs:
99
tests:
1010
runs-on: ubuntu-24.04
1111
steps:
12-
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@d6b5322d8dbc130126ec1fa00bc0f2d6cc2f53db
12+
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@7992e39cce119c931dab92f6879013efff123009
13+
with:
14+
submodules: recursive
1315
- run: npm run test
1416
check-endpoints:
1517
runs-on: ubuntu-24.04
1618
# Currently, the check-endpoints script fails on the master branch.
1719
# So we need to continue on error.
1820
continue-on-error: true
1921
steps:
20-
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@d6b5322d8dbc130126ec1fa00bc0f2d6cc2f53db
22+
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@7992e39cce119c931dab92f6879013efff123009
2123
with:
2224
submodules: recursive
2325
- run: npm run check-endpoints
2426
lint:
2527
runs-on: ubuntu-24.04
2628
steps:
27-
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@d6b5322d8dbc130126ec1fa00bc0f2d6cc2f53db
29+
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@7992e39cce119c931dab92f6879013efff123009
2830
- run: npm run lint
2931
build:
3032
runs-on: ubuntu-24.04
3133
steps:
32-
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@d6b5322d8dbc130126ec1fa00bc0f2d6cc2f53db
34+
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@7992e39cce119c931dab92f6879013efff123009
3335
- run: npm run build

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Release
1212
runs-on: ubuntu-24.04
1313
steps:
14-
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@d6b5322d8dbc130126ec1fa00bc0f2d6cc2f53db
14+
- uses: yandex-cloud/nodejs-sdk/.github/actions/checkout-and-install-node@7992e39cce119c931dab92f6879013efff123009
1515
with:
1616
persist-credentials: false
1717
- env:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea
22
node_modules
33
dist
4+
.env
5+
.vscode

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/generated/**

.prettierrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
tabWidth: 4,
3+
printWidth: 100,
4+
singleQuote: true,
5+
trailingComma: 'all',
6+
bracketSpacing: true,
7+
overrides: [
8+
{
9+
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
10+
options: {
11+
parser: 'typescript',
12+
},
13+
},
14+
{
15+
files: ['*.md', '*.json', '*.yaml', '*.yml'],
16+
options: {
17+
tabWidth: 2,
18+
},
19+
},
20+
],
21+
};

README.md

Lines changed: 14 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Need to automate your infrastructure or use services provided by Yandex.Cloud? We've got you covered.
77

88
## Requirements
9-
- nodejs >= 12
9+
- nodejs >= 22.15
1010

1111
## Installation
1212
`npm install @yandex-cloud/nodejs-sdk`
@@ -22,18 +22,17 @@ running in Yandex.Cloud)
2222
### OAuth Token
2323

2424
```typescript
25-
import { Session, cloudApi, serviceClients } from '@yandex-cloud/nodejs-sdk';
26-
27-
const { resourcemanager: { cloud_service: { ListCloudsRequest } } } = cloudApi;
25+
import { Session } from '@yandex-cloud/nodejs-sdk';
26+
import { cloudService } from '@yandex-cloud/nodejs-sdk/resourcemanager-v1';
2827

2928
// Initialize SDK with your token
3029
const session = new Session({ oauthToken: 'YOUR_TOKEN' });
3130

3231
// Create service client
33-
const cloudService = session.client(serviceClients.CloudServiceClient);
32+
const cloudServiceClient = session.client(cloudService.CloudServiceClient);
3433

3534
// Issue request (returns Promise)
36-
const response = await cloudService.list(ListCloudsRequest.fromPartial({
35+
const response = await cloudServiceClient.list(cloudService.ListCloudsRequest.fromPartial({
3736
pageSize: 100,
3837
}));
3938
```
@@ -43,37 +42,35 @@ const response = await cloudService.list(ListCloudsRequest.fromPartial({
4342
Don't forget to assign Service Account for your Instance or Function.
4443

4544
```typescript
46-
import { Session, cloudApi, serviceClients } from '@yandex-cloud/nodejs-sdk';
47-
48-
const { resourcemanager: { cloud_service: { ListCloudsRequest } } } = cloudApi;
45+
import { Session} from '@yandex-cloud/nodejs-sdk';
46+
import { cloudService } from '@yandex-cloud/nodejs-sdk/resourcemanager-v1';
4947

5048
// Initialize SDK with your token
5149
const session = new Session();
5250

5351
// Create service client
54-
const cloudService = session.client(serviceClients.CloudServiceClient);
52+
const cloudServiceClient = session.client(cloudService.CloudServiceClient);
5553

5654
// Issue request (returns Promise)
57-
const response = await cloudService.list(ListCloudsRequest.fromPartial({
55+
const response = await cloudServiceClient.list(cloudService.ListCloudsRequest.fromPartial({
5856
pageSize: 100,
5957
}));
6058
```
6159

6260
### IAM Token
6361

6462
```typescript
65-
import { Session, cloudApi, serviceClients } from '@yandex-cloud/nodejs-sdk';
66-
67-
const { resourcemanager: { cloud_service: { ListCloudsRequest } } } = cloudApi;
63+
import { Session } from '@yandex-cloud/nodejs-sdk';
64+
import { cloudService } from '@yandex-cloud/nodejs-sdk/resourcemanager-v1';
6865

6966
// Initialize SDK with your token
7067
const session = new Session({ iamToken: 'YOUR_TOKEN' });
7168

7269
// Create service client
73-
const cloudService = session.client(serviceClients.CloudServiceClient);
70+
const cloudServiceClient = session.client(cloudService.CloudServiceClient);
7471

7572
// Issue request (returns Promise)
76-
const response = await cloudService.list(ListCloudsRequest.fromPartial({
73+
const response = await cloudServiceClient.list(cloudService.ListCloudsRequest.fromPartial({
7774
pageSize: 100,
7875
}));
7976
```
@@ -87,46 +84,4 @@ npm i
8784
YC_OAUTH_TOKEN=... YC_FOLDER_ID=... npm run start path/to/example.ts
8885
```
8986

90-
## Services
91-
92-
* AI Translate;
93-
* AI Vision.
94-
* Application Load Balancer
95-
* Billing
96-
* Cloud CDN
97-
* Certificate Manager
98-
* Compute Cloud
99-
* Container Registry
100-
* Data Proc
101-
* DataSphere
102-
* Data Transfer
103-
* DNS
104-
* Identity and Access Management (IAM)
105-
* IoT Core
106-
* Managed Service for Kubernetes
107-
* Key Management Service (KMS)
108-
* Load Balancer
109-
* Lockbox
110-
* Logging
111-
* Managed DataBase
112-
* ClickHouse
113-
* ElasticSearch
114-
* Greenplum
115-
* Kafka
116-
* MongoDB
117-
* MySQL
118-
* PostgreSQL
119-
* Redis
120-
* MS SQL Server
121-
* Organization Manager
122-
* Resource Manager
123-
* Serverless
124-
* Functions
125-
* API Gateway
126-
* Containers
127-
* Triggers
128-
* MDB Proxy
129-
* Virtual Private Cloud (VPC)
130-
* Yandex Database (YDB)
131-
132-
If you need generated client for other Yandex.Cloud services, just open an issue.
87+
P.S If you need generated client for other Yandex.Cloud services, just open an issue.

0 commit comments

Comments
 (0)