Skip to content

Commit

Permalink
Merge pull request #12 from affinidi/feat/update-client-dcf
Browse files Browse the repository at this point in the history
feat: update client dcf
  • Loading branch information
maratsh authored Feb 5, 2024
2 parents 120d334 + 6d8b7d3 commit 8f7a954
Show file tree
Hide file tree
Showing 16 changed files with 7,576 additions and 0 deletions.
35 changes: 35 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-dcf/.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-dcf/.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-dcf/.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-dcf/.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-dcf/.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-dcf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## @affinidi/test-sdk-client-dcf

### Usage

```bash
npm install @affinidi/test-sdk-client-dcf --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-dcf';
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}/dcf`,
})
);

await api.oneOfMethods();
```

#### With session ID via BFF

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

const headers = getBffHeaders(cookieName, sessionId);

const baseOptions = { headers };

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

await api.oneOfMethods();
```
Loading

0 comments on commit 8f7a954

Please sign in to comment.