@robosystems/client 2.21.0 → 2.23.0

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.
Files changed (34) hide show
  1. package/artifacts/LedgerClient.d.ts +81 -3
  2. package/artifacts/LedgerClient.js +92 -1
  3. package/artifacts/LedgerClient.ts +190 -2
  4. package/artifacts/graphql/generated/graphql.d.ts +329 -0
  5. package/artifacts/graphql/generated/graphql.js +961 -59
  6. package/artifacts/graphql/generated/graphql.ts +1275 -59
  7. package/artifacts/graphql/queries/ledger/agedBalances.d.ts +27 -0
  8. package/artifacts/graphql/queries/ledger/agedBalances.js +136 -0
  9. package/artifacts/graphql/queries/ledger/agedBalances.ts +139 -0
  10. package/artifacts/graphql/queries/ledger/dimensions.d.ts +7 -0
  11. package/artifacts/graphql/queries/ledger/dimensions.js +27 -0
  12. package/artifacts/graphql/queries/ledger/dimensions.ts +25 -0
  13. package/artifacts/graphql/queries/ledger/journalEntries.js +5 -0
  14. package/artifacts/graphql/queries/ledger/journalEntries.ts +5 -0
  15. package/artifacts/graphql/queries/ledger/transaction.js +6 -0
  16. package/artifacts/graphql/queries/ledger/transaction.ts +6 -0
  17. package/artifacts/graphql/queries/ledger/trialBalance.d.ts +4 -1
  18. package/artifacts/graphql/queries/ledger/trialBalance.js +19 -3
  19. package/artifacts/graphql/queries/ledger/trialBalance.ts +19 -3
  20. package/index.ts +2 -2
  21. package/package.json +1 -1
  22. package/sdk/index.d.ts +2 -2
  23. package/sdk/index.js +7 -5
  24. package/sdk/index.ts +2 -2
  25. package/sdk/sdk.gen.d.ts +21 -5
  26. package/sdk/sdk.gen.js +40 -6
  27. package/sdk/sdk.gen.ts +39 -5
  28. package/sdk/types.gen.d.ts +449 -5
  29. package/sdk/types.gen.ts +468 -5
  30. package/sdk.gen.d.ts +21 -5
  31. package/sdk.gen.js +40 -6
  32. package/sdk.gen.ts +39 -5
  33. package/types.gen.d.ts +449 -5
  34. package/types.gen.ts +468 -5
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Receivables or payables aged at a date (`$asOf`, default today): totals by
3
+ * days past due, a row per counterparty, and each entity's open items tied
4
+ * out to its receivables or payables account. `$scope` is `entity` (one
5
+ * entity's books, `$entityId` default the group parent) or `group` (the
6
+ * parent and the members consolidated in full, with what they owe each other
7
+ * set apart). A missing due date reads as due on receipt and is counted in
8
+ * `defaultedDueDateCount`; the tie-out's `differenceCents` is never plugged.
9
+ */
10
+ export declare const OPEN_ITEM_FIELDS: string;
11
+ export declare const AGED_BALANCES_FIELDS: string;
12
+ export declare const AGED_RECEIVABLES: string;
13
+ export declare const AGED_PAYABLES: string;
14
+ /**
15
+ * One counterparty's open invoices (`receivables`) or bills (`payables`) at
16
+ * a date, oldest first, each with its due date, age and bucket: the drill
17
+ * from an aged row into its documents.
18
+ */
19
+ export declare const OPEN_ITEMS_FOR_AGENT: string;
20
+ /**
21
+ * The open invoices or bills a payment or bank line may settle, an exact
22
+ * amount match first, then the oldest due date; `classifiedToControl` says
23
+ * the line went to a receivables or payables account, where the inbox offers
24
+ * the pick. The choice is recorded with `discharge_allocations` on
25
+ * `updateEventBlock`.
26
+ */
27
+ export declare const DISCHARGE_CANDIDATES: string;
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DISCHARGE_CANDIDATES = exports.OPEN_ITEMS_FOR_AGENT = exports.AGED_PAYABLES = exports.AGED_RECEIVABLES = exports.AGED_BALANCES_FIELDS = exports.OPEN_ITEM_FIELDS = void 0;
4
+ const graphql_request_1 = require("graphql-request");
5
+ /**
6
+ * Receivables or payables aged at a date (`$asOf`, default today): totals by
7
+ * days past due, a row per counterparty, and each entity's open items tied
8
+ * out to its receivables or payables account. `$scope` is `entity` (one
9
+ * entity's books, `$entityId` default the group parent) or `group` (the
10
+ * parent and the members consolidated in full, with what they owe each other
11
+ * set apart). A missing due date reads as due on receipt and is counted in
12
+ * `defaultedDueDateCount`; the tie-out's `differenceCents` is never plugged.
13
+ */
14
+ exports.OPEN_ITEM_FIELDS = (0, graphql_request_1.gql) `
15
+ fragment OpenItemFields on OpenItem {
16
+ eventId
17
+ entityId
18
+ agentId
19
+ occurredOn
20
+ documentNumber
21
+ description
22
+ originalCents
23
+ settledCents
24
+ openCents
25
+ currency
26
+ dueDate
27
+ dueDateBasis
28
+ daysPastDue
29
+ bucket
30
+ }
31
+ `;
32
+ exports.AGED_BALANCES_FIELDS = (0, graphql_request_1.gql) `
33
+ fragment AgedBalancesFields on AgedBalances {
34
+ kind
35
+ asOf
36
+ scope
37
+ entityId
38
+ memberEntityIds
39
+ buckets {
40
+ ...AgingBucketsFields
41
+ }
42
+ agents {
43
+ agentId
44
+ agentName
45
+ openItemCount
46
+ oldestDueDate
47
+ buckets {
48
+ ...AgingBucketsFields
49
+ }
50
+ }
51
+ defaultedDueDateCount
52
+ intercompany {
53
+ ...OpenItemFields
54
+ }
55
+ pairs {
56
+ creditorEntityId
57
+ debtorEntityId
58
+ receivableCents
59
+ payableCents
60
+ differenceCents
61
+ }
62
+ tieOuts {
63
+ entityId
64
+ accounts {
65
+ elementId
66
+ code
67
+ name
68
+ }
69
+ controlBalanceCents
70
+ openItemsCents
71
+ differenceCents
72
+ }
73
+ }
74
+
75
+ fragment AgingBucketsFields on AgingBuckets {
76
+ currentCents
77
+ oneToThirtyCents
78
+ thirtyOneToSixtyCents
79
+ sixtyOneToNinetyCents
80
+ overNinetyCents
81
+ unappliedCreditCents
82
+ totalCents
83
+ }
84
+ `;
85
+ exports.AGED_RECEIVABLES = (0, graphql_request_1.gql) `
86
+ query AgedReceivables($asOf: Date, $entityId: String, $scope: String! = "entity") {
87
+ agedReceivables(asOf: $asOf, entityId: $entityId, scope: $scope) {
88
+ ...AgedBalancesFields
89
+ }
90
+ }
91
+ ${exports.AGED_BALANCES_FIELDS}
92
+ ${exports.OPEN_ITEM_FIELDS}
93
+ `;
94
+ exports.AGED_PAYABLES = (0, graphql_request_1.gql) `
95
+ query AgedPayables($asOf: Date, $entityId: String, $scope: String! = "entity") {
96
+ agedPayables(asOf: $asOf, entityId: $entityId, scope: $scope) {
97
+ ...AgedBalancesFields
98
+ }
99
+ }
100
+ ${exports.AGED_BALANCES_FIELDS}
101
+ ${exports.OPEN_ITEM_FIELDS}
102
+ `;
103
+ /**
104
+ * One counterparty's open invoices (`receivables`) or bills (`payables`) at
105
+ * a date, oldest first, each with its due date, age and bucket: the drill
106
+ * from an aged row into its documents.
107
+ */
108
+ exports.OPEN_ITEMS_FOR_AGENT = (0, graphql_request_1.gql) `
109
+ query OpenItemsForAgent($agentId: String!, $kind: String!, $asOf: Date, $entityId: String) {
110
+ openItemsForAgent(agentId: $agentId, kind: $kind, asOf: $asOf, entityId: $entityId) {
111
+ ...OpenItemFields
112
+ }
113
+ }
114
+ ${exports.OPEN_ITEM_FIELDS}
115
+ `;
116
+ /**
117
+ * The open invoices or bills a payment or bank line may settle, an exact
118
+ * amount match first, then the oldest due date; `classifiedToControl` says
119
+ * the line went to a receivables or payables account, where the inbox offers
120
+ * the pick. The choice is recorded with `discharge_allocations` on
121
+ * `updateEventBlock`.
122
+ */
123
+ exports.DISCHARGE_CANDIDATES = (0, graphql_request_1.gql) `
124
+ query DischargeCandidates($eventId: String!) {
125
+ dischargeCandidates(eventId: $eventId) {
126
+ eventId
127
+ kind
128
+ amountCents
129
+ classifiedToControl
130
+ candidates {
131
+ ...OpenItemFields
132
+ }
133
+ }
134
+ }
135
+ ${exports.OPEN_ITEM_FIELDS}
136
+ `;
@@ -0,0 +1,139 @@
1
+ import { gql } from 'graphql-request'
2
+
3
+ /**
4
+ * Receivables or payables aged at a date (`$asOf`, default today): totals by
5
+ * days past due, a row per counterparty, and each entity's open items tied
6
+ * out to its receivables or payables account. `$scope` is `entity` (one
7
+ * entity's books, `$entityId` default the group parent) or `group` (the
8
+ * parent and the members consolidated in full, with what they owe each other
9
+ * set apart). A missing due date reads as due on receipt and is counted in
10
+ * `defaultedDueDateCount`; the tie-out's `differenceCents` is never plugged.
11
+ */
12
+ export const OPEN_ITEM_FIELDS = gql`
13
+ fragment OpenItemFields on OpenItem {
14
+ eventId
15
+ entityId
16
+ agentId
17
+ occurredOn
18
+ documentNumber
19
+ description
20
+ originalCents
21
+ settledCents
22
+ openCents
23
+ currency
24
+ dueDate
25
+ dueDateBasis
26
+ daysPastDue
27
+ bucket
28
+ }
29
+ `
30
+
31
+ export const AGED_BALANCES_FIELDS = gql`
32
+ fragment AgedBalancesFields on AgedBalances {
33
+ kind
34
+ asOf
35
+ scope
36
+ entityId
37
+ memberEntityIds
38
+ buckets {
39
+ ...AgingBucketsFields
40
+ }
41
+ agents {
42
+ agentId
43
+ agentName
44
+ openItemCount
45
+ oldestDueDate
46
+ buckets {
47
+ ...AgingBucketsFields
48
+ }
49
+ }
50
+ defaultedDueDateCount
51
+ intercompany {
52
+ ...OpenItemFields
53
+ }
54
+ pairs {
55
+ creditorEntityId
56
+ debtorEntityId
57
+ receivableCents
58
+ payableCents
59
+ differenceCents
60
+ }
61
+ tieOuts {
62
+ entityId
63
+ accounts {
64
+ elementId
65
+ code
66
+ name
67
+ }
68
+ controlBalanceCents
69
+ openItemsCents
70
+ differenceCents
71
+ }
72
+ }
73
+
74
+ fragment AgingBucketsFields on AgingBuckets {
75
+ currentCents
76
+ oneToThirtyCents
77
+ thirtyOneToSixtyCents
78
+ sixtyOneToNinetyCents
79
+ overNinetyCents
80
+ unappliedCreditCents
81
+ totalCents
82
+ }
83
+ `
84
+
85
+ export const AGED_RECEIVABLES = gql`
86
+ query AgedReceivables($asOf: Date, $entityId: String, $scope: String! = "entity") {
87
+ agedReceivables(asOf: $asOf, entityId: $entityId, scope: $scope) {
88
+ ...AgedBalancesFields
89
+ }
90
+ }
91
+ ${AGED_BALANCES_FIELDS}
92
+ ${OPEN_ITEM_FIELDS}
93
+ `
94
+
95
+ export const AGED_PAYABLES = gql`
96
+ query AgedPayables($asOf: Date, $entityId: String, $scope: String! = "entity") {
97
+ agedPayables(asOf: $asOf, entityId: $entityId, scope: $scope) {
98
+ ...AgedBalancesFields
99
+ }
100
+ }
101
+ ${AGED_BALANCES_FIELDS}
102
+ ${OPEN_ITEM_FIELDS}
103
+ `
104
+
105
+ /**
106
+ * One counterparty's open invoices (`receivables`) or bills (`payables`) at
107
+ * a date, oldest first, each with its due date, age and bucket: the drill
108
+ * from an aged row into its documents.
109
+ */
110
+ export const OPEN_ITEMS_FOR_AGENT = gql`
111
+ query OpenItemsForAgent($agentId: String!, $kind: String!, $asOf: Date, $entityId: String) {
112
+ openItemsForAgent(agentId: $agentId, kind: $kind, asOf: $asOf, entityId: $entityId) {
113
+ ...OpenItemFields
114
+ }
115
+ }
116
+ ${OPEN_ITEM_FIELDS}
117
+ `
118
+
119
+ /**
120
+ * The open invoices or bills a payment or bank line may settle, an exact
121
+ * amount match first, then the oldest due date; `classifiedToControl` says
122
+ * the line went to a receivables or payables account, where the inbox offers
123
+ * the pick. The choice is recorded with `discharge_allocations` on
124
+ * `updateEventBlock`.
125
+ */
126
+ export const DISCHARGE_CANDIDATES = gql`
127
+ query DischargeCandidates($eventId: String!) {
128
+ dischargeCandidates(eventId: $eventId) {
129
+ eventId
130
+ kind
131
+ amountCents
132
+ classifiedToControl
133
+ candidates {
134
+ ...OpenItemFields
135
+ }
136
+ }
137
+ }
138
+ ${OPEN_ITEM_FIELDS}
139
+ `
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The graph's management dimension members — departments, classes,
3
+ * locations, projects — by axis then name, each with how many ledger lines
4
+ * carry it. `$dimensionType` narrows to one axis; `$includeInactive` adds
5
+ * retired members, which stay on the lines that carry them.
6
+ */
7
+ export declare const LIST_DIMENSIONS: string;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LIST_DIMENSIONS = void 0;
4
+ const graphql_request_1 = require("graphql-request");
5
+ /**
6
+ * The graph's management dimension members — departments, classes,
7
+ * locations, projects — by axis then name, each with how many ledger lines
8
+ * carry it. `$dimensionType` narrows to one axis; `$includeInactive` adds
9
+ * retired members, which stay on the lines that carry them.
10
+ */
11
+ exports.LIST_DIMENSIONS = (0, graphql_request_1.gql) `
12
+ query ListLedgerDimensions($dimensionType: String, $includeInactive: Boolean! = false) {
13
+ dimensions(dimensionType: $dimensionType, includeInactive: $includeInactive) {
14
+ types
15
+ dimensions {
16
+ id
17
+ dimensionType
18
+ name
19
+ value
20
+ source
21
+ isActive
22
+ lineCount
23
+ createdAt
24
+ }
25
+ }
26
+ }
27
+ `;
@@ -0,0 +1,25 @@
1
+ import { gql } from 'graphql-request'
2
+
3
+ /**
4
+ * The graph's management dimension members — departments, classes,
5
+ * locations, projects — by axis then name, each with how many ledger lines
6
+ * carry it. `$dimensionType` narrows to one axis; `$includeInactive` adds
7
+ * retired members, which stay on the lines that carry them.
8
+ */
9
+ export const LIST_DIMENSIONS = gql`
10
+ query ListLedgerDimensions($dimensionType: String, $includeInactive: Boolean! = false) {
11
+ dimensions(dimensionType: $dimensionType, includeInactive: $includeInactive) {
12
+ types
13
+ dimensions {
14
+ id
15
+ dimensionType
16
+ name
17
+ value
18
+ source
19
+ isActive
20
+ lineCount
21
+ createdAt
22
+ }
23
+ }
24
+ }
25
+ `
@@ -65,6 +65,11 @@ exports.LIST_JOURNAL_ENTRIES = (0, graphql_request_1.gql) `
65
65
  description
66
66
  lineOrder
67
67
  flowQname
68
+ dimensions {
69
+ id
70
+ dimensionType
71
+ name
72
+ }
68
73
  }
69
74
  }
70
75
  pagination {
@@ -63,6 +63,11 @@ export const LIST_JOURNAL_ENTRIES = gql`
63
63
  description
64
64
  lineOrder
65
65
  flowQname
66
+ dimensions {
67
+ id
68
+ dimensionType
69
+ name
70
+ }
66
71
  }
67
72
  }
68
73
  pagination {
@@ -42,6 +42,12 @@ exports.GET_TRANSACTION = (0, graphql_request_1.gql) `
42
42
  creditAmount
43
43
  description
44
44
  lineOrder
45
+ flowQname
46
+ dimensions {
47
+ id
48
+ dimensionType
49
+ name
50
+ }
45
51
  }
46
52
  }
47
53
  }
@@ -40,6 +40,12 @@ export const GET_TRANSACTION = gql`
40
40
  creditAmount
41
41
  description
42
42
  lineOrder
43
+ flowQname
44
+ dimensions {
45
+ id
46
+ dimensionType
47
+ name
48
+ }
43
49
  }
44
50
  }
45
51
  }
@@ -2,6 +2,9 @@
2
2
  * Trial balance for a period.
3
3
  *
4
4
  * Both dates are optional — omitting them returns a cumulative trial
5
- * balance from inception to now.
5
+ * balance from inception to now. `$dimensionType` with
6
+ * `$dimensionMemberId` sums one management dimension member's lines
7
+ * (`unallocated` for the untagged ones); such a balance need not foot, and
8
+ * says so in `sliced`.
6
9
  */
7
10
  export declare const GET_TRIAL_BALANCE: string;
@@ -6,13 +6,29 @@ const graphql_request_1 = require("graphql-request");
6
6
  * Trial balance for a period.
7
7
  *
8
8
  * Both dates are optional — omitting them returns a cumulative trial
9
- * balance from inception to now.
9
+ * balance from inception to now. `$dimensionType` with
10
+ * `$dimensionMemberId` sums one management dimension member's lines
11
+ * (`unallocated` for the untagged ones); such a balance need not foot, and
12
+ * says so in `sliced`.
10
13
  */
11
14
  exports.GET_TRIAL_BALANCE = (0, graphql_request_1.gql) `
12
- query GetLedgerTrialBalance($startDate: Date, $endDate: Date, $entityId: String) {
13
- trialBalance(startDate: $startDate, endDate: $endDate, entityId: $entityId) {
15
+ query GetLedgerTrialBalance(
16
+ $startDate: Date
17
+ $endDate: Date
18
+ $entityId: String
19
+ $dimensionType: String
20
+ $dimensionMemberId: String
21
+ ) {
22
+ trialBalance(
23
+ startDate: $startDate
24
+ endDate: $endDate
25
+ entityId: $entityId
26
+ dimensionType: $dimensionType
27
+ dimensionMemberId: $dimensionMemberId
28
+ ) {
14
29
  totalDebits
15
30
  totalCredits
31
+ sliced
16
32
  rows {
17
33
  accountId
18
34
  accountCode
@@ -4,13 +4,29 @@ import { gql } from 'graphql-request'
4
4
  * Trial balance for a period.
5
5
  *
6
6
  * Both dates are optional — omitting them returns a cumulative trial
7
- * balance from inception to now.
7
+ * balance from inception to now. `$dimensionType` with
8
+ * `$dimensionMemberId` sums one management dimension member's lines
9
+ * (`unallocated` for the untagged ones); such a balance need not foot, and
10
+ * says so in `sliced`.
8
11
  */
9
12
  export const GET_TRIAL_BALANCE = gql`
10
- query GetLedgerTrialBalance($startDate: Date, $endDate: Date, $entityId: String) {
11
- trialBalance(startDate: $startDate, endDate: $endDate, entityId: $entityId) {
13
+ query GetLedgerTrialBalance(
14
+ $startDate: Date
15
+ $endDate: Date
16
+ $entityId: String
17
+ $dimensionType: String
18
+ $dimensionMemberId: String
19
+ ) {
20
+ trialBalance(
21
+ startDate: $startDate
22
+ endDate: $endDate
23
+ entityId: $entityId
24
+ dimensionType: $dimensionType
25
+ dimensionMemberId: $dimensionMemberId
26
+ ) {
12
27
  totalDebits
13
28
  totalCredits
29
+ sliced
14
30
  rows {
15
31
  accountId
16
32
  accountCode