@xbongbong/xbbcli 2.0.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -2
- package/ai-call-add-task.js +10 -1
- package/ai-word-list.js +10 -1
- package/bin/xbbcli.js +5 -0
- package/buyer-inquiry-detail.js +10 -1
- package/buyer-inquiry-list.js +10 -1
- package/clue-add-couser.js +10 -1
- package/clue-add.js +10 -1
- package/clue-back.js +10 -1
- package/clue-del.js +10 -1
- package/clue-delete-couser.js +10 -1
- package/clue-delete-mainuser.js +10 -1
- package/clue-detail.js +10 -1
- package/clue-distribution.js +10 -1
- package/clue-edit.js +10 -1
- package/clue-handover.js +10 -1
- package/clue-list.js +10 -1
- package/clue-thorough-delete.js +10 -1
- package/communicate-add.js +10 -1
- package/communicate-del.js +10 -1
- package/communicate-detail.js +10 -1
- package/communicate-edit.js +10 -1
- package/communicate-list.js +10 -1
- package/communicate-plan-add.js +10 -1
- package/communicate-plan-cancel.js +10 -1
- package/communicate-plan-del.js +10 -1
- package/communicate-plan-detail.js +10 -1
- package/communicate-plan-list.js +10 -1
- package/communicate-plan-single-operate.js +10 -1
- package/contact-add-couser.js +10 -1
- package/contact-add-mainuser.js +10 -1
- package/contact-add.js +10 -1
- package/contact-del.js +14 -1
- package/contact-delete-couser.js +10 -1
- package/contact-delete-mainuser.js +10 -1
- package/contact-detail.js +14 -1
- package/contact-edit.js +10 -1
- package/contact-handover.js +10 -1
- package/contact-list.js +10 -1
- package/contract-add-couser.js +10 -1
- package/contract-add-mainuser.js +10 -1
- package/contract-add.js +10 -1
- package/contract-del.js +10 -1
- package/contract-delete-couser.js +10 -1
- package/contract-delete-mainuser.js +10 -1
- package/contract-detail.js +10 -1
- package/contract-edit.js +10 -1
- package/contract-handover.js +10 -1
- package/contract-list.js +10 -1
- package/contract-outstock-add.js +10 -1
- package/contract-outstock-del.js +10 -1
- package/contract-outstock-detail.js +10 -1
- package/contract-outstock-edit.js +10 -1
- package/contract-outstock-list.js +10 -1
- package/customer-add-couser.js +10 -1
- package/customer-add.js +10 -1
- package/customer-back.js +10 -1
- package/customer-del.js +10 -1
- package/customer-delete-couser.js +10 -1
- package/customer-delete-mainuser.js +10 -1
- package/customer-detail.js +10 -1
- package/customer-distribution.js +10 -1
- package/customer-edit.js +10 -1
- package/customer-handover.js +10 -1
- package/customer-invoice-address-add.js +10 -1
- package/customer-invoice-address-edit.js +10 -1
- package/customer-invoice-address.js +10 -1
- package/customer-invoice-info-add.js +10 -1
- package/customer-invoice-info-edit.js +10 -1
- package/customer-invoice-info.js +10 -1
- package/customer-list.js +10 -1
- package/department-add.js +10 -1
- package/department-del.js +10 -1
- package/department-edit.js +10 -1
- package/department-list.js +10 -1
- package/form-data-add-couser.js +10 -1
- package/form-data-add-mainuser.js +10 -1
- package/form-data-add.js +10 -1
- package/form-data-del.js +10 -1
- package/form-data-delete-couser.js +10 -1
- package/form-data-delete-mainuser.js +10 -1
- package/form-data-detail.js +10 -1
- package/form-data-edit.js +10 -1
- package/form-data-handover.js +10 -1
- package/form-data-list.js +10 -1
- package/form-get.js +10 -1
- package/form-list.js +10 -1
- package/invoice-add.js +10 -1
- package/invoice-cancel.js +10 -1
- package/invoice-del.js +10 -1
- package/invoice-detail.js +10 -1
- package/invoice-edit.js +10 -1
- package/invoice-get-amount-detail.js +10 -1
- package/invoice-list.js +10 -1
- package/invoice-red.js +10 -1
- package/label-add.js +10 -1
- package/label-all-list.js +10 -1
- package/label-batch-add.js +10 -1
- package/label-batch-remove.js +10 -1
- package/label-del-completely.js +10 -1
- package/label-del.js +10 -1
- package/label-edit.js +10 -1
- package/label-group-add.js +10 -1
- package/label-group-del.js +10 -1
- package/label-group-list.js +10 -1
- package/label-group-update.js +10 -1
- package/label-list.js +10 -1
- package/label-reduction.js +10 -1
- package/label-repeat.js +10 -1
- package/market-activity-add.js +10 -1
- package/market-activity-del.js +10 -1
- package/market-activity-detail.js +10 -1
- package/market-activity-edit.js +10 -1
- package/market-activity-handover.js +10 -1
- package/market-activity-list.js +10 -1
- package/opportunity-add-couser.js +10 -1
- package/opportunity-add-mainuser.js +10 -1
- package/opportunity-add.js +10 -1
- package/opportunity-del.js +10 -1
- package/opportunity-delete-couser.js +10 -1
- package/opportunity-delete-mainuser.js +10 -1
- package/opportunity-detail.js +10 -1
- package/opportunity-edit.js +10 -1
- package/opportunity-handover.js +10 -1
- package/opportunity-list.js +10 -1
- package/package.json +1 -1
- package/pay-plan-add-couser.js +10 -1
- package/pay-plan-add-mainuser.js +10 -1
- package/pay-plan-add.js +10 -1
- package/pay-plan-delete-couser.js +10 -1
- package/pay-plan-delete-mainuser.js +10 -1
- package/pay-plan-handover.js +10 -1
- package/pay-sheet-add-bad.js +10 -1
- package/pay-sheet-add-couser.js +10 -1
- package/pay-sheet-add-mainuser.js +10 -1
- package/pay-sheet-add-red.js +10 -1
- package/pay-sheet-add-write-off.js +10 -1
- package/pay-sheet-del.js +10 -1
- package/pay-sheet-delete-couser.js +10 -1
- package/pay-sheet-delete-mainuser.js +10 -1
- package/pay-sheet-detail.js +10 -1
- package/pay-sheet-edit-bad.js +10 -1
- package/pay-sheet-edit-red.js +10 -1
- package/pay-sheet-edit-write-off.js +10 -1
- package/pay-sheet-get-amount-detail.js +10 -1
- package/pay-sheet-list.js +10 -1
- package/payment-add-couser.js +10 -1
- package/payment-add-mainuser.js +10 -1
- package/payment-add.js +10 -1
- package/payment-del.js +10 -1
- package/payment-delete-couser.js +10 -1
- package/payment-delete-mainuser.js +10 -1
- package/payment-detail.js +10 -1
- package/payment-edit.js +10 -1
- package/payment-handover.js +10 -1
- package/payment-list.js +10 -1
- package/payment-sheet-add-bad-debt.js +10 -1
- package/payment-sheet-add-pre.js +10 -1
- package/payment-sheet-add-red.js +10 -1
- package/payment-sheet-add-write-off.js +10 -1
- package/payment-sheet-del.js +10 -1
- package/payment-sheet-detail.js +10 -1
- package/payment-sheet-edit-bad-debt.js +10 -1
- package/payment-sheet-edit-red.js +10 -1
- package/payment-sheet-edit-write-off.js +10 -1
- package/payment-sheet-get-amount-detail.js +10 -1
- package/payment-sheet-handover.js +10 -1
- package/payment-sheet-list.js +10 -1
- package/product-add.js +10 -1
- package/product-category-add.js +10 -1
- package/product-category-del.js +10 -1
- package/product-category-list.js +10 -1
- package/product-category-update.js +10 -1
- package/product-del.js +10 -1
- package/product-detail.js +10 -1
- package/product-edit.js +10 -1
- package/product-list.js +10 -1
- package/product-online.js +10 -1
- package/quotation-add-couser.js +10 -1
- package/quotation-add-mainuser.js +10 -1
- package/quotation-add.js +10 -1
- package/quotation-del.js +10 -1
- package/quotation-delete-couser.js +10 -1
- package/quotation-delete-mainuser.js +10 -1
- package/quotation-detail.js +10 -1
- package/quotation-edit.js +10 -1
- package/quotation-handover.js +10 -1
- package/quotation-list.js +10 -1
- package/refund-add.js +16 -1
- package/refund-del.js +16 -1
- package/refund-detail.js +16 -1
- package/refund-edit.js +16 -1
- package/refund-list.js +10 -1
- package/role-list.js +10 -1
- package/sign-in-list.js +10 -1
- package/stage-get.js +10 -1
- package/stage-jump.js +10 -1
- package/supplier-add.js +10 -1
- package/token-del.js +101 -0
- package/token-generate.js +10 -1
- package/token-list.js +101 -0
- package/token-set.js +175 -10
- package/token-use.js +97 -0
- package/user-add.js +10 -1
- package/user-del.js +10 -1
- package/user-edit.js +10 -1
- package/user-handover.js +10 -1
- package/user-list.js +13 -4
- package/work-order-add.js +10 -1
- package/work-order-asset-add-couser.js +10 -1
- package/work-order-asset-add-mainuser.js +10 -1
- package/work-order-asset-add.js +10 -1
- package/work-order-asset-del-couser.js +10 -1
- package/work-order-asset-del-mainuser.js +10 -1
- package/work-order-asset-del.js +10 -1
- package/work-order-asset-detail.js +10 -1
- package/work-order-asset-edit.js +10 -1
- package/work-order-asset-handover.js +10 -1
- package/work-order-asset-list.js +10 -1
- package/work-order-del.js +10 -1
- package/work-order-detail.js +10 -1
- package/work-order-dynamic-list.js +10 -1
- package/work-order-edit.js +10 -1
- package/work-order-list.js +10 -1
- package/work-order-operate.js +10 -1
- package/work-order-template-detail.js +10 -1
- package/work-order-template-list.js +10 -1
- package/work-report-daily-add.js +10 -1
- package/work-report-daily-del.js +10 -1
- package/work-report-daily-detail.js +10 -1
- package/work-report-daily-edit.js +10 -1
- package/work-report-daily-get-work-plan.js +10 -1
- package/work-report-daily-list.js +10 -1
- package/work-report-monthly-add.js +10 -1
- package/work-report-monthly-del.js +10 -1
- package/work-report-monthly-detail.js +10 -1
- package/work-report-monthly-edit.js +10 -1
- package/work-report-monthly-list.js +10 -1
- package/work-report-weekly-add.js +10 -1
- package/work-report-weekly-del.js +10 -1
- package/work-report-weekly-detail.js +10 -1
- package/work-report-weekly-edit.js +10 -1
- package/work-report-weekly-list.js +10 -1
- package/work-task-add-couser.js +10 -1
- package/work-task-add.js +10 -1
- package/work-task-delete-couser.js +10 -1
- package/work-task-detail.js +10 -1
- package/work-task-edit.js +10 -1
- package/work-task-handover.js +10 -1
- package/workorder-add-couser.js +10 -1
- package/workorder-delete-couser.js +10 -1
- package/workorder-handover.js +10 -1
- package/workorderlist.js +10 -1
- package/workorderproductlist.js +10 -1
- package/worktimerecorddetail.js +10 -1
- package/worktimerecordlist.js +10 -1
package/contact-add-mainuser.js
CHANGED
|
@@ -11,7 +11,16 @@ const MISSING_TOKEN_MESSAGE = '缺少 token;请先执行 xbbcli token-set --co
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contact-add.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contact-del.js
CHANGED
|
@@ -10,7 +10,20 @@ const API_URL = 'https://proapi.xbongbong.com/pro/v2/api/contact/del';
|
|
|
10
10
|
const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
|
-
try {
|
|
13
|
+
try {
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
24
|
+
} catch {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
14
27
|
}
|
|
15
28
|
function getRuntimeConfig() {
|
|
16
29
|
const config = readConfig();
|
package/contact-delete-couser.js
CHANGED
|
@@ -11,7 +11,16 @@ const MISSING_TOKEN_MESSAGE = '缺少 token;请先执行 xbbcli token-set --co
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -11,7 +11,16 @@ const MISSING_TOKEN_MESSAGE = '缺少 token;请先执行 xbbcli token-set --co
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contact-detail.js
CHANGED
|
@@ -10,7 +10,20 @@ const API_URL = 'https://proapi.xbongbong.com/pro/v2/api/contact/detail';
|
|
|
10
10
|
const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
|
-
try {
|
|
13
|
+
try {
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
24
|
+
} catch {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
14
27
|
}
|
|
15
28
|
function getRuntimeConfig() {
|
|
16
29
|
const config = readConfig();
|
package/contact-edit.js
CHANGED
|
@@ -10,7 +10,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
10
10
|
|
|
11
11
|
function readConfig() {
|
|
12
12
|
try {
|
|
13
|
-
|
|
13
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
14
|
+
const companies = Array.isArray(parsed)
|
|
15
|
+
? parsed
|
|
16
|
+
: Array.isArray(parsed?.companies)
|
|
17
|
+
? parsed.companies
|
|
18
|
+
: null;
|
|
19
|
+
if (companies) {
|
|
20
|
+
return companies.find((item) => item && item.enable) || {};
|
|
21
|
+
}
|
|
22
|
+
return parsed || {};
|
|
14
23
|
} catch {
|
|
15
24
|
return {};
|
|
16
25
|
}
|
package/contact-handover.js
CHANGED
|
@@ -11,7 +11,16 @@ const MISSING_TOKEN_MESSAGE = '缺少 token;请先执行 xbbcli token-set --co
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contact-list.js
CHANGED
|
@@ -12,7 +12,16 @@ let lastPagination = null;
|
|
|
12
12
|
|
|
13
13
|
function readConfig() {
|
|
14
14
|
try {
|
|
15
|
-
|
|
15
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
16
|
+
const companies = Array.isArray(parsed)
|
|
17
|
+
? parsed
|
|
18
|
+
: Array.isArray(parsed?.companies)
|
|
19
|
+
? parsed.companies
|
|
20
|
+
: null;
|
|
21
|
+
if (companies) {
|
|
22
|
+
return companies.find((item) => item && item.enable) || {};
|
|
23
|
+
}
|
|
24
|
+
return parsed || {};
|
|
16
25
|
} catch {
|
|
17
26
|
return {};
|
|
18
27
|
}
|
package/contract-add-couser.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contract-add-mainuser.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contract-add.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contract-del.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contract-detail.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contract-edit.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contract-handover.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contract-list.js
CHANGED
|
@@ -12,7 +12,16 @@ let lastPagination = null;
|
|
|
12
12
|
|
|
13
13
|
function readConfig() {
|
|
14
14
|
try {
|
|
15
|
-
|
|
15
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
16
|
+
const companies = Array.isArray(parsed)
|
|
17
|
+
? parsed
|
|
18
|
+
: Array.isArray(parsed?.companies)
|
|
19
|
+
? parsed.companies
|
|
20
|
+
: null;
|
|
21
|
+
if (companies) {
|
|
22
|
+
return companies.find((item) => item && item.enable) || {};
|
|
23
|
+
}
|
|
24
|
+
return parsed || {};
|
|
16
25
|
} catch {
|
|
17
26
|
return {};
|
|
18
27
|
}
|
package/contract-outstock-add.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/contract-outstock-del.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -12,7 +12,16 @@ let lastPagination = null;
|
|
|
12
12
|
|
|
13
13
|
function readConfig() {
|
|
14
14
|
try {
|
|
15
|
-
|
|
15
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
16
|
+
const companies = Array.isArray(parsed)
|
|
17
|
+
? parsed
|
|
18
|
+
: Array.isArray(parsed?.companies)
|
|
19
|
+
? parsed.companies
|
|
20
|
+
: null;
|
|
21
|
+
if (companies) {
|
|
22
|
+
return companies.find((item) => item && item.enable) || {};
|
|
23
|
+
}
|
|
24
|
+
return parsed || {};
|
|
16
25
|
} catch {
|
|
17
26
|
return {};
|
|
18
27
|
}
|
package/customer-add-couser.js
CHANGED
|
@@ -11,7 +11,16 @@ const MISSING_TOKEN_MESSAGE = '缺少 token;请先执行 xbbcli token-set --co
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/customer-add.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/customer-back.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/customer-del.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/customer-detail.js
CHANGED
|
@@ -11,7 +11,16 @@ const MISSING_TOKEN_MESSAGE = '缺少 token;请先执行 xbbcli token-set --co
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/customer-distribution.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
package/customer-edit.js
CHANGED
|
@@ -10,7 +10,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
10
10
|
|
|
11
11
|
function readConfig() {
|
|
12
12
|
try {
|
|
13
|
-
|
|
13
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
14
|
+
const companies = Array.isArray(parsed)
|
|
15
|
+
? parsed
|
|
16
|
+
: Array.isArray(parsed?.companies)
|
|
17
|
+
? parsed.companies
|
|
18
|
+
: null;
|
|
19
|
+
if (companies) {
|
|
20
|
+
return companies.find((item) => item && item.enable) || {};
|
|
21
|
+
}
|
|
22
|
+
return parsed || {};
|
|
14
23
|
} catch {
|
|
15
24
|
return {};
|
|
16
25
|
}
|
package/customer-handover.js
CHANGED
|
@@ -11,7 +11,16 @@ const DEFAULT_BASE_URL = 'https://proapi.xbongbong.com';
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|
|
@@ -11,7 +11,16 @@ const MISSING_TOKEN_MESSAGE = '缺少 token;请先执行 xbbcli token-set --co
|
|
|
11
11
|
|
|
12
12
|
function readConfig() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
15
|
+
const companies = Array.isArray(parsed)
|
|
16
|
+
? parsed
|
|
17
|
+
: Array.isArray(parsed?.companies)
|
|
18
|
+
? parsed.companies
|
|
19
|
+
: null;
|
|
20
|
+
if (companies) {
|
|
21
|
+
return companies.find((item) => item && item.enable) || {};
|
|
22
|
+
}
|
|
23
|
+
return parsed || {};
|
|
15
24
|
} catch {
|
|
16
25
|
return {};
|
|
17
26
|
}
|