@tnf-dev/core 1.0.1-8 → 1.0.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.
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var T=s=>{throw TypeError(s)};var P=(s,t)=>{for(var e in t)R(s,e,{get:t[e],enumerable:!0})},f=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $(t))!q.call(s,r)&&r!==e&&R(s,r,{get:()=>t[r],enumerable:!(n=l(t,r))||n.enumerable});return s};var w=s=>f(R({},"__esModule",{value:!0}),s);var c=(s,t,e)=>t.has(s)||T("Cannot "+e);var a=(s,t,e)=>(c(s,t,"read from private field"),e?e.call(s):t.get(s)),g=(s,t,e)=>t.has(s)?T("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),m=(s,t,e,n)=>(c(s,t,"write to private field"),n?n.call(s,e):t.set(s,e),e),p=(s,t,e)=>(c(s,t,"access private method"),e);var U={};P(U,{HttpClient:()=>h});module.exports=w(U);var y=s=>new URLSearchParams(Object.keys(s).reduce((t,e)=>(s[e]!==void 0&&(t[e]=`${s[e]}`),t),{})).toString();var i,o,O,d,h=class{constructor(t){g(this,o);g(this,i);m(this,i,t.baseUrl)}get baseUrl(){return a(this,i)}get(t,e){return p(this,o,d).call(this,`${a(this,i)}${t}`,e)}post(t,e,n){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...n,method:"POST",body:e})}put(t,e,n){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...n,method:"PUT",body:e})}patch(t,e,n={}){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...n,method:"PATCH",body:e})}delete(t,e){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...e,method:"DELETE"})}};i=new WeakMap,o=new WeakSet,O=async function(t,{body:e,params:n,...r}={}){let u=t;n&&(u=`${t}?${y(n||{})}`);let b={...r,...e?{body:JSON.stringify(e)}:{},headers:{"Content-Type":"application/json",...r.headers}};return[u,b]},d=async function(t,e){let[n,r]=await p(this,o,O).call(this,t,e),u=await fetch(n,r);if(!u.ok)throw await u.json();return await u.json()};0&&(module.exports={HttpClient});
1
+ "use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var T=t=>{throw TypeError(t)};var $=(t,e)=>{for(var s in e)R(t,s,{get:e[s],enumerable:!0})},q=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of x(e))!B.call(t,r)&&r!==s&&R(t,r,{get:()=>e[r],enumerable:!(n=l(e,r))||n.enumerable});return t};var w=t=>q(R({},"__esModule",{value:!0}),t);var c=(t,e,s)=>e.has(t)||T("Cannot "+s);var p=(t,e,s)=>(c(t,e,"read from private field"),s?s.call(t):e.get(t)),g=(t,e,s)=>e.has(t)?T("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),m=(t,e,s,n)=>(c(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),d=(t,e,s)=>(c(t,e,"access private method"),s);var f={};$(f,{HttpClient:()=>h});module.exports=w(f);var y=t=>new URLSearchParams(Object.keys(t).reduce((e,s)=>(t[s]!==void 0&&(e[s]=`${t[s]}`),e),{})).toString();var o,i,O,u,h=class{constructor(e){g(this,i);g(this,o);m(this,o,e.baseUrl)}get baseUrl(){return p(this,o)}get(e,s){return d(this,i,u).call(this,`${p(this,o)}${e}`,s)}post(e,s,n){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"POST",body:s})}put(e,s,n){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"PUT",body:s})}patch(e,s,n={}){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"PATCH",body:s})}delete(e,s){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...s,method:"DELETE"})}};o=new WeakMap,i=new WeakSet,O=async function(e,{body:s,params:n,...r}={}){let a=e;n&&(a=`${e}?${y(n||{})}`);let b={...r,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...r.headers}};return[a,b]},u=async function(e,s){let[n,r]=await d(this,i,O).call(this,e,s),a=await fetch(n,r);if(!a.ok)throw{status:"error",error_message:await a.text()};if(a.headers.get("Content-Type")!=="application/json")throw{status:"error",error_message:await a.text()};return{...await a.json(),status:"success"}};0&&(module.exports={HttpClient});
@@ -11,11 +11,11 @@ declare class HttpClient {
11
11
  #private;
12
12
  constructor(options: HttpClientOptions);
13
13
  get baseUrl(): string;
14
- get<T = BaseResponse>(url: string, options?: Omit<RequestOptions, 'body'>): Promise<T>;
15
- post<T = BaseResponse>(url: string, data?: Record<string, any>, options?: Omit<RequestOptions, 'body'>): Promise<T>;
16
- put<T = BaseResponse>(url: string, data?: Record<string, any>, options?: Omit<RequestOptions, 'body'>): Promise<T>;
17
- patch<T = BaseResponse>(url: string, data?: Record<string, any>, options?: RequestInit): Promise<T>;
18
- delete<T = BaseResponse>(url: string, options?: Omit<RequestOptions, 'body'>): Promise<T>;
14
+ get<T extends BaseResponse = BaseResponse>(url: string, options?: Omit<RequestOptions, 'body'>): Promise<T>;
15
+ post<T extends BaseResponse = BaseResponse>(url: string, data?: Record<string, any>, options?: Omit<RequestOptions, 'body'>): Promise<T>;
16
+ put<T extends BaseResponse = BaseResponse>(url: string, data?: Record<string, any>, options?: Omit<RequestOptions, 'body'>): Promise<T>;
17
+ patch<T extends BaseResponse = BaseResponse>(url: string, data?: Record<string, any>, options?: RequestInit): Promise<T>;
18
+ delete<T extends BaseResponse = BaseResponse>(url: string, options?: Omit<RequestOptions, 'body'>): Promise<T>;
19
19
  }
20
20
 
21
21
  export { HttpClient, type HttpClientOptions, type RequestOptions };
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var T=s=>{throw TypeError(s)};var f=(s,t)=>{for(var e in t)R(s,e,{get:t[e],enumerable:!0})},P=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $(t))!q.call(s,r)&&r!==e&&R(s,r,{get:()=>t[r],enumerable:!(n=l(t,r))||n.enumerable});return s};var w=s=>P(R({},"__esModule",{value:!0}),s);var c=(s,t,e)=>t.has(s)||T("Cannot "+e);var a=(s,t,e)=>(c(s,t,"read from private field"),e?e.call(s):t.get(s)),g=(s,t,e)=>t.has(s)?T("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),m=(s,t,e,n)=>(c(s,t,"write to private field"),n?n.call(s,e):t.set(s,e),e),p=(s,t,e)=>(c(s,t,"access private method"),e);var U={};f(U,{HttpClient:()=>h});module.exports=w(U);var y=s=>new URLSearchParams(Object.keys(s).reduce((t,e)=>(s[e]!==void 0&&(t[e]=`${s[e]}`),t),{})).toString();var i,o,O,d,h=class{constructor(t){g(this,o);g(this,i);m(this,i,t.baseUrl)}get baseUrl(){return a(this,i)}get(t,e){return p(this,o,d).call(this,`${a(this,i)}${t}`,e)}post(t,e,n){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...n,method:"POST",body:e})}put(t,e,n){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...n,method:"PUT",body:e})}patch(t,e,n={}){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...n,method:"PATCH",body:e})}delete(t,e){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...e,method:"DELETE"})}};i=new WeakMap,o=new WeakSet,O=async function(t,{body:e,params:n,...r}={}){let u=t;n&&(u=`${t}?${y(n||{})}`);let b={...r,...e?{body:JSON.stringify(e)}:{},headers:{"Content-Type":"application/json",...r.headers}};return[u,b]},d=async function(t,e){let[n,r]=await p(this,o,O).call(this,t,e),u=await fetch(n,r);if(!u.ok)throw await u.json();return await u.json()};0&&(module.exports={HttpClient});
1
+ "use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var T=t=>{throw TypeError(t)};var $=(t,e)=>{for(var s in e)R(t,s,{get:e[s],enumerable:!0})},f=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of x(e))!B.call(t,r)&&r!==s&&R(t,r,{get:()=>e[r],enumerable:!(n=l(e,r))||n.enumerable});return t};var q=t=>f(R({},"__esModule",{value:!0}),t);var c=(t,e,s)=>e.has(t)||T("Cannot "+s);var p=(t,e,s)=>(c(t,e,"read from private field"),s?s.call(t):e.get(t)),g=(t,e,s)=>e.has(t)?T("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),m=(t,e,s,n)=>(c(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),d=(t,e,s)=>(c(t,e,"access private method"),s);var w={};$(w,{HttpClient:()=>h});module.exports=q(w);var y=t=>new URLSearchParams(Object.keys(t).reduce((e,s)=>(t[s]!==void 0&&(e[s]=`${t[s]}`),e),{})).toString();var o,i,O,u,h=class{constructor(e){g(this,i);g(this,o);m(this,o,e.baseUrl)}get baseUrl(){return p(this,o)}get(e,s){return d(this,i,u).call(this,`${p(this,o)}${e}`,s)}post(e,s,n){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"POST",body:s})}put(e,s,n){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"PUT",body:s})}patch(e,s,n={}){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"PATCH",body:s})}delete(e,s){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...s,method:"DELETE"})}};o=new WeakMap,i=new WeakSet,O=async function(e,{body:s,params:n,...r}={}){let a=e;n&&(a=`${e}?${y(n||{})}`);let b={...r,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...r.headers}};return[a,b]},u=async function(e,s){let[n,r]=await d(this,i,O).call(this,e,s),a=await fetch(n,r);if(!a.ok)throw{status:"error",error_message:await a.text()};if(a.headers.get("Content-Type")!=="application/json")throw{status:"error",error_message:await a.text()};return{...await a.json(),status:"success"}};0&&(module.exports={HttpClient});
@@ -1,4 +1,4 @@
1
- export { Notification, NotificationAction, NotificationData, NotificationPayload, NotificationPrimaryAction, NotificationSecondaryAction } from './notifications/notification.interface.cjs';
1
+ export { Notification, NotificationAction, NotificationData, NotificationPayload } from './notifications/notification.interface.cjs';
2
2
  export { PaginationRequest } from './request/request.interface.cjs';
3
3
  export { BaseResponse, ErrorResponse, PaginatedResponse, SingleResponse } from './response/response.interface.cjs';
4
4
  import './base/record.interface.cjs';
@@ -1,2 +1,2 @@
1
- export { Notification, NotificationAction, NotificationData, NotificationPayload, NotificationPrimaryAction, NotificationSecondaryAction } from './notification.interface.cjs';
1
+ export { Notification, NotificationAction, NotificationData, NotificationPayload } from './notification.interface.cjs';
2
2
  import '../base/record.interface.cjs';
@@ -1 +1 @@
1
- "use strict";var e=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(i,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of c(t))!s.call(i,o)&&o!==n&&e(i,o,{get:()=>t[o],enumerable:!(a=r(t,o))||a.enumerable});return i};var d=i=>f(e({},"__esModule",{value:!0}),i);var y={};module.exports=d(y);
1
+ "use strict";var e=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(i,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of c(t))!s.call(i,o)&&o!==n&&e(i,o,{get:()=>t[o],enumerable:!(a=r(t,o))||a.enumerable});return i};var d=i=>f(e({},"__esModule",{value:!0}),i);var g={};module.exports=d(g);
@@ -1,17 +1,12 @@
1
1
  import { BaseRecord } from '../base/record.interface.cjs';
2
2
 
3
3
  interface NotificationAction {
4
- type: 'primary' | 'secondary';
5
4
  label: string;
6
5
  href: string;
7
6
  target?: '_blank' | '_self';
8
7
  rel?: string;
9
- }
10
- interface NotificationPrimaryAction extends NotificationAction {
11
- type: 'primary';
12
- }
13
- interface NotificationSecondaryAction extends NotificationAction {
14
- type: 'secondary';
8
+ background_color?: string;
9
+ foreground_color?: string;
15
10
  }
16
11
  interface NotificationPayload extends Record<string, any> {
17
12
  }
@@ -22,10 +17,9 @@ interface Notification extends BaseRecord {
22
17
  message: string;
23
18
  isRead: boolean;
24
19
  icon?: string;
25
- primary_action?: NotificationPrimaryAction;
26
- secondary_action?: NotificationSecondaryAction;
20
+ actionButtons?: Array<NotificationAction>;
27
21
  payload?: NotificationPayload;
28
22
  data?: NotificationData;
29
23
  }
30
24
 
31
- export type { Notification, NotificationAction, NotificationData, NotificationPayload, NotificationPrimaryAction, NotificationSecondaryAction };
25
+ export type { Notification, NotificationAction, NotificationData, NotificationPayload };
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var T=s=>{throw TypeError(s)};var q=(s,t)=>{for(var e in t)R(s,e,{get:t[e],enumerable:!0})},P=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $(t))!f.call(s,n)&&n!==e&&R(s,n,{get:()=>t[n],enumerable:!(r=l(t,n))||r.enumerable});return s};var w=s=>P(R({},"__esModule",{value:!0}),s);var c=(s,t,e)=>t.has(s)||T("Cannot "+e);var a=(s,t,e)=>(c(s,t,"read from private field"),e?e.call(s):t.get(s)),g=(s,t,e)=>t.has(s)?T("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),m=(s,t,e,r)=>(c(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),p=(s,t,e)=>(c(s,t,"access private method"),e);var U={};q(U,{HttpClient:()=>h});module.exports=w(U);var y=s=>new URLSearchParams(Object.keys(s).reduce((t,e)=>(s[e]!==void 0&&(t[e]=`${s[e]}`),t),{})).toString();var i,o,O,d,h=class{constructor(t){g(this,o);g(this,i);m(this,i,t.baseUrl)}get baseUrl(){return a(this,i)}get(t,e){return p(this,o,d).call(this,`${a(this,i)}${t}`,e)}post(t,e,r){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...r,method:"POST",body:e})}put(t,e,r){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...r,method:"PUT",body:e})}patch(t,e,r={}){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...r,method:"PATCH",body:e})}delete(t,e){return p(this,o,d).call(this,`${a(this,i)}${t}`,{...e,method:"DELETE"})}};i=new WeakMap,o=new WeakSet,O=async function(t,{body:e,params:r,...n}={}){let u=t;r&&(u=`${t}?${y(r||{})}`);let b={...n,...e?{body:JSON.stringify(e)}:{},headers:{"Content-Type":"application/json",...n.headers}};return[u,b]},d=async function(t,e){let[r,n]=await p(this,o,O).call(this,t,e),u=await fetch(r,n);if(!u.ok)throw await u.json();return await u.json()};0&&(module.exports={HttpClient});
1
+ "use strict";var R=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var T=t=>{throw TypeError(t)};var B=(t,e)=>{for(var s in e)R(t,s,{get:e[s],enumerable:!0})},$=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!f.call(t,r)&&r!==s&&R(t,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return t};var q=t=>$(R({},"__esModule",{value:!0}),t);var c=(t,e,s)=>e.has(t)||T("Cannot "+s);var p=(t,e,s)=>(c(t,e,"read from private field"),s?s.call(t):e.get(t)),g=(t,e,s)=>e.has(t)?T("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),m=(t,e,s,n)=>(c(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),d=(t,e,s)=>(c(t,e,"access private method"),s);var w={};B(w,{HttpClient:()=>h});module.exports=q(w);var y=t=>new URLSearchParams(Object.keys(t).reduce((e,s)=>(t[s]!==void 0&&(e[s]=`${t[s]}`),e),{})).toString();var o,i,O,u,h=class{constructor(e){g(this,i);g(this,o);m(this,o,e.baseUrl)}get baseUrl(){return p(this,o)}get(e,s){return d(this,i,u).call(this,`${p(this,o)}${e}`,s)}post(e,s,n){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"POST",body:s})}put(e,s,n){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"PUT",body:s})}patch(e,s,n={}){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...n,method:"PATCH",body:s})}delete(e,s){return d(this,i,u).call(this,`${p(this,o)}${e}`,{...s,method:"DELETE"})}};o=new WeakMap,i=new WeakSet,O=async function(e,{body:s,params:n,...r}={}){let a=e;n&&(a=`${e}?${y(n||{})}`);let b={...r,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...r.headers}};return[a,b]},u=async function(e,s){let[n,r]=await d(this,i,O).call(this,e,s),a=await fetch(n,r);if(!a.ok)throw{status:"error",error_message:await a.text()};if(a.headers.get("Content-Type")!=="application/json")throw{status:"error",error_message:await a.text()};return{...await a.json(),status:"success"}};0&&(module.exports={HttpClient});
@@ -1,5 +1,5 @@
1
1
  export { HttpClient, HttpClientOptions, RequestOptions } from './client/http.cjs';
2
- export { Notification, NotificationAction, NotificationData, NotificationPayload, NotificationPrimaryAction, NotificationSecondaryAction } from './dto/notifications/notification.interface.cjs';
2
+ export { Notification, NotificationAction, NotificationData, NotificationPayload } from './dto/notifications/notification.interface.cjs';
3
3
  export { PaginationRequest } from './dto/request/request.interface.cjs';
4
4
  export { BaseResponse, ErrorResponse, PaginatedResponse, SingleResponse } from './dto/response/response.interface.cjs';
5
5
  import './dto/base/record.interface.cjs';
@@ -11,11 +11,11 @@ declare class HttpClient {
11
11
  #private;
12
12
  constructor(options: HttpClientOptions);
13
13
  get baseUrl(): string;
14
- get<T = BaseResponse>(url: string, options?: Omit<RequestOptions, 'body'>): Promise<T>;
15
- post<T = BaseResponse>(url: string, data?: Record<string, any>, options?: Omit<RequestOptions, 'body'>): Promise<T>;
16
- put<T = BaseResponse>(url: string, data?: Record<string, any>, options?: Omit<RequestOptions, 'body'>): Promise<T>;
17
- patch<T = BaseResponse>(url: string, data?: Record<string, any>, options?: RequestInit): Promise<T>;
18
- delete<T = BaseResponse>(url: string, options?: Omit<RequestOptions, 'body'>): Promise<T>;
14
+ get<T extends BaseResponse = BaseResponse>(url: string, options?: Omit<RequestOptions, 'body'>): Promise<T>;
15
+ post<T extends BaseResponse = BaseResponse>(url: string, data?: Record<string, any>, options?: Omit<RequestOptions, 'body'>): Promise<T>;
16
+ put<T extends BaseResponse = BaseResponse>(url: string, data?: Record<string, any>, options?: Omit<RequestOptions, 'body'>): Promise<T>;
17
+ patch<T extends BaseResponse = BaseResponse>(url: string, data?: Record<string, any>, options?: RequestInit): Promise<T>;
18
+ delete<T extends BaseResponse = BaseResponse>(url: string, options?: Omit<RequestOptions, 'body'>): Promise<T>;
19
19
  }
20
20
 
21
21
  export { HttpClient, type HttpClientOptions, type RequestOptions };
@@ -1 +1 @@
1
- var o=r=>new URLSearchParams(Object.keys(r).reduce((t,e)=>(r[e]!==void 0&&(t[e]=`${r[e]}`),t),{})).toString();var a=class{#t;constructor(t){this.#t=t.baseUrl}get baseUrl(){return this.#t}async#s(t,{body:e,params:s,...i}={}){let n=t;s&&(n=`${t}?${o(s||{})}`);let p={...i,...e?{body:JSON.stringify(e)}:{},headers:{"Content-Type":"application/json",...i.headers}};return[n,p]}async#e(t,e){let[s,i]=await this.#s(t,e),n=await fetch(s,i);if(!n.ok)throw await n.json();return await n.json()}get(t,e){return this.#e(`${this.#t}${t}`,e)}post(t,e,s){return this.#e(`${this.#t}${t}`,{...s,method:"POST",body:e})}put(t,e,s){return this.#e(`${this.#t}${t}`,{...s,method:"PUT",body:e})}patch(t,e,s={}){return this.#e(`${this.#t}${t}`,{...s,method:"PATCH",body:e})}delete(t,e){return this.#e(`${this.#t}${t}`,{...e,method:"DELETE"})}};export{a as HttpClient};
1
+ var i=r=>new URLSearchParams(Object.keys(r).reduce((e,s)=>(r[s]!==void 0&&(e[s]=`${r[s]}`),e),{})).toString();var a=class{#e;constructor(e){this.#e=e.baseUrl}get baseUrl(){return this.#e}async#t(e,{body:s,params:t,...o}={}){let n=e;t&&(n=`${e}?${i(t||{})}`);let p={...o,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...o.headers}};return[n,p]}async#s(e,s){let[t,o]=await this.#t(e,s),n=await fetch(t,o);if(!n.ok)throw{status:"error",error_message:await n.text()};if(n.headers.get("Content-Type")!=="application/json")throw{status:"error",error_message:await n.text()};return{...await n.json(),status:"success"}}get(e,s){return this.#s(`${this.#e}${e}`,s)}post(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"POST",body:s})}put(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"PUT",body:s})}patch(e,s,t={}){return this.#s(`${this.#e}${e}`,{...t,method:"PATCH",body:s})}delete(e,s){return this.#s(`${this.#e}${e}`,{...s,method:"DELETE"})}};export{a as HttpClient};
@@ -1 +1 @@
1
- var o=r=>new URLSearchParams(Object.keys(r).reduce((t,e)=>(r[e]!==void 0&&(t[e]=`${r[e]}`),t),{})).toString();var a=class{#t;constructor(t){this.#t=t.baseUrl}get baseUrl(){return this.#t}async#s(t,{body:e,params:s,...i}={}){let n=t;s&&(n=`${t}?${o(s||{})}`);let p={...i,...e?{body:JSON.stringify(e)}:{},headers:{"Content-Type":"application/json",...i.headers}};return[n,p]}async#e(t,e){let[s,i]=await this.#s(t,e),n=await fetch(s,i);if(!n.ok)throw await n.json();return await n.json()}get(t,e){return this.#e(`${this.#t}${t}`,e)}post(t,e,s){return this.#e(`${this.#t}${t}`,{...s,method:"POST",body:e})}put(t,e,s){return this.#e(`${this.#t}${t}`,{...s,method:"PUT",body:e})}patch(t,e,s={}){return this.#e(`${this.#t}${t}`,{...s,method:"PATCH",body:e})}delete(t,e){return this.#e(`${this.#t}${t}`,{...e,method:"DELETE"})}};export{a as HttpClient};
1
+ var i=r=>new URLSearchParams(Object.keys(r).reduce((e,s)=>(r[s]!==void 0&&(e[s]=`${r[s]}`),e),{})).toString();var a=class{#e;constructor(e){this.#e=e.baseUrl}get baseUrl(){return this.#e}async#t(e,{body:s,params:t,...o}={}){let n=e;t&&(n=`${e}?${i(t||{})}`);let p={...o,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...o.headers}};return[n,p]}async#s(e,s){let[t,o]=await this.#t(e,s),n=await fetch(t,o);if(!n.ok)throw{status:"error",error_message:await n.text()};if(n.headers.get("Content-Type")!=="application/json")throw{status:"error",error_message:await n.text()};return{...await n.json(),status:"success"}}get(e,s){return this.#s(`${this.#e}${e}`,s)}post(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"POST",body:s})}put(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"PUT",body:s})}patch(e,s,t={}){return this.#s(`${this.#e}${e}`,{...t,method:"PATCH",body:s})}delete(e,s){return this.#s(`${this.#e}${e}`,{...s,method:"DELETE"})}};export{a as HttpClient};
@@ -1,4 +1,4 @@
1
- export { Notification, NotificationAction, NotificationData, NotificationPayload, NotificationPrimaryAction, NotificationSecondaryAction } from './notifications/notification.interface.js';
1
+ export { Notification, NotificationAction, NotificationData, NotificationPayload } from './notifications/notification.interface.js';
2
2
  export { PaginationRequest } from './request/request.interface.js';
3
3
  export { BaseResponse, ErrorResponse, PaginatedResponse, SingleResponse } from './response/response.interface.js';
4
4
  import './base/record.interface.js';
@@ -1,2 +1,2 @@
1
- export { Notification, NotificationAction, NotificationData, NotificationPayload, NotificationPrimaryAction, NotificationSecondaryAction } from './notification.interface.js';
1
+ export { Notification, NotificationAction, NotificationData, NotificationPayload } from './notification.interface.js';
2
2
  import '../base/record.interface.js';
@@ -1,17 +1,12 @@
1
1
  import { BaseRecord } from '../base/record.interface.js';
2
2
 
3
3
  interface NotificationAction {
4
- type: 'primary' | 'secondary';
5
4
  label: string;
6
5
  href: string;
7
6
  target?: '_blank' | '_self';
8
7
  rel?: string;
9
- }
10
- interface NotificationPrimaryAction extends NotificationAction {
11
- type: 'primary';
12
- }
13
- interface NotificationSecondaryAction extends NotificationAction {
14
- type: 'secondary';
8
+ background_color?: string;
9
+ foreground_color?: string;
15
10
  }
16
11
  interface NotificationPayload extends Record<string, any> {
17
12
  }
@@ -22,10 +17,9 @@ interface Notification extends BaseRecord {
22
17
  message: string;
23
18
  isRead: boolean;
24
19
  icon?: string;
25
- primary_action?: NotificationPrimaryAction;
26
- secondary_action?: NotificationSecondaryAction;
20
+ actionButtons?: Array<NotificationAction>;
27
21
  payload?: NotificationPayload;
28
22
  data?: NotificationData;
29
23
  }
30
24
 
31
- export type { Notification, NotificationAction, NotificationData, NotificationPayload, NotificationPrimaryAction, NotificationSecondaryAction };
25
+ export type { Notification, NotificationAction, NotificationData, NotificationPayload };
@@ -1,5 +1,5 @@
1
1
  export { HttpClient, HttpClientOptions, RequestOptions } from './client/http.js';
2
- export { Notification, NotificationAction, NotificationData, NotificationPayload, NotificationPrimaryAction, NotificationSecondaryAction } from './dto/notifications/notification.interface.js';
2
+ export { Notification, NotificationAction, NotificationData, NotificationPayload } from './dto/notifications/notification.interface.js';
3
3
  export { PaginationRequest } from './dto/request/request.interface.js';
4
4
  export { BaseResponse, ErrorResponse, PaginatedResponse, SingleResponse } from './dto/response/response.interface.js';
5
5
  import './dto/base/record.interface.js';
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- var o=n=>new URLSearchParams(Object.keys(n).reduce((t,e)=>(n[e]!==void 0&&(t[e]=`${n[e]}`),t),{})).toString();var a=class{#t;constructor(t){this.#t=t.baseUrl}get baseUrl(){return this.#t}async#s(t,{body:e,params:s,...i}={}){let r=t;s&&(r=`${t}?${o(s||{})}`);let p={...i,...e?{body:JSON.stringify(e)}:{},headers:{"Content-Type":"application/json",...i.headers}};return[r,p]}async#e(t,e){let[s,i]=await this.#s(t,e),r=await fetch(s,i);if(!r.ok)throw await r.json();return await r.json()}get(t,e){return this.#e(`${this.#t}${t}`,e)}post(t,e,s){return this.#e(`${this.#t}${t}`,{...s,method:"POST",body:e})}put(t,e,s){return this.#e(`${this.#t}${t}`,{...s,method:"PUT",body:e})}patch(t,e,s={}){return this.#e(`${this.#t}${t}`,{...s,method:"PATCH",body:e})}delete(t,e){return this.#e(`${this.#t}${t}`,{...e,method:"DELETE"})}};export{a as HttpClient};
1
+ var i=r=>new URLSearchParams(Object.keys(r).reduce((e,s)=>(r[s]!==void 0&&(e[s]=`${r[s]}`),e),{})).toString();var a=class{#e;constructor(e){this.#e=e.baseUrl}get baseUrl(){return this.#e}async#t(e,{body:s,params:t,...o}={}){let n=e;t&&(n=`${e}?${i(t||{})}`);let p={...o,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...o.headers}};return[n,p]}async#s(e,s){let[t,o]=await this.#t(e,s),n=await fetch(t,o);if(!n.ok)throw{status:"error",error_message:await n.text()};if(n.headers.get("Content-Type")!=="application/json")throw{status:"error",error_message:await n.text()};return{...await n.json(),status:"success"}}get(e,s){return this.#s(`${this.#e}${e}`,s)}post(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"POST",body:s})}put(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"PUT",body:s})}patch(e,s,t={}){return this.#s(`${this.#e}${e}`,{...t,method:"PATCH",body:s})}delete(e,s){return this.#s(`${this.#e}${e}`,{...s,method:"DELETE"})}};export{a as HttpClient};
package/package.json CHANGED
@@ -44,5 +44,5 @@
44
44
  "sideEffects": false,
45
45
  "type": "module",
46
46
  "types": "./dist/esm/index.d.ts",
47
- "version": "1.0.1-8"
47
+ "version": "1.0.1"
48
48
  }