@memberjunction/core 6.2.0-edge.5 → 6.2.0-edge.7
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/generic/BaseEntitySaveQueue.d.ts +15 -0
- package/dist/generic/BaseEntitySaveQueue.d.ts.map +1 -1
- package/dist/generic/BaseEntitySaveQueue.js +21 -0
- package/dist/generic/BaseEntitySaveQueue.js.map +1 -1
- package/dist/generic/EntityFieldRules.d.ts.map +1 -1
- package/dist/generic/EntityFieldRules.js +1 -0
- package/dist/generic/EntityFieldRules.js.map +1 -1
- package/dist/generic/alternateBaseViews.d.ts +119 -0
- package/dist/generic/alternateBaseViews.d.ts.map +1 -0
- package/dist/generic/alternateBaseViews.js +223 -0
- package/dist/generic/alternateBaseViews.js.map +1 -0
- package/dist/generic/baseEngine.d.ts +171 -17
- package/dist/generic/baseEngine.d.ts.map +1 -1
- package/dist/generic/baseEngine.js +722 -117
- package/dist/generic/baseEngine.js.map +1 -1
- package/dist/generic/baseEngineRegistry.d.ts.map +1 -1
- package/dist/generic/baseEngineRegistry.js +2 -1
- package/dist/generic/baseEngineRegistry.js.map +1 -1
- package/dist/generic/baseEntity.d.ts +216 -21
- package/dist/generic/baseEntity.d.ts.map +1 -1
- package/dist/generic/baseEntity.js +969 -100
- package/dist/generic/baseEntity.js.map +1 -1
- package/dist/generic/baseRemotableOperation.d.ts +95 -6
- package/dist/generic/baseRemotableOperation.d.ts.map +1 -1
- package/dist/generic/baseRemotableOperation.js +112 -8
- package/dist/generic/baseRemotableOperation.js.map +1 -1
- package/dist/generic/contextTokens.d.ts +136 -0
- package/dist/generic/contextTokens.d.ts.map +1 -0
- package/dist/generic/contextTokens.js +319 -0
- package/dist/generic/contextTokens.js.map +1 -0
- package/dist/generic/databaseProviderBase.d.ts +103 -5
- package/dist/generic/databaseProviderBase.d.ts.map +1 -1
- package/dist/generic/databaseProviderBase.js +381 -52
- package/dist/generic/databaseProviderBase.js.map +1 -1
- package/dist/generic/embeddedRecord.d.ts +6 -0
- package/dist/generic/embeddedRecord.d.ts.map +1 -1
- package/dist/generic/embeddedRecord.js +15 -1
- package/dist/generic/embeddedRecord.js.map +1 -1
- package/dist/generic/entityCompanion.d.ts +7 -0
- package/dist/generic/entityCompanion.d.ts.map +1 -1
- package/dist/generic/entityCompanion.js +8 -0
- package/dist/generic/entityCompanion.js.map +1 -1
- package/dist/generic/entityInfo.d.ts +234 -9
- package/dist/generic/entityInfo.d.ts.map +1 -1
- package/dist/generic/entityInfo.js +592 -77
- package/dist/generic/entityInfo.js.map +1 -1
- package/dist/generic/entityValueFieldSecurity.d.ts +139 -0
- package/dist/generic/entityValueFieldSecurity.d.ts.map +1 -0
- package/dist/generic/entityValueFieldSecurity.js +250 -0
- package/dist/generic/entityValueFieldSecurity.js.map +1 -0
- package/dist/generic/externalDataSourceReadRouter.d.ts +10 -0
- package/dist/generic/externalDataSourceReadRouter.d.ts.map +1 -1
- package/dist/generic/externalDataSourceReadRouter.js +12 -0
- package/dist/generic/externalDataSourceReadRouter.js.map +1 -1
- package/dist/generic/fieldSecuritySQLGate.d.ts +359 -0
- package/dist/generic/fieldSecuritySQLGate.d.ts.map +1 -0
- package/dist/generic/fieldSecuritySQLGate.js +902 -0
- package/dist/generic/fieldSecuritySQLGate.js.map +1 -0
- package/dist/generic/indexRestrictedFields.d.ts +47 -0
- package/dist/generic/indexRestrictedFields.d.ts.map +1 -0
- package/dist/generic/indexRestrictedFields.js +129 -0
- package/dist/generic/indexRestrictedFields.js.map +1 -0
- package/dist/generic/interfaces.d.ts +64 -2
- package/dist/generic/interfaces.d.ts.map +1 -1
- package/dist/generic/interfaces.js.map +1 -1
- package/dist/generic/listMembershipFilter.d.ts +5 -0
- package/dist/generic/listMembershipFilter.d.ts.map +1 -0
- package/dist/generic/listMembershipFilter.js +23 -0
- package/dist/generic/listMembershipFilter.js.map +1 -0
- package/dist/generic/localCacheManager.d.ts +126 -14
- package/dist/generic/localCacheManager.d.ts.map +1 -1
- package/dist/generic/localCacheManager.js +348 -48
- package/dist/generic/localCacheManager.js.map +1 -1
- package/dist/generic/logging.d.ts.map +1 -1
- package/dist/generic/logging.js +7 -1
- package/dist/generic/logging.js.map +1 -1
- package/dist/generic/metadata.d.ts +3 -2
- package/dist/generic/metadata.d.ts.map +1 -1
- package/dist/generic/metadata.js +5 -2
- package/dist/generic/metadata.js.map +1 -1
- package/dist/generic/platformSQL.d.ts +54 -0
- package/dist/generic/platformSQL.d.ts.map +1 -1
- package/dist/generic/platformSQL.js +55 -0
- package/dist/generic/platformSQL.js.map +1 -1
- package/dist/generic/providerBase.d.ts +408 -57
- package/dist/generic/providerBase.d.ts.map +1 -1
- package/dist/generic/providerBase.js +1051 -310
- package/dist/generic/providerBase.js.map +1 -1
- package/dist/generic/queryInfo.d.ts +13 -0
- package/dist/generic/queryInfo.d.ts.map +1 -1
- package/dist/generic/queryInfo.js +13 -0
- package/dist/generic/queryInfo.js.map +1 -1
- package/dist/generic/queryInfoInterfaces.d.ts +8 -0
- package/dist/generic/queryInfoInterfaces.d.ts.map +1 -1
- package/dist/generic/queryTemplateContext.d.ts +49 -0
- package/dist/generic/queryTemplateContext.d.ts.map +1 -0
- package/dist/generic/queryTemplateContext.js +113 -0
- package/dist/generic/queryTemplateContext.js.map +1 -0
- package/dist/generic/recordChangeFieldSecurity.d.ts.map +1 -1
- package/dist/generic/recordChangeFieldSecurity.js +13 -2
- package/dist/generic/recordChangeFieldSecurity.js.map +1 -1
- package/dist/generic/relatedRecordCollection.d.ts +18 -0
- package/dist/generic/relatedRecordCollection.d.ts.map +1 -1
- package/dist/generic/relatedRecordCollection.js +55 -7
- package/dist/generic/relatedRecordCollection.js.map +1 -1
- package/dist/generic/remoteOperationDispatch.d.ts.map +1 -1
- package/dist/generic/remoteOperationDispatch.js +14 -2
- package/dist/generic/remoteOperationDispatch.js.map +1 -1
- package/dist/generic/runQuery.d.ts +42 -0
- package/dist/generic/runQuery.d.ts.map +1 -1
- package/dist/generic/runQuery.js +14 -0
- package/dist/generic/runQuery.js.map +1 -1
- package/dist/generic/runQuerySQLFilterImplementations.d.ts +33 -6
- package/dist/generic/runQuerySQLFilterImplementations.d.ts.map +1 -1
- package/dist/generic/runQuerySQLFilterImplementations.js +119 -29
- package/dist/generic/runQuerySQLFilterImplementations.js.map +1 -1
- package/dist/generic/saveEntityGraphOperation.d.ts.map +1 -1
- package/dist/generic/saveEntityGraphOperation.js +3 -0
- package/dist/generic/saveEntityGraphOperation.js.map +1 -1
- package/dist/generic/securityInfo.d.ts +11 -0
- package/dist/generic/securityInfo.d.ts.map +1 -1
- package/dist/generic/securityInfo.js +15 -0
- package/dist/generic/securityInfo.js.map +1 -1
- package/dist/generic/telemetryManager.d.ts +9 -0
- package/dist/generic/telemetryManager.d.ts.map +1 -1
- package/dist/generic/telemetryManager.js +5 -1
- package/dist/generic/telemetryManager.js.map +1 -1
- package/dist/generic/transportError.d.ts +41 -0
- package/dist/generic/transportError.d.ts.map +1 -0
- package/dist/generic/transportError.js +167 -0
- package/dist/generic/transportError.js.map +1 -0
- package/dist/generic/util.d.ts +12 -0
- package/dist/generic/util.d.ts.map +1 -1
- package/dist/generic/util.js +52 -3
- package/dist/generic/util.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/views/runView.d.ts +102 -0
- package/dist/views/runView.d.ts.map +1 -1
- package/dist/views/runView.js +40 -0
- package/dist/views/runView.js.map +1 -1
- package/dist/views/viewProperties.d.ts +55 -0
- package/dist/views/viewProperties.d.ts.map +1 -0
- package/dist/views/viewProperties.js +258 -0
- package/dist/views/viewProperties.js.map +1 -0
- package/package.json +3 -3
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;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GAAG,QAAQ,CAAC;IAC/B,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACjC,CAAC"}
|
package/dist/views/runView.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { BaseEntity } from '../generic/baseEntity.js';
|
|
|
4
4
|
import { PlatformSQL } from '../generic/platformSQL.js';
|
|
5
5
|
import { CompositeKey } from '../generic/compositeKey.js';
|
|
6
6
|
import type { CacheChangedEvent } from '../generic/localCacheManager.js';
|
|
7
|
+
import { ViewPropertyValues } from './viewProperties.js';
|
|
7
8
|
/**
|
|
8
9
|
* Reason codes for {@link AfterKeyNotSupportedError}. Use these to make caller
|
|
9
10
|
* fallback logic explicit (e.g., "if reason is CompositePK, fall back to OFFSET pagination").
|
|
@@ -79,6 +80,14 @@ export interface RunViewTelemetryOptions {
|
|
|
79
80
|
*/
|
|
80
81
|
Reason?: string;
|
|
81
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* `RunViewParams` fields only server code may set. A transport that builds run params from a
|
|
85
|
+
* client's request body (the REST endpoint) removes these before running the view, so a client
|
|
86
|
+
* cannot choose them. GraphQL run inputs never carry them in the first place.
|
|
87
|
+
*/
|
|
88
|
+
export declare const SERVER_ONLY_RUN_VIEW_PARAMS: ReadonlyArray<keyof RunViewParams>;
|
|
89
|
+
/** A copy of client-supplied run params without the {@link SERVER_ONLY_RUN_VIEW_PARAMS} fields. */
|
|
90
|
+
export declare function StripServerOnlyRunViewParams(params: RunViewParams): RunViewParams;
|
|
82
91
|
/**
|
|
83
92
|
* Parameters for running either a stored or dynamic view.
|
|
84
93
|
* A stored view is a view that is saved in the database and can be run either by ID or Name.
|
|
@@ -122,6 +131,22 @@ export declare class RunViewParams {
|
|
|
122
131
|
* view won't exist). The enum (vs. a bare boolean) leaves room for future modes without a breaking change.
|
|
123
132
|
*/
|
|
124
133
|
DataSource?: 'Live' | 'Materialized';
|
|
134
|
+
/**
|
|
135
|
+
* optional - semantic `Name` of a registered `EntityAlternateBaseView` on the target entity
|
|
136
|
+
* (for example, `'Active'` or `'Open'`).
|
|
137
|
+
*
|
|
138
|
+
* When set, `RunView` routes the read (and any parallel aggregate or count query) against the
|
|
139
|
+
* alternate view's physical SQL view (`EntityAlternateBaseView.ViewName` in `EffectiveSchemaName`)
|
|
140
|
+
* instead of `entity.BaseView`.
|
|
141
|
+
*
|
|
142
|
+
* **Precedence & Composition:**
|
|
143
|
+
* - Explicit `params.AlternateBaseView` overrides any `AlternateBaseView` pinned inside a saved
|
|
144
|
+
* `UserView.DisplayState` JSON.
|
|
145
|
+
* - Mutually exclusive with `DataSource: 'Materialized'` (throws a descriptive error when combined).
|
|
146
|
+
* - Entity `CanRead`, Row-Level Security (RLS), and Field-Level Security (FLS) apply identically
|
|
147
|
+
* on top of the alternate base view.
|
|
148
|
+
*/
|
|
149
|
+
AlternateBaseView?: string;
|
|
125
150
|
/**
|
|
126
151
|
* An optional SQL WHERE clause that you can add to the existing filters on a stored view. For dynamic views, you can either
|
|
127
152
|
* run a view without a filter (if the entity definition allows it with AllowAllRowsAPI=1) or filter with any valid SQL WHERE clause.
|
|
@@ -180,8 +205,30 @@ export declare class RunViewParams {
|
|
|
180
205
|
IgnoreMaxRows?: boolean;
|
|
181
206
|
/**
|
|
182
207
|
* optional - if provided, and if IgnoreMaxRows = false, this value will be used to constrain the total # of rows returned by the view. If this is not provided, either the default settings at the entity-level will be used, or if the entity has no UserViewMaxRows setting, all rows will be returned that match any filter, if provided.
|
|
208
|
+
*
|
|
209
|
+
* `TotalRowCount` with `MaxRows`: when the page comes back full, a second query counts the
|
|
210
|
+
* matching rows, whatever the limit. A caller that only reads `Results`, such as a single-row
|
|
211
|
+
* lookup, should pass `SkipTotalRowCount: true` to avoid paying for that count.
|
|
183
212
|
*/
|
|
184
213
|
MaxRows?: number;
|
|
214
|
+
/**
|
|
215
|
+
* optional - when true, the provider skips the EXTRA count query it would otherwise run to
|
|
216
|
+
* populate `TotalRowCount` when the returned page comes back exactly full
|
|
217
|
+
* (`Results.length === MaxRows`). That fallback count is a second, sequential round trip after
|
|
218
|
+
* the data query — and for a single-row existence/lookup read (`MaxRows: 1`) it fires on every
|
|
219
|
+
* HIT, so a hot lookup path pays double round trips to compute a total it never reads. Set
|
|
220
|
+
* this on reads that only consume `Results`. Ignored for `ResultType: 'count_only'`, whose
|
|
221
|
+
* entire point is the count.
|
|
222
|
+
*
|
|
223
|
+
* Scope: it also suppresses the up-front count a PAGINATED read (`StartRow` with `MaxRows`)
|
|
224
|
+
* runs, so a paginated caller that needs "1-100 of N" must leave it unset.
|
|
225
|
+
*
|
|
226
|
+
* With the flag, `TotalRowCount` is always `undefined`, even on a page that was not full, so
|
|
227
|
+
* a read of it fails the same way on every data size instead of working only until the data
|
|
228
|
+
* grows. A caller that needs a total must not pass the flag. Calls with and without it get
|
|
229
|
+
* separate cache slots, since their `TotalRowCount` differs.
|
|
230
|
+
*/
|
|
231
|
+
SkipTotalRowCount?: boolean;
|
|
185
232
|
/**
|
|
186
233
|
* optional - if provided, this value will be used to offset the rows returned.
|
|
187
234
|
*
|
|
@@ -380,6 +427,56 @@ export declare class RunViewParams {
|
|
|
380
427
|
* @default false
|
|
381
428
|
*/
|
|
382
429
|
IncludeBinaryFields?: boolean;
|
|
430
|
+
/**
|
|
431
|
+
* Server only: the IANA time zone (e.g. `'Europe/Paris'`) that context tokens such as
|
|
432
|
+
* `Context.Today` are worked out in for this run. Unset means UTC.
|
|
433
|
+
*
|
|
434
|
+
* MJServer's GraphQL resolvers set it from the request's `x-mj-timezone` header
|
|
435
|
+
* (`TIME_ZONE_HEADER`); server code that runs without a request (agents, schedules) sets it
|
|
436
|
+
* itself. No GraphQL run input carries it, so a GraphQL client cannot set it.
|
|
437
|
+
*
|
|
438
|
+
* It is not part of the result-cache fingerprint. Code that resolves tokens with it must put the
|
|
439
|
+
* resolved values, not the zone, into whatever the fingerprint covers.
|
|
440
|
+
*/
|
|
441
|
+
TimeZone?: string;
|
|
442
|
+
/**
|
|
443
|
+
* Values for a stored view's declared properties (`MJ: User Views.Properties`), keyed by
|
|
444
|
+
* property name. Each property with a value, or with a default, adds one predicate on its target
|
|
445
|
+
* field, ANDed after the view's own filter and `ExtraFilter`; row-level security applies on top.
|
|
446
|
+
* A value is checked against the property's type and written as a typed SQL literal. A list is
|
|
447
|
+
* accepted only for a property whose operator is `IN`. `null` means "no value": the default is
|
|
448
|
+
* not used and no predicate is added.
|
|
449
|
+
*
|
|
450
|
+
* Clients may set this (the GraphQL view inputs and REST carry it). The run is refused, with an
|
|
451
|
+
* error naming the property, for: a name the view does not declare, a value for a property whose
|
|
452
|
+
* `AllowOverride` is false, a value of the wrong type, or a required property left without one.
|
|
453
|
+
* Only a stored view (ViewID, ViewName or ViewEntity) takes properties.
|
|
454
|
+
*
|
|
455
|
+
* Part of the result-cache fingerprint. On the server the database provider replaces it, before
|
|
456
|
+
* the cache lookup, with the resolved values in {@link ServerProperties}.
|
|
457
|
+
*/
|
|
458
|
+
Properties?: ViewPropertyValues;
|
|
459
|
+
/**
|
|
460
|
+
* Server only: values for a stored view's properties that server code sets, including properties
|
|
461
|
+
* whose `AllowOverride` is false (a client value for those is refused). A value here wins over
|
|
462
|
+
* {@link Properties} and over the property's default. Unknown names are refused.
|
|
463
|
+
*
|
|
464
|
+
* No GraphQL run input carries it and the REST view routes strip it
|
|
465
|
+
* ({@link SERVER_ONLY_RUN_VIEW_PARAMS}), so a client cannot set it. Part of the result-cache
|
|
466
|
+
* fingerprint.
|
|
467
|
+
*/
|
|
468
|
+
ServerProperties?: ViewPropertyValues;
|
|
469
|
+
/**
|
|
470
|
+
* Server-only transport optimization flag set by API boundary layers (`ResolverBase` / GraphQL).
|
|
471
|
+
*
|
|
472
|
+
* When `true`, database providers leave `Encrypt = true` fields whose `AllowDecryptInAPI` is
|
|
473
|
+
* `false` in their stored ciphertext form instead of decrypting them on read only for the API
|
|
474
|
+
* layer to re-encrypt (when `SendEncryptedValue = true`) or mask with `ENCRYPTED_SENTINEL`
|
|
475
|
+
* (when `SendEncryptedValue = false`). Stripped from client-supplied REST bodies via
|
|
476
|
+
* {@link SERVER_ONLY_RUN_VIEW_PARAMS} and excluded from cache fingerprints (cache slots always
|
|
477
|
+
* store ciphertext at rest).
|
|
478
|
+
*/
|
|
479
|
+
PreserveRestrictedApiCiphertext?: boolean;
|
|
383
480
|
/**
|
|
384
481
|
* Optional TTL (time-to-live) in milliseconds for cached results when CacheLocal is true.
|
|
385
482
|
* After this time, cached results will be considered stale and fresh data will be fetched.
|
|
@@ -495,6 +592,11 @@ export declare class RunViewParams {
|
|
|
495
592
|
* cached as Live by another (the silent-stale hazard that separate `=== 'Materialized'` checks allow).
|
|
496
593
|
*/
|
|
497
594
|
export declare function IsMaterializedDataSource(dataSource: string | null | undefined): boolean;
|
|
595
|
+
/**
|
|
596
|
+
* Normalizes an `AlternateBaseView` name for comparison and cache-key construction:
|
|
597
|
+
* trims whitespace and lowercases. Returns `''` when the input is null, undefined, or whitespace-only.
|
|
598
|
+
*/
|
|
599
|
+
export declare function NormalizeAlternateBaseViewName(name: string | null | undefined): string;
|
|
498
600
|
/**
|
|
499
601
|
* Class for running views in a generic, tier-independent manner - uses a provider model for
|
|
500
602
|
* implementation transparently from the viewpoint of the consumer of the class. By default the RunView class you create will
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runView.d.ts","sourceRoot":"","sources":["../../src/views/runView.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAiB,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EA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CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAKvG;;;;;OAKG;IACU,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAM5G,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAgC;IACjE;;;OAGG;IACH,WAAkB,QAAQ,IAAI,gBAAgB,CAM7C;IACD,WAAkB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAMjD;IAGD;;;;OAIG;WACiB,8BAA8B,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,GAAE,iBAAiB,GAAG,IAAW,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;CA2ChK"}
|
package/dist/views/runView.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { MJGlobal } from '@memberjunction/global';
|
|
2
|
+
import { IsExplicitBaseViewOverride } from '../generic/alternateBaseViews.js';
|
|
3
|
+
import { ViewPropertyValuesKey } from './viewProperties.js';
|
|
2
4
|
/**
|
|
3
5
|
* Thrown by {@link RunView} / RunViews when `AfterKey` is provided but cannot be honored.
|
|
4
6
|
*
|
|
@@ -49,6 +51,24 @@ export function IsKeysetPaginationOrderableType(sqlTypeName) {
|
|
|
49
51
|
const normalized = sqlTypeName.replace(/\s*\([^)]*\)\s*$/, '').trim().toLowerCase();
|
|
50
52
|
return KEYSET_PAGINATION_ORDERABLE_PK_TYPES.includes(normalized);
|
|
51
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* `RunViewParams` fields only server code may set. A transport that builds run params from a
|
|
56
|
+
* client's request body (the REST endpoint) removes these before running the view, so a client
|
|
57
|
+
* cannot choose them. GraphQL run inputs never carry them in the first place.
|
|
58
|
+
*/
|
|
59
|
+
export const SERVER_ONLY_RUN_VIEW_PARAMS = [
|
|
60
|
+
'TimeZone',
|
|
61
|
+
'ServerProperties',
|
|
62
|
+
'PreserveRestrictedApiCiphertext',
|
|
63
|
+
];
|
|
64
|
+
/** A copy of client-supplied run params without the {@link SERVER_ONLY_RUN_VIEW_PARAMS} fields. */
|
|
65
|
+
export function StripServerOnlyRunViewParams(params) {
|
|
66
|
+
const copy = { ...params };
|
|
67
|
+
for (const key of SERVER_ONLY_RUN_VIEW_PARAMS) {
|
|
68
|
+
delete copy[key];
|
|
69
|
+
}
|
|
70
|
+
return copy;
|
|
71
|
+
}
|
|
52
72
|
/**
|
|
53
73
|
* Parameters for running either a stored or dynamic view.
|
|
54
74
|
* A stored view is a view that is saved in the database and can be run either by ID or Name.
|
|
@@ -98,6 +118,8 @@ export class RunViewParams {
|
|
|
98
118
|
return false;
|
|
99
119
|
if (a.MaxRows !== b.MaxRows)
|
|
100
120
|
return false;
|
|
121
|
+
if (a.SkipTotalRowCount !== b.SkipTotalRowCount)
|
|
122
|
+
return false;
|
|
101
123
|
if (a.StartRow !== b.StartRow)
|
|
102
124
|
return false;
|
|
103
125
|
if (!RunViewParams.afterKeyEqual(a.AfterKey, b.AfterKey))
|
|
@@ -116,11 +138,22 @@ export class RunViewParams {
|
|
|
116
138
|
// undefined and false mean the same thing and must not cause a spurious one.
|
|
117
139
|
if ((a.IncludeBinaryFields === true) !== (b.IncludeBinaryFields === true))
|
|
118
140
|
return false;
|
|
141
|
+
if (a.TimeZone !== b.TimeZone)
|
|
142
|
+
return false;
|
|
143
|
+
if (ViewPropertyValuesKey(a.Properties, a.ServerProperties) !== ViewPropertyValuesKey(b.Properties, b.ServerProperties))
|
|
144
|
+
return false;
|
|
119
145
|
// A Live↔Materialized DataSource toggle changes the result set and MUST trigger a reload. Compared via
|
|
120
146
|
// IsMaterializedDataSource so undefined/'Live' are treated as equal (no spurious reload) while a switch to
|
|
121
147
|
// (or from) 'Materialized' is not — matching the read-routing decision everywhere else.
|
|
122
148
|
if (IsMaterializedDataSource(a.DataSource) !== IsMaterializedDataSource(b.DataSource))
|
|
123
149
|
return false;
|
|
150
|
+
// Switching AlternateBaseView (case-insensitive, trimmed) changes the underlying SQL view and MUST trigger
|
|
151
|
+
// a reload. An explicit empty string (`""`) overrides a saved User View's pinned `DisplayState.alternateBaseView`
|
|
152
|
+
// back to `BaseView` and therefore differs from `undefined` (which inherits the saved view's pin).
|
|
153
|
+
if (IsExplicitBaseViewOverride(a) !== IsExplicitBaseViewOverride(b))
|
|
154
|
+
return false;
|
|
155
|
+
if (NormalizeAlternateBaseViewName(a.AlternateBaseView) !== NormalizeAlternateBaseViewName(b.AlternateBaseView))
|
|
156
|
+
return false;
|
|
124
157
|
// Compare ViewEntity by reference (deep comparison would be expensive)
|
|
125
158
|
if (a.ViewEntity !== b.ViewEntity)
|
|
126
159
|
return false;
|
|
@@ -219,6 +252,13 @@ export class RunViewParams {
|
|
|
219
252
|
export function IsMaterializedDataSource(dataSource) {
|
|
220
253
|
return typeof dataSource === 'string' && dataSource.trim().toLowerCase() === 'materialized';
|
|
221
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* Normalizes an `AlternateBaseView` name for comparison and cache-key construction:
|
|
257
|
+
* trims whitespace and lowercases. Returns `''` when the input is null, undefined, or whitespace-only.
|
|
258
|
+
*/
|
|
259
|
+
export function NormalizeAlternateBaseViewName(name) {
|
|
260
|
+
return typeof name === 'string' ? name.trim().toLowerCase() : '';
|
|
261
|
+
}
|
|
222
262
|
/**
|
|
223
263
|
* Class for running views in a generic, tier-independent manner - uses a provider model for
|
|
224
264
|
* implementation transparently from the viewpoint of the consumer of the class. By default the RunView class you create will
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runView.js","sourceRoot":"","sources":["../../src/views/runView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{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oBAAoB,CAAC,CAAC,CAAC,CAAC;YAC3C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC;gBAC5B,UAAU,EAAE,gBAAgB;gBAC5B,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,QAAQ,GAAG;gBACtF,UAAU,EAAE,eAAe;aAC9B,EAAE,WAAW,CAAC,CAAC;YAChB,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,uDAAuD;YAC5F,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,QAAQ,GAAG,CAAC;YAC9F,MAAM,IAAI,KAAK,CACX,YAAY,OAAO,0EAA0E;gBAC7F,GAAG,WAAW,CAAC,CAAC,CAAC,YAAY,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,4DAA4D,IAAI;gBACpH,sEAAsE,CACzE,CAAC;QACN,CAAC;;YAEG,OAAO,IAAI,CAAC;IACpB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User View properties at run time: checking a view's declared properties when it is saved,
|
|
3
|
+
* working out each property's value for one run, and the SQL predicate that value drives.
|
|
4
|
+
*
|
|
5
|
+
* A property's value comes from, in order: the run's `ServerProperties` (server code only), the
|
|
6
|
+
* run's `Properties` (refused for a property whose `AllowOverride` is false), then the property's
|
|
7
|
+
* `Default`. A key that is present with `null` means "no value": the default is not used and no
|
|
8
|
+
* predicate is added. Every value is checked against the property's type and written as a typed
|
|
9
|
+
* SQL literal; nothing a caller sends is pasted into SQL as text.
|
|
10
|
+
*/
|
|
11
|
+
import type { SQLDialect } from '@memberjunction/sql-dialect';
|
|
12
|
+
import { PropertyResolutionContext, PropertyValue, PropertyValueType, UserViewProperty, UserViewPropertyOperator } from '../generic/contextTokens.js';
|
|
13
|
+
/** A run's value for one view property: one value, or a list for the `IN` operator. */
|
|
14
|
+
export type ViewPropertyValue = PropertyValue | PropertyValue[];
|
|
15
|
+
/** A run's values for a view's properties, keyed by property name. */
|
|
16
|
+
export type ViewPropertyValues = Record<string, ViewPropertyValue>;
|
|
17
|
+
/** Every operator a view property can use. */
|
|
18
|
+
export declare const USER_VIEW_PROPERTY_OPERATORS: readonly UserViewPropertyOperator[];
|
|
19
|
+
/** The operators each property type allows: ranges and lists only where they mean something. */
|
|
20
|
+
export declare const USER_VIEW_PROPERTY_OPERATORS_BY_TYPE: Record<PropertyValueType, readonly UserViewPropertyOperator[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Checks a view's declared properties, as when the view is saved.
|
|
23
|
+
* @param properties the parsed `Properties` JSON; null or undefined means the view has none
|
|
24
|
+
* @param fieldNames the field names of the view's entity
|
|
25
|
+
* @returns the problems found, each naming the property; empty when the properties are valid
|
|
26
|
+
*/
|
|
27
|
+
export declare function ValidateUserViewProperties(properties: unknown, fieldNames: readonly string[]): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Works out every declared property's value for one run.
|
|
30
|
+
* @param declared the view's properties
|
|
31
|
+
* @param clientValues values a client may set (`RunViewParams.Properties`)
|
|
32
|
+
* @param serverValues values only server code sets (`RunViewParams.ServerProperties`)
|
|
33
|
+
* @param ctx the context user, clock and time zone that token defaults are worked out with
|
|
34
|
+
* @returns each declared property's value, `null` where the run adds no predicate for it
|
|
35
|
+
* @throws naming the property: a name the view does not declare, a client value for a property
|
|
36
|
+
* that does not allow override, a value of the wrong type, a required property with no value,
|
|
37
|
+
* or a default that cannot be worked out
|
|
38
|
+
*/
|
|
39
|
+
export declare function ResolveViewPropertyValues(declared: readonly UserViewProperty[], clientValues: ViewPropertyValues | undefined, serverValues: ViewPropertyValues | undefined, ctx: PropertyResolutionContext): ViewPropertyValues;
|
|
40
|
+
/**
|
|
41
|
+
* The WHERE clause a run's property values add: one predicate per property with a value, ANDed.
|
|
42
|
+
* Values are checked again here, so nothing reaches SQL unchecked whoever produced `values`.
|
|
43
|
+
* @param fieldNames the field names of the view's entity; a target that is not one is refused
|
|
44
|
+
* @param dialect the database platform, for identifier quoting and literals
|
|
45
|
+
* @returns '' when no property has a value
|
|
46
|
+
*/
|
|
47
|
+
export declare function BuildViewPropertyFilter(declared: readonly UserViewProperty[], values: ViewPropertyValues, fieldNames: readonly string[], dialect: SQLDialect): string;
|
|
48
|
+
/**
|
|
49
|
+
* A stable text key for a run's property values (names sorted), for result-cache fingerprints and
|
|
50
|
+
* params comparison. Empty when neither map holds a value, so a run without properties keys as before.
|
|
51
|
+
*/
|
|
52
|
+
export declare function ViewPropertyValuesKey(clientValues?: ViewPropertyValues, serverValues?: ViewPropertyValues): string;
|
|
53
|
+
/** True when a property-values map holds at least one key with a defined value. */
|
|
54
|
+
export declare function HasViewPropertyValues(values: ViewPropertyValues | undefined | null): boolean;
|
|
55
|
+
//# sourceMappingURL=viewProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewProperties.d.ts","sourceRoot":"","sources":["../../src/views/viewProperties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAIH,yBAAyB,EACzB,aAAa,EACb,iBAAiB,EAEjB,gBAAgB,EAChB,wBAAwB,EAE3B,MAAM,0BAA0B,CAAC;AAElC,uFAAuF;AACvF,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,aAAa,EAAE,CAAC;AAEhE,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAEnE,8CAA8C;AAC9C,eAAO,MAAM,4BAA4B,EAAE,SAAS,wBAAwB,EAA4C,CAAC;AAEzH,gGAAgG;AAChG,eAAO,MAAM,oCAAoC,EAAE,MAAM,CAAC,iBAAiB,EAAE,SAAS,wBAAwB,EAAE,CAM/G,CAAC;AAKF;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAqBvG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACrC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,YAAY,EAAE,kBAAkB,GAAG,SAAS,EAC5C,YAAY,EAAE,kBAAkB,GAAG,SAAS,EAC5C,GAAG,EAAE,yBAAyB,GAC/B,kBAAkB,CASpB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,MAAM,EAAE,kBAAkB,EAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,EAAE,UAAU,GACpB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,CAAC,EAAE,kBAAkB,EAAE,YAAY,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAIlH;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAE5F"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User View properties at run time: checking a view's declared properties when it is saved,
|
|
3
|
+
* working out each property's value for one run, and the SQL predicate that value drives.
|
|
4
|
+
*
|
|
5
|
+
* A property's value comes from, in order: the run's `ServerProperties` (server code only), the
|
|
6
|
+
* run's `Properties` (refused for a property whose `AllowOverride` is false), then the property's
|
|
7
|
+
* `Default`. A key that is present with `null` means "no value": the default is not used and no
|
|
8
|
+
* predicate is added. Every value is checked against the property's type and written as a typed
|
|
9
|
+
* SQL literal; nothing a caller sends is pasted into SQL as text.
|
|
10
|
+
*/
|
|
11
|
+
import { EscapeSQLString } from '@memberjunction/global';
|
|
12
|
+
import { IsPropertyValueOfType, PROPERTY_VALUE_TYPES, ResolvePropertyDefault, ValidatePropertyDefault, } from '../generic/contextTokens.js';
|
|
13
|
+
/** Every operator a view property can use. */
|
|
14
|
+
export const USER_VIEW_PROPERTY_OPERATORS = ['=', '<>', 'IN', '>', '>=', '<', '<='];
|
|
15
|
+
/** The operators each property type allows: ranges and lists only where they mean something. */
|
|
16
|
+
export const USER_VIEW_PROPERTY_OPERATORS_BY_TYPE = {
|
|
17
|
+
string: USER_VIEW_PROPERTY_OPERATORS,
|
|
18
|
+
number: USER_VIEW_PROPERTY_OPERATORS,
|
|
19
|
+
date: USER_VIEW_PROPERTY_OPERATORS,
|
|
20
|
+
uuid: ['=', '<>', 'IN'],
|
|
21
|
+
boolean: ['=', '<>'],
|
|
22
|
+
};
|
|
23
|
+
/** `YYYY-MM-DD` with nothing after it: kept as written rather than turned into an instant. */
|
|
24
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
25
|
+
/**
|
|
26
|
+
* Checks a view's declared properties, as when the view is saved.
|
|
27
|
+
* @param properties the parsed `Properties` JSON; null or undefined means the view has none
|
|
28
|
+
* @param fieldNames the field names of the view's entity
|
|
29
|
+
* @returns the problems found, each naming the property; empty when the properties are valid
|
|
30
|
+
*/
|
|
31
|
+
export function ValidateUserViewProperties(properties, fieldNames) {
|
|
32
|
+
if (properties === null || properties === undefined) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
if (!Array.isArray(properties)) {
|
|
36
|
+
return ['Properties must be a list.'];
|
|
37
|
+
}
|
|
38
|
+
const errors = [];
|
|
39
|
+
const seen = new Set();
|
|
40
|
+
properties.forEach((property, index) => {
|
|
41
|
+
const name = isPlainObject(property) && typeof property.Name === 'string' ? property.Name.trim() : '';
|
|
42
|
+
const label = name ? `Property "${name}"` : `Property ${index + 1}`;
|
|
43
|
+
for (const problem of propertyErrors(property, fieldNames)) {
|
|
44
|
+
errors.push(`${label}: ${problem}`);
|
|
45
|
+
}
|
|
46
|
+
if (name && seen.has(name.toLowerCase())) {
|
|
47
|
+
errors.push(`${label}: another property has the same name.`);
|
|
48
|
+
}
|
|
49
|
+
seen.add(name.toLowerCase());
|
|
50
|
+
});
|
|
51
|
+
return errors;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Works out every declared property's value for one run.
|
|
55
|
+
* @param declared the view's properties
|
|
56
|
+
* @param clientValues values a client may set (`RunViewParams.Properties`)
|
|
57
|
+
* @param serverValues values only server code sets (`RunViewParams.ServerProperties`)
|
|
58
|
+
* @param ctx the context user, clock and time zone that token defaults are worked out with
|
|
59
|
+
* @returns each declared property's value, `null` where the run adds no predicate for it
|
|
60
|
+
* @throws naming the property: a name the view does not declare, a client value for a property
|
|
61
|
+
* that does not allow override, a value of the wrong type, a required property with no value,
|
|
62
|
+
* or a default that cannot be worked out
|
|
63
|
+
*/
|
|
64
|
+
export function ResolveViewPropertyValues(declared, clientValues, serverValues, ctx) {
|
|
65
|
+
const names = new Set(declared.map(p => p.Name));
|
|
66
|
+
assertKnownNames(names, clientValues, 'Properties');
|
|
67
|
+
assertKnownNames(names, serverValues, 'ServerProperties');
|
|
68
|
+
const resolved = {};
|
|
69
|
+
for (const property of declared) {
|
|
70
|
+
resolved[property.Name] = resolveOne(property, clientValues, serverValues, ctx);
|
|
71
|
+
}
|
|
72
|
+
return resolved;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The WHERE clause a run's property values add: one predicate per property with a value, ANDed.
|
|
76
|
+
* Values are checked again here, so nothing reaches SQL unchecked whoever produced `values`.
|
|
77
|
+
* @param fieldNames the field names of the view's entity; a target that is not one is refused
|
|
78
|
+
* @param dialect the database platform, for identifier quoting and literals
|
|
79
|
+
* @returns '' when no property has a value
|
|
80
|
+
*/
|
|
81
|
+
export function BuildViewPropertyFilter(declared, values, fieldNames, dialect) {
|
|
82
|
+
const predicates = [];
|
|
83
|
+
for (const property of declared) {
|
|
84
|
+
const value = values[property.Name];
|
|
85
|
+
if (value !== null && value !== undefined) {
|
|
86
|
+
predicates.push(buildPredicate(property, value, fieldNames, dialect));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return predicates.join(' AND ');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A stable text key for a run's property values (names sorted), for result-cache fingerprints and
|
|
93
|
+
* params comparison. Empty when neither map holds a value, so a run without properties keys as before.
|
|
94
|
+
*/
|
|
95
|
+
export function ViewPropertyValuesKey(clientValues, serverValues) {
|
|
96
|
+
const client = sortedEntries(clientValues);
|
|
97
|
+
const server = sortedEntries(serverValues);
|
|
98
|
+
return client.length === 0 && server.length === 0 ? '' : JSON.stringify({ p: client, s: server });
|
|
99
|
+
}
|
|
100
|
+
/** True when a property-values map holds at least one key with a defined value. */
|
|
101
|
+
export function HasViewPropertyValues(values) {
|
|
102
|
+
return sortedEntries(values ?? undefined).length > 0;
|
|
103
|
+
}
|
|
104
|
+
function sortedEntries(values) {
|
|
105
|
+
if (!values || typeof values !== 'object') {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
return Object.keys(values)
|
|
109
|
+
.filter(key => values[key] !== undefined)
|
|
110
|
+
.sort()
|
|
111
|
+
.map(key => [key, values[key]]);
|
|
112
|
+
}
|
|
113
|
+
function isPlainObject(value) {
|
|
114
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
115
|
+
}
|
|
116
|
+
function hasValue(values, name) {
|
|
117
|
+
return !!values && Object.prototype.hasOwnProperty.call(values, name) && values[name] !== undefined;
|
|
118
|
+
}
|
|
119
|
+
/** Problems with one declared property, without its label. */
|
|
120
|
+
function propertyErrors(property, fieldNames) {
|
|
121
|
+
if (!isPlainObject(property)) {
|
|
122
|
+
return ['must be an object.'];
|
|
123
|
+
}
|
|
124
|
+
const errors = [];
|
|
125
|
+
if (typeof property.Name !== 'string' || property.Name.trim().length === 0) {
|
|
126
|
+
errors.push('Name is required.');
|
|
127
|
+
}
|
|
128
|
+
const type = property.Type;
|
|
129
|
+
if (!PROPERTY_VALUE_TYPES.includes(type)) {
|
|
130
|
+
errors.push(`Type must be one of ${PROPERTY_VALUE_TYPES.join(', ')}.`);
|
|
131
|
+
return errors;
|
|
132
|
+
}
|
|
133
|
+
errors.push(...targetErrors(property.Target, type, fieldNames));
|
|
134
|
+
if (property.Default !== undefined) {
|
|
135
|
+
errors.push(...ValidatePropertyDefault(property.Default, type));
|
|
136
|
+
}
|
|
137
|
+
for (const flag of ['IsRequired', 'AllowOverride']) {
|
|
138
|
+
if (property[flag] !== undefined && typeof property[flag] !== 'boolean') {
|
|
139
|
+
errors.push(`${flag} must be true or false.`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (property.Description !== undefined && typeof property.Description !== 'string') {
|
|
143
|
+
errors.push('Description must be text.');
|
|
144
|
+
}
|
|
145
|
+
return errors;
|
|
146
|
+
}
|
|
147
|
+
function targetErrors(target, type, fieldNames) {
|
|
148
|
+
if (!isPlainObject(target)) {
|
|
149
|
+
return ['Target is required, with a Field and an Operator.'];
|
|
150
|
+
}
|
|
151
|
+
const errors = [];
|
|
152
|
+
if (typeof target.Field !== 'string' || !findField(fieldNames, target.Field)) {
|
|
153
|
+
errors.push(`Target.Field "${String(target.Field)}" is not a field of the view's entity.`);
|
|
154
|
+
}
|
|
155
|
+
const operator = target.Operator;
|
|
156
|
+
if (!USER_VIEW_PROPERTY_OPERATORS.includes(operator)) {
|
|
157
|
+
errors.push(`Target.Operator must be one of ${USER_VIEW_PROPERTY_OPERATORS.join(', ')}.`);
|
|
158
|
+
}
|
|
159
|
+
else if (!USER_VIEW_PROPERTY_OPERATORS_BY_TYPE[type].includes(operator)) {
|
|
160
|
+
errors.push(`Target.Operator ${operator} does not apply to a ${type} property. Allowed: ${USER_VIEW_PROPERTY_OPERATORS_BY_TYPE[type].join(', ')}.`);
|
|
161
|
+
}
|
|
162
|
+
return errors;
|
|
163
|
+
}
|
|
164
|
+
function findField(fieldNames, name) {
|
|
165
|
+
const wanted = name.trim().toLowerCase();
|
|
166
|
+
return fieldNames.find(f => f.toLowerCase() === wanted);
|
|
167
|
+
}
|
|
168
|
+
function assertKnownNames(names, values, source) {
|
|
169
|
+
if (values === undefined || values === null) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (!isPlainObject(values)) {
|
|
173
|
+
throw new Error(`${source} must be an object of property values keyed by name.`);
|
|
174
|
+
}
|
|
175
|
+
for (const name of Object.keys(values)) {
|
|
176
|
+
if (!names.has(name)) {
|
|
177
|
+
const declared = names.size > 0 ? `The view declares: ${[...names].join(', ')}.` : 'The view declares no properties.';
|
|
178
|
+
throw new Error(`Unknown view property "${name}" in ${source}. ${declared}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function resolveOne(property, clientValues, serverValues, ctx) {
|
|
183
|
+
if (hasValue(clientValues, property.Name) && property.AllowOverride === false) {
|
|
184
|
+
throw new Error(`View property "${property.Name}" is set by the server; a client value for it is refused.`);
|
|
185
|
+
}
|
|
186
|
+
const value = hasValue(serverValues, property.Name) ? serverValues[property.Name]
|
|
187
|
+
: hasValue(clientValues, property.Name) ? clientValues[property.Name]
|
|
188
|
+
: defaultValue(property, ctx);
|
|
189
|
+
const checked = checkValue(property, value);
|
|
190
|
+
if (checked === null && property.IsRequired) {
|
|
191
|
+
throw new Error(`View property "${property.Name}" is required and has no value.`);
|
|
192
|
+
}
|
|
193
|
+
return checked;
|
|
194
|
+
}
|
|
195
|
+
function defaultValue(property, ctx) {
|
|
196
|
+
if (!property.Default) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
return ResolvePropertyDefault(property.Default, ctx);
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
throw new Error(`View property "${property.Name}": its default cannot be worked out. ${e instanceof Error ? e.message : String(e)}`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/** A value checked against the property: null, one value of its type, or (for `IN`) a list of them. */
|
|
207
|
+
function checkValue(property, value) {
|
|
208
|
+
if (value === null || value === undefined) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
if (!Array.isArray(value)) {
|
|
212
|
+
return checkScalar(property, value);
|
|
213
|
+
}
|
|
214
|
+
if (property.Target?.Operator !== 'IN') {
|
|
215
|
+
throw new Error(`View property "${property.Name}" takes one value, not a list; only the IN operator takes a list.`);
|
|
216
|
+
}
|
|
217
|
+
return value.map(item => checkScalar(property, item));
|
|
218
|
+
}
|
|
219
|
+
function checkScalar(property, value) {
|
|
220
|
+
const scalar = typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
221
|
+
if (!scalar || !IsPropertyValueOfType(value, property.Type)) {
|
|
222
|
+
throw new Error(`View property "${property.Name}" needs a ${property.Type} value; ${JSON.stringify(value)} is not one.`);
|
|
223
|
+
}
|
|
224
|
+
if (property.Type === 'date' && !DATE_ONLY.test(value)) {
|
|
225
|
+
return new Date(value).toISOString(); // one spelling per instant, in UTC
|
|
226
|
+
}
|
|
227
|
+
return value;
|
|
228
|
+
}
|
|
229
|
+
function buildPredicate(property, value, fieldNames, dialect) {
|
|
230
|
+
const target = property.Target;
|
|
231
|
+
const field = typeof target?.Field === 'string' ? findField(fieldNames, target.Field) : undefined;
|
|
232
|
+
if (!field) {
|
|
233
|
+
throw new Error(`View property "${property.Name}" targets "${String(target?.Field)}", which is not a field of the view's entity.`);
|
|
234
|
+
}
|
|
235
|
+
if (!USER_VIEW_PROPERTY_OPERATORS_BY_TYPE[property.Type]?.includes(target.Operator)) {
|
|
236
|
+
throw new Error(`View property "${property.Name}": operator ${String(target.Operator)} does not apply to a ${property.Type} property.`);
|
|
237
|
+
}
|
|
238
|
+
const column = dialect.QuoteIdentifier(field);
|
|
239
|
+
const checked = checkValue(property, value);
|
|
240
|
+
if (target.Operator !== 'IN') {
|
|
241
|
+
return `${column} ${target.Operator} ${sqlLiteral(property.Type, checked, dialect)}`;
|
|
242
|
+
}
|
|
243
|
+
const list = Array.isArray(checked) ? checked : [checked];
|
|
244
|
+
// An empty list matches nothing, as IN over an empty set does; SQL has no empty IN ().
|
|
245
|
+
return list.length === 0 ? '1 = 0' : `${column} IN (${list.map(v => sqlLiteral(property.Type, v, dialect)).join(', ')})`;
|
|
246
|
+
}
|
|
247
|
+
/** A checked, non-null value as a typed SQL literal. */
|
|
248
|
+
function sqlLiteral(type, value, dialect) {
|
|
249
|
+
if (type === 'number') {
|
|
250
|
+
return String(value);
|
|
251
|
+
}
|
|
252
|
+
if (type === 'boolean') {
|
|
253
|
+
return dialect.BooleanLiteral(value);
|
|
254
|
+
}
|
|
255
|
+
const text = String(value);
|
|
256
|
+
return `${dialect.StringLiteralPrefix(text)}'${EscapeSQLString(text)}'`;
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=viewProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewProperties.js","sourceRoot":"","sources":["../../src/views/viewProperties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EACH,qBAAqB,EACrB,oBAAoB,EAKpB,sBAAsB,EAGtB,uBAAuB,GAC1B,MAAM,0BAA0B,CAAC;AAQlC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,4BAA4B,GAAwC,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAEzH,gGAAgG;AAChG,MAAM,CAAC,MAAM,oCAAoC,GAAmE;IAChH,MAAM,EAAE,4BAA4B;IACpC,MAAM,EAAE,4BAA4B;I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