graphile-history 1.1.1
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/LICENSE +23 -0
- package/README.md +140 -0
- package/esm/index.d.ts +20 -0
- package/esm/index.js +21 -0
- package/esm/plugin.d.ts +36 -0
- package/esm/plugin.js +512 -0
- package/esm/preset.d.ts +20 -0
- package/esm/preset.js +23 -0
- package/esm/types.d.ts +54 -0
- package/esm/types.js +4 -0
- package/index.d.ts +20 -0
- package/index.js +27 -0
- package/package.json +63 -0
- package/plugin.d.ts +36 -0
- package/plugin.js +516 -0
- package/preset.d.ts +20 -0
- package/preset.js +26 -0
- package/types.d.ts +54 -0
- package/types.js +5 -0
package/types.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the graphile-history v5 plugin.
|
|
3
|
+
*/
|
|
4
|
+
export interface HistoryPluginOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Suffix used to derive the history table name from the source table name
|
|
7
|
+
* when the `@history` smart tag does not carry an explicit table name.
|
|
8
|
+
* @default '_history'
|
|
9
|
+
*/
|
|
10
|
+
historySuffix?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Column on the history table that stores the version timestamp.
|
|
13
|
+
* @default 'recorded_at'
|
|
14
|
+
*/
|
|
15
|
+
recordedAtColumn?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Column on the history table that stores the operation marker
|
|
18
|
+
* (INSERT / UPDATE / DELETE).
|
|
19
|
+
* @default 'history_op'
|
|
20
|
+
*/
|
|
21
|
+
operationColumn?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Source columns that must never be written by a restore mutation
|
|
24
|
+
* (in addition to primary-key columns, which are always excluded).
|
|
25
|
+
* @default ['created_at', 'updated_at']
|
|
26
|
+
*/
|
|
27
|
+
immutableColumns?: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface HistoryColumn {
|
|
30
|
+
/** Physical column name on the history table */
|
|
31
|
+
column: string;
|
|
32
|
+
/** GraphQL field name (camelCase) */
|
|
33
|
+
gqlName: string;
|
|
34
|
+
/** Underlying pg codec name (e.g. 'uuid', 'text', 'timestamptz') */
|
|
35
|
+
pgType: string;
|
|
36
|
+
}
|
|
37
|
+
export interface HistoryTableInfo {
|
|
38
|
+
/** Source table SQL name */
|
|
39
|
+
sourceTable: string;
|
|
40
|
+
/** History table SQL name */
|
|
41
|
+
historyTable: string;
|
|
42
|
+
/** Schema name (shared by source and history tables) */
|
|
43
|
+
schemaName: string;
|
|
44
|
+
/** Primary-key columns on the source table */
|
|
45
|
+
pkColumns: HistoryColumn[];
|
|
46
|
+
/** Version timestamp column on the history table */
|
|
47
|
+
recordedAtColumn: string;
|
|
48
|
+
/** Operation marker column on the history table */
|
|
49
|
+
operationColumn: string;
|
|
50
|
+
/** Copied source columns present on the history table (excludes reserved cols) */
|
|
51
|
+
copyColumns: HistoryColumn[];
|
|
52
|
+
/** GraphQL type name of the source table (e.g. 'Post') */
|
|
53
|
+
sourceTypeName: string;
|
|
54
|
+
}
|