@suss/adapter-ruby 0.27.0 → 0.29.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/index.cjs +3078 -2292
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +3103 -2325
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -214,7 +214,8 @@ type MethodLookup =
|
|
|
214
214
|
* `cause` says why the search stopped, since a caller deciding
|
|
215
215
|
* whether to look further needs more than the sentence: `unreadAncestor`
|
|
216
216
|
* is a base whose file this run could not open, and `dynamicDefine`
|
|
217
|
-
* is a
|
|
217
|
+
* is a `define_method` call that defines this name, or one whose own
|
|
218
|
+
* name this reader could not read.
|
|
218
219
|
*/
|
|
219
220
|
| {
|
|
220
221
|
type: "unsettled";
|
|
@@ -327,6 +328,8 @@ interface RbStoragePattern {
|
|
|
327
328
|
baseClasses: string[];
|
|
328
329
|
/** Methods that change what is stored. Anything else reads. */
|
|
329
330
|
writes: string[];
|
|
331
|
+
/** Methods whose result is the model again: one record, or a relation a later read narrows to one. */
|
|
332
|
+
givesBack: string[];
|
|
330
333
|
/** Which database is behind the connection, which the project settles. */
|
|
331
334
|
storageSystem: "postgresql" | "mysql" | "sqlite";
|
|
332
335
|
}
|
|
@@ -490,6 +493,10 @@ interface GraphqlObjectFields {
|
|
|
490
493
|
* class that reaches that base is a database call. The README says why
|
|
491
494
|
* ancestry. A loader pattern from another pack adds calls that are given
|
|
492
495
|
* the model as an argument instead, and those go through the same test.
|
|
496
|
+
*
|
|
497
|
+
* A write is also recorded when the receiver is not written as a
|
|
498
|
+
* constant and the rules settle it on such a class, which is how
|
|
499
|
+
* `@account.save` after a `before_action` finder counts.
|
|
493
500
|
*/
|
|
494
501
|
|
|
495
502
|
interface RbStorageOptions {
|
|
@@ -544,6 +551,8 @@ declare function discoverUnits(root: Node, options: DiscoveryOptions): Promise<R
|
|
|
544
551
|
interface ConstantDefinition {
|
|
545
552
|
readonly qualifiedName: string;
|
|
546
553
|
readonly key: string;
|
|
554
|
+
/** `class`/`module` opens a constant every file may open again; `X = ...` sets one. */
|
|
555
|
+
readonly kind: "declaration" | "assignment";
|
|
547
556
|
}
|
|
548
557
|
/** A constant read somewhere, with the nesting it was read inside. */
|
|
549
558
|
interface ConstantReference {
|
|
@@ -583,7 +592,7 @@ declare function nodeId(filePath: string, node: Node): string;
|
|
|
583
592
|
* expression in hand and wants to ask the rules about it. `enclosing` is
|
|
584
593
|
* the method the expression is written in, or null outside one.
|
|
585
594
|
*/
|
|
586
|
-
declare function readKey(filePath: string,
|
|
595
|
+
declare function readKey(filePath: string, written: Node, enclosing: Node | null): string;
|
|
587
596
|
/**
|
|
588
597
|
* Walk a file and emit the value facts. A method is walked in its own right,
|
|
589
598
|
* so a body's returns and calls belong to the method that wrote them.
|
package/dist/index.d.ts
CHANGED
|
@@ -214,7 +214,8 @@ type MethodLookup =
|
|
|
214
214
|
* `cause` says why the search stopped, since a caller deciding
|
|
215
215
|
* whether to look further needs more than the sentence: `unreadAncestor`
|
|
216
216
|
* is a base whose file this run could not open, and `dynamicDefine`
|
|
217
|
-
* is a
|
|
217
|
+
* is a `define_method` call that defines this name, or one whose own
|
|
218
|
+
* name this reader could not read.
|
|
218
219
|
*/
|
|
219
220
|
| {
|
|
220
221
|
type: "unsettled";
|
|
@@ -327,6 +328,8 @@ interface RbStoragePattern {
|
|
|
327
328
|
baseClasses: string[];
|
|
328
329
|
/** Methods that change what is stored. Anything else reads. */
|
|
329
330
|
writes: string[];
|
|
331
|
+
/** Methods whose result is the model again: one record, or a relation a later read narrows to one. */
|
|
332
|
+
givesBack: string[];
|
|
330
333
|
/** Which database is behind the connection, which the project settles. */
|
|
331
334
|
storageSystem: "postgresql" | "mysql" | "sqlite";
|
|
332
335
|
}
|
|
@@ -490,6 +493,10 @@ interface GraphqlObjectFields {
|
|
|
490
493
|
* class that reaches that base is a database call. The README says why
|
|
491
494
|
* ancestry. A loader pattern from another pack adds calls that are given
|
|
492
495
|
* the model as an argument instead, and those go through the same test.
|
|
496
|
+
*
|
|
497
|
+
* A write is also recorded when the receiver is not written as a
|
|
498
|
+
* constant and the rules settle it on such a class, which is how
|
|
499
|
+
* `@account.save` after a `before_action` finder counts.
|
|
493
500
|
*/
|
|
494
501
|
|
|
495
502
|
interface RbStorageOptions {
|
|
@@ -544,6 +551,8 @@ declare function discoverUnits(root: Node, options: DiscoveryOptions): Promise<R
|
|
|
544
551
|
interface ConstantDefinition {
|
|
545
552
|
readonly qualifiedName: string;
|
|
546
553
|
readonly key: string;
|
|
554
|
+
/** `class`/`module` opens a constant every file may open again; `X = ...` sets one. */
|
|
555
|
+
readonly kind: "declaration" | "assignment";
|
|
547
556
|
}
|
|
548
557
|
/** A constant read somewhere, with the nesting it was read inside. */
|
|
549
558
|
interface ConstantReference {
|
|
@@ -583,7 +592,7 @@ declare function nodeId(filePath: string, node: Node): string;
|
|
|
583
592
|
* expression in hand and wants to ask the rules about it. `enclosing` is
|
|
584
593
|
* the method the expression is written in, or null outside one.
|
|
585
594
|
*/
|
|
586
|
-
declare function readKey(filePath: string,
|
|
595
|
+
declare function readKey(filePath: string, written: Node, enclosing: Node | null): string;
|
|
587
596
|
/**
|
|
588
597
|
* Walk a file and emit the value facts. A method is walked in its own right,
|
|
589
598
|
* so a body's returns and calls belong to the method that wrote them.
|