Skip to content

Commit

Permalink
Initial Repo Seed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Wenger committed Feb 14, 2024
0 parents commit df459d6
Show file tree
Hide file tree
Showing 84 changed files with 14,825 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish package to npm

on:
release:
types: [published]

jobs:
publish-npm:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run build
# Run Integration tests for the API code
- run: npm run test --username=${{ secrets.API_USERNAME }} --password=${{ secrets.API_PASSWORD }}
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: cp ./README.md ./dist/README.md
- run: cp ./package.json ./dist/package.json
- run: npm publish ./dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This is a basic workflow to help you get started with Actions

name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-package:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- run: npm ci
- run: npm run test --username=${{ secrets.API_USERNAME }} --password=${{ secrets.API_PASSWORD }}

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wwwroot/*.js
node_modules
typings
dist
.env
.vscode
*.log
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
23 changes: 23 additions & 0 deletions .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
58 changes: 58 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.gitignore
.npmignore
README.md
package.json
src/apis/AppApi.ts
src/apis/DeviceApi.ts
src/apis/EntitlementApi.ts
src/apis/FeatureApi.ts
src/apis/GrantApi.ts
src/apis/GroupApi.ts
src/apis/OrganizationApi.ts
src/apis/PermissionApi.ts
src/apis/ResourceApi.ts
src/apis/RoleApi.ts
src/apis/SystemApi.ts
src/apis/TenantApi.ts
src/apis/UserApi.ts
src/apis/index.ts
src/index.ts
src/models/App.ts
src/models/AppList.ts
src/models/Aspect.ts
src/models/Contact.ts
src/models/ContactEmails.ts
src/models/ContactName.ts
src/models/ContactPhoneNumbers.ts
src/models/Device.ts
src/models/DeviceList.ts
src/models/Entitlement.ts
src/models/EntitlementList.ts
src/models/Feature.ts
src/models/FeatureList.ts
src/models/Grant.ts
src/models/GrantList.ts
src/models/Group.ts
src/models/GroupList.ts
src/models/Instance.ts
src/models/InstanceMeta.ts
src/models/Organization.ts
src/models/OrganizationList.ts
src/models/Permission.ts
src/models/PermissionList.ts
src/models/Reference.ts
src/models/Resource.ts
src/models/ResourceList.ts
src/models/Role.ts
src/models/RoleList.ts
src/models/System.ts
src/models/SystemList.ts
src/models/Tag.ts
src/models/Tenant.ts
src/models/TenantList.ts
src/models/User.ts
src/models/UserList.ts
src/models/VersionError.ts
src/models/index.ts
src/runtime.ts
tsconfig.json
1 change: 1 addition & 0 deletions .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.4.0
170 changes: 170 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
## [email protected]

This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). 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 should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))

### Consuming

navigate to the folder of your consuming project and run one of the following commands.

_published:_

```
npm install [email protected] --save
```

_unPublished (not recommended):_

```
npm install PATH_TO_GENERATED_PACKAGE --save
```

<a name="getting-started"></a>
## Getting Started

```typescript
import * as AvalaraSdk from 'avalara-sdk';

const configParams: AvalaraSdk.Runtime.ConfigurationParameters = {
appName: 'asv-sdk-test-app',
appVersion: '1.0',
environment: AvaTaxEnvironment.Sandbox,
machineName: 'test-machine',
timeout:3000,
bearerToken: '<YOUR BEARER TOKEN>',
testBasePath: 'https://localhost:3000'
};
const config = new AvalaraSdk.Runtime.Configuration(configParams);
let client = new AvalaraSdk.Runtime.ApiClient(config);
let api = new AvalaraSdk.Avatax.V2.UtilitiesApi(client);
const result = await api.ping();

```

<a name="documentation-for-authorization"></a>
## Documentation for Authorization

<a name="OAuth Client Credentials Flow"></a>
### OAuth Client Credentials

- **Type**: OAuth
- **Flow**: client_credentials
- **Scopes**:
- avatax_api: avatax_api scope.

```typescript
import * as AvalaraSdk from 'avalara-sdk';

const configParams: Runtime.ConfigurationParameters = {
appName: 'asv-sdk-test-app',
appVersion: '1.0',
environment: AvaTaxEnvironment.Sandbox,
machineName: 'test-machine',
timeout:3000,
clientId: '<YOUR CLIENT ID>',
clientSecret: '<YOUR CLIENT SECRET>',
testBasePath: 'https://localhost:3000'
};
const config = new AvalaraSdk.Runtime.Configuration(configParams);
let client = new AvalaraSdk.Runtime.ApiClient(config);
// Client ID and Client Secret will be used to perform client credentials flow prior to making the request.
// Bearer token will be appended to the Authorization header.
let api = new AvalaraSdk.Avatax.V2.UtilitiesApi(client);
const result = await api.ping();
```

<a name="OAuth Device Code Flow"></a>
### OAuth Device Code

- **Type**: OAuth
- **Flow**: device_code
- **Scopes**:
- avatax_api: avatax_api scope.

```typescript
import * as AvalaraSdk from 'avalara-sdk';

const configParams: Runtime.ConfigurationParameters = {
appName: 'asv-sdk-test-app',
appVersion: '1.0',
environment: AvaTaxEnvironment.Sandbox,
machineName: 'test-machine',
timeout:3000,
clientId: '<YOUR AVALARA IDENTITY CLIENT ID>',
testBasePath: 'https://localhost:3000'
};
const config = new AvalaraSdk.Runtime.Configuration(configParams);
// Pass in the scope (avatax_api in this instance), and the configuration object, clientID is a required property for the flow.
// Fetches the device code and verification url required for the user part of the flow (where they open the URI in their web browser and authenticate)
const response = await OAuthHelper.initiateDeviceAuthorizationFlow('avatax_api', config);
// User Interaction needs to happen here - some polling logic is needed to wait for offline user to authenticate to verification_uri through browser
// Once completed, bearer token will be returned.
const tokenResponse = await OAuthHelper.getAccessTokenForDeviceFlow(response.deviceCode, config);
// Add bearer token into the configuration options.
configuration.bearerToken = tokenResponse.accessToken;
let client = new AvalaraSdk.Runtime.ApiClient(config);
// Provided bearer token will be appended to Authorization header for each request.
let api = new AvalaraSdk.Avatax.V2.UtilitiesApi(client);
const result = await api.ping();

```
<a name="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints

<a name="documentation-for-EInvoicing-V1-api-endpoints"></a>
### EInvoicing V1 API Documentation

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DataInputFieldsApi* | [**getDataInputFields**](docs/EInvoicing/V1/DataInputFieldsApi.md#getdatainputfields) | **GET** /data-input-fields | Returns the mandatory and conditional invoice or creditnote input fields for different country mandates
*DocumentsApi* | [**downloadDocument**](docs/EInvoicing/V1/DocumentsApi.md#downloaddocument) | **GET** /documents/{documentId}/$download | Returns a copy of the document
*DocumentsApi* | [**getDocumentList**](docs/EInvoicing/V1/DocumentsApi.md#getdocumentlist) | **GET** /documents | Returns a summary of documents for a date range
*DocumentsApi* | [**getDocumentStatus**](docs/EInvoicing/V1/DocumentsApi.md#getdocumentstatus) | **GET** /document/{documentId}/status | Checks the status of a document
*DocumentsApi* | [**submitDocument**](docs/EInvoicing/V1/DocumentsApi.md#submitdocument) | **POST** /documents | Submits a document to Avalara E-Invoicing API
*MandatesApi* | [**getMandates**](docs/EInvoicing/V1/MandatesApi.md#getmandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform

<a name="documentation-for-models"></a>
## Documentation for Models

<a name="documentation-for-EInvoicing-V1-models"></a>
### EInvoicing V1 Model Documentation

- [EInvoicing.V1.BadDownloadRequest](docs/EInvoicing/V1/BadDownloadRequest.md)
- [EInvoicing.V1.BadRequest](docs/EInvoicing/V1/BadRequest.md)
- [EInvoicing.V1.ConditionalForField](docs/EInvoicing/V1/ConditionalForField.md)
- [EInvoicing.V1.DataInputField](docs/EInvoicing/V1/DataInputField.md)
- [EInvoicing.V1.DataInputFieldNotUsedFor](docs/EInvoicing/V1/DataInputFieldNotUsedFor.md)
- [EInvoicing.V1.DataInputFieldOptionalFor](docs/EInvoicing/V1/DataInputFieldOptionalFor.md)
- [EInvoicing.V1.DataInputFieldRequiredFor](docs/EInvoicing/V1/DataInputFieldRequiredFor.md)
- [EInvoicing.V1.DataInputFieldsResponse](docs/EInvoicing/V1/DataInputFieldsResponse.md)
- [EInvoicing.V1.DocumentListResponse](docs/EInvoicing/V1/DocumentListResponse.md)
- [EInvoicing.V1.DocumentStatusResponse](docs/EInvoicing/V1/DocumentStatusResponse.md)
- [EInvoicing.V1.DocumentSubmissionError](docs/EInvoicing/V1/DocumentSubmissionError.md)
- [EInvoicing.V1.DocumentSubmitResponse](docs/EInvoicing/V1/DocumentSubmitResponse.md)
- [EInvoicing.V1.DocumentSummary](docs/EInvoicing/V1/DocumentSummary.md)
- [EInvoicing.V1.ForbiddenError](docs/EInvoicing/V1/ForbiddenError.md)
- [EInvoicing.V1.InputDataFormats](docs/EInvoicing/V1/InputDataFormats.md)
- [EInvoicing.V1.InternalServerError](docs/EInvoicing/V1/InternalServerError.md)
- [EInvoicing.V1.Mandate](docs/EInvoicing/V1/Mandate.md)
- [EInvoicing.V1.MandatesResponse](docs/EInvoicing/V1/MandatesResponse.md)
- [EInvoicing.V1.NotFoundError](docs/EInvoicing/V1/NotFoundError.md)
- [EInvoicing.V1.NotUsedForField](docs/EInvoicing/V1/NotUsedForField.md)
- [EInvoicing.V1.RequiredWhenField](docs/EInvoicing/V1/RequiredWhenField.md)
- [EInvoicing.V1.StatusEvent](docs/EInvoicing/V1/StatusEvent.md)
- [EInvoicing.V1.SubmitDocumentData](docs/EInvoicing/V1/SubmitDocumentData.md)
- [EInvoicing.V1.SubmitDocumentMetadata](docs/EInvoicing/V1/SubmitDocumentMetadata.md)
- [EInvoicing.V1.WorkflowIds](docs/EInvoicing/V1/WorkflowIds.md)
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['@babel/preset-env']
}
13 changes: 13 additions & 0 deletions docs/EInvoicing/V1/BadDownloadRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# AvalaraSdk.EInvoicing.V1.BadDownloadRequest
Returns an HTTP status code and message for a \'bad request\'

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | **string** | The three-digit HTTP error code for the bad request | [optional] [default to undefined]
**message** | **string** | A message explaining the bad request | [optional] [default to undefined]
**supportedAcceptHeaders** | **object** | A message explaining the bad request | [optional] [default to undefined]

[[Back to Model list]](../../../README.md#documentation-for-models) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../README.md)

12 changes: 12 additions & 0 deletions docs/EInvoicing/V1/BadRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AvalaraSdk.EInvoicing.V1.BadRequest
Returns an HTTP status code and message for a \'bad request\'

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | **string** | The three-digit HTTP error code for the bad request | [optional] [default to undefined]
**message** | **string** | A message explaining the bad request | [optional] [default to undefined]

[[Back to Model list]](../../../README.md#documentation-for-models) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../README.md)

12 changes: 12 additions & 0 deletions docs/EInvoicing/V1/ConditionalForField.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AvalaraSdk.EInvoicing.V1.ConditionalForField
Mandates for which this field is conditional

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**countryMandate** | **string** | | [optional] [default to undefined]
**requiredWhen** | [**Array&lt;RequiredWhenField&gt;**](RequiredWhenField.md) | Array of scenarios which describe when a particular field is conditional for a country mandate | [optional] [default to undefined]

[[Back to Model list]](../../../README.md#documentation-for-models) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../README.md)

25 changes: 25 additions & 0 deletions docs/EInvoicing/V1/DataInputField.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# AvalaraSdk.EInvoicing.V1.DataInputField
The Data Input Field

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | Field UUID | [optional] [default to undefined]
**fieldId** | **string** | Field ID | [optional] [default to undefined]
**applicableDocumentRoots** | **Array&lt;object&gt;** | | [optional] [default to undefined]
**path** | **string** | Path to this field | [optional] [default to undefined]
**nameSpace** | **string** | Namespace of this field | [optional] [default to undefined]
**fieldName** | **string** | Field name | [optional] [default to undefined]
**exampleOrFixedValue** | **string** | An example of the content for this field | [optional] [default to undefined]
**acceptedValues** | **object** | An object representing the acceptable values for this field | [optional] [default to undefined]
**documentationLink** | **string** | An example of the content for this field | [optional] [default to undefined]
**description** | **string** | A description of this field | [optional] [default to undefined]
**isSegment** | **boolean** | Is this a segment of the schema | [optional] [default to undefined]
**requiredFor** | [**DataInputFieldRequiredFor**](DataInputFieldRequiredFor.md) | | [optional] [default to undefined]
**conditionalFor** | [**Array&lt;ConditionalForField&gt;**](ConditionalForField.md) | | [optional] [default to undefined]
**notUsedFor** | [**DataInputFieldNotUsedFor**](DataInputFieldNotUsedFor.md) | | [optional] [default to undefined]
**optionalFor** | [**DataInputFieldOptionalFor**](DataInputFieldOptionalFor.md) | | [optional] [default to undefined]

[[Back to Model list]](../../../README.md#documentation-for-models) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../README.md)

Loading

0 comments on commit df459d6

Please sign in to comment.