@juhuu/sdk-ts 1.2.27 → 1.2.29

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
@@ -708,6 +708,20 @@ declare class ArticlesService extends Service {
708
708
  delete(ArticleDeleteParams: JUHUU.Article.Delete.Params, ArticleDeleteOptions?: JUHUU.Article.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.Delete.Response>>;
709
709
  }
710
710
 
711
+ declare class ChatsService extends Service {
712
+ constructor(config: JUHUU.SetupConfig);
713
+ list(ChatListParams: JUHUU.Chat.List.Params, ChatListOptions?: JUHUU.Chat.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Chat.List.Response>>;
714
+ retrieve(ChatRetrieveParams: JUHUU.Chat.Retrieve.Params, ChatRetrieveOptions?: JUHUU.Chat.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Chat.Retrieve.Response>>;
715
+ update(ChatUpdateParams: JUHUU.Chat.Update.Params, ChatUpdateOptions?: JUHUU.Chat.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Chat.Update.Response>>;
716
+ delete(ChatDeleteParams: JUHUU.Chat.Delete.Params, ChatDeleteOptions?: JUHUU.Chat.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Chat.Delete.Response>>;
717
+ }
718
+
719
+ declare class ChatMessagesService extends Service {
720
+ constructor(config: JUHUU.SetupConfig);
721
+ list(ChatMessageListParams: JUHUU.ChatMessage.List.Params, ChatMessageListOptions?: JUHUU.ChatMessage.List.Options): Promise<JUHUU.HttpResponse<JUHUU.ChatMessage.List.Response>>;
722
+ retrieve(ChatMessageRetrieveParams: JUHUU.ChatMessage.Retrieve.Params, ChatMessageRetrieveOptions?: JUHUU.ChatMessage.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.ChatMessage.Retrieve.Response>>;
723
+ }
724
+
711
725
  declare class Juhuu {
712
726
  constructor(config: JUHUU.SetupConfig);
713
727
  /**
@@ -733,6 +747,8 @@ declare class Juhuu {
733
747
  readonly sims: SimsService;
734
748
  readonly licenseTemplates: LicenseTemplatesService;
735
749
  readonly articles: ArticlesService;
750
+ readonly chats: ChatsService;
751
+ readonly chatMessages: ChatMessagesService;
736
752
  }
737
753
  declare namespace JUHUU {
738
754
  interface SetupConfig {
@@ -1178,7 +1194,6 @@ declare namespace JUHUU {
1178
1194
  title?: LocaleString;
1179
1195
  subtitle?: LocaleString;
1180
1196
  parentArticleId?: string | null;
1181
- slug?: string;
1182
1197
  markdownContent?: LocaleString;
1183
1198
  status?: "draft" | "published";
1184
1199
  };
@@ -1195,6 +1210,97 @@ declare namespace JUHUU {
1195
1210
  type Response = JUHUU.Article.Object[];
1196
1211
  }
1197
1212
  }
1213
+ namespace Chat {
1214
+ type Object = {
1215
+ id: string;
1216
+ readonly object: "chat";
1217
+ title: string | null;
1218
+ userId: string;
1219
+ lastMessageAt: string | null;
1220
+ };
1221
+ namespace Retrieve {
1222
+ type Params = {
1223
+ chatId: string;
1224
+ };
1225
+ type Options = JUHUU.RequestOptions;
1226
+ type Response = {
1227
+ chat: JUHUU.Chat.Object;
1228
+ };
1229
+ }
1230
+ namespace List {
1231
+ type Params = {
1232
+ userId?: string;
1233
+ };
1234
+ type Options = {
1235
+ limit?: number;
1236
+ skip?: number;
1237
+ } & JUHUU.RequestOptions;
1238
+ type Response = {
1239
+ chatArray: JUHUU.Chat.Object[];
1240
+ count: number;
1241
+ hasMore: boolean;
1242
+ };
1243
+ }
1244
+ namespace Update {
1245
+ type Params = {
1246
+ chatId: string;
1247
+ title?: string;
1248
+ };
1249
+ type Options = JUHUU.RequestOptions;
1250
+ type Response = {
1251
+ chat: JUHUU.Chat.Object;
1252
+ };
1253
+ }
1254
+ namespace Delete {
1255
+ type Params = {
1256
+ chatId: string;
1257
+ };
1258
+ type Options = JUHUU.RequestOptions;
1259
+ type Response = JUHUU.Chat.Object[];
1260
+ }
1261
+ }
1262
+ namespace ChatMessage {
1263
+ type Base = {
1264
+ id: string;
1265
+ readonly object: "chatMessage";
1266
+ createdAt: Date;
1267
+ content: string;
1268
+ chatId: string;
1269
+ };
1270
+ export interface UserChatMessage extends Base {
1271
+ type: "user";
1272
+ userId: string;
1273
+ }
1274
+ export interface AiChatMessage extends Base {
1275
+ type: "ai";
1276
+ }
1277
+ export type Object = AiChatMessage | UserChatMessage;
1278
+ export namespace Retrieve {
1279
+ type Params = {
1280
+ chatMessageId: string;
1281
+ };
1282
+ type Options = JUHUU.RequestOptions;
1283
+ type Response = {
1284
+ chatMessage: JUHUU.ChatMessage.Object;
1285
+ };
1286
+ }
1287
+ export namespace List {
1288
+ type Params = {
1289
+ limit?: number;
1290
+ skip?: number;
1291
+ userId?: string;
1292
+ chatId?: string;
1293
+ };
1294
+ type Options = {
1295
+ limit?: number;
1296
+ skip?: number;
1297
+ } & JUHUU.RequestOptions;
1298
+ type Response = {
1299
+ chatMessageArray: JUHUU.ChatMessage.Object[];
1300
+ };
1301
+ }
1302
+ export { };
1303
+ }
1198
1304
  namespace Tariff {
1199
1305
  type Object = {
1200
1306
  id: string;
package/dist/index.d.ts CHANGED
@@ -708,6 +708,20 @@ declare class ArticlesService extends Service {
708
708
  delete(ArticleDeleteParams: JUHUU.Article.Delete.Params, ArticleDeleteOptions?: JUHUU.Article.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Article.Delete.Response>>;
709
709
  }
710
710
 
711
+ declare class ChatsService extends Service {
712
+ constructor(config: JUHUU.SetupConfig);
713
+ list(ChatListParams: JUHUU.Chat.List.Params, ChatListOptions?: JUHUU.Chat.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Chat.List.Response>>;
714
+ retrieve(ChatRetrieveParams: JUHUU.Chat.Retrieve.Params, ChatRetrieveOptions?: JUHUU.Chat.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Chat.Retrieve.Response>>;
715
+ update(ChatUpdateParams: JUHUU.Chat.Update.Params, ChatUpdateOptions?: JUHUU.Chat.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Chat.Update.Response>>;
716
+ delete(ChatDeleteParams: JUHUU.Chat.Delete.Params, ChatDeleteOptions?: JUHUU.Chat.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Chat.Delete.Response>>;
717
+ }
718
+
719
+ declare class ChatMessagesService extends Service {
720
+ constructor(config: JUHUU.SetupConfig);
721
+ list(ChatMessageListParams: JUHUU.ChatMessage.List.Params, ChatMessageListOptions?: JUHUU.ChatMessage.List.Options): Promise<JUHUU.HttpResponse<JUHUU.ChatMessage.List.Response>>;
722
+ retrieve(ChatMessageRetrieveParams: JUHUU.ChatMessage.Retrieve.Params, ChatMessageRetrieveOptions?: JUHUU.ChatMessage.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.ChatMessage.Retrieve.Response>>;
723
+ }
724
+
711
725
  declare class Juhuu {
712
726
  constructor(config: JUHUU.SetupConfig);
713
727
  /**
@@ -733,6 +747,8 @@ declare class Juhuu {
733
747
  readonly sims: SimsService;
734
748
  readonly licenseTemplates: LicenseTemplatesService;
735
749
  readonly articles: ArticlesService;
750
+ readonly chats: ChatsService;
751
+ readonly chatMessages: ChatMessagesService;
736
752
  }
737
753
  declare namespace JUHUU {
738
754
  interface SetupConfig {
@@ -1178,7 +1194,6 @@ declare namespace JUHUU {
1178
1194
  title?: LocaleString;
1179
1195
  subtitle?: LocaleString;
1180
1196
  parentArticleId?: string | null;
1181
- slug?: string;
1182
1197
  markdownContent?: LocaleString;
1183
1198
  status?: "draft" | "published";
1184
1199
  };
@@ -1195,6 +1210,97 @@ declare namespace JUHUU {
1195
1210
  type Response = JUHUU.Article.Object[];
1196
1211
  }
1197
1212
  }
1213
+ namespace Chat {
1214
+ type Object = {
1215
+ id: string;
1216
+ readonly object: "chat";
1217
+ title: string | null;
1218
+ userId: string;
1219
+ lastMessageAt: string | null;
1220
+ };
1221
+ namespace Retrieve {
1222
+ type Params = {
1223
+ chatId: string;
1224
+ };
1225
+ type Options = JUHUU.RequestOptions;
1226
+ type Response = {
1227
+ chat: JUHUU.Chat.Object;
1228
+ };
1229
+ }
1230
+ namespace List {
1231
+ type Params = {
1232
+ userId?: string;
1233
+ };
1234
+ type Options = {
1235
+ limit?: number;
1236
+ skip?: number;
1237
+ } & JUHUU.RequestOptions;
1238
+ type Response = {
1239
+ chatArray: JUHUU.Chat.Object[];
1240
+ count: number;
1241
+ hasMore: boolean;
1242
+ };
1243
+ }
1244
+ namespace Update {
1245
+ type Params = {
1246
+ chatId: string;
1247
+ title?: string;
1248
+ };
1249
+ type Options = JUHUU.RequestOptions;
1250
+ type Response = {
1251
+ chat: JUHUU.Chat.Object;
1252
+ };
1253
+ }
1254
+ namespace Delete {
1255
+ type Params = {
1256
+ chatId: string;
1257
+ };
1258
+ type Options = JUHUU.RequestOptions;
1259
+ type Response = JUHUU.Chat.Object[];
1260
+ }
1261
+ }
1262
+ namespace ChatMessage {
1263
+ type Base = {
1264
+ id: string;
1265
+ readonly object: "chatMessage";
1266
+ createdAt: Date;
1267
+ content: string;
1268
+ chatId: string;
1269
+ };
1270
+ export interface UserChatMessage extends Base {
1271
+ type: "user";
1272
+ userId: string;
1273
+ }
1274
+ export interface AiChatMessage extends Base {
1275
+ type: "ai";
1276
+ }
1277
+ export type Object = AiChatMessage | UserChatMessage;
1278
+ export namespace Retrieve {
1279
+ type Params = {
1280
+ chatMessageId: string;
1281
+ };
1282
+ type Options = JUHUU.RequestOptions;
1283
+ type Response = {
1284
+ chatMessage: JUHUU.ChatMessage.Object;
1285
+ };
1286
+ }
1287
+ export namespace List {
1288
+ type Params = {
1289
+ limit?: number;
1290
+ skip?: number;
1291
+ userId?: string;
1292
+ chatId?: string;
1293
+ };
1294
+ type Options = {
1295
+ limit?: number;
1296
+ skip?: number;
1297
+ } & JUHUU.RequestOptions;
1298
+ type Response = {
1299
+ chatMessageArray: JUHUU.ChatMessage.Object[];
1300
+ };
1301
+ }
1302
+ export { };
1303
+ }
1198
1304
  namespace Tariff {
1199
1305
  type Object = {
1200
1306
  id: string;
package/dist/index.js CHANGED
@@ -1554,7 +1554,6 @@ var ArticlesService = class extends Service {
1554
1554
  title: ArticleUpdateParams.title,
1555
1555
  subtitle: ArticleUpdateParams.subtitle,
1556
1556
  parentArticleId: ArticleUpdateParams.parentArticleId,
1557
- slug: ArticleUpdateParams.slug,
1558
1557
  markdownContent: ArticleUpdateParams.markdownContent,
1559
1558
  status: ArticleUpdateParams.status
1560
1559
  },
@@ -1576,6 +1575,110 @@ var ArticlesService = class extends Service {
1576
1575
  }
1577
1576
  };
1578
1577
 
1578
+ // src/chats/chats.service.ts
1579
+ var ChatsService = class extends Service {
1580
+ constructor(config) {
1581
+ super(config);
1582
+ }
1583
+ async list(ChatListParams, ChatListOptions) {
1584
+ const queryArray = [];
1585
+ if (ChatListOptions?.limit !== void 0) {
1586
+ queryArray.push("limit=" + ChatListOptions.limit);
1587
+ }
1588
+ if (ChatListParams?.userId !== void 0) {
1589
+ queryArray.push("userId=" + ChatListParams.userId);
1590
+ }
1591
+ if (ChatListOptions?.skip !== void 0) {
1592
+ queryArray.push("skip=" + ChatListOptions.skip);
1593
+ }
1594
+ return await super.sendRequest(
1595
+ {
1596
+ method: "GET",
1597
+ url: "chats?" + queryArray.join("&"),
1598
+ body: void 0,
1599
+ useAuthentication: false
1600
+ },
1601
+ ChatListOptions
1602
+ );
1603
+ }
1604
+ async retrieve(ChatRetrieveParams, ChatRetrieveOptions) {
1605
+ const queryArray = [];
1606
+ return await super.sendRequest(
1607
+ {
1608
+ method: "GET",
1609
+ url: "chats/" + ChatRetrieveParams.chatId + "?" + queryArray.join("&"),
1610
+ body: void 0,
1611
+ useAuthentication: false
1612
+ },
1613
+ ChatRetrieveOptions
1614
+ );
1615
+ }
1616
+ async update(ChatUpdateParams, ChatUpdateOptions) {
1617
+ return await super.sendRequest(
1618
+ {
1619
+ method: "PATCH",
1620
+ url: "chats/" + ChatUpdateParams.chatId,
1621
+ body: {
1622
+ title: ChatUpdateParams.title
1623
+ },
1624
+ useAuthentication: true
1625
+ },
1626
+ ChatUpdateOptions
1627
+ );
1628
+ }
1629
+ async delete(ChatDeleteParams, ChatDeleteOptions) {
1630
+ return await super.sendRequest(
1631
+ {
1632
+ method: "DELETE",
1633
+ url: "chats/" + ChatDeleteParams.chatId,
1634
+ useAuthentication: true,
1635
+ body: void 0
1636
+ },
1637
+ ChatDeleteOptions
1638
+ );
1639
+ }
1640
+ };
1641
+
1642
+ // src/chatMessages/chatMessages.service.ts
1643
+ var ChatMessagesService = class extends Service {
1644
+ constructor(config) {
1645
+ super(config);
1646
+ }
1647
+ async list(ChatMessageListParams, ChatMessageListOptions) {
1648
+ const queryArray = [];
1649
+ if (ChatMessageListParams.userId !== void 0) {
1650
+ queryArray.push("userId=" + ChatMessageListParams.userId);
1651
+ }
1652
+ if (ChatMessageListParams.chatId !== void 0) {
1653
+ queryArray.push("chatId=" + ChatMessageListParams.chatId);
1654
+ }
1655
+ if (ChatMessageListParams.limit !== void 0) {
1656
+ queryArray.push("limit=" + ChatMessageListParams.limit);
1657
+ }
1658
+ if (ChatMessageListParams.skip !== void 0) {
1659
+ queryArray.push("skip=" + ChatMessageListParams.skip);
1660
+ }
1661
+ return await super.sendRequest(
1662
+ {
1663
+ method: "GET",
1664
+ url: "chatMessages?" + queryArray.join("&"),
1665
+ body: void 0,
1666
+ useAuthentication: true
1667
+ },
1668
+ ChatMessageListOptions
1669
+ );
1670
+ }
1671
+ async retrieve(ChatMessageRetrieveParams, ChatMessageRetrieveOptions) {
1672
+ const queryArray = [];
1673
+ return await super.sendRequest({
1674
+ method: "GET",
1675
+ url: "chatMessages/" + ChatMessageRetrieveParams.chatMessageId + "?" + queryArray.join("&"),
1676
+ body: void 0,
1677
+ useAuthentication: true
1678
+ });
1679
+ }
1680
+ };
1681
+
1579
1682
  // src/types/types.ts
1580
1683
  var LanguageCodeArray = [
1581
1684
  "en",
@@ -1750,6 +1853,8 @@ var Juhuu = class {
1750
1853
  this.sims = new SimsService(config);
1751
1854
  this.licenseTemplates = new LicenseTemplatesService(config);
1752
1855
  this.articles = new ArticlesService(config);
1856
+ this.chats = new ChatsService(config);
1857
+ this.chatMessages = new ChatMessagesService(config);
1753
1858
  }
1754
1859
  /**
1755
1860
  * Top Level Resources
@@ -1774,6 +1879,8 @@ var Juhuu = class {
1774
1879
  sims;
1775
1880
  licenseTemplates;
1776
1881
  articles;
1882
+ chats;
1883
+ chatMessages;
1777
1884
  };
1778
1885
  var JUHUU;
1779
1886
  ((JUHUU2) => {
package/dist/index.mjs CHANGED
@@ -1509,7 +1509,6 @@ var ArticlesService = class extends Service {
1509
1509
  title: ArticleUpdateParams.title,
1510
1510
  subtitle: ArticleUpdateParams.subtitle,
1511
1511
  parentArticleId: ArticleUpdateParams.parentArticleId,
1512
- slug: ArticleUpdateParams.slug,
1513
1512
  markdownContent: ArticleUpdateParams.markdownContent,
1514
1513
  status: ArticleUpdateParams.status
1515
1514
  },
@@ -1531,6 +1530,110 @@ var ArticlesService = class extends Service {
1531
1530
  }
1532
1531
  };
1533
1532
 
1533
+ // src/chats/chats.service.ts
1534
+ var ChatsService = class extends Service {
1535
+ constructor(config) {
1536
+ super(config);
1537
+ }
1538
+ async list(ChatListParams, ChatListOptions) {
1539
+ const queryArray = [];
1540
+ if (ChatListOptions?.limit !== void 0) {
1541
+ queryArray.push("limit=" + ChatListOptions.limit);
1542
+ }
1543
+ if (ChatListParams?.userId !== void 0) {
1544
+ queryArray.push("userId=" + ChatListParams.userId);
1545
+ }
1546
+ if (ChatListOptions?.skip !== void 0) {
1547
+ queryArray.push("skip=" + ChatListOptions.skip);
1548
+ }
1549
+ return await super.sendRequest(
1550
+ {
1551
+ method: "GET",
1552
+ url: "chats?" + queryArray.join("&"),
1553
+ body: void 0,
1554
+ useAuthentication: false
1555
+ },
1556
+ ChatListOptions
1557
+ );
1558
+ }
1559
+ async retrieve(ChatRetrieveParams, ChatRetrieveOptions) {
1560
+ const queryArray = [];
1561
+ return await super.sendRequest(
1562
+ {
1563
+ method: "GET",
1564
+ url: "chats/" + ChatRetrieveParams.chatId + "?" + queryArray.join("&"),
1565
+ body: void 0,
1566
+ useAuthentication: false
1567
+ },
1568
+ ChatRetrieveOptions
1569
+ );
1570
+ }
1571
+ async update(ChatUpdateParams, ChatUpdateOptions) {
1572
+ return await super.sendRequest(
1573
+ {
1574
+ method: "PATCH",
1575
+ url: "chats/" + ChatUpdateParams.chatId,
1576
+ body: {
1577
+ title: ChatUpdateParams.title
1578
+ },
1579
+ useAuthentication: true
1580
+ },
1581
+ ChatUpdateOptions
1582
+ );
1583
+ }
1584
+ async delete(ChatDeleteParams, ChatDeleteOptions) {
1585
+ return await super.sendRequest(
1586
+ {
1587
+ method: "DELETE",
1588
+ url: "chats/" + ChatDeleteParams.chatId,
1589
+ useAuthentication: true,
1590
+ body: void 0
1591
+ },
1592
+ ChatDeleteOptions
1593
+ );
1594
+ }
1595
+ };
1596
+
1597
+ // src/chatMessages/chatMessages.service.ts
1598
+ var ChatMessagesService = class extends Service {
1599
+ constructor(config) {
1600
+ super(config);
1601
+ }
1602
+ async list(ChatMessageListParams, ChatMessageListOptions) {
1603
+ const queryArray = [];
1604
+ if (ChatMessageListParams.userId !== void 0) {
1605
+ queryArray.push("userId=" + ChatMessageListParams.userId);
1606
+ }
1607
+ if (ChatMessageListParams.chatId !== void 0) {
1608
+ queryArray.push("chatId=" + ChatMessageListParams.chatId);
1609
+ }
1610
+ if (ChatMessageListParams.limit !== void 0) {
1611
+ queryArray.push("limit=" + ChatMessageListParams.limit);
1612
+ }
1613
+ if (ChatMessageListParams.skip !== void 0) {
1614
+ queryArray.push("skip=" + ChatMessageListParams.skip);
1615
+ }
1616
+ return await super.sendRequest(
1617
+ {
1618
+ method: "GET",
1619
+ url: "chatMessages?" + queryArray.join("&"),
1620
+ body: void 0,
1621
+ useAuthentication: true
1622
+ },
1623
+ ChatMessageListOptions
1624
+ );
1625
+ }
1626
+ async retrieve(ChatMessageRetrieveParams, ChatMessageRetrieveOptions) {
1627
+ const queryArray = [];
1628
+ return await super.sendRequest({
1629
+ method: "GET",
1630
+ url: "chatMessages/" + ChatMessageRetrieveParams.chatMessageId + "?" + queryArray.join("&"),
1631
+ body: void 0,
1632
+ useAuthentication: true
1633
+ });
1634
+ }
1635
+ };
1636
+
1534
1637
  // src/types/types.ts
1535
1638
  var LanguageCodeArray = [
1536
1639
  "en",
@@ -1705,6 +1808,8 @@ var Juhuu = class {
1705
1808
  this.sims = new SimsService(config);
1706
1809
  this.licenseTemplates = new LicenseTemplatesService(config);
1707
1810
  this.articles = new ArticlesService(config);
1811
+ this.chats = new ChatsService(config);
1812
+ this.chatMessages = new ChatMessagesService(config);
1708
1813
  }
1709
1814
  /**
1710
1815
  * Top Level Resources
@@ -1729,6 +1834,8 @@ var Juhuu = class {
1729
1834
  sims;
1730
1835
  licenseTemplates;
1731
1836
  articles;
1837
+ chats;
1838
+ chatMessages;
1732
1839
  };
1733
1840
  var JUHUU;
1734
1841
  ((JUHUU2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juhuu/sdk-ts",
3
- "version": "1.2.27",
3
+ "version": "1.2.29",
4
4
  "description": "Typescript wrapper for JUHUU services",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",