@spaceinvoices/js-sdk 11.0.0 → 11.1.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.
- package/dist/generated/entity-stats/entity-stats.d.cts +7 -3
- package/dist/generated/entity-stats/entity-stats.d.ts +7 -3
- package/dist/generated/model/statsQueryRequestTable.d.cts +1 -0
- package/dist/generated/model/statsQueryRequestTable.d.ts +1 -0
- package/dist/generated-zod/entity-stats/entity-stats.d.cts +9 -3
- package/dist/generated-zod/entity-stats/entity-stats.d.ts +9 -3
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import type { Error, StatsQueryBatchRequest, StatsQueryBatchResponse, Validation
|
|
|
11
11
|
|
|
12
12
|
Send an array of 1-25 queries. Queries share one read-only database snapshot and results are returned in the same order.
|
|
13
13
|
|
|
14
|
-
**Available tables**: invoices, estimates, credit_notes, advance_invoices, payments, customers, items, invoice_taxes, credit_note_taxes
|
|
14
|
+
**Available tables**: invoices, estimates, credit_notes, advance_invoices, payments, customers, items, invoice_taxes, credit_note_taxes, expenses
|
|
15
15
|
|
|
16
16
|
**Metric types**: count, sum, avg, min, max
|
|
17
17
|
|
|
@@ -26,10 +26,14 @@ Send an array of 1-25 queries. Queries share one read-only database snapshot and
|
|
|
26
26
|
- Include a sum of `financial_conversion_missing` in every financial query. A positive result means the aggregate is incomplete and must be shown as unavailable, rather than treating omitted conversion values as zero. For limited rankings, check missing conversions across the whole eligible population in a separate query before presenting the ranking. Historical copied foreign amounts without conversion evidence are not treated as valid 1:1 conversions.
|
|
27
27
|
- Group invoice sales by `customer_key` and `customer_display_name` to keep linked customers stable across name changes; unlinked snapshots use a normalized-name fallback.
|
|
28
28
|
- Date filters are inclusive calendar dates. Invoice overdue fields use the entity timezone; callers should construct reporting periods in that same timezone.
|
|
29
|
+
- Expenses use the same `financial_eligible`, `financial_gross_converted`, `financial_conversion_missing`, `total_due_converted` and `overdue_bucket` fields as invoices, by expense date; `supplier_key`/`supplier_display_name` group by stable supplier identity.
|
|
29
30
|
|
|
30
31
|
**Virtual fields for group_by**:
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
32
|
+
- `day` - Calendar day (YYYY-MM-DD)
|
|
33
|
+
- `week` - ISO week (YYYY-Www, ISO-8601 week-numbering year)
|
|
34
|
+
- `month` - Month (YYYY-MM)
|
|
35
|
+
- `quarter` - Quarter (YYYY-Qn)
|
|
36
|
+
- `year` - Year (YYYY)
|
|
33
37
|
- `overdue_bucket` - Invoice aging bucket (current, 1-30, 31-60, 61-90, 90+)
|
|
34
38
|
|
|
35
39
|
**Example — single query (monthly revenue)**:
|
|
@@ -11,7 +11,7 @@ import type { Error, StatsQueryBatchRequest, StatsQueryBatchResponse, Validation
|
|
|
11
11
|
|
|
12
12
|
Send an array of 1-25 queries. Queries share one read-only database snapshot and results are returned in the same order.
|
|
13
13
|
|
|
14
|
-
**Available tables**: invoices, estimates, credit_notes, advance_invoices, payments, customers, items, invoice_taxes, credit_note_taxes
|
|
14
|
+
**Available tables**: invoices, estimates, credit_notes, advance_invoices, payments, customers, items, invoice_taxes, credit_note_taxes, expenses
|
|
15
15
|
|
|
16
16
|
**Metric types**: count, sum, avg, min, max
|
|
17
17
|
|
|
@@ -26,10 +26,14 @@ Send an array of 1-25 queries. Queries share one read-only database snapshot and
|
|
|
26
26
|
- Include a sum of `financial_conversion_missing` in every financial query. A positive result means the aggregate is incomplete and must be shown as unavailable, rather than treating omitted conversion values as zero. For limited rankings, check missing conversions across the whole eligible population in a separate query before presenting the ranking. Historical copied foreign amounts without conversion evidence are not treated as valid 1:1 conversions.
|
|
27
27
|
- Group invoice sales by `customer_key` and `customer_display_name` to keep linked customers stable across name changes; unlinked snapshots use a normalized-name fallback.
|
|
28
28
|
- Date filters are inclusive calendar dates. Invoice overdue fields use the entity timezone; callers should construct reporting periods in that same timezone.
|
|
29
|
+
- Expenses use the same `financial_eligible`, `financial_gross_converted`, `financial_conversion_missing`, `total_due_converted` and `overdue_bucket` fields as invoices, by expense date; `supplier_key`/`supplier_display_name` group by stable supplier identity.
|
|
29
30
|
|
|
30
31
|
**Virtual fields for group_by**:
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
32
|
+
- `day` - Calendar day (YYYY-MM-DD)
|
|
33
|
+
- `week` - ISO week (YYYY-Www, ISO-8601 week-numbering year)
|
|
34
|
+
- `month` - Month (YYYY-MM)
|
|
35
|
+
- `quarter` - Quarter (YYYY-Qn)
|
|
36
|
+
- `year` - Year (YYYY)
|
|
33
37
|
- `overdue_bucket` - Invoice aging bucket (current, 1-30, 31-60, 61-90, 90+)
|
|
34
38
|
|
|
35
39
|
**Example — single query (monthly revenue)**:
|
|
@@ -11,7 +11,7 @@ import * as zod from "zod";
|
|
|
11
11
|
|
|
12
12
|
Send an array of 1-25 queries. Queries share one read-only database snapshot and results are returned in the same order.
|
|
13
13
|
|
|
14
|
-
**Available tables**: invoices, estimates, credit_notes, advance_invoices, payments, customers, items, invoice_taxes, credit_note_taxes
|
|
14
|
+
**Available tables**: invoices, estimates, credit_notes, advance_invoices, payments, customers, items, invoice_taxes, credit_note_taxes, expenses
|
|
15
15
|
|
|
16
16
|
**Metric types**: count, sum, avg, min, max
|
|
17
17
|
|
|
@@ -26,10 +26,14 @@ Send an array of 1-25 queries. Queries share one read-only database snapshot and
|
|
|
26
26
|
- Include a sum of `financial_conversion_missing` in every financial query. A positive result means the aggregate is incomplete and must be shown as unavailable, rather than treating omitted conversion values as zero. For limited rankings, check missing conversions across the whole eligible population in a separate query before presenting the ranking. Historical copied foreign amounts without conversion evidence are not treated as valid 1:1 conversions.
|
|
27
27
|
- Group invoice sales by `customer_key` and `customer_display_name` to keep linked customers stable across name changes; unlinked snapshots use a normalized-name fallback.
|
|
28
28
|
- Date filters are inclusive calendar dates. Invoice overdue fields use the entity timezone; callers should construct reporting periods in that same timezone.
|
|
29
|
+
- Expenses use the same `financial_eligible`, `financial_gross_converted`, `financial_conversion_missing`, `total_due_converted` and `overdue_bucket` fields as invoices, by expense date; `supplier_key`/`supplier_display_name` group by stable supplier identity.
|
|
29
30
|
|
|
30
31
|
**Virtual fields for group_by**:
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
32
|
+
- `day` - Calendar day (YYYY-MM-DD)
|
|
33
|
+
- `week` - ISO week (YYYY-Www, ISO-8601 week-numbering year)
|
|
34
|
+
- `month` - Month (YYYY-MM)
|
|
35
|
+
- `quarter` - Quarter (YYYY-Qn)
|
|
36
|
+
- `year` - Year (YYYY)
|
|
33
37
|
- `overdue_bucket` - Invoice aging bucket (current, 1-30, 31-60, 61-90, 90+)
|
|
34
38
|
|
|
35
39
|
**Example — single query (monthly revenue)**:
|
|
@@ -82,6 +86,7 @@ export declare const QueryEntityStatsBodyItem: zod.ZodObject<{
|
|
|
82
86
|
items: "items";
|
|
83
87
|
invoice_taxes: "invoice_taxes";
|
|
84
88
|
credit_note_taxes: "credit_note_taxes";
|
|
89
|
+
expenses: "expenses";
|
|
85
90
|
}>;
|
|
86
91
|
date_from: zod.ZodOptional<zod.ZodString>;
|
|
87
92
|
date_to: zod.ZodOptional<zod.ZodString>;
|
|
@@ -118,6 +123,7 @@ export declare const QueryEntityStatsBody: zod.ZodArray<zod.ZodObject<{
|
|
|
118
123
|
items: "items";
|
|
119
124
|
invoice_taxes: "invoice_taxes";
|
|
120
125
|
credit_note_taxes: "credit_note_taxes";
|
|
126
|
+
expenses: "expenses";
|
|
121
127
|
}>;
|
|
122
128
|
date_from: zod.ZodOptional<zod.ZodString>;
|
|
123
129
|
date_to: zod.ZodOptional<zod.ZodString>;
|
|
@@ -11,7 +11,7 @@ import * as zod from "zod";
|
|
|
11
11
|
|
|
12
12
|
Send an array of 1-25 queries. Queries share one read-only database snapshot and results are returned in the same order.
|
|
13
13
|
|
|
14
|
-
**Available tables**: invoices, estimates, credit_notes, advance_invoices, payments, customers, items, invoice_taxes, credit_note_taxes
|
|
14
|
+
**Available tables**: invoices, estimates, credit_notes, advance_invoices, payments, customers, items, invoice_taxes, credit_note_taxes, expenses
|
|
15
15
|
|
|
16
16
|
**Metric types**: count, sum, avg, min, max
|
|
17
17
|
|
|
@@ -26,10 +26,14 @@ Send an array of 1-25 queries. Queries share one read-only database snapshot and
|
|
|
26
26
|
- Include a sum of `financial_conversion_missing` in every financial query. A positive result means the aggregate is incomplete and must be shown as unavailable, rather than treating omitted conversion values as zero. For limited rankings, check missing conversions across the whole eligible population in a separate query before presenting the ranking. Historical copied foreign amounts without conversion evidence are not treated as valid 1:1 conversions.
|
|
27
27
|
- Group invoice sales by `customer_key` and `customer_display_name` to keep linked customers stable across name changes; unlinked snapshots use a normalized-name fallback.
|
|
28
28
|
- Date filters are inclusive calendar dates. Invoice overdue fields use the entity timezone; callers should construct reporting periods in that same timezone.
|
|
29
|
+
- Expenses use the same `financial_eligible`, `financial_gross_converted`, `financial_conversion_missing`, `total_due_converted` and `overdue_bucket` fields as invoices, by expense date; `supplier_key`/`supplier_display_name` group by stable supplier identity.
|
|
29
30
|
|
|
30
31
|
**Virtual fields for group_by**:
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
32
|
+
- `day` - Calendar day (YYYY-MM-DD)
|
|
33
|
+
- `week` - ISO week (YYYY-Www, ISO-8601 week-numbering year)
|
|
34
|
+
- `month` - Month (YYYY-MM)
|
|
35
|
+
- `quarter` - Quarter (YYYY-Qn)
|
|
36
|
+
- `year` - Year (YYYY)
|
|
33
37
|
- `overdue_bucket` - Invoice aging bucket (current, 1-30, 31-60, 61-90, 90+)
|
|
34
38
|
|
|
35
39
|
**Example — single query (monthly revenue)**:
|
|
@@ -82,6 +86,7 @@ export declare const QueryEntityStatsBodyItem: zod.ZodObject<{
|
|
|
82
86
|
items: "items";
|
|
83
87
|
invoice_taxes: "invoice_taxes";
|
|
84
88
|
credit_note_taxes: "credit_note_taxes";
|
|
89
|
+
expenses: "expenses";
|
|
85
90
|
}>;
|
|
86
91
|
date_from: zod.ZodOptional<zod.ZodString>;
|
|
87
92
|
date_to: zod.ZodOptional<zod.ZodString>;
|
|
@@ -118,6 +123,7 @@ export declare const QueryEntityStatsBody: zod.ZodArray<zod.ZodObject<{
|
|
|
118
123
|
items: "items";
|
|
119
124
|
invoice_taxes: "invoice_taxes";
|
|
120
125
|
credit_note_taxes: "credit_note_taxes";
|
|
126
|
+
expenses: "expenses";
|
|
121
127
|
}>;
|
|
122
128
|
date_from: zod.ZodOptional<zod.ZodString>;
|
|
123
129
|
date_to: zod.ZodOptional<zod.ZodString>;
|