@widgetic/api-sdk 1.0.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/.openapi-generator-ignore +23 -0
- package/README.md +46 -0
- package/dist/apis/AdminApi.d.ts +121 -0
- package/dist/apis/AdminApi.js +241 -0
- package/dist/apis/AuthenticationApi.d.ts +203 -0
- package/dist/apis/AuthenticationApi.js +418 -0
- package/dist/apis/BatchApi.d.ts +31 -0
- package/dist/apis/BatchApi.js +48 -0
- package/dist/apis/CompositionsApi.d.ts +113 -0
- package/dist/apis/CompositionsApi.js +219 -0
- package/dist/apis/ContentsApi.d.ts +100 -0
- package/dist/apis/ContentsApi.js +210 -0
- package/dist/apis/EmbedsApi.d.ts +85 -0
- package/dist/apis/EmbedsApi.js +159 -0
- package/dist/apis/FoldersApi.d.ts +85 -0
- package/dist/apis/FoldersApi.js +159 -0
- package/dist/apis/HealthApi.d.ts +42 -0
- package/dist/apis/HealthApi.js +72 -0
- package/dist/apis/IntegrationsApi.d.ts +76 -0
- package/dist/apis/IntegrationsApi.js +121 -0
- package/dist/apis/ManagedUsersApi.d.ts +85 -0
- package/dist/apis/ManagedUsersApi.js +159 -0
- package/dist/apis/StorageApi.d.ts +115 -0
- package/dist/apis/StorageApi.js +229 -0
- package/dist/apis/UIComponentsApi.d.ts +96 -0
- package/dist/apis/UIComponentsApi.js +152 -0
- package/dist/apis/UsersApi.d.ts +210 -0
- package/dist/apis/UsersApi.js +424 -0
- package/dist/apis/WidgetsApi.d.ts +86 -0
- package/dist/apis/WidgetsApi.js +162 -0
- package/dist/apis/index.d.ts +14 -0
- package/dist/apis/index.js +16 -0
- package/dist/esm/apis/AdminApi.d.ts +121 -0
- package/dist/esm/apis/AdminApi.js +241 -0
- package/dist/esm/apis/AuthenticationApi.d.ts +203 -0
- package/dist/esm/apis/AuthenticationApi.js +418 -0
- package/dist/esm/apis/BatchApi.d.ts +31 -0
- package/dist/esm/apis/BatchApi.js +48 -0
- package/dist/esm/apis/CompositionsApi.d.ts +113 -0
- package/dist/esm/apis/CompositionsApi.js +219 -0
- package/dist/esm/apis/ContentsApi.d.ts +100 -0
- package/dist/esm/apis/ContentsApi.js +210 -0
- package/dist/esm/apis/EmbedsApi.d.ts +85 -0
- package/dist/esm/apis/EmbedsApi.js +159 -0
- package/dist/esm/apis/FoldersApi.d.ts +85 -0
- package/dist/esm/apis/FoldersApi.js +159 -0
- package/dist/esm/apis/HealthApi.d.ts +42 -0
- package/dist/esm/apis/HealthApi.js +72 -0
- package/dist/esm/apis/IntegrationsApi.d.ts +76 -0
- package/dist/esm/apis/IntegrationsApi.js +121 -0
- package/dist/esm/apis/ManagedUsersApi.d.ts +85 -0
- package/dist/esm/apis/ManagedUsersApi.js +159 -0
- package/dist/esm/apis/StorageApi.d.ts +115 -0
- package/dist/esm/apis/StorageApi.js +229 -0
- package/dist/esm/apis/UIComponentsApi.d.ts +96 -0
- package/dist/esm/apis/UIComponentsApi.js +152 -0
- package/dist/esm/apis/UsersApi.d.ts +210 -0
- package/dist/esm/apis/UsersApi.js +424 -0
- package/dist/esm/apis/WidgetsApi.d.ts +86 -0
- package/dist/esm/apis/WidgetsApi.js +162 -0
- package/dist/esm/apis/index.d.ts +14 -0
- package/dist/esm/apis/index.js +16 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/AdminHealthStatus.d.ts +55 -0
- package/dist/esm/models/AdminHealthStatus.js +55 -0
- package/dist/esm/models/AdminHealthStatusMetrics.d.ts +45 -0
- package/dist/esm/models/AdminHealthStatusMetrics.js +46 -0
- package/dist/esm/models/AdminHealthStatusMetricsMemory.d.ts +38 -0
- package/dist/esm/models/AdminHealthStatusMetricsMemory.js +43 -0
- package/dist/esm/models/AdminStats.d.ts +56 -0
- package/dist/esm/models/AdminStats.js +49 -0
- package/dist/esm/models/ApiKey.d.ts +74 -0
- package/dist/esm/models/ApiKey.js +55 -0
- package/dist/esm/models/ApiKeyUsageLog.d.ts +88 -0
- package/dist/esm/models/ApiKeyUsageLog.js +64 -0
- package/dist/esm/models/AuditLog.d.ts +68 -0
- package/dist/esm/models/AuditLog.js +53 -0
- package/dist/esm/models/BatchOperation.d.ts +60 -0
- package/dist/esm/models/BatchOperation.js +60 -0
- package/dist/esm/models/BatchResult.d.ts +50 -0
- package/dist/esm/models/BatchResult.js +47 -0
- package/dist/esm/models/CheckUserExists200Response.d.ts +32 -0
- package/dist/esm/models/CheckUserExists200Response.js +41 -0
- package/dist/esm/models/CleanupStatus.d.ts +60 -0
- package/dist/esm/models/CleanupStatus.js +56 -0
- package/dist/esm/models/CompleteSignup200Response.d.ts +39 -0
- package/dist/esm/models/CompleteSignup200Response.js +44 -0
- package/dist/esm/models/CompleteSignupRequest.d.ts +70 -0
- package/dist/esm/models/CompleteSignupRequest.js +69 -0
- package/dist/esm/models/ComponentManifest.d.ts +52 -0
- package/dist/esm/models/ComponentManifest.js +49 -0
- package/dist/esm/models/ComponentManifestAssets.d.ts +38 -0
- package/dist/esm/models/ComponentManifestAssets.js +43 -0
- package/dist/esm/models/ComponentManifestConfig.d.ts +44 -0
- package/dist/esm/models/ComponentManifestConfig.js +45 -0
- package/dist/esm/models/Composition.d.ts +83 -0
- package/dist/esm/models/Composition.js +63 -0
- package/dist/esm/models/CompositionVersion.d.ts +56 -0
- package/dist/esm/models/CompositionVersion.js +49 -0
- package/dist/esm/models/ConfirmEmail200Response.d.ts +38 -0
- package/dist/esm/models/ConfirmEmail200Response.js +43 -0
- package/dist/esm/models/ConfirmEmailRequest.d.ts +38 -0
- package/dist/esm/models/ConfirmEmailRequest.js +47 -0
- package/dist/esm/models/ConnectIntegrationRequest.d.ts +47 -0
- package/dist/esm/models/ConnectIntegrationRequest.js +53 -0
- package/dist/esm/models/Content.d.ts +74 -0
- package/dist/esm/models/Content.js +55 -0
- package/dist/esm/models/CreateCompositionRequest.d.ts +44 -0
- package/dist/esm/models/CreateCompositionRequest.js +51 -0
- package/dist/esm/models/CreateContentRequest.d.ts +44 -0
- package/dist/esm/models/CreateContentRequest.js +49 -0
- package/dist/esm/models/CreateEmbedRequest.d.ts +38 -0
- package/dist/esm/models/CreateEmbedRequest.js +45 -0
- package/dist/esm/models/CreateManagedUserRequest.d.ts +38 -0
- package/dist/esm/models/CreateManagedUserRequest.js +45 -0
- package/dist/esm/models/CreateUserApiKeyRequest.d.ts +38 -0
- package/dist/esm/models/CreateUserApiKeyRequest.js +45 -0
- package/dist/esm/models/DeleteAccountRequest.d.ts +32 -0
- package/dist/esm/models/DeleteAccountRequest.js +43 -0
- package/dist/esm/models/DisconnectIntegrationRequest.d.ts +41 -0
- package/dist/esm/models/DisconnectIntegrationRequest.js +51 -0
- package/dist/esm/models/Embed.d.ts +62 -0
- package/dist/esm/models/Embed.js +51 -0
- package/dist/esm/models/Folder.d.ts +62 -0
- package/dist/esm/models/Folder.js +51 -0
- package/dist/esm/models/GetAdminHealth200Response.d.ts +53 -0
- package/dist/esm/models/GetAdminHealth200Response.js +53 -0
- package/dist/esm/models/GetAllCompositions200Response.d.ts +51 -0
- package/dist/esm/models/GetAllCompositions200Response.js +48 -0
- package/dist/esm/models/GetAllContents200Response.d.ts +51 -0
- package/dist/esm/models/GetAllContents200Response.js +48 -0
- package/dist/esm/models/GetAllEmbeds200Response.d.ts +51 -0
- package/dist/esm/models/GetAllEmbeds200Response.js +48 -0
- package/dist/esm/models/GetAllFolders200Response.d.ts +51 -0
- package/dist/esm/models/GetAllFolders200Response.js +48 -0
- package/dist/esm/models/GetAllManagedUsers200Response.d.ts +51 -0
- package/dist/esm/models/GetAllManagedUsers200Response.js +48 -0
- package/dist/esm/models/GetAllStorageQuotas200Response.d.ts +51 -0
- package/dist/esm/models/GetAllStorageQuotas200Response.js +48 -0
- package/dist/esm/models/GetAllUsers200Response.d.ts +51 -0
- package/dist/esm/models/GetAllUsers200Response.js +48 -0
- package/dist/esm/models/GetAllWidgets200Response.d.ts +51 -0
- package/dist/esm/models/GetAllWidgets200Response.js +48 -0
- package/dist/esm/models/GetApiKeyUsageLogs200Response.d.ts +33 -0
- package/dist/esm/models/GetApiKeyUsageLogs200Response.js +42 -0
- package/dist/esm/models/GetAuditLogs200Response.d.ts +51 -0
- package/dist/esm/models/GetAuditLogs200Response.js +48 -0
- package/dist/esm/models/GetUserRole200Response.d.ts +41 -0
- package/dist/esm/models/GetUserRole200Response.js +51 -0
- package/dist/esm/models/HealthStatus.d.ts +54 -0
- package/dist/esm/models/HealthStatus.js +54 -0
- package/dist/esm/models/HealthStatusServices.d.ts +44 -0
- package/dist/esm/models/HealthStatusServices.js +45 -0
- package/dist/esm/models/IncreaseUserStorageQuotaRequest.d.ts +32 -0
- package/dist/esm/models/IncreaseUserStorageQuotaRequest.js +43 -0
- package/dist/esm/models/InitiateStorageCleanup202Response.d.ts +45 -0
- package/dist/esm/models/InitiateStorageCleanup202Response.js +49 -0
- package/dist/esm/models/Integration.d.ts +86 -0
- package/dist/esm/models/Integration.js +69 -0
- package/dist/esm/models/ListComponents200Response.d.ts +33 -0
- package/dist/esm/models/ListComponents200Response.js +42 -0
- package/dist/esm/models/LoginRequest.d.ts +38 -0
- package/dist/esm/models/LoginRequest.js +47 -0
- package/dist/esm/models/LoginUser401Response.d.ts +32 -0
- package/dist/esm/models/LoginUser401Response.js +41 -0
- package/dist/esm/models/LogoutUser200Response.d.ts +38 -0
- package/dist/esm/models/LogoutUser200Response.js +43 -0
- package/dist/esm/models/MaintenanceMode.d.ts +44 -0
- package/dist/esm/models/MaintenanceMode.js +47 -0
- package/dist/esm/models/ManagedUser.d.ts +62 -0
- package/dist/esm/models/ManagedUser.js +51 -0
- package/dist/esm/models/MountRequest.d.ts +45 -0
- package/dist/esm/models/MountRequest.js +48 -0
- package/dist/esm/models/MountRequestTheme.d.ts +54 -0
- package/dist/esm/models/MountRequestTheme.js +54 -0
- package/dist/esm/models/MountRequestThemeColors.d.ts +50 -0
- package/dist/esm/models/MountRequestThemeColors.js +47 -0
- package/dist/esm/models/MountRequestThemeTypography.d.ts +38 -0
- package/dist/esm/models/MountRequestThemeTypography.js +43 -0
- package/dist/esm/models/MountResponse.d.ts +46 -0
- package/dist/esm/models/MountResponse.js +50 -0
- package/dist/esm/models/NewEmbed.d.ts +38 -0
- package/dist/esm/models/NewEmbed.js +45 -0
- package/dist/esm/models/NewFolder.d.ts +38 -0
- package/dist/esm/models/NewFolder.js +45 -0
- package/dist/esm/models/NewManagedUser.d.ts +38 -0
- package/dist/esm/models/NewManagedUser.js +45 -0
- package/dist/esm/models/NewWidget.d.ts +50 -0
- package/dist/esm/models/NewWidget.js +53 -0
- package/dist/esm/models/OAuthProviderEnum.d.ts +26 -0
- package/dist/esm/models/OAuthProviderEnum.js +44 -0
- package/dist/esm/models/ProcessBatch200Response.d.ts +33 -0
- package/dist/esm/models/ProcessBatch200Response.js +42 -0
- package/dist/esm/models/ProcessBatchRequest.d.ts +33 -0
- package/dist/esm/models/ProcessBatchRequest.js +44 -0
- package/dist/esm/models/ResendConfirmation200Response.d.ts +32 -0
- package/dist/esm/models/ResendConfirmation200Response.js +41 -0
- package/dist/esm/models/ResendConfirmationRequest.d.ts +32 -0
- package/dist/esm/models/ResendConfirmationRequest.js +43 -0
- package/dist/esm/models/ResetPasswordRequest.d.ts +44 -0
- package/dist/esm/models/ResetPasswordRequest.js +47 -0
- package/dist/esm/models/Session.d.ts +63 -0
- package/dist/esm/models/Session.js +52 -0
- package/dist/esm/models/SetUserRole200Response.d.ts +39 -0
- package/dist/esm/models/SetUserRole200Response.js +44 -0
- package/dist/esm/models/SetUserRoleRequest.d.ts +33 -0
- package/dist/esm/models/SetUserRoleRequest.js +44 -0
- package/dist/esm/models/SignupRequest.d.ts +58 -0
- package/dist/esm/models/SignupRequest.js +55 -0
- package/dist/esm/models/SignupUser201Response.d.ts +39 -0
- package/dist/esm/models/SignupUser201Response.js +44 -0
- package/dist/esm/models/SignupUser400Response.d.ts +38 -0
- package/dist/esm/models/SignupUser400Response.js +43 -0
- package/dist/esm/models/SignupUser409Response.d.ts +38 -0
- package/dist/esm/models/SignupUser409Response.js +43 -0
- package/dist/esm/models/SignupUser500Response.d.ts +38 -0
- package/dist/esm/models/SignupUser500Response.js +43 -0
- package/dist/esm/models/StorageQuota.d.ts +44 -0
- package/dist/esm/models/StorageQuota.js +45 -0
- package/dist/esm/models/StorageUsage.d.ts +56 -0
- package/dist/esm/models/StorageUsage.js +49 -0
- package/dist/esm/models/SystemStatus.d.ts +60 -0
- package/dist/esm/models/SystemStatus.js +56 -0
- package/dist/esm/models/SystemStatusServices.d.ts +44 -0
- package/dist/esm/models/SystemStatusServices.js +45 -0
- package/dist/esm/models/ToggleMaintenanceModeRequest.d.ts +44 -0
- package/dist/esm/models/ToggleMaintenanceModeRequest.js +47 -0
- package/dist/esm/models/UIComponent.d.ts +65 -0
- package/dist/esm/models/UIComponent.js +57 -0
- package/dist/esm/models/UpdateApiKeyRequest.d.ts +38 -0
- package/dist/esm/models/UpdateApiKeyRequest.js +43 -0
- package/dist/esm/models/UpdateCompositionRequest.d.ts +38 -0
- package/dist/esm/models/UpdateCompositionRequest.js +43 -0
- package/dist/esm/models/UpdateCompositionStatusRequest.d.ts +41 -0
- package/dist/esm/models/UpdateCompositionStatusRequest.js +51 -0
- package/dist/esm/models/UpdateContentRequest.d.ts +44 -0
- package/dist/esm/models/UpdateContentRequest.js +45 -0
- package/dist/esm/models/UpdateCurrentUserProfileRequest.d.ts +38 -0
- package/dist/esm/models/UpdateCurrentUserProfileRequest.js +43 -0
- package/dist/esm/models/UpdateEmail200Response.d.ts +38 -0
- package/dist/esm/models/UpdateEmail200Response.js +43 -0
- package/dist/esm/models/UpdateEmailRequest.d.ts +38 -0
- package/dist/esm/models/UpdateEmailRequest.js +47 -0
- package/dist/esm/models/UpdateFolder.d.ts +38 -0
- package/dist/esm/models/UpdateFolder.js +43 -0
- package/dist/esm/models/UpdateFolderRequest.d.ts +38 -0
- package/dist/esm/models/UpdateFolderRequest.js +43 -0
- package/dist/esm/models/UpdateManagedUserRequest.d.ts +38 -0
- package/dist/esm/models/UpdateManagedUserRequest.js +43 -0
- package/dist/esm/models/UpdateName200Response.d.ts +38 -0
- package/dist/esm/models/UpdateName200Response.js +43 -0
- package/dist/esm/models/UpdateName401Response.d.ts +44 -0
- package/dist/esm/models/UpdateName401Response.js +45 -0
- package/dist/esm/models/UpdateNameRequest.d.ts +38 -0
- package/dist/esm/models/UpdateNameRequest.js +47 -0
- package/dist/esm/models/UpdatePassword200Response.d.ts +38 -0
- package/dist/esm/models/UpdatePassword200Response.js +43 -0
- package/dist/esm/models/UpdatePasswordRequest.d.ts +38 -0
- package/dist/esm/models/UpdatePasswordRequest.js +45 -0
- package/dist/esm/models/UpdateStorageQuotaRequest.d.ts +32 -0
- package/dist/esm/models/UpdateStorageQuotaRequest.js +43 -0
- package/dist/esm/models/UpdateUserRole200Response.d.ts +38 -0
- package/dist/esm/models/UpdateUserRole200Response.js +43 -0
- package/dist/esm/models/UpdateUserRoleRequest.d.ts +41 -0
- package/dist/esm/models/UpdateUserRoleRequest.js +51 -0
- package/dist/esm/models/User.d.ts +64 -0
- package/dist/esm/models/User.js +53 -0
- package/dist/esm/models/UserPlanEnum.d.ts +28 -0
- package/dist/esm/models/UserPlanEnum.js +46 -0
- package/dist/esm/models/UserRoleEnum.d.ts +26 -0
- package/dist/esm/models/UserRoleEnum.js +44 -0
- package/dist/esm/models/UserUpdate.d.ts +38 -0
- package/dist/esm/models/UserUpdate.js +43 -0
- package/dist/esm/models/Widget.d.ts +74 -0
- package/dist/esm/models/Widget.js +55 -0
- package/dist/esm/models/index.d.ts +106 -0
- package/dist/esm/models/index.js +108 -0
- package/dist/esm/runtime.d.ts +182 -0
- package/dist/esm/runtime.js +396 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/models/AdminHealthStatus.d.ts +55 -0
- package/dist/models/AdminHealthStatus.js +55 -0
- package/dist/models/AdminHealthStatusMetrics.d.ts +45 -0
- package/dist/models/AdminHealthStatusMetrics.js +46 -0
- package/dist/models/AdminHealthStatusMetricsMemory.d.ts +38 -0
- package/dist/models/AdminHealthStatusMetricsMemory.js +43 -0
- package/dist/models/AdminStats.d.ts +56 -0
- package/dist/models/AdminStats.js +49 -0
- package/dist/models/ApiKey.d.ts +74 -0
- package/dist/models/ApiKey.js +55 -0
- package/dist/models/ApiKeyUsageLog.d.ts +88 -0
- package/dist/models/ApiKeyUsageLog.js +64 -0
- package/dist/models/AuditLog.d.ts +68 -0
- package/dist/models/AuditLog.js +53 -0
- package/dist/models/BatchOperation.d.ts +60 -0
- package/dist/models/BatchOperation.js +60 -0
- package/dist/models/BatchResult.d.ts +50 -0
- package/dist/models/BatchResult.js +47 -0
- package/dist/models/CheckUserExists200Response.d.ts +32 -0
- package/dist/models/CheckUserExists200Response.js +41 -0
- package/dist/models/CleanupStatus.d.ts +60 -0
- package/dist/models/CleanupStatus.js +56 -0
- package/dist/models/CompleteSignup200Response.d.ts +39 -0
- package/dist/models/CompleteSignup200Response.js +44 -0
- package/dist/models/CompleteSignupRequest.d.ts +70 -0
- package/dist/models/CompleteSignupRequest.js +69 -0
- package/dist/models/ComponentManifest.d.ts +52 -0
- package/dist/models/ComponentManifest.js +49 -0
- package/dist/models/ComponentManifestAssets.d.ts +38 -0
- package/dist/models/ComponentManifestAssets.js +43 -0
- package/dist/models/ComponentManifestConfig.d.ts +44 -0
- package/dist/models/ComponentManifestConfig.js +45 -0
- package/dist/models/Composition.d.ts +83 -0
- package/dist/models/Composition.js +63 -0
- package/dist/models/CompositionVersion.d.ts +56 -0
- package/dist/models/CompositionVersion.js +49 -0
- package/dist/models/ConfirmEmail200Response.d.ts +38 -0
- package/dist/models/ConfirmEmail200Response.js +43 -0
- package/dist/models/ConfirmEmailRequest.d.ts +38 -0
- package/dist/models/ConfirmEmailRequest.js +47 -0
- package/dist/models/ConnectIntegrationRequest.d.ts +47 -0
- package/dist/models/ConnectIntegrationRequest.js +53 -0
- package/dist/models/Content.d.ts +74 -0
- package/dist/models/Content.js +55 -0
- package/dist/models/CreateCompositionRequest.d.ts +44 -0
- package/dist/models/CreateCompositionRequest.js +51 -0
- package/dist/models/CreateContentRequest.d.ts +44 -0
- package/dist/models/CreateContentRequest.js +49 -0
- package/dist/models/CreateEmbedRequest.d.ts +38 -0
- package/dist/models/CreateEmbedRequest.js +45 -0
- package/dist/models/CreateManagedUserRequest.d.ts +38 -0
- package/dist/models/CreateManagedUserRequest.js +45 -0
- package/dist/models/CreateUserApiKeyRequest.d.ts +38 -0
- package/dist/models/CreateUserApiKeyRequest.js +45 -0
- package/dist/models/DeleteAccountRequest.d.ts +32 -0
- package/dist/models/DeleteAccountRequest.js +43 -0
- package/dist/models/DisconnectIntegrationRequest.d.ts +41 -0
- package/dist/models/DisconnectIntegrationRequest.js +51 -0
- package/dist/models/Embed.d.ts +62 -0
- package/dist/models/Embed.js +51 -0
- package/dist/models/Folder.d.ts +62 -0
- package/dist/models/Folder.js +51 -0
- package/dist/models/GetAdminHealth200Response.d.ts +53 -0
- package/dist/models/GetAdminHealth200Response.js +53 -0
- package/dist/models/GetAllCompositions200Response.d.ts +51 -0
- package/dist/models/GetAllCompositions200Response.js +48 -0
- package/dist/models/GetAllContents200Response.d.ts +51 -0
- package/dist/models/GetAllContents200Response.js +48 -0
- package/dist/models/GetAllEmbeds200Response.d.ts +51 -0
- package/dist/models/GetAllEmbeds200Response.js +48 -0
- package/dist/models/GetAllFolders200Response.d.ts +51 -0
- package/dist/models/GetAllFolders200Response.js +48 -0
- package/dist/models/GetAllManagedUsers200Response.d.ts +51 -0
- package/dist/models/GetAllManagedUsers200Response.js +48 -0
- package/dist/models/GetAllStorageQuotas200Response.d.ts +51 -0
- package/dist/models/GetAllStorageQuotas200Response.js +48 -0
- package/dist/models/GetAllUsers200Response.d.ts +51 -0
- package/dist/models/GetAllUsers200Response.js +48 -0
- package/dist/models/GetAllWidgets200Response.d.ts +51 -0
- package/dist/models/GetAllWidgets200Response.js +48 -0
- package/dist/models/GetApiKeyUsageLogs200Response.d.ts +33 -0
- package/dist/models/GetApiKeyUsageLogs200Response.js +42 -0
- package/dist/models/GetAuditLogs200Response.d.ts +51 -0
- package/dist/models/GetAuditLogs200Response.js +48 -0
- package/dist/models/GetUserRole200Response.d.ts +41 -0
- package/dist/models/GetUserRole200Response.js +51 -0
- package/dist/models/HealthStatus.d.ts +54 -0
- package/dist/models/HealthStatus.js +54 -0
- package/dist/models/HealthStatusServices.d.ts +44 -0
- package/dist/models/HealthStatusServices.js +45 -0
- package/dist/models/IncreaseUserStorageQuotaRequest.d.ts +32 -0
- package/dist/models/IncreaseUserStorageQuotaRequest.js +43 -0
- package/dist/models/InitiateStorageCleanup202Response.d.ts +45 -0
- package/dist/models/InitiateStorageCleanup202Response.js +49 -0
- package/dist/models/Integration.d.ts +86 -0
- package/dist/models/Integration.js +69 -0
- package/dist/models/ListComponents200Response.d.ts +33 -0
- package/dist/models/ListComponents200Response.js +42 -0
- package/dist/models/LoginRequest.d.ts +38 -0
- package/dist/models/LoginRequest.js +47 -0
- package/dist/models/LoginUser401Response.d.ts +32 -0
- package/dist/models/LoginUser401Response.js +41 -0
- package/dist/models/LogoutUser200Response.d.ts +38 -0
- package/dist/models/LogoutUser200Response.js +43 -0
- package/dist/models/MaintenanceMode.d.ts +44 -0
- package/dist/models/MaintenanceMode.js +47 -0
- package/dist/models/ManagedUser.d.ts +62 -0
- package/dist/models/ManagedUser.js +51 -0
- package/dist/models/MountRequest.d.ts +45 -0
- package/dist/models/MountRequest.js +48 -0
- package/dist/models/MountRequestTheme.d.ts +54 -0
- package/dist/models/MountRequestTheme.js +54 -0
- package/dist/models/MountRequestThemeColors.d.ts +50 -0
- package/dist/models/MountRequestThemeColors.js +47 -0
- package/dist/models/MountRequestThemeTypography.d.ts +38 -0
- package/dist/models/MountRequestThemeTypography.js +43 -0
- package/dist/models/MountResponse.d.ts +46 -0
- package/dist/models/MountResponse.js +50 -0
- package/dist/models/NewEmbed.d.ts +38 -0
- package/dist/models/NewEmbed.js +45 -0
- package/dist/models/NewFolder.d.ts +38 -0
- package/dist/models/NewFolder.js +45 -0
- package/dist/models/NewManagedUser.d.ts +38 -0
- package/dist/models/NewManagedUser.js +45 -0
- package/dist/models/NewWidget.d.ts +50 -0
- package/dist/models/NewWidget.js +53 -0
- package/dist/models/OAuthProviderEnum.d.ts +26 -0
- package/dist/models/OAuthProviderEnum.js +44 -0
- package/dist/models/ProcessBatch200Response.d.ts +33 -0
- package/dist/models/ProcessBatch200Response.js +42 -0
- package/dist/models/ProcessBatchRequest.d.ts +33 -0
- package/dist/models/ProcessBatchRequest.js +44 -0
- package/dist/models/ResendConfirmation200Response.d.ts +32 -0
- package/dist/models/ResendConfirmation200Response.js +41 -0
- package/dist/models/ResendConfirmationRequest.d.ts +32 -0
- package/dist/models/ResendConfirmationRequest.js +43 -0
- package/dist/models/ResetPasswordRequest.d.ts +44 -0
- package/dist/models/ResetPasswordRequest.js +47 -0
- package/dist/models/Session.d.ts +63 -0
- package/dist/models/Session.js +52 -0
- package/dist/models/SetUserRole200Response.d.ts +39 -0
- package/dist/models/SetUserRole200Response.js +44 -0
- package/dist/models/SetUserRoleRequest.d.ts +33 -0
- package/dist/models/SetUserRoleRequest.js +44 -0
- package/dist/models/SignupRequest.d.ts +58 -0
- package/dist/models/SignupRequest.js +55 -0
- package/dist/models/SignupUser201Response.d.ts +39 -0
- package/dist/models/SignupUser201Response.js +44 -0
- package/dist/models/SignupUser400Response.d.ts +38 -0
- package/dist/models/SignupUser400Response.js +43 -0
- package/dist/models/SignupUser409Response.d.ts +38 -0
- package/dist/models/SignupUser409Response.js +43 -0
- package/dist/models/SignupUser500Response.d.ts +38 -0
- package/dist/models/SignupUser500Response.js +43 -0
- package/dist/models/StorageQuota.d.ts +44 -0
- package/dist/models/StorageQuota.js +45 -0
- package/dist/models/StorageUsage.d.ts +56 -0
- package/dist/models/StorageUsage.js +49 -0
- package/dist/models/SystemStatus.d.ts +60 -0
- package/dist/models/SystemStatus.js +56 -0
- package/dist/models/SystemStatusServices.d.ts +44 -0
- package/dist/models/SystemStatusServices.js +45 -0
- package/dist/models/ToggleMaintenanceModeRequest.d.ts +44 -0
- package/dist/models/ToggleMaintenanceModeRequest.js +47 -0
- package/dist/models/UIComponent.d.ts +65 -0
- package/dist/models/UIComponent.js +57 -0
- package/dist/models/UpdateApiKeyRequest.d.ts +38 -0
- package/dist/models/UpdateApiKeyRequest.js +43 -0
- package/dist/models/UpdateCompositionRequest.d.ts +38 -0
- package/dist/models/UpdateCompositionRequest.js +43 -0
- package/dist/models/UpdateCompositionStatusRequest.d.ts +41 -0
- package/dist/models/UpdateCompositionStatusRequest.js +51 -0
- package/dist/models/UpdateContentRequest.d.ts +44 -0
- package/dist/models/UpdateContentRequest.js +45 -0
- package/dist/models/UpdateCurrentUserProfileRequest.d.ts +38 -0
- package/dist/models/UpdateCurrentUserProfileRequest.js +43 -0
- package/dist/models/UpdateEmail200Response.d.ts +38 -0
- package/dist/models/UpdateEmail200Response.js +43 -0
- package/dist/models/UpdateEmailRequest.d.ts +38 -0
- package/dist/models/UpdateEmailRequest.js +47 -0
- package/dist/models/UpdateFolder.d.ts +38 -0
- package/dist/models/UpdateFolder.js +43 -0
- package/dist/models/UpdateFolderRequest.d.ts +38 -0
- package/dist/models/UpdateFolderRequest.js +43 -0
- package/dist/models/UpdateManagedUserRequest.d.ts +38 -0
- package/dist/models/UpdateManagedUserRequest.js +43 -0
- package/dist/models/UpdateName200Response.d.ts +38 -0
- package/dist/models/UpdateName200Response.js +43 -0
- package/dist/models/UpdateName401Response.d.ts +44 -0
- package/dist/models/UpdateName401Response.js +45 -0
- package/dist/models/UpdateNameRequest.d.ts +38 -0
- package/dist/models/UpdateNameRequest.js +47 -0
- package/dist/models/UpdatePassword200Response.d.ts +38 -0
- package/dist/models/UpdatePassword200Response.js +43 -0
- package/dist/models/UpdatePasswordRequest.d.ts +38 -0
- package/dist/models/UpdatePasswordRequest.js +45 -0
- package/dist/models/UpdateStorageQuotaRequest.d.ts +32 -0
- package/dist/models/UpdateStorageQuotaRequest.js +43 -0
- package/dist/models/UpdateUserRole200Response.d.ts +38 -0
- package/dist/models/UpdateUserRole200Response.js +43 -0
- package/dist/models/UpdateUserRoleRequest.d.ts +41 -0
- package/dist/models/UpdateUserRoleRequest.js +51 -0
- package/dist/models/User.d.ts +64 -0
- package/dist/models/User.js +53 -0
- package/dist/models/UserPlanEnum.d.ts +28 -0
- package/dist/models/UserPlanEnum.js +46 -0
- package/dist/models/UserRoleEnum.d.ts +26 -0
- package/dist/models/UserRoleEnum.js +44 -0
- package/dist/models/UserUpdate.d.ts +38 -0
- package/dist/models/UserUpdate.js +43 -0
- package/dist/models/Widget.d.ts +74 -0
- package/dist/models/Widget.js +55 -0
- package/dist/models/index.d.ts +106 -0
- package/dist/models/index.js +108 -0
- package/dist/runtime.d.ts +182 -0
- package/dist/runtime.js +396 -0
- package/package.json +33 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widgetic API Gateway
|
|
3
|
+
* API documentation for the Widgetic API Gateway
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BASE_PATH: string;
|
|
13
|
+
export interface ConfigurationParameters {
|
|
14
|
+
basePath?: string;
|
|
15
|
+
fetchApi?: FetchAPI;
|
|
16
|
+
middleware?: Middleware[];
|
|
17
|
+
queryParamsStringify?: (params: HTTPQuery) => string;
|
|
18
|
+
username?: string;
|
|
19
|
+
password?: string;
|
|
20
|
+
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
|
|
21
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
|
|
22
|
+
headers?: HTTPHeaders;
|
|
23
|
+
credentials?: RequestCredentials;
|
|
24
|
+
}
|
|
25
|
+
export declare class Configuration {
|
|
26
|
+
private configuration;
|
|
27
|
+
constructor(configOrApiKey?: ConfigurationParameters | string);
|
|
28
|
+
set config(configuration: Configuration);
|
|
29
|
+
get basePath(): string;
|
|
30
|
+
get fetchApi(): FetchAPI | undefined;
|
|
31
|
+
get middleware(): Middleware[];
|
|
32
|
+
get queryParamsStringify(): (params: HTTPQuery) => string;
|
|
33
|
+
get username(): string | undefined;
|
|
34
|
+
get password(): string | undefined;
|
|
35
|
+
get apiKey(): ((name: string) => string | Promise<string>) | undefined;
|
|
36
|
+
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
|
|
37
|
+
get headers(): HTTPHeaders | undefined;
|
|
38
|
+
get credentials(): RequestCredentials | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare const DefaultConfig: Configuration;
|
|
41
|
+
/**
|
|
42
|
+
* This is the base class for all generated API classes.
|
|
43
|
+
*/
|
|
44
|
+
export declare class BaseAPI {
|
|
45
|
+
protected configuration: Configuration;
|
|
46
|
+
private static readonly jsonRegex;
|
|
47
|
+
private middleware;
|
|
48
|
+
constructor(configuration?: Configuration);
|
|
49
|
+
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
|
|
50
|
+
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
|
|
51
|
+
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
|
|
52
|
+
/**
|
|
53
|
+
* Check if the given MIME is a JSON MIME.
|
|
54
|
+
* JSON MIME examples:
|
|
55
|
+
* application/json
|
|
56
|
+
* application/json; charset=UTF8
|
|
57
|
+
* APPLICATION/JSON
|
|
58
|
+
* application/vnd.company+json
|
|
59
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
60
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
61
|
+
*/
|
|
62
|
+
protected isJsonMime(mime: string | null | undefined): boolean;
|
|
63
|
+
protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
|
|
64
|
+
private createFetchParams;
|
|
65
|
+
private fetchApi;
|
|
66
|
+
/**
|
|
67
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
68
|
+
* and then shallow cloning data members.
|
|
69
|
+
*/
|
|
70
|
+
private clone;
|
|
71
|
+
}
|
|
72
|
+
export declare class ResponseError extends Error {
|
|
73
|
+
response: Response;
|
|
74
|
+
name: "ResponseError";
|
|
75
|
+
constructor(response: Response, msg?: string);
|
|
76
|
+
}
|
|
77
|
+
export declare class FetchError extends Error {
|
|
78
|
+
cause: Error;
|
|
79
|
+
name: "FetchError";
|
|
80
|
+
constructor(cause: Error, msg?: string);
|
|
81
|
+
}
|
|
82
|
+
export declare class RequiredError extends Error {
|
|
83
|
+
field: string;
|
|
84
|
+
name: "RequiredError";
|
|
85
|
+
constructor(field: string, msg?: string);
|
|
86
|
+
}
|
|
87
|
+
export declare const COLLECTION_FORMATS: {
|
|
88
|
+
csv: string;
|
|
89
|
+
ssv: string;
|
|
90
|
+
tsv: string;
|
|
91
|
+
pipes: string;
|
|
92
|
+
};
|
|
93
|
+
export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
|
|
94
|
+
export type Json = any;
|
|
95
|
+
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
96
|
+
export type HTTPHeaders = {
|
|
97
|
+
[key: string]: string;
|
|
98
|
+
};
|
|
99
|
+
export type HTTPQuery = {
|
|
100
|
+
[key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
|
|
101
|
+
};
|
|
102
|
+
export type HTTPBody = Json | FormData | URLSearchParams;
|
|
103
|
+
export type HTTPRequestInit = {
|
|
104
|
+
headers?: HTTPHeaders;
|
|
105
|
+
method: HTTPMethod;
|
|
106
|
+
credentials?: RequestCredentials;
|
|
107
|
+
body?: HTTPBody;
|
|
108
|
+
};
|
|
109
|
+
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
|
110
|
+
export type InitOverrideFunction = (requestContext: {
|
|
111
|
+
init: HTTPRequestInit;
|
|
112
|
+
context: RequestOpts;
|
|
113
|
+
}) => Promise<RequestInit>;
|
|
114
|
+
export interface FetchParams {
|
|
115
|
+
url: string;
|
|
116
|
+
init: RequestInit;
|
|
117
|
+
}
|
|
118
|
+
export interface RequestOpts {
|
|
119
|
+
path: string;
|
|
120
|
+
method: HTTPMethod;
|
|
121
|
+
headers: HTTPHeaders;
|
|
122
|
+
query?: HTTPQuery;
|
|
123
|
+
body?: HTTPBody;
|
|
124
|
+
}
|
|
125
|
+
export declare function querystring(params: HTTPQuery, prefix?: string): string;
|
|
126
|
+
export declare function exists(json: any, key: string): boolean;
|
|
127
|
+
export declare function mapValues(data: any, fn: (item: any) => any): {};
|
|
128
|
+
export declare function canConsumeForm(consumes: Consume[]): boolean;
|
|
129
|
+
export interface Consume {
|
|
130
|
+
contentType: string;
|
|
131
|
+
}
|
|
132
|
+
export interface RequestContext {
|
|
133
|
+
fetch: FetchAPI;
|
|
134
|
+
url: string;
|
|
135
|
+
init: RequestInit;
|
|
136
|
+
}
|
|
137
|
+
export interface ResponseContext {
|
|
138
|
+
fetch: FetchAPI;
|
|
139
|
+
url: string;
|
|
140
|
+
init: RequestInit;
|
|
141
|
+
response: Response;
|
|
142
|
+
}
|
|
143
|
+
export interface ErrorContext {
|
|
144
|
+
fetch: FetchAPI;
|
|
145
|
+
url: string;
|
|
146
|
+
init: RequestInit;
|
|
147
|
+
error: unknown;
|
|
148
|
+
response?: Response;
|
|
149
|
+
}
|
|
150
|
+
export interface Middleware {
|
|
151
|
+
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
152
|
+
post?(context: ResponseContext): Promise<Response | void>;
|
|
153
|
+
onError?(context: ErrorContext): Promise<Response | void>;
|
|
154
|
+
}
|
|
155
|
+
export interface ApiResponse<T> {
|
|
156
|
+
raw: Response;
|
|
157
|
+
value(): Promise<T>;
|
|
158
|
+
}
|
|
159
|
+
export interface ResponseTransformer<T> {
|
|
160
|
+
(json: any): T;
|
|
161
|
+
}
|
|
162
|
+
export declare class JSONApiResponse<T> {
|
|
163
|
+
raw: Response;
|
|
164
|
+
private transformer;
|
|
165
|
+
constructor(raw: Response, transformer?: ResponseTransformer<T>);
|
|
166
|
+
value(): Promise<T>;
|
|
167
|
+
}
|
|
168
|
+
export declare class VoidApiResponse {
|
|
169
|
+
raw: Response;
|
|
170
|
+
constructor(raw: Response);
|
|
171
|
+
value(): Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
export declare class BlobApiResponse {
|
|
174
|
+
raw: Response;
|
|
175
|
+
constructor(raw: Response);
|
|
176
|
+
value(): Promise<Blob>;
|
|
177
|
+
}
|
|
178
|
+
export declare class TextApiResponse {
|
|
179
|
+
raw: Response;
|
|
180
|
+
constructor(raw: Response);
|
|
181
|
+
value(): Promise<string>;
|
|
182
|
+
}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widgetic API Gateway
|
|
3
|
+
* API documentation for the Widgetic API Gateway
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
// Base URLs from OpenAPI spec x-variables
|
|
13
|
+
// const env = "development";
|
|
14
|
+
// const API_URL = "http://localhost:3000";
|
|
15
|
+
// const API_BASE_URL = "/api/v1";
|
|
16
|
+
export const BASE_PATH = "http://localhost:3000/api/v1".replace(/\/+$/, "");
|
|
17
|
+
export class Configuration {
|
|
18
|
+
constructor(configOrApiKey) {
|
|
19
|
+
// Initialize with default empty configuration
|
|
20
|
+
this.configuration = {
|
|
21
|
+
basePath: BASE_PATH,
|
|
22
|
+
headers: {},
|
|
23
|
+
middleware: []
|
|
24
|
+
};
|
|
25
|
+
// if string API key provided
|
|
26
|
+
if (typeof configOrApiKey === 'string') {
|
|
27
|
+
this.configuration.apiKey = configOrApiKey;
|
|
28
|
+
this.configuration.headers = {
|
|
29
|
+
'Content-Type': 'application/json',
|
|
30
|
+
'Authorization': `Bearer ${configOrApiKey}`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// if configuration object provided
|
|
34
|
+
else if (configOrApiKey) {
|
|
35
|
+
// If configuration object provided
|
|
36
|
+
this.configuration = configOrApiKey;
|
|
37
|
+
// add default headers if not provided
|
|
38
|
+
if (!configOrApiKey.headers) {
|
|
39
|
+
this.configuration.headers = {
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
...(configOrApiKey.apiKey ? { 'Authorization': `Bearer ${configOrApiKey.apiKey}` } : {})
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
}
|
|
46
|
+
//console.log('Configuration constructor:', this.configuration);
|
|
47
|
+
}
|
|
48
|
+
set config(configuration) {
|
|
49
|
+
this.configuration = configuration;
|
|
50
|
+
}
|
|
51
|
+
get basePath() {
|
|
52
|
+
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
53
|
+
}
|
|
54
|
+
get fetchApi() {
|
|
55
|
+
return this.configuration.fetchApi;
|
|
56
|
+
}
|
|
57
|
+
get middleware() {
|
|
58
|
+
return this.configuration.middleware || [];
|
|
59
|
+
}
|
|
60
|
+
get queryParamsStringify() {
|
|
61
|
+
return this.configuration.queryParamsStringify || querystring;
|
|
62
|
+
}
|
|
63
|
+
get username() {
|
|
64
|
+
return this.configuration.username;
|
|
65
|
+
}
|
|
66
|
+
get password() {
|
|
67
|
+
return this.configuration.password;
|
|
68
|
+
}
|
|
69
|
+
get apiKey() {
|
|
70
|
+
const apiKey = this.configuration.apiKey;
|
|
71
|
+
if (apiKey) {
|
|
72
|
+
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
get accessToken() {
|
|
77
|
+
const accessToken = this.configuration.accessToken;
|
|
78
|
+
if (accessToken) {
|
|
79
|
+
return typeof accessToken === 'function' ? accessToken : async () => accessToken;
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
get headers() {
|
|
84
|
+
return this.configuration.headers;
|
|
85
|
+
}
|
|
86
|
+
get credentials() {
|
|
87
|
+
return this.configuration.credentials;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export const DefaultConfig = new Configuration();
|
|
91
|
+
/**
|
|
92
|
+
* This is the base class for all generated API classes.
|
|
93
|
+
*/
|
|
94
|
+
export class BaseAPI {
|
|
95
|
+
constructor(configuration = DefaultConfig) {
|
|
96
|
+
this.configuration = configuration;
|
|
97
|
+
this.fetchApi = async (url, init) => {
|
|
98
|
+
let fetchParams = { url, init };
|
|
99
|
+
// Ensure middleware exists before trying to iterate
|
|
100
|
+
if (!this.middleware || !Array.isArray(this.middleware)) {
|
|
101
|
+
this.middleware = [];
|
|
102
|
+
}
|
|
103
|
+
for (const middleware of this.middleware) {
|
|
104
|
+
if (middleware.pre) {
|
|
105
|
+
fetchParams = await middleware.pre({
|
|
106
|
+
fetch: this.fetchApi,
|
|
107
|
+
...fetchParams,
|
|
108
|
+
}) || fetchParams;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
let response = undefined;
|
|
112
|
+
try {
|
|
113
|
+
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
for (const middleware of this.middleware) {
|
|
117
|
+
if (middleware.onError) {
|
|
118
|
+
response = await middleware.onError({
|
|
119
|
+
fetch: this.fetchApi,
|
|
120
|
+
url: fetchParams.url,
|
|
121
|
+
init: fetchParams.init,
|
|
122
|
+
error: e,
|
|
123
|
+
response: response ? response.clone() : undefined,
|
|
124
|
+
}) || response;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (response === undefined) {
|
|
128
|
+
if (e instanceof Error) {
|
|
129
|
+
throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
throw e;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for (const middleware of this.middleware) {
|
|
137
|
+
if (middleware.post) {
|
|
138
|
+
response = await middleware.post({
|
|
139
|
+
fetch: this.fetchApi,
|
|
140
|
+
url: fetchParams.url,
|
|
141
|
+
init: fetchParams.init,
|
|
142
|
+
response: response.clone(),
|
|
143
|
+
}) || response;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return response;
|
|
147
|
+
};
|
|
148
|
+
this.middleware = configuration.middleware || [];
|
|
149
|
+
//console.log('API SDK: BaseAPI constructor config:', configuration);
|
|
150
|
+
}
|
|
151
|
+
withMiddleware(...middlewares) {
|
|
152
|
+
const next = this.clone();
|
|
153
|
+
next.middleware = next.middleware.concat(...middlewares);
|
|
154
|
+
return next;
|
|
155
|
+
}
|
|
156
|
+
withPreMiddleware(...preMiddlewares) {
|
|
157
|
+
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
158
|
+
return this.withMiddleware(...middlewares);
|
|
159
|
+
}
|
|
160
|
+
withPostMiddleware(...postMiddlewares) {
|
|
161
|
+
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
162
|
+
return this.withMiddleware(...middlewares);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Check if the given MIME is a JSON MIME.
|
|
166
|
+
* JSON MIME examples:
|
|
167
|
+
* application/json
|
|
168
|
+
* application/json; charset=UTF8
|
|
169
|
+
* APPLICATION/JSON
|
|
170
|
+
* application/vnd.company+json
|
|
171
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
172
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
173
|
+
*/
|
|
174
|
+
isJsonMime(mime) {
|
|
175
|
+
if (!mime) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
return BaseAPI.jsonRegex.test(mime);
|
|
179
|
+
}
|
|
180
|
+
async request(context, initOverrides) {
|
|
181
|
+
// console.log('API SDK: Request method: init context:', {
|
|
182
|
+
// path: context.path,
|
|
183
|
+
// headers: context.headers,
|
|
184
|
+
// configHeaders: this.configuration.headers
|
|
185
|
+
//});
|
|
186
|
+
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
187
|
+
// Ensure headers are properly merged
|
|
188
|
+
const headers = new Headers({
|
|
189
|
+
...this.configuration.headers,
|
|
190
|
+
...(context.headers || {}),
|
|
191
|
+
...(init.headers || {})
|
|
192
|
+
});
|
|
193
|
+
const finalInit = {
|
|
194
|
+
...init,
|
|
195
|
+
headers
|
|
196
|
+
};
|
|
197
|
+
// console.log('API SDK: Request method: final config:', {
|
|
198
|
+
// url,
|
|
199
|
+
// headers: headers
|
|
200
|
+
// });
|
|
201
|
+
const response = await this.fetchApi(url, finalInit);
|
|
202
|
+
if (response && (response.status >= 200 && response.status < 300)) {
|
|
203
|
+
return response;
|
|
204
|
+
}
|
|
205
|
+
// Clone the response to read it
|
|
206
|
+
const errorResponse = response.clone();
|
|
207
|
+
let errorMessage = "Response returned an error code";
|
|
208
|
+
try {
|
|
209
|
+
const errorData = await errorResponse.json();
|
|
210
|
+
errorMessage = errorData.message || errorData.error || errorMessage;
|
|
211
|
+
}
|
|
212
|
+
catch (e) {
|
|
213
|
+
// If we can't parse JSON, try to get text
|
|
214
|
+
try {
|
|
215
|
+
errorMessage = await errorResponse.text();
|
|
216
|
+
}
|
|
217
|
+
catch (textError) {
|
|
218
|
+
// If both fail, use the status text
|
|
219
|
+
errorMessage = response.statusText;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
throw new ResponseError(response, errorMessage);
|
|
223
|
+
}
|
|
224
|
+
async createFetchParams(context, initOverrides) {
|
|
225
|
+
// Ensure basePath is absolute and doesn't end with a slash
|
|
226
|
+
const basePath = this.configuration.basePath || BASE_PATH;
|
|
227
|
+
const cleanBasePath = basePath.replace(/\/+$/, '');
|
|
228
|
+
// Ensure path starts with a slash
|
|
229
|
+
const cleanPath = context.path.startsWith('/') ? context.path : `/${context.path}`;
|
|
230
|
+
let url = cleanBasePath + cleanPath;
|
|
231
|
+
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
232
|
+
// only add the querystring to the URL if there are query parameters.
|
|
233
|
+
// this is done to avoid urls ending with a "?" character which buggy webservers
|
|
234
|
+
// do not handle correctly sometimes.
|
|
235
|
+
url += '?' + this.configuration.queryParamsStringify(context.query);
|
|
236
|
+
}
|
|
237
|
+
// Ensure headers are properly merged
|
|
238
|
+
//const headers = { ...this.configuration.headers, ...(context.headers || {}) };
|
|
239
|
+
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
240
|
+
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
|
|
241
|
+
// console.log('API SDK: Creating fetch params:', { basePath: cleanBasePath, path: cleanPath, url, headers: headers });
|
|
242
|
+
const initOverrideFn = typeof initOverrides === "function"
|
|
243
|
+
? initOverrides
|
|
244
|
+
: async () => initOverrides;
|
|
245
|
+
const initParams = {
|
|
246
|
+
method: context.method,
|
|
247
|
+
headers,
|
|
248
|
+
body: context.body,
|
|
249
|
+
credentials: this.configuration.credentials,
|
|
250
|
+
};
|
|
251
|
+
const overriddenInit = {
|
|
252
|
+
...initParams,
|
|
253
|
+
...(await initOverrideFn({
|
|
254
|
+
init: initParams,
|
|
255
|
+
context,
|
|
256
|
+
}))
|
|
257
|
+
};
|
|
258
|
+
let body;
|
|
259
|
+
if (isFormData(overriddenInit.body)
|
|
260
|
+
|| (overriddenInit.body instanceof URLSearchParams)
|
|
261
|
+
|| isBlob(overriddenInit.body)) {
|
|
262
|
+
body = overriddenInit.body;
|
|
263
|
+
}
|
|
264
|
+
else if (this.isJsonMime(headers['Content-Type'])) {
|
|
265
|
+
body = JSON.stringify(overriddenInit.body);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
body = overriddenInit.body;
|
|
269
|
+
}
|
|
270
|
+
const init = {
|
|
271
|
+
...overriddenInit,
|
|
272
|
+
body
|
|
273
|
+
};
|
|
274
|
+
return { url, init };
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
278
|
+
* and then shallow cloning data members.
|
|
279
|
+
*/
|
|
280
|
+
clone() {
|
|
281
|
+
const constructor = this.constructor;
|
|
282
|
+
const next = new constructor(this.configuration);
|
|
283
|
+
next.middleware = this.middleware.slice();
|
|
284
|
+
return next;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
BaseAPI.jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
|
|
288
|
+
;
|
|
289
|
+
function isBlob(value) {
|
|
290
|
+
return typeof Blob !== 'undefined' && value instanceof Blob;
|
|
291
|
+
}
|
|
292
|
+
function isFormData(value) {
|
|
293
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
294
|
+
}
|
|
295
|
+
export class ResponseError extends Error {
|
|
296
|
+
constructor(response, msg) {
|
|
297
|
+
super(msg);
|
|
298
|
+
this.response = response;
|
|
299
|
+
this.name = "ResponseError";
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
export class FetchError extends Error {
|
|
303
|
+
constructor(cause, msg) {
|
|
304
|
+
super(msg);
|
|
305
|
+
this.cause = cause;
|
|
306
|
+
this.name = "FetchError";
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
export class RequiredError extends Error {
|
|
310
|
+
constructor(field, msg) {
|
|
311
|
+
super(msg);
|
|
312
|
+
this.field = field;
|
|
313
|
+
this.name = "RequiredError";
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
export const COLLECTION_FORMATS = {
|
|
317
|
+
csv: ",",
|
|
318
|
+
ssv: " ",
|
|
319
|
+
tsv: "\t",
|
|
320
|
+
pipes: "|",
|
|
321
|
+
};
|
|
322
|
+
export function querystring(params, prefix = '') {
|
|
323
|
+
return Object.keys(params)
|
|
324
|
+
.map(key => querystringSingleKey(key, params[key], prefix))
|
|
325
|
+
.filter(part => part.length > 0)
|
|
326
|
+
.join('&');
|
|
327
|
+
}
|
|
328
|
+
function querystringSingleKey(key, value, keyPrefix = '') {
|
|
329
|
+
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
330
|
+
if (value instanceof Array) {
|
|
331
|
+
const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
|
|
332
|
+
.join(`&${encodeURIComponent(fullKey)}=`);
|
|
333
|
+
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
334
|
+
}
|
|
335
|
+
if (value instanceof Set) {
|
|
336
|
+
const valueAsArray = Array.from(value);
|
|
337
|
+
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
338
|
+
}
|
|
339
|
+
if (value instanceof Date) {
|
|
340
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
341
|
+
}
|
|
342
|
+
if (value instanceof Object) {
|
|
343
|
+
return querystring(value, fullKey);
|
|
344
|
+
}
|
|
345
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
346
|
+
}
|
|
347
|
+
export function exists(json, key) {
|
|
348
|
+
const value = json[key];
|
|
349
|
+
return value !== null && value !== undefined;
|
|
350
|
+
}
|
|
351
|
+
export function mapValues(data, fn) {
|
|
352
|
+
return Object.keys(data).reduce((acc, key) => ({ ...acc, [key]: fn(data[key]) }), {});
|
|
353
|
+
}
|
|
354
|
+
export function canConsumeForm(consumes) {
|
|
355
|
+
for (const consume of consumes) {
|
|
356
|
+
if ('multipart/form-data' === consume.contentType) {
|
|
357
|
+
return true;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
export class JSONApiResponse {
|
|
363
|
+
constructor(raw, transformer = (jsonValue) => jsonValue) {
|
|
364
|
+
this.raw = raw;
|
|
365
|
+
this.transformer = transformer;
|
|
366
|
+
}
|
|
367
|
+
async value() {
|
|
368
|
+
return this.transformer(await this.raw.json());
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
export class VoidApiResponse {
|
|
372
|
+
constructor(raw) {
|
|
373
|
+
this.raw = raw;
|
|
374
|
+
}
|
|
375
|
+
async value() {
|
|
376
|
+
return undefined;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
export class BlobApiResponse {
|
|
380
|
+
constructor(raw) {
|
|
381
|
+
this.raw = raw;
|
|
382
|
+
}
|
|
383
|
+
async value() {
|
|
384
|
+
return await this.raw.blob();
|
|
385
|
+
}
|
|
386
|
+
;
|
|
387
|
+
}
|
|
388
|
+
export class TextApiResponse {
|
|
389
|
+
constructor(raw) {
|
|
390
|
+
this.raw = raw;
|
|
391
|
+
}
|
|
392
|
+
async value() {
|
|
393
|
+
return await this.raw.text();
|
|
394
|
+
}
|
|
395
|
+
;
|
|
396
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@widgetic/api-sdk",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Typescript client for widgetic API",
|
|
5
|
+
"author": "Widgetic",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://gitlab.com/widgeticai/api-sdk-client/typescript-sdk.git"
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"private": false,
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"require": "./dist/index.cjs",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc && tsc -p tsconfig.esm.json",
|
|
24
|
+
"prepare": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"typescript": "^5.0"
|
|
28
|
+
},
|
|
29
|
+
"volta": {
|
|
30
|
+
"node": "22.9.0",
|
|
31
|
+
"npm": "10.8.3"
|
|
32
|
+
}
|
|
33
|
+
}
|