skikrumb-api 1.3.8 → 1.4.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.
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export declare const skiKrumb: (options?: {
7
7
  }) => {
8
8
  createDevice: (deveui: string, serialNumber: string) => Promise<any>;
9
9
  createDeviceDownlink: (userId: string, deveui: string, type?: string) => Promise<any>;
10
+ sendMobileLocation: (payload: any) => Promise<any>;
10
11
  createPaymentIntent: (form: any) => Promise<any>;
11
12
  createPrePurchaseIntent: (form: any) => Promise<any>;
12
13
  getPaymentIntent: (clientSecret: string) => Promise<any>;
@@ -17,6 +18,7 @@ export declare const skiKrumb: (options?: {
17
18
  state?: string;
18
19
  }) => Promise<any>;
19
20
  createSubscription: (customerId: string, priceId: string, cartId: string, productId: string, registrations: Array<string>) => Promise<any>;
21
+ updatePaymentIntent: (cartId: string, intentId: string) => Promise<any>;
20
22
  updateSubscription: (subscriptionId: string, quantity: number, registrations: Array<string>) => Promise<any>;
21
23
  cancelSubscription: (subscriptionId: string) => Promise<any>;
22
24
  readApiKeys: () => Promise<apiKeys[]>;
package/dist/index.js CHANGED
@@ -58,6 +58,18 @@ export const skiKrumb = (options = {
58
58
  })
59
59
  .json();
60
60
  };
61
+ const sendMobileLocation = async (payload) => {
62
+ if (!payload)
63
+ throw new Error('Payload is required');
64
+ return await api
65
+ .post(`${options.url}/devices/location/mobile`, {
66
+ headers: {
67
+ 'content-type': 'application/json',
68
+ },
69
+ json: payload,
70
+ })
71
+ .json();
72
+ };
61
73
  const createPaymentIntent = async (form) => {
62
74
  if (!form)
63
75
  throw new Error('Form values not posted.');
@@ -72,6 +84,15 @@ export const skiKrumb = (options = {
72
84
  throw new Error('Client secret is required');
73
85
  return api.get(`${options.url}/payments/intent/${clientSecret}`).json();
74
86
  };
87
+ const updatePaymentIntent = async (cartId, intentId) => {
88
+ if (!cartId || !intentId)
89
+ throw new Error('Cart Id and IntentId are required');
90
+ return api.patch(`${options.url}/payments/intent/${intentId}`, {
91
+ json: {
92
+ cartId: cartId,
93
+ }
94
+ }).json();
95
+ };
75
96
  const createPrePurchaseIntent = async (form) => {
76
97
  if (!form)
77
98
  throw new Error('Form values not posted.');
@@ -186,12 +207,14 @@ export const skiKrumb = (options = {
186
207
  return {
187
208
  createDevice,
188
209
  createDeviceDownlink,
210
+ sendMobileLocation,
189
211
  createPaymentIntent,
190
212
  createPrePurchaseIntent,
191
213
  getPaymentIntent,
192
214
  updateCustomerAddress,
193
215
  getTaxCalculation,
194
216
  createSubscription,
217
+ updatePaymentIntent,
195
218
  updateSubscription,
196
219
  cancelSubscription,
197
220
  readApiKeys,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skikrumb-api",
3
- "version": "1.3.8",
3
+ "version": "1.4.0",
4
4
  "description": "Wrapper for the skiKrumb API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/readme.md CHANGED
@@ -52,4 +52,4 @@ Defaults to production skiKrumb API URL. Possible values: `https://api-dev.skikr
52
52
  > Requires an API key. Request an API Key by emailing info@skikrumb.ca
53
53
 
54
54
  > &copy; skiKrumb
55
- > `2023`
55
+ > `2025`