skikrumb-api 1.2.2 → 1.2.4
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/.kanelrc.js +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -1
- package/package.json +1 -1
- package/readme.md +2 -2
package/.kanelrc.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
/** @type {import('kanel').Config} */
|
|
4
|
+
module.exports = {
|
|
5
|
+
connection: {
|
|
6
|
+
host: '127.0.0.1',
|
|
7
|
+
user: 'postgres',
|
|
8
|
+
password: 'postgres',
|
|
9
|
+
database: 'skikrumb',
|
|
10
|
+
port: 54322
|
|
11
|
+
},
|
|
12
|
+
schemas: ['public'],
|
|
13
|
+
preDeleteOutputFolder: true,
|
|
14
|
+
outputPath: './lib/database.types.ts',
|
|
15
|
+
customTypeMap: {
|
|
16
|
+
'pg_catalog.tsvector': 'string',
|
|
17
|
+
'pg_catalog.date': 'string',
|
|
18
|
+
'pg_catalog.timestamptz': 'string',
|
|
19
|
+
'pg_catalog.uuid': 'string',
|
|
20
|
+
'pg_catalog.bpchar': 'string',
|
|
21
|
+
'pg_catalog.int8': 'number',
|
|
22
|
+
'pg_catalog.numeric': 'number',
|
|
23
|
+
},
|
|
24
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const skiKrumb: (options?: {
|
|
|
4
4
|
requestedWith: string | undefined;
|
|
5
5
|
url: string | undefined;
|
|
6
6
|
}) => {
|
|
7
|
+
createDevice: (deveui: string, serialNumber: string) => Promise<any>;
|
|
7
8
|
createPaymentIntent: (form: any) => Promise<any>;
|
|
8
9
|
createPrePurchaseIntent: (form: any) => Promise<any>;
|
|
9
10
|
readApiKeys: () => Promise<apiKeys[]>;
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,16 @@ export const skiKrumb = (options = {
|
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
+
const createDevice = (deveui, serialNumber) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
if (!deveui || !serialNumber)
|
|
29
|
+
throw new Error('Must pass Lora MAC (deveui) and Serial Number');
|
|
30
|
+
return yield api.post(`${options.url}/devices`, {
|
|
31
|
+
headers: {
|
|
32
|
+
'content-type': 'application/json'
|
|
33
|
+
},
|
|
34
|
+
json: { deveui: deveui, serial_number: serialNumber }
|
|
35
|
+
}).json();
|
|
36
|
+
});
|
|
27
37
|
const createPaymentIntent = (form) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
38
|
if (!form)
|
|
29
39
|
throw new Error('Form values not posted.');
|
|
@@ -63,11 +73,12 @@ export const skiKrumb = (options = {
|
|
|
63
73
|
return api.get(`${options.url}/keys`).json();
|
|
64
74
|
});
|
|
65
75
|
return {
|
|
76
|
+
createDevice,
|
|
66
77
|
createPaymentIntent,
|
|
67
78
|
createPrePurchaseIntent,
|
|
68
79
|
readApiKeys,
|
|
69
80
|
readDataForDevices,
|
|
70
81
|
readDeviceDailyDistance,
|
|
71
|
-
readDeviceData
|
|
82
|
+
readDeviceData,
|
|
72
83
|
};
|
|
73
84
|
};
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -18,7 +18,7 @@ import skiKrumb from 'skikrumb-api';
|
|
|
18
18
|
const {readDeviceData} = skiKrumb({
|
|
19
19
|
apiKey: 'YOUR_API_KEY',
|
|
20
20
|
requestedWith: 'My Application Name',
|
|
21
|
-
url: 'Defaults to
|
|
21
|
+
url: 'Defaults to https://api.skikrumb.ca'
|
|
22
22
|
})
|
|
23
23
|
```
|
|
24
24
|
### skiKrumb(options?)
|
|
@@ -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
|
> © skiKrumb
|
|
55
|
-
> `2023`
|
|
55
|
+
> `2023`
|