Skip to content

Commit

Permalink
feat: update client vpa
Browse files Browse the repository at this point in the history
  • Loading branch information
maratsh committed Feb 2, 2024
1 parent 37010fe commit 13130a9
Show file tree
Hide file tree
Showing 16 changed files with 7,671 additions and 0 deletions.
38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions packages/sdk-client-vpa/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# dependencies
node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
wwwroot/*.js
dist

# System Files
.DS_Store
Thumbs.db

# other
.env
.env.production
.npmrc
.nyc_output
coverage
10 changes: 10 additions & 0 deletions packages/sdk-client-vpa/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm

node_modules
coverage
.vscode
.DS_Store
.nyc_output
.history
.idea
Thumbs.db
23 changes: 23 additions & 0 deletions packages/sdk-client-vpa/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
13 changes: 13 additions & 0 deletions packages/sdk-client-vpa/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.gitignore
.npmignore
.openapi-generator-ignore
README.md
api.ts
base.ts
common.ts
configuration.ts
git_push.sh
index.ts
package.json
tsconfig.esm.json
tsconfig.json
1 change: 1 addition & 0 deletions packages/sdk-client-vpa/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.2.0
53 changes: 53 additions & 0 deletions packages/sdk-client-vpa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## @affinidi/test-sdk-client-vpa

### Usage

```bash
npm install @affinidi/test-sdk-client-vpa --save
```

#### With PAT

To call service methods with personal access token, you need to get a getProjectScopedToken for the machine user:

```ts
import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-vpa';
import { authProvider } from '@affinidi/test-auth-provider';

const projectScopedToken = await authProvider.getProjectScopedToken({
apiGatewayUrl,
projectId,
machineUserId,
tokenEndpoint,
privateKey,
passphrase,
keyId,
publicKey,
});

const api = new SomeClassApi(
new Configuration({
apiKey: projectScopedToken,
basePath: `${apiGatewayUrl}/vpa`,
})
);

await api.oneOfMethods();
```

#### With session ID via BFF

```ts
import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-vpa';
import { getBffHeaders } from '@affinidi/test-auth-provider';

const headers = getBffHeaders(cookieName, sessionId);

const baseOptions = { headers };

const api = new SomeClassApi(
new Configuration({ basePath: `${bffHost}/vpa`, baseOptions })
);

await api.oneOfMethods();
```
Loading

0 comments on commit 13130a9

Please sign in to comment.