@ptkl/sdk 1.0.3 → 1.1.0

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,9 +1,10 @@
1
1
  import Invoicing from "./integrations/invoicing";
2
2
  import DMS from "./integrations/dms";
3
- import VPFR from "./integrations/vpfr";
3
+ import MinFin from "./integrations/serbia/minfin";
4
4
  import IntegrationsBaseClient from "./integrationsBaseClient";
5
5
  import Payments from "./integrations/payments";
6
6
  import Minimax from "./integrations/minimax";
7
+ import NBS from "./integrations/serbia/nbs";
7
8
  export default class Integrations extends IntegrationsBaseClient {
8
9
  private integrations;
9
10
  constructor(options?: {
@@ -11,12 +12,12 @@ export default class Integrations extends IntegrationsBaseClient {
11
12
  token?: string;
12
13
  host?: string;
13
14
  });
14
- getSerbiaUtilities(): any;
15
15
  getDMS(): DMS;
16
- getVPFR(): VPFR;
17
16
  getInvoicing(): Invoicing;
18
17
  getPayments(): Payments;
19
18
  getMinimax(): Minimax;
19
+ getNBS(): NBS;
20
+ getSerbiaMinFin(): MinFin;
20
21
  isInstalled(id: string): Promise<boolean>;
21
22
  getInterfaceOf(id: string): any;
22
23
  }
@@ -3,7 +3,7 @@ import Functions from "./functions";
3
3
  import APIUser from "./apiUser";
4
4
  import Users from "./users";
5
5
  import Apps from "./apps";
6
- import Component, { ComponentOptions } from "./component";
6
+ import Component from "./component";
7
7
  import ComponentUtils from "./componentUtils";
8
8
  import Thunder from "./thunder";
9
9
  import Ratchet from "./ratchet";
@@ -22,7 +22,7 @@ export default class Platform extends PlatformBaseClient {
22
22
  user(): Users;
23
23
  app(appType: string): Apps;
24
24
  forge(): Forge;
25
- component(ref: string, options?: ComponentOptions): Component;
25
+ component(ref: string): Component;
26
26
  componentUtils(): ComponentUtils;
27
27
  ratchet(): Ratchet;
28
28
  sandbox(): Sandbox;
@@ -42,6 +42,11 @@ export default class Project extends PlatformBaseClient {
42
42
  * @param uuid Invite UUID
43
43
  */
44
44
  acceptInvite(uuid: string): Promise<AxiosResponse<any>>;
45
+ /**
46
+ * Revoke an invite
47
+ * @param uuid Invite UUID
48
+ */
49
+ revokeInvite(uuid: string): Promise<AxiosResponse<any>>;
45
50
  /**
46
51
  * Register through an invite
47
52
  * @param uuid Invite UUID
@@ -19002,7 +19002,7 @@ const isSandbox = typeof window !== "undefined";
19002
19002
  */
19003
19003
  class PlatformBaseClient extends BaseClient {
19004
19004
  constructor(options) {
19005
- var _a, _b, _c, _d, _e, _f, _g;
19005
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19006
19006
  let { env = null, token = null, host = null, } = options !== null && options !== void 0 ? options : {};
19007
19007
  let headers = {};
19008
19008
  var project_uuid = null;
@@ -19011,23 +19011,23 @@ class PlatformBaseClient extends BaseClient {
19011
19011
  const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
19012
19012
  host = (_a = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.API_HOST) !== null && _a !== void 0 ? _a : host;
19013
19013
  // @ts-ignore
19014
- env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
19015
- token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
19014
+ env = (_b = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV) !== null && _b !== void 0 ? _b : env;
19015
+ token = (_c = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN) !== null && _c !== void 0 ? _c : token;
19016
19016
  project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
19017
19017
  if (isBrowser) {
19018
19018
  if (sessionStorage.getItem('protokol_context') == "forge") {
19019
- headers['X-Project-Env'] = (_b = sessionStorage.getItem('forge_app_env')) !== null && _b !== void 0 ? _b : "dev";
19019
+ headers['X-Project-Env'] = (_d = sessionStorage.getItem('forge_app_env')) !== null && _d !== void 0 ? _d : "dev";
19020
19020
  }
19021
19021
  else {
19022
- headers['X-Project-Env'] = (_c = localStorage.getItem('current_env')) !== null && _c !== void 0 ? _c : "dev";
19022
+ headers['X-Project-Env'] = (_e = localStorage.getItem('current_env')) !== null && _e !== void 0 ? _e : "dev";
19023
19023
  }
19024
19024
  }
19025
19025
  }
19026
- else if (isNode) {
19027
- host = (_d = host !== null && host !== void 0 ? host : process.env.API_HOST) !== null && _d !== void 0 ? _d : null;
19028
- env = (_e = env !== null && env !== void 0 ? env : process.env.PROJECT_ENV) !== null && _e !== void 0 ? _e : null;
19029
- token = (_f = token !== null && token !== void 0 ? token : process.env.PROJECT_API_TOKEN) !== null && _f !== void 0 ? _f : null;
19030
- project_uuid = (_g = process.env.PROJECT_UUID) !== null && _g !== void 0 ? _g : null;
19026
+ if (isNode) {
19027
+ host = (_f = host !== null && host !== void 0 ? host : process.env.API_HOST) !== null && _f !== void 0 ? _f : null;
19028
+ env = (_g = env !== null && env !== void 0 ? env : process.env.PROJECT_ENV) !== null && _g !== void 0 ? _g : null;
19029
+ token = (_h = token !== null && token !== void 0 ? token : process.env.PROJECT_API_TOKEN) !== null && _h !== void 0 ? _h : null;
19030
+ project_uuid = (_j = process.env.PROJECT_UUID) !== null && _j !== void 0 ? _j : null;
19031
19031
  }
19032
19032
  if (token) {
19033
19033
  headers['Authorization'] = `Bearer ${token}`;
@@ -19055,21 +19055,9 @@ class PlatformBaseClient extends BaseClient {
19055
19055
  }
19056
19056
 
19057
19057
  class Component extends PlatformBaseClient {
19058
- constructor(ref = null, options) {
19059
- var _a;
19058
+ constructor(ref = null) {
19060
19059
  super();
19061
19060
  this.ref = ref;
19062
- this.version = (_a = options === null || options === void 0 ? void 0 : options.version) !== null && _a !== void 0 ? _a : null;
19063
- }
19064
- /**
19065
- * Get the base path for component API calls
19066
- * @private
19067
- */
19068
- getComponentPath() {
19069
- if (this.version) {
19070
- return `/v3/system/component/${this.ref}/v/${this.version}`;
19071
- }
19072
- return `/v3/system/component/${this.ref}`;
19073
19061
  }
19074
19062
  /**
19075
19063
  * Find method to search for models
@@ -19093,7 +19081,6 @@ class Component extends PlatformBaseClient {
19093
19081
  * )
19094
19082
  **/
19095
19083
  async find(filters, opts) {
19096
- const { cache = false, buildttl = -1, locale = "en_US", } = opts !== null && opts !== void 0 ? opts : {};
19097
19084
  let payload = {
19098
19085
  context: filters,
19099
19086
  ref: this.ref,
@@ -19119,7 +19106,7 @@ class Component extends PlatformBaseClient {
19119
19106
  sortBy: ctx.sortBy,
19120
19107
  sortDesc: sortDesc,
19121
19108
  filter: ctx.filter,
19122
- filterOn: ctx.filterOn.join(","),
19109
+ filterOn: ctx.filterOn,
19123
19110
  limit: limit,
19124
19111
  dateFrom: ctx.dateFrom,
19125
19112
  dateTo: ctx.dateTo,
@@ -19131,20 +19118,12 @@ class Component extends PlatformBaseClient {
19131
19118
  if (ctx.$aggregate && ctx.$aggregate.length > 0) {
19132
19119
  params.$aggregate = JSON.stringify(ctx.$aggregate);
19133
19120
  }
19134
- if (opts) {
19135
- Object.keys(opts).forEach(k => {
19136
- if (['cache', 'buildttl', 'locale'].includes(k)) {
19137
- return;
19138
- }
19139
- params[`_opt_${k}`] = opts ? opts[k] : null;
19140
- });
19141
- }
19142
- return await this.client.get(`${this.getComponentPath()}/models`, {
19143
- params: params,
19121
+ return await this.client.post(`/v4/system/component/${this.ref}/models`, {
19122
+ ...params,
19123
+ options: opts
19124
+ }, {
19144
19125
  headers: {
19145
- 'X-Cache': cache,
19146
- 'X-Build-Ttl': buildttl,
19147
- 'Accept-Language': locale
19126
+ "Accept-Language": (opts === null || opts === void 0 ? void 0 : opts.locale) || "en_US",
19148
19127
  }
19149
19128
  });
19150
19129
  }
@@ -19178,7 +19157,7 @@ class Component extends PlatformBaseClient {
19178
19157
  * @returns (Promise<Model>)
19179
19158
  */
19180
19159
  async get(uuid) {
19181
- return await this.client.get(`${this.getComponentPath()}/model/${uuid}`);
19160
+ return await this.client.get(`/v4/system/component/${this.ref}/model/${uuid}`);
19182
19161
  }
19183
19162
  /**
19184
19163
  * Update model by uuid
@@ -19188,7 +19167,7 @@ class Component extends PlatformBaseClient {
19188
19167
  * @returns
19189
19168
  */
19190
19169
  async update(uuid, data, options) {
19191
- return await this.client.post(`${this.getComponentPath()}/model/${uuid}`, {
19170
+ return await this.client.post(`/v4/system/component/${this.ref}/model/${uuid}`, {
19192
19171
  data,
19193
19172
  options,
19194
19173
  });
@@ -19201,7 +19180,7 @@ class Component extends PlatformBaseClient {
19201
19180
  * @returns
19202
19181
  */
19203
19182
  async updateMany(data, options) {
19204
- return await this.client.patch(`${this.getComponentPath()}/models/bulk`, {
19183
+ return await this.client.patch(`/v4/system/component/${this.ref}/models/bulk`, {
19205
19184
  data,
19206
19185
  options
19207
19186
  });
@@ -19214,7 +19193,7 @@ class Component extends PlatformBaseClient {
19214
19193
  * @returns
19215
19194
  */
19216
19195
  async createMany(data, options) {
19217
- return await this.client.post(`${this.getComponentPath()}/models/bulk`, {
19196
+ return await this.client.post(`/v4/system/component/${this.ref}/models/bulk`, {
19218
19197
  data,
19219
19198
  options
19220
19199
  });
@@ -19227,7 +19206,7 @@ class Component extends PlatformBaseClient {
19227
19206
  * @returns
19228
19207
  */
19229
19208
  async modify(filters, data, options) {
19230
- return await this.client.patch(`${this.getComponentPath()}/modify/model`, {
19209
+ return await this.client.patch(`/v4/system/component/${this.ref}/modify/model`, {
19231
19210
  filters,
19232
19211
  data,
19233
19212
  options,
@@ -19242,17 +19221,17 @@ class Component extends PlatformBaseClient {
19242
19221
  * @returns
19243
19222
  */
19244
19223
  async concurrentUpdate(uuid, version, data, options) {
19245
- return await this.client.post(`${this.getComponentPath()}/model/${uuid}`, {
19224
+ return await this.client.post(`/v4/system/component/${this.ref}/model/${uuid}`, {
19246
19225
  version: version,
19247
19226
  data,
19248
19227
  options,
19249
19228
  });
19250
19229
  }
19251
19230
  async create(model) {
19252
- return await this.client.post(`${this.getComponentPath()}/model`, model);
19231
+ return await this.client.post(`/v4/system/component/${this.ref}/model`, model);
19253
19232
  }
19254
19233
  async delete(uuid) {
19255
- return await this.client.delete(`${this.getComponentPath()}/model/${uuid}`);
19234
+ return await this.client.delete(`/v4/system/component/${this.ref}/model/${uuid}`);
19256
19235
  }
19257
19236
  /**
19258
19237
  * Execute aggregate pipeline with optional streaming support
@@ -19305,14 +19284,14 @@ class Component extends PlatformBaseClient {
19305
19284
  onError: onErrorCallback,
19306
19285
  onEnd: onEndCallback
19307
19286
  };
19308
- streamPromise = this._streamNDJSON(`${this.getComponentPath()}/aggregate`, {
19287
+ streamPromise = this._streamNDJSON(`/v4/system/component/${this.ref}/aggregate`, {
19309
19288
  'Accept': 'application/x-ndjson',
19310
19289
  'Content-Type': 'application/json'
19311
19290
  }, handler, pipeline);
19312
19291
  }
19313
19292
  return streamPromise.then(resolve, reject);
19314
19293
  }
19315
- return this.client.post(`${this.getComponentPath()}/aggregate`, pipeline)
19294
+ return this.client.post(`/v4/system/component/${this.ref}/aggregate`, pipeline)
19316
19295
  .then(resolve, reject);
19317
19296
  },
19318
19297
  catch: (reject) => {
@@ -19324,8 +19303,18 @@ class Component extends PlatformBaseClient {
19324
19303
  async settings() {
19325
19304
  return await this.client.get(`/v3/system/component/settings/${this.ref}`);
19326
19305
  }
19306
+ async settingsForVersion(version) {
19307
+ return await this.client.get(`/v3/system/component/settings/${this.ref}/${version}`);
19308
+ }
19309
+ async publish(version, env) {
19310
+ return await this.client.post(`/v3/system/component/version/publish`, {
19311
+ ref: this.ref,
19312
+ version,
19313
+ env,
19314
+ });
19315
+ }
19327
19316
  async saveSettings(settings, version) {
19328
- return await this.client.post(`/v3/system/component/settings/${this.ref}/${version}`, settings);
19317
+ return await this.client.post(`/v4/system/component/settings/${this.ref}/${version}`, settings);
19329
19318
  }
19330
19319
  async saveTemplatesDist(version, sdkVersion, engine, dist) {
19331
19320
  return await this.client.post(`/v3/system/component/templates/${this.ref}/${version}`, {
@@ -19337,18 +19326,18 @@ class Component extends PlatformBaseClient {
19337
19326
  });
19338
19327
  }
19339
19328
  async workflow(event, input) {
19340
- return await this.client.post(`${this.getComponentPath()}/workflow/event`, {
19329
+ return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
19341
19330
  event,
19342
19331
  input
19343
19332
  });
19344
19333
  }
19345
19334
  async function(name, input) {
19346
- return await this.client.post(`${this.getComponentPath()}/function/${name}`, {
19335
+ return await this.client.post(`/v3/system/component/${this.ref}/function/${name}`, {
19347
19336
  data: input
19348
19337
  });
19349
19338
  }
19350
19339
  async revisions(uuid) {
19351
- return await this.client.get(`${this.getComponentPath()}/model/${uuid}/revisions`);
19340
+ return await this.client.get(`/v3/system/component/${this.ref}/model/${uuid}/revisions`);
19352
19341
  }
19353
19342
  /**
19354
19343
  * Internal method to handle NDJSON streaming responses
@@ -19897,7 +19886,7 @@ class Sandbox extends PlatformBaseClient {
19897
19886
  * const result = await platform.sandbox().spark("myFunction", { foo: "bar" })
19898
19887
  */
19899
19888
  async spark(name, data) {
19900
- return await this.client.post(`/v1/project/sandbox/spark/exec/${name}`, data);
19889
+ return await this.client.post(`/luma/sandbox/v1/spark/exec/${name}`, data);
19901
19890
  }
19902
19891
  }
19903
19892
 
@@ -19994,6 +19983,13 @@ class Project extends PlatformBaseClient {
19994
19983
  async acceptInvite(uuid) {
19995
19984
  return await this.client.get(`/v1/project/invite/accept/${uuid}`);
19996
19985
  }
19986
+ /**
19987
+ * Revoke an invite
19988
+ * @param uuid Invite UUID
19989
+ */
19990
+ async revokeInvite(uuid) {
19991
+ return await this.client.delete(`/v1/project/invite/${uuid}`);
19992
+ }
19997
19993
  /**
19998
19994
  * Register through an invite
19999
19995
  * @param uuid Invite UUID
@@ -20157,8 +20153,8 @@ class Platform extends PlatformBaseClient {
20157
20153
  forge() {
20158
20154
  return (new Forge()).setClient(this.client);
20159
20155
  }
20160
- component(ref, options) {
20161
- return (new Component(ref, options)).setClient(this.client);
20156
+ component(ref) {
20157
+ return (new Component(ref)).setClient(this.client);
20162
20158
  }
20163
20159
  componentUtils() {
20164
20160
  return (new ComponentUtils()).setClient(this.client);
@@ -20186,31 +20182,6 @@ class Platform extends PlatformBaseClient {
20186
20182
  }
20187
20183
  }
20188
20184
 
20189
- class Invoicing extends PlatformBaseClient {
20190
- async getSalesInvoices(provider, page) {
20191
- return await this.request("GET", `invoices/${provider}/sales`, {
20192
- params: {
20193
- page: page || 1
20194
- }
20195
- });
20196
- }
20197
- async acceptPurchaseInvoice(provider, id, comment) {
20198
- return await this.request('POST', `invoices/${provider}/purchase/acceptReject/${id}`, {
20199
- data: {
20200
- accepted: true,
20201
- comment: comment
20202
- }
20203
- });
20204
- }
20205
- async request(method, endpoint, params) {
20206
- return await this.client.request({
20207
- method: method,
20208
- url: `/karadjordje/v1/${endpoint}`,
20209
- ...params
20210
- });
20211
- }
20212
- }
20213
-
20214
20185
  class IntegrationsBaseClient extends BaseClient {
20215
20186
  constructor(options) {
20216
20187
  var _a, _b, _c, _d, _e, _f, _g;
@@ -20233,7 +20204,7 @@ class IntegrationsBaseClient extends BaseClient {
20233
20204
  }
20234
20205
  }
20235
20206
  }
20236
- else if (isNode) {
20207
+ if (isNode) {
20237
20208
  host = (_d = host !== null && host !== void 0 ? host : process.env.INTEGRATION_API) !== null && _d !== void 0 ? _d : null;
20238
20209
  env = (_e = env !== null && env !== void 0 ? env : process.env.PROJECT_ENV) !== null && _e !== void 0 ? _e : null;
20239
20210
  token = (_f = token !== null && token !== void 0 ? token : process.env.PROJECT_API_TOKEN) !== null && _f !== void 0 ? _f : null;
@@ -21031,18 +21002,33 @@ class DMS extends IntegrationsBaseClient {
21031
21002
  }
21032
21003
  }
21033
21004
 
21034
- class SerbiaUtil extends IntegrationsBaseClient {
21035
- async nbsSearch(params) {
21036
- return await this.services("GET", "nbs/search", { params });
21005
+ class VPFR extends IntegrationsBaseClient {
21006
+ async request(method, endpoint, params) {
21007
+ return await this.client.request({
21008
+ method: method,
21009
+ url: `/v1/karadjordje/vpfr/${endpoint}`,
21010
+ ...params
21011
+ });
21037
21012
  }
21013
+ }
21014
+
21015
+ class MinFin extends IntegrationsBaseClient {
21038
21016
  async getReceiptFromUrl(url, source) {
21039
- return await this.services("POST", "receipt/crawl", {
21017
+ return await this.services("POST", "receipt/extract", {
21040
21018
  data: {
21041
21019
  url,
21042
21020
  source
21043
21021
  }
21044
21022
  });
21045
21023
  }
21024
+ async getReceiptFromQrCode(qrCodeImage, source) {
21025
+ return await this.services("POST", "receipt/extract", {
21026
+ data: {
21027
+ qrCodeImage,
21028
+ source
21029
+ }
21030
+ });
21031
+ }
21046
21032
  async getContoList() {
21047
21033
  return await this.services("GET", "conto");
21048
21034
  }
@@ -21056,15 +21042,8 @@ class SerbiaUtil extends IntegrationsBaseClient {
21056
21042
  ...params
21057
21043
  });
21058
21044
  }
21059
- }
21060
-
21061
- class VPFR extends IntegrationsBaseClient {
21062
- async request(method, endpoint, params) {
21063
- return await this.client.request({
21064
- method: method,
21065
- url: `/v1/karadjordje/vpfr/${endpoint}`,
21066
- ...params
21067
- });
21045
+ vpfr() {
21046
+ return new VPFR().setClient(this.client);
21068
21047
  }
21069
21048
  }
21070
21049
 
@@ -21847,28 +21826,57 @@ class Minimax extends IntegrationsBaseClient {
21847
21826
  }
21848
21827
  }
21849
21828
 
21850
- // import integrations
21829
+ class NBS extends IntegrationsBaseClient {
21830
+ async nbsSearch(params) {
21831
+ return await this.services("GET", "nbs/search", { params });
21832
+ }
21833
+ async getNbsIpsQrCode(code, size, lang) {
21834
+ return await this.request("GET", `ipsQr/generate`, {
21835
+ params: {
21836
+ size,
21837
+ lang
21838
+ },
21839
+ data: {
21840
+ ...code
21841
+ }
21842
+ });
21843
+ }
21844
+ async validateNbsIpsQrCode(qrCodeString, lang) {
21845
+ return await this.request("GET", `ipsQr/validate`, {
21846
+ params: {
21847
+ lang
21848
+ },
21849
+ data: {
21850
+ QRCodeString: qrCodeString
21851
+ }
21852
+ });
21853
+ }
21854
+ async services(method, endpoint, params) {
21855
+ return this.request(method, `services/${endpoint}`, params);
21856
+ }
21857
+ async request(method, endpoint, params) {
21858
+ return await this.client.request({
21859
+ method: method,
21860
+ url: `/v1/karadjordje/${endpoint}`,
21861
+ ...params
21862
+ });
21863
+ }
21864
+ }
21865
+
21851
21866
  class Integrations extends IntegrationsBaseClient {
21852
21867
  constructor(options) {
21853
21868
  super(options);
21854
21869
  this.integrations = {
21855
- 'protokol-invoicing': new Invoicing().setClient(this.client),
21856
- 'protokol-vpfr': new VPFR().setClient(this.client),
21870
+ 'serbia-minfin': new MinFin().setClient(this.client),
21857
21871
  'protokol-dms': new DMS().setClient(this.client),
21858
- 'serbia-utilities': new SerbiaUtil().setClient(this.client),
21872
+ 'nbs': new NBS().setClient(this.client),
21859
21873
  'protokol-payments': new Payments().setClient(this.client),
21860
21874
  'protokol-minimax': new Minimax().setClient(this.client),
21861
21875
  };
21862
21876
  }
21863
- getSerbiaUtilities() {
21864
- return this.getInterfaceOf('serbia-utilities');
21865
- }
21866
21877
  getDMS() {
21867
21878
  return this.getInterfaceOf('protokol-dms');
21868
21879
  }
21869
- getVPFR() {
21870
- return this.getInterfaceOf('protokol-vpfr');
21871
- }
21872
21880
  getInvoicing() {
21873
21881
  return this.getInterfaceOf('protokol-invoicing');
21874
21882
  }
@@ -21878,6 +21886,12 @@ class Integrations extends IntegrationsBaseClient {
21878
21886
  getMinimax() {
21879
21887
  return this.getInterfaceOf('protokol-minimax');
21880
21888
  }
21889
+ getNBS() {
21890
+ return this.getInterfaceOf('nbs');
21891
+ }
21892
+ getSerbiaMinFin() {
21893
+ return this.getInterfaceOf('serbia-minfin');
21894
+ }
21881
21895
  async isInstalled(id) {
21882
21896
  const { data } = await this.client.get("/v1/integrations");
21883
21897
  return data.find((i) => i.id == id) !== undefined;
@@ -21892,6 +21906,31 @@ class Integrations extends IntegrationsBaseClient {
21892
21906
  }
21893
21907
  }
21894
21908
 
21909
+ class Invoicing extends PlatformBaseClient {
21910
+ async getSalesInvoices(provider, page) {
21911
+ return await this.request("GET", `invoices/${provider}/sales`, {
21912
+ params: {
21913
+ page: page || 1
21914
+ }
21915
+ });
21916
+ }
21917
+ async acceptPurchaseInvoice(provider, id, comment) {
21918
+ return await this.request('POST', `invoices/${provider}/purchase/acceptReject/${id}`, {
21919
+ data: {
21920
+ accepted: true,
21921
+ comment: comment
21922
+ }
21923
+ });
21924
+ }
21925
+ async request(method, endpoint, params) {
21926
+ return await this.client.request({
21927
+ method: method,
21928
+ url: `/karadjordje/v1/${endpoint}`,
21929
+ ...params
21930
+ });
21931
+ }
21932
+ }
21933
+
21895
21934
  exports.APIUser = APIUser;
21896
21935
  exports.Apps = Apps;
21897
21936
  exports.Component = Component;
@@ -21903,12 +21942,13 @@ exports.Functions = Functions;
21903
21942
  exports.Integration = Integrations;
21904
21943
  exports.Integrations = Integrations;
21905
21944
  exports.Invoicing = Invoicing;
21945
+ exports.NBS = NBS;
21906
21946
  exports.Payments = Payments;
21907
21947
  exports.Platform = Platform;
21908
21948
  exports.Project = Project;
21909
21949
  exports.Ratchet = Ratchet;
21910
21950
  exports.Sandbox = Sandbox;
21911
- exports.SerbiaUtil = SerbiaUtil;
21951
+ exports.SerbiaMinFin = MinFin;
21912
21952
  exports.System = System;
21913
21953
  exports.Thunder = Thunder;
21914
21954
  exports.Users = Users;