@timeback/caliper 0.1.3 → 0.1.5
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/client.d.ts +10 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +558 -156
- package/dist/lib/event-factories.d.ts.map +1 -1
- package/dist/resources/events.d.ts +6 -3
- package/dist/resources/events.d.ts.map +1 -1
- package/dist/types.js +1 -17
- package/package.json +3 -2
package/dist/client.d.ts
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
* Provides methods to send, list, and retrieve Caliper learning events,
|
|
10
10
|
* as well as track async processing jobs.
|
|
11
11
|
*
|
|
12
|
-
* @example
|
|
12
|
+
* @example
|
|
13
13
|
* ```typescript
|
|
14
|
+
* // Environment mode (Timeback APIs)
|
|
14
15
|
* const client = new CaliperClient({
|
|
15
16
|
* env: 'staging', // or 'production'
|
|
16
17
|
* auth: {
|
|
@@ -20,8 +21,9 @@
|
|
|
20
21
|
* })
|
|
21
22
|
* ```
|
|
22
23
|
*
|
|
23
|
-
* @example
|
|
24
|
+
* @example
|
|
24
25
|
* ```typescript
|
|
26
|
+
* // Provider mode (shared tokens)
|
|
25
27
|
* import { TimebackProvider } from '@timeback/internal-client-infra'
|
|
26
28
|
*
|
|
27
29
|
* const provider = new TimebackProvider({
|
|
@@ -33,8 +35,9 @@
|
|
|
33
35
|
* const client = new CaliperClient({ provider })
|
|
34
36
|
* ```
|
|
35
37
|
*
|
|
36
|
-
* @example
|
|
38
|
+
* @example
|
|
37
39
|
* ```typescript
|
|
40
|
+
* // Explicit mode (custom API)
|
|
38
41
|
* const client = new CaliperClient({
|
|
39
42
|
* baseUrl: 'https://caliper.example.com',
|
|
40
43
|
* auth: {
|
|
@@ -45,15 +48,17 @@
|
|
|
45
48
|
* })
|
|
46
49
|
* ```
|
|
47
50
|
*
|
|
48
|
-
* @example
|
|
51
|
+
* @example
|
|
49
52
|
* ```typescript
|
|
53
|
+
* // Environment variables fallback
|
|
50
54
|
* // Set CALIPER_BASE_URL, CALIPER_TOKEN_URL,
|
|
51
55
|
* // CALIPER_CLIENT_ID, CALIPER_CLIENT_SECRET
|
|
52
56
|
* const client = new CaliperClient()
|
|
53
57
|
* ```
|
|
54
58
|
*
|
|
55
|
-
* @example
|
|
59
|
+
* @example
|
|
56
60
|
* ```typescript
|
|
61
|
+
* // Sending events
|
|
57
62
|
* const result = await client.events.send(
|
|
58
63
|
* 'https://example.edu/sensors/lms',
|
|
59
64
|
* [{
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;CAAwB,CAAA;AAElD,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Caliper Analytics client SDK for Timeback.
|
|
5
5
|
*
|
|
6
|
-
* @example
|
|
6
|
+
* @example
|
|
7
7
|
* ```typescript
|
|
8
|
+
* // Timeback Profile - Activity Completed (recommended)
|
|
8
9
|
* import { CaliperClient } from '@timeback/caliper'
|
|
9
10
|
*
|
|
10
11
|
* const client = new CaliperClient({
|
|
@@ -42,8 +43,9 @@
|
|
|
42
43
|
* const status = await client.jobs.waitForCompletion(result.jobId)
|
|
43
44
|
* ```
|
|
44
45
|
*
|
|
45
|
-
* @example
|
|
46
|
+
* @example
|
|
46
47
|
* ```typescript
|
|
48
|
+
* // Timeback Profile - Time Spent
|
|
47
49
|
* await client.events.sendTimeSpent(
|
|
48
50
|
* 'https://myapp.example.com/sensors/main',
|
|
49
51
|
* {
|
|
@@ -57,8 +59,9 @@
|
|
|
57
59
|
* )
|
|
58
60
|
* ```
|
|
59
61
|
*
|
|
60
|
-
* @example
|
|
62
|
+
* @example
|
|
61
63
|
* ```typescript
|
|
64
|
+
* // Generic Caliper Events
|
|
62
65
|
* // For non-Timeback Caliper events, use the generic method
|
|
63
66
|
* await client.events.send('https://sensor.url', [genericCaliperEvent])
|
|
64
67
|
* ```
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAMH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAE/C,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AACrD,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7F,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAMtE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjF,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,iCAAiC,EACjC,kBAAkB,EAClB,eAAe,EACf,kCAAkC,EAClC,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,aAAa,GACb,MAAM,mCAAmC,CAAA;AAE1C,YAAY,EACX,sBAAsB,EACtB,cAAc,EACd,uBAAuB,IAAI,gBAAgB,GAC3C,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,YAAY,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,gBAAgB,GAChB,MAAM,mCAAmC,CAAA;AAM1C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA"}
|