Skip to content

Commit

Permalink
Merge pull request #44 from qonversion/release/0.2.0
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
SpertsyanKM authored Sep 30, 2022
2 parents e1b6805 + a7dea39 commit 8ac45da
Show file tree
Hide file tree
Showing 44 changed files with 1,445 additions and 1,407 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sdk/build
sdk/src/__tests__
babel.config.js
File renamed without changes.
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:

- name: Build typescript
run: |
cd sdk/
yarn
yarn build
Expand All @@ -26,7 +25,6 @@ jobs:

- name: Publish to npm
run: |
cd sdk/
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
.idea
.idea

# OSX
#
.DS_Store

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

build/

# BUCK
buck-out/
\.buckd/
*.keystore

# vscode
.vscode
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
default_platform(:mac)

def update_package_json(new_version)
path = "../sdk/package.json"
path = "../package.json"
regex = /"version": ".*",/
result_value = "\"version\": \"#{new_version}\","

Expand Down
2 changes: 1 addition & 1 deletion fastlane/report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@



<testcase classname="fastlane.lanes" name="0: default_platform" time="0.090207">
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.099549">

</testcase>

Expand Down
8 changes: 4 additions & 4 deletions sdk/package.json → package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@qonversion/web-sdk",
"title": "Qonversion Web SDK",
"version": "0.1.4",
"version": "0.2.0",
"description": "Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation. Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and content using our Stripe wrapper, StoreKit wrapper and Google Play Billing wrapper.",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "sdk/build/index.js",
"types": "sdk/build/index.d.ts",
"files": [
"/build"
"sdk/build"
],
"scripts": {
"build": "yarn tsc",
Expand Down
2 changes: 0 additions & 2 deletions sdk/.eslintignore

This file was deleted.

45 changes: 0 additions & 45 deletions sdk/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/src/QonversionConfigBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {LogLevel} from './dto/LogLevel';
import {LoggerConfig, NetworkConfig, PrimaryConfig, QonversionConfig} from './types';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const packageJson = require('../package.json');
const packageJson = require('../../package.json');
const DEFAULT_LOG_TAG = "Qonversion";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {expectQonversionError} from './utils';
import Qonversion, {QonversionConfig, QonversionErrorCode} from '../src';
import {QonversionInternal} from '../src/internal';
import Qonversion, {QonversionConfig, QonversionErrorCode} from '../index';
import {QonversionInternal} from '../internal';

jest.mock('../src/internal/QonversionInternal');
jest.mock('../internal/QonversionInternal');

test('get non-initialized backing instance', () => {
// given
Expand All @@ -14,8 +14,11 @@ test('get non-initialized backing instance', () => {
test('initialize and get shared instance', () => {
// given
const mockQonversionConfig: QonversionConfig = {
// @ts-ignore
loggerConfig: undefined,
// @ts-ignore
networkConfig: undefined,
// @ts-ignore
primaryConfig: undefined,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
QonversionConfig,
QonversionConfigBuilder,
QonversionErrorCode
} from '../src';
import {LoggerConfig, NetworkConfig, PrimaryConfig} from "../src/types";
} from '../index';
import {LoggerConfig, NetworkConfig, PrimaryConfig} from "../types";
import {expectQonversionError} from './utils';

const packageJson = require('../package.json');
const packageJson = require('../../../package.json');

test('constructor', () => {
// given
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UserPropertiesBuilder} from '../src';
import {UserPropertiesBuilder} from '../index';

let builder: UserPropertiesBuilder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {LoggerConfig, NetworkConfig, PrimaryConfig, QonversionConfig} from '../../src/types';
import {Environment, LogLevel} from '../../src';
import {LoggerConfig, NetworkConfig, PrimaryConfig, QonversionConfig} from '../../types';
import {Environment, LogLevel} from '../../index';
import {
InternalConfig,
EnvironmentProvider,
LoggerConfigProvider,
NetworkConfigHolder,
PrimaryConfigProvider
} from '../../src/internal';
} from '../../internal';

let primaryConfig: PrimaryConfig;
let networkConfig: NetworkConfig;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {QonversionInternal, InternalConfig} from '../../src/internal';
import {DependenciesAssembly} from '../../src/internal/di/DependenciesAssembly';
import {LoggerConfig, NetworkConfig, PrimaryConfig} from '../../src/types';
import {QonversionInternal, InternalConfig} from '../../internal';
import {DependenciesAssembly} from '../../internal/di/DependenciesAssembly';
import {LoggerConfig, NetworkConfig, PrimaryConfig} from '../../types';
import Qonversion, {
Entitlement,
Environment,
Expand All @@ -9,15 +9,15 @@ import Qonversion, {
StripeStoreData,
UserProperty,
UserPurchase,
} from '../../src';
import {UserPropertiesController, UserPropertiesControllerImpl} from '../../src/internal/userProperties';
import {UserController} from '../../src/internal/user';
import {EntitlementsController, EntitlementsControllerImpl} from '../../src/internal/entitlements';
import {PurchasesController, PurchasesControllerImpl} from '../../src/internal/purchases';
import {Logger} from '../../src/internal/logger';

jest.mock('../../src/internal/di/DependenciesAssembly', () => {
const originalModule = jest.requireActual('../../src/internal/di/DependenciesAssembly');
} from '../../index';
import {UserPropertiesController} from '../../internal/userProperties';
import {UserController} from '../../internal/user';
import {EntitlementsController, EntitlementsControllerImpl} from '../../internal/entitlements';
import {PurchasesController, PurchasesControllerImpl} from '../../internal/purchases';
import {Logger} from '../../internal/logger';

jest.mock('../../internal/di/DependenciesAssembly', () => {
const originalModule = jest.requireActual('../../internal/di/DependenciesAssembly');
return {__esModule: true, ...originalModule};
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {LocalStorage, LocalStorageImpl} from '../../../src/internal/common';
import {LocalStorage, LocalStorageImpl} from '../../../internal/common';

let savedJSON;
let savedJSON: JSON;

beforeAll(() => {
savedJSON = JSON;
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('local storage tests', () => {

test('get int from undefined string', () => {
// given
localStorage.getItem = jest.fn(() => undefined);
localStorage.getItem = jest.fn(() => null);

// when
const res = myLocalStorage.getInt(testKey);
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('local storage tests', () => {

test('get float from undefined string', () => {
// given
localStorage.getItem = jest.fn(() => undefined);
localStorage.getItem = jest.fn(() => null);

// when
const res = myLocalStorage.getFloat(testKey);
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('local storage tests', () => {

test('get object from undefined string', () => {
// given
localStorage.getItem = jest.fn(() => undefined);
localStorage.getItem = jest.fn(() => null);

// when
const res = myLocalStorage.getObject(testKey);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {UserControllerImpl, UserDataStorage} from '../../../src/internal/user';
import {Logger} from '../../../src/internal/logger';
import {EntitlementsController, EntitlementsService, EntitlementsControllerImpl} from '../../../src/internal/entitlements';
import {Entitlement, QonversionError, QonversionErrorCode} from '../../../src';
import {UserControllerImpl, UserDataStorage} from '../../../internal/user';
import {Logger} from '../../../internal/logger';
import {EntitlementsController, EntitlementsService, EntitlementsControllerImpl} from '../../../internal/entitlements';
import {Entitlement, QonversionError, QonversionErrorCode} from '../../../index';

let entitlementsService: EntitlementsService;
let userDataStorage: UserDataStorage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ import {
NetworkRequest,
NetworkResponseError,
NetworkResponseSuccess
} from '../../../src/internal/network';
import {Entitlement, PeriodType, QonversionError, QonversionErrorCode, RenewState} from '../../../src';
import {HTTP_CODE_NOT_FOUND} from '../../../src/internal/network/constants';
} from '../../../internal/network';
import {
Entitlement,
EntitlementSource,
PeriodType,
QonversionError,
QonversionErrorCode,
RenewState
} from '../../../index';
import {HTTP_CODE_NOT_FOUND} from '../../../internal/network/constants';
import {
EntitlementApi,
EntitlementsResponse,
EntitlementsService,
EntitlementsServiceImpl
} from '../../../src/internal/entitlements';
} from '../../../internal/entitlements';

let requestConfigurator: RequestConfigurator;
let apiInteractor: ApiInteractor;
Expand All @@ -24,6 +31,7 @@ const apiEntitlement: EntitlementApi = {
started: 10,
expires: 100,
id: 'test entitlement',
source: 'stripe',
product: {
product_id: 'test product',
subscription: {
Expand Down Expand Up @@ -56,6 +64,7 @@ const expRes: Entitlement[] = [{
started: 10,
expires: 100,
id: 'test entitlement',
source: EntitlementSource.Stripe,
product: {
productId: 'test product',
subscription: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {LoggerConfigProvider} from '../../../src/internal';
import {LogLevel} from '../../../src';
import LoggerImpl from '../../../src/internal/logger';
import {LoggerConfigProvider} from '../../../internal';
import {LogLevel} from '../../../index';
import LoggerImpl from '../../../internal/logger';

const testLogTag = 'tag';
let allowedLogLevel = LogLevel.Disabled;
Expand Down
Loading

0 comments on commit 8ac45da

Please sign in to comment.