bruce-models 7.1.128 → 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.
@@ -0,0 +1,131 @@
1
+ import { Api } from "../api/api";
2
+ import { BruceApi } from "../api/bruce-api";
3
+ import { ReportTemplate } from "./report-template";
4
+ /**
5
+ * Ordered sections belonging to a single Report Template; every route requires the owning template ID.
6
+ * Access can be granted directly or inherited through the parent template's permissions.
7
+ */
8
+ export declare namespace ReportTemplateSection {
9
+ /**
10
+ * JSON settings specific to a section; the API does not prescribe their internal schema.
11
+ */
12
+ type TSettings = {
13
+ [key: string]: unknown;
14
+ };
15
+ /**
16
+ * A section whose identity and owning template are controlled by the request path.
17
+ */
18
+ interface ISection {
19
+ /**
20
+ * Database-assigned bigint identity. Omit or use 0 when creating a section.
21
+ */
22
+ ID?: ReportTemplate.TId;
23
+ /**
24
+ * Identity of the owning template; ignored in the body when the route specifies a parent.
25
+ */
26
+ "ReportTemplate.ID"?: ReportTemplate.TId;
27
+ /**
28
+ * Signed 32-bit integer position, ascending; defaults to 1 when omitted on creation.
29
+ */
30
+ DisplayOrder?: number;
31
+ /**
32
+ * Section heading, required on creation; 1 to 200 characters and not entirely whitespace.
33
+ */
34
+ Title?: string;
35
+ /**
36
+ * Settings for this section. Null clears them; omission preserves them on update.
37
+ */
38
+ Settings?: TSettings | null;
39
+ }
40
+ /**
41
+ * Inputs for reading a section through the template that owns it.
42
+ */
43
+ interface IGetParams {
44
+ api?: BruceApi.Api;
45
+ reportTemplateId: ReportTemplate.TId;
46
+ /**
47
+ * Positive identity of a section belonging to reportTemplateId.
48
+ */
49
+ sectionId: ReportTemplate.TId;
50
+ req?: Api.IReqParams;
51
+ }
52
+ /**
53
+ * The section returned by a single-record read.
54
+ */
55
+ interface IGetRes {
56
+ reportTemplateSection: ISection;
57
+ }
58
+ /**
59
+ * Inputs for listing sections within an existing template; no paging is supported.
60
+ */
61
+ interface IGetListParams {
62
+ api?: BruceApi.Api;
63
+ reportTemplateId: ReportTemplate.TId;
64
+ req?: Api.IReqParams;
65
+ }
66
+ /**
67
+ * Visible sections ordered by DisplayOrder ascending, then ID ascending to break ties.
68
+ */
69
+ interface IGetListRes {
70
+ reportTemplateSections: ISection[];
71
+ }
72
+ /**
73
+ * Inputs for creating or updating a section; the path always controls its parent and identity.
74
+ */
75
+ interface IUpdateParams {
76
+ api?: BruceApi.Api;
77
+ /**
78
+ * Explicit parent takes precedence over reportTemplateSection["ReportTemplate.ID"].
79
+ */
80
+ reportTemplateId?: ReportTemplate.TId;
81
+ /**
82
+ * Overrides the section's ID. Omit both section IDs, or use 0, to create under the parent.
83
+ */
84
+ sectionId?: ReportTemplate.TId;
85
+ /**
86
+ * Fields to save. Title is required on creation; omitted fields are preserved on update.
87
+ */
88
+ reportTemplateSection: ISection;
89
+ req?: Api.IReqParams;
90
+ }
91
+ /**
92
+ * The saved section, including its server-assigned identity and owning template.
93
+ */
94
+ interface IUpdateRes {
95
+ reportTemplateSection: ISection;
96
+ }
97
+ /**
98
+ * Inputs for deleting a section through its owning template.
99
+ */
100
+ interface IDeleteParams {
101
+ api?: BruceApi.Api;
102
+ reportTemplateId: ReportTemplate.TId;
103
+ sectionId: ReportTemplate.TId;
104
+ req?: Api.IReqParams;
105
+ }
106
+ /**
107
+ * Reads one section; a section belonging to another template is rejected by the server.
108
+ */
109
+ function Get(params: IGetParams): Promise<IGetRes>;
110
+ /**
111
+ * Lists visible sections of a template in display order, filtered by the caller's permissions.
112
+ */
113
+ function GetList(params: IGetListParams): Promise<IGetListRes>;
114
+ /**
115
+ * Creates with section ID 0 or updates under an existing parent; Settings accepts null to clear it.
116
+ * The server ignores body IDs, preserves omitted fields and never moves a section to another parent.
117
+ */
118
+ function Update(params: IUpdateParams): Promise<IUpdateRes>;
119
+ /**
120
+ * Deletes only the identified section, preserving its template and sibling sections.
121
+ */
122
+ function Delete(params: IDeleteParams): Promise<void>;
123
+ /**
124
+ * Cache identifier scoped to both parent and section, so another parent's read cannot reuse it.
125
+ */
126
+ function GetCacheKey(reportTemplateId: ReportTemplate.TId, sectionId: ReportTemplate.TId): string;
127
+ /**
128
+ * Cache identifier for one template's visible section list.
129
+ */
130
+ function GetListCacheKey(reportTemplateId: ReportTemplate.TId): string;
131
+ }
@@ -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
+ }
@@ -0,0 +1,39 @@
1
+ import { Api } from "../api/api";
2
+ import { GuardianApi } from "../api/guardian-api";
3
+ /**
4
+ * Guardian's record of sign-ins and other access, such as an access token used directly.
5
+ * Reading it needs account admin for an account, or super user for every account.
6
+ */
7
+ export declare namespace UserAccessLog {
8
+ /**
9
+ * Describes an access log record.
10
+ */
11
+ interface IRecord {
12
+ Username: string;
13
+ "ClientAccount.ID"?: string;
14
+ Created: string;
15
+ IsLogin: boolean;
16
+ Type: string;
17
+ Success: boolean;
18
+ Message?: string;
19
+ UserAgent?: string;
20
+ IP?: string;
21
+ Environment?: string;
22
+ }
23
+ /**
24
+ * Returns access log records, newest first, or each user's newest one when grouped by user.
25
+ */
26
+ function GetList(params: {
27
+ api?: GuardianApi.Api;
28
+ accountId?: string;
29
+ userIds?: string[];
30
+ groupByUser?: boolean;
31
+ isLogin?: boolean | "*";
32
+ success?: boolean;
33
+ pageSize?: number;
34
+ pageIndex?: number;
35
+ req?: Api.IReqParams;
36
+ }): Promise<{
37
+ records: IRecord[];
38
+ }>;
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bruce-models",
3
- "version": "7.1.128",
3
+ "version": "7.1.130",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/bruce-models.umd.js",