@authenty/authapi-types 1.0.33 → 1.0.39

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.d.ts CHANGED
@@ -560,6 +560,14 @@ export declare namespace AuthApi {
560
560
  type DELETE = {
561
561
  msg: string;
562
562
  };
563
+ namespace subscriptions {
564
+ type GET = (objects.Purchase & {
565
+ PaymentMethod: objects.PaymentMethod;
566
+ Wallet: objects.Wallet & {
567
+ User: objects.LocalUser;
568
+ };
569
+ })[];
570
+ }
563
571
  }
564
572
  }
565
573
  namespace products {
@@ -768,6 +776,18 @@ export declare namespace AuthApi {
768
776
  }>;
769
777
  }
770
778
  }
779
+ namespace marketing {
780
+ namespace campaigns {
781
+ type GET = Array<{
782
+ id: number;
783
+ title: string;
784
+ short: string;
785
+ totalAccesses: number;
786
+ totalUsers: number;
787
+ totalPurchases: number;
788
+ }>;
789
+ }
790
+ }
771
791
  }
772
792
  namespace admin {
773
793
  namespace purchases {
@@ -883,12 +903,17 @@ export declare namespace AuthApi {
883
903
  list: () => Promise<responses.ApiResponse<responses.products.GET>>;
884
904
  get: (productId: number) => Promise<responses.ApiResponse<objects.Product>>;
885
905
  update: (productId: number, productData: any) => Promise<responses.ApiResponse<objects.Product>>;
906
+ getSubscriptions: (productId: number, includeExpired?: boolean) => Promise<responses.ApiResponse<responses.product.$productId.subscriptions.GET>>;
886
907
  };
887
908
  paymentMethods: {
888
909
  create: (id: number, paymentMethodData: objects.PaymentMethod) => Promise<responses.ApiResponse<responses.bundle.$bundleId.paymentMethod.POST>>;
889
910
  update: (id: number, paymentMethodId: number, paymentMethodData: objects.PaymentMethod) => Promise<responses.ApiResponse<objects.PaymentMethod>>;
890
911
  delete: (id: number, paymentMethodId: number) => Promise<responses.ApiResponse<responses.bundle.$bundleId.paymentMethod.$paymentMethodId.DELETE>>;
891
912
  };
913
+ bundles: {
914
+ list: () => Promise<responses.ApiResponse<responses.bundles.GET>>;
915
+ get: (bundleId: number, includeDeleted?: boolean, includeInactive?: boolean) => Promise<responses.ApiResponse<objects.Bundle>>;
916
+ };
892
917
  aux: {
893
918
  countries: () => Promise<responses.ApiResponse<responses.aux.countries.GET>>;
894
919
  states: (countryId: number) => Promise<responses.ApiResponse<responses.aux.states.GET>>;
@@ -913,6 +938,7 @@ export declare namespace AuthApi {
913
938
  usersTimeline: (iniDate?: string, endDate?: string) => Promise<responses.ApiResponse<responses.report.users.timeline.GET>>;
914
939
  usersCumulativeTimeline: (iniDate?: string, endDate?: string) => Promise<responses.ApiResponse<responses.report.users.cumulativeTimeline.GET>>;
915
940
  getLiveUsersCountByProduct: () => Promise<responses.ApiResponse<responses.report.live.activeUsersBySoftware.GET>>;
941
+ marketingCampaigns: (iniDate?: string, endDate?: string) => Promise<responses.ApiResponse<responses.report.marketing.campaigns.GET>>;
916
942
  };
917
943
  };
918
944
  support: {
package/dist/index.js CHANGED
@@ -203,7 +203,10 @@ var AuthApi;
203
203
  },
204
204
  update: async (productId, productData) => {
205
205
  return await this.request('PUT', `product/${productId}`, productData);
206
- }
206
+ },
207
+ getSubscriptions: async (productId, includeExpired = false) => {
208
+ return await this.request('GET', `product/${productId}/subscriptions`, { includeExpired });
209
+ },
207
210
  };
208
211
  this.paymentMethods = {
209
212
  create: async (id, paymentMethodData) => {
@@ -216,6 +219,14 @@ var AuthApi;
216
219
  return await this.request('DELETE', `bundle/${id}/paymentMethod/${paymentMethodId}`, {});
217
220
  }
218
221
  };
222
+ this.bundles = {
223
+ list: async () => {
224
+ return await this.request('GET', 'bundles', {});
225
+ },
226
+ get: async (bundleId, includeDeleted = false, includeInactive = false) => {
227
+ return await this.request('GET', `bundle/${bundleId}`, { includeDeleted, includeInactive });
228
+ },
229
+ };
219
230
  this.aux = {
220
231
  countries: async () => {
221
232
  return await this.request('GET', 'aux/countries', {});
@@ -269,6 +280,9 @@ var AuthApi;
269
280
  },
270
281
  getLiveUsersCountByProduct: async () => {
271
282
  return await this.request('GET', 'report/live/active-users-by-software', {});
283
+ },
284
+ marketingCampaigns: async (iniDate, endDate) => {
285
+ return await this.request('GET', 'report/marketing/campaigns', { iniDate, endDate });
272
286
  }
273
287
  }
274
288
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authenty/authapi-types",
3
- "version": "1.0.33",
3
+ "version": "1.0.39",
4
4
  "description": "Shared types for Authenty API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -587,6 +587,15 @@ export namespace AuthApi {
587
587
  export type GET = objects.Product;
588
588
  export type PUT = objects.Product;
589
589
  export type DELETE = { msg: string };
590
+
591
+ export namespace subscriptions {
592
+ export type GET = (objects.Purchase & {
593
+ PaymentMethod: objects.PaymentMethod;
594
+ Wallet: objects.Wallet & {
595
+ User: objects.LocalUser;
596
+ };
597
+ })[];
598
+ }
590
599
  }
591
600
  }
592
601
  export namespace products {
@@ -791,8 +800,21 @@ export namespace AuthApi {
791
800
  }>
792
801
  }
793
802
  }
803
+ export namespace marketing {
804
+ export namespace campaigns {
805
+ export type GET = Array<{
806
+ id: number;
807
+ title: string;
808
+ short: string;
809
+ totalAccesses: number;
810
+ totalUsers: number;
811
+ totalPurchases: number;
812
+ }>;
813
+ }
814
+ }
794
815
  }
795
816
 
817
+
796
818
  export namespace admin {
797
819
  export namespace purchases {
798
820
  export namespace search {
@@ -1150,7 +1172,10 @@ export namespace AuthApi {
1150
1172
  },
1151
1173
  update: async (productId: number, productData: any) => {
1152
1174
  return await this.request<responses.product.$productId.PUT>('PUT', `product/${productId}`, productData);
1153
- }
1175
+ },
1176
+ getSubscriptions: async (productId: number, includeExpired:boolean=false) => {
1177
+ return await this.request<responses.product.$productId.subscriptions.GET>('GET', `product/${productId}/subscriptions`, {includeExpired});
1178
+ },
1154
1179
  }
1155
1180
 
1156
1181
  public paymentMethods = {
@@ -1166,6 +1191,16 @@ export namespace AuthApi {
1166
1191
  }
1167
1192
  }
1168
1193
 
1194
+ public bundles = {
1195
+
1196
+ list: async () => {
1197
+ return await this.request<responses.bundles.GET>('GET', 'bundles', {});
1198
+ },
1199
+ get: async (bundleId: number, includeDeleted: boolean = false, includeInactive: boolean = false) => {
1200
+ return await this.request<responses.bundle.$bundleId.GET>('GET', `bundle/${bundleId}`, { includeDeleted, includeInactive });
1201
+ },
1202
+ }
1203
+
1169
1204
  public aux = {
1170
1205
  countries: async () => {
1171
1206
  return await this.request<responses.aux.countries.GET>('GET', 'aux/countries', {});
@@ -1226,6 +1261,9 @@ export namespace AuthApi {
1226
1261
  },
1227
1262
  getLiveUsersCountByProduct: async () => {
1228
1263
  return await this.request<responses.report.live.activeUsersBySoftware.GET>('GET', 'report/live/active-users-by-software', {});
1264
+ },
1265
+ marketingCampaigns: async (iniDate?: string, endDate?: string) => {
1266
+ return await this.request<responses.report.marketing.campaigns.GET>('GET', 'report/marketing/campaigns', { iniDate, endDate });
1229
1267
  }
1230
1268
  }
1231
1269
  }