@gyldendalas/gyldendal-divine-api 0.3.0 → 0.3.3
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 +332 -208
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -35
- package/dist/index.d.ts +35 -35
- package/dist/index.js +332 -208
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ declare class BaseService {
|
|
|
5
5
|
environment: string;
|
|
6
6
|
myAccountId: string;
|
|
7
7
|
baseDomain: string;
|
|
8
|
-
constructor({ bearerToken, apiKey, serviceUrl, environment, myAccountId, baseDomain
|
|
8
|
+
constructor({ bearerToken, apiKey, serviceUrl, environment, myAccountId, baseDomain }: {
|
|
9
9
|
bearerToken?: string;
|
|
10
10
|
apiKey?: string;
|
|
11
11
|
serviceUrl?: string;
|
|
@@ -636,20 +636,20 @@ interface FolderContent extends FolderObject {
|
|
|
636
636
|
* UserFolders is a service that allows users to create folders in their account. It's built on top of the Tagging service.
|
|
637
637
|
* Folders are created with a name and an optional parent folder. If no parent folder is provided, the folder is created at the root level.
|
|
638
638
|
* Folders are created with a unique UUID that can be used to reference the folder in future requests. The folder properties are stored as a base64 encoded JSON string.
|
|
639
|
-
**/
|
|
639
|
+
**/
|
|
640
640
|
declare class UserFolders extends TaggingService {
|
|
641
641
|
private readonly hasNoParent;
|
|
642
642
|
private identity?;
|
|
643
643
|
getIdentity(): Promise<string>;
|
|
644
644
|
/**
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
645
|
+
* Create a folder.
|
|
646
|
+
* @param folder_name The name of the folder.
|
|
647
|
+
* @param parent_folder_uuid The UUID of the parent folder. If no parent folder is provided, the folder is created at the root level.
|
|
648
|
+
* @param color The color of the folder.
|
|
649
|
+
* @param timeout The timeout for the request in milliseconds.
|
|
650
|
+
*
|
|
651
|
+
* @return Folder
|
|
652
|
+
**/
|
|
653
653
|
createFolder({ folder_name, parent_folder_uuid, color, timeout }: {
|
|
654
654
|
folder_name: string;
|
|
655
655
|
color: string;
|
|
@@ -657,15 +657,15 @@ declare class UserFolders extends TaggingService {
|
|
|
657
657
|
timeout?: number;
|
|
658
658
|
}): Promise<Folder>;
|
|
659
659
|
/**
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
660
|
+
* Update a folder. Only name and color can be changed.
|
|
661
|
+
*
|
|
662
|
+
* @param folder_uuid The UUID of the folder.
|
|
663
|
+
* @param folder_name The new name of the folder.
|
|
664
|
+
* @param color The new color of the folder.
|
|
665
|
+
* @param timeout The timeout for the request in milliseconds.
|
|
666
|
+
*
|
|
667
|
+
* @return Folder
|
|
668
|
+
**/
|
|
669
669
|
updateFolder({ folder_uuid, folder_name, color, timeout }: {
|
|
670
670
|
folder_uuid: string;
|
|
671
671
|
folder_name?: string;
|
|
@@ -673,12 +673,12 @@ declare class UserFolders extends TaggingService {
|
|
|
673
673
|
timeout?: number;
|
|
674
674
|
}): Promise<Folder>;
|
|
675
675
|
/**
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
676
|
+
* List all folders in the user's account.
|
|
677
|
+
*
|
|
678
|
+
* @param timeout The timeout for the request in milliseconds.
|
|
679
|
+
*
|
|
680
|
+
* @return Folder[]
|
|
681
|
+
**/
|
|
682
682
|
listAllFolders({ timeout }: {
|
|
683
683
|
timeout?: number;
|
|
684
684
|
}): Promise<Folder[]>;
|
|
@@ -689,7 +689,7 @@ declare class UserFolders extends TaggingService {
|
|
|
689
689
|
* @param timeout The timeout for the request in milliseconds.
|
|
690
690
|
*
|
|
691
691
|
* @return Folder[]
|
|
692
|
-
|
|
692
|
+
**/
|
|
693
693
|
listNextFolderLevel({ parent_folder_uuid, timeout }: {
|
|
694
694
|
parent_folder_uuid?: string;
|
|
695
695
|
timeout?: number;
|
|
@@ -700,8 +700,8 @@ declare class UserFolders extends TaggingService {
|
|
|
700
700
|
* @param folder_uuid The UUID of the folder.
|
|
701
701
|
* @param timeout The timeout for the request in milliseconds.
|
|
702
702
|
*
|
|
703
|
-
|
|
704
|
-
|
|
703
|
+
* @return (Folder | FolderContent)[]
|
|
704
|
+
**/
|
|
705
705
|
getFolderContent({ folder_uuid, timeout }: {
|
|
706
706
|
folder_uuid: string;
|
|
707
707
|
timeout?: number;
|
|
@@ -714,7 +714,7 @@ declare class UserFolders extends TaggingService {
|
|
|
714
714
|
* @param timeout The timeout for the request in milliseconds.
|
|
715
715
|
*
|
|
716
716
|
* @return FolderContent
|
|
717
|
-
|
|
717
|
+
**/
|
|
718
718
|
addInternetbookToFolder({ folder_uuid, isbn, timeout }: {
|
|
719
719
|
folder_uuid: string;
|
|
720
720
|
isbn: string;
|
|
@@ -728,7 +728,7 @@ declare class UserFolders extends TaggingService {
|
|
|
728
728
|
* @param timeout The timeout for the request in milliseconds.
|
|
729
729
|
*
|
|
730
730
|
* @return void
|
|
731
|
-
|
|
731
|
+
**/
|
|
732
732
|
removeInternetbookFromFolder({ folder_uuid, isbn, timeout }: {
|
|
733
733
|
folder_uuid: string;
|
|
734
734
|
isbn: string;
|
|
@@ -743,7 +743,7 @@ declare class UserFolders extends TaggingService {
|
|
|
743
743
|
* @param timeout The timeout for the request in milliseconds.
|
|
744
744
|
*
|
|
745
745
|
* @return FolderContent
|
|
746
|
-
|
|
746
|
+
**/
|
|
747
747
|
addContentToFolder({ folder_uuid, resource_type, resource_name, timeout }: {
|
|
748
748
|
folder_uuid: string;
|
|
749
749
|
resource_name: string;
|
|
@@ -759,7 +759,7 @@ declare class UserFolders extends TaggingService {
|
|
|
759
759
|
* @param timeout The timeout for the request in milliseconds.
|
|
760
760
|
*
|
|
761
761
|
* @return void
|
|
762
|
-
|
|
762
|
+
**/
|
|
763
763
|
removeContentFromFolder({ folder_uuid, resource_name, resource_type, timeout }: {
|
|
764
764
|
folder_uuid: string;
|
|
765
765
|
resource_name: string;
|
|
@@ -773,7 +773,7 @@ declare class UserFolders extends TaggingService {
|
|
|
773
773
|
* @param timeout The timeout for the request in milliseconds.
|
|
774
774
|
*
|
|
775
775
|
* @return void
|
|
776
|
-
|
|
776
|
+
**/
|
|
777
777
|
deleteFolder({ folder_uuid, timeout }: {
|
|
778
778
|
folder_uuid: string;
|
|
779
779
|
timeout?: number;
|
|
@@ -784,13 +784,13 @@ declare class UserFolders extends TaggingService {
|
|
|
784
784
|
* @param timeout The timeout for the request in milliseconds.
|
|
785
785
|
*
|
|
786
786
|
* @return void
|
|
787
|
-
|
|
787
|
+
**/
|
|
788
788
|
deleteAllFolders({ timeout }: {
|
|
789
789
|
timeout?: number;
|
|
790
790
|
}): Promise<void>;
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
-
type AIChatRole =
|
|
793
|
+
type AIChatRole = 'user' | 'assistant' | 'system';
|
|
794
794
|
type GenericContext = Record<string, unknown>;
|
|
795
795
|
interface AIChatMessage<ContextType extends GenericContext = GenericContext> {
|
|
796
796
|
role: AIChatRole;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare class BaseService {
|
|
|
5
5
|
environment: string;
|
|
6
6
|
myAccountId: string;
|
|
7
7
|
baseDomain: string;
|
|
8
|
-
constructor({ bearerToken, apiKey, serviceUrl, environment, myAccountId, baseDomain
|
|
8
|
+
constructor({ bearerToken, apiKey, serviceUrl, environment, myAccountId, baseDomain }: {
|
|
9
9
|
bearerToken?: string;
|
|
10
10
|
apiKey?: string;
|
|
11
11
|
serviceUrl?: string;
|
|
@@ -636,20 +636,20 @@ interface FolderContent extends FolderObject {
|
|
|
636
636
|
* UserFolders is a service that allows users to create folders in their account. It's built on top of the Tagging service.
|
|
637
637
|
* Folders are created with a name and an optional parent folder. If no parent folder is provided, the folder is created at the root level.
|
|
638
638
|
* Folders are created with a unique UUID that can be used to reference the folder in future requests. The folder properties are stored as a base64 encoded JSON string.
|
|
639
|
-
**/
|
|
639
|
+
**/
|
|
640
640
|
declare class UserFolders extends TaggingService {
|
|
641
641
|
private readonly hasNoParent;
|
|
642
642
|
private identity?;
|
|
643
643
|
getIdentity(): Promise<string>;
|
|
644
644
|
/**
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
645
|
+
* Create a folder.
|
|
646
|
+
* @param folder_name The name of the folder.
|
|
647
|
+
* @param parent_folder_uuid The UUID of the parent folder. If no parent folder is provided, the folder is created at the root level.
|
|
648
|
+
* @param color The color of the folder.
|
|
649
|
+
* @param timeout The timeout for the request in milliseconds.
|
|
650
|
+
*
|
|
651
|
+
* @return Folder
|
|
652
|
+
**/
|
|
653
653
|
createFolder({ folder_name, parent_folder_uuid, color, timeout }: {
|
|
654
654
|
folder_name: string;
|
|
655
655
|
color: string;
|
|
@@ -657,15 +657,15 @@ declare class UserFolders extends TaggingService {
|
|
|
657
657
|
timeout?: number;
|
|
658
658
|
}): Promise<Folder>;
|
|
659
659
|
/**
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
660
|
+
* Update a folder. Only name and color can be changed.
|
|
661
|
+
*
|
|
662
|
+
* @param folder_uuid The UUID of the folder.
|
|
663
|
+
* @param folder_name The new name of the folder.
|
|
664
|
+
* @param color The new color of the folder.
|
|
665
|
+
* @param timeout The timeout for the request in milliseconds.
|
|
666
|
+
*
|
|
667
|
+
* @return Folder
|
|
668
|
+
**/
|
|
669
669
|
updateFolder({ folder_uuid, folder_name, color, timeout }: {
|
|
670
670
|
folder_uuid: string;
|
|
671
671
|
folder_name?: string;
|
|
@@ -673,12 +673,12 @@ declare class UserFolders extends TaggingService {
|
|
|
673
673
|
timeout?: number;
|
|
674
674
|
}): Promise<Folder>;
|
|
675
675
|
/**
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
676
|
+
* List all folders in the user's account.
|
|
677
|
+
*
|
|
678
|
+
* @param timeout The timeout for the request in milliseconds.
|
|
679
|
+
*
|
|
680
|
+
* @return Folder[]
|
|
681
|
+
**/
|
|
682
682
|
listAllFolders({ timeout }: {
|
|
683
683
|
timeout?: number;
|
|
684
684
|
}): Promise<Folder[]>;
|
|
@@ -689,7 +689,7 @@ declare class UserFolders extends TaggingService {
|
|
|
689
689
|
* @param timeout The timeout for the request in milliseconds.
|
|
690
690
|
*
|
|
691
691
|
* @return Folder[]
|
|
692
|
-
|
|
692
|
+
**/
|
|
693
693
|
listNextFolderLevel({ parent_folder_uuid, timeout }: {
|
|
694
694
|
parent_folder_uuid?: string;
|
|
695
695
|
timeout?: number;
|
|
@@ -700,8 +700,8 @@ declare class UserFolders extends TaggingService {
|
|
|
700
700
|
* @param folder_uuid The UUID of the folder.
|
|
701
701
|
* @param timeout The timeout for the request in milliseconds.
|
|
702
702
|
*
|
|
703
|
-
|
|
704
|
-
|
|
703
|
+
* @return (Folder | FolderContent)[]
|
|
704
|
+
**/
|
|
705
705
|
getFolderContent({ folder_uuid, timeout }: {
|
|
706
706
|
folder_uuid: string;
|
|
707
707
|
timeout?: number;
|
|
@@ -714,7 +714,7 @@ declare class UserFolders extends TaggingService {
|
|
|
714
714
|
* @param timeout The timeout for the request in milliseconds.
|
|
715
715
|
*
|
|
716
716
|
* @return FolderContent
|
|
717
|
-
|
|
717
|
+
**/
|
|
718
718
|
addInternetbookToFolder({ folder_uuid, isbn, timeout }: {
|
|
719
719
|
folder_uuid: string;
|
|
720
720
|
isbn: string;
|
|
@@ -728,7 +728,7 @@ declare class UserFolders extends TaggingService {
|
|
|
728
728
|
* @param timeout The timeout for the request in milliseconds.
|
|
729
729
|
*
|
|
730
730
|
* @return void
|
|
731
|
-
|
|
731
|
+
**/
|
|
732
732
|
removeInternetbookFromFolder({ folder_uuid, isbn, timeout }: {
|
|
733
733
|
folder_uuid: string;
|
|
734
734
|
isbn: string;
|
|
@@ -743,7 +743,7 @@ declare class UserFolders extends TaggingService {
|
|
|
743
743
|
* @param timeout The timeout for the request in milliseconds.
|
|
744
744
|
*
|
|
745
745
|
* @return FolderContent
|
|
746
|
-
|
|
746
|
+
**/
|
|
747
747
|
addContentToFolder({ folder_uuid, resource_type, resource_name, timeout }: {
|
|
748
748
|
folder_uuid: string;
|
|
749
749
|
resource_name: string;
|
|
@@ -759,7 +759,7 @@ declare class UserFolders extends TaggingService {
|
|
|
759
759
|
* @param timeout The timeout for the request in milliseconds.
|
|
760
760
|
*
|
|
761
761
|
* @return void
|
|
762
|
-
|
|
762
|
+
**/
|
|
763
763
|
removeContentFromFolder({ folder_uuid, resource_name, resource_type, timeout }: {
|
|
764
764
|
folder_uuid: string;
|
|
765
765
|
resource_name: string;
|
|
@@ -773,7 +773,7 @@ declare class UserFolders extends TaggingService {
|
|
|
773
773
|
* @param timeout The timeout for the request in milliseconds.
|
|
774
774
|
*
|
|
775
775
|
* @return void
|
|
776
|
-
|
|
776
|
+
**/
|
|
777
777
|
deleteFolder({ folder_uuid, timeout }: {
|
|
778
778
|
folder_uuid: string;
|
|
779
779
|
timeout?: number;
|
|
@@ -784,13 +784,13 @@ declare class UserFolders extends TaggingService {
|
|
|
784
784
|
* @param timeout The timeout for the request in milliseconds.
|
|
785
785
|
*
|
|
786
786
|
* @return void
|
|
787
|
-
|
|
787
|
+
**/
|
|
788
788
|
deleteAllFolders({ timeout }: {
|
|
789
789
|
timeout?: number;
|
|
790
790
|
}): Promise<void>;
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
-
type AIChatRole =
|
|
793
|
+
type AIChatRole = 'user' | 'assistant' | 'system';
|
|
794
794
|
type GenericContext = Record<string, unknown>;
|
|
795
795
|
interface AIChatMessage<ContextType extends GenericContext = GenericContext> {
|
|
796
796
|
role: AIChatRole;
|