@katlux/providers 0.1.1-alpha.129 → 0.1.1-alpha.131

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.mjs CHANGED
@@ -1,8 +1,6 @@
1
1
  import * as crypto$1 from 'node:crypto';
2
2
  import { $fetch } from 'ofetch';
3
3
 
4
- const DECRYPT_ERROR_SENTINEL = Symbol.for("katlux.decrypt_error");
5
-
6
4
  var EDataFilterOperator = /* @__PURE__ */ ((EDataFilterOperator2) => {
7
5
  EDataFilterOperator2["Equal"] = "==";
8
6
  EDataFilterOperator2["NotEqual"] = "!=";
@@ -18,6 +16,7 @@ var EDataFilterOperator = /* @__PURE__ */ ((EDataFilterOperator2) => {
18
16
  EDataFilterOperator2["Nor"] = "nor";
19
17
  return EDataFilterOperator2;
20
18
  })(EDataFilterOperator || {});
19
+
21
20
  var ECacheStrategy = /* @__PURE__ */ ((ECacheStrategy2) => {
22
21
  ECacheStrategy2["Application"] = "Application";
23
22
  ECacheStrategy2["ServerSession"] = "ServerSession";
@@ -28,6 +27,7 @@ var ECacheStrategy = /* @__PURE__ */ ((ECacheStrategy2) => {
28
27
  ECacheStrategy2["Cookie"] = "Cookie";
29
28
  return ECacheStrategy2;
30
29
  })(ECacheStrategy || {});
30
+
31
31
  var EQueueStorage = /* @__PURE__ */ ((EQueueStorage2) => {
32
32
  EQueueStorage2["Memory"] = "Memory";
33
33
  EQueueStorage2["LocalStorage"] = "LocalStorage";
@@ -35,6 +35,8 @@ var EQueueStorage = /* @__PURE__ */ ((EQueueStorage2) => {
35
35
  return EQueueStorage2;
36
36
  })(EQueueStorage || {});
37
37
 
38
+ const DECRYPT_ERROR_SENTINEL = Symbol.for("katlux.decrypt_error");
39
+
38
40
  const useDebounce = (callback, delay) => {
39
41
  let timeoutId = null;
40
42
  const debounced = function(...args) {
@@ -9079,7 +9081,7 @@ class CAPIFlatClientDataProvider extends CFlatClientDataProvider {
9079
9081
  if (this.refreshOnMutation) {
9080
9082
  await this.refresh(true);
9081
9083
  } else {
9082
- if (result && result.item) {
9084
+ if (result && typeof result === "object" && "item" in result) {
9083
9085
  this.allData = [...this.allData, result.item];
9084
9086
  this.loadPageData();
9085
9087
  } else {
@@ -9105,7 +9107,7 @@ class CAPIFlatClientDataProvider extends CFlatClientDataProvider {
9105
9107
  } else {
9106
9108
  const index = this.allData.findIndex((row) => row[this.idKey] === item[this.idKey]);
9107
9109
  if (index !== -1) {
9108
- if (result && result.item) {
9110
+ if (result && typeof result === "object" && "item" in result) {
9109
9111
  this.allData[index] = result.item;
9110
9112
  } else {
9111
9113
  if (this.encryption?.enabled) {
@@ -10333,7 +10335,7 @@ class CAPITreeClientDataProvider extends CTreeClientDataProvider {
10333
10335
  if (this.refreshOnMutation) {
10334
10336
  await this.refresh(true);
10335
10337
  } else {
10336
- if (result && result.item) {
10338
+ if (result && typeof result === "object" && "item" in result) {
10337
10339
  this.allData.push(result.item);
10338
10340
  this.invalidateStaticCache();
10339
10341
  this.loadPageData();
@@ -10360,7 +10362,7 @@ class CAPITreeClientDataProvider extends CTreeClientDataProvider {
10360
10362
  } else {
10361
10363
  const index = this.allData.findIndex((row) => row[this.idKey] === item[this.idKey]);
10362
10364
  if (index !== -1) {
10363
- if (result && result.item) {
10365
+ if (result && typeof result === "object" && "item" in result) {
10364
10366
  this.allData[index] = result.item;
10365
10367
  } else {
10366
10368
  if (this.encryption?.enabled) {
package/global.d.ts ADDED
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Global ambient declarations for @katlux/providers.
3
+ * Provides zero-import typing for core interfaces and data types.
4
+ */
5
+ import type {
6
+ IDataFilter as _IDataFilter,
7
+ IDataSort as _IDataSort,
8
+ IDataResult as _IDataResult,
9
+ IDataProviderOptions as _IDataProviderOptions,
10
+ IDataProviderState as _IDataProviderState,
11
+ TDataRow as _TDataRow,
12
+ TPageDataHandler as _TPageDataHandler,
13
+ TDataProviderListener as _TDataProviderListener,
14
+ TUnsubscribe as _TUnsubscribe,
15
+ ITreeNode as _ITreeNode,
16
+ ITreeNodeStatic as _ITreeNodeStatic,
17
+ ITreeDataProvider as _ITreeDataProvider,
18
+ ITreeDataProviderOptions as _ITreeDataProviderOptions,
19
+ TreePaginationMode as _TreePaginationMode,
20
+ TTreeRow as _TTreeRow,
21
+ IKDatatableAction as _IKDatatableAction,
22
+ KProductItemData as _KProductItemData,
23
+ KProductRowAction as _KProductRowAction,
24
+ ICacheEntry as _ICacheEntry,
25
+ ICacheQuotaOptions as _ICacheQuotaOptions,
26
+ ICookieCacheOptions as _ICookieCacheOptions,
27
+ IRequestOptions as _IRequestOptions,
28
+ IQueuedOperation as _IQueuedOperation,
29
+ IDeadLetterItem as _IDeadLetterItem,
30
+ IFlushOptions as _IFlushOptions,
31
+ IEncryptedPayload as _IEncryptedPayload,
32
+ IEncryptionContext as _IEncryptionContext,
33
+ IFieldEncryptionConfig as _IFieldEncryptionConfig,
34
+ IHybridKeyExport as _IHybridKeyExport,
35
+ IExportedKeyStore as _IExportedKeyStore,
36
+ ISearchIndexDump as _ISearchIndexDump
37
+ } from './dist/index'
38
+
39
+ declare global {
40
+ type IDataFilter = _IDataFilter
41
+ type IDataSort = _IDataSort
42
+ type IDataResult<TRow = _TDataRow> = _IDataResult<TRow>
43
+ type IDataProviderOptions<TRow = _TDataRow> = _IDataProviderOptions
44
+ type IDataProviderState<TRow = _TDataRow> = _IDataProviderState<TRow>
45
+ type TDataRow = _TDataRow
46
+ type TPageDataHandler<TRow = _TDataRow> = _TPageDataHandler<TRow>
47
+ type TDataProviderListener<T = unknown> = _TDataProviderListener<T>
48
+ type TUnsubscribe = _TUnsubscribe
49
+ type ITreeNode<TRow = _TDataRow> = _ITreeNode<TRow>
50
+ type ITreeNodeStatic<TRow = _TDataRow> = _ITreeNodeStatic<TRow>
51
+ type ITreeDataProvider<TRow = _TDataRow> = _ITreeDataProvider<TRow>
52
+ type ITreeDataProviderOptions = _ITreeDataProviderOptions
53
+ type TreePaginationMode = _TreePaginationMode
54
+ type TTreeRow<TRow = _TDataRow> = _TTreeRow<TRow>
55
+ type IKDatatableAction = _IKDatatableAction
56
+ type KProductItemData = _KProductItemData
57
+ type KProductRowAction = _KProductRowAction
58
+ type ICacheEntry<T = any> = _ICacheEntry<T>
59
+ type ICacheQuotaOptions = _ICacheQuotaOptions
60
+ type ICookieCacheOptions = _ICookieCacheOptions
61
+ type IRequestOptions = _IRequestOptions
62
+ type IQueuedOperation = _IQueuedOperation
63
+ type IDeadLetterItem = _IDeadLetterItem
64
+ type IFlushOptions = _IFlushOptions
65
+ type IEncryptedPayload = _IEncryptedPayload
66
+ type IEncryptionContext = _IEncryptionContext
67
+ type IFieldEncryptionConfig = _IFieldEncryptionConfig
68
+ type IHybridKeyExport = _IHybridKeyExport
69
+ type IExportedKeyStore = _IExportedKeyStore
70
+ type ISearchIndexDump = _ISearchIndexDump
71
+ }
72
+
73
+ export {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/providers",
3
- "version": "0.1.1-alpha.129",
3
+ "version": "0.1.1-alpha.131",
4
4
  "description": "Core data calculation and caching providers for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "Apache-2.0",
@@ -19,6 +19,9 @@
19
19
  "types": "./dist/index.d.ts",
20
20
  "import": "./dist/index.mjs",
21
21
  "require": "./dist/index.cjs"
22
+ },
23
+ "./global": {
24
+ "types": "./global.d.ts"
22
25
  }
23
26
  },
24
27
  "sideEffects": false,
@@ -27,6 +30,7 @@
27
30
  "ofetch": "^1.4.0"
28
31
  },
29
32
  "files": [
30
- "dist"
33
+ "dist",
34
+ "global.d.ts"
31
35
  ]
32
36
  }