@widgetic/api-sdk 1.0.31 → 1.0.33
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/README.md +4 -0
- package/dist/apis/AdminApi.d.ts +30 -46
- package/dist/apis/AdminApi.js +53 -102
- package/dist/apis/AdminBillingApi.d.ts +2 -2
- package/dist/apis/AdminBillingApi.js +2 -2
- package/dist/apis/BillingApi.d.ts +44 -1
- package/dist/apis/BillingApi.js +127 -0
- package/dist/apis/CompositionsApi.d.ts +19 -15
- package/dist/apis/CompositionsApi.js +21 -14
- package/dist/apis/CreditsApi.d.ts +7 -7
- package/dist/apis/CreditsApi.js +5 -5
- package/dist/apis/OrganizationsApi.d.ts +35 -7
- package/dist/apis/OrganizationsApi.js +86 -6
- package/dist/apis/PartnerApi.d.ts +141 -36
- package/dist/apis/PartnerApi.js +333 -31
- package/dist/apis/PartnerCustomizationsApi.d.ts +4 -4
- package/dist/apis/PartnerCustomizationsApi.js +4 -4
- package/dist/apis/PartnersApi.d.ts +85 -67
- package/dist/apis/PartnersApi.js +198 -119
- package/dist/apis/PublicEmbedApi.d.ts +42 -3
- package/dist/apis/PublicEmbedApi.js +99 -2
- package/dist/apis/SubscriptionsApi.d.ts +2 -2
- package/dist/apis/SubscriptionsApi.js +2 -2
- package/dist/apis/UploadsApi.d.ts +4 -4
- package/dist/apis/UploadsApi.js +4 -4
- package/dist/apis/UsersApi.d.ts +4 -4
- package/dist/apis/UsersApi.js +4 -4
- package/dist/apis/index.d.ts +0 -4
- package/dist/apis/index.js +0 -4
- package/dist/esm/apis/AdminApi.d.ts +30 -46
- package/dist/esm/apis/AdminApi.js +54 -103
- package/dist/esm/apis/AdminBillingApi.d.ts +2 -2
- package/dist/esm/apis/AdminBillingApi.js +2 -2
- package/dist/esm/apis/BillingApi.d.ts +44 -1
- package/dist/esm/apis/BillingApi.js +128 -1
- package/dist/esm/apis/CompositionsApi.d.ts +19 -15
- package/dist/esm/apis/CompositionsApi.js +22 -15
- package/dist/esm/apis/CreditsApi.d.ts +7 -7
- package/dist/esm/apis/CreditsApi.js +6 -6
- package/dist/esm/apis/OrganizationsApi.d.ts +35 -7
- package/dist/esm/apis/OrganizationsApi.js +87 -7
- package/dist/esm/apis/PartnerApi.d.ts +141 -36
- package/dist/esm/apis/PartnerApi.js +334 -32
- package/dist/esm/apis/PartnerCustomizationsApi.d.ts +4 -4
- package/dist/esm/apis/PartnerCustomizationsApi.js +4 -4
- package/dist/esm/apis/PartnersApi.d.ts +85 -67
- package/dist/esm/apis/PartnersApi.js +198 -119
- package/dist/esm/apis/PublicEmbedApi.d.ts +42 -3
- package/dist/esm/apis/PublicEmbedApi.js +100 -3
- package/dist/esm/apis/SubscriptionsApi.d.ts +2 -2
- package/dist/esm/apis/SubscriptionsApi.js +2 -2
- package/dist/esm/apis/UploadsApi.d.ts +4 -4
- package/dist/esm/apis/UploadsApi.js +4 -4
- package/dist/esm/apis/UsersApi.d.ts +4 -4
- package/dist/esm/apis/UsersApi.js +4 -4
- package/dist/esm/apis/index.d.ts +0 -4
- package/dist/esm/apis/index.js +0 -4
- package/dist/esm/models/BillingUsersUserIdStorageCancelPackPostRequest.d.ts +40 -0
- package/dist/esm/models/BillingUsersUserIdStorageCancelPackPostRequest.js +43 -0
- package/dist/esm/models/BillingUsersUserIdStorageGet200Response.d.ts +39 -0
- package/dist/esm/models/BillingUsersUserIdStorageGet200Response.js +44 -0
- package/dist/esm/models/BillingUsersUserIdStorageGet200ResponseData.d.ts +33 -0
- package/dist/esm/models/BillingUsersUserIdStorageGet200ResponseData.js +42 -0
- package/dist/esm/models/Composition.d.ts +12 -0
- package/dist/esm/models/Composition.js +2 -0
- package/dist/esm/models/CompositionDataSource.d.ts +41 -0
- package/dist/esm/models/CompositionDataSource.js +47 -0
- package/dist/esm/models/CompositionEntriesReading.d.ts +20 -4
- package/dist/esm/models/CompositionEntriesReading.js +3 -0
- package/dist/esm/models/CompositionEntryAggregateTally.d.ts +15 -8
- package/dist/esm/models/CompositionEntryAggregatesBlock.d.ts +10 -0
- package/dist/esm/models/CompositionEntryItem.d.ts +4 -1
- package/dist/esm/models/CompositionEntryItemsMeta.d.ts +8 -0
- package/dist/esm/models/ConvertSoloToTeams200Response.d.ts +39 -0
- package/dist/esm/models/ConvertSoloToTeams200Response.js +44 -0
- package/dist/esm/models/CreatePartnerRequest.d.ts +7 -0
- package/dist/esm/models/CreatePartnerRequest.js +2 -0
- package/dist/esm/models/DeleteCompositionDataSource200Response.d.ts +32 -0
- package/dist/esm/models/DeleteCompositionDataSource200Response.js +43 -0
- package/dist/esm/models/GetCompositionContentSchema200Response.d.ts +2 -2
- package/dist/esm/models/GetOrganizationPricing200ResponseDataStorage.d.ts +3 -2
- package/dist/esm/models/GetOrganizationStorageUsage200ResponseDataStorageUsage.d.ts +5 -5
- package/dist/esm/models/GetPartnerCreditTransactions200Response.d.ts +39 -0
- package/dist/esm/models/GetPartnerCreditTransactions200Response.js +44 -0
- package/dist/esm/models/GetPublicCompositionEmbed200Response.d.ts +106 -0
- package/dist/esm/models/GetPublicCompositionEmbed200Response.js +67 -0
- package/dist/esm/models/GetPublicCompositionEmbed200ResponseDataSource.d.ts +38 -0
- package/dist/esm/models/GetPublicCompositionEmbed200ResponseDataSource.js +43 -0
- package/dist/esm/models/GetPublicCompositionEmbed200ResponseDirect.d.ts +44 -0
- package/dist/esm/models/GetPublicCompositionEmbed200ResponseDirect.js +45 -0
- package/dist/esm/models/GetPublicCompositionEmbed403Response.d.ts +51 -0
- package/dist/esm/models/GetPublicCompositionEmbed403Response.js +48 -0
- package/dist/esm/models/GetPublicCompositionEmbed403ResponseDetails.d.ts +46 -0
- package/dist/esm/models/GetPublicCompositionEmbed403ResponseDetails.js +50 -0
- package/dist/esm/models/GetPublicCompositionEmbed404Response.d.ts +47 -0
- package/dist/esm/models/GetPublicCompositionEmbed404Response.js +51 -0
- package/dist/esm/models/GetPublicCompositionEmbed429Response.d.ts +38 -0
- package/dist/esm/models/GetPublicCompositionEmbed429Response.js +43 -0
- package/dist/esm/models/IssuePartnerInvoiceRequest.d.ts +14 -1
- package/dist/esm/models/IssuePartnerInvoiceRequest.js +2 -0
- package/dist/esm/models/IssuedPartnerInvoice.d.ts +6 -0
- package/dist/esm/models/IssuedPartnerInvoice.js +4 -0
- package/dist/esm/models/ManagedUserEntryItem.d.ts +4 -1
- package/dist/esm/models/MyPartner.d.ts +7 -0
- package/dist/esm/models/MyPartner.js +4 -0
- package/dist/esm/models/MyPartners.d.ts +9 -1
- package/dist/esm/models/MyPartners.js +6 -1
- package/dist/esm/models/OrganizationsOrgIdBillingGet200ResponseData.d.ts +25 -5
- package/dist/esm/models/OrganizationsOrgIdBillingGet200ResponseData.js +9 -0
- package/dist/esm/models/Partner.d.ts +7 -0
- package/dist/esm/models/Partner.js +2 -0
- package/dist/esm/models/PartnerActivation.d.ts +1 -1
- package/dist/esm/models/PartnerBillingOverviewOperationalCredits.d.ts +0 -14
- package/dist/esm/models/PartnerBillingOverviewOperationalCredits.js +0 -4
- package/dist/esm/models/PartnerBillingProfile.d.ts +1 -1
- package/dist/esm/models/PartnerContract.d.ts +15 -3
- package/dist/esm/models/PartnerContract.js +6 -2
- package/dist/esm/models/PartnerCustomization.d.ts +15 -3
- package/dist/esm/models/PartnerCustomization.js +6 -2
- package/dist/esm/models/PartnerDetails.d.ts +7 -0
- package/dist/esm/models/PartnerDetails.js +2 -0
- package/dist/esm/models/PartnerEntryContextSecret.d.ts +39 -0
- package/dist/esm/models/PartnerEntryContextSecret.js +48 -0
- package/dist/esm/models/PartnerEntryContextSigning.d.ts +62 -0
- package/dist/esm/models/PartnerEntryContextSigning.js +63 -0
- package/dist/esm/models/PartnerExtraCreditsInvoice.d.ts +98 -0
- package/dist/esm/models/PartnerExtraCreditsInvoice.js +87 -0
- package/dist/esm/models/PartnerInvoiceSchedule.d.ts +66 -0
- package/dist/esm/models/PartnerInvoiceSchedule.js +67 -0
- package/dist/esm/models/PartnerInvoiceScheduleContract.d.ts +68 -0
- package/dist/esm/models/PartnerInvoiceScheduleContract.js +67 -0
- package/dist/esm/models/PartnerInvoiceScheduleNext.d.ts +94 -0
- package/dist/esm/models/PartnerInvoiceScheduleNext.js +91 -0
- package/dist/esm/models/PartnerInvoiceScheduleNextPeriod.d.ts +38 -0
- package/dist/esm/models/PartnerInvoiceScheduleNextPeriod.js +47 -0
- package/dist/esm/models/PartnerInvoiceScheduleOverdue.d.ts +38 -0
- package/dist/esm/models/PartnerInvoiceScheduleOverdue.js +47 -0
- package/dist/esm/models/PartnerInvoiceSchedulePeriod.d.ts +101 -0
- package/dist/esm/models/PartnerInvoiceSchedulePeriod.js +91 -0
- package/dist/esm/models/PartnerNotification.d.ts +1 -1
- package/dist/esm/models/PartnerNotificationEventType.d.ts +2 -0
- package/dist/esm/models/PartnerNotificationEventType.js +2 -0
- package/dist/esm/models/PartnerNotificationTestEventRequest.d.ts +33 -0
- package/dist/esm/models/PartnerNotificationTestEventRequest.js +44 -0
- package/dist/esm/models/PartnerNotificationTestEventResult.d.ts +50 -0
- package/dist/esm/models/PartnerNotificationTestEventResult.js +53 -0
- package/dist/esm/models/PartnerUpdateResult.d.ts +8 -16
- package/dist/esm/models/PartnerUpdateResult.js +2 -5
- package/dist/esm/models/PartnerWithWarnings.d.ts +7 -0
- package/dist/esm/models/PartnerWithWarnings.js +2 -0
- package/dist/esm/models/PersonalExtraStorage.d.ts +92 -0
- package/dist/esm/models/PersonalExtraStorage.js +83 -0
- package/dist/esm/models/PersonalExtraStorageBlock.d.ts +56 -0
- package/dist/esm/models/PersonalExtraStorageBlock.js +57 -0
- package/dist/esm/models/PersonalStorage.d.ts +80 -0
- package/dist/esm/models/PersonalStorage.js +73 -0
- package/dist/esm/models/PersonalStoragePack.d.ts +100 -0
- package/dist/esm/models/PersonalStoragePack.js +84 -0
- package/dist/esm/models/PostPublicCompositionEmbedStatus200Response.d.ts +39 -0
- package/dist/esm/models/PostPublicCompositionEmbedStatus200Response.js +44 -0
- package/dist/esm/models/PostPublicCompositionEmbedStatus200ResponseData.d.ts +45 -0
- package/dist/esm/models/PostPublicCompositionEmbedStatus200ResponseData.js +51 -0
- package/dist/esm/models/PostPublicCompositionEmbedStatus429Response.d.ts +32 -0
- package/dist/esm/models/PostPublicCompositionEmbedStatus429Response.js +41 -0
- package/dist/esm/models/PostPublicCompositionEmbedStatusRequest.d.ts +32 -0
- package/dist/esm/models/PostPublicCompositionEmbedStatusRequest.js +43 -0
- package/dist/esm/models/PublicCompositionEntryRequest.d.ts +1 -1
- package/dist/esm/models/RequestExtraCredits.d.ts +33 -0
- package/dist/esm/models/RequestExtraCredits.js +43 -0
- package/dist/esm/models/StorageChange.d.ts +4 -3
- package/dist/esm/models/SurfaceConversionResult.d.ts +85 -0
- package/dist/esm/models/SurfaceConversionResult.js +76 -0
- package/dist/esm/models/SurfaceConversionResultSubscription.d.ts +82 -0
- package/dist/esm/models/SurfaceConversionResultSubscription.js +62 -0
- package/dist/esm/models/UpdatePartnerCustomizationRequest.d.ts +3 -3
- package/dist/esm/models/UpdatePartnerCustomizationRequest.js +2 -2
- package/dist/esm/models/UpdatePartnerEntryContextSigningRequest.d.ts +32 -0
- package/dist/esm/models/UpdatePartnerEntryContextSigningRequest.js +43 -0
- package/dist/esm/models/UpdatePartnerRequest.d.ts +7 -24
- package/dist/esm/models/UpdatePartnerRequest.js +2 -8
- package/dist/esm/models/index.d.ts +37 -86
- package/dist/esm/models/index.js +37 -86
- package/dist/models/BillingUsersUserIdStorageCancelPackPostRequest.d.ts +40 -0
- package/dist/models/BillingUsersUserIdStorageCancelPackPostRequest.js +50 -0
- package/dist/models/BillingUsersUserIdStorageGet200Response.d.ts +39 -0
- package/dist/models/BillingUsersUserIdStorageGet200Response.js +51 -0
- package/dist/models/BillingUsersUserIdStorageGet200ResponseData.d.ts +33 -0
- package/dist/models/BillingUsersUserIdStorageGet200ResponseData.js +49 -0
- package/dist/models/Composition.d.ts +12 -0
- package/dist/models/Composition.js +2 -0
- package/dist/models/CompositionDataSource.d.ts +41 -0
- package/dist/models/CompositionDataSource.js +54 -0
- package/dist/models/CompositionEntriesReading.d.ts +20 -4
- package/dist/models/CompositionEntriesReading.js +3 -0
- package/dist/models/CompositionEntryAggregateTally.d.ts +15 -8
- package/dist/models/CompositionEntryAggregatesBlock.d.ts +10 -0
- package/dist/models/CompositionEntryItem.d.ts +4 -1
- package/dist/models/CompositionEntryItemsMeta.d.ts +8 -0
- package/dist/models/ConvertSoloToTeams200Response.d.ts +39 -0
- package/dist/models/ConvertSoloToTeams200Response.js +51 -0
- package/dist/models/CreatePartnerRequest.d.ts +7 -0
- package/dist/models/CreatePartnerRequest.js +2 -0
- package/dist/models/DeleteCompositionDataSource200Response.d.ts +32 -0
- package/dist/models/DeleteCompositionDataSource200Response.js +50 -0
- package/dist/models/GetCompositionContentSchema200Response.d.ts +2 -2
- package/dist/models/GetOrganizationPricing200ResponseDataStorage.d.ts +3 -2
- package/dist/models/GetOrganizationStorageUsage200ResponseDataStorageUsage.d.ts +5 -5
- package/dist/models/GetPartnerCreditTransactions200Response.d.ts +39 -0
- package/dist/models/GetPartnerCreditTransactions200Response.js +51 -0
- package/dist/models/GetPublicCompositionEmbed200Response.d.ts +106 -0
- package/dist/models/GetPublicCompositionEmbed200Response.js +74 -0
- package/dist/models/GetPublicCompositionEmbed200ResponseDataSource.d.ts +38 -0
- package/dist/models/GetPublicCompositionEmbed200ResponseDataSource.js +50 -0
- package/dist/models/GetPublicCompositionEmbed200ResponseDirect.d.ts +44 -0
- package/dist/models/GetPublicCompositionEmbed200ResponseDirect.js +52 -0
- package/dist/models/GetPublicCompositionEmbed403Response.d.ts +51 -0
- package/dist/models/GetPublicCompositionEmbed403Response.js +55 -0
- package/dist/models/GetPublicCompositionEmbed403ResponseDetails.d.ts +46 -0
- package/dist/models/GetPublicCompositionEmbed403ResponseDetails.js +58 -0
- package/dist/models/GetPublicCompositionEmbed404Response.d.ts +47 -0
- package/dist/models/GetPublicCompositionEmbed404Response.js +59 -0
- package/dist/models/GetPublicCompositionEmbed429Response.d.ts +38 -0
- package/dist/models/GetPublicCompositionEmbed429Response.js +50 -0
- package/dist/models/IssuePartnerInvoiceRequest.d.ts +14 -1
- package/dist/models/IssuePartnerInvoiceRequest.js +2 -0
- package/dist/models/IssuedPartnerInvoice.d.ts +6 -0
- package/dist/models/IssuedPartnerInvoice.js +4 -0
- package/dist/models/ManagedUserEntryItem.d.ts +4 -1
- package/dist/models/MyPartner.d.ts +7 -0
- package/dist/models/MyPartner.js +4 -0
- package/dist/models/MyPartners.d.ts +9 -1
- package/dist/models/MyPartners.js +6 -1
- package/dist/models/OrganizationsOrgIdBillingGet200ResponseData.d.ts +25 -5
- package/dist/models/OrganizationsOrgIdBillingGet200ResponseData.js +10 -0
- package/dist/models/Partner.d.ts +7 -0
- package/dist/models/Partner.js +2 -0
- package/dist/models/PartnerActivation.d.ts +1 -1
- package/dist/models/PartnerBillingOverviewOperationalCredits.d.ts +0 -14
- package/dist/models/PartnerBillingOverviewOperationalCredits.js +0 -4
- package/dist/models/PartnerBillingProfile.d.ts +1 -1
- package/dist/models/PartnerContract.d.ts +15 -3
- package/dist/models/PartnerContract.js +6 -2
- package/dist/models/PartnerCustomization.d.ts +15 -3
- package/dist/models/PartnerCustomization.js +6 -2
- package/dist/models/PartnerDetails.d.ts +7 -0
- package/dist/models/PartnerDetails.js +2 -0
- package/dist/models/PartnerEntryContextSecret.d.ts +39 -0
- package/dist/models/PartnerEntryContextSecret.js +55 -0
- package/dist/models/PartnerEntryContextSigning.d.ts +62 -0
- package/dist/models/PartnerEntryContextSigning.js +70 -0
- package/dist/models/PartnerExtraCreditsInvoice.d.ts +98 -0
- package/dist/models/PartnerExtraCreditsInvoice.js +94 -0
- package/dist/models/PartnerInvoiceSchedule.d.ts +66 -0
- package/dist/models/PartnerInvoiceSchedule.js +74 -0
- package/dist/models/PartnerInvoiceScheduleContract.d.ts +68 -0
- package/dist/models/PartnerInvoiceScheduleContract.js +74 -0
- package/dist/models/PartnerInvoiceScheduleNext.d.ts +94 -0
- package/dist/models/PartnerInvoiceScheduleNext.js +99 -0
- package/dist/models/PartnerInvoiceScheduleNextPeriod.d.ts +38 -0
- package/dist/models/PartnerInvoiceScheduleNextPeriod.js +54 -0
- package/dist/models/PartnerInvoiceScheduleOverdue.d.ts +38 -0
- package/dist/models/PartnerInvoiceScheduleOverdue.js +54 -0
- package/dist/models/PartnerInvoiceSchedulePeriod.d.ts +101 -0
- package/dist/models/PartnerInvoiceSchedulePeriod.js +99 -0
- package/dist/models/PartnerNotification.d.ts +1 -1
- package/dist/models/PartnerNotificationEventType.d.ts +2 -0
- package/dist/models/PartnerNotificationEventType.js +2 -0
- package/dist/models/PartnerNotificationTestEventRequest.d.ts +33 -0
- package/dist/models/PartnerNotificationTestEventRequest.js +51 -0
- package/dist/models/PartnerNotificationTestEventResult.d.ts +50 -0
- package/dist/models/PartnerNotificationTestEventResult.js +60 -0
- package/dist/models/PartnerUpdateResult.d.ts +8 -16
- package/dist/models/PartnerUpdateResult.js +2 -5
- package/dist/models/PartnerWithWarnings.d.ts +7 -0
- package/dist/models/PartnerWithWarnings.js +2 -0
- package/dist/models/PersonalExtraStorage.d.ts +92 -0
- package/dist/models/PersonalExtraStorage.js +91 -0
- package/dist/models/PersonalExtraStorageBlock.d.ts +56 -0
- package/dist/models/PersonalExtraStorageBlock.js +65 -0
- package/dist/models/PersonalStorage.d.ts +80 -0
- package/dist/models/PersonalStorage.js +80 -0
- package/dist/models/PersonalStoragePack.d.ts +100 -0
- package/dist/models/PersonalStoragePack.js +92 -0
- package/dist/models/PostPublicCompositionEmbedStatus200Response.d.ts +39 -0
- package/dist/models/PostPublicCompositionEmbedStatus200Response.js +51 -0
- package/dist/models/PostPublicCompositionEmbedStatus200ResponseData.d.ts +45 -0
- package/dist/models/PostPublicCompositionEmbedStatus200ResponseData.js +59 -0
- package/dist/models/PostPublicCompositionEmbedStatus429Response.d.ts +32 -0
- package/dist/models/PostPublicCompositionEmbedStatus429Response.js +48 -0
- package/dist/models/PostPublicCompositionEmbedStatusRequest.d.ts +32 -0
- package/dist/models/PostPublicCompositionEmbedStatusRequest.js +50 -0
- package/dist/models/PublicCompositionEntryRequest.d.ts +1 -1
- package/dist/models/RequestExtraCredits.d.ts +33 -0
- package/dist/models/RequestExtraCredits.js +50 -0
- package/dist/models/StorageChange.d.ts +4 -3
- package/dist/models/SurfaceConversionResult.d.ts +85 -0
- package/dist/models/SurfaceConversionResult.js +84 -0
- package/dist/models/SurfaceConversionResultSubscription.d.ts +82 -0
- package/dist/models/SurfaceConversionResultSubscription.js +70 -0
- package/dist/models/UpdatePartnerCustomizationRequest.d.ts +3 -3
- package/dist/models/UpdatePartnerCustomizationRequest.js +2 -2
- package/dist/models/UpdatePartnerEntryContextSigningRequest.d.ts +32 -0
- package/dist/models/UpdatePartnerEntryContextSigningRequest.js +50 -0
- package/dist/models/UpdatePartnerRequest.d.ts +7 -24
- package/dist/models/UpdatePartnerRequest.js +2 -8
- package/dist/models/index.d.ts +37 -86
- package/dist/models/index.js +37 -86
- package/package.json +3 -2
package/dist/apis/PartnerApi.js
CHANGED
|
@@ -30,7 +30,7 @@ const index_1 = require("../models/index");
|
|
|
30
30
|
*/
|
|
31
31
|
class PartnerApi extends runtime.BaseAPI {
|
|
32
32
|
/**
|
|
33
|
-
* Adds a website to an account\'s own list. Give a website name such as `example.com`, or `*.example.com` for a website and all of its subdomains. A scheme, a port, a path, capital letters and a leading `www.` are dropped, so `https://www.Example.com/shop` is kept as `example.com`, and `example.com` covers `www.example.com` too. Something that is not a website name is refused, not stored. Until the first website is added nothing is restricted, and a widget can be shown anywhere. Once the list has one, a widget of the account is shown on the listed websites (and on Widgetic\'s own) and nowhere else. A page on your own machine (`localhost`, `127.0.0.1` or `[::1]`, on any port) is always allowed, so there is nothing to add to test locally. A change can take about 15 seconds to reach every server. The list is a safeguard against other websites showing your widgets in a visitor\'s browser. It is not access control: anyone who knows a widget\'s id can still fetch its published content with a plain request that names no website. An account can list at most 50 websites. Use `*.example.com` for a website and all of its subdomains instead of listing each one.
|
|
33
|
+
* Adds a website to an account\'s own list. Give a website name such as `example.com`, or `*.example.com` for a website and all of its subdomains. A scheme, a port, a path, capital letters and a leading `www.` are dropped, so `https://www.Example.com/shop` is kept as `example.com`, and `example.com` covers `www.example.com` too. Something that is not a website name is refused, not stored. Until the first website is added nothing is restricted, and a widget can be shown anywhere. Once the list has one, a widget of the account is shown on the listed websites (and on Widgetic\'s own) and nowhere else. A page on your own machine (`localhost`, `127.0.0.1` or `[::1]`, on any port) is always allowed, so there is nothing to add to test locally. So is the website where a partner your account administers integrates Widgetic, with every subdomain of it (`platformDomain` in the answer of `GET /partners/mine`), so there is nothing to add for it either and a list can never lock it out. A change can take about 15 seconds to reach every server. The list is a safeguard against other websites showing your widgets in a visitor\'s browser. It is not access control: anyone who knows a widget\'s id can still fetch its published content with a plain request that names no website. An account can list at most 50 websites. Use `*.example.com` for a website and all of its subdomains instead of listing each one.
|
|
34
34
|
* Allow a website to show your widgets
|
|
35
35
|
*/
|
|
36
36
|
addPersonalWorkspaceDomainRaw(requestParameters, initOverrides) {
|
|
@@ -62,7 +62,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Adds a website to an account\'s own list. Give a website name such as `example.com`, or `*.example.com` for a website and all of its subdomains. A scheme, a port, a path, capital letters and a leading `www.` are dropped, so `https://www.Example.com/shop` is kept as `example.com`, and `example.com` covers `www.example.com` too. Something that is not a website name is refused, not stored. Until the first website is added nothing is restricted, and a widget can be shown anywhere. Once the list has one, a widget of the account is shown on the listed websites (and on Widgetic\'s own) and nowhere else. A page on your own machine (`localhost`, `127.0.0.1` or `[::1]`, on any port) is always allowed, so there is nothing to add to test locally. A change can take about 15 seconds to reach every server. The list is a safeguard against other websites showing your widgets in a visitor\'s browser. It is not access control: anyone who knows a widget\'s id can still fetch its published content with a plain request that names no website. An account can list at most 50 websites. Use `*.example.com` for a website and all of its subdomains instead of listing each one.
|
|
65
|
+
* Adds a website to an account\'s own list. Give a website name such as `example.com`, or `*.example.com` for a website and all of its subdomains. A scheme, a port, a path, capital letters and a leading `www.` are dropped, so `https://www.Example.com/shop` is kept as `example.com`, and `example.com` covers `www.example.com` too. Something that is not a website name is refused, not stored. Until the first website is added nothing is restricted, and a widget can be shown anywhere. Once the list has one, a widget of the account is shown on the listed websites (and on Widgetic\'s own) and nowhere else. A page on your own machine (`localhost`, `127.0.0.1` or `[::1]`, on any port) is always allowed, so there is nothing to add to test locally. So is the website where a partner your account administers integrates Widgetic, with every subdomain of it (`platformDomain` in the answer of `GET /partners/mine`), so there is nothing to add for it either and a list can never lock it out. A change can take about 15 seconds to reach every server. The list is a safeguard against other websites showing your widgets in a visitor\'s browser. It is not access control: anyone who knows a widget\'s id can still fetch its published content with a plain request that names no website. An account can list at most 50 websites. Use `*.example.com` for a website and all of its subdomains instead of listing each one.
|
|
66
66
|
* Allow a website to show your widgets
|
|
67
67
|
*/
|
|
68
68
|
addPersonalWorkspaceDomain(requestParameters, initOverrides) {
|
|
@@ -344,7 +344,52 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
/**
|
|
347
|
-
*
|
|
347
|
+
* Asks Widgetic for an invoice for extra credits, on top of the credits of the contract. Name the dollars; the invoice is for the most whole credits they buy at the **list price** of a credit (the price a contract may lower belongs to the contract), so it is never for more than you asked: 12.34 buys 123 credits and the invoice says 12.30. The smallest purchase is 10 dollars and one request buys at most 100000 (ask Widgetic for an invoice for more). Pay the invoice with the link in the answer. When it is paid the credits are added **once, for good**, to the account of the person who administers the partner, which is the account everything the partner builds is charged to (`getPartnerCreditBalance` shows it). Extra credits **do not expire**, unlike the credits of a contract period, which end with it. Nothing is added before the invoice is paid, and an unpaid invoice for extra credits never stops the partner: only an unpaid invoice of the contract does (`payment_arrears`). Allowed whatever the partner\'s standing: a partner that has run out of credits, or is stopped for an unpaid contract invoice, can still buy. No contract is needed. An `Idempotency-Key` is required, and it is what makes a retry safe: the same key with the same body returns the invoice already issued, the same key with a different body is refused with 422, and a duplicate that arrives while the first is still running is refused with 409. Use one key per purchase you mean to make, and a new key for the next one. At most 10 requests an hour. Who may ask: the person who administers the partner, or a Widgetic administrator. A key limited to scopes needs `billing:write`.
|
|
348
|
+
* Buy extra credits for a partner
|
|
349
|
+
*/
|
|
350
|
+
createPartnerExtraCreditsInvoiceRaw(requestParameters, initOverrides) {
|
|
351
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
+
if (requestParameters['partnerId'] == null) {
|
|
353
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling createPartnerExtraCreditsInvoice().');
|
|
354
|
+
}
|
|
355
|
+
if (requestParameters['requestExtraCredits'] == null) {
|
|
356
|
+
throw new runtime.RequiredError('requestExtraCredits', 'Required parameter "requestExtraCredits" was null or undefined when calling createPartnerExtraCreditsInvoice().');
|
|
357
|
+
}
|
|
358
|
+
const queryParameters = {};
|
|
359
|
+
const headerParameters = {};
|
|
360
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
361
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
362
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
363
|
+
}
|
|
364
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
365
|
+
const token = this.configuration.accessToken;
|
|
366
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
367
|
+
if (tokenString) {
|
|
368
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
const response = yield this.request({
|
|
372
|
+
path: `/partners/{partnerId}/credits/extra-invoice`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
373
|
+
method: 'POST',
|
|
374
|
+
headers: headerParameters,
|
|
375
|
+
query: queryParameters,
|
|
376
|
+
body: (0, index_1.RequestExtraCreditsToJSON)(requestParameters['requestExtraCredits']),
|
|
377
|
+
}, initOverrides);
|
|
378
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerExtraCreditsInvoiceFromJSON)(jsonValue));
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Asks Widgetic for an invoice for extra credits, on top of the credits of the contract. Name the dollars; the invoice is for the most whole credits they buy at the **list price** of a credit (the price a contract may lower belongs to the contract), so it is never for more than you asked: 12.34 buys 123 credits and the invoice says 12.30. The smallest purchase is 10 dollars and one request buys at most 100000 (ask Widgetic for an invoice for more). Pay the invoice with the link in the answer. When it is paid the credits are added **once, for good**, to the account of the person who administers the partner, which is the account everything the partner builds is charged to (`getPartnerCreditBalance` shows it). Extra credits **do not expire**, unlike the credits of a contract period, which end with it. Nothing is added before the invoice is paid, and an unpaid invoice for extra credits never stops the partner: only an unpaid invoice of the contract does (`payment_arrears`). Allowed whatever the partner\'s standing: a partner that has run out of credits, or is stopped for an unpaid contract invoice, can still buy. No contract is needed. An `Idempotency-Key` is required, and it is what makes a retry safe: the same key with the same body returns the invoice already issued, the same key with a different body is refused with 422, and a duplicate that arrives while the first is still running is refused with 409. Use one key per purchase you mean to make, and a new key for the next one. At most 10 requests an hour. Who may ask: the person who administers the partner, or a Widgetic administrator. A key limited to scopes needs `billing:write`.
|
|
383
|
+
* Buy extra credits for a partner
|
|
384
|
+
*/
|
|
385
|
+
createPartnerExtraCreditsInvoice(requestParameters, initOverrides) {
|
|
386
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
387
|
+
const response = yield this.createPartnerExtraCreditsInvoiceRaw(requestParameters, initOverrides);
|
|
388
|
+
return yield response.value();
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Makes a new API key for an account and returns its secret in `key`. That is the only time the secret is shown: Widgetic keeps a hash, so a key that was not stored cannot be recovered, only replaced. To rotate a key, make the new one, switch the integration over to it, then delete the old one. Only a person signed in on widgetic.com can make a key: a request made with an API key, or with an SDK token, is refused with 403. That way a leaked key cannot be used to make a second one that survives its revocation. Make keys from the dashboard; a key can still list, rename, switch off and delete keys. An `Idempotency-Key` header is required (8 to 50 characters: letters, digits, `-` and `_`). A retry with the same header and the same body returns the same answer instead of making a second key, and the same header with a different body is refused with 422. Make keys one at a time: two requests for the same account that run at the same moment can overwrite each other. A key can be limited to what it needs. Send a `preset` (`read_only`, `content` or `full_access`) or a list of `scopes`, never both. Send neither for a key that can do everything its owner can, as every key made before scopes existed. A limited key is refused with 403 and the code `API_KEY_SCOPE_MISSING` on anything outside its scopes, so a key held by a build server or by a partner\'s backend can be given only the part of the API it uses. The scopes of a key are fixed when it is made: to widen one, make a new key and delete the old one. A limited key cannot make, change or delete keys, exchange tokens or reach the administration routes. The list of scopes is in the `ApiKeyScope` schema. An account can hold at most 25 keys, except a partner account, which has no limit: what a partner\'s keys do is paid for from its own credits, however many integrations it runs. An account on a plan without API access cannot make one (a partner account is not asked about a plan).
|
|
348
393
|
* Create an API key
|
|
349
394
|
*/
|
|
350
395
|
createUserApiKeyRaw(requestParameters, initOverrides) {
|
|
@@ -379,7 +424,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
379
424
|
});
|
|
380
425
|
}
|
|
381
426
|
/**
|
|
382
|
-
* Makes a new API key for an account and returns its secret in `key`. That is the only time the secret is shown: Widgetic keeps a hash, so a key that was not stored cannot be recovered, only replaced. To rotate a key, make the new one, switch the integration over to it, then delete the old one. Only a person signed in on widgetic.com can make a key: a request made with an API key, or with an SDK token, is refused with 403. That way a leaked key cannot be used to make a second one that survives its revocation. Make keys from the dashboard; a key can still list, rename, switch off and delete keys. An `Idempotency-Key` header is required (8 to 50 characters: letters, digits, `-` and `_`). A retry with the same header and the same body returns the same answer instead of making a second key, and the same header with a different body is refused with 422. Make keys one at a time: two requests for the same account that run at the same moment can overwrite each other. A key can be limited to what it needs. Send a `preset` (`read_only`, `content` or `full_access`) or a list of `scopes`, never both. Send neither for a key that can do everything its owner can, as every key made before scopes existed. A limited key is refused with 403 and the code `API_KEY_SCOPE_MISSING` on anything outside its scopes, so a key held by a build server or by a partner\'s backend can be given only the part of the API it uses. The scopes of a key are fixed when it is made: to widen one, make a new key and delete the old one. A limited key cannot make, change or delete keys, exchange tokens or reach the administration routes. The list of scopes is in the `ApiKeyScope` schema. An account can hold at most 25 keys. An account on a plan without API access cannot make one.
|
|
427
|
+
* Makes a new API key for an account and returns its secret in `key`. That is the only time the secret is shown: Widgetic keeps a hash, so a key that was not stored cannot be recovered, only replaced. To rotate a key, make the new one, switch the integration over to it, then delete the old one. Only a person signed in on widgetic.com can make a key: a request made with an API key, or with an SDK token, is refused with 403. That way a leaked key cannot be used to make a second one that survives its revocation. Make keys from the dashboard; a key can still list, rename, switch off and delete keys. An `Idempotency-Key` header is required (8 to 50 characters: letters, digits, `-` and `_`). A retry with the same header and the same body returns the same answer instead of making a second key, and the same header with a different body is refused with 422. Make keys one at a time: two requests for the same account that run at the same moment can overwrite each other. A key can be limited to what it needs. Send a `preset` (`read_only`, `content` or `full_access`) or a list of `scopes`, never both. Send neither for a key that can do everything its owner can, as every key made before scopes existed. A limited key is refused with 403 and the code `API_KEY_SCOPE_MISSING` on anything outside its scopes, so a key held by a build server or by a partner\'s backend can be given only the part of the API it uses. The scopes of a key are fixed when it is made: to widen one, make a new key and delete the old one. A limited key cannot make, change or delete keys, exchange tokens or reach the administration routes. The list of scopes is in the `ApiKeyScope` schema. An account can hold at most 25 keys, except a partner account, which has no limit: what a partner\'s keys do is paid for from its own credits, however many integrations it runs. An account on a plan without API access cannot make one (a partner account is not asked about a plan).
|
|
383
428
|
* Create an API key
|
|
384
429
|
*/
|
|
385
430
|
createUserApiKey(requestParameters, initOverrides) {
|
|
@@ -514,6 +559,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
514
559
|
});
|
|
515
560
|
}
|
|
516
561
|
/**
|
|
562
|
+
* Removes the binding. Asking again, or asking for a composition that had none, is not an error: the composition has no data source afterwards, and that is all `removed: true` says.
|
|
517
563
|
* Remove the composition data source binding
|
|
518
564
|
*/
|
|
519
565
|
deleteCompositionDataSourceRaw(requestParameters, initOverrides) {
|
|
@@ -539,15 +585,17 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
539
585
|
headers: headerParameters,
|
|
540
586
|
query: queryParameters,
|
|
541
587
|
}, initOverrides);
|
|
542
|
-
return new runtime.
|
|
588
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DeleteCompositionDataSource200ResponseFromJSON)(jsonValue));
|
|
543
589
|
});
|
|
544
590
|
}
|
|
545
591
|
/**
|
|
592
|
+
* Removes the binding. Asking again, or asking for a composition that had none, is not an error: the composition has no data source afterwards, and that is all `removed: true` says.
|
|
546
593
|
* Remove the composition data source binding
|
|
547
594
|
*/
|
|
548
595
|
deleteCompositionDataSource(requestParameters, initOverrides) {
|
|
549
596
|
return __awaiter(this, void 0, void 0, function* () {
|
|
550
|
-
yield this.deleteCompositionDataSourceRaw(requestParameters, initOverrides);
|
|
597
|
+
const response = yield this.deleteCompositionDataSourceRaw(requestParameters, initOverrides);
|
|
598
|
+
return yield response.value();
|
|
551
599
|
});
|
|
552
600
|
}
|
|
553
601
|
/**
|
|
@@ -965,7 +1013,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
965
1013
|
});
|
|
966
1014
|
}
|
|
967
1015
|
/**
|
|
968
|
-
* Retrieves a specific composition by its ID.
|
|
1016
|
+
* Retrieves a specific composition by its ID. The answer carries `direct`, which says whether the widget the composition is made from is drawn straight into your page (`true`) or inside a frame (`false`), or `null` while the widget has no published version. Read it before you go live: a widget drawn without a frame writes its entries from your own page, so the public entry route accepts them only from a website on the composition\'s allowed list, and refuses them while that list is empty (the public JSON of the composition stays open to every website). A widget in a frame writes from Widgetic\'s own frame and is accepted whatever the list says.
|
|
969
1017
|
* Get Composition
|
|
970
1018
|
*/
|
|
971
1019
|
getCompositionByIdRaw(requestParameters, initOverrides) {
|
|
@@ -992,7 +1040,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
992
1040
|
});
|
|
993
1041
|
}
|
|
994
1042
|
/**
|
|
995
|
-
* Retrieves a specific composition by its ID.
|
|
1043
|
+
* Retrieves a specific composition by its ID. The answer carries `direct`, which says whether the widget the composition is made from is drawn straight into your page (`true`) or inside a frame (`false`), or `null` while the widget has no published version. Read it before you go live: a widget drawn without a frame writes its entries from your own page, so the public entry route accepts them only from a website on the composition\'s allowed list, and refuses them while that list is empty (the public JSON of the composition stays open to every website). A widget in a frame writes from Widgetic\'s own frame and is accepted whatever the list says.
|
|
996
1044
|
* Get Composition
|
|
997
1045
|
*/
|
|
998
1046
|
getCompositionById(requestParameters, initOverrides) {
|
|
@@ -1076,6 +1124,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1076
1124
|
});
|
|
1077
1125
|
}
|
|
1078
1126
|
/**
|
|
1127
|
+
* The data source that is bound to the composition: `url` and `refreshSeconds`. The answer\'s `data` is `null` when none is bound, and also when what is stored does not pass the rule for a public https address (a binding written by another path, such as the general embed-settings update, is never shown to a page unless it passes the same checks as this route).
|
|
1079
1128
|
* Read the composition data source binding
|
|
1080
1129
|
*/
|
|
1081
1130
|
getCompositionDataSourceRaw(requestParameters, initOverrides) {
|
|
@@ -1098,15 +1147,17 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1098
1147
|
headers: headerParameters,
|
|
1099
1148
|
query: queryParameters,
|
|
1100
1149
|
}, initOverrides);
|
|
1101
|
-
return new runtime.
|
|
1150
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CompositionDataSourceFromJSON)(jsonValue));
|
|
1102
1151
|
});
|
|
1103
1152
|
}
|
|
1104
1153
|
/**
|
|
1154
|
+
* The data source that is bound to the composition: `url` and `refreshSeconds`. The answer\'s `data` is `null` when none is bound, and also when what is stored does not pass the rule for a public https address (a binding written by another path, such as the general embed-settings update, is never shown to a page unless it passes the same checks as this route).
|
|
1105
1155
|
* Read the composition data source binding
|
|
1106
1156
|
*/
|
|
1107
1157
|
getCompositionDataSource(requestParameters, initOverrides) {
|
|
1108
1158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1109
|
-
yield this.getCompositionDataSourceRaw(requestParameters, initOverrides);
|
|
1159
|
+
const response = yield this.getCompositionDataSourceRaw(requestParameters, initOverrides);
|
|
1160
|
+
return yield response.value();
|
|
1110
1161
|
});
|
|
1111
1162
|
}
|
|
1112
1163
|
/**
|
|
@@ -1492,7 +1543,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1492
1543
|
});
|
|
1493
1544
|
}
|
|
1494
1545
|
/**
|
|
1495
|
-
* Retrieves
|
|
1546
|
+
* Retrieves the older partner wallet\'s figures (`operationalCredits`), the partner\'s contract terms (`partnerCustomization`, the same fields as `getPartnerContract`) and billing integration status. Internal negotiation notes are not part of it. `operationalCredits` is **not** what the partner spends: that is the balance of its administrator\'s account, read with `getPartnerCreditBalance` (and its ledger with `getPartnerCreditTransactions`). The wallet it shows was kept before credits followed the account, and nothing adds to it any more.
|
|
1496
1547
|
* Get comprehensive partner billing overview
|
|
1497
1548
|
*/
|
|
1498
1549
|
getPartnerBillingOverviewRaw(requestParameters, initOverrides) {
|
|
@@ -1519,7 +1570,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1519
1570
|
});
|
|
1520
1571
|
}
|
|
1521
1572
|
/**
|
|
1522
|
-
* Retrieves
|
|
1573
|
+
* Retrieves the older partner wallet\'s figures (`operationalCredits`), the partner\'s contract terms (`partnerCustomization`, the same fields as `getPartnerContract`) and billing integration status. Internal negotiation notes are not part of it. `operationalCredits` is **not** what the partner spends: that is the balance of its administrator\'s account, read with `getPartnerCreditBalance` (and its ledger with `getPartnerCreditTransactions`). The wallet it shows was kept before credits followed the account, and nothing adds to it any more.
|
|
1523
1574
|
* Get comprehensive partner billing overview
|
|
1524
1575
|
*/
|
|
1525
1576
|
getPartnerBillingOverview(requestParameters, initOverrides) {
|
|
@@ -1564,6 +1615,89 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1564
1615
|
return yield response.value();
|
|
1565
1616
|
});
|
|
1566
1617
|
}
|
|
1618
|
+
/**
|
|
1619
|
+
* Returns the credits the partner has: the balance of the account of the person who administers it, and how much of that is reserved by operations that are still running. That is the account its customers\' editor sessions and its own API calls spend from, and the one a paid invoice that carries credits adds to, so it is the same balance `getUserCreditBalance` reads for that person. The partner wallet that was kept before credits followed the account is not read here: nothing adds to it or spends from it any more. A partner with no administrator reads a balance of 0. Access: the person who administers the partner, or a Widgetic administrator.
|
|
1620
|
+
* Get partner credit balance
|
|
1621
|
+
*/
|
|
1622
|
+
getPartnerCreditBalanceRaw(requestParameters, initOverrides) {
|
|
1623
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1624
|
+
if (requestParameters['partnerId'] == null) {
|
|
1625
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling getPartnerCreditBalance().');
|
|
1626
|
+
}
|
|
1627
|
+
const queryParameters = {};
|
|
1628
|
+
const headerParameters = {};
|
|
1629
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1630
|
+
const token = this.configuration.accessToken;
|
|
1631
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
1632
|
+
if (tokenString) {
|
|
1633
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
const response = yield this.request({
|
|
1637
|
+
path: `/partners/{partnerId}/credits/balance`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
1638
|
+
method: 'GET',
|
|
1639
|
+
headers: headerParameters,
|
|
1640
|
+
query: queryParameters,
|
|
1641
|
+
}, initOverrides);
|
|
1642
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AccountCreditBalanceFromJSON)(jsonValue));
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Returns the credits the partner has: the balance of the account of the person who administers it, and how much of that is reserved by operations that are still running. That is the account its customers\' editor sessions and its own API calls spend from, and the one a paid invoice that carries credits adds to, so it is the same balance `getUserCreditBalance` reads for that person. The partner wallet that was kept before credits followed the account is not read here: nothing adds to it or spends from it any more. A partner with no administrator reads a balance of 0. Access: the person who administers the partner, or a Widgetic administrator.
|
|
1647
|
+
* Get partner credit balance
|
|
1648
|
+
*/
|
|
1649
|
+
getPartnerCreditBalance(requestParameters, initOverrides) {
|
|
1650
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1651
|
+
const response = yield this.getPartnerCreditBalanceRaw(requestParameters, initOverrides);
|
|
1652
|
+
return yield response.value();
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Lists what happened to the partner\'s credits, newest first: the entries of the credit ledger of the account of the person who administers it. Every operation that spends credits is a `debit` entry, and the credits an invoice carried arrive as `credit` entries when the invoice is paid, so this is also how the partner\'s usage is read. It is the same ledger `getUserCreditTransactions` reads for that person. The partner wallet that was kept before credits followed the account is not read here. A partner with no administrator has an empty ledger. The page is always bounded: `limit` defaults to 20 and is capped at 100, `offset` defaults to 0. Access: the person who administers the partner, or a Widgetic administrator.
|
|
1657
|
+
* Get partner credit transaction history
|
|
1658
|
+
*/
|
|
1659
|
+
getPartnerCreditTransactionsRaw(requestParameters, initOverrides) {
|
|
1660
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1661
|
+
if (requestParameters['partnerId'] == null) {
|
|
1662
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling getPartnerCreditTransactions().');
|
|
1663
|
+
}
|
|
1664
|
+
const queryParameters = {};
|
|
1665
|
+
if (requestParameters['limit'] != null) {
|
|
1666
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
1667
|
+
}
|
|
1668
|
+
if (requestParameters['offset'] != null) {
|
|
1669
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
1670
|
+
}
|
|
1671
|
+
if (requestParameters['type'] != null) {
|
|
1672
|
+
queryParameters['type'] = requestParameters['type'];
|
|
1673
|
+
}
|
|
1674
|
+
const headerParameters = {};
|
|
1675
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1676
|
+
const token = this.configuration.accessToken;
|
|
1677
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
1678
|
+
if (tokenString) {
|
|
1679
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
const response = yield this.request({
|
|
1683
|
+
path: `/partners/{partnerId}/credits/transactions`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
1684
|
+
method: 'GET',
|
|
1685
|
+
headers: headerParameters,
|
|
1686
|
+
query: queryParameters,
|
|
1687
|
+
}, initOverrides);
|
|
1688
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetPartnerCreditTransactions200ResponseFromJSON)(jsonValue));
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Lists what happened to the partner\'s credits, newest first: the entries of the credit ledger of the account of the person who administers it. Every operation that spends credits is a `debit` entry, and the credits an invoice carried arrive as `credit` entries when the invoice is paid, so this is also how the partner\'s usage is read. It is the same ledger `getUserCreditTransactions` reads for that person. The partner wallet that was kept before credits followed the account is not read here. A partner with no administrator has an empty ledger. The page is always bounded: `limit` defaults to 20 and is capped at 100, `offset` defaults to 0. Access: the person who administers the partner, or a Widgetic administrator.
|
|
1693
|
+
* Get partner credit transaction history
|
|
1694
|
+
*/
|
|
1695
|
+
getPartnerCreditTransactions(requestParameters, initOverrides) {
|
|
1696
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1697
|
+
const response = yield this.getPartnerCreditTransactionsRaw(requestParameters, initOverrides);
|
|
1698
|
+
return yield response.value();
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1567
1701
|
/**
|
|
1568
1702
|
* Read partner-wide design defaults
|
|
1569
1703
|
*/
|
|
@@ -1599,6 +1733,43 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1599
1733
|
return yield response.value();
|
|
1600
1734
|
});
|
|
1601
1735
|
}
|
|
1736
|
+
/**
|
|
1737
|
+
* Says whether you have a secret to sign the `context` of your embeds with, when it was made, whether the secret it replaced is still accepted, and whether an entry without a valid signature is refused (`required`). The secret itself is never part of the answer: it is shown once, when it is made (`rotatePartnerEntryContextSecret`, which also explains what signing is for and how to sign). Signing covers the entries written through the gateway into the compositions of your managed users and into those of your own account. The caller must be the person who administers the partner (an API key of that account works, with the `partner:read` scope), or a Widgetic administrator.
|
|
1738
|
+
* See how the context of your embeds is signed
|
|
1739
|
+
*/
|
|
1740
|
+
getPartnerEntryContextSigningRaw(requestParameters, initOverrides) {
|
|
1741
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1742
|
+
if (requestParameters['partnerId'] == null) {
|
|
1743
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling getPartnerEntryContextSigning().');
|
|
1744
|
+
}
|
|
1745
|
+
const queryParameters = {};
|
|
1746
|
+
const headerParameters = {};
|
|
1747
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1748
|
+
const token = this.configuration.accessToken;
|
|
1749
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
1750
|
+
if (tokenString) {
|
|
1751
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
const response = yield this.request({
|
|
1755
|
+
path: `/partners/{partnerId}/entry-context-signing`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
1756
|
+
method: 'GET',
|
|
1757
|
+
headers: headerParameters,
|
|
1758
|
+
query: queryParameters,
|
|
1759
|
+
}, initOverrides);
|
|
1760
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerEntryContextSigningFromJSON)(jsonValue));
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Says whether you have a secret to sign the `context` of your embeds with, when it was made, whether the secret it replaced is still accepted, and whether an entry without a valid signature is refused (`required`). The secret itself is never part of the answer: it is shown once, when it is made (`rotatePartnerEntryContextSecret`, which also explains what signing is for and how to sign). Signing covers the entries written through the gateway into the compositions of your managed users and into those of your own account. The caller must be the person who administers the partner (an API key of that account works, with the `partner:read` scope), or a Widgetic administrator.
|
|
1765
|
+
* See how the context of your embeds is signed
|
|
1766
|
+
*/
|
|
1767
|
+
getPartnerEntryContextSigning(requestParameters, initOverrides) {
|
|
1768
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1769
|
+
const response = yield this.getPartnerEntryContextSigningRaw(requestParameters, initOverrides);
|
|
1770
|
+
return yield response.value();
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1602
1773
|
/**
|
|
1603
1774
|
* Returns who gets the emails, which events you want by email and by webhook, the address of your webhook, and whether it has a secret to sign with. The secret itself is never returned: it is shown once, when it is made. `events` lists every kind of event there is, for a settings screen. The caller must be the person who administers the partner (an API key of that account works, with the `partner:read` scope), or a Widgetic administrator.
|
|
1604
1775
|
* Where your notifications go
|
|
@@ -1791,7 +1962,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1791
1962
|
});
|
|
1792
1963
|
}
|
|
1793
1964
|
/**
|
|
1794
|
-
* Returns the credits an account holds: the balance, and how much of it is reserved by operations that are still running. An account reads its own balance; with a partner\'s API key, that is the account of the person who administers the partner. Widgetic administrators can read any account\'s. An account that has never held credits reads a balance of 0.
|
|
1965
|
+
* Returns the credits an account holds: the balance, and how much of it is reserved by operations that are still running. An account reads its own balance; with a partner\'s API key, that is the account of the person who administers the partner. Widgetic administrators can read any account\'s. An account that has never held credits reads a balance of 0. `getPartnerCreditBalance` reads this same balance by partner id.
|
|
1795
1966
|
* Get an account\'s credit balance
|
|
1796
1967
|
*/
|
|
1797
1968
|
getUserCreditBalanceRaw(requestParameters, initOverrides) {
|
|
@@ -1818,7 +1989,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1818
1989
|
});
|
|
1819
1990
|
}
|
|
1820
1991
|
/**
|
|
1821
|
-
* Returns the credits an account holds: the balance, and how much of it is reserved by operations that are still running. An account reads its own balance; with a partner\'s API key, that is the account of the person who administers the partner. Widgetic administrators can read any account\'s. An account that has never held credits reads a balance of 0.
|
|
1992
|
+
* Returns the credits an account holds: the balance, and how much of it is reserved by operations that are still running. An account reads its own balance; with a partner\'s API key, that is the account of the person who administers the partner. Widgetic administrators can read any account\'s. An account that has never held credits reads a balance of 0. `getPartnerCreditBalance` reads this same balance by partner id.
|
|
1822
1993
|
* Get an account\'s credit balance
|
|
1823
1994
|
*/
|
|
1824
1995
|
getUserCreditBalance(requestParameters, initOverrides) {
|
|
@@ -1828,7 +1999,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1828
1999
|
});
|
|
1829
2000
|
}
|
|
1830
2001
|
/**
|
|
1831
|
-
* Lists the entries of an account\'s credit ledger, newest first. This is also how an account\'s usage is read: every operation that spends credits is a `debit` entry, so summing the `debit` entries over a period gives the credits consumed in it, and the other types give what was added. An account reads its own ledger; with a partner\'s API key, that is the account of the person who administers the partner. Widgetic administrators can read any account\'s.
|
|
2002
|
+
* Lists the entries of an account\'s credit ledger, newest first. This is also how an account\'s usage is read: every operation that spends credits is a `debit` entry, so summing the `debit` entries over a period gives the credits consumed in it, and the other types give what was added. An account reads its own ledger; with a partner\'s API key, that is the account of the person who administers the partner. Widgetic administrators can read any account\'s. `getPartnerCreditTransactions` reads this same ledger by partner id. The page is always bounded: `limit` defaults to 100 and is capped at 500, `offset` defaults to 0.
|
|
1832
2003
|
* List an account\'s credit ledger
|
|
1833
2004
|
*/
|
|
1834
2005
|
getUserCreditTransactionsRaw(requestParameters, initOverrides) {
|
|
@@ -1860,11 +2031,11 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1860
2031
|
headers: headerParameters,
|
|
1861
2032
|
query: queryParameters,
|
|
1862
2033
|
}, initOverrides);
|
|
1863
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
2034
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetPartnerCreditTransactions200ResponseFromJSON)(jsonValue));
|
|
1864
2035
|
});
|
|
1865
2036
|
}
|
|
1866
2037
|
/**
|
|
1867
|
-
* Lists the entries of an account\'s credit ledger, newest first. This is also how an account\'s usage is read: every operation that spends credits is a `debit` entry, so summing the `debit` entries over a period gives the credits consumed in it, and the other types give what was added. An account reads its own ledger; with a partner\'s API key, that is the account of the person who administers the partner. Widgetic administrators can read any account\'s.
|
|
2038
|
+
* Lists the entries of an account\'s credit ledger, newest first. This is also how an account\'s usage is read: every operation that spends credits is a `debit` entry, so summing the `debit` entries over a period gives the credits consumed in it, and the other types give what was added. An account reads its own ledger; with a partner\'s API key, that is the account of the person who administers the partner. Widgetic administrators can read any account\'s. `getPartnerCreditTransactions` reads this same ledger by partner id. The page is always bounded: `limit` defaults to 100 and is capped at 500, `offset` defaults to 0.
|
|
1868
2039
|
* List an account\'s credit ledger
|
|
1869
2040
|
*/
|
|
1870
2041
|
getUserCreditTransactions(requestParameters, initOverrides) {
|
|
@@ -1984,7 +2155,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
1984
2155
|
});
|
|
1985
2156
|
}
|
|
1986
2157
|
/**
|
|
1987
|
-
* Merges eligible tables (time and id columns) across the managed user\'s compositions in global time order, then compositionId, table, and id (byte order). Only tables with both a time and an id column take part. Rate limit
|
|
2158
|
+
* Merges eligible tables (time and id columns) across the managed user\'s compositions in global time order, then compositionId, table, and id (byte order). Only tables with both a time and an id column take part. Rate limit 30 requests per minute.
|
|
1988
2159
|
* List entries across a managed user\'s compositions
|
|
1989
2160
|
*/
|
|
1990
2161
|
listManagedUserEntriesRaw(requestParameters, initOverrides) {
|
|
@@ -2038,7 +2209,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2038
2209
|
});
|
|
2039
2210
|
}
|
|
2040
2211
|
/**
|
|
2041
|
-
* Merges eligible tables (time and id columns) across the managed user\'s compositions in global time order, then compositionId, table, and id (byte order). Only tables with both a time and an id column take part. Rate limit
|
|
2212
|
+
* Merges eligible tables (time and id columns) across the managed user\'s compositions in global time order, then compositionId, table, and id (byte order). Only tables with both a time and an id column take part. Rate limit 30 requests per minute.
|
|
2042
2213
|
* List entries across a managed user\'s compositions
|
|
2043
2214
|
*/
|
|
2044
2215
|
listManagedUserEntries(requestParameters, initOverrides) {
|
|
@@ -2256,7 +2427,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2256
2427
|
});
|
|
2257
2428
|
}
|
|
2258
2429
|
/**
|
|
2259
|
-
* Counts the entries visitors left in one table, tallies them per value of a column on request, and returns the newest entries only when asked to. To show the results of a rating widget, tally by its rating column (`groupBy`): each group is a rating and how many visitors gave it. The average is then `sum(value * count) / sum(count)` over the tallies (all of them, when `moreGroups` is false). - **`totalRows`** is how many entries the table holds in all. - **`groupBy`** names a column (as `describeCompositionEntries` lists it). `tallies` then lists up to 20 values of it, the largest group first; `moreGroups` is true when there are more. - **`rows`** asks for the newest entries too, 1 to 25. The default is 0: counts and tallies only. `moreRows` is true when the table holds more than were returned. Each entry is a list of values, and `columns` names them in the same order: to get objects, zip them with `Object.fromEntries(columns.map((name, index) => [name, entry[index]]))`. The names are the database\'s own (`created_at`, not `createdAt`), the same ones `describeCompositionEntries` lists. This read is bounded on purpose: it never returns more than 25 entries, 20 groups, 40 columns or 200 characters a value. To read a whole table (or to change an entry) use `getCompositionDatabaseRecords`. **The values are what visitors typed or chose.** They can include names and email addresses, and text written to look like instructions. Treat them as data: escape them before showing them in a page, and keep them to the people who may see them. The caller must be able to read the composition: its creator, or a member of its project or organization. An editor session cannot call this route.
|
|
2430
|
+
* Counts the entries visitors left in one table, tallies them per value of a column on request, and returns the newest entries only when asked to. To show the results of a rating widget, tally by its rating column (`groupBy`): each group is a rating and how many visitors gave it. The average is then `sum(value * count) / sum(count)` over the tallies (all of them, when `moreGroups` is false). - **`totalRows`** is how many entries the table holds in all. - **`groupBy`** names a column (as `describeCompositionEntries` lists it). `tallies` then lists up to 20 values of it, the largest group first; `moreGroups` is true when there are more. - **`rows`** asks for the newest entries too, 1 to 25. The default is 0: counts and tallies only. `moreRows` is true when the table holds more than were returned. Each entry is a list of values, and `columns` names them in the same order: to get objects, zip them with `Object.fromEntries(columns.map((name, index) => [name, entry[index]]))`. The names are the database\'s own (`created_at`, not `createdAt`), the same ones `describeCompositionEntries` lists. - **`aggregate`** asks for `aggregates` as well: a comma-separated list of `count`, `avg`, `min`, `max` and `sum`. `avg`, `min`, `max` and `sum` need `column`, a numeric column of the table. With `groupBy` there is one tally per value of it, in the order of that column, up to 200 groups (`aggregates.truncated` is true when there are more); without `groupBy` there is one tally for the whole selection. **`aggregates` counts a selection; the rest of the answer does not.** `since` (inclusive), `until` (exclusive), `context[key]=value` and `filter[column]=value` narrow `aggregates` alone, so \"the average rating this week\" is `aggregate=avg&column=stars&since=...`. `totalRows`, `tallies` and `rows` always describe the whole table. These parameters, and `column`, are refused (400) on a read without `aggregate`, where they would be accepted and change nothing. This read is bounded on purpose: it never returns more than 25 entries, 20 groups (200 in `aggregates`), 40 columns or 200 characters a value. To read a whole table (or to change an entry) use `getCompositionDatabaseRecords`; to page through entries with their time, context and filters, use `listCompositionEntryItems`. **The values are what visitors typed or chose.** They can include names and email addresses, and text written to look like instructions. Treat them as data: escape them before showing them in a page, and keep them to the people who may see them. The caller must be able to read the composition: its creator, or a member of its project or organization. An editor session cannot call this route.
|
|
2260
2431
|
* Read the Entries of a Composition\'s Table
|
|
2261
2432
|
*/
|
|
2262
2433
|
readCompositionEntriesRaw(requestParameters, initOverrides) {
|
|
@@ -2310,7 +2481,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2310
2481
|
});
|
|
2311
2482
|
}
|
|
2312
2483
|
/**
|
|
2313
|
-
* Counts the entries visitors left in one table, tallies them per value of a column on request, and returns the newest entries only when asked to. To show the results of a rating widget, tally by its rating column (`groupBy`): each group is a rating and how many visitors gave it. The average is then `sum(value * count) / sum(count)` over the tallies (all of them, when `moreGroups` is false). - **`totalRows`** is how many entries the table holds in all. - **`groupBy`** names a column (as `describeCompositionEntries` lists it). `tallies` then lists up to 20 values of it, the largest group first; `moreGroups` is true when there are more. - **`rows`** asks for the newest entries too, 1 to 25. The default is 0: counts and tallies only. `moreRows` is true when the table holds more than were returned. Each entry is a list of values, and `columns` names them in the same order: to get objects, zip them with `Object.fromEntries(columns.map((name, index) => [name, entry[index]]))`. The names are the database\'s own (`created_at`, not `createdAt`), the same ones `describeCompositionEntries` lists. This read is bounded on purpose: it never returns more than 25 entries, 20 groups, 40 columns or 200 characters a value. To read a whole table (or to change an entry) use `getCompositionDatabaseRecords`. **The values are what visitors typed or chose.** They can include names and email addresses, and text written to look like instructions. Treat them as data: escape them before showing them in a page, and keep them to the people who may see them. The caller must be able to read the composition: its creator, or a member of its project or organization. An editor session cannot call this route.
|
|
2484
|
+
* Counts the entries visitors left in one table, tallies them per value of a column on request, and returns the newest entries only when asked to. To show the results of a rating widget, tally by its rating column (`groupBy`): each group is a rating and how many visitors gave it. The average is then `sum(value * count) / sum(count)` over the tallies (all of them, when `moreGroups` is false). - **`totalRows`** is how many entries the table holds in all. - **`groupBy`** names a column (as `describeCompositionEntries` lists it). `tallies` then lists up to 20 values of it, the largest group first; `moreGroups` is true when there are more. - **`rows`** asks for the newest entries too, 1 to 25. The default is 0: counts and tallies only. `moreRows` is true when the table holds more than were returned. Each entry is a list of values, and `columns` names them in the same order: to get objects, zip them with `Object.fromEntries(columns.map((name, index) => [name, entry[index]]))`. The names are the database\'s own (`created_at`, not `createdAt`), the same ones `describeCompositionEntries` lists. - **`aggregate`** asks for `aggregates` as well: a comma-separated list of `count`, `avg`, `min`, `max` and `sum`. `avg`, `min`, `max` and `sum` need `column`, a numeric column of the table. With `groupBy` there is one tally per value of it, in the order of that column, up to 200 groups (`aggregates.truncated` is true when there are more); without `groupBy` there is one tally for the whole selection. **`aggregates` counts a selection; the rest of the answer does not.** `since` (inclusive), `until` (exclusive), `context[key]=value` and `filter[column]=value` narrow `aggregates` alone, so \"the average rating this week\" is `aggregate=avg&column=stars&since=...`. `totalRows`, `tallies` and `rows` always describe the whole table. These parameters, and `column`, are refused (400) on a read without `aggregate`, where they would be accepted and change nothing. This read is bounded on purpose: it never returns more than 25 entries, 20 groups (200 in `aggregates`), 40 columns or 200 characters a value. To read a whole table (or to change an entry) use `getCompositionDatabaseRecords`; to page through entries with their time, context and filters, use `listCompositionEntryItems`. **The values are what visitors typed or chose.** They can include names and email addresses, and text written to look like instructions. Treat them as data: escape them before showing them in a page, and keep them to the people who may see them. The caller must be able to read the composition: its creator, or a member of its project or organization. An editor session cannot call this route.
|
|
2314
2485
|
* Read the Entries of a Composition\'s Table
|
|
2315
2486
|
*/
|
|
2316
2487
|
readCompositionEntries(requestParameters, initOverrides) {
|
|
@@ -2360,7 +2531,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2360
2531
|
});
|
|
2361
2532
|
}
|
|
2362
2533
|
/**
|
|
2363
|
-
* Removes the partner\'s storage destination. Partner storage is not optional, so after this
|
|
2534
|
+
* Removes the partner\'s storage destination. Partner storage is not optional, so after this every upload of the account, on any route, and the uploads of your customers\' editor sessions are refused (409 `PARTNER_STORAGE_REQUIRED`) until a destination is set again, and no editor session can be made. Files already in the partner\'s bucket are not touched and are not moved: they stay where they are, at the addresses they were given. Removing a destination the partner does not have is not an error: the answer is `removed: false`. The caller must be the person who administers the partner, or a Widgetic administrator.
|
|
2364
2535
|
* Stop storing a partner\'s uploaded files in its own bucket
|
|
2365
2536
|
*/
|
|
2366
2537
|
removePartnerStorageDestinationRaw(requestParameters, initOverrides) {
|
|
@@ -2387,7 +2558,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2387
2558
|
});
|
|
2388
2559
|
}
|
|
2389
2560
|
/**
|
|
2390
|
-
* Removes the partner\'s storage destination. Partner storage is not optional, so after this
|
|
2561
|
+
* Removes the partner\'s storage destination. Partner storage is not optional, so after this every upload of the account, on any route, and the uploads of your customers\' editor sessions are refused (409 `PARTNER_STORAGE_REQUIRED`) until a destination is set again, and no editor session can be made. Files already in the partner\'s bucket are not touched and are not moved: they stay where they are, at the addresses they were given. Removing a destination the partner does not have is not an error: the answer is `removed: false`. The caller must be the person who administers the partner, or a Widgetic administrator.
|
|
2391
2562
|
* Stop storing a partner\'s uploaded files in its own bucket
|
|
2392
2563
|
*/
|
|
2393
2564
|
removePartnerStorageDestination(requestParameters, initOverrides) {
|
|
@@ -2439,6 +2610,46 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2439
2610
|
return yield response.value();
|
|
2440
2611
|
});
|
|
2441
2612
|
}
|
|
2613
|
+
/**
|
|
2614
|
+
* Makes a secret to sign the `context` of your embeds with, and returns it in `secret`: **keep it now, it is shown once** and cannot be read again. Keep it on your server only: whoever holds it can write contexts your compositions accept. Call this again to make a new secret; the one it replaces is still accepted for a day, so that your server can switch without an entry being refused (making another within that day ends the overlap with the first). **What signing is for.** `<widgetic composition-id=\"...\" context=\'{\"customerId\":\"c_42\"}\'>` hands attribution to a widget, which sends it with every entry it saves. The page is yours but the browser is the visitor\'s: anybody can change that attribute and file an entry under another customer\'s id. When your server signs the context, the gateway refuses an entry whose context was changed, and the entries you keep hold attribution your server wrote. **How to sign** (on your server, for each page you render): 1. Take the context to give the widget. It may hold text and whole numbers only (within ±2^53, written without a fraction or an exponent). 2. Choose when the signature stops being good: `widgetic_exp`, in seconds since 1970 (UTC), no more than seven days from now. A minute of difference between clocks is forgiven. 3. Write the text to sign, with no spaces except those inside values: `widgetic-context.v1.<compositionId>.<widgetic_exp>.<json>`. `<compositionId>` is the id of the composition in lower case. `<json>` is the context as JSON with the keys in character-code order (so `Z` comes before `a`, and `10` before `9`), no spaces, strings escaped as JSON escapes them, and the two keys of the signature left out. 4. Sign that text: HMAC-SHA256 with the 32 bytes the secret stands for (the base64 text after `ctxsec_`), and write the result as base64url without padding. 5. Give the widget the context with two keys added: `widgetic_exp` and `widgetic_sig` (the signature). The whole attribute, the two keys included, stays within the limits of any context: at most 20 keys, 2048 bytes of JSON, strings up to 500 characters. The two keys take two of the 20 keys and 87 bytes of the 2048. A test vector, to check your code against before you rely on it. Secret `ctxsec_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=` (the bytes 0 to 31), composition `7c9e6679-7425-40de-944b-e07fc1f90ae7`, `widgetic_exp` 1792000000 and context `{\"customerId\":\"c_42\",\"plan\":\"pro\",\"seats\":3}` sign the text `widgetic-context.v1.7c9e6679-7425-40de-944b-e07fc1f90ae7.1792000000.{\"customerId\":\"c_42\",\"plan\":\"pro\",\"seats\":3}` and give the signature `j6g7151F54tl9C8oEY9levaYSppHME4fAPZ7WPwL8C8`. (The secret is the example\'s, not a real one.) **What the gateway does with an entry.** When you have a secret, an entry whose context carries a signature is checked: a signature that does not match is refused with 403 `CONTEXT_SIGNATURE_INVALID`, and one that is past `widgetic_exp` with 403 `CONTEXT_SIGNATURE_EXPIRED`. When you also require signatures (`updatePartnerEntryContextSigning`) an entry whose context carries none is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`. The two keys are taken out before the entry is stored or announced: your entries and your `entry.created` events hold the context you wrote. A change you make reaches every part of the gateway within a minute. **What it does not do.** A signed context that has been seen (a page\'s source is public) can be sent again by anyone until `widgetic_exp`; when you must not accept the same context twice, put a value that is new for each page view in it (a `submissionId` you made up) and keep the ones you have seen. The signature covers the entries that reach Widgetic\'s gateway: a widget that writes straight into its own database does not pass through it. Retry this call with the same `Idempotency-Key` if its answer was lost: the answer, secret included, is then given again, and no second secret is made. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator.
|
|
2615
|
+
* Make a secret to sign the context of your embeds
|
|
2616
|
+
*/
|
|
2617
|
+
rotatePartnerEntryContextSecretRaw(requestParameters, initOverrides) {
|
|
2618
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2619
|
+
if (requestParameters['partnerId'] == null) {
|
|
2620
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling rotatePartnerEntryContextSecret().');
|
|
2621
|
+
}
|
|
2622
|
+
const queryParameters = {};
|
|
2623
|
+
const headerParameters = {};
|
|
2624
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
2625
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
2626
|
+
}
|
|
2627
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2628
|
+
const token = this.configuration.accessToken;
|
|
2629
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
2630
|
+
if (tokenString) {
|
|
2631
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
const response = yield this.request({
|
|
2635
|
+
path: `/partners/{partnerId}/entry-context-signing/secret`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
2636
|
+
method: 'POST',
|
|
2637
|
+
headers: headerParameters,
|
|
2638
|
+
query: queryParameters,
|
|
2639
|
+
}, initOverrides);
|
|
2640
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerEntryContextSecretFromJSON)(jsonValue));
|
|
2641
|
+
});
|
|
2642
|
+
}
|
|
2643
|
+
/**
|
|
2644
|
+
* Makes a secret to sign the `context` of your embeds with, and returns it in `secret`: **keep it now, it is shown once** and cannot be read again. Keep it on your server only: whoever holds it can write contexts your compositions accept. Call this again to make a new secret; the one it replaces is still accepted for a day, so that your server can switch without an entry being refused (making another within that day ends the overlap with the first). **What signing is for.** `<widgetic composition-id=\"...\" context=\'{\"customerId\":\"c_42\"}\'>` hands attribution to a widget, which sends it with every entry it saves. The page is yours but the browser is the visitor\'s: anybody can change that attribute and file an entry under another customer\'s id. When your server signs the context, the gateway refuses an entry whose context was changed, and the entries you keep hold attribution your server wrote. **How to sign** (on your server, for each page you render): 1. Take the context to give the widget. It may hold text and whole numbers only (within ±2^53, written without a fraction or an exponent). 2. Choose when the signature stops being good: `widgetic_exp`, in seconds since 1970 (UTC), no more than seven days from now. A minute of difference between clocks is forgiven. 3. Write the text to sign, with no spaces except those inside values: `widgetic-context.v1.<compositionId>.<widgetic_exp>.<json>`. `<compositionId>` is the id of the composition in lower case. `<json>` is the context as JSON with the keys in character-code order (so `Z` comes before `a`, and `10` before `9`), no spaces, strings escaped as JSON escapes them, and the two keys of the signature left out. 4. Sign that text: HMAC-SHA256 with the 32 bytes the secret stands for (the base64 text after `ctxsec_`), and write the result as base64url without padding. 5. Give the widget the context with two keys added: `widgetic_exp` and `widgetic_sig` (the signature). The whole attribute, the two keys included, stays within the limits of any context: at most 20 keys, 2048 bytes of JSON, strings up to 500 characters. The two keys take two of the 20 keys and 87 bytes of the 2048. A test vector, to check your code against before you rely on it. Secret `ctxsec_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=` (the bytes 0 to 31), composition `7c9e6679-7425-40de-944b-e07fc1f90ae7`, `widgetic_exp` 1792000000 and context `{\"customerId\":\"c_42\",\"plan\":\"pro\",\"seats\":3}` sign the text `widgetic-context.v1.7c9e6679-7425-40de-944b-e07fc1f90ae7.1792000000.{\"customerId\":\"c_42\",\"plan\":\"pro\",\"seats\":3}` and give the signature `j6g7151F54tl9C8oEY9levaYSppHME4fAPZ7WPwL8C8`. (The secret is the example\'s, not a real one.) **What the gateway does with an entry.** When you have a secret, an entry whose context carries a signature is checked: a signature that does not match is refused with 403 `CONTEXT_SIGNATURE_INVALID`, and one that is past `widgetic_exp` with 403 `CONTEXT_SIGNATURE_EXPIRED`. When you also require signatures (`updatePartnerEntryContextSigning`) an entry whose context carries none is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`. The two keys are taken out before the entry is stored or announced: your entries and your `entry.created` events hold the context you wrote. A change you make reaches every part of the gateway within a minute. **What it does not do.** A signed context that has been seen (a page\'s source is public) can be sent again by anyone until `widgetic_exp`; when you must not accept the same context twice, put a value that is new for each page view in it (a `submissionId` you made up) and keep the ones you have seen. The signature covers the entries that reach Widgetic\'s gateway: a widget that writes straight into its own database does not pass through it. Retry this call with the same `Idempotency-Key` if its answer was lost: the answer, secret included, is then given again, and no second secret is made. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator.
|
|
2645
|
+
* Make a secret to sign the context of your embeds
|
|
2646
|
+
*/
|
|
2647
|
+
rotatePartnerEntryContextSecret(requestParameters, initOverrides) {
|
|
2648
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2649
|
+
const response = yield this.rotatePartnerEntryContextSecretRaw(requestParameters, initOverrides);
|
|
2650
|
+
return yield response.value();
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2442
2653
|
/**
|
|
2443
2654
|
* Makes a new secret to sign your webhook with, and returns it in `webhookSecret`: **keep it now, it is shown once** and cannot be read again. Use it when the secret was lost, or may have leaked. The secret you had keeps signing beside the new one for a day, so that your receiver can switch without a call being rejected: during that day each call carries two signatures (see `updatePartnerNotificationSettings` for how they are verified). Rotating again within the day ends the overlap with the first secret. Retry this call with the same `Idempotency-Key` if its answer was lost: the answer, secret included, is then given again, and no second secret is made. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator.
|
|
2444
2655
|
* Make a new secret for your webhook
|
|
@@ -2480,7 +2691,52 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2480
2691
|
});
|
|
2481
2692
|
}
|
|
2482
2693
|
/**
|
|
2483
|
-
*
|
|
2694
|
+
* Sends ONE signed call, right now, to the webhook address you saved under notification settings, with a sample of what an event of the type you name carries, and answers how it went: whether your receiver answered with a 2xx status, which status, how long it took, and why not when it did not arrive. Use it to write and try your receiver (above all the signature check) before a real event happens. The call is made like every other: it is signed with your current secret (and the previous one while a rotation overlaps), it carries the headers `webhook-id`, `webhook-timestamp`, `webhook-signature` and `x-widgetic-event` (the event type), and its body is `{ \"id\", \"type\", \"createdAt\", \"partnerId\", \"data\" }`. Three things differ. `id` starts with `evt_test_` and is new every time, so a receiver that remembers ids can tell a test from an event and drop it. `data` holds made-up values of the shape a real event of that type carries (`PartnerNotification` describes each), never anything about your account. And the call is made once: it is not tried again, nothing is stored, and it appears neither in the delivery log nor in the notification list. It is sent whatever `webhookEvents` says: a test is not filtered by what you subscribed to. The answer is 200 whether or not your receiver took the call (read `delivered`); a call that gets no answer within ten seconds is given up and reported as a `timeout`. A webhook address and a signing secret must be saved first (`updatePartnerNotificationSettings`); until then the answer is 409. This needs an API key with full access, and `Idempotency-Key` is required: a retry with the same key gets the first answer back and no second call is made. The caller must be the person who administers the partner, or a Widgetic administrator. Five tests a minute.
|
|
2695
|
+
* Send a test event to your webhook
|
|
2696
|
+
*/
|
|
2697
|
+
sendPartnerNotificationTestEventRaw(requestParameters, initOverrides) {
|
|
2698
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2699
|
+
if (requestParameters['partnerId'] == null) {
|
|
2700
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling sendPartnerNotificationTestEvent().');
|
|
2701
|
+
}
|
|
2702
|
+
if (requestParameters['partnerNotificationTestEventRequest'] == null) {
|
|
2703
|
+
throw new runtime.RequiredError('partnerNotificationTestEventRequest', 'Required parameter "partnerNotificationTestEventRequest" was null or undefined when calling sendPartnerNotificationTestEvent().');
|
|
2704
|
+
}
|
|
2705
|
+
const queryParameters = {};
|
|
2706
|
+
const headerParameters = {};
|
|
2707
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
2708
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
2709
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
2710
|
+
}
|
|
2711
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2712
|
+
const token = this.configuration.accessToken;
|
|
2713
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
2714
|
+
if (tokenString) {
|
|
2715
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
const response = yield this.request({
|
|
2719
|
+
path: `/partners/{partnerId}/notifications/test-event`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
2720
|
+
method: 'POST',
|
|
2721
|
+
headers: headerParameters,
|
|
2722
|
+
query: queryParameters,
|
|
2723
|
+
body: (0, index_1.PartnerNotificationTestEventRequestToJSON)(requestParameters['partnerNotificationTestEventRequest']),
|
|
2724
|
+
}, initOverrides);
|
|
2725
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerNotificationTestEventResultFromJSON)(jsonValue));
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
/**
|
|
2729
|
+
* Sends ONE signed call, right now, to the webhook address you saved under notification settings, with a sample of what an event of the type you name carries, and answers how it went: whether your receiver answered with a 2xx status, which status, how long it took, and why not when it did not arrive. Use it to write and try your receiver (above all the signature check) before a real event happens. The call is made like every other: it is signed with your current secret (and the previous one while a rotation overlaps), it carries the headers `webhook-id`, `webhook-timestamp`, `webhook-signature` and `x-widgetic-event` (the event type), and its body is `{ \"id\", \"type\", \"createdAt\", \"partnerId\", \"data\" }`. Three things differ. `id` starts with `evt_test_` and is new every time, so a receiver that remembers ids can tell a test from an event and drop it. `data` holds made-up values of the shape a real event of that type carries (`PartnerNotification` describes each), never anything about your account. And the call is made once: it is not tried again, nothing is stored, and it appears neither in the delivery log nor in the notification list. It is sent whatever `webhookEvents` says: a test is not filtered by what you subscribed to. The answer is 200 whether or not your receiver took the call (read `delivered`); a call that gets no answer within ten seconds is given up and reported as a `timeout`. A webhook address and a signing secret must be saved first (`updatePartnerNotificationSettings`); until then the answer is 409. This needs an API key with full access, and `Idempotency-Key` is required: a retry with the same key gets the first answer back and no second call is made. The caller must be the person who administers the partner, or a Widgetic administrator. Five tests a minute.
|
|
2730
|
+
* Send a test event to your webhook
|
|
2731
|
+
*/
|
|
2732
|
+
sendPartnerNotificationTestEvent(requestParameters, initOverrides) {
|
|
2733
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2734
|
+
const response = yield this.sendPartnerNotificationTestEventRaw(requestParameters, initOverrides);
|
|
2735
|
+
return yield response.value();
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
/**
|
|
2739
|
+
* Stores an https URL the widget runtime may read on load and every `refresh_seconds`. The URL must name a public host (no loopback, link-local or metadata addresses). A composition has one binding: saving another replaces it. The answer is the binding as it was saved (`url`, `refreshSeconds`).
|
|
2484
2740
|
* Bind a public JSON data source for embed refresh
|
|
2485
2741
|
*/
|
|
2486
2742
|
setCompositionDataSourceRaw(requestParameters, initOverrides) {
|
|
@@ -2511,16 +2767,17 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2511
2767
|
query: queryParameters,
|
|
2512
2768
|
body: (0, index_1.SetCompositionDataSourceRequestToJSON)(requestParameters['setCompositionDataSourceRequest']),
|
|
2513
2769
|
}, initOverrides);
|
|
2514
|
-
return new runtime.
|
|
2770
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CompositionDataSourceFromJSON)(jsonValue));
|
|
2515
2771
|
});
|
|
2516
2772
|
}
|
|
2517
2773
|
/**
|
|
2518
|
-
* Stores an https URL the widget runtime may read on load and every `refresh_seconds`. The URL must name a public host (no loopback, link-local or metadata addresses).
|
|
2774
|
+
* Stores an https URL the widget runtime may read on load and every `refresh_seconds`. The URL must name a public host (no loopback, link-local or metadata addresses). A composition has one binding: saving another replaces it. The answer is the binding as it was saved (`url`, `refreshSeconds`).
|
|
2519
2775
|
* Bind a public JSON data source for embed refresh
|
|
2520
2776
|
*/
|
|
2521
2777
|
setCompositionDataSource(requestParameters, initOverrides) {
|
|
2522
2778
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2523
|
-
yield this.setCompositionDataSourceRaw(requestParameters, initOverrides);
|
|
2779
|
+
const response = yield this.setCompositionDataSourceRaw(requestParameters, initOverrides);
|
|
2780
|
+
return yield response.value();
|
|
2524
2781
|
});
|
|
2525
2782
|
}
|
|
2526
2783
|
/**
|
|
@@ -2740,7 +2997,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2740
2997
|
});
|
|
2741
2998
|
}
|
|
2742
2999
|
/**
|
|
2743
|
-
* Points the partner at a bucket of its own on an S3-compatible service (Amazon S3, Backblaze B2, Cloudflare R2, Wasabi, MinIO and the like). From then on,
|
|
3000
|
+
* Points the partner at a bucket of its own on an S3-compatible service (Amazon S3, Backblaze B2, Cloudflare R2, Wasabi, MinIO and the like). From then on, every file the account that administers the partner stores is kept in that bucket instead of with Widgetic, whichever way it arrives: a file sent with `uploadsPost` (with an API key, an SDK token, an editor session or from the Widgetic website), a resumable upload, the media library, and the files the agent tools and the MCP server save. It takes none of the account\'s storage allowance, and its `url` is served from `public_base_url`. The chunks of a resumable upload wait in Widgetic\'s temporary staging area until it is completed and are removed then: the finished file is stored in your bucket and nowhere else. A destination is required. Partner storage is not optional: your customers\' files, and your own however they arrive, are kept in this destination and nowhere else. An editor session (`createManagedUserEditorSession`) of any surface cannot be made until a destination is set (409 `PARTNER_STORAGE_REQUIRED`), a destination removed later stops the uploads of the sessions already made (the same 409), and your own upload with no destination (on any route, including a resumable upload, which is refused when it is started) is refused in the same way instead of being stored with Widgetic. A partner cannot be activated until it has a destination that works. The destination is checked before it is saved. Widgetic writes a small test file under `<key_prefix>widgetic-check/`, reads it back from `<public_base_url>/<its key>`, and deletes it. If any step fails nothing is saved and the answer is 422 `STORAGE_DESTINATION_UNVERIFIED`: `details.step` says where (`endpoint`, `write` or `public_read`), `details.reason` says why, and `param` names the field most likely to be wrong. What the bucket needs: - an access key that may put objects into it (it may also delete objects, which lets the test file be cleaned up, but that is not required); - its files publicly readable at `public_base_url`, either because the bucket is public or through a CDN. The secret access key is stored encrypted and is never returned or logged; a response shows only the last four characters of the access key id (`accessKeyHint`). Saving replaces the whole destination, so send every field again, including the secret. Files already stored stay where they are, and keep working for as long as that bucket stays publicly readable. Once a destination is set, an upload is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 `STORAGE_DESTINATION_UNAVAILABLE`, and when the bucket rejects the file with 502 `STORAGE_DESTINATION_WRITE_FAILED`. The caller must be the person who administers the partner (an API key of that account works); anyone else is refused with 403 whether or not the partner exists. Widgetic administrators can set any partner\'s.
|
|
2744
3001
|
* Set where a partner\'s uploaded files are stored
|
|
2745
3002
|
*/
|
|
2746
3003
|
setPartnerStorageDestinationRaw(requestParameters, initOverrides) {
|
|
@@ -2772,7 +3029,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2772
3029
|
});
|
|
2773
3030
|
}
|
|
2774
3031
|
/**
|
|
2775
|
-
* Points the partner at a bucket of its own on an S3-compatible service (Amazon S3, Backblaze B2, Cloudflare R2, Wasabi, MinIO and the like). From then on,
|
|
3032
|
+
* Points the partner at a bucket of its own on an S3-compatible service (Amazon S3, Backblaze B2, Cloudflare R2, Wasabi, MinIO and the like). From then on, every file the account that administers the partner stores is kept in that bucket instead of with Widgetic, whichever way it arrives: a file sent with `uploadsPost` (with an API key, an SDK token, an editor session or from the Widgetic website), a resumable upload, the media library, and the files the agent tools and the MCP server save. It takes none of the account\'s storage allowance, and its `url` is served from `public_base_url`. The chunks of a resumable upload wait in Widgetic\'s temporary staging area until it is completed and are removed then: the finished file is stored in your bucket and nowhere else. A destination is required. Partner storage is not optional: your customers\' files, and your own however they arrive, are kept in this destination and nowhere else. An editor session (`createManagedUserEditorSession`) of any surface cannot be made until a destination is set (409 `PARTNER_STORAGE_REQUIRED`), a destination removed later stops the uploads of the sessions already made (the same 409), and your own upload with no destination (on any route, including a resumable upload, which is refused when it is started) is refused in the same way instead of being stored with Widgetic. A partner cannot be activated until it has a destination that works. The destination is checked before it is saved. Widgetic writes a small test file under `<key_prefix>widgetic-check/`, reads it back from `<public_base_url>/<its key>`, and deletes it. If any step fails nothing is saved and the answer is 422 `STORAGE_DESTINATION_UNVERIFIED`: `details.step` says where (`endpoint`, `write` or `public_read`), `details.reason` says why, and `param` names the field most likely to be wrong. What the bucket needs: - an access key that may put objects into it (it may also delete objects, which lets the test file be cleaned up, but that is not required); - its files publicly readable at `public_base_url`, either because the bucket is public or through a CDN. The secret access key is stored encrypted and is never returned or logged; a response shows only the last four characters of the access key id (`accessKeyHint`). Saving replaces the whole destination, so send every field again, including the secret. Files already stored stay where they are, and keep working for as long as that bucket stays publicly readable. Once a destination is set, an upload is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 `STORAGE_DESTINATION_UNAVAILABLE`, and when the bucket rejects the file with 502 `STORAGE_DESTINATION_WRITE_FAILED`. The caller must be the person who administers the partner (an API key of that account works); anyone else is refused with 403 whether or not the partner exists. Widgetic administrators can set any partner\'s.
|
|
2776
3033
|
* Set where a partner\'s uploaded files are stored
|
|
2777
3034
|
*/
|
|
2778
3035
|
setPartnerStorageDestination(requestParameters, initOverrides) {
|
|
@@ -2871,6 +3128,51 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
2871
3128
|
return yield response.value();
|
|
2872
3129
|
});
|
|
2873
3130
|
}
|
|
3131
|
+
/**
|
|
3132
|
+
* Chooses what the gateway does with an entry whose `context` carries no valid signature. With `required: false` (the default) an entry that carries a signature is checked and refused when the signature is wrong or out of date, and an entry that carries none is accepted, as it always was. With `required: true` an entry without a valid signature is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`: use it once every page of yours that embeds a composition signs its context. Signatures cannot be required before you have made a secret (`rotatePartnerEntryContextSecret`): the answer is 409, so that you cannot lock your own compositions out of taking entries. The change reaches every part of the gateway within a minute. Saving the same choice twice leaves the same state, so a retry is harmless and `Idempotency-Key` is optional. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator.
|
|
3133
|
+
* Require a signed context, or stop requiring it
|
|
3134
|
+
*/
|
|
3135
|
+
updatePartnerEntryContextSigningRaw(requestParameters, initOverrides) {
|
|
3136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3137
|
+
if (requestParameters['partnerId'] == null) {
|
|
3138
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling updatePartnerEntryContextSigning().');
|
|
3139
|
+
}
|
|
3140
|
+
if (requestParameters['updatePartnerEntryContextSigningRequest'] == null) {
|
|
3141
|
+
throw new runtime.RequiredError('updatePartnerEntryContextSigningRequest', 'Required parameter "updatePartnerEntryContextSigningRequest" was null or undefined when calling updatePartnerEntryContextSigning().');
|
|
3142
|
+
}
|
|
3143
|
+
const queryParameters = {};
|
|
3144
|
+
const headerParameters = {};
|
|
3145
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
3146
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
3147
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
3148
|
+
}
|
|
3149
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
3150
|
+
const token = this.configuration.accessToken;
|
|
3151
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
3152
|
+
if (tokenString) {
|
|
3153
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
const response = yield this.request({
|
|
3157
|
+
path: `/partners/{partnerId}/entry-context-signing`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
3158
|
+
method: 'PUT',
|
|
3159
|
+
headers: headerParameters,
|
|
3160
|
+
query: queryParameters,
|
|
3161
|
+
body: (0, index_1.UpdatePartnerEntryContextSigningRequestToJSON)(requestParameters['updatePartnerEntryContextSigningRequest']),
|
|
3162
|
+
}, initOverrides);
|
|
3163
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerEntryContextSigningFromJSON)(jsonValue));
|
|
3164
|
+
});
|
|
3165
|
+
}
|
|
3166
|
+
/**
|
|
3167
|
+
* Chooses what the gateway does with an entry whose `context` carries no valid signature. With `required: false` (the default) an entry that carries a signature is checked and refused when the signature is wrong or out of date, and an entry that carries none is accepted, as it always was. With `required: true` an entry without a valid signature is refused with 403 `CONTEXT_SIGNATURE_REQUIRED`: use it once every page of yours that embeds a composition signs its context. Signatures cannot be required before you have made a secret (`rotatePartnerEntryContextSecret`): the answer is 409, so that you cannot lock your own compositions out of taking entries. The change reaches every part of the gateway within a minute. Saving the same choice twice leaves the same state, so a retry is harmless and `Idempotency-Key` is optional. This needs an API key with full access. The caller must be the person who administers the partner, or a Widgetic administrator.
|
|
3168
|
+
* Require a signed context, or stop requiring it
|
|
3169
|
+
*/
|
|
3170
|
+
updatePartnerEntryContextSigning(requestParameters, initOverrides) {
|
|
3171
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3172
|
+
const response = yield this.updatePartnerEntryContextSigningRaw(requestParameters, initOverrides);
|
|
3173
|
+
return yield response.value();
|
|
3174
|
+
});
|
|
3175
|
+
}
|
|
2874
3176
|
/**
|
|
2875
3177
|
* Changes who gets the emails, which events you want by email and by webhook, and the address of your webhook. A key you leave out of the body is left as it was; send only what changes. **Email.** `emailRecipients` is the list of addresses (at most five). While it is empty the emails about invoices go to the billing emails of your billing profile (your contact email when there are none), and the others to your contact email. The events about money and about the standing of your account are always emailed, whatever `emailEvents` says; it narrows the others. **Webhook.** `webhookUrl` is where Widgetic sends a signed `POST` for each event, so that your own system can act on it (mark an invoice paid, warn your team that credits are low). The address must be `https` on the standard port, on a public site, and must not redirect. Setting an address when you have no secret yet makes one, and the answer carries it as `webhookSecret`: **keep it now, it is shown once**. `webhookEvents` narrows what is sent. Each call has a JSON body, `{ \"id\": \"evt_...\", \"type\": \"invoice.paid\", \"createdAt\": \"...\", \"partnerId\": \"...\", \"data\": { ... } }` (`data` is the `data` of `PartnerNotification`), and these headers: `webhook-id` (the same as `id`, and the same on every retry), `webhook-timestamp` (seconds since 1970) and `webhook-signature` (`v1,` and a base64 HMAC-SHA256). It is the Standard Webhooks scheme, so any of its libraries verifies it. By hand: take your secret without the `whsec_` prefix, decode it from base64, and sign the text `<webhook-id>.<webhook-timestamp>.<the raw body>` with it; the header holds `v1,<base64 of the result>` (two signatures separated by a space while a rotated secret overlaps). Reject a `webhook-timestamp` that is more than five minutes old. Answer with a 2xx status within ten seconds. Anything else is tried again, eight attempts in all over about two days (`listPartnerNotificationDeliveries` shows each). Delivery is at least once: if your answer was lost the same event arrives again with the same `id`, so drop what you have already handled by it. Changing the settings needs an API key with full access: they decide where your notifications go. The caller must be the person who administers the partner, or a Widgetic administrator.
|
|
2876
3178
|
* Choose where your notifications go
|
|
@@ -3158,7 +3460,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
3158
3460
|
});
|
|
3159
3461
|
}
|
|
3160
3462
|
/**
|
|
3161
|
-
* Stores one file for the account and returns its public address. This is how a user\'s own images, video and PDFs reach a widget\'s content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the
|
|
3463
|
+
* Stores one file for the account and returns its public address. This is how a user\'s own images, video and PDFs reach a widget\'s content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team\'s shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store\'s session, always work in that team\'s shared storage. A personal API key or an SDK token always uses the account\'s own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `uploadsLimitsGet` lists the size limit and the accepted types. When the full storage is a Shopify store\'s team\'s, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person\'s own workspace, get the shorter message. To upload the file for one of your managed users, send `managed_user_id` (Widgetic\'s id for the user) or `managed_user_external_id` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user\'s files with `uploadsGet`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session\'s own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `context_type`, `source`, `widget_id` and `conversation_id` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner\'s business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner\'s own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner\'s public address, and its `storage_key` is the key in the partner\'s bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner\'s storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner\'s own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers\' editor sessions are kept in the partner\'s own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session\'s browser is only told that the feature is not available right now.
|
|
3162
3464
|
* Upload a file
|
|
3163
3465
|
*/
|
|
3164
3466
|
uploadsPostRaw(requestParameters, initOverrides) {
|
|
@@ -3216,7 +3518,7 @@ class PartnerApi extends runtime.BaseAPI {
|
|
|
3216
3518
|
});
|
|
3217
3519
|
}
|
|
3218
3520
|
/**
|
|
3219
|
-
* Stores one file for the account and returns its public address. This is how a user\'s own images, video and PDFs reach a widget\'s content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the
|
|
3521
|
+
* Stores one file for the account and returns its public address. This is how a user\'s own images, video and PDFs reach a widget\'s content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team\'s shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store\'s session, always work in that team\'s shared storage. A personal API key or an SDK token always uses the account\'s own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `uploadsLimitsGet` lists the size limit and the accepted types. When the full storage is a Shopify store\'s team\'s, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person\'s own workspace, get the shorter message. To upload the file for one of your managed users, send `managed_user_id` (Widgetic\'s id for the user) or `managed_user_external_id` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user\'s files with `uploadsGet`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session\'s own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `context_type`, `source`, `widget_id` and `conversation_id` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner\'s business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner\'s own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner\'s public address, and its `storage_key` is the key in the partner\'s bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner\'s storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner\'s own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers\' editor sessions are kept in the partner\'s own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session\'s browser is only told that the feature is not available right now.
|
|
3220
3522
|
* Upload a file
|
|
3221
3523
|
*/
|
|
3222
3524
|
uploadsPost(requestParameters, initOverrides) {
|