@authenty/authapi-types 1.0.34 → 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 {
@@ -895,12 +903,17 @@ export declare namespace AuthApi {
895
903
  list: () => Promise<responses.ApiResponse<responses.products.GET>>;
896
904
  get: (productId: number) => Promise<responses.ApiResponse<objects.Product>>;
897
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>>;
898
907
  };
899
908
  paymentMethods: {
900
909
  create: (id: number, paymentMethodData: objects.PaymentMethod) => Promise<responses.ApiResponse<responses.bundle.$bundleId.paymentMethod.POST>>;
901
910
  update: (id: number, paymentMethodId: number, paymentMethodData: objects.PaymentMethod) => Promise<responses.ApiResponse<objects.PaymentMethod>>;
902
911
  delete: (id: number, paymentMethodId: number) => Promise<responses.ApiResponse<responses.bundle.$bundleId.paymentMethod.$paymentMethodId.DELETE>>;
903
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
+ };
904
917
  aux: {
905
918
  countries: () => Promise<responses.ApiResponse<responses.aux.countries.GET>>;
906
919
  states: (countryId: number) => Promise<responses.ApiResponse<responses.aux.states.GET>>;
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', {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authenty/authapi-types",
3
- "version": "1.0.34",
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 {
@@ -1163,7 +1172,10 @@ export namespace AuthApi {
1163
1172
  },
1164
1173
  update: async (productId: number, productData: any) => {
1165
1174
  return await this.request<responses.product.$productId.PUT>('PUT', `product/${productId}`, productData);
1166
- }
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
+ },
1167
1179
  }
1168
1180
 
1169
1181
  public paymentMethods = {
@@ -1179,6 +1191,16 @@ export namespace AuthApi {
1179
1191
  }
1180
1192
  }
1181
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
+
1182
1204
  public aux = {
1183
1205
  countries: async () => {
1184
1206
  return await this.request<responses.aux.countries.GET>('GET', 'aux/countries', {});