@affinidi-tdk/iota-client
v1.45.0
Published
Affinidi TDK typescript client for Affinidi IOTA
Readme
@affinidi-tdk/[email protected]
This generator creates TypeScript/JavaScript client that utilizes axios. The generated Node module can be used in the following environments:
Environment
- Node.js
- Webpack
- Browserify
Language level
- ES5 - you must have a Promises/A+ library installed
- ES6
Module system
- CommonJS
- ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via package.json. (Reference)
Building
To build and compile the typescript sources to javascript use:
npm install
npm run buildPublishing
First build the package then run npm publish
Consuming
navigate to the folder of your consuming project and run one of the following commands.
published:
npm install @affinidi-tdk/[email protected] --saveunPublished (not recommended):
npm install PATH_TO_GENERATED_PACKAGE --saveDocumentation for API Endpoints
All URIs are relative to https://apse1.api.affinidi.io/ais
| Class | Method | HTTP request | Description | | ------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------- | | CallbackApi | iotOIDC4VPCallback | POST /v1/callback | | ConfigurationsApi | createIotaConfiguration | POST /v1/configurations | | ConfigurationsApi | deleteIotaConfigurationById | DELETE /v1/configurations/{configurationId} | | ConfigurationsApi | getIotaConfigurationById | GET /v1/configurations/{configurationId} | | ConfigurationsApi | getIotaConfigurationMetaData | GET /v1/projects/{projectId}/configurations/{configurationId}/metadata | | ConfigurationsApi | listIotaConfigurations | GET /v1/configurations | | ConfigurationsApi | updateIotaConfigurationById | PATCH /v1/configurations/{configurationId} | | DcqlQueryApi | createDcqlQuery | POST /v1/configurations/{configurationId}/dcql-queries | | DcqlQueryApi | deleteDcqlQueryById | DELETE /v1/configurations/{configurationId}/dcql-queries/{queryId} | | DcqlQueryApi | getDcqlQueryById | GET /v1/configurations/{configurationId}/dcql-queries/{queryId} | | DcqlQueryApi | listDcqlQueries | GET /v1/configurations/{configurationId}/dcql-queries | | DcqlQueryApi | updateDcqlQueryById | PATCH /v1/configurations/{configurationId}/dcql-queries/{queryId} | | DefaultApi | listLoggedConsents | GET /v1/logged-consents | | IotaApi | awsExchangeCredentials | POST /v1/aws-exchange-credentials | | IotaApi | awsExchangeCredentialsProjectToken | POST /v1/aws-exchange-credentials/project-token | | IotaApi | fetchIotaVpResponse | POST /v1/fetch-iota-response | | IotaApi | initiateDataSharingRequest | POST /v1/initiate-data-sharing-request | | IotaApi | iotaExchangeCredentials | POST /v1/exchange-credentials | | PexQueryApi | createPexQuery | POST /v1/configurations/{configurationId}/pex-queries | | PexQueryApi | deletePexQueries | POST /v1/configurations/{configurationId}/delete-queries | | PexQueryApi | deletePexQueryById | DELETE /v1/configurations/{configurationId}/pex-queries/{queryId} | | PexQueryApi | getPexQueryById | GET /v1/configurations/{configurationId}/pex-queries/{queryId} | | PexQueryApi | listPexQueries | GET /v1/configurations/{configurationId}/pex-queries | | PexQueryApi | savePexQueries | POST /v1/configurations/{configurationId}/save-queries | | PexQueryApi | updatePexQueryById | PATCH /v1/configurations/{configurationId}/pex-queries/{queryId} |
Documentation For Models
- AlreadyExistsError
- AwsExchangeCredentials
- AwsExchangeCredentialsOK
- AwsExchangeCredentialsProjectToken
- AwsExchangeCredentialsProjectTokenOK
- AwsExchangeCredentialsProjectTokenOKCredentials
- CallbackInput
- CallbackResponseOK
- ConsentDto
- CorsAwsExchangeCredentialsOK
- CorsAwsExchangeCredentialsProjectTokenOK
- CorsFetchIotaVpResponseOK
- CorsInitiateDataSharingRequestOK
- CorsIotOidc4vpcallbackOK
- CorsIotaExchangeCredentialsOK
- CreateDcqlQueryInput
- CreateIotaConfigurationInput
- CreatePexQueryInput
- DcqlQueryDto
- DeletePexQueriesInput
- FetchIOTAVPResponseInput
- FetchIOTAVPResponseOK
- GetIotaConfigurationMetaDataOK
- InitiateDataSharingRequestInput
- InitiateDataSharingRequestOK
- InitiateDataSharingRequestOKData
- InvalidParameterError
- InvalidParameterErrorDetailsInner
- IotaConfigurationDto
- IotaConfigurationDtoClientMetadata
- IotaExchangeCredentials
- IotaExchangeCredentialsOK
- IotaExchangeCredentialsOKCredentials
- ListConfigurationOK
- ListDcqlQueriesOK
- ListLoggedConsentsOK
- ListPexQueriesOK
- MessagePublishingError
- NotFoundError
- OperationForbiddenError
- PexQueryDto
- PrepareRequest
- PrepareRequestCreated
- PrepareRequestCreatedData
- ResourceLimitExceededError
- SavePexQueriesUpdateInput
- SavePexQueriesUpdateInputQueriesInner
- UpdateConfigurationByIdInput
- UpdateConfigurationByIdOK
- UpdateDcqlQueryInput
- UpdatePexQueryInput
- VPTokenValidationError
Documentation For Authorization
Authentication schemes defined for the API:
AwsSigV4
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
ApiKey
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
bearerAuth
- Type: Bearer authentication (JWT)
ConsumerTokenAuth
- Type: API key
- API key parameter name: authorization
- Location: HTTP header
UserTokenAuth
- Type: API key
- API key parameter name: authorization
- Location: HTTP header
ProjectTokenAuth
- Type: API key
- API key parameter name: authorization
- Location: HTTP header
HeritageTokenAuth
- Type: API key
- API key parameter name: authorization
- Location: HTTP header
Obtaining auth token
💡 To create personal access token (PAT), use Affinidi CLI's create-token command.
Login to your Affinidi Vault.
affinidi loginCheck for command details if you want to set optional passphrase and keyId:
affinidi token --helpCreate PAT:
affinidi token create-token -n YourTokenName -g -w --no-inputThis command will return you variables to initialize AuthProvider as required below.
import { SomeClassApi, Configuration } from '@affinidi-tdk/iota-client'
import { AuthProvider } from '@affinidi-tdk/auth-provider'
const authProvider = new AuthProvider({ tokenId, privateKey, projectId })
const api = new SomeClassApi(
new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider),
}),
)
await api.oneOfMethods()