@aderis-erp/cli 1.0.2 → 1.0.3
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/dist/commands/{processing-logs.d.ts → access-groups.d.ts} +1 -1
- package/dist/commands/{access-groups 2.js → access-groups.js} +30 -18
- package/dist/commands/account-transactions.d.ts +41 -0
- package/dist/commands/account-transactions.js +1032 -0
- package/dist/commands/accounts.d.ts +40 -0
- package/dist/commands/accounts.js +1024 -0
- package/dist/commands/agent-runs.d.ts +39 -0
- package/dist/commands/agent-runs.js +1013 -0
- package/dist/commands/{pubsub.d.ts → async-endpoints-internal.d.ts} +1 -1
- package/dist/commands/{pubsub.js → async-endpoints-internal.js} +37 -25
- package/dist/commands/audit-log.d.ts +39 -0
- package/dist/commands/{processing-logs.js → audit-log.js} +42 -28
- package/dist/commands/auth/login.d.ts +14 -0
- package/dist/commands/auth/login.js +116 -0
- package/dist/commands/auth/logout.d.ts +10 -0
- package/dist/commands/auth/logout.js +58 -0
- package/dist/commands/auth/status.d.ts +12 -0
- package/dist/commands/auth/status.js +101 -0
- package/dist/commands/auth/tenant.d.ts +19 -0
- package/dist/commands/auth/tenant.js +184 -0
- package/dist/commands/auth.d.ts +37 -0
- package/dist/commands/auth.js +871 -0
- package/dist/commands/bank-accounts.d.ts +41 -0
- package/dist/commands/bank-accounts.js +1032 -0
- package/dist/commands/bank-integrations.js +30 -18
- package/dist/commands/business-partners---contacts.js +30 -18
- package/dist/commands/business-partners.js +30 -18
- package/dist/commands/config/add.d.ts +13 -0
- package/dist/commands/config/add.js +120 -0
- package/dist/commands/config/current.d.ts +9 -0
- package/dist/commands/config/current.js +43 -0
- package/dist/commands/config/delete.d.ts +12 -0
- package/dist/commands/config/delete.js +67 -0
- package/dist/commands/config/list.d.ts +9 -0
- package/dist/commands/config/list.js +50 -0
- package/dist/commands/config/use.d.ts +9 -0
- package/dist/commands/config/use.js +40 -0
- package/dist/commands/credit-card-accounts.js +30 -18
- package/dist/commands/documents.js +30 -18
- package/dist/commands/dunning-configs.js +30 -18
- package/dist/commands/dunning-reminders.js +30 -18
- package/dist/commands/dunning-runs.js +30 -18
- package/dist/commands/employees.js +30 -18
- package/dist/commands/event-processor-mappings.js +30 -18
- package/dist/commands/files-internal.js +30 -18
- package/dist/commands/health.js +30 -18
- package/dist/commands/inbox.js +33 -19
- package/dist/commands/integrations.js +30 -18
- package/dist/commands/item-categories.js +30 -18
- package/dist/commands/items.js +30 -18
- package/dist/commands/journal-lines.js +30 -18
- package/dist/commands/journals.js +30 -18
- package/dist/commands/ledgers.js +30 -18
- package/dist/commands/office-locations.js +30 -18
- package/dist/commands/payment-method-ledger-mappings.js +30 -18
- package/dist/commands/payment-methods.js +30 -18
- package/dist/commands/payment-runs.js +30 -18
- package/dist/commands/payment-terms.js +30 -18
- package/dist/commands/price-lists.js +30 -18
- package/dist/commands/processor-mappings.js +30 -18
- package/dist/commands/processors.js +31 -19
- package/dist/commands/reconciliation.js +30 -18
- package/dist/commands/reports.js +30 -18
- package/dist/commands/salary-types.js +1018 -0
- package/dist/commands/sales-invoices.js +30 -18
- package/dist/commands/sales-orders.js +32 -19
- package/dist/commands/switch.d.ts +1 -0
- package/dist/commands/switch.js +58 -3
- package/dist/commands/tags.js +30 -18
- package/dist/commands/tax-codes.js +30 -18
- package/dist/commands/tax-matrix.js +30 -18
- package/dist/commands/tenants.js +30 -18
- package/dist/commands/text-templates.js +30 -18
- package/dist/commands/tools.js +30 -18
- package/dist/commands/vendor-invoices.js +33 -19
- package/dist/commands/webhooks.js +30 -18
- package/dist/commands/workflows.js +30 -18
- package/dist/index 2.js +1 -0
- package/dist/index.d 2.ts +1 -0
- package/dist/lib/auth.d.ts +16 -1
- package/dist/lib/auth.js +153 -45
- package/dist/lib/config.d.ts +7 -0
- package/dist/lib/config.js +6 -0
- package/oclif.manifest.json +2092 -669
- package/package.json +2 -2
|
@@ -825,32 +825,44 @@ export default class PriceLists extends Command {
|
|
|
825
825
|
filterFields(data, fields) {
|
|
826
826
|
const isUnsafeKey = (k) => k === '__proto__' || k === 'constructor' || k === 'prototype';
|
|
827
827
|
const pick = (obj, keys) => {
|
|
828
|
-
|
|
828
|
+
// Group keys by their first segment so sibling sub-paths
|
|
829
|
+
// (e.g. 'items.amount' + 'items._type') resolve in one recursive pass
|
|
830
|
+
// and don't clobber each other on merge.
|
|
831
|
+
const directKeys = new Set();
|
|
832
|
+
const nestedKeys = new Map();
|
|
829
833
|
for (const key of keys) {
|
|
830
834
|
if (key.split('.').some(isUnsafeKey))
|
|
831
835
|
continue;
|
|
832
836
|
if (key.includes('.')) {
|
|
833
|
-
// Handle nested fields like 'customer.name' or 'allocations.salesInvoiceId'
|
|
834
837
|
const [first, ...rest] = key.split('.');
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
const existing = Array.isArray(result[first]) ? result[first] : [];
|
|
841
|
-
result[first] = val.map((item, i) => ({
|
|
842
|
-
...(existing[i] || {}),
|
|
843
|
-
...pick(item, [restKey]),
|
|
844
|
-
}));
|
|
845
|
-
}
|
|
846
|
-
else {
|
|
847
|
-
const nested = pick(val, [restKey]);
|
|
848
|
-
result[first] = { ...(result[first] || {}), ...nested };
|
|
849
|
-
}
|
|
838
|
+
if (isUnsafeKey(first))
|
|
839
|
+
continue;
|
|
840
|
+
const list = nestedKeys.get(first);
|
|
841
|
+
if (list) {
|
|
842
|
+
list.push(rest.join('.'));
|
|
850
843
|
}
|
|
844
|
+
else {
|
|
845
|
+
nestedKeys.set(first, [rest.join('.')]);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
else {
|
|
849
|
+
directKeys.add(key);
|
|
851
850
|
}
|
|
852
|
-
|
|
851
|
+
}
|
|
852
|
+
const result = {};
|
|
853
|
+
for (const key of directKeys) {
|
|
854
|
+
if (key in obj)
|
|
853
855
|
result[key] = obj[key];
|
|
856
|
+
}
|
|
857
|
+
for (const [first, restKeys] of nestedKeys) {
|
|
858
|
+
const val = obj[first];
|
|
859
|
+
if (!val || typeof val !== 'object')
|
|
860
|
+
continue;
|
|
861
|
+
if (Array.isArray(val)) {
|
|
862
|
+
result[first] = val.map(item => pick(item, restKeys));
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
result[first] = pick(val, restKeys);
|
|
854
866
|
}
|
|
855
867
|
}
|
|
856
868
|
return result;
|
|
@@ -817,32 +817,44 @@ export default class ProcessorMappings extends Command {
|
|
|
817
817
|
filterFields(data, fields) {
|
|
818
818
|
const isUnsafeKey = (k) => k === '__proto__' || k === 'constructor' || k === 'prototype';
|
|
819
819
|
const pick = (obj, keys) => {
|
|
820
|
-
|
|
820
|
+
// Group keys by their first segment so sibling sub-paths
|
|
821
|
+
// (e.g. 'items.amount' + 'items._type') resolve in one recursive pass
|
|
822
|
+
// and don't clobber each other on merge.
|
|
823
|
+
const directKeys = new Set();
|
|
824
|
+
const nestedKeys = new Map();
|
|
821
825
|
for (const key of keys) {
|
|
822
826
|
if (key.split('.').some(isUnsafeKey))
|
|
823
827
|
continue;
|
|
824
828
|
if (key.includes('.')) {
|
|
825
|
-
// Handle nested fields like 'customer.name' or 'allocations.salesInvoiceId'
|
|
826
829
|
const [first, ...rest] = key.split('.');
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
const existing = Array.isArray(result[first]) ? result[first] : [];
|
|
833
|
-
result[first] = val.map((item, i) => ({
|
|
834
|
-
...(existing[i] || {}),
|
|
835
|
-
...pick(item, [restKey]),
|
|
836
|
-
}));
|
|
837
|
-
}
|
|
838
|
-
else {
|
|
839
|
-
const nested = pick(val, [restKey]);
|
|
840
|
-
result[first] = { ...(result[first] || {}), ...nested };
|
|
841
|
-
}
|
|
830
|
+
if (isUnsafeKey(first))
|
|
831
|
+
continue;
|
|
832
|
+
const list = nestedKeys.get(first);
|
|
833
|
+
if (list) {
|
|
834
|
+
list.push(rest.join('.'));
|
|
842
835
|
}
|
|
836
|
+
else {
|
|
837
|
+
nestedKeys.set(first, [rest.join('.')]);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
else {
|
|
841
|
+
directKeys.add(key);
|
|
843
842
|
}
|
|
844
|
-
|
|
843
|
+
}
|
|
844
|
+
const result = {};
|
|
845
|
+
for (const key of directKeys) {
|
|
846
|
+
if (key in obj)
|
|
845
847
|
result[key] = obj[key];
|
|
848
|
+
}
|
|
849
|
+
for (const [first, restKeys] of nestedKeys) {
|
|
850
|
+
const val = obj[first];
|
|
851
|
+
if (!val || typeof val !== 'object')
|
|
852
|
+
continue;
|
|
853
|
+
if (Array.isArray(val)) {
|
|
854
|
+
result[first] = val.map(item => pick(item, restKeys));
|
|
855
|
+
}
|
|
856
|
+
else {
|
|
857
|
+
result[first] = pick(val, restKeys);
|
|
846
858
|
}
|
|
847
859
|
}
|
|
848
860
|
return result;
|
|
@@ -9,7 +9,7 @@ const NESTED_IMPORTS = [];
|
|
|
9
9
|
const SUBCOMMANDS = [...["list-tools", "list", "create", "resolve", "resolve-event", "get", "update", "delete", "template"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
|
|
10
10
|
const ENDPOINTS = {
|
|
11
11
|
'list-tools': { method: 'GET', path: '/v1/processors/tools', summary: 'List all available tools', pathParams: [], hasBody: false, isMultipart: false },
|
|
12
|
-
'list': { method: 'GET', path: '/v1/processors', summary: 'List
|
|
12
|
+
'list': { method: 'GET', path: '/v1/processors', summary: 'List processors available to the tenant', pathParams: [], hasBody: false, isMultipart: false },
|
|
13
13
|
'create': { method: 'POST', path: '/v1/processors', summary: 'Create a new tenant-scoped processor', pathParams: [], hasBody: true, isMultipart: false },
|
|
14
14
|
'resolve': { method: 'GET', path: '/v1/processors/resolve/{documentType}', summary: 'Resolve processor for a document type', pathParams: ['documentType'], hasBody: false, isMultipart: false },
|
|
15
15
|
'resolve-event': { method: 'GET', path: '/v1/processors/resolve/event/{eventType}', summary: 'Resolve processors for an event type', pathParams: ['eventType'], hasBody: false, isMultipart: false },
|
|
@@ -823,32 +823,44 @@ export default class Processors extends Command {
|
|
|
823
823
|
filterFields(data, fields) {
|
|
824
824
|
const isUnsafeKey = (k) => k === '__proto__' || k === 'constructor' || k === 'prototype';
|
|
825
825
|
const pick = (obj, keys) => {
|
|
826
|
-
|
|
826
|
+
// Group keys by their first segment so sibling sub-paths
|
|
827
|
+
// (e.g. 'items.amount' + 'items._type') resolve in one recursive pass
|
|
828
|
+
// and don't clobber each other on merge.
|
|
829
|
+
const directKeys = new Set();
|
|
830
|
+
const nestedKeys = new Map();
|
|
827
831
|
for (const key of keys) {
|
|
828
832
|
if (key.split('.').some(isUnsafeKey))
|
|
829
833
|
continue;
|
|
830
834
|
if (key.includes('.')) {
|
|
831
|
-
// Handle nested fields like 'customer.name' or 'allocations.salesInvoiceId'
|
|
832
835
|
const [first, ...rest] = key.split('.');
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
const existing = Array.isArray(result[first]) ? result[first] : [];
|
|
839
|
-
result[first] = val.map((item, i) => ({
|
|
840
|
-
...(existing[i] || {}),
|
|
841
|
-
...pick(item, [restKey]),
|
|
842
|
-
}));
|
|
843
|
-
}
|
|
844
|
-
else {
|
|
845
|
-
const nested = pick(val, [restKey]);
|
|
846
|
-
result[first] = { ...(result[first] || {}), ...nested };
|
|
847
|
-
}
|
|
836
|
+
if (isUnsafeKey(first))
|
|
837
|
+
continue;
|
|
838
|
+
const list = nestedKeys.get(first);
|
|
839
|
+
if (list) {
|
|
840
|
+
list.push(rest.join('.'));
|
|
848
841
|
}
|
|
842
|
+
else {
|
|
843
|
+
nestedKeys.set(first, [rest.join('.')]);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
directKeys.add(key);
|
|
849
848
|
}
|
|
850
|
-
|
|
849
|
+
}
|
|
850
|
+
const result = {};
|
|
851
|
+
for (const key of directKeys) {
|
|
852
|
+
if (key in obj)
|
|
851
853
|
result[key] = obj[key];
|
|
854
|
+
}
|
|
855
|
+
for (const [first, restKeys] of nestedKeys) {
|
|
856
|
+
const val = obj[first];
|
|
857
|
+
if (!val || typeof val !== 'object')
|
|
858
|
+
continue;
|
|
859
|
+
if (Array.isArray(val)) {
|
|
860
|
+
result[first] = val.map(item => pick(item, restKeys));
|
|
861
|
+
}
|
|
862
|
+
else {
|
|
863
|
+
result[first] = pick(val, restKeys);
|
|
852
864
|
}
|
|
853
865
|
}
|
|
854
866
|
return result;
|
|
@@ -816,32 +816,44 @@ export default class Reconciliation extends Command {
|
|
|
816
816
|
filterFields(data, fields) {
|
|
817
817
|
const isUnsafeKey = (k) => k === '__proto__' || k === 'constructor' || k === 'prototype';
|
|
818
818
|
const pick = (obj, keys) => {
|
|
819
|
-
|
|
819
|
+
// Group keys by their first segment so sibling sub-paths
|
|
820
|
+
// (e.g. 'items.amount' + 'items._type') resolve in one recursive pass
|
|
821
|
+
// and don't clobber each other on merge.
|
|
822
|
+
const directKeys = new Set();
|
|
823
|
+
const nestedKeys = new Map();
|
|
820
824
|
for (const key of keys) {
|
|
821
825
|
if (key.split('.').some(isUnsafeKey))
|
|
822
826
|
continue;
|
|
823
827
|
if (key.includes('.')) {
|
|
824
|
-
// Handle nested fields like 'customer.name' or 'allocations.salesInvoiceId'
|
|
825
828
|
const [first, ...rest] = key.split('.');
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
const existing = Array.isArray(result[first]) ? result[first] : [];
|
|
832
|
-
result[first] = val.map((item, i) => ({
|
|
833
|
-
...(existing[i] || {}),
|
|
834
|
-
...pick(item, [restKey]),
|
|
835
|
-
}));
|
|
836
|
-
}
|
|
837
|
-
else {
|
|
838
|
-
const nested = pick(val, [restKey]);
|
|
839
|
-
result[first] = { ...(result[first] || {}), ...nested };
|
|
840
|
-
}
|
|
829
|
+
if (isUnsafeKey(first))
|
|
830
|
+
continue;
|
|
831
|
+
const list = nestedKeys.get(first);
|
|
832
|
+
if (list) {
|
|
833
|
+
list.push(rest.join('.'));
|
|
841
834
|
}
|
|
835
|
+
else {
|
|
836
|
+
nestedKeys.set(first, [rest.join('.')]);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
else {
|
|
840
|
+
directKeys.add(key);
|
|
842
841
|
}
|
|
843
|
-
|
|
842
|
+
}
|
|
843
|
+
const result = {};
|
|
844
|
+
for (const key of directKeys) {
|
|
845
|
+
if (key in obj)
|
|
844
846
|
result[key] = obj[key];
|
|
847
|
+
}
|
|
848
|
+
for (const [first, restKeys] of nestedKeys) {
|
|
849
|
+
const val = obj[first];
|
|
850
|
+
if (!val || typeof val !== 'object')
|
|
851
|
+
continue;
|
|
852
|
+
if (Array.isArray(val)) {
|
|
853
|
+
result[first] = val.map(item => pick(item, restKeys));
|
|
854
|
+
}
|
|
855
|
+
else {
|
|
856
|
+
result[first] = pick(val, restKeys);
|
|
845
857
|
}
|
|
846
858
|
}
|
|
847
859
|
return result;
|
package/dist/commands/reports.js
CHANGED
|
@@ -809,32 +809,44 @@ export default class Reports extends Command {
|
|
|
809
809
|
filterFields(data, fields) {
|
|
810
810
|
const isUnsafeKey = (k) => k === '__proto__' || k === 'constructor' || k === 'prototype';
|
|
811
811
|
const pick = (obj, keys) => {
|
|
812
|
-
|
|
812
|
+
// Group keys by their first segment so sibling sub-paths
|
|
813
|
+
// (e.g. 'items.amount' + 'items._type') resolve in one recursive pass
|
|
814
|
+
// and don't clobber each other on merge.
|
|
815
|
+
const directKeys = new Set();
|
|
816
|
+
const nestedKeys = new Map();
|
|
813
817
|
for (const key of keys) {
|
|
814
818
|
if (key.split('.').some(isUnsafeKey))
|
|
815
819
|
continue;
|
|
816
820
|
if (key.includes('.')) {
|
|
817
|
-
// Handle nested fields like 'customer.name' or 'allocations.salesInvoiceId'
|
|
818
821
|
const [first, ...rest] = key.split('.');
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
const existing = Array.isArray(result[first]) ? result[first] : [];
|
|
825
|
-
result[first] = val.map((item, i) => ({
|
|
826
|
-
...(existing[i] || {}),
|
|
827
|
-
...pick(item, [restKey]),
|
|
828
|
-
}));
|
|
829
|
-
}
|
|
830
|
-
else {
|
|
831
|
-
const nested = pick(val, [restKey]);
|
|
832
|
-
result[first] = { ...(result[first] || {}), ...nested };
|
|
833
|
-
}
|
|
822
|
+
if (isUnsafeKey(first))
|
|
823
|
+
continue;
|
|
824
|
+
const list = nestedKeys.get(first);
|
|
825
|
+
if (list) {
|
|
826
|
+
list.push(rest.join('.'));
|
|
834
827
|
}
|
|
828
|
+
else {
|
|
829
|
+
nestedKeys.set(first, [rest.join('.')]);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
directKeys.add(key);
|
|
835
834
|
}
|
|
836
|
-
|
|
835
|
+
}
|
|
836
|
+
const result = {};
|
|
837
|
+
for (const key of directKeys) {
|
|
838
|
+
if (key in obj)
|
|
837
839
|
result[key] = obj[key];
|
|
840
|
+
}
|
|
841
|
+
for (const [first, restKeys] of nestedKeys) {
|
|
842
|
+
const val = obj[first];
|
|
843
|
+
if (!val || typeof val !== 'object')
|
|
844
|
+
continue;
|
|
845
|
+
if (Array.isArray(val)) {
|
|
846
|
+
result[first] = val.map(item => pick(item, restKeys));
|
|
847
|
+
}
|
|
848
|
+
else {
|
|
849
|
+
result[first] = pick(val, restKeys);
|
|
838
850
|
}
|
|
839
851
|
}
|
|
840
852
|
return result;
|