bruce-models 7.1.129 → 7.1.130
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/bruce-models.es5.js +239 -2
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +228 -1
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-concept.js +5 -0
- package/dist/lib/account/account-concept.js.map +1 -1
- package/dist/lib/api/api.js +2 -0
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/bruce-models.js +3 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/report/report-template-section.js +116 -0
- package/dist/lib/report/report-template-section.js.map +1 -0
- package/dist/lib/report/report-template.js +131 -0
- package/dist/lib/report/report-template.js.map +1 -0
- package/dist/lib/server/record-change-feed.js +12 -0
- package/dist/lib/server/record-change-feed.js.map +1 -1
- package/dist/types/account/account-concept.d.ts +2 -0
- package/dist/types/api/api.d.ts +2 -0
- package/dist/types/bruce-models.d.ts +3 -1
- package/dist/types/report/report-template-section.d.ts +131 -0
- package/dist/types/report/report-template.d.ts +136 -0
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Api } from "../api/api";
|
|
2
|
+
import { BruceApi } from "../api/bruce-api";
|
|
3
|
+
/**
|
|
4
|
+
* Reusable report definitions whose ordered sections are separate ReportTemplateSection records.
|
|
5
|
+
* These calls require an API deployment that supports the Report Template concepts.
|
|
6
|
+
*/
|
|
7
|
+
export declare namespace ReportTemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Database bigint identity; decimal strings preserve IDs beyond JavaScript's safe integer range.
|
|
10
|
+
*/
|
|
11
|
+
type TId = number | string;
|
|
12
|
+
/**
|
|
13
|
+
* JSON settings for the report's main structure; the API does not prescribe their internal schema.
|
|
14
|
+
*/
|
|
15
|
+
type TSettings = {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A report template, without its sections; load those through ReportTemplateSection.GetList.
|
|
20
|
+
*/
|
|
21
|
+
interface ITemplate {
|
|
22
|
+
/**
|
|
23
|
+
* Database-assigned identity. Omit or use 0 when creating a template.
|
|
24
|
+
*/
|
|
25
|
+
ID?: TId;
|
|
26
|
+
/**
|
|
27
|
+
* Display name, required on creation; 1 to 200 characters and not entirely whitespace.
|
|
28
|
+
*/
|
|
29
|
+
Name?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Optional explanation of the template's purpose. Null clears it on update.
|
|
32
|
+
*/
|
|
33
|
+
Description?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Server-assigned creator, preserved on update and ignored in request bodies.
|
|
36
|
+
*/
|
|
37
|
+
"Created.ByUser.ID"?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Server-assigned creation time in ISO 8601 format, preserved on update.
|
|
40
|
+
*/
|
|
41
|
+
"Created.DateTime"?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Main report settings. Null clears them; section settings belong on each section record.
|
|
44
|
+
*/
|
|
45
|
+
Settings?: TSettings | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Inputs for reading a single template in the current account and session.
|
|
49
|
+
*/
|
|
50
|
+
interface IGetParams {
|
|
51
|
+
api?: BruceApi.Api;
|
|
52
|
+
/**
|
|
53
|
+
* Positive identity of the template to read.
|
|
54
|
+
*/
|
|
55
|
+
reportTemplateId: TId;
|
|
56
|
+
req?: Api.IReqParams;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The template returned by a single-record read or save.
|
|
60
|
+
*/
|
|
61
|
+
interface IGetRes {
|
|
62
|
+
reportTemplate: ITemplate;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Inputs for listing all templates visible to the current account session; no paging is supported.
|
|
66
|
+
*/
|
|
67
|
+
interface IGetListParams {
|
|
68
|
+
api?: BruceApi.Api;
|
|
69
|
+
req?: Api.IReqParams;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Visible templates ordered by Name ascending, then ID ascending to break ties.
|
|
73
|
+
*/
|
|
74
|
+
interface IGetListRes {
|
|
75
|
+
reportTemplates: ITemplate[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Inputs for creating or updating a template; omitted fields retain their existing values.
|
|
79
|
+
*/
|
|
80
|
+
interface IUpdateParams {
|
|
81
|
+
api?: BruceApi.Api;
|
|
82
|
+
/**
|
|
83
|
+
* Template fields to save. Name is required when creating; metadata is server-controlled.
|
|
84
|
+
*/
|
|
85
|
+
reportTemplate: ITemplate;
|
|
86
|
+
/**
|
|
87
|
+
* Overrides reportTemplate.ID. Omit both IDs, or use 0, to create a template.
|
|
88
|
+
*/
|
|
89
|
+
reportTemplateId?: TId;
|
|
90
|
+
req?: Api.IReqParams;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The saved template, including its identity and creation metadata.
|
|
94
|
+
*/
|
|
95
|
+
interface IUpdateRes {
|
|
96
|
+
reportTemplate: ITemplate;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Inputs for deleting a template and all of its sections atomically.
|
|
100
|
+
*/
|
|
101
|
+
interface IDeleteParams {
|
|
102
|
+
api?: BruceApi.Api;
|
|
103
|
+
reportTemplateId: TId;
|
|
104
|
+
req?: Api.IReqParams;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Validates and normalizes a signed 64-bit identity for routes and cache keys without rounding it.
|
|
108
|
+
* Zero is accepted only for creation; decimal strings can represent the full positive bigint range.
|
|
109
|
+
*/
|
|
110
|
+
function NormalizeId(id: TId, allowZero?: boolean): string;
|
|
111
|
+
/**
|
|
112
|
+
* Reads a template by ID, subject to the caller's template view permission.
|
|
113
|
+
*/
|
|
114
|
+
function Get(params: IGetParams): Promise<IGetRes>;
|
|
115
|
+
/**
|
|
116
|
+
* Lists visible templates in name order; the server filters out records the caller cannot view.
|
|
117
|
+
*/
|
|
118
|
+
function GetList(params?: IGetListParams): Promise<IGetListRes>;
|
|
119
|
+
/**
|
|
120
|
+
* Creates with ID 0 or updates the identified template, preserving omitted fields on the server.
|
|
121
|
+
* Explicit null clears Description or Settings; identity and creation metadata come from the server.
|
|
122
|
+
*/
|
|
123
|
+
function Update(params: IUpdateParams): Promise<IUpdateRes>;
|
|
124
|
+
/**
|
|
125
|
+
* Deletes a template and every section it owns; requires template delete permission.
|
|
126
|
+
*/
|
|
127
|
+
function Delete(params: IDeleteParams): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Cache identifier for one template, shared by numeric IDs and their decimal string equivalents.
|
|
130
|
+
*/
|
|
131
|
+
function GetCacheKey(reportTemplateId: TId): string;
|
|
132
|
+
/**
|
|
133
|
+
* Cache identifier for the account's visible template list.
|
|
134
|
+
*/
|
|
135
|
+
function GetListCacheKey(): string;
|
|
136
|
+
}
|