@katlux/providers 0.1.1-alpha.114 → 0.1.1-alpha.116
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 +56 -20
- package/dist/index.d.cts +7 -3
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.mjs +56 -20
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4730,6 +4730,9 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4730
4730
|
const { rows, decrypted } = await this.decryptRows(this.pageData);
|
|
4731
4731
|
if (decrypted) {
|
|
4732
4732
|
this.pageData = rows;
|
|
4733
|
+
if (this.pageSize <= 0) {
|
|
4734
|
+
this._rowMap = rows;
|
|
4735
|
+
}
|
|
4733
4736
|
}
|
|
4734
4737
|
}
|
|
4735
4738
|
} catch (err) {
|
|
@@ -7035,10 +7038,26 @@ class CFlatServerDataProvider extends ADataProvider {
|
|
|
7035
7038
|
};
|
|
7036
7039
|
};
|
|
7037
7040
|
contextKey = "";
|
|
7041
|
+
encryption;
|
|
7038
7042
|
latestRequestId = 0;
|
|
7039
7043
|
abortController = null;
|
|
7040
7044
|
constructor(options) {
|
|
7041
7045
|
super(options);
|
|
7046
|
+
if (options?.encryption) {
|
|
7047
|
+
this.encryption = options.encryption;
|
|
7048
|
+
}
|
|
7049
|
+
}
|
|
7050
|
+
setEncryption(encryption) {
|
|
7051
|
+
if (this.encryption && this.encryption !== encryption) {
|
|
7052
|
+
clearCachedCipherProvider(this.encryption);
|
|
7053
|
+
}
|
|
7054
|
+
this.encryption = encryption;
|
|
7055
|
+
}
|
|
7056
|
+
clearEncryption() {
|
|
7057
|
+
if (this.encryption) {
|
|
7058
|
+
clearCachedCipherProvider(this.encryption);
|
|
7059
|
+
}
|
|
7060
|
+
this.encryption = void 0;
|
|
7042
7061
|
}
|
|
7043
7062
|
setContextKey(key) {
|
|
7044
7063
|
this.contextKey = key;
|
|
@@ -7104,14 +7123,15 @@ class CFlatServerDataProvider extends ADataProvider {
|
|
|
7104
7123
|
if (requestId !== this.latestRequestId) return;
|
|
7105
7124
|
if (returnedData) {
|
|
7106
7125
|
const normalized = normalizeDataResult(returnedData);
|
|
7126
|
+
let rows = normalized ? normalized.rows : returnedData.rows || [];
|
|
7127
|
+
const rowCount = normalized ? normalized.rowCount : returnedData.rowCount ?? 0;
|
|
7128
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
7129
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
7130
|
+
if (decrypted) rows = decRows;
|
|
7131
|
+
}
|
|
7107
7132
|
this.batchUpdates(() => {
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
this.rowCount = normalized.rowCount;
|
|
7111
|
-
} else {
|
|
7112
|
-
this.pageData = returnedData.rows || [];
|
|
7113
|
-
this.rowCount = returnedData.rowCount ?? 0;
|
|
7114
|
-
}
|
|
7133
|
+
this.pageData = rows;
|
|
7134
|
+
this.rowCount = rowCount;
|
|
7115
7135
|
this.initialLoad = false;
|
|
7116
7136
|
});
|
|
7117
7137
|
} else {
|
|
@@ -7151,7 +7171,6 @@ class CAPIFlatServerDataProvider extends CFlatServerDataProvider {
|
|
|
7151
7171
|
cacheLifetime = 0;
|
|
7152
7172
|
refreshOnMutation = true;
|
|
7153
7173
|
// Default true for server
|
|
7154
|
-
encryption;
|
|
7155
7174
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
7156
7175
|
_requestGeneration = 0;
|
|
7157
7176
|
constructor(options) {
|
|
@@ -7174,11 +7193,11 @@ class CAPIFlatServerDataProvider extends CFlatServerDataProvider {
|
|
|
7174
7193
|
});
|
|
7175
7194
|
}
|
|
7176
7195
|
setEncryption(encryption) {
|
|
7177
|
-
|
|
7196
|
+
super.setEncryption(encryption);
|
|
7178
7197
|
this.requestProvider.setEncryption(encryption);
|
|
7179
7198
|
}
|
|
7180
7199
|
clearEncryption() {
|
|
7181
|
-
|
|
7200
|
+
super.clearEncryption();
|
|
7182
7201
|
this.requestProvider.clearEncryption();
|
|
7183
7202
|
}
|
|
7184
7203
|
async refresh(hardRefresh = false) {
|
|
@@ -7721,6 +7740,9 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
7721
7740
|
const { rows, decrypted } = await this.decryptRows(this.pageData);
|
|
7722
7741
|
if (decrypted) {
|
|
7723
7742
|
this.pageData = rows;
|
|
7743
|
+
if (this.pageSize <= 0) {
|
|
7744
|
+
this._rowMap = rows;
|
|
7745
|
+
}
|
|
7724
7746
|
}
|
|
7725
7747
|
}
|
|
7726
7748
|
} catch (err) {
|
|
@@ -8156,6 +8178,7 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8156
8178
|
// Server-side data handler
|
|
8157
8179
|
pageDataHandler = null;
|
|
8158
8180
|
contextKey = "";
|
|
8181
|
+
encryption;
|
|
8159
8182
|
constructor(options) {
|
|
8160
8183
|
super(options);
|
|
8161
8184
|
this.expandedNodes = /* @__PURE__ */ new Set();
|
|
@@ -8165,6 +8188,19 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8165
8188
|
if (options?.idKey) this.idKey = options.idKey;
|
|
8166
8189
|
if (options?.expandedByDefault !== void 0) this.expandedByDefault = options.expandedByDefault;
|
|
8167
8190
|
if (options?.paginateBy) this.paginateBy = options.paginateBy;
|
|
8191
|
+
if (options?.encryption) this.encryption = options.encryption;
|
|
8192
|
+
}
|
|
8193
|
+
setEncryption(encryption) {
|
|
8194
|
+
if (this.encryption && this.encryption !== encryption) {
|
|
8195
|
+
clearCachedCipherProvider(this.encryption);
|
|
8196
|
+
}
|
|
8197
|
+
this.encryption = encryption;
|
|
8198
|
+
}
|
|
8199
|
+
clearEncryption() {
|
|
8200
|
+
if (this.encryption) {
|
|
8201
|
+
clearCachedCipherProvider(this.encryption);
|
|
8202
|
+
}
|
|
8203
|
+
this.encryption = void 0;
|
|
8168
8204
|
}
|
|
8169
8205
|
setContextKey(key) {
|
|
8170
8206
|
this.contextKey = key;
|
|
@@ -8247,14 +8283,15 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8247
8283
|
if (requestId !== this.latestRequestId) return;
|
|
8248
8284
|
if (returnedData) {
|
|
8249
8285
|
const normalized = normalizeDataResult(returnedData);
|
|
8286
|
+
let rows = normalized ? normalized.rows : returnedData.rows || [];
|
|
8287
|
+
const rowCount = normalized ? normalized.rowCount : returnedData.rowCount ?? 0;
|
|
8288
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
8289
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
8290
|
+
if (decrypted) rows = decRows;
|
|
8291
|
+
}
|
|
8250
8292
|
this.batchUpdates(() => {
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
this.rowCount = normalized.rowCount;
|
|
8254
|
-
} else {
|
|
8255
|
-
this.pageData = returnedData.rows || [];
|
|
8256
|
-
this.rowCount = returnedData.rowCount ?? 0;
|
|
8257
|
-
}
|
|
8293
|
+
this.pageData = rows;
|
|
8294
|
+
this.rowCount = rowCount;
|
|
8258
8295
|
this.initialLoad = false;
|
|
8259
8296
|
});
|
|
8260
8297
|
} else {
|
|
@@ -8337,7 +8374,6 @@ class CAPITreeServerDataProvider extends CTreeServerDataProvider {
|
|
|
8337
8374
|
cacheLifetime = 0;
|
|
8338
8375
|
refreshOnMutation = true;
|
|
8339
8376
|
// Default true for server
|
|
8340
|
-
encryption;
|
|
8341
8377
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
8342
8378
|
_requestGeneration = 0;
|
|
8343
8379
|
constructor(options) {
|
|
@@ -8361,11 +8397,11 @@ class CAPITreeServerDataProvider extends CTreeServerDataProvider {
|
|
|
8361
8397
|
});
|
|
8362
8398
|
}
|
|
8363
8399
|
setEncryption(encryption) {
|
|
8364
|
-
|
|
8400
|
+
super.setEncryption(encryption);
|
|
8365
8401
|
this.requestProvider.setEncryption(encryption);
|
|
8366
8402
|
}
|
|
8367
8403
|
clearEncryption() {
|
|
8368
|
-
|
|
8404
|
+
super.clearEncryption();
|
|
8369
8405
|
this.requestProvider.clearEncryption();
|
|
8370
8406
|
}
|
|
8371
8407
|
async refresh(hardRefresh = false) {
|
package/dist/index.d.cts
CHANGED
|
@@ -618,7 +618,7 @@ declare abstract class AEncryptedClientProvider<TRow = TDataRow> extends ADataPr
|
|
|
618
618
|
declare class CFlatClientDataProvider<TRow = TDataRow> extends AEncryptedClientProvider<TRow> {
|
|
619
619
|
private _allData;
|
|
620
620
|
filteredData: TRow[];
|
|
621
|
-
|
|
621
|
+
protected _rowMap: TRow[];
|
|
622
622
|
protected _filterDirty: boolean;
|
|
623
623
|
protected _sortDirty: boolean;
|
|
624
624
|
protected _activeFilterEvaluator: ((row: any) => boolean) | null;
|
|
@@ -754,9 +754,12 @@ declare class CAPIFlatClientDataProvider<TRow = TDataRow> extends CFlatClientDat
|
|
|
754
754
|
declare class CFlatServerDataProvider<TRow = TDataRow> extends ADataProvider<TRow> {
|
|
755
755
|
pageDataHandler: TPageDataHandler<TRow>;
|
|
756
756
|
contextKey: string;
|
|
757
|
+
encryption?: IProviderEncryptionOptions;
|
|
757
758
|
private latestRequestId;
|
|
758
759
|
private abortController;
|
|
759
760
|
constructor(options?: IDataProviderOptions);
|
|
761
|
+
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
762
|
+
clearEncryption(): void;
|
|
760
763
|
setContextKey(key: string): void;
|
|
761
764
|
setPageDataHandler(handler: TPageDataHandler<TRow>): Promise<void>;
|
|
762
765
|
loadPageData(options?: {
|
|
@@ -773,7 +776,6 @@ declare class CAPIFlatServerDataProvider<TRow = TDataRow> extends CFlatServerDat
|
|
|
773
776
|
cacheStrategy: ECacheStrategy | null;
|
|
774
777
|
cacheLifetime: number;
|
|
775
778
|
refreshOnMutation: boolean | undefined;
|
|
776
|
-
encryption?: IProviderEncryptionOptions;
|
|
777
779
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
778
780
|
private _requestGeneration;
|
|
779
781
|
constructor(options?: IDataProviderOptions);
|
|
@@ -883,7 +885,10 @@ declare class CTreeServerDataProvider<TRow = TDataRow> extends ADataProvider<TRo
|
|
|
883
885
|
expandedNodes: Set<string | number>;
|
|
884
886
|
pageDataHandler: TTreePageDataHandler<TRow> | null;
|
|
885
887
|
contextKey: string;
|
|
888
|
+
encryption?: IProviderEncryptionOptions;
|
|
886
889
|
constructor(options?: ITreeDataProviderOptions);
|
|
890
|
+
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
891
|
+
clearEncryption(): void;
|
|
887
892
|
setContextKey(key: string): void;
|
|
888
893
|
setPageDataHandler(handler: TTreePageDataHandler<TRow>): Promise<void>;
|
|
889
894
|
private latestRequestId;
|
|
@@ -919,7 +924,6 @@ declare class CAPITreeServerDataProvider<TRow = TDataRow> extends CTreeServerDat
|
|
|
919
924
|
cacheStrategy: ECacheStrategy | null;
|
|
920
925
|
cacheLifetime: number;
|
|
921
926
|
refreshOnMutation: boolean | undefined;
|
|
922
|
-
encryption?: IProviderEncryptionOptions;
|
|
923
927
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
924
928
|
private _requestGeneration;
|
|
925
929
|
constructor(options?: ITreeDataProviderOptions);
|
package/dist/index.d.mts
CHANGED
|
@@ -618,7 +618,7 @@ declare abstract class AEncryptedClientProvider<TRow = TDataRow> extends ADataPr
|
|
|
618
618
|
declare class CFlatClientDataProvider<TRow = TDataRow> extends AEncryptedClientProvider<TRow> {
|
|
619
619
|
private _allData;
|
|
620
620
|
filteredData: TRow[];
|
|
621
|
-
|
|
621
|
+
protected _rowMap: TRow[];
|
|
622
622
|
protected _filterDirty: boolean;
|
|
623
623
|
protected _sortDirty: boolean;
|
|
624
624
|
protected _activeFilterEvaluator: ((row: any) => boolean) | null;
|
|
@@ -754,9 +754,12 @@ declare class CAPIFlatClientDataProvider<TRow = TDataRow> extends CFlatClientDat
|
|
|
754
754
|
declare class CFlatServerDataProvider<TRow = TDataRow> extends ADataProvider<TRow> {
|
|
755
755
|
pageDataHandler: TPageDataHandler<TRow>;
|
|
756
756
|
contextKey: string;
|
|
757
|
+
encryption?: IProviderEncryptionOptions;
|
|
757
758
|
private latestRequestId;
|
|
758
759
|
private abortController;
|
|
759
760
|
constructor(options?: IDataProviderOptions);
|
|
761
|
+
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
762
|
+
clearEncryption(): void;
|
|
760
763
|
setContextKey(key: string): void;
|
|
761
764
|
setPageDataHandler(handler: TPageDataHandler<TRow>): Promise<void>;
|
|
762
765
|
loadPageData(options?: {
|
|
@@ -773,7 +776,6 @@ declare class CAPIFlatServerDataProvider<TRow = TDataRow> extends CFlatServerDat
|
|
|
773
776
|
cacheStrategy: ECacheStrategy | null;
|
|
774
777
|
cacheLifetime: number;
|
|
775
778
|
refreshOnMutation: boolean | undefined;
|
|
776
|
-
encryption?: IProviderEncryptionOptions;
|
|
777
779
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
778
780
|
private _requestGeneration;
|
|
779
781
|
constructor(options?: IDataProviderOptions);
|
|
@@ -883,7 +885,10 @@ declare class CTreeServerDataProvider<TRow = TDataRow> extends ADataProvider<TRo
|
|
|
883
885
|
expandedNodes: Set<string | number>;
|
|
884
886
|
pageDataHandler: TTreePageDataHandler<TRow> | null;
|
|
885
887
|
contextKey: string;
|
|
888
|
+
encryption?: IProviderEncryptionOptions;
|
|
886
889
|
constructor(options?: ITreeDataProviderOptions);
|
|
890
|
+
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
891
|
+
clearEncryption(): void;
|
|
887
892
|
setContextKey(key: string): void;
|
|
888
893
|
setPageDataHandler(handler: TTreePageDataHandler<TRow>): Promise<void>;
|
|
889
894
|
private latestRequestId;
|
|
@@ -919,7 +924,6 @@ declare class CAPITreeServerDataProvider<TRow = TDataRow> extends CTreeServerDat
|
|
|
919
924
|
cacheStrategy: ECacheStrategy | null;
|
|
920
925
|
cacheLifetime: number;
|
|
921
926
|
refreshOnMutation: boolean | undefined;
|
|
922
|
-
encryption?: IProviderEncryptionOptions;
|
|
923
927
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
924
928
|
private _requestGeneration;
|
|
925
929
|
constructor(options?: ITreeDataProviderOptions);
|
package/dist/index.d.ts
CHANGED
|
@@ -618,7 +618,7 @@ declare abstract class AEncryptedClientProvider<TRow = TDataRow> extends ADataPr
|
|
|
618
618
|
declare class CFlatClientDataProvider<TRow = TDataRow> extends AEncryptedClientProvider<TRow> {
|
|
619
619
|
private _allData;
|
|
620
620
|
filteredData: TRow[];
|
|
621
|
-
|
|
621
|
+
protected _rowMap: TRow[];
|
|
622
622
|
protected _filterDirty: boolean;
|
|
623
623
|
protected _sortDirty: boolean;
|
|
624
624
|
protected _activeFilterEvaluator: ((row: any) => boolean) | null;
|
|
@@ -754,9 +754,12 @@ declare class CAPIFlatClientDataProvider<TRow = TDataRow> extends CFlatClientDat
|
|
|
754
754
|
declare class CFlatServerDataProvider<TRow = TDataRow> extends ADataProvider<TRow> {
|
|
755
755
|
pageDataHandler: TPageDataHandler<TRow>;
|
|
756
756
|
contextKey: string;
|
|
757
|
+
encryption?: IProviderEncryptionOptions;
|
|
757
758
|
private latestRequestId;
|
|
758
759
|
private abortController;
|
|
759
760
|
constructor(options?: IDataProviderOptions);
|
|
761
|
+
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
762
|
+
clearEncryption(): void;
|
|
760
763
|
setContextKey(key: string): void;
|
|
761
764
|
setPageDataHandler(handler: TPageDataHandler<TRow>): Promise<void>;
|
|
762
765
|
loadPageData(options?: {
|
|
@@ -773,7 +776,6 @@ declare class CAPIFlatServerDataProvider<TRow = TDataRow> extends CFlatServerDat
|
|
|
773
776
|
cacheStrategy: ECacheStrategy | null;
|
|
774
777
|
cacheLifetime: number;
|
|
775
778
|
refreshOnMutation: boolean | undefined;
|
|
776
|
-
encryption?: IProviderEncryptionOptions;
|
|
777
779
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
778
780
|
private _requestGeneration;
|
|
779
781
|
constructor(options?: IDataProviderOptions);
|
|
@@ -883,7 +885,10 @@ declare class CTreeServerDataProvider<TRow = TDataRow> extends ADataProvider<TRo
|
|
|
883
885
|
expandedNodes: Set<string | number>;
|
|
884
886
|
pageDataHandler: TTreePageDataHandler<TRow> | null;
|
|
885
887
|
contextKey: string;
|
|
888
|
+
encryption?: IProviderEncryptionOptions;
|
|
886
889
|
constructor(options?: ITreeDataProviderOptions);
|
|
890
|
+
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
891
|
+
clearEncryption(): void;
|
|
887
892
|
setContextKey(key: string): void;
|
|
888
893
|
setPageDataHandler(handler: TTreePageDataHandler<TRow>): Promise<void>;
|
|
889
894
|
private latestRequestId;
|
|
@@ -919,7 +924,6 @@ declare class CAPITreeServerDataProvider<TRow = TDataRow> extends CTreeServerDat
|
|
|
919
924
|
cacheStrategy: ECacheStrategy | null;
|
|
920
925
|
cacheLifetime: number;
|
|
921
926
|
refreshOnMutation: boolean | undefined;
|
|
922
|
-
encryption?: IProviderEncryptionOptions;
|
|
923
927
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
924
928
|
private _requestGeneration;
|
|
925
929
|
constructor(options?: ITreeDataProviderOptions);
|
package/dist/index.mjs
CHANGED
|
@@ -4713,6 +4713,9 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4713
4713
|
const { rows, decrypted } = await this.decryptRows(this.pageData);
|
|
4714
4714
|
if (decrypted) {
|
|
4715
4715
|
this.pageData = rows;
|
|
4716
|
+
if (this.pageSize <= 0) {
|
|
4717
|
+
this._rowMap = rows;
|
|
4718
|
+
}
|
|
4716
4719
|
}
|
|
4717
4720
|
}
|
|
4718
4721
|
} catch (err) {
|
|
@@ -7018,10 +7021,26 @@ class CFlatServerDataProvider extends ADataProvider {
|
|
|
7018
7021
|
};
|
|
7019
7022
|
};
|
|
7020
7023
|
contextKey = "";
|
|
7024
|
+
encryption;
|
|
7021
7025
|
latestRequestId = 0;
|
|
7022
7026
|
abortController = null;
|
|
7023
7027
|
constructor(options) {
|
|
7024
7028
|
super(options);
|
|
7029
|
+
if (options?.encryption) {
|
|
7030
|
+
this.encryption = options.encryption;
|
|
7031
|
+
}
|
|
7032
|
+
}
|
|
7033
|
+
setEncryption(encryption) {
|
|
7034
|
+
if (this.encryption && this.encryption !== encryption) {
|
|
7035
|
+
clearCachedCipherProvider(this.encryption);
|
|
7036
|
+
}
|
|
7037
|
+
this.encryption = encryption;
|
|
7038
|
+
}
|
|
7039
|
+
clearEncryption() {
|
|
7040
|
+
if (this.encryption) {
|
|
7041
|
+
clearCachedCipherProvider(this.encryption);
|
|
7042
|
+
}
|
|
7043
|
+
this.encryption = void 0;
|
|
7025
7044
|
}
|
|
7026
7045
|
setContextKey(key) {
|
|
7027
7046
|
this.contextKey = key;
|
|
@@ -7087,14 +7106,15 @@ class CFlatServerDataProvider extends ADataProvider {
|
|
|
7087
7106
|
if (requestId !== this.latestRequestId) return;
|
|
7088
7107
|
if (returnedData) {
|
|
7089
7108
|
const normalized = normalizeDataResult(returnedData);
|
|
7109
|
+
let rows = normalized ? normalized.rows : returnedData.rows || [];
|
|
7110
|
+
const rowCount = normalized ? normalized.rowCount : returnedData.rowCount ?? 0;
|
|
7111
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
7112
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
7113
|
+
if (decrypted) rows = decRows;
|
|
7114
|
+
}
|
|
7090
7115
|
this.batchUpdates(() => {
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
this.rowCount = normalized.rowCount;
|
|
7094
|
-
} else {
|
|
7095
|
-
this.pageData = returnedData.rows || [];
|
|
7096
|
-
this.rowCount = returnedData.rowCount ?? 0;
|
|
7097
|
-
}
|
|
7116
|
+
this.pageData = rows;
|
|
7117
|
+
this.rowCount = rowCount;
|
|
7098
7118
|
this.initialLoad = false;
|
|
7099
7119
|
});
|
|
7100
7120
|
} else {
|
|
@@ -7134,7 +7154,6 @@ class CAPIFlatServerDataProvider extends CFlatServerDataProvider {
|
|
|
7134
7154
|
cacheLifetime = 0;
|
|
7135
7155
|
refreshOnMutation = true;
|
|
7136
7156
|
// Default true for server
|
|
7137
|
-
encryption;
|
|
7138
7157
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
7139
7158
|
_requestGeneration = 0;
|
|
7140
7159
|
constructor(options) {
|
|
@@ -7157,11 +7176,11 @@ class CAPIFlatServerDataProvider extends CFlatServerDataProvider {
|
|
|
7157
7176
|
});
|
|
7158
7177
|
}
|
|
7159
7178
|
setEncryption(encryption) {
|
|
7160
|
-
|
|
7179
|
+
super.setEncryption(encryption);
|
|
7161
7180
|
this.requestProvider.setEncryption(encryption);
|
|
7162
7181
|
}
|
|
7163
7182
|
clearEncryption() {
|
|
7164
|
-
|
|
7183
|
+
super.clearEncryption();
|
|
7165
7184
|
this.requestProvider.clearEncryption();
|
|
7166
7185
|
}
|
|
7167
7186
|
async refresh(hardRefresh = false) {
|
|
@@ -7704,6 +7723,9 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
7704
7723
|
const { rows, decrypted } = await this.decryptRows(this.pageData);
|
|
7705
7724
|
if (decrypted) {
|
|
7706
7725
|
this.pageData = rows;
|
|
7726
|
+
if (this.pageSize <= 0) {
|
|
7727
|
+
this._rowMap = rows;
|
|
7728
|
+
}
|
|
7707
7729
|
}
|
|
7708
7730
|
}
|
|
7709
7731
|
} catch (err) {
|
|
@@ -8139,6 +8161,7 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8139
8161
|
// Server-side data handler
|
|
8140
8162
|
pageDataHandler = null;
|
|
8141
8163
|
contextKey = "";
|
|
8164
|
+
encryption;
|
|
8142
8165
|
constructor(options) {
|
|
8143
8166
|
super(options);
|
|
8144
8167
|
this.expandedNodes = /* @__PURE__ */ new Set();
|
|
@@ -8148,6 +8171,19 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8148
8171
|
if (options?.idKey) this.idKey = options.idKey;
|
|
8149
8172
|
if (options?.expandedByDefault !== void 0) this.expandedByDefault = options.expandedByDefault;
|
|
8150
8173
|
if (options?.paginateBy) this.paginateBy = options.paginateBy;
|
|
8174
|
+
if (options?.encryption) this.encryption = options.encryption;
|
|
8175
|
+
}
|
|
8176
|
+
setEncryption(encryption) {
|
|
8177
|
+
if (this.encryption && this.encryption !== encryption) {
|
|
8178
|
+
clearCachedCipherProvider(this.encryption);
|
|
8179
|
+
}
|
|
8180
|
+
this.encryption = encryption;
|
|
8181
|
+
}
|
|
8182
|
+
clearEncryption() {
|
|
8183
|
+
if (this.encryption) {
|
|
8184
|
+
clearCachedCipherProvider(this.encryption);
|
|
8185
|
+
}
|
|
8186
|
+
this.encryption = void 0;
|
|
8151
8187
|
}
|
|
8152
8188
|
setContextKey(key) {
|
|
8153
8189
|
this.contextKey = key;
|
|
@@ -8230,14 +8266,15 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8230
8266
|
if (requestId !== this.latestRequestId) return;
|
|
8231
8267
|
if (returnedData) {
|
|
8232
8268
|
const normalized = normalizeDataResult(returnedData);
|
|
8269
|
+
let rows = normalized ? normalized.rows : returnedData.rows || [];
|
|
8270
|
+
const rowCount = normalized ? normalized.rowCount : returnedData.rowCount ?? 0;
|
|
8271
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
8272
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
8273
|
+
if (decrypted) rows = decRows;
|
|
8274
|
+
}
|
|
8233
8275
|
this.batchUpdates(() => {
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
this.rowCount = normalized.rowCount;
|
|
8237
|
-
} else {
|
|
8238
|
-
this.pageData = returnedData.rows || [];
|
|
8239
|
-
this.rowCount = returnedData.rowCount ?? 0;
|
|
8240
|
-
}
|
|
8276
|
+
this.pageData = rows;
|
|
8277
|
+
this.rowCount = rowCount;
|
|
8241
8278
|
this.initialLoad = false;
|
|
8242
8279
|
});
|
|
8243
8280
|
} else {
|
|
@@ -8320,7 +8357,6 @@ class CAPITreeServerDataProvider extends CTreeServerDataProvider {
|
|
|
8320
8357
|
cacheLifetime = 0;
|
|
8321
8358
|
refreshOnMutation = true;
|
|
8322
8359
|
// Default true for server
|
|
8323
|
-
encryption;
|
|
8324
8360
|
/** Incremented on every new request; stale onDataReceived callbacks are discarded. */
|
|
8325
8361
|
_requestGeneration = 0;
|
|
8326
8362
|
constructor(options) {
|
|
@@ -8344,11 +8380,11 @@ class CAPITreeServerDataProvider extends CTreeServerDataProvider {
|
|
|
8344
8380
|
});
|
|
8345
8381
|
}
|
|
8346
8382
|
setEncryption(encryption) {
|
|
8347
|
-
|
|
8383
|
+
super.setEncryption(encryption);
|
|
8348
8384
|
this.requestProvider.setEncryption(encryption);
|
|
8349
8385
|
}
|
|
8350
8386
|
clearEncryption() {
|
|
8351
|
-
|
|
8387
|
+
super.clearEncryption();
|
|
8352
8388
|
this.requestProvider.clearEncryption();
|
|
8353
8389
|
}
|
|
8354
8390
|
async refresh(hardRefresh = false) {
|