@wireapp/api-client 27.46.0 → 27.48.0

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.
@@ -11,19 +11,8 @@ export declare class BillingAPI {
11
11
  private readonly client;
12
12
  static readonly DEFAULT_INVOICES_CHUNK_SIZE = 10;
13
13
  constructor(client: HttpClient);
14
- static readonly URL: {
15
- BILLING: string;
16
- CURRENCIES: string;
17
- INFO: string;
18
- CARD: string;
19
- COUPON: string;
20
- INVOICES: string;
21
- PLAN: string;
22
- LIST: string;
23
- TEAMS: string;
24
- TEAM: string;
25
- UPCOMING: string;
26
- };
14
+ getBilling(teamId: string): Promise<any>;
15
+ getBillingEmbedded(teamId: string, planId: string): Promise<any>;
27
16
  getBillingTeam(teamId: string): Promise<BillingTeamData>;
28
17
  putBillingInfo(teamId: string, billingInfo: BillingData): Promise<BillingData>;
29
18
  getBillingInfo(teamId: string): Promise<BillingData>;
@@ -34,6 +23,7 @@ export declare class BillingAPI {
34
23
  deleteCoupon(teamId: string, coupon: string): Promise<void>;
35
24
  getCurrentPlan(teamId: string): Promise<PlanData>;
36
25
  subscribe(teamId: string, planId: string): Promise<Subscription>;
26
+ getCurrentSubscription(teamId: string, planId: string): Promise<Subscription>;
37
27
  putPlan(teamId: string, planId: string): Promise<PlanData>;
38
28
  getAvailablePlans(teamId: string, filter: {
39
29
  currency?: SupportedCurrency;
@@ -42,5 +32,6 @@ export declare class BillingAPI {
42
32
  getSupportedCurrencies(teamId: string): Promise<SupportedCurrency[]>;
43
33
  getUpcomingInvoice(teamId: string): Promise<InvoiceUpcomingData>;
44
34
  getInvoices(teamId: string, limit?: number, startAfterInvoiceId?: string): Promise<InvoiceListData>;
35
+ getPortalUrl(teamId: string): Promise<any>;
45
36
  }
46
37
  //# sourceMappingURL=BillingAPI.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BillingAPI.d.ts","sourceRoot":"","sources":["../../../src/team/billing/BillingAPI.ts"],"names":[],"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AC,QAAQ,CAAC;IAW1D,iBAAiB,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE;QACN,QAAQ,CAAC,EAAE,iBAAiB,CAAC;QAC7B,QAAQ,CAAC,EAAE,YAAY,CAAC;KACzB,GACA,OAAO,CAAC,QAAQ,EAAE,CAAC;IAWT,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAUpE,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAUhE,WAAW,CACtB,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAA+C,EACtD,mBAAmB,CAAC,EAAE,MAAM,GAC3B,OAAO,CAAC,eAAe,CAAC;IAcd,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CASxD"}
@@ -25,23 +25,29 @@ class BillingAPI {
25
25
  constructor(client) {
26
26
  this.client = client;
27
27
  }
28
- static URL = {
29
- BILLING: 'billing',
30
- CURRENCIES: 'currencies',
31
- INFO: 'info',
32
- CARD: 'card',
33
- COUPON: 'coupon',
34
- INVOICES: 'invoices',
35
- PLAN: 'plan',
36
- LIST: 'list',
37
- TEAMS: '/teams',
38
- TEAM: 'team',
39
- UPCOMING: 'upcoming',
40
- };
28
+ async getBilling(teamId) {
29
+ const config = {
30
+ method: 'get',
31
+ url: `/teams/${teamId}/billing/checkout`,
32
+ };
33
+ const response = await this.client.sendJSON(config);
34
+ return response.data;
35
+ }
36
+ async getBillingEmbedded(teamId, planId) {
37
+ const config = {
38
+ method: 'POST',
39
+ url: `/teams/${teamId}/billing/checkout/embedded`,
40
+ data: {
41
+ planId,
42
+ },
43
+ };
44
+ const response = await this.client.sendJSON(config);
45
+ return response.data;
46
+ }
41
47
  async getBillingTeam(teamId) {
42
48
  const config = {
43
49
  method: 'get',
44
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.TEAM}`,
50
+ url: `/teams/${teamId}/billing/team`,
45
51
  };
46
52
  const response = await this.client.sendJSON(config);
47
53
  return response.data;
@@ -50,7 +56,7 @@ class BillingAPI {
50
56
  const config = {
51
57
  data: billingInfo,
52
58
  method: 'put',
53
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.INFO}`,
59
+ url: `/teams/${teamId}/billing/info`,
54
60
  };
55
61
  const response = await this.client.sendJSON(config);
56
62
  return response.data;
@@ -58,7 +64,7 @@ class BillingAPI {
58
64
  async getBillingInfo(teamId) {
59
65
  const config = {
60
66
  method: 'get',
61
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.INFO}`,
67
+ url: `/teams/${teamId}/billing/info`,
62
68
  };
63
69
  const response = await this.client.sendJSON(config);
64
70
  return response.data;
@@ -69,7 +75,7 @@ class BillingAPI {
69
75
  paymentMethod: paymentMethodId,
70
76
  },
71
77
  method: 'put',
72
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.CARD}`,
78
+ url: `/teams/${teamId}/billing/card`,
73
79
  };
74
80
  const response = await this.client.sendJSON(config);
75
81
  return response.data;
@@ -77,7 +83,7 @@ class BillingAPI {
77
83
  async deleteCard(teamId) {
78
84
  const config = {
79
85
  method: 'delete',
80
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.CARD}`,
86
+ url: `/teams/${teamId}/billing/card`,
81
87
  };
82
88
  const response = await this.client.sendJSON(config);
83
89
  return response.data;
@@ -85,7 +91,7 @@ class BillingAPI {
85
91
  async getCard(teamId) {
86
92
  const config = {
87
93
  method: 'get',
88
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.CARD}`,
94
+ url: `/teams/${teamId}/billing/card`,
89
95
  };
90
96
  const response = await this.client.sendJSON(config);
91
97
  return response.data;
@@ -96,7 +102,7 @@ class BillingAPI {
96
102
  coupon,
97
103
  },
98
104
  method: 'post',
99
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.COUPON}`,
105
+ url: `/teams/${teamId}/billing/coupon`,
100
106
  };
101
107
  const response = await this.client.sendJSON(config);
102
108
  return response.data;
@@ -107,14 +113,14 @@ class BillingAPI {
107
113
  coupon,
108
114
  },
109
115
  method: 'delete',
110
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.COUPON}`,
116
+ url: `/teams/${teamId}/billing/coupon`,
111
117
  };
112
118
  await this.client.sendJSON(config);
113
119
  }
114
120
  async getCurrentPlan(teamId) {
115
121
  const config = {
116
122
  method: 'get',
117
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.PLAN}`,
123
+ url: `/teams/${teamId}/billing/plan`,
118
124
  };
119
125
  const response = await this.client.sendJSON(config);
120
126
  return response.data;
@@ -123,7 +129,16 @@ class BillingAPI {
123
129
  const config = {
124
130
  data: { planId },
125
131
  method: 'put',
126
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/subscription`,
132
+ url: `/teams/${teamId}/billing/subscription`,
133
+ };
134
+ const response = await this.client.sendJSON(config);
135
+ return response.data;
136
+ }
137
+ async getCurrentSubscription(teamId, planId) {
138
+ const config = {
139
+ data: { planId },
140
+ method: 'GET',
141
+ url: `/teams/${teamId}/billing/subscription`,
127
142
  };
128
143
  const response = await this.client.sendJSON(config);
129
144
  return response.data;
@@ -132,7 +147,7 @@ class BillingAPI {
132
147
  const config = {
133
148
  data: { planId },
134
149
  method: 'put',
135
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.PLAN}`,
150
+ url: `/teams/${teamId}/billing/plan`,
136
151
  };
137
152
  const response = await this.client.sendJSON(config);
138
153
  return response.data;
@@ -141,7 +156,7 @@ class BillingAPI {
141
156
  const config = {
142
157
  params: filter,
143
158
  method: 'get',
144
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.PLAN}/${BillingAPI.URL.LIST}`,
159
+ url: `/teams/${teamId}/billing/plan/list`,
145
160
  };
146
161
  const response = await this.client.sendJSON(config);
147
162
  return response.data;
@@ -149,7 +164,7 @@ class BillingAPI {
149
164
  async getSupportedCurrencies(teamId) {
150
165
  const config = {
151
166
  method: 'get',
152
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.CURRENCIES}`,
167
+ url: `/teams/${teamId}/billing/currencies`,
153
168
  };
154
169
  const response = await this.client.sendJSON(config);
155
170
  return response.data;
@@ -157,7 +172,7 @@ class BillingAPI {
157
172
  async getUpcomingInvoice(teamId) {
158
173
  const config = {
159
174
  method: 'get',
160
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.INVOICES}/${BillingAPI.URL.UPCOMING}`,
175
+ url: `/teams/${teamId}/billing/invoices/upcoming`,
161
176
  };
162
177
  const response = await this.client.sendJSON(config);
163
178
  return response.data;
@@ -169,7 +184,15 @@ class BillingAPI {
169
184
  size: limit,
170
185
  start: startAfterInvoiceId,
171
186
  },
172
- url: `${BillingAPI.URL.TEAMS}/${teamId}/${BillingAPI.URL.BILLING}/${BillingAPI.URL.INVOICES}`,
187
+ url: `/teams/${teamId}/billing/invoices`,
188
+ };
189
+ const response = await this.client.sendJSON(config);
190
+ return response.data;
191
+ }
192
+ async getPortalUrl(teamId) {
193
+ const config = {
194
+ method: 'get',
195
+ url: `/teams/${teamId}/billing/checkout/portal`,
173
196
  };
174
197
  const response = await this.client.sendJSON(config);
175
198
  return response.data;
package/package.json CHANGED
@@ -70,6 +70,6 @@
70
70
  "watch": "webpack serve --config webpack.browser.js",
71
71
  "prepare": "yarn dist"
72
72
  },
73
- "version": "27.46.0",
74
- "gitHead": "ed0741cb9c055a65cd4b72b7b3fa60fe8f3610fe"
73
+ "version": "27.48.0",
74
+ "gitHead": "bae1d8cff8b327ba3bf1ccee7b425f8782c64d30"
75
75
  }