@tantainnovative/ndpr-toolkit 3.5.5 → 3.6.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.
- package/CHANGELOG.md +44 -0
- package/README.md +48 -2
- package/dist/adapters.d.mts +137 -3
- package/dist/adapters.d.ts +137 -3
- package/dist/adapters.js +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/chunk-LTPSN2SU.mjs +1 -0
- package/dist/chunk-PL4XNCQA.mjs +1 -0
- package/dist/chunk-ROTLSZMV.js +1 -0
- package/dist/chunk-RV2VMWZJ.mjs +1 -0
- package/dist/chunk-RXZFYBUJ.js +1 -0
- package/dist/chunk-SJRIOZ4K.mjs +1 -0
- package/dist/chunk-V3RYHNHN.js +1 -0
- package/dist/chunk-W7RBGZCC.js +1 -0
- package/dist/presets-consent.d.mts +139 -0
- package/dist/presets-consent.d.ts +139 -0
- package/dist/presets-consent.js +2 -0
- package/dist/presets-consent.mjs +2 -0
- package/dist/presets-dsr.d.mts +133 -0
- package/dist/presets-dsr.d.ts +133 -0
- package/dist/presets-dsr.js +2 -0
- package/dist/presets-dsr.mjs +2 -0
- package/dist/presets-policy.d.mts +203 -0
- package/dist/presets-policy.d.ts +203 -0
- package/dist/presets-policy.js +2 -0
- package/dist/presets-policy.mjs +2 -0
- package/dist/presets.d.mts +73 -0
- package/dist/presets.d.ts +73 -0
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/server.d.mts +137 -3
- package/dist/server.d.ts +137 -3
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/package.json +25 -1
- package/dist/chunk-6NXXQYQL.js +0 -1
- package/dist/chunk-NBZUZYTB.mjs +0 -1
package/dist/server.d.ts
CHANGED
|
@@ -3,10 +3,144 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare type AdequacyStatus = 'adequate' | 'inadequate' | 'pending_review' | 'unknown';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Production-ready API storage adapter.
|
|
8
|
+
*
|
|
9
|
+
* Backward-compatible with the 3.5.x signature — `apiAdapter('/api/x')`
|
|
10
|
+
* still works exactly as before. New options are all opt-in.
|
|
11
|
+
*
|
|
12
|
+
* @example basic
|
|
13
|
+
* const adapter = apiAdapter<ConsentSettings>('/api/consent');
|
|
14
|
+
*
|
|
15
|
+
* @example with credentials and CSRF
|
|
16
|
+
* const adapter = apiAdapter<ConsentSettings>('/api/consent', {
|
|
17
|
+
* credentials: 'include',
|
|
18
|
+
* headers: () => ({
|
|
19
|
+
* 'X-CSRF-Token': document.querySelector<HTMLMetaElement>(
|
|
20
|
+
* 'meta[name="csrf-token"]'
|
|
21
|
+
* )?.content ?? '',
|
|
22
|
+
* }),
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* @example with retry + telemetry
|
|
26
|
+
* const adapter = apiAdapter<ConsentSettings>('/api/consent', {
|
|
27
|
+
* retry: { attempts: 2, baseDelayMs: 300 },
|
|
28
|
+
* onError: (ctx) => Sentry.captureException(ctx.error, { extra: ctx }),
|
|
29
|
+
* onSuccess: (ctx) => analytics.track('consent_saved', { method: ctx.method }),
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* @example with response unwrap
|
|
33
|
+
* const adapter = apiAdapter<ConsentSettings>('/api/consent', {
|
|
34
|
+
* // API returns { data: ConsentSettings, ok: true }
|
|
35
|
+
* unwrap: (raw) => (raw as { data: ConsentSettings }).data,
|
|
36
|
+
* });
|
|
37
|
+
*/
|
|
38
|
+
export declare function apiAdapter<T = unknown>(endpoint: string, options?: ApiAdapterOptions<T>): StorageAdapter<T>;
|
|
39
|
+
|
|
40
|
+
declare interface ApiAdapterErrorContext<T = unknown> {
|
|
41
|
+
/** Which adapter operation triggered this — `load`, `save`, or `remove`. */
|
|
42
|
+
method: ApiAdapterMethod;
|
|
43
|
+
/** The endpoint URL that failed. */
|
|
44
|
+
endpoint: string;
|
|
45
|
+
/** Underlying error (for network failures / parse errors). */
|
|
46
|
+
error?: unknown;
|
|
47
|
+
/** Response object, if a response was received. */
|
|
48
|
+
response?: Response;
|
|
49
|
+
/** HTTP status code, if available. */
|
|
50
|
+
status?: number;
|
|
51
|
+
/** For `save`, the payload that failed to send. */
|
|
52
|
+
payload?: T;
|
|
53
|
+
/** Which retry attempt this is (0 = first try). Capped at `retry.attempts`. */
|
|
54
|
+
attempt: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare type ApiAdapterMethod = 'load' | 'save' | 'remove';
|
|
58
|
+
|
|
59
|
+
declare interface ApiAdapterOptions<T = unknown> {
|
|
60
|
+
/**
|
|
61
|
+
* Extra HTTP headers to send with every request. Useful for `Authorization`,
|
|
62
|
+
* `X-CSRF-Token`, `X-Requested-With`, etc.
|
|
63
|
+
*
|
|
64
|
+
* Can also be a function that returns headers, which lets you read a CSRF
|
|
65
|
+
* token from the DOM/cookie at request time rather than at adapter
|
|
66
|
+
* construction time.
|
|
67
|
+
*/
|
|
68
|
+
headers?: Record<string, string> | (() => Record<string, string>);
|
|
69
|
+
/**
|
|
70
|
+
* Forwarded to fetch's `credentials` option. Defaults to `'same-origin'`
|
|
71
|
+
* (the browser default). Set to `'include'` for cross-origin endpoints
|
|
72
|
+
* that need cookies / auth.
|
|
73
|
+
*/
|
|
74
|
+
credentials?: RequestCredentials;
|
|
75
|
+
/**
|
|
76
|
+
* HTTP method override for the load operation. Defaults to `'GET'`.
|
|
77
|
+
*/
|
|
78
|
+
loadMethod?: 'GET' | 'POST';
|
|
79
|
+
/**
|
|
80
|
+
* HTTP method override for the save operation. Defaults to `'POST'`. Some
|
|
81
|
+
* REST APIs prefer `'PUT'` for upsert semantics.
|
|
82
|
+
*/
|
|
83
|
+
saveMethod?: 'POST' | 'PUT' | 'PATCH';
|
|
84
|
+
/**
|
|
85
|
+
* Transform the raw JSON response into the expected `T`. Useful for APIs
|
|
86
|
+
* that wrap responses in `{ data: ... }` or similar envelopes. Called
|
|
87
|
+
* after `res.json()`. If omitted, the parsed JSON is used as-is.
|
|
88
|
+
*/
|
|
89
|
+
unwrap?: (raw: unknown) => T | null;
|
|
90
|
+
/**
|
|
91
|
+
* Retry policy for failed requests. Defaults to no retries (preserves the
|
|
92
|
+
* pre-3.6.0 behaviour). When configured, applies to all three operations.
|
|
93
|
+
*/
|
|
94
|
+
retry?: ApiAdapterRetryConfig;
|
|
95
|
+
/**
|
|
96
|
+
* Called when a request fails (after all retries exhausted). The adapter
|
|
97
|
+
* still returns a graceful null/void result so the consuming hook
|
|
98
|
+
* doesn't crash — this hook is for telemetry, toasts, or audit logging.
|
|
99
|
+
*/
|
|
100
|
+
onError?: (ctx: ApiAdapterErrorContext<T>) => void;
|
|
101
|
+
/**
|
|
102
|
+
* Called when a request succeeds. Useful for cache invalidation,
|
|
103
|
+
* analytics, or syncing other state.
|
|
104
|
+
*/
|
|
105
|
+
onSuccess?: (ctx: ApiAdapterSuccessContext<T>) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Per-request fetch options to merge into every request. Use this for
|
|
108
|
+
* things `fetch` itself supports that aren't directly modelled above —
|
|
109
|
+
* `signal`, `mode`, `cache`, `redirect`, etc.
|
|
110
|
+
*/
|
|
111
|
+
fetchInit?: Omit<RequestInit, 'method' | 'headers' | 'body' | 'credentials'>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare interface ApiAdapterRetryConfig {
|
|
115
|
+
/**
|
|
116
|
+
* Number of additional attempts after the initial request. Defaults to 0
|
|
117
|
+
* (no retries). e.g. `attempts: 2` means up to 3 total requests.
|
|
118
|
+
*/
|
|
119
|
+
attempts?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Base delay in ms between attempts. Defaults to 250ms. The actual delay
|
|
122
|
+
* uses exponential backoff: `baseDelayMs * 2^attempt`.
|
|
123
|
+
*/
|
|
124
|
+
baseDelayMs?: number;
|
|
125
|
+
/**
|
|
126
|
+
* Predicate that decides whether to retry given the failure context. By
|
|
127
|
+
* default we retry on network errors and 5xx responses, but not on 4xx
|
|
128
|
+
* (those are client errors that won't fix themselves).
|
|
129
|
+
*/
|
|
130
|
+
shouldRetry?: (ctx: ApiAdapterErrorContext<unknown>) => boolean;
|
|
131
|
+
}
|
|
7
132
|
|
|
8
|
-
declare interface
|
|
9
|
-
|
|
133
|
+
declare interface ApiAdapterSuccessContext<T = unknown> {
|
|
134
|
+
/** Which adapter operation succeeded — `load`, `save`, or `remove`. */
|
|
135
|
+
method: ApiAdapterMethod;
|
|
136
|
+
/** The endpoint URL. */
|
|
137
|
+
endpoint: string;
|
|
138
|
+
/** Response object. */
|
|
139
|
+
response: Response;
|
|
140
|
+
/** For `load` operations, the parsed (and optionally unwrapped) data. */
|
|
141
|
+
data?: T;
|
|
142
|
+
/** For `save` operations, the payload that was sent. */
|
|
143
|
+
payload?: T;
|
|
10
144
|
}
|
|
11
145
|
|
|
12
146
|
/**
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkROTLSZMV_js=require('./chunk-ROTLSZMV.js'),chunk4QXTB3L6_js=require('./chunk-4QXTB3L6.js'),chunk7IFSWCQP_js=require('./chunk-7IFSWCQP.js'),chunkN3MQQUQP_js=require('./chunk-N3MQQUQP.js'),chunkLVGT3DLT_js=require('./chunk-LVGT3DLT.js'),chunkQPRYXVH2_js=require('./chunk-QPRYXVH2.js'),chunkQ64735OC_js=require('./chunk-Q64735OC.js'),chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),chunk7ZZO7GVB_js=require('./chunk-7ZZO7GVB.js'),chunkB46SJB5V_js=require('./chunk-B46SJB5V.js'),chunkL2BRFMVS_js=require('./chunk-L2BRFMVS.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js');require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"apiAdapter",{enumerable:true,get:function(){return chunkROTLSZMV_js.a}});Object.defineProperty(exports,"composeAdapters",{enumerable:true,get:function(){return chunkROTLSZMV_js.c}});Object.defineProperty(exports,"memoryAdapter",{enumerable:true,get:function(){return chunkROTLSZMV_js.b}});Object.defineProperty(exports,"hausaLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.c}});Object.defineProperty(exports,"igboLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.b}});Object.defineProperty(exports,"pidginLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.d}});Object.defineProperty(exports,"yorubaLocale",{enumerable:true,get:function(){return chunk4QXTB3L6_js.a}});Object.defineProperty(exports,"defaultLocale",{enumerable:true,get:function(){return chunk7IFSWCQP_js.a}});Object.defineProperty(exports,"mergeLocale",{enumerable:true,get:function(){return chunk7IFSWCQP_js.b}});Object.defineProperty(exports,"exportDOCX",{enumerable:true,get:function(){return chunkN3MQQUQP_js.d}});Object.defineProperty(exports,"exportHTML",{enumerable:true,get:function(){return chunkN3MQQUQP_js.a}});Object.defineProperty(exports,"exportMarkdown",{enumerable:true,get:function(){return chunkN3MQQUQP_js.b}});Object.defineProperty(exports,"exportPDF",{enumerable:true,get:function(){return chunkN3MQQUQP_js.c}});Object.defineProperty(exports,"DEFAULT_POLICY_SECTIONS",{enumerable:true,get:function(){return chunkLVGT3DLT_js.c}});Object.defineProperty(exports,"DEFAULT_POLICY_VARIABLES",{enumerable:true,get:function(){return chunkLVGT3DLT_js.d}});Object.defineProperty(exports,"createBusinessPolicyTemplate",{enumerable:true,get:function(){return chunkLVGT3DLT_js.e}});Object.defineProperty(exports,"findUnfilledTokens",{enumerable:true,get:function(){return chunkLVGT3DLT_js.a}});Object.defineProperty(exports,"generatePolicyText",{enumerable:true,get:function(){return chunkLVGT3DLT_js.b}});Object.defineProperty(exports,"getComplianceScore",{enumerable:true,get:function(){return chunkQPRYXVH2_js.a}});Object.defineProperty(exports,"DEFAULT_DATA_CATEGORIES",{enumerable:true,get:function(){return chunkQ64735OC_js.d}});Object.defineProperty(exports,"UNFILLED_PREFIX",{enumerable:true,get:function(){return chunkQ64735OC_js.a}});Object.defineProperty(exports,"UNFILLED_SUFFIX",{enumerable:true,get:function(){return chunkQ64735OC_js.b}});Object.defineProperty(exports,"assemblePolicy",{enumerable:true,get:function(){return chunkQ64735OC_js.c}});Object.defineProperty(exports,"createDefaultContext",{enumerable:true,get:function(){return chunkQ64735OC_js.e}});Object.defineProperty(exports,"evaluatePolicyCompliance",{enumerable:true,get:function(){return chunkQ64735OC_js.f}});Object.defineProperty(exports,"assessComplianceGaps",{enumerable:true,get:function(){return chunkWZYCBW2R_js.c}});Object.defineProperty(exports,"generateLawfulBasisSummary",{enumerable:true,get:function(){return chunkWZYCBW2R_js.d}});Object.defineProperty(exports,"getLawfulBasisDescription",{enumerable:true,get:function(){return chunkWZYCBW2R_js.b}});Object.defineProperty(exports,"validateProcessingActivity",{enumerable:true,get:function(){return chunkWZYCBW2R_js.a}});Object.defineProperty(exports,"assessTransferRisk",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.h}});Object.defineProperty(exports,"getTransferMechanismDescription",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.f}});Object.defineProperty(exports,"isNDPCApprovalRequired",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.e}});Object.defineProperty(exports,"validateTransfer",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.g}});Object.defineProperty(exports,"exportROPAToCSV",{enumerable:true,get:function(){return chunk4CVBQC66_js.c}});Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});Object.defineProperty(exports,"validateProcessingRecord",{enumerable:true,get:function(){return chunk4CVBQC66_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk3IA3KDII_js.b}});Object.defineProperty(exports,"cookieAdapter",{enumerable:true,get:function(){return chunk7ZZO7GVB_js.b}});Object.defineProperty(exports,"sessionStorageAdapter",{enumerable:true,get:function(){return chunk7ZZO7GVB_js.a}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkB46SJB5V_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkB46SJB5V_js.b}});Object.defineProperty(exports,"formatDSRRequest",{enumerable:true,get:function(){return chunkL2BRFMVS_js.b}});Object.defineProperty(exports,"validateDsrSubmission",{enumerable:true,get:function(){return chunkL2BRFMVS_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkTQZWJGJ2_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunk3YTAOT5O_js.a}});Object.defineProperty(exports,"sanitizeInput",{enumerable:true,get:function(){return chunkUXUMYP4L_js.a}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_LONG",{enumerable:true,get:function(){return chunkZVOIR4QH_js.b}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_SHORT",{enumerable:true,get:function(){return chunkZVOIR4QH_js.a}});Object.defineProperty(exports,"legalDisclaimerBlock",{enumerable:true,get:function(){return chunkZVOIR4QH_js.c}});Object.defineProperty(exports,"localStorageAdapter",{enumerable:true,get:function(){return chunkVWED6UTN_js.a}});
|
package/dist/server.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as apiAdapter,c as composeAdapters,b as memoryAdapter}from'./chunk-
|
|
1
|
+
export{a as apiAdapter,c as composeAdapters,b as memoryAdapter}from'./chunk-PL4XNCQA.mjs';export{c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-LQTARVPU.mjs';export{a as defaultLocale,b as mergeLocale}from'./chunk-HWHBINVN.mjs';export{d as exportDOCX,a as exportHTML,b as exportMarkdown,c as exportPDF}from'./chunk-AOHKVFAS.mjs';export{c as DEFAULT_POLICY_SECTIONS,d as DEFAULT_POLICY_VARIABLES,e as createBusinessPolicyTemplate,a as findUnfilledTokens,b as generatePolicyText}from'./chunk-Y3MKMAFQ.mjs';export{a as getComplianceScore}from'./chunk-EFIBHKQE.mjs';export{d as DEFAULT_DATA_CATEGORIES,a as UNFILLED_PREFIX,b as UNFILLED_SUFFIX,c as assemblePolicy,e as createDefaultContext,f as evaluatePolicyCompliance}from'./chunk-RMQ7OLNY.mjs';export{c as assessComplianceGaps,d as generateLawfulBasisSummary,b as getLawfulBasisDescription,a as validateProcessingActivity}from'./chunk-LWIKDDSU.mjs';export{h as assessTransferRisk,f as getTransferMechanismDescription,e as isNDPCApprovalRequired,g as validateTransfer}from'./chunk-7BJXI2HI.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';export{b as cookieAdapter,a as sessionStorageAdapter}from'./chunk-UASG46LP.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-PJNKQPQP.mjs';export{b as formatDSRRequest,a as validateDsrSubmission}from'./chunk-RZ6GC6WN.mjs';export{a as assessDPIARisk}from'./chunk-LRRENTT5.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';export{a as sanitizeInput}from'./chunk-EWVK45Z3.mjs';export{b as LEGAL_DISCLAIMER_LONG,a as LEGAL_DISCLAIMER_SHORT,c as legalDisclaimerBlock}from'./chunk-ITCY2Z66.mjs';export{a as localStorageAdapter}from'./chunk-DBZSN4WP.mjs';import'./chunk-ZJYULEER.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tantainnovative/ndpr-toolkit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Nigeria Data Protection Toolkit — enterprise-grade compliance components for the Nigeria Data Protection Act (NDPA) 2023",
|
|
6
6
|
"pnpm": {
|
|
@@ -162,6 +162,21 @@
|
|
|
162
162
|
"import": "./dist/presets.mjs",
|
|
163
163
|
"require": "./dist/presets.js"
|
|
164
164
|
},
|
|
165
|
+
"./presets/consent": {
|
|
166
|
+
"types": "./dist/presets-consent.d.ts",
|
|
167
|
+
"import": "./dist/presets-consent.mjs",
|
|
168
|
+
"require": "./dist/presets-consent.js"
|
|
169
|
+
},
|
|
170
|
+
"./presets/dsr": {
|
|
171
|
+
"types": "./dist/presets-dsr.d.ts",
|
|
172
|
+
"import": "./dist/presets-dsr.mjs",
|
|
173
|
+
"require": "./dist/presets-dsr.js"
|
|
174
|
+
},
|
|
175
|
+
"./presets/policy": {
|
|
176
|
+
"types": "./dist/presets-policy.d.ts",
|
|
177
|
+
"import": "./dist/presets-policy.mjs",
|
|
178
|
+
"require": "./dist/presets-policy.js"
|
|
179
|
+
},
|
|
165
180
|
"./unstyled": {
|
|
166
181
|
"types": "./dist/unstyled.d.ts",
|
|
167
182
|
"import": "./dist/unstyled.mjs",
|
|
@@ -217,6 +232,15 @@
|
|
|
217
232
|
"presets": [
|
|
218
233
|
"./dist/presets.d.ts"
|
|
219
234
|
],
|
|
235
|
+
"presets/consent": [
|
|
236
|
+
"./dist/presets-consent.d.ts"
|
|
237
|
+
],
|
|
238
|
+
"presets/dsr": [
|
|
239
|
+
"./dist/presets-dsr.d.ts"
|
|
240
|
+
],
|
|
241
|
+
"presets/policy": [
|
|
242
|
+
"./dist/presets-policy.d.ts"
|
|
243
|
+
],
|
|
220
244
|
"unstyled": [
|
|
221
245
|
"./dist/unstyled.d.ts"
|
|
222
246
|
]
|
package/dist/chunk-6NXXQYQL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js');function l(e,t={}){var a;let o=(a=t.headers)!=null?a:{};return {load(){return chunkRFPLZDIO_js.d(this,null,function*(){try{let r=yield fetch(e,{method:"GET",headers:chunkRFPLZDIO_js.a({},o)});return r.ok?yield r.json():null}catch(r){return null}})},save(r){return chunkRFPLZDIO_js.d(this,null,function*(){try{let n=yield fetch(e,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},o),body:JSON.stringify(r)});n.ok||console.warn(`[ndpr-toolkit] Failed to save to ${e}: ${n.status}`);}catch(n){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return chunkRFPLZDIO_js.d(this,null,function*(){try{let r=yield fetch(e,{method:"DELETE",headers:chunkRFPLZDIO_js.a({},o)});r.ok||console.warn(`[ndpr-toolkit] Failed to delete from ${e}: ${r.status}`);}catch(r){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function u(e){let t=e!=null?e:null;return {load(){return t},save(o){t=o;},remove(){t=null;}}}function f(e,...t){return {load(){return e.load()},save(o){let a=e.save(o),s=()=>{for(let r of t)try{r.save(o);}catch(n){console.warn("[ndpr-toolkit] Secondary adapter save failed:",n);}};if(a instanceof Promise)return a.then(()=>s());s();},remove(){let o=e.remove(),a=()=>{for(let s of t)try{s.remove();}catch(r){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",r);}};if(o instanceof Promise)return o.then(()=>a());a();}}}exports.a=l;exports.b=u;exports.c=f;
|
package/dist/chunk-NBZUZYTB.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {d,a}from'./chunk-ZJYULEER.mjs';function l(e,t={}){var a$1;let o=(a$1=t.headers)!=null?a$1:{};return {load(){return d(this,null,function*(){try{let r=yield fetch(e,{method:"GET",headers:a({},o)});return r.ok?yield r.json():null}catch(r){return null}})},save(r){return d(this,null,function*(){try{let n=yield fetch(e,{method:"POST",headers:a({"Content-Type":"application/json"},o),body:JSON.stringify(r)});n.ok||console.warn(`[ndpr-toolkit] Failed to save to ${e}: ${n.status}`);}catch(n){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return d(this,null,function*(){try{let r=yield fetch(e,{method:"DELETE",headers:a({},o)});r.ok||console.warn(`[ndpr-toolkit] Failed to delete from ${e}: ${r.status}`);}catch(r){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function u(e){let t=e!=null?e:null;return {load(){return t},save(o){t=o;},remove(){t=null;}}}function f(e,...t){return {load(){return e.load()},save(o){let a=e.save(o),s=()=>{for(let r of t)try{r.save(o);}catch(n){console.warn("[ndpr-toolkit] Secondary adapter save failed:",n);}};if(a instanceof Promise)return a.then(()=>s());s();},remove(){let o=e.remove(),a=()=>{for(let s of t)try{s.remove();}catch(r){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",r);}};if(o instanceof Promise)return o.then(()=>a());a();}}}export{l as a,u as b,f as c};
|