@genesislcap/mock-server 15.70.0 → 15.71.0-FUI-2650.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.
@@ -0,0 +1,11 @@
1
+ import { type CriteriaOptions } from './criteria.ts';
2
+ /**
3
+ * What a GSF 8.15 dataserver says to a CRITERIA_MATCH before it runs it: the
4
+ * INVALID_CRITERIA text from its criteria validator (Groovy syntax, the `Expr`
5
+ * and field-method whitelists, GStrings, ...), then from its `@CompileStatic`
6
+ * compilation (a call no overload takes, given the fields' `types`), or
7
+ * undefined when it accepts the criteria. The checks DATA_LOGON makes under
8
+ * `fidelity: 'gsf'`, for clients that want to test the criteria they build.
9
+ * @public
10
+ */
11
+ export declare function criteriaRefusal(criteria: string, options?: Pick<CriteriaOptions, 'types'>): string | undefined;
@@ -0,0 +1,15 @@
1
+ import { criteriaCompileRefusal } from "./criteria.js";
2
+ import { strictCriteriaRefusal } from "./criteriaDialect.js";
3
+ /**
4
+ * What a GSF 8.15 dataserver says to a CRITERIA_MATCH before it runs it: the
5
+ * INVALID_CRITERIA text from its criteria validator (Groovy syntax, the `Expr`
6
+ * and field-method whitelists, GStrings, ...), then from its `@CompileStatic`
7
+ * compilation (a call no overload takes, given the fields' `types`), or
8
+ * undefined when it accepts the criteria. The checks DATA_LOGON makes under
9
+ * `fidelity: 'gsf'`, for clients that want to test the criteria they build.
10
+ * @public
11
+ */
12
+ export function criteriaRefusal(criteria, options = {}) {
13
+ return (strictCriteriaRefusal(criteria, undefined, options.types) ??
14
+ criteriaCompileRefusal(criteria, options.types));
15
+ }
package/dist/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export { Store } from './db/store.ts';
4
4
  export { RECORD_FIELDS, RECORD_ID, TIMESTAMP } from './db/identity.ts';
5
5
  export { ErrorCode, NackError, statusCodeFor, type ErrorCodeName, type GenesisErrorType, type NackErrorEntry, type NackErrorInput, type NackErrorOptions, } from './protocol/errors.ts';
6
6
  export { compileCriteria, type CriteriaOptions, filterByCriteria, type Predicate, } from './db/criteria.ts';
7
+ export { criteriaRefusal } from './db/criteriaRefusal.ts';
7
8
  export type { AntiJoinDef, AuthConfig, AuthUser, BroadcastFn, BroadcastTableChangeFn, CookieAuthenticationOptions, CrudEventVerb, EventHandler, EventHandlerCtx, EventHandlerResult, EventSchemaOverride, FidelityMode, FieldDef, FieldMetadata, GeneratedFieldDef, GenesisFieldType, GenesisMessage, HttpRouteDef, IndexDef, JoinDef, JoinFieldLink, JoinLink, JoinType, JoinValueLink, LiveModifyMode, MockServerConfig, OnMessageCtx, OnMessageHook, ProductDetails, QueryDef, RequestingUser, RequestReplyDef, RequestReplyResolverCtx, ResourceAuthDef, ResourceItem, Row, SequenceFormat, SocketLike, SsoIdentityProvider, TableDef, ViewDef, ViewRowSources, } from './types.ts';
package/dist/index.js CHANGED
@@ -4,3 +4,4 @@ export { Store } from "./db/store.js";
4
4
  export { RECORD_FIELDS, RECORD_ID, TIMESTAMP } from "./db/identity.js";
5
5
  export { ErrorCode, NackError, statusCodeFor, } from "./protocol/errors.js";
6
6
  export { compileCriteria, filterByCriteria, } from "./db/criteria.js";
7
+ export { criteriaRefusal } from "./db/criteriaRefusal.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genesislcap/mock-server",
3
- "version": "15.70.0",
3
+ "version": "15.71.0-FUI-2650.1",
4
4
  "description": "Reusable in-memory Genesis WebSocket protocol mock server for client automation/CI, without a JVM or database.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,21 @@
1
+ import { type CriteriaOptions, criteriaCompileRefusal } from './criteria.ts';
2
+ import { strictCriteriaRefusal } from './criteriaDialect.ts';
3
+
4
+ /**
5
+ * What a GSF 8.15 dataserver says to a CRITERIA_MATCH before it runs it: the
6
+ * INVALID_CRITERIA text from its criteria validator (Groovy syntax, the `Expr`
7
+ * and field-method whitelists, GStrings, ...), then from its `@CompileStatic`
8
+ * compilation (a call no overload takes, given the fields' `types`), or
9
+ * undefined when it accepts the criteria. The checks DATA_LOGON makes under
10
+ * `fidelity: 'gsf'`, for clients that want to test the criteria they build.
11
+ * @public
12
+ */
13
+ export function criteriaRefusal(
14
+ criteria: string,
15
+ options: Pick<CriteriaOptions, 'types'> = {},
16
+ ): string | undefined {
17
+ return (
18
+ strictCriteriaRefusal(criteria, undefined, options.types) ??
19
+ criteriaCompileRefusal(criteria, options.types)
20
+ );
21
+ }
package/src/index.ts CHANGED
@@ -18,6 +18,7 @@ export {
18
18
  filterByCriteria,
19
19
  type Predicate,
20
20
  } from './db/criteria.ts';
21
+ export { criteriaRefusal } from './db/criteriaRefusal.ts';
21
22
  export type {
22
23
  AntiJoinDef,
23
24
  AuthConfig,