@filipebraida/adonis-function-points 0.4.0 → 0.6.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/CHANGELOG.md +155 -0
- package/README.md +101 -281
- package/build/{calibration-8eV8CEix.js → calibration-DVIf8hcE.js} +42 -3
- package/build/commands/main.js +6 -6
- package/build/{fp_calibrate-DLZP5bUp.js → fp_calibrate-EAuAtdbq.js} +1 -1
- package/build/{fp_count-DNSwaLUD.js → fp_count-CZ0cUUBQ.js} +1 -1
- package/build/{fp_diff-CCKxqGKh.js → fp_diff-BTg_LX0r.js} +1 -1
- package/build/{fp_explain-Dpiby5Qx.js → fp_explain-D6QvDLKQ.js} +1 -1
- package/build/{fp_inventory-DHwZzEQf.js → fp_inventory-C43fU39x.js} +1 -1
- package/build/{fp_metrics-M84qLYaE.js → fp_metrics-DEMPk4xC.js} +1 -1
- package/build/index.d.ts +8 -4
- package/build/index.js +4 -4
- package/build/{pipeline-Dm9KvUvF.js → pipeline-Cq4dNTNE.js} +841 -264
- package/build/{resolvers-vMahHkAd.js → resolvers-DlKJOZnk.js} +373 -63
- package/build/{runners-DetZGfh5.js → runners-FYmPIPub.js} +12 -4
- package/build/src/albrecht/counter.d.ts +31 -5
- package/build/src/albrecht/data_functions.d.ts +49 -3
- package/build/src/albrecht/diff.d.ts +27 -0
- package/build/src/albrecht/index.d.ts +1 -0
- package/build/src/albrecht/opaque.d.ts +90 -0
- package/build/src/albrecht/technical_filter.d.ts +18 -11
- package/build/src/albrecht/transactional_functions.d.ts +7 -0
- package/build/src/cli.js +2 -2
- package/build/src/define_config.d.ts +55 -57
- package/build/src/inventory/graph/call_graph.d.ts +39 -0
- package/build/src/inventory/graph/output_fields.d.ts +99 -0
- package/build/src/inventory/paths.d.ts +3 -0
- package/build/src/inventory/resolvers/index.d.ts +28 -0
- package/build/src/inventory/resolvers/index.js +2 -2
- package/build/src/inventory/resolvers/types.d.ts +19 -0
- package/build/src/pipeline.js +1 -1
- package/build/src/types.d.ts +32 -1
- package/build/stubs/config.stub +29 -16
- package/package.json +1 -1
package/build/src/types.d.ts
CHANGED
|
@@ -45,6 +45,17 @@ export type Attribute = {
|
|
|
45
45
|
name: string;
|
|
46
46
|
type?: string;
|
|
47
47
|
isIdentifier: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Maintained by the framework, not by the user: `autoCreate` / `autoUpdate`
|
|
50
|
+
* on a `@column.dateTime()`. Not a DET, on the same ground as the identifier —
|
|
51
|
+
* counting-decisions §6.
|
|
52
|
+
*/
|
|
53
|
+
system?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* `serializeAs: null`: Lucid never serialises it, so it never leaves on an
|
|
56
|
+
* output. Still a DET of the data function — counting-decisions §6.
|
|
57
|
+
*/
|
|
58
|
+
hidden?: boolean;
|
|
48
59
|
provenance: Provenance;
|
|
49
60
|
};
|
|
50
61
|
/**
|
|
@@ -84,6 +95,8 @@ export type HandlerBehavior = {
|
|
|
84
95
|
writes: boolean;
|
|
85
96
|
/** DataStores reached (ids) */
|
|
86
97
|
touches: string[];
|
|
98
|
+
/** of those, the ones this transaction writes — §6.5.4 is per store, not per request */
|
|
99
|
+
writtenStores: string[];
|
|
87
100
|
/** declared input fields (validators) */
|
|
88
101
|
inputFields: Field[];
|
|
89
102
|
/**
|
|
@@ -103,8 +116,26 @@ export type HandlerBehavior = {
|
|
|
103
116
|
requestFields: Field[];
|
|
104
117
|
/** the transaction reads the request in a way that enumerates nothing */
|
|
105
118
|
opaqueRequest: boolean;
|
|
106
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* What a transformer on the path emits — counting-decisions §6. Empty means no
|
|
121
|
+
* transformer was reached and the output is counted from the stores' columns.
|
|
122
|
+
*/
|
|
107
123
|
outputFields: Field[];
|
|
124
|
+
/** output spreads the analysis could not read: 1 DET each, a floor */
|
|
125
|
+
opaqueOutputFields: Field[];
|
|
126
|
+
/** stores a transformer on the path is for: their keys leave, not their columns */
|
|
127
|
+
transformedStores: string[];
|
|
128
|
+
/**
|
|
129
|
+
* How each store was read: rows whole, `.select()` columns, or one aggregate
|
|
130
|
+
* scalar; by its own chain (`direct`) or preloaded through another store (`via`).
|
|
131
|
+
*/
|
|
132
|
+
outputReads: Record<string, {
|
|
133
|
+
whole: boolean;
|
|
134
|
+
selected: string[];
|
|
135
|
+
aggregate: boolean;
|
|
136
|
+
direct: boolean;
|
|
137
|
+
via: string[];
|
|
138
|
+
}>;
|
|
108
139
|
/** path walked through the call graph — what `fp:explain` prints */
|
|
109
140
|
trace: TraceStep[];
|
|
110
141
|
/** calls no resolver knew how to follow */
|
package/build/stubs/config.stub
CHANGED
|
@@ -24,31 +24,44 @@ export default defineConfig({
|
|
|
24
24
|
business: [],
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* How tables fold into data functions (RET). `usage`, the default: a
|
|
29
|
+
* `hasMany`/`hasOne` child no application code addresses directly is a RET of
|
|
30
|
+
* its parent, not an ILF of its own. `none` keeps every table apart, at RET 1,
|
|
31
|
+
* to compare against a count made before 0.6.0.
|
|
32
|
+
*/
|
|
33
|
+
// dataFunctions: { grouping: 'usage' },
|
|
29
34
|
|
|
30
|
-
/** How far to follow the call graph from the handler. */
|
|
31
|
-
maxDepth: 3,
|
|
35
|
+
/** How far to follow the call graph from the handler (default 3). */
|
|
36
|
+
// maxDepth: 3,
|
|
32
37
|
|
|
33
38
|
/** Refuses to emit a count if tracing covers less than this. */
|
|
34
39
|
minCoverage: 0.85,
|
|
35
40
|
|
|
36
41
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* here.
|
|
42
|
+
* DETs static analysis cannot read — a JSON column, an open validator field —
|
|
43
|
+
* count 1 each, a floor, and `fp:count` names them. Answer them here by ORIGIN,
|
|
44
|
+
* with a required justification, and the answer reaches every function carrying
|
|
45
|
+
* the DET. See counting-decisions §8; use it sparingly, because `fp:count`
|
|
46
|
+
* reports what share of the total came from here.
|
|
43
47
|
*/
|
|
44
|
-
//
|
|
45
|
-
// //
|
|
46
|
-
//
|
|
48
|
+
// opaque: {
|
|
49
|
+
// // the fields live in a JSON Schema declared in the code: name it (or several,
|
|
50
|
+
// // unioned by leaf path), and the count keeps coming from the code
|
|
51
|
+
// 'Survey.answers': { schemas: ['surveySchema', 'feedbackSchema'], reason: 'one schema per survey template' },
|
|
52
|
+
// 'answerSurveyValidator.answers': { schemas: 'surveySchema', reason: 'the same form, submitted' },
|
|
47
53
|
//
|
|
48
54
|
// // 1 DET is a floor, and `fp:count` says so on every run. When 1 IS the right
|
|
49
|
-
// // answer, record that someone checked —
|
|
50
|
-
//
|
|
51
|
-
//
|
|
55
|
+
// // answer, record that someone checked — it moves no number
|
|
56
|
+
// 'Attachment.metadata': { reviewed: true, reason: 'size and mime type: one bag, one field' },
|
|
57
|
+
// },
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A declared NUMBER for one function — the last resort, for a schema that lives
|
|
61
|
+
* only in the database. It freezes: prefer `opaque.<origin>.schemas`.
|
|
62
|
+
*/
|
|
63
|
+
// overrides: {
|
|
64
|
+
// 'POST /surveys/:id/answers': { det: 42, reason: 'the form has 42 fields, defined in the database' },
|
|
52
65
|
// },
|
|
53
66
|
|
|
54
67
|
/**
|