@ptkl/sdk 0.9.0 → 0.9.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/dist/index.cjs.js CHANGED
@@ -18362,14 +18362,14 @@ class Platform extends PlatformBaseClient {
18362
18362
 
18363
18363
  class Invoicing extends PlatformBaseClient {
18364
18364
  async getSalesInvoices(provider, page) {
18365
- return await this.request("GET", `/invoices/${provider}/sales`, {
18365
+ return await this.request("GET", `invoices/${provider}/sales`, {
18366
18366
  params: {
18367
18367
  page: page || 1
18368
18368
  }
18369
18369
  });
18370
18370
  }
18371
18371
  async acceptPurchaseInvoice(provider, id, comment) {
18372
- return await this.request('POST', `/invoices/${provider}/purchase/acceptReject/${id}`, {
18372
+ return await this.request('POST', `invoices/${provider}/purchase/acceptReject/${id}`, {
18373
18373
  data: {
18374
18374
  accepted: true,
18375
18375
  comment: comment
@@ -18379,7 +18379,7 @@ class Invoicing extends PlatformBaseClient {
18379
18379
  async request(method, endpoint, params) {
18380
18380
  return await this.client.request({
18381
18381
  method: method,
18382
- url: `/v1/integrations/karadjordje/${endpoint}`,
18382
+ url: `/karadjordje/v1/${endpoint}`,
18383
18383
  ...params
18384
18384
  });
18385
18385
  }
@@ -18415,7 +18415,7 @@ class IntegrationsBaseClient extends BaseClient {
18415
18415
  headers['X-Project-Env'] = env;
18416
18416
  }
18417
18417
  const client = axios.create({
18418
- baseURL: host !== null && host !== undefined ? host : "https://orange.protokol.io",
18418
+ baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
18419
18419
  timeout: 15000,
18420
18420
  headers: {
18421
18421
  ...headers,
@@ -18573,6 +18573,21 @@ class VPFR extends IntegrationsBaseClient {
18573
18573
  }
18574
18574
  }
18575
18575
 
18576
+ class Payments extends IntegrationsBaseClient {
18577
+ async getTransactions(user) {
18578
+ return await this.client.get(`/karadjordje/v1/payment/${user}/list`);
18579
+ }
18580
+ async settings(provider) {
18581
+ return await this.client.get(`/karadjordje/v1/payment/${provider}/settings`);
18582
+ }
18583
+ async getPaymentLink(provider, amount, description, user) {
18584
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, {
18585
+ totalAmount: amount.toString(),
18586
+ description,
18587
+ });
18588
+ }
18589
+ }
18590
+
18576
18591
  // import integrations
18577
18592
  class Integrations extends IntegrationsBaseClient {
18578
18593
  constructor(options) {
@@ -18582,6 +18597,7 @@ class Integrations extends IntegrationsBaseClient {
18582
18597
  'protokol-vpfr': new VPFR().setClient(this.client),
18583
18598
  'protokol-media': new Media().setClient(this.client),
18584
18599
  'serbia-utilities': new SerbiaUtil().setClient(this.client),
18600
+ 'protokol-payments': new Payments().setClient(this.client),
18585
18601
  };
18586
18602
  }
18587
18603
  getSerbiaUtilities() {
@@ -18596,6 +18612,9 @@ class Integrations extends IntegrationsBaseClient {
18596
18612
  getInvoicing() {
18597
18613
  return this.getInterfaceOf('protokol-invoicing');
18598
18614
  }
18615
+ getPayments() {
18616
+ return this.getInterfaceOf('protokol-payments');
18617
+ }
18599
18618
  async isInstalled(id) {
18600
18619
  const { data } = await this.client.get("/v1/integrations");
18601
18620
  return data.find((i) => i.id == id) !== undefined;
package/dist/index.esm.js CHANGED
@@ -552,14 +552,14 @@ class Platform extends PlatformBaseClient {
552
552
 
553
553
  class Invoicing extends PlatformBaseClient {
554
554
  async getSalesInvoices(provider, page) {
555
- return await this.request("GET", `/invoices/${provider}/sales`, {
555
+ return await this.request("GET", `invoices/${provider}/sales`, {
556
556
  params: {
557
557
  page: page || 1
558
558
  }
559
559
  });
560
560
  }
561
561
  async acceptPurchaseInvoice(provider, id, comment) {
562
- return await this.request('POST', `/invoices/${provider}/purchase/acceptReject/${id}`, {
562
+ return await this.request('POST', `invoices/${provider}/purchase/acceptReject/${id}`, {
563
563
  data: {
564
564
  accepted: true,
565
565
  comment: comment
@@ -569,7 +569,7 @@ class Invoicing extends PlatformBaseClient {
569
569
  async request(method, endpoint, params) {
570
570
  return await this.client.request({
571
571
  method: method,
572
- url: `/v1/integrations/karadjordje/${endpoint}`,
572
+ url: `/karadjordje/v1/${endpoint}`,
573
573
  ...params
574
574
  });
575
575
  }
@@ -605,7 +605,7 @@ class IntegrationsBaseClient extends BaseClient {
605
605
  headers['X-Project-Env'] = env;
606
606
  }
607
607
  const client = axios.create({
608
- baseURL: host !== null && host !== undefined ? host : "https://orange.protokol.io",
608
+ baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
609
609
  timeout: 15000,
610
610
  headers: {
611
611
  ...headers,
@@ -763,6 +763,21 @@ class VPFR extends IntegrationsBaseClient {
763
763
  }
764
764
  }
765
765
 
766
+ class Payments extends IntegrationsBaseClient {
767
+ async getTransactions(user) {
768
+ return await this.client.get(`/karadjordje/v1/payment/${user}/list`);
769
+ }
770
+ async settings(provider) {
771
+ return await this.client.get(`/karadjordje/v1/payment/${provider}/settings`);
772
+ }
773
+ async getPaymentLink(provider, amount, description, user) {
774
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, {
775
+ totalAmount: amount.toString(),
776
+ description,
777
+ });
778
+ }
779
+ }
780
+
766
781
  // import integrations
767
782
  class Integrations extends IntegrationsBaseClient {
768
783
  constructor(options) {
@@ -772,6 +787,7 @@ class Integrations extends IntegrationsBaseClient {
772
787
  'protokol-vpfr': new VPFR().setClient(this.client),
773
788
  'protokol-media': new Media().setClient(this.client),
774
789
  'serbia-utilities': new SerbiaUtil().setClient(this.client),
790
+ 'protokol-payments': new Payments().setClient(this.client),
775
791
  };
776
792
  }
777
793
  getSerbiaUtilities() {
@@ -786,6 +802,9 @@ class Integrations extends IntegrationsBaseClient {
786
802
  getInvoicing() {
787
803
  return this.getInterfaceOf('protokol-invoicing');
788
804
  }
805
+ getPayments() {
806
+ return this.getInterfaceOf('protokol-payments');
807
+ }
789
808
  async isInstalled(id) {
790
809
  const { data } = await this.client.get("/v1/integrations");
791
810
  return data.find((i) => i.id == id) !== undefined;
@@ -553,14 +553,14 @@ var ProtokolSDK = (function (exports, axios) {
553
553
 
554
554
  class Invoicing extends PlatformBaseClient {
555
555
  async getSalesInvoices(provider, page) {
556
- return await this.request("GET", `/invoices/${provider}/sales`, {
556
+ return await this.request("GET", `invoices/${provider}/sales`, {
557
557
  params: {
558
558
  page: page || 1
559
559
  }
560
560
  });
561
561
  }
562
562
  async acceptPurchaseInvoice(provider, id, comment) {
563
- return await this.request('POST', `/invoices/${provider}/purchase/acceptReject/${id}`, {
563
+ return await this.request('POST', `invoices/${provider}/purchase/acceptReject/${id}`, {
564
564
  data: {
565
565
  accepted: true,
566
566
  comment: comment
@@ -570,7 +570,7 @@ var ProtokolSDK = (function (exports, axios) {
570
570
  async request(method, endpoint, params) {
571
571
  return await this.client.request({
572
572
  method: method,
573
- url: `/v1/integrations/karadjordje/${endpoint}`,
573
+ url: `/karadjordje/v1/${endpoint}`,
574
574
  ...params
575
575
  });
576
576
  }
@@ -606,7 +606,7 @@ var ProtokolSDK = (function (exports, axios) {
606
606
  headers['X-Project-Env'] = env;
607
607
  }
608
608
  const client = axios.create({
609
- baseURL: host !== null && host !== undefined ? host : "https://orange.protokol.io",
609
+ baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
610
610
  timeout: 15000,
611
611
  headers: {
612
612
  ...headers,
@@ -764,6 +764,21 @@ var ProtokolSDK = (function (exports, axios) {
764
764
  }
765
765
  }
766
766
 
767
+ class Payments extends IntegrationsBaseClient {
768
+ async getTransactions(user) {
769
+ return await this.client.get(`/karadjordje/v1/payment/${user}/list`);
770
+ }
771
+ async settings(provider) {
772
+ return await this.client.get(`/karadjordje/v1/payment/${provider}/settings`);
773
+ }
774
+ async getPaymentLink(provider, amount, description, user) {
775
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, {
776
+ totalAmount: amount.toString(),
777
+ description,
778
+ });
779
+ }
780
+ }
781
+
767
782
  // import integrations
768
783
  class Integrations extends IntegrationsBaseClient {
769
784
  constructor(options) {
@@ -773,6 +788,7 @@ var ProtokolSDK = (function (exports, axios) {
773
788
  'protokol-vpfr': new VPFR().setClient(this.client),
774
789
  'protokol-media': new Media().setClient(this.client),
775
790
  'serbia-utilities': new SerbiaUtil().setClient(this.client),
791
+ 'protokol-payments': new Payments().setClient(this.client),
776
792
  };
777
793
  }
778
794
  getSerbiaUtilities() {
@@ -787,6 +803,9 @@ var ProtokolSDK = (function (exports, axios) {
787
803
  getInvoicing() {
788
804
  return this.getInterfaceOf('protokol-invoicing');
789
805
  }
806
+ getPayments() {
807
+ return this.getInterfaceOf('protokol-payments');
808
+ }
790
809
  async isInstalled(id) {
791
810
  const { data } = await this.client.get("/v1/integrations");
792
811
  return data.find((i) => i.id == id) !== undefined;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.8.4",
3
+ "version": "0.9.1",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "docs": "typedoc"
@@ -0,0 +1,7 @@
1
+ import IntegrationsBaseClient from "../integrationsBaseClient";
2
+ import { PaymentProvider } from "../../types/integrations";
3
+ export default class Payments extends IntegrationsBaseClient {
4
+ getTransactions(user: string): Promise<import("axios").AxiosResponse<any, any>>;
5
+ settings(provider: PaymentProvider): Promise<import("axios").AxiosResponse<any, any>>;
6
+ getPaymentLink(provider: PaymentProvider, amount: number, description: string, user: string): Promise<import("axios").AxiosResponse<any, any>>;
7
+ }
@@ -10,6 +10,7 @@ export default class Integrations extends IntegrationsBaseClient {
10
10
  getDMS(): any;
11
11
  getVPFR(): any;
12
12
  getInvoicing(): any;
13
+ getPayments(): any;
13
14
  isInstalled(id: string): Promise<boolean>;
14
15
  getInterfaceOf(id: string): any;
15
16
  }
@@ -0,0 +1 @@
1
+ export type PaymentProvider = 'monri';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "docs": "typedoc"