@tnf-dev/api 1.0.6-6 → 1.0.6-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.
@@ -1,2 +1,39 @@
1
- export { Teknify, TeknifyOptions, TeknifyTriggerParams, TeknifyTriggerResponse } from './lib/teknify.cjs';
2
- import '@tnf-dev/core';
1
+ import { BaseResponse } from '@tnf-dev/core';
2
+
3
+ interface TeknifyOptions {
4
+ channelId: string;
5
+ appId: string;
6
+ apiKey: string;
7
+ baseUrl?: string;
8
+ }
9
+ interface TeknifyTriggerParams {
10
+ workflowIdentifier: string;
11
+ payload?: Record<string, any>;
12
+ to: {
13
+ subscriberId: string;
14
+ email?: string;
15
+ phone?: string;
16
+ };
17
+ override?: {
18
+ provider?: Array<string>;
19
+ };
20
+ }
21
+ interface TeknifyTriggerResponse extends BaseResponse {
22
+ data: {
23
+ eventData: Array<{
24
+ id: string;
25
+ identifier: string;
26
+ is_active: string;
27
+ name: string;
28
+ provider: string;
29
+ }>;
30
+ };
31
+ }
32
+ declare class Teknify {
33
+ #private;
34
+ constructor(options: TeknifyOptions);
35
+ get baseUrl(): string;
36
+ trigger(params: TeknifyTriggerParams): Promise<TeknifyTriggerResponse>;
37
+ }
38
+
39
+ export { Teknify, type TeknifyOptions, type TeknifyTriggerParams, type TeknifyTriggerResponse };
@@ -1,2 +1,39 @@
1
- export { Teknify, TeknifyOptions, TeknifyTriggerParams, TeknifyTriggerResponse } from './lib/teknify.js';
2
- import '@tnf-dev/core';
1
+ import { BaseResponse } from '@tnf-dev/core';
2
+
3
+ interface TeknifyOptions {
4
+ channelId: string;
5
+ appId: string;
6
+ apiKey: string;
7
+ baseUrl?: string;
8
+ }
9
+ interface TeknifyTriggerParams {
10
+ workflowIdentifier: string;
11
+ payload?: Record<string, any>;
12
+ to: {
13
+ subscriberId: string;
14
+ email?: string;
15
+ phone?: string;
16
+ };
17
+ override?: {
18
+ provider?: Array<string>;
19
+ };
20
+ }
21
+ interface TeknifyTriggerResponse extends BaseResponse {
22
+ data: {
23
+ eventData: Array<{
24
+ id: string;
25
+ identifier: string;
26
+ is_active: string;
27
+ name: string;
28
+ provider: string;
29
+ }>;
30
+ };
31
+ }
32
+ declare class Teknify {
33
+ #private;
34
+ constructor(options: TeknifyOptions);
35
+ get baseUrl(): string;
36
+ trigger(params: TeknifyTriggerParams): Promise<TeknifyTriggerResponse>;
37
+ }
38
+
39
+ export { Teknify, type TeknifyOptions, type TeknifyTriggerParams, type TeknifyTriggerResponse };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "browser": "./dist/esm/index.js",
3
3
  "dependencies": {
4
- "@tnf-dev/core": "1.0.6-6"
4
+ "@tnf-dev/core": "1.0.6-7"
5
5
  },
6
6
  "devDependencies": {
7
7
  "@arethetypeswrong/cli": "^0.18.2",
@@ -52,5 +52,5 @@
52
52
  "sideEffects": false,
53
53
  "type": "module",
54
54
  "types": "./dist/esm/index.d.ts",
55
- "version": "1.0.6-6"
55
+ "version": "1.0.6-7"
56
56
  }
@@ -1 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var s in e)o(t,s,{get:e[s],enumerable:!0})},f=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!x.call(t,r)&&r!==s&&o(t,r,{get:()=>e[r],enumerable:!(i=n(e,r))||i.enumerable});return t};var k=t=>f(o({},"__esModule",{value:!0}),t);var A={};c(A,{DEFAULT_BASE_URL:()=>v});module.exports=k(A);var v="https://teknify-server.teknix.services";0&&(module.exports={DEFAULT_BASE_URL});
@@ -1 +0,0 @@
1
- export { DEFAULT_BASE_URL } from './utils/const.cjs';
@@ -1 +0,0 @@
1
- "use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},v=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of k(e))!o.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(n=c(e,s))||n.enumerable});return t};var x=t=>v(i({},"__esModule",{value:!0}),t);var E={};p(E,{DEFAULT_BASE_URL:()=>A});module.exports=x(E);var A="https://teknify-server.teknix.services";0&&(module.exports={DEFAULT_BASE_URL});
@@ -1,3 +0,0 @@
1
- declare const DEFAULT_BASE_URL = "https://teknify-server.teknix.services";
2
-
3
- export { DEFAULT_BASE_URL };
@@ -1 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var s in e)o(t,s,{get:e[s],enumerable:!0})},f=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!x.call(t,r)&&r!==s&&o(t,r,{get:()=>e[r],enumerable:!(i=n(e,r))||i.enumerable});return t};var k=t=>f(o({},"__esModule",{value:!0}),t);var A={};c(A,{DEFAULT_BASE_URL:()=>v});module.exports=k(A);var v="https://teknify-server.teknix.services";0&&(module.exports={DEFAULT_BASE_URL});
@@ -1 +0,0 @@
1
- export { DEFAULT_BASE_URL } from './const.cjs';
@@ -1 +0,0 @@
1
- "use strict";var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var I=e=>{throw TypeError(e)};var U=(e,r)=>{for(var i in r)f(e,i,{get:r[i],enumerable:!0})},b=(e,r,i,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let g of x(r))!u.call(e,g)&&g!==i&&f(e,g,{get:()=>r[g],enumerable:!(p=m(r,g))||p.enumerable});return e};var R=e=>b(f({},"__esModule",{value:!0}),e);var w=(e,r,i)=>r.has(e)||I("Cannot "+i);var t=(e,r,i)=>(w(e,r,"read from private field"),i?i.call(e):r.get(e)),s=(e,r,i)=>r.has(e)?I("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,i),n=(e,r,i,p)=>(w(e,r,"write to private field"),p?p.call(e,i):r.set(e,i),i);var v={};U(v,{Teknify:()=>y});module.exports=R(v);var k=require("@tnf-dev/core");var T="https://teknify-server.teknix.services";var d,o,h,a,l,c,y=class{constructor(r){s(this,d);s(this,o);s(this,h);s(this,a);s(this,l);s(this,c,{});if(!r.channelId)throw new Error("channelId is required");if(!r.appId)throw new Error("appId is required");if(!r.apiKey)throw new Error("apiKey is required");n(this,h,r.apiKey),n(this,a,r.baseUrl||T),n(this,o,r.appId),n(this,d,r.channelId),n(this,l,new k.HttpClient({baseUrl:t(this,a)})),n(this,c,{"x-channel-id":t(this,d),"x-api-key":t(this,h)})}get baseUrl(){return t(this,a)}async trigger(r){return await t(this,l).post("/api/workflows/trigger",{appId:t(this,o),...r},{headers:{...t(this,c)}})}};d=new WeakMap,o=new WeakMap,h=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap;0&&(module.exports={Teknify});
@@ -1,2 +0,0 @@
1
- export { Teknify, TeknifyOptions, TeknifyTriggerParams, TeknifyTriggerResponse } from './teknify.cjs';
2
- import '@tnf-dev/core';
@@ -1 +0,0 @@
1
- "use strict";var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var I=e=>{throw TypeError(e)};var U=(e,r)=>{for(var i in r)f(e,i,{get:r[i],enumerable:!0})},b=(e,r,i,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let g of u(r))!x.call(e,g)&&g!==i&&f(e,g,{get:()=>r[g],enumerable:!(p=m(r,g))||p.enumerable});return e};var R=e=>b(f({},"__esModule",{value:!0}),e);var w=(e,r,i)=>r.has(e)||I("Cannot "+i);var t=(e,r,i)=>(w(e,r,"read from private field"),i?i.call(e):r.get(e)),s=(e,r,i)=>r.has(e)?I("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,i),n=(e,r,i,p)=>(w(e,r,"write to private field"),p?p.call(e,i):r.set(e,i),i);var v={};U(v,{Teknify:()=>y});module.exports=R(v);var k=require("@tnf-dev/core");var T="https://teknify-server.teknix.services";var d,h,o,a,l,c,y=class{constructor(r){s(this,d);s(this,h);s(this,o);s(this,a);s(this,l);s(this,c,{});if(!r.channelId)throw new Error("channelId is required");if(!r.appId)throw new Error("appId is required");if(!r.apiKey)throw new Error("apiKey is required");n(this,o,r.apiKey),n(this,a,r.baseUrl||T),n(this,h,r.appId),n(this,d,r.channelId),n(this,l,new k.HttpClient({baseUrl:t(this,a)})),n(this,c,{"x-channel-id":t(this,d),"x-api-key":t(this,o)})}get baseUrl(){return t(this,a)}async trigger(r){return await t(this,l).post("/api/workflows/trigger",{appId:t(this,h),...r},{headers:{...t(this,c)}})}};d=new WeakMap,h=new WeakMap,o=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap;0&&(module.exports={Teknify});
@@ -1,39 +0,0 @@
1
- import { BaseResponse } from '@tnf-dev/core';
2
-
3
- interface TeknifyOptions {
4
- channelId: string;
5
- appId: string;
6
- apiKey: string;
7
- baseUrl?: string;
8
- }
9
- interface TeknifyTriggerParams {
10
- workflowIdentifier: string;
11
- payload?: Record<string, any>;
12
- to: {
13
- subscriberId: string;
14
- email?: string;
15
- phone?: string;
16
- };
17
- override?: {
18
- provider?: Array<string>;
19
- };
20
- }
21
- interface TeknifyTriggerResponse extends BaseResponse {
22
- data: {
23
- eventData: Array<{
24
- id: string;
25
- identifier: string;
26
- is_active: string;
27
- name: string;
28
- provider: string;
29
- }>;
30
- };
31
- }
32
- declare class Teknify {
33
- #private;
34
- constructor(options: TeknifyOptions);
35
- get baseUrl(): string;
36
- trigger(params: TeknifyTriggerParams): Promise<TeknifyTriggerResponse>;
37
- }
38
-
39
- export { Teknify, type TeknifyOptions, type TeknifyTriggerParams, type TeknifyTriggerResponse };
@@ -1 +0,0 @@
1
- export { DEFAULT_BASE_URL } from './utils/const.js';
@@ -1 +0,0 @@
1
- var e="https://teknify-server.teknix.services";export{e as DEFAULT_BASE_URL};
@@ -1,3 +0,0 @@
1
- declare const DEFAULT_BASE_URL = "https://teknify-server.teknix.services";
2
-
3
- export { DEFAULT_BASE_URL };
@@ -1 +0,0 @@
1
- var e="https://teknify-server.teknix.services";export{e as DEFAULT_BASE_URL};
@@ -1 +0,0 @@
1
- export { DEFAULT_BASE_URL } from './const.js';
@@ -1 +0,0 @@
1
- var e="https://teknify-server.teknix.services";export{e as DEFAULT_BASE_URL};
@@ -1,2 +0,0 @@
1
- export { Teknify, TeknifyOptions, TeknifyTriggerParams, TeknifyTriggerResponse } from './teknify.js';
2
- import '@tnf-dev/core';
@@ -1 +0,0 @@
1
- import{HttpClient as t}from"@tnf-dev/core";var e="https://teknify-server.teknix.services";var i=class{#e;#i;#t;#r;#s;#n={};constructor(r){if(!r.channelId)throw new Error("channelId is required");if(!r.appId)throw new Error("appId is required");if(!r.apiKey)throw new Error("apiKey is required");this.#t=r.apiKey,this.#r=r.baseUrl||e,this.#i=r.appId,this.#e=r.channelId,this.#s=new t({baseUrl:this.#r}),this.#n={"x-channel-id":this.#e,"x-api-key":this.#t}}get baseUrl(){return this.#r}async trigger(r){return await this.#s.post("/api/workflows/trigger",{appId:this.#i,...r},{headers:{...this.#n}})}};export{i as Teknify};
@@ -1,39 +0,0 @@
1
- import { BaseResponse } from '@tnf-dev/core';
2
-
3
- interface TeknifyOptions {
4
- channelId: string;
5
- appId: string;
6
- apiKey: string;
7
- baseUrl?: string;
8
- }
9
- interface TeknifyTriggerParams {
10
- workflowIdentifier: string;
11
- payload?: Record<string, any>;
12
- to: {
13
- subscriberId: string;
14
- email?: string;
15
- phone?: string;
16
- };
17
- override?: {
18
- provider?: Array<string>;
19
- };
20
- }
21
- interface TeknifyTriggerResponse extends BaseResponse {
22
- data: {
23
- eventData: Array<{
24
- id: string;
25
- identifier: string;
26
- is_active: string;
27
- name: string;
28
- provider: string;
29
- }>;
30
- };
31
- }
32
- declare class Teknify {
33
- #private;
34
- constructor(options: TeknifyOptions);
35
- get baseUrl(): string;
36
- trigger(params: TeknifyTriggerParams): Promise<TeknifyTriggerResponse>;
37
- }
38
-
39
- export { Teknify, type TeknifyOptions, type TeknifyTriggerParams, type TeknifyTriggerResponse };
@@ -1 +0,0 @@
1
- import{HttpClient as t}from"@tnf-dev/core";var e="https://teknify-server.teknix.services";var i=class{#e;#i;#t;#r;#s;#n={};constructor(r){if(!r.channelId)throw new Error("channelId is required");if(!r.appId)throw new Error("appId is required");if(!r.apiKey)throw new Error("apiKey is required");this.#t=r.apiKey,this.#r=r.baseUrl||e,this.#i=r.appId,this.#e=r.channelId,this.#s=new t({baseUrl:this.#r}),this.#n={"x-channel-id":this.#e,"x-api-key":this.#t}}get baseUrl(){return this.#r}async trigger(r){return await this.#s.post("/api/workflows/trigger",{appId:this.#i,...r},{headers:{...this.#n}})}};export{i as Teknify};