@wix/auto_sdk_pricing-plans_plans 1.0.63 → 1.0.64
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/build/cjs/index.d.ts +35 -12
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.ts → index.typings.d.ts} +430 -1
- package/build/cjs/index.typings.js +791 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +35 -12
- package/build/es/index.mjs +1 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.mts → index.typings.d.mts} +430 -1
- package/build/es/index.typings.mjs +751 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +35 -12
- package/build/internal/cjs/index.js +1 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.ts → index.typings.d.ts} +430 -1
- package/build/internal/cjs/index.typings.js +791 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +35 -12
- package/build/internal/es/index.mjs +1 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.mts → index.typings.d.mts} +430 -1
- package/build/internal/es/index.typings.mjs +751 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
package/build/cjs/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.ts → index.typings.d.ts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
/** Information about the pricing plan. */
|
|
2
4
|
interface Plan {
|
|
3
5
|
/**
|
|
@@ -679,6 +681,161 @@ declare enum WebhookIdentityType {
|
|
|
679
681
|
}
|
|
680
682
|
/** @enumType */
|
|
681
683
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
684
|
+
type ListPublicPlansApplicationErrors = {
|
|
685
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
686
|
+
description?: string;
|
|
687
|
+
data?: Record<string, any>;
|
|
688
|
+
};
|
|
689
|
+
type QueryPublicPlansApplicationErrors = {
|
|
690
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
691
|
+
description?: string;
|
|
692
|
+
data?: Record<string, any>;
|
|
693
|
+
};
|
|
694
|
+
type QueryPublicPlansValidationErrors = {
|
|
695
|
+
ruleName?: 'PAGING_LIMIT_OUT_OF_RANGE';
|
|
696
|
+
};
|
|
697
|
+
type GetPlanApplicationErrors = {
|
|
698
|
+
code?: 'plan_not_found';
|
|
699
|
+
description?: string;
|
|
700
|
+
data?: Record<string, any>;
|
|
701
|
+
} | {
|
|
702
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
703
|
+
description?: string;
|
|
704
|
+
data?: Record<string, any>;
|
|
705
|
+
};
|
|
706
|
+
type ListPlansApplicationErrors = {
|
|
707
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
708
|
+
description?: string;
|
|
709
|
+
data?: Record<string, any>;
|
|
710
|
+
};
|
|
711
|
+
type ListPlansValidationErrors = {
|
|
712
|
+
ruleName?: 'INVALID_ARCHIVE_FILTER';
|
|
713
|
+
} | {
|
|
714
|
+
ruleName?: 'INVALID_VISIBLE_FILTER';
|
|
715
|
+
};
|
|
716
|
+
type GetPlanStatsApplicationErrors = {
|
|
717
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
718
|
+
description?: string;
|
|
719
|
+
data?: Record<string, any>;
|
|
720
|
+
};
|
|
721
|
+
type CreatePlanApplicationErrors = {
|
|
722
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
723
|
+
description?: string;
|
|
724
|
+
data?: Record<string, any>;
|
|
725
|
+
};
|
|
726
|
+
type CreatePlanValidationErrors = {
|
|
727
|
+
ruleName?: 'PLAN_NAME_BLANK';
|
|
728
|
+
} | {
|
|
729
|
+
ruleName?: 'PLAN_FEE_NAME_BLANK';
|
|
730
|
+
} | {
|
|
731
|
+
ruleName?: 'PERIOD_AMOUNT_OUT_OF_RANGE';
|
|
732
|
+
} | {
|
|
733
|
+
ruleName?: 'RECURRING_PLAN_PAYMENT_PRICE_MISSING';
|
|
734
|
+
} | {
|
|
735
|
+
ruleName?: 'RECURRING_PLAN_CYCLE_DURATION_TOO_SHORT';
|
|
736
|
+
} | {
|
|
737
|
+
ruleName?: 'RECURRING_PLAN_CYCLE_COUNT_INVALID';
|
|
738
|
+
} | {
|
|
739
|
+
ruleName?: 'SINGLE_PAYMENT_DURATION_TOO_SHORT';
|
|
740
|
+
} | {
|
|
741
|
+
ruleName?: 'SINGLE_PAYMENT_CYCLE_COUNT_INVALID';
|
|
742
|
+
} | {
|
|
743
|
+
ruleName?: 'SINGLE_PAYMENT_FREE_TRIAL_UNSUPPORTED';
|
|
744
|
+
} | {
|
|
745
|
+
ruleName?: 'INVALID_SINGLE_PAYMENT_WITHOUT_DURATION';
|
|
746
|
+
} | {
|
|
747
|
+
ruleName?: 'invalid_duration_unit';
|
|
748
|
+
} | {
|
|
749
|
+
ruleName?: 'client_data_is_invalid';
|
|
750
|
+
};
|
|
751
|
+
type UpdatePlanApplicationErrors = {
|
|
752
|
+
code?: 'plan_not_found';
|
|
753
|
+
description?: string;
|
|
754
|
+
data?: Record<string, any>;
|
|
755
|
+
} | {
|
|
756
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
757
|
+
description?: string;
|
|
758
|
+
data?: Record<string, any>;
|
|
759
|
+
};
|
|
760
|
+
type UpdatePlanValidationErrors = {
|
|
761
|
+
ruleName?: 'MISSING_PLAN_ID';
|
|
762
|
+
} | {
|
|
763
|
+
ruleName?: 'PLAN_NAME_BLANK';
|
|
764
|
+
} | {
|
|
765
|
+
ruleName?: 'PLAN_FEE_NAME_BLANK';
|
|
766
|
+
} | {
|
|
767
|
+
ruleName?: 'PERIOD_AMOUNT_OUT_OF_RANGE';
|
|
768
|
+
} | {
|
|
769
|
+
ruleName?: 'RECURRING_PLAN_PAYMENT_PRICE_MISSING';
|
|
770
|
+
} | {
|
|
771
|
+
ruleName?: 'RECURRING_PLAN_CYCLE_DURATION_TOO_SHORT';
|
|
772
|
+
} | {
|
|
773
|
+
ruleName?: 'RECURRING_PLAN_CYCLE_COUNT_INVALID';
|
|
774
|
+
} | {
|
|
775
|
+
ruleName?: 'SINGLE_PAYMENT_CYCLE_COUNT_INVALID';
|
|
776
|
+
} | {
|
|
777
|
+
ruleName?: 'SINGLE_PAYMENT_FREE_TRIAL_UNSUPPORTED';
|
|
778
|
+
} | {
|
|
779
|
+
ruleName?: 'INVALID_SINGLE_PAYMENT_WITHOUT_DURATION';
|
|
780
|
+
} | {
|
|
781
|
+
ruleName?: 'INVALID_DURATION_UNIT';
|
|
782
|
+
} | {
|
|
783
|
+
ruleName?: 'update_not_supported';
|
|
784
|
+
} | {
|
|
785
|
+
ruleName?: 'invalid_period_amount';
|
|
786
|
+
} | {
|
|
787
|
+
ruleName?: 'price_missing';
|
|
788
|
+
} | {
|
|
789
|
+
ruleName?: 'duration_missing';
|
|
790
|
+
} | {
|
|
791
|
+
ruleName?: 'free_trial_not_supported';
|
|
792
|
+
} | {
|
|
793
|
+
ruleName?: 'client_data_is_invalid';
|
|
794
|
+
};
|
|
795
|
+
type SetPlanVisibilityApplicationErrors = {
|
|
796
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
797
|
+
description?: string;
|
|
798
|
+
data?: Record<string, any>;
|
|
799
|
+
} | {
|
|
800
|
+
code?: 'plan_not_found';
|
|
801
|
+
description?: string;
|
|
802
|
+
data?: Record<string, any>;
|
|
803
|
+
} | {
|
|
804
|
+
code?: 'set_visibility_not_supported';
|
|
805
|
+
description?: string;
|
|
806
|
+
data?: Record<string, any>;
|
|
807
|
+
};
|
|
808
|
+
type MakePlanPrimaryApplicationErrors = {
|
|
809
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
810
|
+
description?: string;
|
|
811
|
+
data?: Record<string, any>;
|
|
812
|
+
} | {
|
|
813
|
+
code?: 'plan_not_found';
|
|
814
|
+
description?: string;
|
|
815
|
+
data?: Record<string, any>;
|
|
816
|
+
} | {
|
|
817
|
+
code?: 'set_primary_not_supported';
|
|
818
|
+
description?: string;
|
|
819
|
+
data?: Record<string, any>;
|
|
820
|
+
};
|
|
821
|
+
type ClearPrimaryApplicationErrors = {
|
|
822
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
823
|
+
description?: string;
|
|
824
|
+
data?: Record<string, any>;
|
|
825
|
+
};
|
|
826
|
+
type ArchivePlanApplicationErrors = {
|
|
827
|
+
code?: 'PRICING_PLANS_NOT_INSTALLED';
|
|
828
|
+
description?: string;
|
|
829
|
+
data?: Record<string, any>;
|
|
830
|
+
} | {
|
|
831
|
+
code?: 'plan_not_found';
|
|
832
|
+
description?: string;
|
|
833
|
+
data?: Record<string, any>;
|
|
834
|
+
} | {
|
|
835
|
+
code?: 'already_archived';
|
|
836
|
+
description?: string;
|
|
837
|
+
data?: Record<string, any>;
|
|
838
|
+
};
|
|
682
839
|
interface BaseEventMetadata {
|
|
683
840
|
/**
|
|
684
841
|
* App instance ID.
|
|
@@ -727,18 +884,123 @@ interface PlanBuyerCanCancelUpdatedEnvelope {
|
|
|
727
884
|
data: BuyerCanCancelUpdated;
|
|
728
885
|
metadata: EventMetadata;
|
|
729
886
|
}
|
|
887
|
+
/**
|
|
888
|
+
* Triggered when a plan's `buyerCanCancel` field is updated.
|
|
889
|
+
* @permissionScope Read Pricing Plans
|
|
890
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
|
|
891
|
+
* @permissionScope Manage Stores
|
|
892
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
893
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
894
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
895
|
+
* @permissionScope Manage Events
|
|
896
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
897
|
+
* @permissionScope Manage Challenges
|
|
898
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
899
|
+
* @permissionScope Manage Blog
|
|
900
|
+
* @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
|
|
901
|
+
* @permissionScope Manage Pricing Plans
|
|
902
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
|
|
903
|
+
* @permissionId PRICING_PLANS.READ_PLANS
|
|
904
|
+
* @webhook
|
|
905
|
+
* @eventType wix.pricing_plans.plan_buyer_can_cancel_updated
|
|
906
|
+
* @serviceIdentifier com.wixpress.membership.v2.plans.PlansServiceV2
|
|
907
|
+
* @slug buyer_can_cancel_updated
|
|
908
|
+
*/
|
|
909
|
+
declare function onPlanBuyerCanCancelUpdated(handler: (event: PlanBuyerCanCancelUpdatedEnvelope) => void | Promise<void>): void;
|
|
730
910
|
interface PlanCreatedEnvelope {
|
|
731
911
|
entity: Plan;
|
|
732
912
|
metadata: EventMetadata;
|
|
733
913
|
}
|
|
914
|
+
/**
|
|
915
|
+
* Triggered when a pricing plan is created.
|
|
916
|
+
* @permissionScope Read Pricing Plans
|
|
917
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
|
|
918
|
+
* @permissionScope Manage Stores
|
|
919
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
920
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
921
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
922
|
+
* @permissionScope Manage Events
|
|
923
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
924
|
+
* @permissionScope Manage Challenges
|
|
925
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
926
|
+
* @permissionScope Manage Blog
|
|
927
|
+
* @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
|
|
928
|
+
* @permissionScope Manage Pricing Plans
|
|
929
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
|
|
930
|
+
* @permissionId PRICING_PLANS.READ_PLANS
|
|
931
|
+
* @webhook
|
|
932
|
+
* @eventType wix.pricing_plans.plan_created
|
|
933
|
+
* @serviceIdentifier com.wixpress.membership.v2.plans.PlansServiceV2
|
|
934
|
+
* @slug created
|
|
935
|
+
*/
|
|
936
|
+
declare function onPlanCreated(handler: (event: PlanCreatedEnvelope) => void | Promise<void>): void;
|
|
734
937
|
interface PlanArchivedEnvelope {
|
|
735
938
|
data: PlanArchived;
|
|
736
939
|
metadata: EventMetadata;
|
|
737
940
|
}
|
|
941
|
+
/**
|
|
942
|
+
* Triggered when a pricing plan is archived.
|
|
943
|
+
* @permissionScope Read Pricing Plans
|
|
944
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
|
|
945
|
+
* @permissionScope Manage Stores
|
|
946
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
947
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
948
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
949
|
+
* @permissionScope Manage Events
|
|
950
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
951
|
+
* @permissionScope Manage Challenges
|
|
952
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
953
|
+
* @permissionScope Manage Blog
|
|
954
|
+
* @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
|
|
955
|
+
* @permissionScope Manage Pricing Plans
|
|
956
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
|
|
957
|
+
* @permissionId PRICING_PLANS.READ_PLANS
|
|
958
|
+
* @webhook
|
|
959
|
+
* @eventType wix.pricing_plans.plan_plan_archived
|
|
960
|
+
* @serviceIdentifier com.wixpress.membership.v2.plans.PlansServiceV2
|
|
961
|
+
* @slug plan_archived
|
|
962
|
+
*/
|
|
963
|
+
declare function onPlanArchived(handler: (event: PlanArchivedEnvelope) => void | Promise<void>): void;
|
|
738
964
|
interface PlanUpdatedEnvelope {
|
|
739
965
|
entity: Plan;
|
|
740
966
|
metadata: EventMetadata;
|
|
741
967
|
}
|
|
968
|
+
/**
|
|
969
|
+
* Triggered when a pricing plan is updated.
|
|
970
|
+
* @permissionScope Read Pricing Plans
|
|
971
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
|
|
972
|
+
* @permissionScope Manage Stores
|
|
973
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
974
|
+
* @permissionScope Manage plans and orders of Pricing Plans
|
|
975
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS-AND-ORDERS
|
|
976
|
+
* @permissionScope Manage Events
|
|
977
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
978
|
+
* @permissionScope Manage Challenges
|
|
979
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
980
|
+
* @permissionScope Manage Blog
|
|
981
|
+
* @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
|
|
982
|
+
* @permissionScope Manage Pricing Plans
|
|
983
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
|
|
984
|
+
* @permissionId PRICING_PLANS.READ_PLANS
|
|
985
|
+
* @webhook
|
|
986
|
+
* @eventType wix.pricing_plans.plan_updated
|
|
987
|
+
* @serviceIdentifier com.wixpress.membership.v2.plans.PlansServiceV2
|
|
988
|
+
* @slug updated
|
|
989
|
+
*/
|
|
990
|
+
declare function onPlanUpdated(handler: (event: PlanUpdatedEnvelope) => void | Promise<void>): void;
|
|
991
|
+
type PlanNonNullablePaths = `_id` | `perks.values` | `pricing.subscription.cycleDuration.unit` | `pricing.price.value` | `pricing.price.currency` | `archived` | `primary` | `hasOrders`;
|
|
992
|
+
/**
|
|
993
|
+
* Retrieves a list of up to 100 public pricing plans. Public plans are visible plans that are available to site visitors and can be purchased.
|
|
994
|
+
* @public
|
|
995
|
+
* @param options - Options for filtering and paging the list of public plans.
|
|
996
|
+
* @permissionId PRICING_PLANS.READ_PUBLIC_PLANS
|
|
997
|
+
* @applicableIdentity APP
|
|
998
|
+
* @applicableIdentity VISITOR
|
|
999
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.ListPublicPlans
|
|
1000
|
+
*/
|
|
1001
|
+
declare function listPublicPlans(options?: ListPublicPlansOptions): Promise<NonNullablePaths<ListPublicPlansResponse, `plans` | `plans.${number}._id` | `plans.${number}.pricing.subscription.cycleDuration.unit` | `plans.${number}.pricing.price.value` | `plans.${number}.pricing.price.currency` | `plans.${number}.primary`> & {
|
|
1002
|
+
__applicationErrorsType?: ListPublicPlansApplicationErrors;
|
|
1003
|
+
}>;
|
|
742
1004
|
interface ListPublicPlansOptions {
|
|
743
1005
|
/**
|
|
744
1006
|
* Number of items to list. Defaults to `75`. See limits ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/list-public-plans) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#paging)).
|
|
@@ -755,6 +1017,30 @@ interface ListPublicPlansOptions {
|
|
|
755
1017
|
*/
|
|
756
1018
|
planIds?: string[];
|
|
757
1019
|
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Creates a query to retrieve a list of public pricing plans.
|
|
1022
|
+
*
|
|
1023
|
+
*
|
|
1024
|
+
* The `queryPublicPlans()` method builds a query to retrieve a list of up to 1,000 public plans and returns a [`PublicPlansQueryBuilder`](#plansquerybuilder) object.
|
|
1025
|
+
*
|
|
1026
|
+
* The returned object contains the query definition which is typically used to run the query using the [`find()`](#plansquerybuilder/find) method.
|
|
1027
|
+
*
|
|
1028
|
+
* You can refine the query by chaining `PublicPlansQueryBuilder` methods onto the query. `PublicPlansQueryBuilder` methods enable you to sort, filter, and control the results that `queryPublicPlans()` returns.
|
|
1029
|
+
*
|
|
1030
|
+
* `queryPublicPlans()` runs with the following `PublicPlansQueryBuilder` defaults that you can override:
|
|
1031
|
+
* - [`skip`](#plansquerybuilder/skip): `0`
|
|
1032
|
+
* - [`limit`](#plansquerybuilder/limit): `50`
|
|
1033
|
+
*
|
|
1034
|
+
* The methods that are chained to `queryPublicPlans()` are applied in the order they are called. For example, if you sort on the `_createdDate` property in ascending order and then on the `_id` property in ascending order, the results are sorted first by the created date of the items and then, if there are multiple results with the same date, the items are sorted by `_id` in ascending order, per created date value.
|
|
1035
|
+
*
|
|
1036
|
+
* The following `PublicPlansQueryBuilder` methods are supported for the `queryPublicPlans()` method. For a full description of the Plans object, see the object returned for the [`items`](#plansqueryresult/items) property in [`PublicPlansQueryResult`](#plansqueryresult).
|
|
1037
|
+
* @public
|
|
1038
|
+
* @permissionId PRICING_PLANS.READ_PUBLIC_PLANS
|
|
1039
|
+
* @applicableIdentity APP
|
|
1040
|
+
* @applicableIdentity VISITOR
|
|
1041
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.QueryPublicPlans
|
|
1042
|
+
*/
|
|
1043
|
+
declare function queryPublicPlans(): PlansQueryBuilder;
|
|
758
1044
|
interface QueryOffsetResult {
|
|
759
1045
|
currentPage: number | undefined;
|
|
760
1046
|
totalPages: number | undefined;
|
|
@@ -815,6 +1101,33 @@ interface PlansQueryBuilder {
|
|
|
815
1101
|
skip: (skip: number) => PlansQueryBuilder;
|
|
816
1102
|
find: () => Promise<PlansQueryResult>;
|
|
817
1103
|
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Retrieves a pricing plan by ID.
|
|
1106
|
+
* @param _id - Plan ID.
|
|
1107
|
+
* @public
|
|
1108
|
+
* @requiredField _id
|
|
1109
|
+
* @permissionId PRICING_PLANS.READ_PLANS
|
|
1110
|
+
* @applicableIdentity APP
|
|
1111
|
+
* @returns Pricing plan.
|
|
1112
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.GetPlan
|
|
1113
|
+
*/
|
|
1114
|
+
declare function getPlan(_id: string): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
|
|
1115
|
+
__applicationErrorsType?: GetPlanApplicationErrors;
|
|
1116
|
+
}>;
|
|
1117
|
+
/**
|
|
1118
|
+
* Retrieves a list of up to 100 pricing plans (including public, hidden, and archived plans).
|
|
1119
|
+
* @public
|
|
1120
|
+
* @param options - Options for filtering and paging the list of plans.
|
|
1121
|
+
* @permissionId PRICING_PLANS.READ_PLANS
|
|
1122
|
+
* @applicableIdentity APP
|
|
1123
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.ListPlans
|
|
1124
|
+
*/
|
|
1125
|
+
declare function listPlans(options?: ListPlansOptions): Promise<NonNullablePaths<ListPlansResponse, {
|
|
1126
|
+
[P in PlanNonNullablePaths]: `plans.${number}.${P}`;
|
|
1127
|
+
}[PlanNonNullablePaths]> & {
|
|
1128
|
+
__applicationErrorsType?: ListPlansApplicationErrors;
|
|
1129
|
+
__validationErrorsType?: ListPlansValidationErrors;
|
|
1130
|
+
}>;
|
|
818
1131
|
interface ListPlansOptions {
|
|
819
1132
|
/** Archived filter. Defaults to `ACTIVE` (not archived) only. */
|
|
820
1133
|
archived?: ArchivedFilterWithLiterals;
|
|
@@ -835,6 +1148,58 @@ interface ListPlansOptions {
|
|
|
835
1148
|
*/
|
|
836
1149
|
planIds?: string[];
|
|
837
1150
|
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Gets statistics about the pricing plans. Currently provides only the total number of pricing plans, including archived plans.
|
|
1153
|
+
* @public
|
|
1154
|
+
* @permissionId PRICING_PLANS.READ_PLANS
|
|
1155
|
+
* @applicableIdentity APP
|
|
1156
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.GetPlanStats
|
|
1157
|
+
*/
|
|
1158
|
+
declare function getPlanStats(): Promise<NonNullablePaths<GetPlanStatsResponse, `totalPlans`> & {
|
|
1159
|
+
__applicationErrorsType?: GetPlanStatsApplicationErrors;
|
|
1160
|
+
}>;
|
|
1161
|
+
/**
|
|
1162
|
+
* Creates a pricing plan. The specified `plan` object must contain a pricing model. A pricing model can be 1 of the following:
|
|
1163
|
+
* - **A subscription**: A subscription with recurring payments and how often the plan occurs. Subscriptions can have free trial days.
|
|
1164
|
+
* - **A plan that doesn't renew**: A single payment for a specific duration that doesn't renew.
|
|
1165
|
+
* - **An unlimited plan**: A single payment for an unlimited amount of time (until canceled).
|
|
1166
|
+
* Pricing plans are available to the Wix user in the Pricing Plans section in a site's dashboard.
|
|
1167
|
+
* @public
|
|
1168
|
+
* @requiredField plan
|
|
1169
|
+
* @requiredField plan.name
|
|
1170
|
+
* @requiredField plan.pricing
|
|
1171
|
+
* @requiredField plan.pricing.pricingModel
|
|
1172
|
+
* @requiredField plan.pricing.pricingModel.singlePaymentForDuration.count
|
|
1173
|
+
* @requiredField plan.pricing.pricingModel.subscription.cycleCount
|
|
1174
|
+
* @requiredField plan.pricing.pricingModel.subscription.cycleDuration
|
|
1175
|
+
* @requiredField plan.pricing.pricingModel.subscription.cycleDuration.count
|
|
1176
|
+
* @param plan - Information for the plan being created.
|
|
1177
|
+
* @permissionId PRICING_PLANS.MANAGE_PLANS
|
|
1178
|
+
* @applicableIdentity APP
|
|
1179
|
+
* @returns Created plan.
|
|
1180
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.CreatePlan
|
|
1181
|
+
*/
|
|
1182
|
+
declare function createPlan(plan: NonNullablePaths<Plan, `name` | `pricing` | `pricing.singlePaymentForDuration.count` | `pricing.subscription.cycleCount` | `pricing.subscription.cycleDuration` | `pricing.subscription.cycleDuration.count`>): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
|
|
1183
|
+
__applicationErrorsType?: CreatePlanApplicationErrors;
|
|
1184
|
+
__validationErrorsType?: CreatePlanValidationErrors;
|
|
1185
|
+
}>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Updates a pricing plan.
|
|
1188
|
+
* Updating a plan doesn't impact existing orders made for the plan. All orders keep the details of the original plan that was active at the time of purchase.
|
|
1189
|
+
* @public
|
|
1190
|
+
* @requiredField _id
|
|
1191
|
+
* @requiredField plan
|
|
1192
|
+
* @param _id - ID of the plan to update.
|
|
1193
|
+
* @param options - Options for updating the plan.
|
|
1194
|
+
* @permissionId PRICING_PLANS.MANAGE_PLANS
|
|
1195
|
+
* @applicableIdentity APP
|
|
1196
|
+
* @returns Updated plan.
|
|
1197
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.UpdatePlan
|
|
1198
|
+
*/
|
|
1199
|
+
declare function updatePlan(_id: string, plan: UpdatePlan): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
|
|
1200
|
+
__applicationErrorsType?: UpdatePlanApplicationErrors;
|
|
1201
|
+
__validationErrorsType?: UpdatePlanValidationErrors;
|
|
1202
|
+
}>;
|
|
838
1203
|
interface UpdatePlan {
|
|
839
1204
|
/**
|
|
840
1205
|
* Plan ID.
|
|
@@ -918,5 +1283,69 @@ interface UpdatePlan {
|
|
|
918
1283
|
*/
|
|
919
1284
|
formId?: string | null;
|
|
920
1285
|
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Sets visibility for pricing plans. Visible plans are considered public plans.
|
|
1288
|
+
* By default, pricing plans are public, meaning they are visible. Plans can be hidden so that site members and visitors can't choose them.
|
|
1289
|
+
* As opposed to archiving, setting visibility can be reversed. This means that a public plan can be hidden, and a hidden plan can be made public (visible). (An archived plan always remains archived and can't be made active again.)
|
|
1290
|
+
* Changing a plan’s visibility doesn't impact existing orders for the plan. All orders for hidden plans are still active and keep their perks.
|
|
1291
|
+
* @param visible - Whether a plan is visible to members and site visitors. Updates the `public` field.
|
|
1292
|
+
* @public
|
|
1293
|
+
* @requiredField _id
|
|
1294
|
+
* @requiredField visible
|
|
1295
|
+
* @param _id - The ID of the plan to either display or hide on the site page.
|
|
1296
|
+
* @param options - Plan visibility options.
|
|
1297
|
+
* @permissionId PRICING_PLANS.MANAGE_PLANS
|
|
1298
|
+
* @applicableIdentity APP
|
|
1299
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.SetPlanVisibility
|
|
1300
|
+
*/
|
|
1301
|
+
declare function setPlanVisibility(_id: string, visible: boolean): Promise<NonNullablePaths<SetPlanVisibilityResponse, {
|
|
1302
|
+
[P in PlanNonNullablePaths]: `plan.${P}`;
|
|
1303
|
+
}[PlanNonNullablePaths]> & {
|
|
1304
|
+
__applicationErrorsType?: SetPlanVisibilityApplicationErrors;
|
|
1305
|
+
}>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Marks a pricing plan as the primary pricing plan. When viewing pricing plans on a site, the primary plan is highlighted with a customizable ribbon. Only a single plan can be marked as a primary plan at any given time. If there is an existing plan marked as primary, calling Make Plan Primary causes the existing primary plan to lose its primary status.
|
|
1308
|
+
* @public
|
|
1309
|
+
* @requiredField _id
|
|
1310
|
+
* @param _id - ID of the pricing plan to set as the primary plan.
|
|
1311
|
+
* @permissionId PRICING_PLANS.MANAGE_PLANS
|
|
1312
|
+
* @applicableIdentity APP
|
|
1313
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.MakePlanPrimary
|
|
1314
|
+
*/
|
|
1315
|
+
declare function makePlanPrimary(_id: string): Promise<NonNullablePaths<MakePlanPrimaryResponse, {
|
|
1316
|
+
[P in PlanNonNullablePaths]: `plan.${P}`;
|
|
1317
|
+
}[PlanNonNullablePaths]> & {
|
|
1318
|
+
__applicationErrorsType?: MakePlanPrimaryApplicationErrors;
|
|
1319
|
+
}>;
|
|
1320
|
+
/**
|
|
1321
|
+
* Sets all pricing plans as not primary. When viewing pricing plans on a site, no plan is highlighted with a customizable ribbon.
|
|
1322
|
+
* @public
|
|
1323
|
+
* @permissionId PRICING_PLANS.MANAGE_PLANS
|
|
1324
|
+
* @applicableIdentity APP
|
|
1325
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.ClearPrimary
|
|
1326
|
+
*/
|
|
1327
|
+
declare function clearPrimary(): Promise<void & {
|
|
1328
|
+
__applicationErrorsType?: ClearPrimaryApplicationErrors;
|
|
1329
|
+
}>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Archives a single plan.
|
|
1332
|
+
* When a plan is archived, it's no longer visible as a public plan that can be chosen by site members or visitors.
|
|
1333
|
+
* This is because the plan's `public` property is automatically set to `false`.
|
|
1334
|
+
* Archived plans can't be purchased or reactivated.
|
|
1335
|
+
* Plan archiving doesn't impact existing orders made for the plan. All orders for the plan are still active and keep their perks, payment options, and terms.
|
|
1336
|
+
* Wix users can see archived plans in a site's dashboard under **Pricing Plans -> Archived Plans**.
|
|
1337
|
+
* > **Note:** An attempt to archive an already-archived plan throws an error.
|
|
1338
|
+
* @public
|
|
1339
|
+
* @requiredField _id
|
|
1340
|
+
* @param _id - ID of the active plan to archive.
|
|
1341
|
+
* @permissionId PRICING_PLANS.MANAGE_PLANS
|
|
1342
|
+
* @applicableIdentity APP
|
|
1343
|
+
* @fqn com.wixpress.membership.v2.plans.PlansServiceV2.ArchivePlan
|
|
1344
|
+
*/
|
|
1345
|
+
declare function archivePlan(_id: string): Promise<NonNullablePaths<ArchivePlanResponse, {
|
|
1346
|
+
[P in PlanNonNullablePaths]: `plan.${P}`;
|
|
1347
|
+
}[PlanNonNullablePaths]> & {
|
|
1348
|
+
__applicationErrorsType?: ArchivePlanApplicationErrors;
|
|
1349
|
+
}>;
|
|
921
1350
|
|
|
922
|
-
export { type
|
|
1351
|
+
export { type ActionEvent, type ApplicationError, AppliedAt, type AppliedAtWithLiterals, type ArchivePlanApplicationErrors, type ArchivePlanRequest, type ArchivePlanResponse, ArchivedFilter, type ArchivedFilterWithLiterals, type ArrangePlansRequest, type ArrangePlansResponse, type BaseEventMetadata, type BulkActionMetadata, type BulkArchivePlanRequest, type BulkArchivePlanResponse, type BulkPlanResult, type BuyerCanCancelUpdated, type ClearPrimaryApplicationErrors, type ClearPrimaryRequest, type ClearPrimaryResponse, type CountPlansRequest, type CountPlansResponse, type CreatePlanApplicationErrors, type CreatePlanRequest, type CreatePlanResponse, type CreatePlanValidationErrors, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type Duration, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Fee, type FeeConfig, type GetPlanApplicationErrors, type GetPlanRequest, type GetPlanResponse, type GetPlanStatsApplicationErrors, type GetPlanStatsRequest, type GetPlanStatsResponse, type GetPlansPremiumStatusRequest, type GetPlansPremiumStatusResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ListPlansApplicationErrors, type ListPlansOptions, type ListPlansRequest, type ListPlansResponse, type ListPlansValidationErrors, type ListPublicPlansApplicationErrors, type ListPublicPlansOptions, type ListPublicPlansRequest, type ListPublicPlansResponse, type MakePlanPrimaryApplicationErrors, type MakePlanPrimaryRequest, type MakePlanPrimaryResponse, type MessageEnvelope, type Money, type Paging, type PagingMetadataV2, PeriodUnit, type PeriodUnitWithLiterals, type Plan, type PlanArchived, type PlanArchivedEnvelope, type PlanBuyerCanCancelUpdatedEnvelope, type PlanCreatedEnvelope, type PlanUpdatedEnvelope, type PlansQueryBuilder, type PlansQueryResult, type Pricing, type PricingPricingModelOneOf, PublicFilter, type PublicFilterWithLiterals, type PublicPlan, type QueryPublicPlansApplicationErrors, type QueryPublicPlansRequest, type QueryPublicPlansResponse, type QueryPublicPlansValidationErrors, type QueryV2, type Recurrence, type RestoreInfo, type SearchPlansRequest, type SearchPlansResponse, type SetPlanVisibilityApplicationErrors, type SetPlanVisibilityRequest, type SetPlanVisibilityResponse, SortOrder, type SortOrderWithLiterals, type Sorting, type StringList, type UpdatePlan, type UpdatePlanApplicationErrors, type UpdatePlanRequest, type UpdatePlanResponse, type UpdatePlanValidationErrors, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, archivePlan, clearPrimary, createPlan, getPlan, getPlanStats, listPlans, listPublicPlans, makePlanPrimary, onPlanArchived, onPlanBuyerCanCancelUpdated, onPlanCreated, onPlanUpdated, queryPublicPlans, setPlanVisibility, updatePlan };
|