@kard-financial/sdk 14.0.0 → 14.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +11 -6
- package/dist/cjs/api/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/index.js +5 -1
- package/dist/cjs/api/resources/internalOrganizations/exports.d.ts +1 -0
- package/dist/cjs/api/resources/internalOrganizations/exports.js +18 -0
- package/dist/cjs/api/resources/internalOrganizations/index.d.ts +1 -0
- package/dist/cjs/api/resources/internalOrganizations/index.js +17 -0
- package/dist/cjs/api/resources/internalOrganizations/types/DeleteResourceData.d.ts +11 -0
- package/dist/cjs/api/resources/internalOrganizations/types/DeleteResourceData.js +3 -0
- package/dist/cjs/api/resources/internalOrganizations/types/DeleteResourceResponse.d.ts +7 -0
- package/dist/cjs/api/resources/internalOrganizations/types/DeleteResourceResponse.js +3 -0
- package/dist/cjs/api/resources/internalOrganizations/types/EnrolledReward.d.ts +6 -0
- package/dist/cjs/api/resources/internalOrganizations/types/EnrolledReward.js +9 -0
- package/dist/cjs/api/resources/internalOrganizations/types/MerchantNetwork.d.ts +10 -0
- package/dist/cjs/api/resources/internalOrganizations/types/MerchantNetwork.js +3 -0
- package/dist/cjs/api/resources/internalOrganizations/types/MerchantNetworkName.d.ts +11 -0
- package/dist/cjs/api/resources/internalOrganizations/types/MerchantNetworkName.js +14 -0
- package/dist/cjs/api/resources/internalOrganizations/types/OrganizationPaginationMetadata.d.ts +9 -0
- package/dist/cjs/api/resources/internalOrganizations/types/OrganizationPaginationMetadata.js +3 -0
- package/dist/cjs/api/resources/internalOrganizations/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/internalOrganizations/types/index.js +22 -0
- package/dist/cjs/api/resources/organizations/client/Client.d.ts +35 -0
- package/dist/cjs/api/resources/organizations/client/Client.js +126 -0
- package/dist/cjs/api/resources/organizations/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/organizations/client/index.js +2 -0
- package/dist/cjs/api/resources/organizations/exports.d.ts +3 -0
- package/dist/cjs/api/resources/organizations/exports.js +22 -0
- package/dist/cjs/api/resources/organizations/index.d.ts +3 -0
- package/dist/cjs/api/resources/organizations/index.js +19 -0
- package/dist/cjs/api/resources/organizations/resources/children/client/Client.d.ts +113 -0
- package/dist/cjs/api/resources/organizations/resources/children/client/Client.js +382 -0
- package/dist/cjs/api/resources/organizations/resources/children/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/organizations/resources/children/client/index.js +17 -0
- package/dist/cjs/api/resources/organizations/resources/children/client/requests/ListChildrenRequest.d.ts +10 -0
- package/dist/cjs/api/resources/organizations/resources/children/client/requests/ListChildrenRequest.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/children/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/organizations/resources/children/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/organizations/resources/children/exports.d.ts +2 -0
- package/dist/cjs/api/resources/organizations/resources/children/exports.js +21 -0
- package/dist/cjs/api/resources/organizations/resources/children/index.d.ts +2 -0
- package/dist/cjs/api/resources/organizations/resources/children/index.js +18 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/ChildOrganizationListResponse.d.ts +11 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/ChildOrganizationListResponse.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/CreateChildAttributes.d.ts +18 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/CreateChildAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/CreateChildRequestBody.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/CreateChildRequestBody.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/CreateChildRequestData.d.ts +10 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/CreateChildRequestData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/UpdateChildAttributes.d.ts +21 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/UpdateChildAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/UpdateChildRequestBody.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/UpdateChildRequestBody.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/UpdateChildRequestData.d.ts +10 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/UpdateChildRequestData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/index.d.ts +7 -0
- package/dist/cjs/api/resources/organizations/resources/children/types/index.js +23 -0
- package/dist/cjs/api/resources/organizations/resources/index.d.ts +6 -0
- package/dist/cjs/api/resources/organizations/resources/index.js +45 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/Client.d.ts +131 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/Client.js +409 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/index.js +17 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/ListPlacementsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/ListPlacementsRequest.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/organizations/resources/placements/exports.d.ts +2 -0
- package/dist/cjs/api/resources/organizations/resources/placements/exports.js +21 -0
- package/dist/cjs/api/resources/organizations/resources/placements/index.d.ts +2 -0
- package/dist/cjs/api/resources/organizations/resources/placements/index.js +18 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/Cadence.d.ts +14 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/Cadence.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CadenceFrequency.d.ts +7 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CadenceFrequency.js +10 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateMainPageAttributes.d.ts +15 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateMainPageAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateMainPagePlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateMainPagePlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePlacementDataUnion.d.ts +13 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePlacementDataUnion.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePlacementRequestBody.d.ts +33 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePlacementRequestBody.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePushNotificationAttributes.d.ts +19 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePushNotificationAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePushNotificationPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePushNotificationPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/DayOfWeek.d.ts +11 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/DayOfWeek.js +14 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/MainPagePlacementAttributes.d.ts +15 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/MainPagePlacementAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/MainPagePlacementData.d.ts +9 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/MainPagePlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementFormatUnion.d.ts +42 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementFormatUnion.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementListResponse.d.ts +11 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementListResponse.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PushNotificationPlacementAttributes.d.ts +16 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PushNotificationPlacementAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PushNotificationPlacementData.d.ts +9 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PushNotificationPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateMainPageAttributes.d.ts +15 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateMainPageAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateMainPagePlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateMainPagePlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePlacementDataUnion.d.ts +13 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePlacementDataUnion.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePlacementRequestBody.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePlacementRequestBody.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePushNotificationAttributes.d.ts +20 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePushNotificationAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePushNotificationPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePushNotificationPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/index.d.ts +21 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/index.js +37 -0
- package/dist/cjs/api/resources/organizations/types/ExternalOrganizationAttributes.d.ts +30 -0
- package/dist/cjs/api/resources/organizations/types/ExternalOrganizationAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/types/ExternalOrganizationResponse.d.ts +10 -0
- package/dist/cjs/api/resources/organizations/types/ExternalOrganizationResponse.js +3 -0
- package/dist/cjs/api/resources/organizations/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/organizations/types/index.js +18 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/index.mjs +4 -0
- package/dist/esm/api/resources/internalOrganizations/exports.d.mts +1 -0
- package/dist/esm/api/resources/internalOrganizations/exports.mjs +2 -0
- package/dist/esm/api/resources/internalOrganizations/index.d.mts +1 -0
- package/dist/esm/api/resources/internalOrganizations/index.mjs +1 -0
- package/dist/esm/api/resources/internalOrganizations/types/DeleteResourceData.d.mts +11 -0
- package/dist/esm/api/resources/internalOrganizations/types/DeleteResourceData.mjs +2 -0
- package/dist/esm/api/resources/internalOrganizations/types/DeleteResourceResponse.d.mts +7 -0
- package/dist/esm/api/resources/internalOrganizations/types/DeleteResourceResponse.mjs +2 -0
- package/dist/esm/api/resources/internalOrganizations/types/EnrolledReward.d.mts +6 -0
- package/dist/esm/api/resources/internalOrganizations/types/EnrolledReward.mjs +6 -0
- package/dist/esm/api/resources/internalOrganizations/types/MerchantNetwork.d.mts +10 -0
- package/dist/esm/api/resources/internalOrganizations/types/MerchantNetwork.mjs +2 -0
- package/dist/esm/api/resources/internalOrganizations/types/MerchantNetworkName.d.mts +11 -0
- package/dist/esm/api/resources/internalOrganizations/types/MerchantNetworkName.mjs +11 -0
- package/dist/esm/api/resources/internalOrganizations/types/OrganizationPaginationMetadata.d.mts +9 -0
- package/dist/esm/api/resources/internalOrganizations/types/OrganizationPaginationMetadata.mjs +2 -0
- package/dist/esm/api/resources/internalOrganizations/types/index.d.mts +6 -0
- package/dist/esm/api/resources/internalOrganizations/types/index.mjs +6 -0
- package/dist/esm/api/resources/organizations/client/Client.d.mts +35 -0
- package/dist/esm/api/resources/organizations/client/Client.mjs +89 -0
- package/dist/esm/api/resources/organizations/client/index.d.mts +1 -0
- package/dist/esm/api/resources/organizations/client/index.mjs +1 -0
- package/dist/esm/api/resources/organizations/exports.d.mts +3 -0
- package/dist/esm/api/resources/organizations/exports.mjs +4 -0
- package/dist/esm/api/resources/organizations/index.d.mts +3 -0
- package/dist/esm/api/resources/organizations/index.mjs +3 -0
- package/dist/esm/api/resources/organizations/resources/children/client/Client.d.mts +113 -0
- package/dist/esm/api/resources/organizations/resources/children/client/Client.mjs +345 -0
- package/dist/esm/api/resources/organizations/resources/children/client/index.d.mts +1 -0
- package/dist/esm/api/resources/organizations/resources/children/client/index.mjs +1 -0
- package/dist/esm/api/resources/organizations/resources/children/client/requests/ListChildrenRequest.d.mts +10 -0
- package/dist/esm/api/resources/organizations/resources/children/client/requests/ListChildrenRequest.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/organizations/resources/children/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/organizations/resources/children/exports.d.mts +2 -0
- package/dist/esm/api/resources/organizations/resources/children/exports.mjs +3 -0
- package/dist/esm/api/resources/organizations/resources/children/index.d.mts +2 -0
- package/dist/esm/api/resources/organizations/resources/children/index.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/types/ChildOrganizationListResponse.d.mts +11 -0
- package/dist/esm/api/resources/organizations/resources/children/types/ChildOrganizationListResponse.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/types/CreateChildAttributes.d.mts +18 -0
- package/dist/esm/api/resources/organizations/resources/children/types/CreateChildAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/types/CreateChildRequestBody.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/children/types/CreateChildRequestBody.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/types/CreateChildRequestData.d.mts +10 -0
- package/dist/esm/api/resources/organizations/resources/children/types/CreateChildRequestData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/types/UpdateChildAttributes.d.mts +21 -0
- package/dist/esm/api/resources/organizations/resources/children/types/UpdateChildAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/types/UpdateChildRequestBody.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/children/types/UpdateChildRequestBody.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/types/UpdateChildRequestData.d.mts +10 -0
- package/dist/esm/api/resources/organizations/resources/children/types/UpdateChildRequestData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/children/types/index.d.mts +7 -0
- package/dist/esm/api/resources/organizations/resources/children/types/index.mjs +7 -0
- package/dist/esm/api/resources/organizations/resources/index.d.mts +6 -0
- package/dist/esm/api/resources/organizations/resources/index.mjs +6 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/Client.d.mts +131 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/Client.mjs +372 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/index.d.mts +1 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/index.mjs +1 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/ListPlacementsRequest.d.mts +10 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/ListPlacementsRequest.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/organizations/resources/placements/exports.d.mts +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/exports.mjs +3 -0
- package/dist/esm/api/resources/organizations/resources/placements/index.d.mts +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/index.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/Cadence.d.mts +14 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/Cadence.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CadenceFrequency.d.mts +7 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CadenceFrequency.mjs +7 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateMainPageAttributes.d.mts +15 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateMainPageAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateMainPagePlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateMainPagePlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePlacementDataUnion.d.mts +13 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePlacementDataUnion.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePlacementRequestBody.d.mts +33 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePlacementRequestBody.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePushNotificationAttributes.d.mts +19 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePushNotificationAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePushNotificationPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePushNotificationPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/DayOfWeek.d.mts +11 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/DayOfWeek.mjs +11 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/MainPagePlacementAttributes.d.mts +15 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/MainPagePlacementAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/MainPagePlacementData.d.mts +9 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/MainPagePlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementFormatUnion.d.mts +42 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementFormatUnion.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementListResponse.d.mts +11 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementListResponse.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PushNotificationPlacementAttributes.d.mts +16 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PushNotificationPlacementAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PushNotificationPlacementData.d.mts +9 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PushNotificationPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateMainPageAttributes.d.mts +15 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateMainPageAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateMainPagePlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateMainPagePlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePlacementDataUnion.d.mts +13 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePlacementDataUnion.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePlacementRequestBody.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePlacementRequestBody.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePushNotificationAttributes.d.mts +20 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePushNotificationAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePushNotificationPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePushNotificationPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/index.d.mts +21 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/index.mjs +21 -0
- package/dist/esm/api/resources/organizations/types/ExternalOrganizationAttributes.d.mts +30 -0
- package/dist/esm/api/resources/organizations/types/ExternalOrganizationAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/types/ExternalOrganizationResponse.d.mts +10 -0
- package/dist/esm/api/resources/organizations/types/ExternalOrganizationResponse.mjs +2 -0
- package/dist/esm/api/resources/organizations/types/index.d.mts +2 -0
- package/dist/esm/api/resources/organizations/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +34 -1
- package/reference.md +820 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
import * as KardApi from "../../../../../index.mjs";
|
|
5
|
+
export declare namespace PlacementsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class PlacementsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<PlacementsClient.Options>;
|
|
12
|
+
constructor(options?: PlacementsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Create a placement for the organization. Use type "placementMainPage" for main-page placements (requires name and availableSlots) or "placementPushNotification" for push-notification placements (requires name and cadence; availableSlots is automatically set to 1).
|
|
15
|
+
*
|
|
16
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
17
|
+
* @param {KardApi.organizations.CreatePlacementRequestBody} request
|
|
18
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
21
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
22
|
+
* @throws {@link KardApi.InvalidRequest}
|
|
23
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
24
|
+
* @throws {@link KardApi.InternalServerError}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.organizations.placements.create("org-123", {
|
|
28
|
+
* data: {
|
|
29
|
+
* type: "placementMainPage",
|
|
30
|
+
* attributes: {
|
|
31
|
+
* name: "Homepage Banner",
|
|
32
|
+
* availableSlots: 5
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* })
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await client.organizations.placements.create("org-123", {
|
|
39
|
+
* data: {
|
|
40
|
+
* type: "placementPushNotification",
|
|
41
|
+
* attributes: {
|
|
42
|
+
* name: "Daily Deal Alert",
|
|
43
|
+
* cadence: {
|
|
44
|
+
* frequency: "DAILY",
|
|
45
|
+
* timeOfDay: "09:00"
|
|
46
|
+
* }
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
* })
|
|
50
|
+
*/
|
|
51
|
+
create(organizationId: string, request: KardApi.organizations.CreatePlacementRequestBody, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.PlacementFormatUnion>;
|
|
52
|
+
private __create;
|
|
53
|
+
/**
|
|
54
|
+
* List placements belonging to the authenticated organization
|
|
55
|
+
*
|
|
56
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
57
|
+
* @param {KardApi.organizations.ListPlacementsRequest} request
|
|
58
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
+
*
|
|
60
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
61
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
62
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
63
|
+
* @throws {@link KardApi.InternalServerError}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* await client.organizations.placements.list("organizationId")
|
|
67
|
+
*/
|
|
68
|
+
list(organizationId: string, request?: KardApi.organizations.ListPlacementsRequest, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.PlacementListResponse>;
|
|
69
|
+
private __list;
|
|
70
|
+
/**
|
|
71
|
+
* Retrieve a specific placement
|
|
72
|
+
*
|
|
73
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
74
|
+
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
75
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
76
|
+
*
|
|
77
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
78
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
79
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
80
|
+
* @throws {@link KardApi.InternalServerError}
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* await client.organizations.placements.get("organizationId", "placementId")
|
|
84
|
+
*/
|
|
85
|
+
get(organizationId: string, placementId: string, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.PlacementFormatUnion>;
|
|
86
|
+
private __get;
|
|
87
|
+
/**
|
|
88
|
+
* Replace a placement. All fields must be provided. Use type "placementMainPage" or "placementPushNotification" to set the placement kind. If the type is "placementPushNotification", availableSlots is automatically set to 1.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
91
|
+
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
92
|
+
* @param {KardApi.organizations.UpdatePlacementRequestBody} request
|
|
93
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
94
|
+
*
|
|
95
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
96
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
97
|
+
* @throws {@link KardApi.InvalidRequest}
|
|
98
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
99
|
+
* @throws {@link KardApi.InternalServerError}
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* await client.organizations.placements.update("organizationId", "placementId", {
|
|
103
|
+
* data: {
|
|
104
|
+
* type: "placementMainPage",
|
|
105
|
+
* attributes: {
|
|
106
|
+
* name: "name",
|
|
107
|
+
* availableSlots: 1
|
|
108
|
+
* }
|
|
109
|
+
* }
|
|
110
|
+
* })
|
|
111
|
+
*/
|
|
112
|
+
update(organizationId: string, placementId: string, request: KardApi.organizations.UpdatePlacementRequestBody, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.PlacementFormatUnion>;
|
|
113
|
+
private __update;
|
|
114
|
+
/**
|
|
115
|
+
* Delete a placement
|
|
116
|
+
*
|
|
117
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
118
|
+
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
119
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
|
+
*
|
|
121
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
122
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
123
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
124
|
+
* @throws {@link KardApi.InternalServerError}
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* await client.organizations.placements.delete("organizationId", "placementId")
|
|
128
|
+
*/
|
|
129
|
+
delete(organizationId: string, placementId: string, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.DeleteResourceResponse>;
|
|
130
|
+
private __delete;
|
|
131
|
+
}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
import * as KardApi from "../../../../../index.mjs";
|
|
18
|
+
export class PlacementsClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a placement for the organization. Use type "placementMainPage" for main-page placements (requires name and availableSlots) or "placementPushNotification" for push-notification placements (requires name and cadence; availableSlots is automatically set to 1).
|
|
24
|
+
*
|
|
25
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
26
|
+
* @param {KardApi.organizations.CreatePlacementRequestBody} request
|
|
27
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
30
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
31
|
+
* @throws {@link KardApi.InvalidRequest}
|
|
32
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
33
|
+
* @throws {@link KardApi.InternalServerError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.organizations.placements.create("org-123", {
|
|
37
|
+
* data: {
|
|
38
|
+
* type: "placementMainPage",
|
|
39
|
+
* attributes: {
|
|
40
|
+
* name: "Homepage Banner",
|
|
41
|
+
* availableSlots: 5
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
* })
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* await client.organizations.placements.create("org-123", {
|
|
48
|
+
* data: {
|
|
49
|
+
* type: "placementPushNotification",
|
|
50
|
+
* attributes: {
|
|
51
|
+
* name: "Daily Deal Alert",
|
|
52
|
+
* cadence: {
|
|
53
|
+
* frequency: "DAILY",
|
|
54
|
+
* timeOfDay: "09:00"
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
* }
|
|
58
|
+
* })
|
|
59
|
+
*/
|
|
60
|
+
create(organizationId, request, requestOptions) {
|
|
61
|
+
return core.HttpResponsePromise.fromPromise(this.__create(organizationId, request, requestOptions));
|
|
62
|
+
}
|
|
63
|
+
__create(organizationId, request, requestOptions) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
66
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
67
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
68
|
+
const _response = yield core.fetcher({
|
|
69
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `v2/issuers/${core.url.encodePathParam(organizationId)}/placements`),
|
|
70
|
+
method: "POST",
|
|
71
|
+
headers: _headers,
|
|
72
|
+
contentType: "application/json",
|
|
73
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
74
|
+
requestType: "json",
|
|
75
|
+
body: request,
|
|
76
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
77
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
78
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
79
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
80
|
+
logging: this._options.logging,
|
|
81
|
+
});
|
|
82
|
+
if (_response.ok) {
|
|
83
|
+
return {
|
|
84
|
+
data: _response.body,
|
|
85
|
+
rawResponse: _response.rawResponse,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (_response.error.reason === "status-code") {
|
|
89
|
+
switch (_response.error.statusCode) {
|
|
90
|
+
case 401:
|
|
91
|
+
throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
92
|
+
case 403:
|
|
93
|
+
throw new KardApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
94
|
+
case 400:
|
|
95
|
+
throw new KardApi.InvalidRequest(_response.error.body, _response.rawResponse);
|
|
96
|
+
case 404:
|
|
97
|
+
throw new KardApi.DoesNotExistError(_response.error.body, _response.rawResponse);
|
|
98
|
+
case 500:
|
|
99
|
+
throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
100
|
+
default:
|
|
101
|
+
throw new errors.KardApiError({
|
|
102
|
+
statusCode: _response.error.statusCode,
|
|
103
|
+
body: _response.error.body,
|
|
104
|
+
rawResponse: _response.rawResponse,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/issuers/{organizationId}/placements");
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* List placements belonging to the authenticated organization
|
|
113
|
+
*
|
|
114
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
115
|
+
* @param {KardApi.organizations.ListPlacementsRequest} request
|
|
116
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
117
|
+
*
|
|
118
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
119
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
120
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
121
|
+
* @throws {@link KardApi.InternalServerError}
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* await client.organizations.placements.list("organizationId")
|
|
125
|
+
*/
|
|
126
|
+
list(organizationId, request = {}, requestOptions) {
|
|
127
|
+
return core.HttpResponsePromise.fromPromise(this.__list(organizationId, request, requestOptions));
|
|
128
|
+
}
|
|
129
|
+
__list(organizationId_1) {
|
|
130
|
+
return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
|
|
131
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
132
|
+
const { "page[after]": pageAfter, "page[size]": pageSize } = request;
|
|
133
|
+
const _queryParams = {
|
|
134
|
+
"page[after]": pageAfter,
|
|
135
|
+
"page[size]": pageSize,
|
|
136
|
+
};
|
|
137
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
138
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
139
|
+
const _response = yield core.fetcher({
|
|
140
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `v2/issuers/${core.url.encodePathParam(organizationId)}/placements`),
|
|
141
|
+
method: "GET",
|
|
142
|
+
headers: _headers,
|
|
143
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
144
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
145
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
146
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
147
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
148
|
+
logging: this._options.logging,
|
|
149
|
+
});
|
|
150
|
+
if (_response.ok) {
|
|
151
|
+
return {
|
|
152
|
+
data: _response.body,
|
|
153
|
+
rawResponse: _response.rawResponse,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
if (_response.error.reason === "status-code") {
|
|
157
|
+
switch (_response.error.statusCode) {
|
|
158
|
+
case 401:
|
|
159
|
+
throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
160
|
+
case 403:
|
|
161
|
+
throw new KardApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
162
|
+
case 404:
|
|
163
|
+
throw new KardApi.DoesNotExistError(_response.error.body, _response.rawResponse);
|
|
164
|
+
case 500:
|
|
165
|
+
throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
166
|
+
default:
|
|
167
|
+
throw new errors.KardApiError({
|
|
168
|
+
statusCode: _response.error.statusCode,
|
|
169
|
+
body: _response.error.body,
|
|
170
|
+
rawResponse: _response.rawResponse,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/placements");
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Retrieve a specific placement
|
|
179
|
+
*
|
|
180
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
181
|
+
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
182
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
183
|
+
*
|
|
184
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
185
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
186
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
187
|
+
* @throws {@link KardApi.InternalServerError}
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* await client.organizations.placements.get("organizationId", "placementId")
|
|
191
|
+
*/
|
|
192
|
+
get(organizationId, placementId, requestOptions) {
|
|
193
|
+
return core.HttpResponsePromise.fromPromise(this.__get(organizationId, placementId, requestOptions));
|
|
194
|
+
}
|
|
195
|
+
__get(organizationId, placementId, requestOptions) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
198
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
199
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
200
|
+
const _response = yield core.fetcher({
|
|
201
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `v2/issuers/${core.url.encodePathParam(organizationId)}/placements/${core.url.encodePathParam(placementId)}`),
|
|
202
|
+
method: "GET",
|
|
203
|
+
headers: _headers,
|
|
204
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
205
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
206
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
207
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
208
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
209
|
+
logging: this._options.logging,
|
|
210
|
+
});
|
|
211
|
+
if (_response.ok) {
|
|
212
|
+
return {
|
|
213
|
+
data: _response.body,
|
|
214
|
+
rawResponse: _response.rawResponse,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
if (_response.error.reason === "status-code") {
|
|
218
|
+
switch (_response.error.statusCode) {
|
|
219
|
+
case 401:
|
|
220
|
+
throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
221
|
+
case 403:
|
|
222
|
+
throw new KardApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
223
|
+
case 404:
|
|
224
|
+
throw new KardApi.DoesNotExistError(_response.error.body, _response.rawResponse);
|
|
225
|
+
case 500:
|
|
226
|
+
throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
227
|
+
default:
|
|
228
|
+
throw new errors.KardApiError({
|
|
229
|
+
statusCode: _response.error.statusCode,
|
|
230
|
+
body: _response.error.body,
|
|
231
|
+
rawResponse: _response.rawResponse,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/placements/{placementId}");
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Replace a placement. All fields must be provided. Use type "placementMainPage" or "placementPushNotification" to set the placement kind. If the type is "placementPushNotification", availableSlots is automatically set to 1.
|
|
240
|
+
*
|
|
241
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
242
|
+
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
243
|
+
* @param {KardApi.organizations.UpdatePlacementRequestBody} request
|
|
244
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
245
|
+
*
|
|
246
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
247
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
248
|
+
* @throws {@link KardApi.InvalidRequest}
|
|
249
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
250
|
+
* @throws {@link KardApi.InternalServerError}
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* await client.organizations.placements.update("organizationId", "placementId", {
|
|
254
|
+
* data: {
|
|
255
|
+
* type: "placementMainPage",
|
|
256
|
+
* attributes: {
|
|
257
|
+
* name: "name",
|
|
258
|
+
* availableSlots: 1
|
|
259
|
+
* }
|
|
260
|
+
* }
|
|
261
|
+
* })
|
|
262
|
+
*/
|
|
263
|
+
update(organizationId, placementId, request, requestOptions) {
|
|
264
|
+
return core.HttpResponsePromise.fromPromise(this.__update(organizationId, placementId, request, requestOptions));
|
|
265
|
+
}
|
|
266
|
+
__update(organizationId, placementId, request, requestOptions) {
|
|
267
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
269
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
270
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
271
|
+
const _response = yield core.fetcher({
|
|
272
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `v2/issuers/${core.url.encodePathParam(organizationId)}/placements/${core.url.encodePathParam(placementId)}`),
|
|
273
|
+
method: "PUT",
|
|
274
|
+
headers: _headers,
|
|
275
|
+
contentType: "application/json",
|
|
276
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
277
|
+
requestType: "json",
|
|
278
|
+
body: request,
|
|
279
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
280
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
281
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
282
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
283
|
+
logging: this._options.logging,
|
|
284
|
+
});
|
|
285
|
+
if (_response.ok) {
|
|
286
|
+
return {
|
|
287
|
+
data: _response.body,
|
|
288
|
+
rawResponse: _response.rawResponse,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
if (_response.error.reason === "status-code") {
|
|
292
|
+
switch (_response.error.statusCode) {
|
|
293
|
+
case 401:
|
|
294
|
+
throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
295
|
+
case 403:
|
|
296
|
+
throw new KardApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
297
|
+
case 400:
|
|
298
|
+
throw new KardApi.InvalidRequest(_response.error.body, _response.rawResponse);
|
|
299
|
+
case 404:
|
|
300
|
+
throw new KardApi.DoesNotExistError(_response.error.body, _response.rawResponse);
|
|
301
|
+
case 500:
|
|
302
|
+
throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
303
|
+
default:
|
|
304
|
+
throw new errors.KardApiError({
|
|
305
|
+
statusCode: _response.error.statusCode,
|
|
306
|
+
body: _response.error.body,
|
|
307
|
+
rawResponse: _response.rawResponse,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v2/issuers/{organizationId}/placements/{placementId}");
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Delete a placement
|
|
316
|
+
*
|
|
317
|
+
* @param {string} organizationId - Unique identifier of the organization
|
|
318
|
+
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
319
|
+
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
320
|
+
*
|
|
321
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
322
|
+
* @throws {@link KardApi.ForbiddenError}
|
|
323
|
+
* @throws {@link KardApi.DoesNotExistError}
|
|
324
|
+
* @throws {@link KardApi.InternalServerError}
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* await client.organizations.placements.delete("organizationId", "placementId")
|
|
328
|
+
*/
|
|
329
|
+
delete(organizationId, placementId, requestOptions) {
|
|
330
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(organizationId, placementId, requestOptions));
|
|
331
|
+
}
|
|
332
|
+
__delete(organizationId, placementId, requestOptions) {
|
|
333
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
334
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
335
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
336
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
337
|
+
const _response = yield core.fetcher({
|
|
338
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `v2/issuers/${core.url.encodePathParam(organizationId)}/placements/${core.url.encodePathParam(placementId)}`),
|
|
339
|
+
method: "DELETE",
|
|
340
|
+
headers: _headers,
|
|
341
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
342
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
343
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
344
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
345
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
346
|
+
logging: this._options.logging,
|
|
347
|
+
});
|
|
348
|
+
if (_response.ok) {
|
|
349
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
350
|
+
}
|
|
351
|
+
if (_response.error.reason === "status-code") {
|
|
352
|
+
switch (_response.error.statusCode) {
|
|
353
|
+
case 401:
|
|
354
|
+
throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
355
|
+
case 403:
|
|
356
|
+
throw new KardApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
357
|
+
case 404:
|
|
358
|
+
throw new KardApi.DoesNotExistError(_response.error.body, _response.rawResponse);
|
|
359
|
+
case 500:
|
|
360
|
+
throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
361
|
+
default:
|
|
362
|
+
throw new errors.KardApiError({
|
|
363
|
+
statusCode: _response.error.statusCode,
|
|
364
|
+
body: _response.error.body,
|
|
365
|
+
rawResponse: _response.rawResponse,
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v2/issuers/{organizationId}/placements/{placementId}");
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ListPlacementsRequest } from "./ListPlacementsRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Cadence schedule for push notification placements
|
|
4
|
+
*/
|
|
5
|
+
export interface Cadence {
|
|
6
|
+
/** Delivery frequency */
|
|
7
|
+
frequency: KardApi.organizations.CadenceFrequency;
|
|
8
|
+
/** Optional time of day in HH:mm format (24-hour, UTC) */
|
|
9
|
+
timeOfDay?: string | undefined;
|
|
10
|
+
/** Day of the week to deliver (used when frequency is WEEKLY, defaults to MON) */
|
|
11
|
+
dayOfWeek?: KardApi.organizations.DayOfWeek | undefined;
|
|
12
|
+
/** Day of the month to deliver, 1-31 (used when frequency is MONTHLY, defaults to 1) */
|
|
13
|
+
dayOfMonth?: number | undefined;
|
|
14
|
+
}
|
package/dist/esm/api/resources/organizations/resources/placements/types/CadenceFrequency.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** How often a push notification placement delivers */
|
|
2
|
+
export declare const CadenceFrequency: {
|
|
3
|
+
readonly Daily: "DAILY";
|
|
4
|
+
readonly Weekly: "WEEKLY";
|
|
5
|
+
readonly Monthly: "MONTHLY";
|
|
6
|
+
};
|
|
7
|
+
export type CadenceFrequency = (typeof CadenceFrequency)[keyof typeof CadenceFrequency];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attributes for creating a main-page placement
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* name: "Homepage Banner",
|
|
7
|
+
* availableSlots: 5
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface CreateMainPageAttributes {
|
|
11
|
+
/** Name of the placement */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Number of available slots (minimum 1) */
|
|
14
|
+
availableSlots: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Data for creating a main-page placement
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateMainPagePlacementData {
|
|
6
|
+
/** Main-page placement attributes for creation */
|
|
7
|
+
attributes: KardApi.organizations.CreateMainPageAttributes;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Discriminated union for creating a placement
|
|
4
|
+
*/
|
|
5
|
+
export type CreatePlacementDataUnion = KardApi.organizations.CreatePlacementDataUnion.PlacementMainPage | KardApi.organizations.CreatePlacementDataUnion.PlacementPushNotification;
|
|
6
|
+
export declare namespace CreatePlacementDataUnion {
|
|
7
|
+
interface PlacementMainPage extends KardApi.organizations.CreateMainPagePlacementData {
|
|
8
|
+
type: "placementMainPage";
|
|
9
|
+
}
|
|
10
|
+
interface PlacementPushNotification extends KardApi.organizations.CreatePushNotificationPlacementData {
|
|
11
|
+
type: "placementPushNotification";
|
|
12
|
+
}
|
|
13
|
+
}
|