Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions spec/v2/providers/alerts/billing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ describe('billing', () => {
});
});

describe('onAutomatedPlanUpdatePublished', () => {
describe('onPlanAutomatedUpdatePublished', () => {
it('should create a function with only handler', () => {
const func = billing.onAutomatedPlanUpdatePublished(myHandler);
const func = billing.onPlanAutomatedUpdatePublished(myHandler);

expect(func.__endpoint).to.deep.equal({
platform: 'gcfv2',
labels: {},
eventTrigger: {
eventType: alerts.eventType,
eventFilters: {
alertType: billing.automatedPlanUpdateAlert,
alertType: billing.planAutomatedUpdateAlert,
},
retry: false,
},
});
});

it('should create a function with opts & handler', () => {
const func = billing.onAutomatedPlanUpdatePublished(
const func = billing.onPlanAutomatedUpdatePublished(
{ ...FULL_OPTIONS },
myHandler
);
Expand All @@ -71,7 +71,7 @@ describe('billing', () => {
eventTrigger: {
eventType: alerts.eventType,
eventFilters: {
alertType: billing.automatedPlanUpdateAlert,
alertType: billing.planAutomatedUpdateAlert,
},
retry: false,
},
Expand Down
10 changes: 5 additions & 5 deletions src/v2/providers/alerts/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type BillingEvent<T> = CloudEvent<FirebaseAlertData<T>, WithAlertType>;
/** @internal */
export const planUpdateAlert = 'billing.planUpdate';
/** @internal */
export const automatedPlanUpdateAlert = 'billing.automatedPlanUpdate';
export const planAutomatedUpdateAlert = 'billing.planAutomatedUpdate';

/**
* Declares a function that can handle a billing plan update event.
Expand Down Expand Up @@ -60,18 +60,18 @@ export function onPlanUpdatePublished(
/**
* Declares a function that can handle an automated billing plan update event.
*/
export function onAutomatedPlanUpdatePublished(
export function onPlanAutomatedUpdatePublished(
handler: (
event: BillingEvent<PlanAutomatedUpdatePayload>
) => any | Promise<any>
): CloudFunction<FirebaseAlertData<PlanAutomatedUpdatePayload>>;
export function onAutomatedPlanUpdatePublished(
export function onPlanAutomatedUpdatePublished(
opts: options.EventHandlerOptions,
handler: (
event: BillingEvent<PlanAutomatedUpdatePayload>
) => any | Promise<any>
): CloudFunction<FirebaseAlertData<PlanAutomatedUpdatePayload>>;
export function onAutomatedPlanUpdatePublished(
export function onPlanAutomatedUpdatePublished(
optsOrHandler:
| options.EventHandlerOptions
| ((event: BillingEvent<PlanAutomatedUpdatePayload>) => any | Promise<any>),
Expand All @@ -80,7 +80,7 @@ export function onAutomatedPlanUpdatePublished(
) => any | Promise<any>
): CloudFunction<FirebaseAlertData<PlanAutomatedUpdatePayload>> {
return onOperation<PlanAutomatedUpdatePayload>(
automatedPlanUpdateAlert,
planAutomatedUpdateAlert,
optsOrHandler,
handler
);
Expand Down