Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Commit

Permalink
Restructure the package
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinitto committed Jun 4, 2019
1 parent 52aafe1 commit 173c324
Show file tree
Hide file tree
Showing 56 changed files with 37,559 additions and 39 deletions.
865 changes: 865 additions & 0 deletions docs/assets/css/main.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/assets/css/main.css.map

Large diffs are not rendered by default.

Binary file added docs/assets/images/icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/widgets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/assets/js/main.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/assets/js/search.js

Large diffs are not rendered by default.

1,286 changes: 1,286 additions & 0 deletions docs/classes/_account_index_.account.html

Large diffs are not rendered by default.

1,261 changes: 1,261 additions & 0 deletions docs/classes/_core_index_.baseproduct.html

Large diffs are not rendered by default.

1,283 changes: 1,283 additions & 0 deletions docs/classes/_sandboxapiuser_index_.sandboxapiuser.html

Large diffs are not rendered by default.

1,589 changes: 1,589 additions & 0 deletions docs/classes/_transaction_index_.transaction.html

Large diffs are not rendered by default.

1,056 changes: 1,056 additions & 0 deletions docs/enums/_account_types_.accounttypes.html

Large diffs are not rendered by default.

1,063 changes: 1,063 additions & 0 deletions docs/enums/_transaction_types_.receipienttypes.html

Large diffs are not rendered by default.

1,077 changes: 1,077 additions & 0 deletions docs/enums/_transaction_types_.resourceurls.html

Large diffs are not rendered by default.

1,091 changes: 1,091 additions & 0 deletions docs/enums/_transaction_types_.status.html

Large diffs are not rendered by default.

1,077 changes: 1,077 additions & 0 deletions docs/enums/_transaction_types_.transactionreceipienttypes.html

Large diffs are not rendered by default.

1,077 changes: 1,077 additions & 0 deletions docs/enums/_transaction_types_.transactiontypes.html

Large diffs are not rendered by default.

1,036 changes: 1,036 additions & 0 deletions docs/globals.html

Large diffs are not rendered by default.

1,037 changes: 1,037 additions & 0 deletions docs/index.html

Large diffs are not rendered by default.

1,106 changes: 1,106 additions & 0 deletions docs/interfaces/_account_types_.iaccountconfig.html

Large diffs are not rendered by default.

1,050 changes: 1,050 additions & 0 deletions docs/interfaces/_account_types_.iaccountdetails.html

Large diffs are not rendered by default.

1,072 changes: 1,072 additions & 0 deletions docs/interfaces/_core_types_.iapitoken.html

Large diffs are not rendered by default.

1,072 changes: 1,072 additions & 0 deletions docs/interfaces/_sandboxapiuser_types_.isandboxapiuserdetails.html

Large diffs are not rendered by default.

1,071 changes: 1,071 additions & 0 deletions docs/interfaces/_transaction_types_.irecepient.html

Large diffs are not rendered by default.

1,085 changes: 1,085 additions & 0 deletions docs/interfaces/_transaction_types_.istatus.html

Large diffs are not rendered by default.

1,141 changes: 1,141 additions & 0 deletions docs/interfaces/_transaction_types_.itransactionbody.html

Large diffs are not rendered by default.

1,253 changes: 1,253 additions & 0 deletions docs/interfaces/_transaction_types_.itransactionconfig.html

Large diffs are not rendered by default.

1,155 changes: 1,155 additions & 0 deletions docs/interfaces/_transaction_types_.itransactiondetails.html

Large diffs are not rendered by default.

1,218 changes: 1,218 additions & 0 deletions docs/interfaces/_utils_repository_.iresource.html

Large diffs are not rendered by default.

1,012 changes: 1,012 additions & 0 deletions docs/interfaces/_utils_repository_.iresourcesobject.html

Large diffs are not rendered by default.

1,004 changes: 1,004 additions & 0 deletions docs/modules/_account_index_.html

Large diffs are not rendered by default.

1,017 changes: 1,017 additions & 0 deletions docs/modules/_account_types_.html

Large diffs are not rendered by default.

1,004 changes: 1,004 additions & 0 deletions docs/modules/_core_index_.html

Large diffs are not rendered by default.

1,004 changes: 1,004 additions & 0 deletions docs/modules/_core_types_.html

Large diffs are not rendered by default.

988 changes: 988 additions & 0 deletions docs/modules/_index_.html

Large diffs are not rendered by default.

1,004 changes: 1,004 additions & 0 deletions docs/modules/_sandboxapiuser_index_.html

Large diffs are not rendered by default.

1,004 changes: 1,004 additions & 0 deletions docs/modules/_sandboxapiuser_types_.html

Large diffs are not rendered by default.

1,100 changes: 1,100 additions & 0 deletions docs/modules/_transaction_index_.html

Large diffs are not rendered by default.

1,045 changes: 1,045 additions & 0 deletions docs/modules/_transaction_types_.html

Large diffs are not rendered by default.

1,109 changes: 1,109 additions & 0 deletions docs/modules/_utils_repository_.html

Large diffs are not rendered by default.

178 changes: 178 additions & 0 deletions package-lock.json

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

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"version": "npm run format && npm run typedoc && git add -A src",
"postversion": "git push && git push --tags",
"typedoc": "typedoc --out docs src --theme minimal"
},
"repository": {
"type": "git",
Expand All @@ -39,6 +40,7 @@
"ts-jest": "^24.0.2",
"tslint": "^5.17.0",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.14.2",
"typescript": "^3.5.1"
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import axios from 'axios';
import Account from '../../utils/account/main';
import { IAccountConfig, AccountTypes } from '../../utils/account/types';
import Account, { IAccountConfig, AccountTypes } from '../account';

const testAllAccountTypes = (accountType: string) => {
describe(`Account type: ${accountType}`, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SandboxApiUser from '../../utils/sandboxApiUser';
import SandboxApiUser from '../sandboxApiUser';

describe('sandboxApiUser', () => {
it('requires process environment variables TEST_BASE_URL, TEST_SUBSCRIPTION_KEY', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { generate as uuidv4 } from 'uuidjs';
import Transaction, { transactionReceipientTypesMap, resourceUrlsMap } from '../../utils/transaction/main';
import { IRecepient, ITransactionConfig, Status, TransactionTypes } from '../../utils/transaction/types';
import Transaction, {
transactionReceipientTypesMap,
resourceUrlsMap,
IRecepient,
ITransactionConfig,
Status,
TransactionTypes,
} from '../transaction';

export const testAnyTransactionType = (transactionType: string, requestTimeout = 40000) => {
describe(`${transactionType}`, () => {
Expand Down
7 changes: 5 additions & 2 deletions src/utils/account/main.ts → src/account/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/// https://ericssonbasicapi2.azure-api.net/${accountType}/v1_0/account/balance

import getResources, { IResource } from '../repository';
import { BaseProduct } from '../sharedTypes';
import { BaseProduct } from '../core';
import getResources, { IResource } from '../utils/repository';
import { IAccountConfig, IAccountDetails } from './types';


export * from './types';

/**
* @class Account()
* Details about the account
Expand Down
File renamed without changes.
12 changes: 3 additions & 9 deletions src/utils/sharedTypes.ts → src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import getResources, { IResource } from './repository';
import getResources, { IResource } from '../utils/repository';
import { IApiToken } from './types';

/// Shared Types

export interface IApiToken {
accessToken: string;
tokenType: string;
expiresIn: number;
createdAt: Date;
}
export * from './types';

/**
* Base class for all products including account,
Expand Down
6 changes: 6 additions & 0 deletions src/core/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface IApiToken {
accessToken: string;
tokenType: string;
expiresIn: number;
createdAt: Date;
}
14 changes: 4 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
// import PaymentRequest from './utils/paymentRequest';
// export default class MtnPay {

// public paymentRequests: PaymentRequest;

// // set up the default configs and then merge all the different products as properties
// constructor({ defaultPartyIdType = 'MSISDN',
// }: { defaultPartyIdType?: string }) { }

// }
export * from './transaction';
export * from './account';
export * from './core';
export * from './sandboxApiUser';
10 changes: 3 additions & 7 deletions src/utils/sandboxApiUser.ts → src/sandboxApiUser/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
/// https://ericssonbasicapi2.azure-api.net/v1_0/apiuser

import { generate as uuidv4 } from 'uuidjs';
import getResources, { IResource } from './repository';
import getResources, { IResource } from '../utils/repository';
import { ISandboxApiUserDetails } from './types';

export interface ISandboxApiUserDetails {
apiKey: string;
providerCallbackHost: string;
targetEnvironment: string;
referenceId: string;
}
export * from './types';

/**
* @class SandboxApiUser
Expand Down
6 changes: 6 additions & 0 deletions src/sandboxApiUser/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface ISandboxApiUserDetails {
apiKey: string;
providerCallbackHost: string;
targetEnvironment: string;
referenceId: string;
}
Loading

0 comments on commit 173c324

Please sign in to comment.