@koolbase/core 12.52.0 → 12.53.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.
|
@@ -36,6 +36,9 @@ export type KbValueJson = {
|
|
|
36
36
|
kind: 'range';
|
|
37
37
|
from: KbValueJson;
|
|
38
38
|
to: KbValueJson;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'field';
|
|
41
|
+
field: string;
|
|
39
42
|
};
|
|
40
43
|
export type KbWhereNode = {
|
|
41
44
|
op: 'and' | 'or';
|
|
@@ -81,6 +84,17 @@ export declare const KbValue: {
|
|
|
81
84
|
callerUserId: () => KbValueJson;
|
|
82
85
|
/** One of the signed-in user's claims, as the server set it. Refused (caller_claim_missing) without it. */
|
|
83
86
|
callerClaim: (name: string) => KbValueJson;
|
|
87
|
+
/**
|
|
88
|
+
* Another field of the same record, to compare this one with:
|
|
89
|
+
* `KbField('stock').lt(KbValue.field('reorder_level'))`. Both fields must be
|
|
90
|
+
* declared and their types must fit -- number with number, a date with a
|
|
91
|
+
* date or a date and time, a choice with a choice of the same values, a
|
|
92
|
+
* user with a user (or created_by), a reference with a reference to the
|
|
93
|
+
* same collection. With eq, neq, gt, gte, lt, lte, before, after,
|
|
94
|
+
* onOrBefore, onOrAfter and on. A record missing either value never
|
|
95
|
+
* matches. One hop through a reference is allowed: `'order_id.due_date'`.
|
|
96
|
+
*/
|
|
97
|
+
field: (name: string) => KbValueJson;
|
|
84
98
|
};
|
|
85
99
|
/** A record field to filter on: a declared field, or id, created_at, updated_at, created_by. */
|
|
86
100
|
export declare function KbField(name: string): {
|
|
@@ -81,6 +81,17 @@ exports.KbValue = {
|
|
|
81
81
|
callerUserId: () => ({ kind: 'caller', path: 'user_id' }),
|
|
82
82
|
/** One of the signed-in user's claims, as the server set it. Refused (caller_claim_missing) without it. */
|
|
83
83
|
callerClaim: (name) => ({ kind: 'caller', path: `claims.${name}` }),
|
|
84
|
+
/**
|
|
85
|
+
* Another field of the same record, to compare this one with:
|
|
86
|
+
* `KbField('stock').lt(KbValue.field('reorder_level'))`. Both fields must be
|
|
87
|
+
* declared and their types must fit -- number with number, a date with a
|
|
88
|
+
* date or a date and time, a choice with a choice of the same values, a
|
|
89
|
+
* user with a user (or created_by), a reference with a reference to the
|
|
90
|
+
* same collection. With eq, neq, gt, gte, lt, lte, before, after,
|
|
91
|
+
* onOrBefore, onOrAfter and on. A record missing either value never
|
|
92
|
+
* matches. One hop through a reference is allowed: `'order_id.due_date'`.
|
|
93
|
+
*/
|
|
94
|
+
field: (name) => ({ kind: 'field', field: name }),
|
|
84
95
|
};
|
|
85
96
|
/** A record field to filter on: a declared field, or id, created_at, updated_at, created_by. */
|
|
86
97
|
function KbField(name) {
|
|
@@ -36,6 +36,9 @@ export type KbValueJson = {
|
|
|
36
36
|
kind: 'range';
|
|
37
37
|
from: KbValueJson;
|
|
38
38
|
to: KbValueJson;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'field';
|
|
41
|
+
field: string;
|
|
39
42
|
};
|
|
40
43
|
export type KbWhereNode = {
|
|
41
44
|
op: 'and' | 'or';
|
|
@@ -81,6 +84,17 @@ export declare const KbValue: {
|
|
|
81
84
|
callerUserId: () => KbValueJson;
|
|
82
85
|
/** One of the signed-in user's claims, as the server set it. Refused (caller_claim_missing) without it. */
|
|
83
86
|
callerClaim: (name: string) => KbValueJson;
|
|
87
|
+
/**
|
|
88
|
+
* Another field of the same record, to compare this one with:
|
|
89
|
+
* `KbField('stock').lt(KbValue.field('reorder_level'))`. Both fields must be
|
|
90
|
+
* declared and their types must fit -- number with number, a date with a
|
|
91
|
+
* date or a date and time, a choice with a choice of the same values, a
|
|
92
|
+
* user with a user (or created_by), a reference with a reference to the
|
|
93
|
+
* same collection. With eq, neq, gt, gte, lt, lte, before, after,
|
|
94
|
+
* onOrBefore, onOrAfter and on. A record missing either value never
|
|
95
|
+
* matches. One hop through a reference is allowed: `'order_id.due_date'`.
|
|
96
|
+
*/
|
|
97
|
+
field: (name: string) => KbValueJson;
|
|
84
98
|
};
|
|
85
99
|
/** A record field to filter on: a declared field, or id, created_at, updated_at, created_by. */
|
|
86
100
|
export declare function KbField(name: string): {
|
|
@@ -75,6 +75,17 @@ export const KbValue = {
|
|
|
75
75
|
callerUserId: () => ({ kind: 'caller', path: 'user_id' }),
|
|
76
76
|
/** One of the signed-in user's claims, as the server set it. Refused (caller_claim_missing) without it. */
|
|
77
77
|
callerClaim: (name) => ({ kind: 'caller', path: `claims.${name}` }),
|
|
78
|
+
/**
|
|
79
|
+
* Another field of the same record, to compare this one with:
|
|
80
|
+
* `KbField('stock').lt(KbValue.field('reorder_level'))`. Both fields must be
|
|
81
|
+
* declared and their types must fit -- number with number, a date with a
|
|
82
|
+
* date or a date and time, a choice with a choice of the same values, a
|
|
83
|
+
* user with a user (or created_by), a reference with a reference to the
|
|
84
|
+
* same collection. With eq, neq, gt, gte, lt, lte, before, after,
|
|
85
|
+
* onOrBefore, onOrAfter and on. A record missing either value never
|
|
86
|
+
* matches. One hop through a reference is allowed: `'order_id.due_date'`.
|
|
87
|
+
*/
|
|
88
|
+
field: (name) => ({ kind: 'field', field: name }),
|
|
78
89
|
};
|
|
79
90
|
/** A record field to filter on: a declared field, or id, created_at, updated_at, created_by. */
|
|
80
91
|
export function KbField(name) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koolbase/core",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.53.0",
|
|
4
4
|
"description": "Koolbase SDK core — shared behaviour behind @koolbase/react-native and @koolbase/js. Install one of those, not this.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"react-native": "./dist/esm/index.js",
|