@juhuu/sdk-ts 1.2.24 → 1.2.26

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.d.mts CHANGED
@@ -526,10 +526,16 @@ declare class Service {
526
526
  url: string;
527
527
  body: any;
528
528
  useAuthentication: boolean;
529
+ } | {
530
+ method: "DELETE";
531
+ url: string;
532
+ body: undefined;
533
+ useAuthentication: boolean;
529
534
  }, options?: JUHUU.RequestOptions): Promise<JUHUU.HttpResponse<T>>;
530
535
  private sendGetRequest;
531
536
  private sendPostRequest;
532
537
  private sendPatchRequest;
538
+ private sendDeleteRequest;
533
539
  connectToWebsocket<T>({ url }: {
534
540
  url: string;
535
541
  }): Socket;
@@ -552,9 +558,6 @@ declare class LinkService extends Service {
552
558
  create(): Promise<void>;
553
559
  retrieve(LinkRetrieveParams: JUHUU.Link.Retrieve.Params, LinkRetrieveOptions?: JUHUU.Link.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Link.Retrieve.Response>>;
554
560
  list(LinkListParams: JUHUU.Link.List.Params, LinkListOptions?: JUHUU.Link.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Link.List.Response>>;
555
- update(): Promise<void>;
556
- delete(): Promise<void>;
557
- terminate(): Promise<void>;
558
561
  }
559
562
 
560
563
  declare class UsersService extends Service {
@@ -576,8 +579,6 @@ declare class PaymentsService extends Service {
576
579
  list(PaymentListParams: JUHUU.Payment.List.Params, PaymentListOptions?: JUHUU.Payment.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Payment.List.Response>>;
577
580
  retrieve(PaymentRetrieveParams: JUHUU.Payment.Retrieve.Params, PaymentRetrieveOptions?: JUHUU.Payment.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Payment.Retrieve.Response>>;
578
581
  tokens(PaymentTokensParams: JUHUU.Payment.Tokens.Params, PaymentTokensOptions?: JUHUU.Payment.Tokens.Options): Promise<JUHUU.HttpResponse<JUHUU.Payment.Tokens.Response>>;
579
- update(): Promise<void>;
580
- delete(): Promise<void>;
581
582
  retrieveInvoiceUrl(PaymentRetrieveInvoiceUrlParams: JUHUU.Payment.RetrieveInvoiceUrl.Params, PaymentRetrieveInvoiceUrlOptions?: JUHUU.Payment.RetrieveInvoiceUrl.Options): Promise<JUHUU.HttpResponse<JUHUU.Payment.RetrieveInvoiceUrl.Response>>;
582
583
  }
583
584
 
@@ -588,8 +589,6 @@ declare class PropertiesService extends Service {
588
589
  list(PropertyListParams: JUHUU.Property.List.Params, PropertyListOptions?: JUHUU.Property.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Property.List.Response>>;
589
590
  update(PropertyUpdateParams: JUHUU.Property.Update.Params, PropertyUpdateOptions?: JUHUU.Property.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Property.Update.Response>>;
590
591
  stripeAccountUrl(PropertyStripeAccountUrlParams: JUHUU.Property.StripeAccountUrl.Params, PropertyStripeAccountUrlOptions?: JUHUU.Property.StripeAccountUrl.Options): Promise<JUHUU.HttpResponse<JUHUU.Property.StripeAccountUrl.Response>>;
591
- delete(): Promise<void>;
592
- terminate(): Promise<void>;
593
592
  }
594
593
 
595
594
  declare class PointsService extends Service {
@@ -634,7 +633,6 @@ declare class TermsService extends Service {
634
633
 
635
634
  declare class TariffsService extends Service {
636
635
  constructor(config: JUHUU.SetupConfig);
637
- create(): Promise<void>;
638
636
  retrieve(TariffRetrieveParams: JUHUU.Tariff.Retrieve.Params, TariffRetrieveOptions?: JUHUU.Tariff.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Tariff.Retrieve.Response>>;
639
637
  list(TariffListParams: JUHUU.Tariff.List.Params, TariffListOptions?: JUHUU.Tariff.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Tariff.List.Response>>;
640
638
  update(TariffUpdateParams: JUHUU.Tariff.Update.Params, TariffUpdateOptions?: JUHUU.Tariff.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Tariff.Update.Response>>;
@@ -702,6 +700,14 @@ declare class LicenseTemplatesService extends Service {
702
700
  retrieve(LicenseTemplateRetrieveParams: JUHUU.LicenseTemplate.Retrieve.Params, LicenseTemplateRetrieveOptions?: JUHUU.LicenseTemplate.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.LicenseTemplate.Retrieve.Response>>;
703
701
  }
704
702
 
703
+ declare class ArticlesService extends Service {
704
+ constructor(config: JUHUU.SetupConfig);
705
+ list(ArticleListParams: JUHUU.Article.List.Params, ArticleListOptions?: JUHUU.Article.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.List.Response>>;
706
+ retrieve(ArticleRetrieveParams: JUHUU.Article.Retrieve.Params, ArticleRetrieveOptions?: JUHUU.Article.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.Retrieve.Response>>;
707
+ update(ArticleUpdateParams: JUHUU.Article.Update.Params, ArticleUpdateOptions?: JUHUU.Article.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.Update.Response>>;
708
+ delete(ArticleDeleteParams: JUHUU.Article.Delete.Params, ArticleDeleteOptions?: JUHUU.Article.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.Delete.Response>>;
709
+ }
710
+
705
711
  declare class Juhuu {
706
712
  constructor(config: JUHUU.SetupConfig);
707
713
  /**
@@ -726,6 +732,7 @@ declare class Juhuu {
726
732
  readonly connectorMessages: ConnectorMessagesService;
727
733
  readonly sims: SimsService;
728
734
  readonly licenseTemplates: LicenseTemplatesService;
735
+ readonly articles: ArticlesService;
729
736
  }
730
737
  declare namespace JUHUU {
731
738
  interface SetupConfig {
@@ -1125,6 +1132,69 @@ declare namespace JUHUU {
1125
1132
  type Response = JUHUU.AccountingArea.Object[];
1126
1133
  }
1127
1134
  }
1135
+ namespace Article {
1136
+ type Object = {
1137
+ id: string;
1138
+ readonly object: "article";
1139
+ title: LocaleString;
1140
+ subtitle: LocaleString;
1141
+ propertyId: string | null;
1142
+ parentArticleId: string | null;
1143
+ slug: string;
1144
+ markdownContent: LocaleString;
1145
+ status: "draft" | "published";
1146
+ };
1147
+ namespace Retrieve {
1148
+ type Params = {
1149
+ articleId: string;
1150
+ };
1151
+ type Options = {
1152
+ expand?: Array<"property">;
1153
+ } & JUHUU.RequestOptions;
1154
+ type Response = {
1155
+ article: JUHUU.Article.Object;
1156
+ property?: JUHUU.Property.Object;
1157
+ };
1158
+ }
1159
+ namespace List {
1160
+ type Params = {
1161
+ propertyId?: string;
1162
+ parentArticleId?: string | null;
1163
+ statusArray?: JUHUU.Article.Object["status"][];
1164
+ };
1165
+ type Options = {
1166
+ limit?: number;
1167
+ skip?: number;
1168
+ } & JUHUU.RequestOptions;
1169
+ type Response = {
1170
+ articleArray: JUHUU.Article.Object[];
1171
+ count: number;
1172
+ hasMore: boolean;
1173
+ };
1174
+ }
1175
+ namespace Update {
1176
+ type Params = {
1177
+ articleId: string;
1178
+ title: LocaleString;
1179
+ subtitle: LocaleString;
1180
+ parentArticleId: string | null;
1181
+ slug: string;
1182
+ markdownContent: LocaleString;
1183
+ status: "draft" | "published";
1184
+ };
1185
+ type Options = JUHUU.RequestOptions;
1186
+ type Response = {
1187
+ article: JUHUU.Article.Object;
1188
+ };
1189
+ }
1190
+ namespace Delete {
1191
+ type Params = {
1192
+ articleId?: string;
1193
+ };
1194
+ type Options = JUHUU.RequestOptions;
1195
+ type Response = JUHUU.Article.Object[];
1196
+ }
1197
+ }
1128
1198
  namespace Tariff {
1129
1199
  type Object = {
1130
1200
  id: string;
package/dist/index.d.ts CHANGED
@@ -526,10 +526,16 @@ declare class Service {
526
526
  url: string;
527
527
  body: any;
528
528
  useAuthentication: boolean;
529
+ } | {
530
+ method: "DELETE";
531
+ url: string;
532
+ body: undefined;
533
+ useAuthentication: boolean;
529
534
  }, options?: JUHUU.RequestOptions): Promise<JUHUU.HttpResponse<T>>;
530
535
  private sendGetRequest;
531
536
  private sendPostRequest;
532
537
  private sendPatchRequest;
538
+ private sendDeleteRequest;
533
539
  connectToWebsocket<T>({ url }: {
534
540
  url: string;
535
541
  }): Socket;
@@ -552,9 +558,6 @@ declare class LinkService extends Service {
552
558
  create(): Promise<void>;
553
559
  retrieve(LinkRetrieveParams: JUHUU.Link.Retrieve.Params, LinkRetrieveOptions?: JUHUU.Link.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Link.Retrieve.Response>>;
554
560
  list(LinkListParams: JUHUU.Link.List.Params, LinkListOptions?: JUHUU.Link.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Link.List.Response>>;
555
- update(): Promise<void>;
556
- delete(): Promise<void>;
557
- terminate(): Promise<void>;
558
561
  }
559
562
 
560
563
  declare class UsersService extends Service {
@@ -576,8 +579,6 @@ declare class PaymentsService extends Service {
576
579
  list(PaymentListParams: JUHUU.Payment.List.Params, PaymentListOptions?: JUHUU.Payment.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Payment.List.Response>>;
577
580
  retrieve(PaymentRetrieveParams: JUHUU.Payment.Retrieve.Params, PaymentRetrieveOptions?: JUHUU.Payment.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Payment.Retrieve.Response>>;
578
581
  tokens(PaymentTokensParams: JUHUU.Payment.Tokens.Params, PaymentTokensOptions?: JUHUU.Payment.Tokens.Options): Promise<JUHUU.HttpResponse<JUHUU.Payment.Tokens.Response>>;
579
- update(): Promise<void>;
580
- delete(): Promise<void>;
581
582
  retrieveInvoiceUrl(PaymentRetrieveInvoiceUrlParams: JUHUU.Payment.RetrieveInvoiceUrl.Params, PaymentRetrieveInvoiceUrlOptions?: JUHUU.Payment.RetrieveInvoiceUrl.Options): Promise<JUHUU.HttpResponse<JUHUU.Payment.RetrieveInvoiceUrl.Response>>;
582
583
  }
583
584
 
@@ -588,8 +589,6 @@ declare class PropertiesService extends Service {
588
589
  list(PropertyListParams: JUHUU.Property.List.Params, PropertyListOptions?: JUHUU.Property.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Property.List.Response>>;
589
590
  update(PropertyUpdateParams: JUHUU.Property.Update.Params, PropertyUpdateOptions?: JUHUU.Property.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Property.Update.Response>>;
590
591
  stripeAccountUrl(PropertyStripeAccountUrlParams: JUHUU.Property.StripeAccountUrl.Params, PropertyStripeAccountUrlOptions?: JUHUU.Property.StripeAccountUrl.Options): Promise<JUHUU.HttpResponse<JUHUU.Property.StripeAccountUrl.Response>>;
591
- delete(): Promise<void>;
592
- terminate(): Promise<void>;
593
592
  }
594
593
 
595
594
  declare class PointsService extends Service {
@@ -634,7 +633,6 @@ declare class TermsService extends Service {
634
633
 
635
634
  declare class TariffsService extends Service {
636
635
  constructor(config: JUHUU.SetupConfig);
637
- create(): Promise<void>;
638
636
  retrieve(TariffRetrieveParams: JUHUU.Tariff.Retrieve.Params, TariffRetrieveOptions?: JUHUU.Tariff.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Tariff.Retrieve.Response>>;
639
637
  list(TariffListParams: JUHUU.Tariff.List.Params, TariffListOptions?: JUHUU.Tariff.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Tariff.List.Response>>;
640
638
  update(TariffUpdateParams: JUHUU.Tariff.Update.Params, TariffUpdateOptions?: JUHUU.Tariff.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Tariff.Update.Response>>;
@@ -702,6 +700,14 @@ declare class LicenseTemplatesService extends Service {
702
700
  retrieve(LicenseTemplateRetrieveParams: JUHUU.LicenseTemplate.Retrieve.Params, LicenseTemplateRetrieveOptions?: JUHUU.LicenseTemplate.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.LicenseTemplate.Retrieve.Response>>;
703
701
  }
704
702
 
703
+ declare class ArticlesService extends Service {
704
+ constructor(config: JUHUU.SetupConfig);
705
+ list(ArticleListParams: JUHUU.Article.List.Params, ArticleListOptions?: JUHUU.Article.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.List.Response>>;
706
+ retrieve(ArticleRetrieveParams: JUHUU.Article.Retrieve.Params, ArticleRetrieveOptions?: JUHUU.Article.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.Retrieve.Response>>;
707
+ update(ArticleUpdateParams: JUHUU.Article.Update.Params, ArticleUpdateOptions?: JUHUU.Article.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.Update.Response>>;
708
+ delete(ArticleDeleteParams: JUHUU.Article.Delete.Params, ArticleDeleteOptions?: JUHUU.Article.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.Delete.Response>>;
709
+ }
710
+
705
711
  declare class Juhuu {
706
712
  constructor(config: JUHUU.SetupConfig);
707
713
  /**
@@ -726,6 +732,7 @@ declare class Juhuu {
726
732
  readonly connectorMessages: ConnectorMessagesService;
727
733
  readonly sims: SimsService;
728
734
  readonly licenseTemplates: LicenseTemplatesService;
735
+ readonly articles: ArticlesService;
729
736
  }
730
737
  declare namespace JUHUU {
731
738
  interface SetupConfig {
@@ -1125,6 +1132,69 @@ declare namespace JUHUU {
1125
1132
  type Response = JUHUU.AccountingArea.Object[];
1126
1133
  }
1127
1134
  }
1135
+ namespace Article {
1136
+ type Object = {
1137
+ id: string;
1138
+ readonly object: "article";
1139
+ title: LocaleString;
1140
+ subtitle: LocaleString;
1141
+ propertyId: string | null;
1142
+ parentArticleId: string | null;
1143
+ slug: string;
1144
+ markdownContent: LocaleString;
1145
+ status: "draft" | "published";
1146
+ };
1147
+ namespace Retrieve {
1148
+ type Params = {
1149
+ articleId: string;
1150
+ };
1151
+ type Options = {
1152
+ expand?: Array<"property">;
1153
+ } & JUHUU.RequestOptions;
1154
+ type Response = {
1155
+ article: JUHUU.Article.Object;
1156
+ property?: JUHUU.Property.Object;
1157
+ };
1158
+ }
1159
+ namespace List {
1160
+ type Params = {
1161
+ propertyId?: string;
1162
+ parentArticleId?: string | null;
1163
+ statusArray?: JUHUU.Article.Object["status"][];
1164
+ };
1165
+ type Options = {
1166
+ limit?: number;
1167
+ skip?: number;
1168
+ } & JUHUU.RequestOptions;
1169
+ type Response = {
1170
+ articleArray: JUHUU.Article.Object[];
1171
+ count: number;
1172
+ hasMore: boolean;
1173
+ };
1174
+ }
1175
+ namespace Update {
1176
+ type Params = {
1177
+ articleId: string;
1178
+ title: LocaleString;
1179
+ subtitle: LocaleString;
1180
+ parentArticleId: string | null;
1181
+ slug: string;
1182
+ markdownContent: LocaleString;
1183
+ status: "draft" | "published";
1184
+ };
1185
+ type Options = JUHUU.RequestOptions;
1186
+ type Response = {
1187
+ article: JUHUU.Article.Object;
1188
+ };
1189
+ }
1190
+ namespace Delete {
1191
+ type Params = {
1192
+ articleId?: string;
1193
+ };
1194
+ type Options = JUHUU.RequestOptions;
1195
+ type Response = JUHUU.Article.Object[];
1196
+ }
1197
+ }
1128
1198
  namespace Tariff {
1129
1199
  type Object = {
1130
1200
  id: string;
package/dist/index.js CHANGED
@@ -122,6 +122,10 @@ var Service = class {
122
122
  response = await this.sendPatchRequest(token, uri, body);
123
123
  break;
124
124
  }
125
+ case "DELETE": {
126
+ response = await this.sendDeleteRequest(token, uri);
127
+ break;
128
+ }
125
129
  }
126
130
  if (response.ok === false) {
127
131
  throw new Error(response.statusText);
@@ -244,6 +248,19 @@ var Service = class {
244
248
  body: JSON.stringify(body)
245
249
  });
246
250
  }
251
+ async sendDeleteRequest(token, uri) {
252
+ const headers = {
253
+ "Content-Type": "application/json",
254
+ "Client-Version": this.clientVersion
255
+ };
256
+ if (token !== void 0 && token !== null) {
257
+ headers.Authorization = `Bearer ${token}`;
258
+ }
259
+ return await fetch(uri, {
260
+ method: "DELETE",
261
+ headers
262
+ });
263
+ }
247
264
  connectToWebsocket({ url }) {
248
265
  const uri = this.wssBaseUrl + url;
249
266
  console.log("connecting to websocket", uri);
@@ -421,12 +438,6 @@ var LinkService = class extends Service {
421
438
  LinkListOptions
422
439
  );
423
440
  }
424
- async update() {
425
- }
426
- async delete() {
427
- }
428
- async terminate() {
429
- }
430
441
  };
431
442
 
432
443
  // src/users/users.service.ts
@@ -638,10 +649,6 @@ var PaymentsService = class extends Service {
638
649
  PaymentTokensOptions
639
650
  );
640
651
  }
641
- async update() {
642
- }
643
- async delete() {
644
- }
645
652
  async retrieveInvoiceUrl(PaymentRetrieveInvoiceUrlParams, PaymentRetrieveInvoiceUrlOptions) {
646
653
  const queryArray = [];
647
654
  return await super.sendRequest({
@@ -724,10 +731,6 @@ var PropertiesService = class extends Service {
724
731
  PropertyStripeAccountUrlOptions
725
732
  );
726
733
  }
727
- async delete() {
728
- }
729
- async terminate() {
730
- }
731
734
  };
732
735
 
733
736
  // src/points/points.service.ts
@@ -1067,8 +1070,6 @@ var TariffsService = class extends Service {
1067
1070
  constructor(config) {
1068
1071
  super(config);
1069
1072
  }
1070
- async create() {
1071
- }
1072
1073
  async retrieve(TariffRetrieveParams, TariffRetrieveOptions) {
1073
1074
  const queryArray = [];
1074
1075
  if (TariffRetrieveOptions?.expand !== void 0) {
@@ -1497,6 +1498,84 @@ var LicenseTemplatesService = class extends Service {
1497
1498
  }
1498
1499
  };
1499
1500
 
1501
+ // src/articles/articles.service.ts
1502
+ var ArticlesService = class extends Service {
1503
+ constructor(config) {
1504
+ super(config);
1505
+ }
1506
+ async list(ArticleListParams, ArticleListOptions) {
1507
+ const queryArray = [];
1508
+ if (ArticleListOptions?.limit !== void 0) {
1509
+ queryArray.push("limit=" + ArticleListOptions.limit);
1510
+ }
1511
+ if (ArticleListParams?.propertyId !== void 0) {
1512
+ queryArray.push("propertyId=" + ArticleListParams.propertyId);
1513
+ }
1514
+ if (ArticleListParams?.statusArray !== void 0) {
1515
+ queryArray.push("statusArray=" + ArticleListParams.statusArray.join(","));
1516
+ }
1517
+ if (ArticleListOptions?.skip !== void 0) {
1518
+ queryArray.push("skip=" + ArticleListOptions.skip);
1519
+ }
1520
+ if (ArticleListParams?.parentArticleId !== void 0) {
1521
+ queryArray.push("parentArticleId=" + ArticleListParams.parentArticleId);
1522
+ }
1523
+ return await super.sendRequest(
1524
+ {
1525
+ method: "GET",
1526
+ url: "articles?" + queryArray.join("&"),
1527
+ body: void 0,
1528
+ useAuthentication: false
1529
+ },
1530
+ ArticleListOptions
1531
+ );
1532
+ }
1533
+ async retrieve(ArticleRetrieveParams, ArticleRetrieveOptions) {
1534
+ const queryArray = [];
1535
+ if (ArticleRetrieveOptions?.expand !== void 0) {
1536
+ queryArray.push("expand=" + ArticleRetrieveOptions.expand.join(","));
1537
+ }
1538
+ return await super.sendRequest(
1539
+ {
1540
+ method: "GET",
1541
+ url: "articles/" + ArticleRetrieveParams.articleId + "?" + queryArray.join("&"),
1542
+ body: void 0,
1543
+ useAuthentication: false
1544
+ },
1545
+ ArticleRetrieveOptions
1546
+ );
1547
+ }
1548
+ async update(ArticleUpdateParams, ArticleUpdateOptions) {
1549
+ return await super.sendRequest(
1550
+ {
1551
+ method: "PATCH",
1552
+ url: "articles/" + ArticleUpdateParams.articleId,
1553
+ body: {
1554
+ title: ArticleUpdateParams.title,
1555
+ subtitle: ArticleUpdateParams.subtitle,
1556
+ parentArticleId: ArticleUpdateParams.parentArticleId,
1557
+ slug: ArticleUpdateParams.slug,
1558
+ markdownContent: ArticleUpdateParams.markdownContent,
1559
+ status: ArticleUpdateParams.status
1560
+ },
1561
+ useAuthentication: true
1562
+ },
1563
+ ArticleUpdateOptions
1564
+ );
1565
+ }
1566
+ async delete(ArticleDeleteParams, ArticleDeleteOptions) {
1567
+ return await super.sendRequest(
1568
+ {
1569
+ method: "DELETE",
1570
+ url: "articles/" + ArticleDeleteParams.articleId,
1571
+ useAuthentication: true,
1572
+ body: void 0
1573
+ },
1574
+ ArticleDeleteOptions
1575
+ );
1576
+ }
1577
+ };
1578
+
1500
1579
  // src/types/types.ts
1501
1580
  var LanguageCodeArray = [
1502
1581
  "en",
@@ -1670,6 +1749,7 @@ var Juhuu = class {
1670
1749
  this.connectorMessages = new ConnectorMessagesService(config);
1671
1750
  this.sims = new SimsService(config);
1672
1751
  this.licenseTemplates = new LicenseTemplatesService(config);
1752
+ this.articles = new ArticlesService(config);
1673
1753
  }
1674
1754
  /**
1675
1755
  * Top Level Resources
@@ -1693,6 +1773,7 @@ var Juhuu = class {
1693
1773
  connectorMessages;
1694
1774
  sims;
1695
1775
  licenseTemplates;
1776
+ articles;
1696
1777
  };
1697
1778
  var JUHUU;
1698
1779
  ((JUHUU2) => {
package/dist/index.mjs CHANGED
@@ -77,6 +77,10 @@ var Service = class {
77
77
  response = await this.sendPatchRequest(token, uri, body);
78
78
  break;
79
79
  }
80
+ case "DELETE": {
81
+ response = await this.sendDeleteRequest(token, uri);
82
+ break;
83
+ }
80
84
  }
81
85
  if (response.ok === false) {
82
86
  throw new Error(response.statusText);
@@ -199,6 +203,19 @@ var Service = class {
199
203
  body: JSON.stringify(body)
200
204
  });
201
205
  }
206
+ async sendDeleteRequest(token, uri) {
207
+ const headers = {
208
+ "Content-Type": "application/json",
209
+ "Client-Version": this.clientVersion
210
+ };
211
+ if (token !== void 0 && token !== null) {
212
+ headers.Authorization = `Bearer ${token}`;
213
+ }
214
+ return await fetch(uri, {
215
+ method: "DELETE",
216
+ headers
217
+ });
218
+ }
202
219
  connectToWebsocket({ url }) {
203
220
  const uri = this.wssBaseUrl + url;
204
221
  console.log("connecting to websocket", uri);
@@ -376,12 +393,6 @@ var LinkService = class extends Service {
376
393
  LinkListOptions
377
394
  );
378
395
  }
379
- async update() {
380
- }
381
- async delete() {
382
- }
383
- async terminate() {
384
- }
385
396
  };
386
397
 
387
398
  // src/users/users.service.ts
@@ -593,10 +604,6 @@ var PaymentsService = class extends Service {
593
604
  PaymentTokensOptions
594
605
  );
595
606
  }
596
- async update() {
597
- }
598
- async delete() {
599
- }
600
607
  async retrieveInvoiceUrl(PaymentRetrieveInvoiceUrlParams, PaymentRetrieveInvoiceUrlOptions) {
601
608
  const queryArray = [];
602
609
  return await super.sendRequest({
@@ -679,10 +686,6 @@ var PropertiesService = class extends Service {
679
686
  PropertyStripeAccountUrlOptions
680
687
  );
681
688
  }
682
- async delete() {
683
- }
684
- async terminate() {
685
- }
686
689
  };
687
690
 
688
691
  // src/points/points.service.ts
@@ -1022,8 +1025,6 @@ var TariffsService = class extends Service {
1022
1025
  constructor(config) {
1023
1026
  super(config);
1024
1027
  }
1025
- async create() {
1026
- }
1027
1028
  async retrieve(TariffRetrieveParams, TariffRetrieveOptions) {
1028
1029
  const queryArray = [];
1029
1030
  if (TariffRetrieveOptions?.expand !== void 0) {
@@ -1452,6 +1453,84 @@ var LicenseTemplatesService = class extends Service {
1452
1453
  }
1453
1454
  };
1454
1455
 
1456
+ // src/articles/articles.service.ts
1457
+ var ArticlesService = class extends Service {
1458
+ constructor(config) {
1459
+ super(config);
1460
+ }
1461
+ async list(ArticleListParams, ArticleListOptions) {
1462
+ const queryArray = [];
1463
+ if (ArticleListOptions?.limit !== void 0) {
1464
+ queryArray.push("limit=" + ArticleListOptions.limit);
1465
+ }
1466
+ if (ArticleListParams?.propertyId !== void 0) {
1467
+ queryArray.push("propertyId=" + ArticleListParams.propertyId);
1468
+ }
1469
+ if (ArticleListParams?.statusArray !== void 0) {
1470
+ queryArray.push("statusArray=" + ArticleListParams.statusArray.join(","));
1471
+ }
1472
+ if (ArticleListOptions?.skip !== void 0) {
1473
+ queryArray.push("skip=" + ArticleListOptions.skip);
1474
+ }
1475
+ if (ArticleListParams?.parentArticleId !== void 0) {
1476
+ queryArray.push("parentArticleId=" + ArticleListParams.parentArticleId);
1477
+ }
1478
+ return await super.sendRequest(
1479
+ {
1480
+ method: "GET",
1481
+ url: "articles?" + queryArray.join("&"),
1482
+ body: void 0,
1483
+ useAuthentication: false
1484
+ },
1485
+ ArticleListOptions
1486
+ );
1487
+ }
1488
+ async retrieve(ArticleRetrieveParams, ArticleRetrieveOptions) {
1489
+ const queryArray = [];
1490
+ if (ArticleRetrieveOptions?.expand !== void 0) {
1491
+ queryArray.push("expand=" + ArticleRetrieveOptions.expand.join(","));
1492
+ }
1493
+ return await super.sendRequest(
1494
+ {
1495
+ method: "GET",
1496
+ url: "articles/" + ArticleRetrieveParams.articleId + "?" + queryArray.join("&"),
1497
+ body: void 0,
1498
+ useAuthentication: false
1499
+ },
1500
+ ArticleRetrieveOptions
1501
+ );
1502
+ }
1503
+ async update(ArticleUpdateParams, ArticleUpdateOptions) {
1504
+ return await super.sendRequest(
1505
+ {
1506
+ method: "PATCH",
1507
+ url: "articles/" + ArticleUpdateParams.articleId,
1508
+ body: {
1509
+ title: ArticleUpdateParams.title,
1510
+ subtitle: ArticleUpdateParams.subtitle,
1511
+ parentArticleId: ArticleUpdateParams.parentArticleId,
1512
+ slug: ArticleUpdateParams.slug,
1513
+ markdownContent: ArticleUpdateParams.markdownContent,
1514
+ status: ArticleUpdateParams.status
1515
+ },
1516
+ useAuthentication: true
1517
+ },
1518
+ ArticleUpdateOptions
1519
+ );
1520
+ }
1521
+ async delete(ArticleDeleteParams, ArticleDeleteOptions) {
1522
+ return await super.sendRequest(
1523
+ {
1524
+ method: "DELETE",
1525
+ url: "articles/" + ArticleDeleteParams.articleId,
1526
+ useAuthentication: true,
1527
+ body: void 0
1528
+ },
1529
+ ArticleDeleteOptions
1530
+ );
1531
+ }
1532
+ };
1533
+
1455
1534
  // src/types/types.ts
1456
1535
  var LanguageCodeArray = [
1457
1536
  "en",
@@ -1625,6 +1704,7 @@ var Juhuu = class {
1625
1704
  this.connectorMessages = new ConnectorMessagesService(config);
1626
1705
  this.sims = new SimsService(config);
1627
1706
  this.licenseTemplates = new LicenseTemplatesService(config);
1707
+ this.articles = new ArticlesService(config);
1628
1708
  }
1629
1709
  /**
1630
1710
  * Top Level Resources
@@ -1648,6 +1728,7 @@ var Juhuu = class {
1648
1728
  connectorMessages;
1649
1729
  sims;
1650
1730
  licenseTemplates;
1731
+ articles;
1651
1732
  };
1652
1733
  var JUHUU;
1653
1734
  ((JUHUU2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juhuu/sdk-ts",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "Typescript wrapper for JUHUU services",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",