@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/PartnersApi.js
CHANGED
|
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
25
|
+
exports.PartnersApi = void 0;
|
|
26
26
|
const runtime = require("../runtime");
|
|
27
27
|
const index_1 = require("../models/index");
|
|
28
28
|
/**
|
|
@@ -30,16 +30,16 @@ const index_1 = require("../models/index");
|
|
|
30
30
|
*/
|
|
31
31
|
class PartnersApi extends runtime.BaseAPI {
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* 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`.
|
|
34
|
+
* Buy extra credits for a partner
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
createPartnerExtraCreditsInvoiceRaw(requestParameters, initOverrides) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
if (requestParameters['partnerId'] == null) {
|
|
39
|
-
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling
|
|
39
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling createPartnerExtraCreditsInvoice().');
|
|
40
40
|
}
|
|
41
|
-
if (requestParameters['
|
|
42
|
-
throw new runtime.RequiredError('
|
|
41
|
+
if (requestParameters['requestExtraCredits'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('requestExtraCredits', 'Required parameter "requestExtraCredits" was null or undefined when calling createPartnerExtraCreditsInvoice().');
|
|
43
43
|
}
|
|
44
44
|
const queryParameters = {};
|
|
45
45
|
const headerParameters = {};
|
|
@@ -55,106 +55,27 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
const response = yield this.request({
|
|
58
|
-
path: `/partners/{partnerId}/credits/
|
|
58
|
+
path: `/partners/{partnerId}/credits/extra-invoice`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
59
59
|
method: 'POST',
|
|
60
60
|
headers: headerParameters,
|
|
61
61
|
query: queryParameters,
|
|
62
|
-
body: (0, index_1.
|
|
62
|
+
body: (0, index_1.RequestExtraCreditsToJSON)(requestParameters['requestExtraCredits']),
|
|
63
63
|
}, initOverrides);
|
|
64
|
-
return new runtime.
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Adds credits to a partner\'s account, generating a checkout URL for payment. This call is left out of the public API description on purpose, so a generated client does not have it. The partner wallet it tops up is not used by anything a partner builds on (a partner pays by invoice under its contract). It stays available to the partner\'s administrator and to Widgetic staff.
|
|
69
|
-
* Add credits to partner account
|
|
70
|
-
*/
|
|
71
|
-
addPartnerCredits(requestParameters, initOverrides) {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
yield this.addPartnerCreditsRaw(requestParameters, initOverrides);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Checks all partner credit balances and triggers auto-reload where needed (Admin only)
|
|
78
|
-
* Check all partner balances for auto-reload
|
|
79
|
-
*/
|
|
80
|
-
checkPartnerCreditBalancesRaw(requestParameters, initOverrides) {
|
|
81
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
const queryParameters = {};
|
|
83
|
-
const headerParameters = {};
|
|
84
|
-
if (requestParameters['idempotencyKey'] != null) {
|
|
85
|
-
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
86
|
-
}
|
|
87
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
88
|
-
const token = this.configuration.accessToken;
|
|
89
|
-
const tokenString = yield token("apiKeyAuth", []);
|
|
90
|
-
if (tokenString) {
|
|
91
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const response = yield this.request({
|
|
95
|
-
path: `/partners/credits/check-balances`,
|
|
96
|
-
method: 'POST',
|
|
97
|
-
headers: headerParameters,
|
|
98
|
-
query: queryParameters,
|
|
99
|
-
}, initOverrides);
|
|
100
|
-
return new runtime.VoidApiResponse(response);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Checks all partner credit balances and triggers auto-reload where needed (Admin only)
|
|
105
|
-
* Check all partner balances for auto-reload
|
|
106
|
-
*/
|
|
107
|
-
checkPartnerCreditBalances() {
|
|
108
|
-
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
109
|
-
yield this.checkPartnerCreditBalancesRaw(requestParameters, initOverrides);
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Configures automatic credit reload when balance falls below threshold
|
|
114
|
-
* Configure auto-reload settings
|
|
115
|
-
*/
|
|
116
|
-
configureAutoReloadRaw(requestParameters, initOverrides) {
|
|
117
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
-
if (requestParameters['partnerId'] == null) {
|
|
119
|
-
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling configureAutoReload().');
|
|
120
|
-
}
|
|
121
|
-
if (requestParameters['configureAutoReloadRequest'] == null) {
|
|
122
|
-
throw new runtime.RequiredError('configureAutoReloadRequest', 'Required parameter "configureAutoReloadRequest" was null or undefined when calling configureAutoReload().');
|
|
123
|
-
}
|
|
124
|
-
const queryParameters = {};
|
|
125
|
-
const headerParameters = {};
|
|
126
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
127
|
-
if (requestParameters['idempotencyKey'] != null) {
|
|
128
|
-
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
129
|
-
}
|
|
130
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
131
|
-
const token = this.configuration.accessToken;
|
|
132
|
-
const tokenString = yield token("apiKeyAuth", []);
|
|
133
|
-
if (tokenString) {
|
|
134
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
const response = yield this.request({
|
|
138
|
-
path: `/partners/{partnerId}/credits/auto-reload`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
139
|
-
method: 'PUT',
|
|
140
|
-
headers: headerParameters,
|
|
141
|
-
query: queryParameters,
|
|
142
|
-
body: (0, index_1.ConfigureAutoReloadRequestToJSON)(requestParameters['configureAutoReloadRequest']),
|
|
143
|
-
}, initOverrides);
|
|
144
|
-
return new runtime.VoidApiResponse(response);
|
|
64
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerExtraCreditsInvoiceFromJSON)(jsonValue));
|
|
145
65
|
});
|
|
146
66
|
}
|
|
147
67
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
68
|
+
* 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`.
|
|
69
|
+
* Buy extra credits for a partner
|
|
150
70
|
*/
|
|
151
|
-
|
|
71
|
+
createPartnerExtraCreditsInvoice(requestParameters, initOverrides) {
|
|
152
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
-
yield this.
|
|
73
|
+
const response = yield this.createPartnerExtraCreditsInvoiceRaw(requestParameters, initOverrides);
|
|
74
|
+
return yield response.value();
|
|
154
75
|
});
|
|
155
76
|
}
|
|
156
77
|
/**
|
|
157
|
-
* Returns the partner (nearly always one) that the signed-in account administers, with the id every other partner route asks for and the standing it is in: `active`, `inactive` (not activated yet)
|
|
78
|
+
* Returns the partner (nearly always one) that the signed-in account administers, with the id every other partner route asks for and the standing it is in: `active`, `inactive` (not activated yet), `suspended` (paused, with the reason Widgetic gave) or `payment_arrears` (a contract invoice is past its due date and unpaid, since `overdueSince`; the partner is stopped until it is paid). A partner API key is that account\'s key, so it reads its own partner here. An account that administers no partner is not refused: it gets `standing: not_a_partner` and an empty list, so a dashboard can tell \"this is not a partner account\" from \"something failed\". The call stays open while the partner is paused, not yet active or in payment arrears: that is when its dashboard has to say why.
|
|
158
79
|
* Find the partner you administer
|
|
159
80
|
*/
|
|
160
81
|
getMyPartnersRaw(initOverrides) {
|
|
@@ -178,7 +99,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
178
99
|
});
|
|
179
100
|
}
|
|
180
101
|
/**
|
|
181
|
-
* Returns the partner (nearly always one) that the signed-in account administers, with the id every other partner route asks for and the standing it is in: `active`, `inactive` (not activated yet)
|
|
102
|
+
* Returns the partner (nearly always one) that the signed-in account administers, with the id every other partner route asks for and the standing it is in: `active`, `inactive` (not activated yet), `suspended` (paused, with the reason Widgetic gave) or `payment_arrears` (a contract invoice is past its due date and unpaid, since `overdueSince`; the partner is stopped until it is paid). A partner API key is that account\'s key, so it reads its own partner here. An account that administers no partner is not refused: it gets `standing: not_a_partner` and an empty list, so a dashboard can tell \"this is not a partner account\" from \"something failed\". The call stays open while the partner is paused, not yet active or in payment arrears: that is when its dashboard has to say why.
|
|
182
103
|
* Find the partner you administer
|
|
183
104
|
*/
|
|
184
105
|
getMyPartners(initOverrides) {
|
|
@@ -387,7 +308,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
387
308
|
});
|
|
388
309
|
}
|
|
389
310
|
/**
|
|
390
|
-
* Retrieves
|
|
311
|
+
* 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.
|
|
391
312
|
* Get comprehensive partner billing overview
|
|
392
313
|
*/
|
|
393
314
|
getPartnerBillingOverviewRaw(requestParameters, initOverrides) {
|
|
@@ -414,7 +335,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
414
335
|
});
|
|
415
336
|
}
|
|
416
337
|
/**
|
|
417
|
-
* Retrieves
|
|
338
|
+
* 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.
|
|
418
339
|
* Get comprehensive partner billing overview
|
|
419
340
|
*/
|
|
420
341
|
getPartnerBillingOverview(requestParameters, initOverrides) {
|
|
@@ -460,7 +381,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
460
381
|
});
|
|
461
382
|
}
|
|
462
383
|
/**
|
|
463
|
-
*
|
|
384
|
+
* 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.
|
|
464
385
|
* Get partner credit balance
|
|
465
386
|
*/
|
|
466
387
|
getPartnerCreditBalanceRaw(requestParameters, initOverrides) {
|
|
@@ -483,11 +404,11 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
483
404
|
headers: headerParameters,
|
|
484
405
|
query: queryParameters,
|
|
485
406
|
}, initOverrides);
|
|
486
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
407
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AccountCreditBalanceFromJSON)(jsonValue));
|
|
487
408
|
});
|
|
488
409
|
}
|
|
489
410
|
/**
|
|
490
|
-
*
|
|
411
|
+
* 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.
|
|
491
412
|
* Get partner credit balance
|
|
492
413
|
*/
|
|
493
414
|
getPartnerCreditBalance(requestParameters, initOverrides) {
|
|
@@ -497,7 +418,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
497
418
|
});
|
|
498
419
|
}
|
|
499
420
|
/**
|
|
500
|
-
*
|
|
421
|
+
* 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.
|
|
501
422
|
* Get partner credit transaction history
|
|
502
423
|
*/
|
|
503
424
|
getPartnerCreditTransactionsRaw(requestParameters, initOverrides) {
|
|
@@ -529,16 +450,17 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
529
450
|
headers: headerParameters,
|
|
530
451
|
query: queryParameters,
|
|
531
452
|
}, initOverrides);
|
|
532
|
-
return new runtime.
|
|
453
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetPartnerCreditTransactions200ResponseFromJSON)(jsonValue));
|
|
533
454
|
});
|
|
534
455
|
}
|
|
535
456
|
/**
|
|
536
|
-
*
|
|
457
|
+
* 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.
|
|
537
458
|
* Get partner credit transaction history
|
|
538
459
|
*/
|
|
539
460
|
getPartnerCreditTransactions(requestParameters, initOverrides) {
|
|
540
461
|
return __awaiter(this, void 0, void 0, function* () {
|
|
541
|
-
yield this.getPartnerCreditTransactionsRaw(requestParameters, initOverrides);
|
|
462
|
+
const response = yield this.getPartnerCreditTransactionsRaw(requestParameters, initOverrides);
|
|
463
|
+
return yield response.value();
|
|
542
464
|
});
|
|
543
465
|
}
|
|
544
466
|
/**
|
|
@@ -576,6 +498,43 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
576
498
|
return yield response.value();
|
|
577
499
|
});
|
|
578
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* 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.
|
|
503
|
+
* See how the context of your embeds is signed
|
|
504
|
+
*/
|
|
505
|
+
getPartnerEntryContextSigningRaw(requestParameters, initOverrides) {
|
|
506
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
507
|
+
if (requestParameters['partnerId'] == null) {
|
|
508
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling getPartnerEntryContextSigning().');
|
|
509
|
+
}
|
|
510
|
+
const queryParameters = {};
|
|
511
|
+
const headerParameters = {};
|
|
512
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
513
|
+
const token = this.configuration.accessToken;
|
|
514
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
515
|
+
if (tokenString) {
|
|
516
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
const response = yield this.request({
|
|
520
|
+
path: `/partners/{partnerId}/entry-context-signing`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
521
|
+
method: 'GET',
|
|
522
|
+
headers: headerParameters,
|
|
523
|
+
query: queryParameters,
|
|
524
|
+
}, initOverrides);
|
|
525
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerEntryContextSigningFromJSON)(jsonValue));
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* 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.
|
|
530
|
+
* See how the context of your embeds is signed
|
|
531
|
+
*/
|
|
532
|
+
getPartnerEntryContextSigning(requestParameters, initOverrides) {
|
|
533
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
534
|
+
const response = yield this.getPartnerEntryContextSigningRaw(requestParameters, initOverrides);
|
|
535
|
+
return yield response.value();
|
|
536
|
+
});
|
|
537
|
+
}
|
|
579
538
|
/**
|
|
580
539
|
* 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.
|
|
581
540
|
* Where your notifications go
|
|
@@ -854,7 +813,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
854
813
|
});
|
|
855
814
|
}
|
|
856
815
|
/**
|
|
857
|
-
* Removes the partner\'s storage destination. Partner storage is not optional, so after this
|
|
816
|
+
* 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.
|
|
858
817
|
* Stop storing a partner\'s uploaded files in its own bucket
|
|
859
818
|
*/
|
|
860
819
|
removePartnerStorageDestinationRaw(requestParameters, initOverrides) {
|
|
@@ -881,7 +840,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
881
840
|
});
|
|
882
841
|
}
|
|
883
842
|
/**
|
|
884
|
-
* Removes the partner\'s storage destination. Partner storage is not optional, so after this
|
|
843
|
+
* 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.
|
|
885
844
|
* Stop storing a partner\'s uploaded files in its own bucket
|
|
886
845
|
*/
|
|
887
846
|
removePartnerStorageDestination(requestParameters, initOverrides) {
|
|
@@ -933,6 +892,46 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
933
892
|
return yield response.value();
|
|
934
893
|
});
|
|
935
894
|
}
|
|
895
|
+
/**
|
|
896
|
+
* 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.
|
|
897
|
+
* Make a secret to sign the context of your embeds
|
|
898
|
+
*/
|
|
899
|
+
rotatePartnerEntryContextSecretRaw(requestParameters, initOverrides) {
|
|
900
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
901
|
+
if (requestParameters['partnerId'] == null) {
|
|
902
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling rotatePartnerEntryContextSecret().');
|
|
903
|
+
}
|
|
904
|
+
const queryParameters = {};
|
|
905
|
+
const headerParameters = {};
|
|
906
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
907
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
908
|
+
}
|
|
909
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
910
|
+
const token = this.configuration.accessToken;
|
|
911
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
912
|
+
if (tokenString) {
|
|
913
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
const response = yield this.request({
|
|
917
|
+
path: `/partners/{partnerId}/entry-context-signing/secret`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
918
|
+
method: 'POST',
|
|
919
|
+
headers: headerParameters,
|
|
920
|
+
query: queryParameters,
|
|
921
|
+
}, initOverrides);
|
|
922
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerEntryContextSecretFromJSON)(jsonValue));
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* 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.
|
|
927
|
+
* Make a secret to sign the context of your embeds
|
|
928
|
+
*/
|
|
929
|
+
rotatePartnerEntryContextSecret(requestParameters, initOverrides) {
|
|
930
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
931
|
+
const response = yield this.rotatePartnerEntryContextSecretRaw(requestParameters, initOverrides);
|
|
932
|
+
return yield response.value();
|
|
933
|
+
});
|
|
934
|
+
}
|
|
936
935
|
/**
|
|
937
936
|
* 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.
|
|
938
937
|
* Make a new secret for your webhook
|
|
@@ -973,6 +972,51 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
973
972
|
return yield response.value();
|
|
974
973
|
});
|
|
975
974
|
}
|
|
975
|
+
/**
|
|
976
|
+
* 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.
|
|
977
|
+
* Send a test event to your webhook
|
|
978
|
+
*/
|
|
979
|
+
sendPartnerNotificationTestEventRaw(requestParameters, initOverrides) {
|
|
980
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
981
|
+
if (requestParameters['partnerId'] == null) {
|
|
982
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling sendPartnerNotificationTestEvent().');
|
|
983
|
+
}
|
|
984
|
+
if (requestParameters['partnerNotificationTestEventRequest'] == null) {
|
|
985
|
+
throw new runtime.RequiredError('partnerNotificationTestEventRequest', 'Required parameter "partnerNotificationTestEventRequest" was null or undefined when calling sendPartnerNotificationTestEvent().');
|
|
986
|
+
}
|
|
987
|
+
const queryParameters = {};
|
|
988
|
+
const headerParameters = {};
|
|
989
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
990
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
991
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
992
|
+
}
|
|
993
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
994
|
+
const token = this.configuration.accessToken;
|
|
995
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
996
|
+
if (tokenString) {
|
|
997
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
const response = yield this.request({
|
|
1001
|
+
path: `/partners/{partnerId}/notifications/test-event`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
1002
|
+
method: 'POST',
|
|
1003
|
+
headers: headerParameters,
|
|
1004
|
+
query: queryParameters,
|
|
1005
|
+
body: (0, index_1.PartnerNotificationTestEventRequestToJSON)(requestParameters['partnerNotificationTestEventRequest']),
|
|
1006
|
+
}, initOverrides);
|
|
1007
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerNotificationTestEventResultFromJSON)(jsonValue));
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* 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.
|
|
1012
|
+
* Send a test event to your webhook
|
|
1013
|
+
*/
|
|
1014
|
+
sendPartnerNotificationTestEvent(requestParameters, initOverrides) {
|
|
1015
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1016
|
+
const response = yield this.sendPartnerNotificationTestEventRaw(requestParameters, initOverrides);
|
|
1017
|
+
return yield response.value();
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
976
1020
|
/**
|
|
977
1021
|
* Send `{ \"design\": { ... } }` or `{ \"design\": null }` to remove. New compositions merge this layer over the widget base and under each managed user\'s default and the request body.
|
|
978
1022
|
* Set or clear partner-wide design defaults
|
|
@@ -1060,7 +1104,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
1060
1104
|
});
|
|
1061
1105
|
}
|
|
1062
1106
|
/**
|
|
1063
|
-
* 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,
|
|
1107
|
+
* 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.
|
|
1064
1108
|
* Set where a partner\'s uploaded files are stored
|
|
1065
1109
|
*/
|
|
1066
1110
|
setPartnerStorageDestinationRaw(requestParameters, initOverrides) {
|
|
@@ -1092,7 +1136,7 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
1092
1136
|
});
|
|
1093
1137
|
}
|
|
1094
1138
|
/**
|
|
1095
|
-
* 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,
|
|
1139
|
+
* 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.
|
|
1096
1140
|
* Set where a partner\'s uploaded files are stored
|
|
1097
1141
|
*/
|
|
1098
1142
|
setPartnerStorageDestination(requestParameters, initOverrides) {
|
|
@@ -1101,6 +1145,51 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
1101
1145
|
return yield response.value();
|
|
1102
1146
|
});
|
|
1103
1147
|
}
|
|
1148
|
+
/**
|
|
1149
|
+
* 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.
|
|
1150
|
+
* Require a signed context, or stop requiring it
|
|
1151
|
+
*/
|
|
1152
|
+
updatePartnerEntryContextSigningRaw(requestParameters, initOverrides) {
|
|
1153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1154
|
+
if (requestParameters['partnerId'] == null) {
|
|
1155
|
+
throw new runtime.RequiredError('partnerId', 'Required parameter "partnerId" was null or undefined when calling updatePartnerEntryContextSigning().');
|
|
1156
|
+
}
|
|
1157
|
+
if (requestParameters['updatePartnerEntryContextSigningRequest'] == null) {
|
|
1158
|
+
throw new runtime.RequiredError('updatePartnerEntryContextSigningRequest', 'Required parameter "updatePartnerEntryContextSigningRequest" was null or undefined when calling updatePartnerEntryContextSigning().');
|
|
1159
|
+
}
|
|
1160
|
+
const queryParameters = {};
|
|
1161
|
+
const headerParameters = {};
|
|
1162
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1163
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
1164
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
1165
|
+
}
|
|
1166
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1167
|
+
const token = this.configuration.accessToken;
|
|
1168
|
+
const tokenString = yield token("apiKeyAuth", []);
|
|
1169
|
+
if (tokenString) {
|
|
1170
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
const response = yield this.request({
|
|
1174
|
+
path: `/partners/{partnerId}/entry-context-signing`.replace(`{${"partnerId"}}`, encodeURIComponent(String(requestParameters['partnerId']))),
|
|
1175
|
+
method: 'PUT',
|
|
1176
|
+
headers: headerParameters,
|
|
1177
|
+
query: queryParameters,
|
|
1178
|
+
body: (0, index_1.UpdatePartnerEntryContextSigningRequestToJSON)(requestParameters['updatePartnerEntryContextSigningRequest']),
|
|
1179
|
+
}, initOverrides);
|
|
1180
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PartnerEntryContextSigningFromJSON)(jsonValue));
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* 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.
|
|
1185
|
+
* Require a signed context, or stop requiring it
|
|
1186
|
+
*/
|
|
1187
|
+
updatePartnerEntryContextSigning(requestParameters, initOverrides) {
|
|
1188
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1189
|
+
const response = yield this.updatePartnerEntryContextSigningRaw(requestParameters, initOverrides);
|
|
1190
|
+
return yield response.value();
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1104
1193
|
/**
|
|
1105
1194
|
* 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.
|
|
1106
1195
|
* Choose where your notifications go
|
|
@@ -1185,13 +1274,3 @@ class PartnersApi extends runtime.BaseAPI {
|
|
|
1185
1274
|
}
|
|
1186
1275
|
}
|
|
1187
1276
|
exports.PartnersApi = PartnersApi;
|
|
1188
|
-
/**
|
|
1189
|
-
* @export
|
|
1190
|
-
*/
|
|
1191
|
-
exports.GetPartnerCreditTransactionsTypeEnum = {
|
|
1192
|
-
Credit: 'credit',
|
|
1193
|
-
Debit: 'debit',
|
|
1194
|
-
Purchase: 'purchase',
|
|
1195
|
-
Usage: 'usage',
|
|
1196
|
-
Refund: 'refund'
|
|
1197
|
-
};
|