@connect-plus-online/ogabai-integrations 0.0.69 → 0.0.71
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/index.cjs.js +341 -324
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +176 -154
- package/dist/index.d.ts +176 -154
- package/dist/index.esm.js +331 -304
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -612,6 +612,25 @@ var createPaystackService = (client) => ({
|
|
|
612
612
|
});
|
|
613
613
|
|
|
614
614
|
// src/services/subscription/subscription.entity.ts
|
|
615
|
+
var subscriptionTrialQuery = [
|
|
616
|
+
"createdAt",
|
|
617
|
+
"endedAt",
|
|
618
|
+
"id",
|
|
619
|
+
"planId",
|
|
620
|
+
"storeId",
|
|
621
|
+
"userId"
|
|
622
|
+
];
|
|
623
|
+
var subscriptionPlanFeatureDefinitionQuery = [
|
|
624
|
+
"id",
|
|
625
|
+
"title",
|
|
626
|
+
"description",
|
|
627
|
+
"subscriptionPlanFeatureKey",
|
|
628
|
+
"featureDefnitionStatus",
|
|
629
|
+
"accessDefinition",
|
|
630
|
+
"limitDefinition",
|
|
631
|
+
"behaviourDefinition",
|
|
632
|
+
"createdAt"
|
|
633
|
+
];
|
|
615
634
|
var subscriptionPlanFeatureBehaviourQuery = [
|
|
616
635
|
"id",
|
|
617
636
|
"createdAt",
|
|
@@ -638,17 +657,10 @@ var subscriptionQuery = [
|
|
|
638
657
|
"version"
|
|
639
658
|
];
|
|
640
659
|
var subscriptionPlanFeatureQuery = [
|
|
641
|
-
"id",
|
|
642
|
-
"title",
|
|
643
|
-
"description",
|
|
644
|
-
"createdAt",
|
|
645
660
|
"limitValue",
|
|
646
661
|
"accessValue",
|
|
647
662
|
"behaviourIds",
|
|
648
|
-
"subscriptionPlanFeatureKey"
|
|
649
|
-
"featureStatus",
|
|
650
|
-
"meta",
|
|
651
|
-
"planId"
|
|
663
|
+
"subscriptionPlanFeatureKey"
|
|
652
664
|
];
|
|
653
665
|
var subscriptionPlanQuery = [
|
|
654
666
|
"id",
|
|
@@ -666,57 +678,35 @@ var subscriptionPlanQuery = [
|
|
|
666
678
|
"annuallyPlanPrice"
|
|
667
679
|
];
|
|
668
680
|
|
|
669
|
-
// src/services/subscription/types/subscription-plan-feature.type.ts
|
|
670
|
-
var
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
"total"
|
|
681
|
-
];
|
|
682
|
-
var getSubscriptionPlanFeaturesResponseNestedFields = {
|
|
683
|
-
..._getSubscriptionPlanFeatureResponseNestedFields,
|
|
684
|
-
subscriptionPlanFeatures: subscriptionPlanFeatureQuery
|
|
685
|
-
};
|
|
686
|
-
var addSubscriptionPlanFeatureResponse = getSubscriptionPlanFeatureResponse;
|
|
687
|
-
var addSubscriptionPlanFeatureResponseNestedFields = getSubscriptionPlanFeatureResponseNestedFields;
|
|
688
|
-
var updateSubscriptionPlanFeatureResponse = getSubscriptionPlanFeatureResponse;
|
|
689
|
-
var updateSubscriptionPlanFeatureResponseNestedFields = getSubscriptionPlanFeatureResponseNestedFields;
|
|
690
|
-
var removeSubscriptionPlanFeatureResponse = [
|
|
691
|
-
"subscriptionPlanFeatureId"
|
|
692
|
-
];
|
|
681
|
+
// src/services/subscription/types/subscription-plan-feature-definition.type.ts
|
|
682
|
+
var ENTITY2 = "subscriptionPlanFeatureDefinition";
|
|
683
|
+
var subscriptionPlanFeatureDefinitionIntegration = createStandardEntityIntegration({
|
|
684
|
+
key: ENTITY2,
|
|
685
|
+
fields: subscriptionPlanFeatureDefinitionQuery
|
|
686
|
+
});
|
|
687
|
+
var subscriptionPlanFeatureDefinitionListIntegration = createListIntegration({
|
|
688
|
+
key: "subscriptionPlanFeatureDefinitions",
|
|
689
|
+
fields: subscriptionPlanFeatureDefinitionQuery
|
|
690
|
+
});
|
|
691
|
+
var subscriptionPlanFeatureDefinitionDeleteIntegration = createDeleteIntegration(ENTITY2);
|
|
693
692
|
|
|
694
693
|
// src/services/subscription/types/subscription-plan.type.ts
|
|
695
|
-
var
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
subscriptionPlans: subscriptionPlanQuery
|
|
712
|
-
};
|
|
713
|
-
var addSubscriptionPlanResponse = getSubscriptionPlanResponse;
|
|
714
|
-
var addSubscriptionPlanResponseNestedFields = getSubscriptionPlanResponseNestedFields;
|
|
715
|
-
var updateSubscriptionPlanResponse = getSubscriptionPlanResponse;
|
|
716
|
-
var updateSubscriptionPlanResponseNestedFields = getSubscriptionPlanResponseNestedFields;
|
|
717
|
-
var removeSubscriptionPlanResponse = [
|
|
718
|
-
"subscriptionPlanId"
|
|
719
|
-
];
|
|
694
|
+
var ENTITY3 = "subscriptionPlan";
|
|
695
|
+
var subscriptionPlanIntegration = createStandardEntityIntegration({
|
|
696
|
+
key: ENTITY3,
|
|
697
|
+
fields: subscriptionPlanQuery,
|
|
698
|
+
nested: {
|
|
699
|
+
features: subscriptionPlanFeatureQuery
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
var subscriptionPlanListIntegration = createListIntegration({
|
|
703
|
+
key: "subscriptionPlans",
|
|
704
|
+
fields: subscriptionPlanQuery,
|
|
705
|
+
nested: {
|
|
706
|
+
features: subscriptionPlanFeatureQuery
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
var subscriptionPlanDeleteIntegration = createDeleteIntegration(ENTITY3);
|
|
720
710
|
|
|
721
711
|
// src/services/subscription/types/subscription.type.ts
|
|
722
712
|
var getSubscriptionResponse = [
|
|
@@ -744,239 +734,228 @@ var removeSubscriptionResponse = [
|
|
|
744
734
|
];
|
|
745
735
|
|
|
746
736
|
// src/services/subscription/types/subscription-plan-feature-behaviour.type.ts
|
|
747
|
-
var
|
|
737
|
+
var ENTITY4 = "subscriptionPlanFeatureBehaviour";
|
|
748
738
|
var subscriptionPlanFeatureBehaviourIntegration = createStandardEntityIntegration({
|
|
749
|
-
key:
|
|
739
|
+
key: ENTITY4,
|
|
750
740
|
fields: subscriptionPlanFeatureBehaviourQuery
|
|
751
741
|
});
|
|
752
742
|
var subscriptionPlanFeatureBehaviourListIntegration = createListIntegration({
|
|
753
743
|
key: "subscriptionPlanFeatureBehaviours",
|
|
754
744
|
fields: subscriptionPlanFeatureBehaviourQuery
|
|
755
745
|
});
|
|
756
|
-
var subscriptionPlanFeatureBehaviourDeleteIntegration = createDeleteIntegration(
|
|
746
|
+
var subscriptionPlanFeatureBehaviourDeleteIntegration = createDeleteIntegration(ENTITY4);
|
|
757
747
|
|
|
758
|
-
// src/services/subscription/
|
|
759
|
-
var
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
getSubscriptionPlanFeatures(search: $search, subscriptionPlanFeatureIds: $subscriptionPlanFeatureIds, subscriptionPlanFeature: $subscriptionPlanFeature, limit: $limit, skip: $skip) {
|
|
770
|
-
${query}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
`,
|
|
774
|
-
addSubscriptionPlanFeature: (query) => `
|
|
775
|
-
mutation addSubscriptionPlanFeature($subscriptionPlanFeature: SubscriptionPlanFeatureInput!) {
|
|
776
|
-
addSubscriptionPlanFeature(subscriptionPlanFeature: $subscriptionPlanFeature) {
|
|
777
|
-
${query}
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
`,
|
|
781
|
-
updateSubscriptionPlanFeature: (query) => `
|
|
782
|
-
mutation updateSubscriptionPlanFeature($subscriptionPlanFeatureId: String!, $subscriptionPlanFeature: SubscriptionPlanFeatureInput!) {
|
|
783
|
-
updateSubscriptionPlanFeature(subscriptionPlanFeatureId: $subcriptionPlanFeatureId, subscriptionPlanFeature: $subscriptionPlanFeature) {
|
|
784
|
-
${query}
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
`,
|
|
788
|
-
removeSubscriptionPlanFeature: (query) => `
|
|
789
|
-
mutation removeSubscriptionPlanFeature($subscriptionPlanFeatureId: String!) {
|
|
790
|
-
removeSubscriptionPlanFeature(subscriptionPlanFeatureId: $subcriptionPlanFeatureId) {
|
|
791
|
-
${query}
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
`
|
|
795
|
-
};
|
|
748
|
+
// src/services/subscription/types/subscription-trial.type.ts
|
|
749
|
+
var ENTITY5 = "subscriptionTrial";
|
|
750
|
+
var subscriptionTrialIntegration = createStandardEntityIntegration({
|
|
751
|
+
key: ENTITY5,
|
|
752
|
+
fields: subscriptionTrialQuery
|
|
753
|
+
});
|
|
754
|
+
var subscriptionTrialListIntegration = createListIntegration({
|
|
755
|
+
key: "subscriptionTrials",
|
|
756
|
+
fields: subscriptionTrialQuery
|
|
757
|
+
});
|
|
758
|
+
var subscriptionTrialDeleteIntegration = createDeleteIntegration(ENTITY5);
|
|
796
759
|
|
|
797
|
-
// src/
|
|
798
|
-
|
|
799
|
-
async
|
|
760
|
+
// src/helpers/service.factory.ts
|
|
761
|
+
function createOperationExecutor(client, key, config) {
|
|
762
|
+
return async (input, fetchFields, option) => {
|
|
800
763
|
var _a, _b, _c;
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
),
|
|
807
|
-
input,
|
|
808
|
-
option
|
|
764
|
+
const query = config.schema(
|
|
765
|
+
gqlQueryStringBuilder(
|
|
766
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : config.defaultRootFields,
|
|
767
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : config.defaultNestedFields
|
|
768
|
+
)
|
|
809
769
|
);
|
|
810
|
-
return (_c = (_b = res.data) == null ? void 0 : _b.removeSubscriptionPlanFeature) != null ? _c : null;
|
|
811
|
-
},
|
|
812
|
-
async updateSubscriptionPlanFeature(input, fetchFields, option) {
|
|
813
|
-
var _a, _b, _c, _d;
|
|
814
770
|
const res = await client.request(
|
|
815
|
-
|
|
816
|
-
gqlQueryStringBuilder(
|
|
817
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateSubscriptionPlanFeatureResponse,
|
|
818
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateSubscriptionPlanFeatureResponseNestedFields
|
|
819
|
-
)
|
|
820
|
-
),
|
|
771
|
+
query,
|
|
821
772
|
input,
|
|
822
773
|
option
|
|
823
774
|
);
|
|
824
|
-
return (
|
|
775
|
+
return (_c = res.data) == null ? void 0 : _c[key];
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// src/helpers/schema-builder.ts
|
|
780
|
+
function buildSchema({
|
|
781
|
+
operation,
|
|
782
|
+
name,
|
|
783
|
+
variables,
|
|
784
|
+
field
|
|
785
|
+
}) {
|
|
786
|
+
return (selection) => `
|
|
787
|
+
${operation} ${name}${variables} {
|
|
788
|
+
${name}${field} {
|
|
789
|
+
${selection}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
`.trim();
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// src/services/subscription/schemas/subscription-plan-feature-definition.schema.ts
|
|
796
|
+
var subscriptionPlanFeatureDefinitionSchema = {
|
|
797
|
+
get: {
|
|
798
|
+
operation: "query",
|
|
799
|
+
name: "getSubscriptionPlanFeatureDefinition",
|
|
800
|
+
variables: "($subscriptionPlanFeatureDefinition: SubscriptionPlanFeatureDefinitionInput!)",
|
|
801
|
+
field: "(subscriptionPlanFeatureDefinition: $subscriptionPlanFeatureDefinition)"
|
|
825
802
|
},
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addSubscriptionPlanFeatureResponse,
|
|
832
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addSubscriptionPlanFeatureResponseNestedFields
|
|
833
|
-
)
|
|
834
|
-
),
|
|
835
|
-
input,
|
|
836
|
-
option
|
|
837
|
-
);
|
|
838
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.addSubscriptionPlanFeature) != null ? _d : null;
|
|
803
|
+
list: {
|
|
804
|
+
operation: "query",
|
|
805
|
+
name: "getSubscriptionPlanFeatureDefinitions",
|
|
806
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $subscriptionPlanFeatureDefinition: SubscriptionPlanFeatureDefinitionInput, $subscriptionPlanFeatureDefinitionIds: [String])",
|
|
807
|
+
field: "(limit: $limit, skip: $skip, search: $search, subscriptionPlanFeatureDefinition: $subscriptionPlanFeatureDefinition, subscriptionPlanFeatureDefinitionIds: $subscriptionPlanFeatureDefinitionIds)"
|
|
839
808
|
},
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionPlanFeatureResponse,
|
|
846
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionPlanFeatureResponseNestedFields
|
|
847
|
-
)
|
|
848
|
-
),
|
|
849
|
-
input,
|
|
850
|
-
option
|
|
851
|
-
);
|
|
852
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptionPlanFeature) != null ? _d : null;
|
|
809
|
+
create: {
|
|
810
|
+
operation: "mutation",
|
|
811
|
+
name: "createSubscriptionPlanFeatureDefinition",
|
|
812
|
+
variables: "($subscriptionPlanFeatureDefinition: SubscriptionPlanFeatureDefinitionInput!)",
|
|
813
|
+
field: "(subscriptionPlanFeatureDefinition: $subscriptionPlanFeatureDefinition)"
|
|
853
814
|
},
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
);
|
|
866
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptionPlanFeatures) != null ? _d : null;
|
|
815
|
+
update: {
|
|
816
|
+
operation: "mutation",
|
|
817
|
+
name: "updateSubscriptionPlanFeatureDefinition",
|
|
818
|
+
variables: "($subscriptionPlanFeatureDefinitionId: String!, $subscriptionPlanFeatureDefinition: SubscriptionPlanFeatureDefinitionInput!)",
|
|
819
|
+
field: "(subscriptionPlanFeatureDefinitionId: $subscriptionPlanFeatureDefinitionId, subscriptionPlanFeatureDefinition: $subscriptionPlanFeatureDefinition)"
|
|
820
|
+
},
|
|
821
|
+
delete: {
|
|
822
|
+
operation: "mutation",
|
|
823
|
+
name: "removeSubscriptionPlanFeatureDefinition",
|
|
824
|
+
variables: "($subscriptionPlanFeatureDefinitionId: String!)",
|
|
825
|
+
field: "(subscriptionPlanFeatureDefinitionId: $subscriptionPlanFeatureDefinitionId)"
|
|
867
826
|
}
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
// src/services/subscription/subscription-plan-feature-definition.service.ts
|
|
830
|
+
var createSubscriptionPlanFeatureDefinitionService = (client) => ({
|
|
831
|
+
createSubscriptionPlanFeatureDefinition: createOperationExecutor(
|
|
832
|
+
client,
|
|
833
|
+
"createSubscriptionPlanFeatureDefinition",
|
|
834
|
+
{
|
|
835
|
+
schema: buildSchema(subscriptionPlanFeatureDefinitionSchema.create),
|
|
836
|
+
defaultRootFields: subscriptionPlanFeatureDefinitionIntegration.create.responseFields,
|
|
837
|
+
defaultNestedFields: subscriptionPlanFeatureDefinitionIntegration.create.nestedFields
|
|
838
|
+
}
|
|
839
|
+
),
|
|
840
|
+
updateSubscriptionPlanFeatureDefinition: createOperationExecutor(
|
|
841
|
+
client,
|
|
842
|
+
"updateSubscriptionPlanFeatureDefinition",
|
|
843
|
+
{
|
|
844
|
+
schema: buildSchema(subscriptionPlanFeatureDefinitionSchema.update),
|
|
845
|
+
defaultRootFields: subscriptionPlanFeatureDefinitionIntegration.update.responseFields,
|
|
846
|
+
defaultNestedFields: subscriptionPlanFeatureDefinitionIntegration.update.nestedFields
|
|
847
|
+
}
|
|
848
|
+
),
|
|
849
|
+
getSubscriptionPlanFeatureDefinition: createOperationExecutor(
|
|
850
|
+
client,
|
|
851
|
+
"getSubscriptionPlanFeatureDefinition",
|
|
852
|
+
{
|
|
853
|
+
schema: buildSchema(subscriptionPlanFeatureDefinitionSchema.get),
|
|
854
|
+
defaultRootFields: subscriptionPlanFeatureDefinitionIntegration.get.responseFields,
|
|
855
|
+
defaultNestedFields: subscriptionPlanFeatureDefinitionIntegration.get.nestedFields
|
|
856
|
+
}
|
|
857
|
+
),
|
|
858
|
+
removeSubscriptionPlanFeatureDefinition: createOperationExecutor(
|
|
859
|
+
client,
|
|
860
|
+
"removeSubscriptionPlanFeatureDefinition",
|
|
861
|
+
{
|
|
862
|
+
schema: buildSchema(subscriptionPlanFeatureDefinitionSchema.delete),
|
|
863
|
+
defaultRootFields: subscriptionPlanFeatureDefinitionDeleteIntegration.responseFields,
|
|
864
|
+
defaultNestedFields: {}
|
|
865
|
+
}
|
|
866
|
+
),
|
|
867
|
+
getSubscriptionPlanFeatureDefinitions: createOperationExecutor(
|
|
868
|
+
client,
|
|
869
|
+
"getSubscriptionPlanFeatureDefinitions",
|
|
870
|
+
{
|
|
871
|
+
schema: buildSchema(subscriptionPlanFeatureDefinitionSchema.list),
|
|
872
|
+
defaultRootFields: [...subscriptionPlanFeatureDefinitionListIntegration.responseFields],
|
|
873
|
+
defaultNestedFields: subscriptionPlanFeatureDefinitionListIntegration.nestedFields
|
|
874
|
+
}
|
|
875
|
+
)
|
|
868
876
|
});
|
|
869
877
|
|
|
870
878
|
// src/services/subscription/schemas/subscription-plan.schema.ts
|
|
871
879
|
var subscriptionPlanSchema = {
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
}
|
|
878
|
-
`,
|
|
879
|
-
getSubscriptionPlans: (query) => `
|
|
880
|
-
query getSubscriptionPlans($search: String, $subscriptionPlanIds: [String], $subscriptionPlan: SubscriptionPlanInput, $limit: Int!, $skip: Int!) {
|
|
881
|
-
getSubscriptionPlans(search: $search, subscriptionPlanIds: $subscriptionPlanIds, subscriptionPlan: $subscriptionPlan, limit: $limit, skip: $skip) {
|
|
882
|
-
${query}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
`,
|
|
886
|
-
addSubscriptionPlan: (query) => `
|
|
887
|
-
mutation addSubscriptionPlan($subscriptionPlan: SubscriptionPlanInput!) {
|
|
888
|
-
addSubscriptionPlan(subscriptionPlan: $subscriptionPlan) {
|
|
889
|
-
${query}
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
`,
|
|
893
|
-
updateSubscriptionPlan: (query) => `
|
|
894
|
-
mutation updateSubscriptionPlan($subscriptionPlanId: String!, $subscriptionPlan: SubscriptionPlanInput!) {
|
|
895
|
-
updateSubscriptionPlan(subscriptionPlanId: $subscriptionPlanId, subscriptionPlan: $subscriptionPlan) {
|
|
896
|
-
${query}
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
`,
|
|
900
|
-
removeSubscriptionPlan: (query) => `
|
|
901
|
-
mutation removeSubscriptionPlan($subscriptionPlanId: String!) {
|
|
902
|
-
removeSubscriptionPlan(subscriptionPlanId: $subscriptionPlanId) {
|
|
903
|
-
${query}
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
`
|
|
907
|
-
};
|
|
908
|
-
|
|
909
|
-
// src/services/subscription/subscription-plan.service.ts
|
|
910
|
-
var createSubscriptionPlanService = (client) => ({
|
|
911
|
-
async removeSubscriptionPlan(input, fetchFields, option) {
|
|
912
|
-
var _a, _b, _c;
|
|
913
|
-
const res = await client.request(
|
|
914
|
-
subscriptionPlanSchema.removeSubscriptionPlan(
|
|
915
|
-
gqlQueryStringBuilder(
|
|
916
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeSubscriptionPlanResponse
|
|
917
|
-
)
|
|
918
|
-
),
|
|
919
|
-
input,
|
|
920
|
-
option
|
|
921
|
-
);
|
|
922
|
-
return (_c = (_b = res.data) == null ? void 0 : _b.removeSubscriptionPlan) != null ? _c : null;
|
|
880
|
+
get: {
|
|
881
|
+
operation: "query",
|
|
882
|
+
name: "getSubscriptionPlan",
|
|
883
|
+
variables: "($subscriptionPlan: SubscriptionPlanInput!)",
|
|
884
|
+
field: "(subscriptionPlan: $subscriptionPlan)"
|
|
923
885
|
},
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateSubscriptionPlanResponse,
|
|
930
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateSubscriptionPlanResponseNestedFields
|
|
931
|
-
)
|
|
932
|
-
),
|
|
933
|
-
input,
|
|
934
|
-
option
|
|
935
|
-
);
|
|
936
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.updateSubscriptionPlan) != null ? _d : null;
|
|
886
|
+
list: {
|
|
887
|
+
operation: "query",
|
|
888
|
+
name: "getSubscriptionPlans",
|
|
889
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $subscriptionPlan: SubscriptionPlanInput, $subscriptionPlanIds: [String])",
|
|
890
|
+
field: "(limit: $limit, skip: $skip, search: $search, subscriptionPlan: $subscriptionPlan, subscriptionPlanIds: $subscriptionPlanIds)"
|
|
937
891
|
},
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addSubscriptionPlanResponse,
|
|
944
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addSubscriptionPlanResponseNestedFields
|
|
945
|
-
)
|
|
946
|
-
),
|
|
947
|
-
input,
|
|
948
|
-
option
|
|
949
|
-
);
|
|
950
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.addSubscriptionPlan) != null ? _d : null;
|
|
892
|
+
create: {
|
|
893
|
+
operation: "mutation",
|
|
894
|
+
name: "createSubscriptionPlan",
|
|
895
|
+
variables: "($subscriptionPlan: SubscriptionPlanInput!)",
|
|
896
|
+
field: "(subscriptionPlan: $subscriptionPlan)"
|
|
951
897
|
},
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionPlanResponse,
|
|
958
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionPlanResponseNestedFields
|
|
959
|
-
)
|
|
960
|
-
),
|
|
961
|
-
input,
|
|
962
|
-
option
|
|
963
|
-
);
|
|
964
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptionPlan) != null ? _d : null;
|
|
898
|
+
update: {
|
|
899
|
+
operation: "mutation",
|
|
900
|
+
name: "updateSubscriptionPlan",
|
|
901
|
+
variables: "($subscriptionPlanId: String!, $subscriptionPlan: SubscriptionPlanInput!)",
|
|
902
|
+
field: "(subscriptionPlanId: $subscriptionPlanId, subscriptionPlan: $subscriptionPlan)"
|
|
965
903
|
},
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionPlansResponse,
|
|
972
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionPlansResponseNestedFields
|
|
973
|
-
)
|
|
974
|
-
),
|
|
975
|
-
input,
|
|
976
|
-
option
|
|
977
|
-
);
|
|
978
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptionPlans) != null ? _d : null;
|
|
904
|
+
delete: {
|
|
905
|
+
operation: "mutation",
|
|
906
|
+
name: "removeSubscriptionPlan",
|
|
907
|
+
variables: "($subscriptionPlanId: String!)",
|
|
908
|
+
field: "(subscriptionPlanId: $subscriptionPlanId)"
|
|
979
909
|
}
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
// src/services/subscription/subscription-plan.service.ts
|
|
913
|
+
var createSubscriptionPlanService = (client) => ({
|
|
914
|
+
createSubscriptionPlan: createOperationExecutor(
|
|
915
|
+
client,
|
|
916
|
+
"createSubscriptionPlan",
|
|
917
|
+
{
|
|
918
|
+
schema: buildSchema(subscriptionPlanSchema.create),
|
|
919
|
+
defaultRootFields: subscriptionPlanIntegration.create.responseFields,
|
|
920
|
+
defaultNestedFields: subscriptionPlanIntegration.create.nestedFields
|
|
921
|
+
}
|
|
922
|
+
),
|
|
923
|
+
updateSubscriptionPlan: createOperationExecutor(
|
|
924
|
+
client,
|
|
925
|
+
"updateSubscriptionPlan",
|
|
926
|
+
{
|
|
927
|
+
schema: buildSchema(subscriptionPlanSchema.update),
|
|
928
|
+
defaultRootFields: subscriptionPlanIntegration.update.responseFields,
|
|
929
|
+
defaultNestedFields: subscriptionPlanIntegration.update.nestedFields
|
|
930
|
+
}
|
|
931
|
+
),
|
|
932
|
+
getSubscriptionPlan: createOperationExecutor(
|
|
933
|
+
client,
|
|
934
|
+
"getSubscriptionPlan",
|
|
935
|
+
{
|
|
936
|
+
schema: buildSchema(subscriptionPlanSchema.get),
|
|
937
|
+
defaultRootFields: subscriptionPlanIntegration.get.responseFields,
|
|
938
|
+
defaultNestedFields: subscriptionPlanIntegration.get.nestedFields
|
|
939
|
+
}
|
|
940
|
+
),
|
|
941
|
+
removeSubscriptionPlan: createOperationExecutor(
|
|
942
|
+
client,
|
|
943
|
+
"removeSubscriptionPlan",
|
|
944
|
+
{
|
|
945
|
+
schema: buildSchema(subscriptionPlanSchema.delete),
|
|
946
|
+
defaultRootFields: subscriptionPlanDeleteIntegration.responseFields,
|
|
947
|
+
defaultNestedFields: {}
|
|
948
|
+
}
|
|
949
|
+
),
|
|
950
|
+
getSubscriptionPlans: createOperationExecutor(
|
|
951
|
+
client,
|
|
952
|
+
"getSubscriptionPlans",
|
|
953
|
+
{
|
|
954
|
+
schema: buildSchema(subscriptionPlanSchema.list),
|
|
955
|
+
defaultRootFields: [...subscriptionPlanListIntegration.responseFields],
|
|
956
|
+
defaultNestedFields: subscriptionPlanListIntegration.nestedFields
|
|
957
|
+
}
|
|
958
|
+
)
|
|
980
959
|
});
|
|
981
960
|
|
|
982
961
|
// src/services/subscription/schemas/subscription.schema.ts
|
|
@@ -1091,41 +1070,6 @@ var createSubscriptionService = (client) => ({
|
|
|
1091
1070
|
}
|
|
1092
1071
|
});
|
|
1093
1072
|
|
|
1094
|
-
// src/helpers/service.factory.ts
|
|
1095
|
-
function createOperationExecutor(client, key, config) {
|
|
1096
|
-
return async (input, fetchFields, option) => {
|
|
1097
|
-
var _a, _b, _c;
|
|
1098
|
-
const query = config.schema(
|
|
1099
|
-
gqlQueryStringBuilder(
|
|
1100
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : config.defaultRootFields,
|
|
1101
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : config.defaultNestedFields
|
|
1102
|
-
)
|
|
1103
|
-
);
|
|
1104
|
-
const res = await client.request(
|
|
1105
|
-
query,
|
|
1106
|
-
input,
|
|
1107
|
-
option
|
|
1108
|
-
);
|
|
1109
|
-
return (_c = res.data) == null ? void 0 : _c[key];
|
|
1110
|
-
};
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
// src/helpers/schema-builder.ts
|
|
1114
|
-
function buildSchema({
|
|
1115
|
-
operation,
|
|
1116
|
-
name,
|
|
1117
|
-
variables,
|
|
1118
|
-
field
|
|
1119
|
-
}) {
|
|
1120
|
-
return (selection) => `
|
|
1121
|
-
${operation} ${name}${variables} {
|
|
1122
|
-
${name}${field} {
|
|
1123
|
-
${selection}
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
`.trim();
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
1073
|
// src/services/subscription/schemas/subscription-plan-feature-behaviour.ts
|
|
1130
1074
|
var subscriptionPlanFeatureBehaviourSchema = {
|
|
1131
1075
|
get: {
|
|
@@ -1209,6 +1153,89 @@ var createSubscriptionPlanFeatureBehaviourService = (client) => ({
|
|
|
1209
1153
|
)
|
|
1210
1154
|
});
|
|
1211
1155
|
|
|
1156
|
+
// src/services/subscription/schemas/subscription-trial.schema.ts
|
|
1157
|
+
var subscriptionTrialSchema = {
|
|
1158
|
+
get: {
|
|
1159
|
+
operation: "query",
|
|
1160
|
+
name: "getSubscriptionTrial",
|
|
1161
|
+
variables: "($subscriptionTrial: SubscriptionTrialInput!)",
|
|
1162
|
+
field: "(subscriptionTrial: $subscriptionTrial)"
|
|
1163
|
+
},
|
|
1164
|
+
list: {
|
|
1165
|
+
operation: "query",
|
|
1166
|
+
name: "getSubscriptionTrials",
|
|
1167
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $subscriptionTrial: SubscriptionTrialInput, $subscriptionTrialIds: [String])",
|
|
1168
|
+
field: "(limit: $limit, skip: $skip, search: $search, subscriptionTrial: $subscriptionTrial, subscriptionTrialIds: $subscriptionTrialIds)"
|
|
1169
|
+
},
|
|
1170
|
+
create: {
|
|
1171
|
+
operation: "mutation",
|
|
1172
|
+
name: "createSubscriptionTrial",
|
|
1173
|
+
variables: "($subscriptionTrial: SubscriptionTrialInput!)",
|
|
1174
|
+
field: "(subscriptionTrial: $subscriptionTrial)"
|
|
1175
|
+
},
|
|
1176
|
+
update: {
|
|
1177
|
+
operation: "mutation",
|
|
1178
|
+
name: "updateSubscriptionTrial",
|
|
1179
|
+
variables: "($subscriptionTrialId: String!, $subscriptionTrial: SubscriptionTrialInput!)",
|
|
1180
|
+
field: "(subscriptionTrialId: $subscriptionTrialId, subscriptionTrial: $subscriptionTrial)"
|
|
1181
|
+
},
|
|
1182
|
+
delete: {
|
|
1183
|
+
operation: "mutation",
|
|
1184
|
+
name: "removeSubscriptionTrial",
|
|
1185
|
+
variables: "($subscriptionTrialId: String!)",
|
|
1186
|
+
field: "(subscriptionTrialId: $subscriptionTrialId)"
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
// src/services/subscription/subscription-trial.service.ts
|
|
1191
|
+
var createSubscriptionTrialService = (client) => ({
|
|
1192
|
+
createSubscriptionTrial: createOperationExecutor(
|
|
1193
|
+
client,
|
|
1194
|
+
"createSubscriptionTrial",
|
|
1195
|
+
{
|
|
1196
|
+
schema: buildSchema(subscriptionTrialSchema.create),
|
|
1197
|
+
defaultRootFields: subscriptionTrialIntegration.create.responseFields,
|
|
1198
|
+
defaultNestedFields: subscriptionTrialIntegration.create.nestedFields
|
|
1199
|
+
}
|
|
1200
|
+
),
|
|
1201
|
+
updateSubscriptionTrial: createOperationExecutor(
|
|
1202
|
+
client,
|
|
1203
|
+
"updateSubscriptionTrial",
|
|
1204
|
+
{
|
|
1205
|
+
schema: buildSchema(subscriptionTrialSchema.update),
|
|
1206
|
+
defaultRootFields: subscriptionTrialIntegration.update.responseFields,
|
|
1207
|
+
defaultNestedFields: subscriptionTrialIntegration.update.nestedFields
|
|
1208
|
+
}
|
|
1209
|
+
),
|
|
1210
|
+
getSubscriptionTrial: createOperationExecutor(
|
|
1211
|
+
client,
|
|
1212
|
+
"getSubscriptionTrial",
|
|
1213
|
+
{
|
|
1214
|
+
schema: buildSchema(subscriptionTrialSchema.get),
|
|
1215
|
+
defaultRootFields: subscriptionTrialIntegration.get.responseFields,
|
|
1216
|
+
defaultNestedFields: subscriptionTrialIntegration.get.nestedFields
|
|
1217
|
+
}
|
|
1218
|
+
),
|
|
1219
|
+
removeSubscriptionTrial: createOperationExecutor(
|
|
1220
|
+
client,
|
|
1221
|
+
"removeSubscriptionTrial",
|
|
1222
|
+
{
|
|
1223
|
+
schema: buildSchema(subscriptionTrialSchema.delete),
|
|
1224
|
+
defaultRootFields: subscriptionTrialDeleteIntegration.responseFields,
|
|
1225
|
+
defaultNestedFields: {}
|
|
1226
|
+
}
|
|
1227
|
+
),
|
|
1228
|
+
getSubscriptionTrials: createOperationExecutor(
|
|
1229
|
+
client,
|
|
1230
|
+
"getSubscriptionTrials",
|
|
1231
|
+
{
|
|
1232
|
+
schema: buildSchema(subscriptionTrialSchema.list),
|
|
1233
|
+
defaultRootFields: [...subscriptionTrialListIntegration.responseFields],
|
|
1234
|
+
defaultNestedFields: subscriptionTrialListIntegration.nestedFields
|
|
1235
|
+
}
|
|
1236
|
+
)
|
|
1237
|
+
});
|
|
1238
|
+
|
|
1212
1239
|
// src/services/user/types/user.type.ts
|
|
1213
1240
|
var getUserTypeCountsResponse = [
|
|
1214
1241
|
"userTypeCounts"
|
|
@@ -1710,9 +1737,9 @@ var createUserAccountService = (client) => ({
|
|
|
1710
1737
|
});
|
|
1711
1738
|
|
|
1712
1739
|
// src/services/user/types/user-role.type.ts
|
|
1713
|
-
var
|
|
1740
|
+
var ENTITY6 = "userRole";
|
|
1714
1741
|
var userRoleIntegration = createStandardEntityIntegration({
|
|
1715
|
-
key:
|
|
1742
|
+
key: ENTITY6,
|
|
1716
1743
|
fields: userRoleQuery,
|
|
1717
1744
|
nested: {
|
|
1718
1745
|
privileges: privilegeQuery
|
|
@@ -1725,7 +1752,7 @@ var userRoleListIntegration = createListIntegration({
|
|
|
1725
1752
|
privileges: privilegeQuery
|
|
1726
1753
|
}
|
|
1727
1754
|
});
|
|
1728
|
-
var userRoleDeleteIntegration = createDeleteIntegration(
|
|
1755
|
+
var userRoleDeleteIntegration = createDeleteIntegration(ENTITY6);
|
|
1729
1756
|
|
|
1730
1757
|
// src/services/user/schemas/user-role.schema.ts
|
|
1731
1758
|
var userRoleSchema = {
|
|
@@ -1811,16 +1838,16 @@ var createUserRoleService = (client) => ({
|
|
|
1811
1838
|
});
|
|
1812
1839
|
|
|
1813
1840
|
// src/services/user/types/application-feature.type.ts
|
|
1814
|
-
var
|
|
1841
|
+
var ENTITY7 = "applicationFeature";
|
|
1815
1842
|
var applicationFeatureIntegration = createStandardEntityIntegration({
|
|
1816
|
-
key:
|
|
1843
|
+
key: ENTITY7,
|
|
1817
1844
|
fields: applicationFeatureQuery
|
|
1818
1845
|
});
|
|
1819
1846
|
var applicationFeatureListIntegration = createListIntegration({
|
|
1820
1847
|
key: "applicationFeatures",
|
|
1821
1848
|
fields: applicationFeatureQuery
|
|
1822
1849
|
});
|
|
1823
|
-
var applicationFeatureDeleteIntegration = createDeleteIntegration(
|
|
1850
|
+
var applicationFeatureDeleteIntegration = createDeleteIntegration(ENTITY7);
|
|
1824
1851
|
|
|
1825
1852
|
// src/services/user/schemas/application-feature.schema.ts
|
|
1826
1853
|
var applicationFeatureSchema = {
|
|
@@ -3337,6 +3364,6 @@ var createTransactionService = (client) => ({
|
|
|
3337
3364
|
}
|
|
3338
3365
|
});
|
|
3339
3366
|
|
|
3340
|
-
export { AuthenticationError, GraphQLClient, NetworkError, SdkError, SubscriptionPlanFeatureKeyLabels, UpdateSaleResponse, _getPackageResponseNestedFields, _getProductResponseNestedFields, _getSaleResponseNestedFields, _getStoreResponseNestedFields,
|
|
3367
|
+
export { AuthenticationError, GraphQLClient, NetworkError, SdkError, SubscriptionPlanFeatureKeyLabels, UpdateSaleResponse, _getPackageResponseNestedFields, _getProductResponseNestedFields, _getSaleResponseNestedFields, _getStoreResponseNestedFields, _getSubscriptionResponseNestedFields, _getTransactionResponseNestedFields, _getTransactionsResponseNestedFields, addPackageResponseFields, addPackageResponseNestedFields, addPackagesResponseFields, addPackagesResponseNestedFields, addPriceResponseFields, addPriceResponseNestedFields, addProductResponseFields, addProductResponseNestedFields, addStockResponse, addStockResponseNestedFields, addStoreResponse, addStoreResponseNestedFields, addSubscriptionResponse, addSubscriptionResponseNestedFields, addTransactionResponse, addTransactionResponseNestedFields, compose, createApplicationFeatureService, createAuthService, createOrderService, createPackageService, createPaystackService, createPriceService, createProductService, createSaleService, createStockService, createStoreCategoryProductResponseFields, createStoreCategoryProductResponseNestedFields, createStoreCategoryProductService, createStoreCategoryResponseFields, createStoreCategoryResponseNestedFields, createStoreCategoryService, createStoreService, createSubscriptionPlanFeatureBehaviourService, createSubscriptionPlanFeatureDefinitionService, createSubscriptionPlanService, createSubscriptionService, createSubscriptionTrialService, createTransactionService, createTransport, createUserAccountService, createUserNotificationService, createUserRoleService, createUserService, getCustomerProductCountsByIdsResponse, getCustomerProductCountsByIdsResponseNestedFields, getOrderResponse, getOrderResponseNestedFields, getOrdersResponse, getOrdersResponseNestedFields, getPackageResponseFields, getPackageResponseNestedFields, getPackagesResponseFields, getPackagesResponseNestedFields, getPriceResponseFields, getPriceResponseNestedFields, getPricesResponseFields, getPricesResponseNestedFields, getProductByBarcodeResponse, getProductByBarcodeResponseNestedFields, getProductResponseFields, getProductResponseNestedFields, getProductsResponseFields, getProductsResponseNestedFields, getSaleResponse, getSaleResponseNestedFields, getSalesResponse, getSalesResponseNestedFields, getStockResponse, getStockResponseNestedFields, getStocksResponse, getStocksResponseNestedFields, getStoreCategoriesResponseFields, getStoreCategoriesResponseNestedFields, getStoreCategoryProductResponseFields, getStoreCategoryProductResponseNestedFields, getStoreCategoryProductsResponseFields, getStoreCategoryProductsResponseNestedFields, getStoreCategoryResponseFields, getStoreCategoryResponseNestedFields, getStoreCountResponse, getStoreResponse, getStoreResponseNestedFields, getStoresResponse, getStoresResponseNestedFields, getSubscriptionResponse, getSubscriptionResponseNestedFields, getSubscriptionsResponse, getSubscriptionsResponseNestedFields, getTransactionResponse, getTransactionResponseNestedFields, getTransactionsResponse, getTransactionsResponseNestedFields, orderQuery, paystackInitializePaymentResponse, paystackInitializeSubscriptionResponse, removePackageResponseFields, removePriceResponseFields, removeProductResponseFields, removeStockResponse, removeStoreCategoryProductResponseFields, removeStoreCategoryResponseFields, removeStoreResponse, removeSubscriptionResponse, saleQuery, searchCategoriesAndTemplateResponse, searchCategoriesAndTemplateResponseNestedFields, searchProductNamesResponse, searchProductNamesResponseNestedFields, subscriptionPlanDeleteIntegration, subscriptionPlanFeatureBehaviourDeleteIntegration, subscriptionPlanFeatureBehaviourIntegration, subscriptionPlanFeatureBehaviourListIntegration, subscriptionPlanFeatureDefinitionDeleteIntegration, subscriptionPlanFeatureDefinitionIntegration, subscriptionPlanFeatureDefinitionListIntegration, subscriptionPlanIntegration, subscriptionPlanListIntegration, subscriptionTrialDeleteIntegration, subscriptionTrialIntegration, subscriptionTrialListIntegration, toAsyncHeadersFactory, toAsyncTokenProvider, transactionQuery, updatePackageResponseFields, updatePackageResponseNestedFields, updatePriceResponseFields, updatePriceResponseNestedFields, updateProductResponseFields, updateProductResponseNestedFields, updateSaleResponseNestedFields, updateStockResponse, updateStockResponseNestedFields, updateStoreCategoryProductResponseFields, updateStoreCategoryProductResponseNestedFields, updateStoreCategoryResponseFields, updateStoreCategoryResponseNestedFields, updateStoreResponse, updateStoreResponseNestedFields, updateSubscriptionResponse, updateSubscriptionResponseNestedFields, updateTransactionResponse, updateTransactionResponseNestedFields };
|
|
3341
3368
|
//# sourceMappingURL=index.esm.js.map
|
|
3342
3369
|
//# sourceMappingURL=index.esm.js.map
|