Skip to content

DEVORTEX-5439 add webhooks api #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

DEVORTEX-5439 add webhooks api #125

wants to merge 4 commits into from

Conversation

steplov
Copy link
Collaborator

@steplov steplov commented Jul 8, 2025

No description provided.

Comment on lines +1 to +5
interface SubscriptionSecretDto {
payloadSecret: string;
}

export { SubscriptionSecretDto };
Copy link
Contributor

@PavelLoparev PavelLoparev Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no actions points: weird naming. it's already clear this secret is in payload.

import { CreateUpdateSubscriptionParameters } from "./create-update-subscription-parameters";
import { SubscriptionEvent } from "./subscription-event";

export class UpdateSubscriptionParameters extends CreateUpdateSubscriptionParameters {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename CreateUpdateSubscriptionParameters to CreateSubscriptionParameters since you have separate class for updating?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UpdateSubscriptionParameters doesn’t support all methods available in CreateSubscriptionParameters, so we can't inherit one from the other directly.
Instead, both CreateSubscriptionParameters and UpdateSubscriptionParameters extend a common base class.

Comment on lines +20 to +27
getSubscriptions(
accountUid: string
): Promise<SmartlingListResponse<SubscriptionDto>> {
return this.makeRequest(
"get",
`${this.entrypoint}/accounts/${accountUid}/subscriptions`
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this endpoint support pagination?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the endpoint returns the full list of subscriptions, but it's capped to a small fixed number.

Comment on lines +72 to +100
enableSubscription(
accountUid: string,
subscriptionUid: string
): Promise<void> {
return this.makeRequest(
"post",
`${this.entrypoint}/accounts/${accountUid}/subscriptions/${subscriptionUid}/enable`
);
}

disableSubscription(
accountUid: string,
subscriptionUid: string
): Promise<void> {
return this.makeRequest(
"post",
`${this.entrypoint}/accounts/${accountUid}/subscriptions/${subscriptionUid}/disable`
);
}

testSubscription(
accountUid: string,
subscriptionUid: string
): Promise<void> {
return this.makeRequest(
"post",
`${this.entrypoint}/accounts/${accountUid}/subscriptions/${subscriptionUid}/test`
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember initial arch review but have you guys arranged API review? These verbs in endpoints look strange (test/enable/disable/etc)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnetrebenko-smartling could you please answer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants