mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
Compare commits
6 Commits
auto-subsc
...
v0.16.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56b40ad4cb | ||
|
|
9b6f934990 | ||
|
|
80e3522f8a | ||
|
|
7975643765 | ||
|
|
2ac7f86bdb | ||
|
|
60248ec3f6 |
@@ -96,7 +96,6 @@ PLAID_LINK_WEBHOOK=
|
|||||||
PLAID_SANDBOX_REDIRECT_URI=
|
PLAID_SANDBOX_REDIRECT_URI=
|
||||||
PLAID_DEVELOPMENT_REDIRECT_URI=
|
PLAID_DEVELOPMENT_REDIRECT_URI=
|
||||||
|
|
||||||
|
|
||||||
# https://docs.lemonsqueezy.com/guides/developer-guide/getting-started#create-an-api-key
|
# https://docs.lemonsqueezy.com/guides/developer-guide/getting-started#create-an-api-key
|
||||||
LEMONSQUEEZY_API_KEY=
|
LEMONSQUEEZY_API_KEY=
|
||||||
LEMONSQUEEZY_STORE_ID=
|
LEMONSQUEEZY_STORE_ID=
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@casl/ability": "^5.4.3",
|
"@casl/ability": "^5.4.3",
|
||||||
"@hapi/boom": "^7.4.3",
|
"@hapi/boom": "^7.4.3",
|
||||||
|
"@lemonsqueezy/lemonsqueezy.js": "^2.2.0",
|
||||||
"@types/i18n": "^0.8.7",
|
"@types/i18n": "^0.8.7",
|
||||||
"@types/knex": "^0.16.1",
|
"@types/knex": "^0.16.1",
|
||||||
"@types/mathjs": "^6.0.12",
|
"@types/mathjs": "^6.0.12",
|
||||||
@@ -89,17 +90,17 @@
|
|||||||
"objection-filter": "^4.0.1",
|
"objection-filter": "^4.0.1",
|
||||||
"objection-soft-delete": "^1.0.7",
|
"objection-soft-delete": "^1.0.7",
|
||||||
"objection-unique": "^1.2.2",
|
"objection-unique": "^1.2.2",
|
||||||
|
"plaid": "^10.3.0",
|
||||||
"pluralize": "^8.0.0",
|
"pluralize": "^8.0.0",
|
||||||
"pug": "^3.0.2",
|
"pug": "^3.0.2",
|
||||||
"puppeteer": "^10.2.0",
|
"puppeteer": "^10.2.0",
|
||||||
"plaid": "^10.3.0",
|
|
||||||
"qim": "0.0.52",
|
"qim": "0.0.52",
|
||||||
"ramda": "^0.27.1",
|
"ramda": "^0.27.1",
|
||||||
"rate-limiter-flexible": "^2.1.14",
|
"rate-limiter-flexible": "^2.1.14",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"rtl-detect": "^1.0.4",
|
"rtl-detect": "^1.0.4",
|
||||||
"source-map-loader": "^4.0.1",
|
|
||||||
"socket.io": "^4.7.4",
|
"socket.io": "^4.7.4",
|
||||||
|
"source-map-loader": "^4.0.1",
|
||||||
"tmp-promise": "^3.0.3",
|
"tmp-promise": "^3.0.3",
|
||||||
"ts-transformer-keys": "^0.4.2",
|
"ts-transformer-keys": "^0.4.2",
|
||||||
"tsyringe": "^4.3.0",
|
"tsyringe": "^4.3.0",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Multer from 'multer';
|
import Multer from 'multer';
|
||||||
import { ServiceError } from '@/exceptions';
|
import { ServiceError } from '@/exceptions';
|
||||||
|
import { getImportsStoragePath } from '@/services/Import/_utils';
|
||||||
|
|
||||||
export function allowSheetExtensions(req, file, cb) {
|
export function allowSheetExtensions(req, file, cb) {
|
||||||
if (
|
if (
|
||||||
@@ -16,7 +17,8 @@ export function allowSheetExtensions(req, file, cb) {
|
|||||||
|
|
||||||
const storage = Multer.diskStorage({
|
const storage = Multer.diskStorage({
|
||||||
destination: function (req, file, cb) {
|
destination: function (req, file, cb) {
|
||||||
cb(null, './public/imports');
|
const path = getImportsStoragePath();
|
||||||
|
cb(null, path);
|
||||||
},
|
},
|
||||||
filename: function (req, file, cb) {
|
filename: function (req, file, cb) {
|
||||||
// Add the creation timestamp to clean up temp files later.
|
// Add the creation timestamp to clean up temp files later.
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ export class ImportFileUploadService {
|
|||||||
filename: string,
|
filename: string,
|
||||||
params: Record<string, number | string>
|
params: Record<string, number | string>
|
||||||
): Promise<ImportFileUploadPOJO> {
|
): Promise<ImportFileUploadPOJO> {
|
||||||
console.log(filename, 'filename');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await this.importUnhandled(
|
return await this.importUnhandled(
|
||||||
tenantId,
|
tenantId,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import moment from 'moment';
|
|||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
|
import path from 'path';
|
||||||
import {
|
import {
|
||||||
defaultTo,
|
defaultTo,
|
||||||
upperFirst,
|
upperFirst,
|
||||||
@@ -353,7 +354,6 @@ export const parseKey = R.curry(
|
|||||||
_key = `${fieldKey}`;
|
_key = `${fieldKey}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(_key);
|
|
||||||
return _key;
|
return _key;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -432,13 +432,19 @@ export const sanitizeSheetData = (json) => {
|
|||||||
export const getMapToPath = (to: string, group = '') =>
|
export const getMapToPath = (to: string, group = '') =>
|
||||||
group ? `${group}.${to}` : to;
|
group ? `${group}.${to}` : to;
|
||||||
|
|
||||||
|
export const getImportsStoragePath = () => {
|
||||||
|
return path.join(global.__storage_dir, `/imports`);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the imported file from the storage and database.
|
* Deletes the imported file from the storage and database.
|
||||||
* @param {string} filename
|
* @param {string} filename
|
||||||
*/
|
*/
|
||||||
export const deleteImportFile = async (filename: string) => {
|
export const deleteImportFile = async (filename: string) => {
|
||||||
|
const filePath = getImportsStoragePath();
|
||||||
|
|
||||||
// Deletes the imported file.
|
// Deletes the imported file.
|
||||||
await fs.unlink(`public/imports/${filename}`);
|
await fs.unlink(`${filePath}/${filename}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -447,5 +453,7 @@ export const deleteImportFile = async (filename: string) => {
|
|||||||
* @returns {Promise<Buffer>}
|
* @returns {Promise<Buffer>}
|
||||||
*/
|
*/
|
||||||
export const readImportFile = (filename: string) => {
|
export const readImportFile = (filename: string) => {
|
||||||
return fs.readFile(`public/imports/${filename}`);
|
const filePath = getImportsStoragePath();
|
||||||
|
|
||||||
|
return fs.readFile(`${filePath}/${filename}`);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import moment, { type unitOfTime } from 'moment';
|
import moment, { unitOfTime } from 'moment';
|
||||||
|
|
||||||
export default class SubscriptionPeriod {
|
export default class SubscriptionPeriod {
|
||||||
private start: Date;
|
private start: Date;
|
||||||
|
|||||||
@@ -194,7 +194,12 @@ export default class Tenant extends BaseModel {
|
|||||||
* @param {*} subscriptionSlug
|
* @param {*} subscriptionSlug
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
public newSubscription(planId, invoiceInterval, invoicePeriod, subscriptionSlug) {
|
public newSubscription(
|
||||||
|
planId,
|
||||||
|
invoiceInterval,
|
||||||
|
invoicePeriod,
|
||||||
|
subscriptionSlug
|
||||||
|
) {
|
||||||
return Tenant.newSubscription(
|
return Tenant.newSubscription(
|
||||||
this.id,
|
this.id,
|
||||||
planId,
|
planId,
|
||||||
@@ -202,7 +207,6 @@ export default class Tenant extends BaseModel {
|
|||||||
invoicePeriod,
|
invoicePeriod,
|
||||||
subscriptionSlug
|
subscriptionSlug
|
||||||
);
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@@ -38,6 +38,9 @@ importers:
|
|||||||
'@hapi/boom':
|
'@hapi/boom':
|
||||||
specifier: ^7.4.3
|
specifier: ^7.4.3
|
||||||
version: 7.4.11
|
version: 7.4.11
|
||||||
|
'@lemonsqueezy/lemonsqueezy.js':
|
||||||
|
specifier: ^2.2.0
|
||||||
|
version: 2.2.0
|
||||||
'@types/i18n':
|
'@types/i18n':
|
||||||
specifier: ^0.8.7
|
specifier: ^0.8.7
|
||||||
version: 0.8.8
|
version: 0.8.8
|
||||||
@@ -4623,6 +4626,11 @@ packages:
|
|||||||
resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==}
|
resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@lemonsqueezy/lemonsqueezy.js@2.2.0:
|
||||||
|
resolution: {integrity: sha512-DsZTeowehSLTESUZ6xxoYPDhoE8BYepWsj3TCqibG7FvB8X1HERPXQlc6E/IeGj22SOfIM997b7GfFkeLWY8pA==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@lerna/add@6.4.1:
|
/@lerna/add@6.4.1:
|
||||||
resolution: {integrity: sha512-YSRnMcsdYnQtQQK0NSyrS9YGXvB3jzvx183o+JTH892MKzSlBqwpBHekCknSibyxga1HeZ0SNKQXgsHAwWkrRw==}
|
resolution: {integrity: sha512-YSRnMcsdYnQtQQK0NSyrS9YGXvB3jzvx183o+JTH892MKzSlBqwpBHekCknSibyxga1HeZ0SNKQXgsHAwWkrRw==}
|
||||||
engines: {node: ^14.15.0 || >=16.0.0}
|
engines: {node: ^14.15.0 || >=16.0.0}
|
||||||
|
|||||||
Reference in New Issue
Block a user