@veho/turvo-integration-sdk 0.1.0-beta.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.
Files changed (57) hide show
  1. package/README.md +473 -0
  2. package/index.ts +1 -0
  3. package/lib/cjs/api/turvoInternalApi.d.ts +23 -0
  4. package/lib/cjs/api/turvoInternalApi.js +36 -0
  5. package/lib/cjs/api/turvoPublicApi.d.ts +99 -0
  6. package/lib/cjs/api/turvoPublicApi.js +103 -0
  7. package/lib/cjs/client/turvoClient.d.ts +49 -0
  8. package/lib/cjs/client/turvoClient.js +180 -0
  9. package/lib/cjs/constants.d.ts +29 -0
  10. package/lib/cjs/constants.js +33 -0
  11. package/lib/cjs/index.d.ts +6 -0
  12. package/lib/cjs/index.js +37 -0
  13. package/lib/cjs/shipmentTracking/index.d.ts +22 -0
  14. package/lib/cjs/shipmentTracking/index.js +39 -0
  15. package/lib/cjs/shipmentTracking/trackingService.d.ts +25 -0
  16. package/lib/cjs/shipmentTracking/trackingService.js +85 -0
  17. package/lib/cjs/types/common.d.ts +64 -0
  18. package/lib/cjs/types/common.js +27 -0
  19. package/lib/cjs/types/config.d.ts +13 -0
  20. package/lib/cjs/types/config.js +3 -0
  21. package/lib/cjs/types/errors.d.ts +35 -0
  22. package/lib/cjs/types/errors.js +63 -0
  23. package/lib/cjs/types/index.d.ts +5 -0
  24. package/lib/cjs/types/index.js +27 -0
  25. package/lib/cjs/types/shipment.d.ts +379 -0
  26. package/lib/cjs/types/shipment.js +46 -0
  27. package/lib/cjs/types/tracking.d.ts +65 -0
  28. package/lib/cjs/types/tracking.js +3 -0
  29. package/lib/esm/api/turvoInternalApi.d.ts +23 -0
  30. package/lib/esm/api/turvoInternalApi.js +32 -0
  31. package/lib/esm/api/turvoPublicApi.d.ts +99 -0
  32. package/lib/esm/api/turvoPublicApi.js +99 -0
  33. package/lib/esm/client/turvoClient.d.ts +49 -0
  34. package/lib/esm/client/turvoClient.js +172 -0
  35. package/lib/esm/constants.d.ts +29 -0
  36. package/lib/esm/constants.js +30 -0
  37. package/lib/esm/index.d.ts +6 -0
  38. package/lib/esm/index.js +11 -0
  39. package/lib/esm/shipmentTracking/index.d.ts +22 -0
  40. package/lib/esm/shipmentTracking/index.js +36 -0
  41. package/lib/esm/shipmentTracking/trackingService.d.ts +25 -0
  42. package/lib/esm/shipmentTracking/trackingService.js +81 -0
  43. package/lib/esm/types/common.d.ts +64 -0
  44. package/lib/esm/types/common.js +23 -0
  45. package/lib/esm/types/config.d.ts +13 -0
  46. package/lib/esm/types/config.js +2 -0
  47. package/lib/esm/types/errors.d.ts +35 -0
  48. package/lib/esm/types/errors.js +55 -0
  49. package/lib/esm/types/index.d.ts +5 -0
  50. package/lib/esm/types/index.js +11 -0
  51. package/lib/esm/types/shipment.d.ts +379 -0
  52. package/lib/esm/types/shipment.js +43 -0
  53. package/lib/esm/types/tracking.d.ts +65 -0
  54. package/lib/esm/types/tracking.js +2 -0
  55. package/lib/tsconfig.cjs.tsbuildinfo +1 -0
  56. package/lib/tsconfig.esm.tsbuildinfo +1 -0
  57. package/package.json +126 -0
@@ -0,0 +1,65 @@
1
+ import { TurvoShipmentStatusLocation } from './shipment';
2
+ /**
3
+ * Options for fetching shipment tracking data
4
+ */
5
+ export interface GetTrackingOptions {
6
+ /**
7
+ * Include GPS ping history in response.
8
+ * Requires internal API call - may be slower.
9
+ * Default: true
10
+ */
11
+ includeGps?: boolean;
12
+ /**
13
+ * Override the default secret path (/turvo/api).
14
+ * Useful for testing or different environments.
15
+ */
16
+ secretPath?: string;
17
+ }
18
+ /**
19
+ * GPS location update from shipment tracking
20
+ */
21
+ export interface LocationUpdate {
22
+ latitude: number;
23
+ longitude: number;
24
+ timestamp: string;
25
+ }
26
+ /**
27
+ * Individual stop in a shipment route
28
+ */
29
+ export interface Stop {
30
+ sequence: number;
31
+ stopType: string;
32
+ isCompleted: boolean;
33
+ facilityCode: string | null;
34
+ address: string | null;
35
+ city: string | null;
36
+ state: string | null;
37
+ appointmentTimeUtc: string | null;
38
+ actualArrivalUtc: string | null;
39
+ actualDepartureUtc: string | null;
40
+ }
41
+ /**
42
+ * Complete shipment tracking information combining public and internal API data
43
+ */
44
+ export interface ShipmentTracking {
45
+ shipmentId: string;
46
+ loadReferenceNumber: string;
47
+ status: string;
48
+ lateBy: string | null;
49
+ isLate: boolean;
50
+ currentLocation: TurvoShipmentStatusLocation | null;
51
+ hasGpsTracking: boolean;
52
+ completedStops: number;
53
+ totalStops: number;
54
+ stops: Stop[];
55
+ etaUtc: string | null;
56
+ etaTimezone: string | null;
57
+ milesRemaining: number | null;
58
+ totalMiles: number | null;
59
+ locationUpdates: LocationUpdate[] | null;
60
+ pingCount: number | null;
61
+ lastPingAt: string | null;
62
+ laneType: string | null;
63
+ managementType: string | null;
64
+ carrier: string | null;
65
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhY2tpbmcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdHlwZXMvdHJhY2tpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFR1cnZvU2hpcG1lbnRTdGF0dXNMb2NhdGlvbiB9IGZyb20gJy4vc2hpcG1lbnQnXG5cbi8qKlxuICogT3B0aW9ucyBmb3IgZmV0Y2hpbmcgc2hpcG1lbnQgdHJhY2tpbmcgZGF0YVxuICovXG5leHBvcnQgaW50ZXJmYWNlIEdldFRyYWNraW5nT3B0aW9ucyB7XG4gIC8qKlxuICAgKiBJbmNsdWRlIEdQUyBwaW5nIGhpc3RvcnkgaW4gcmVzcG9uc2UuXG4gICAqIFJlcXVpcmVzIGludGVybmFsIEFQSSBjYWxsIC0gbWF5IGJlIHNsb3dlci5cbiAgICogRGVmYXVsdDogdHJ1ZVxuICAgKi9cbiAgaW5jb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IHwgbnVsbFxuICBsYXN0UGluZ0F0OiBzdHJpbmcgfCBudWxsXG5cbiAgLy8gU2hpcG1lbnQgQXR0cmlidXRlc1xuICBsYW5lVHlwZTogc3RyaW5nIHwgbnVsbCAvLyBcIk1pZGRsZSBNaWxlXCIsIFwiRmlyc3QgTWlsZVwiLCBcIlJldHVyblwiXG4gIG1hbmFnZW1lbnRUeXBlOiBzdHJpbmcgfCBudWxsIC8vIFwiVmVobyBNYW5hZ2VkXCIsIFwiQ2xpZW50IE1hbmFnZWRcIlxuICBjYXJyaWVyOiBzdHJpbmcgfCBudWxsXG59XG4iXX0=
@@ -0,0 +1 @@
1
+ {"root":["../src/constants.ts","../src/index.ts","../src/api/turvointernalapi.ts","../src/api/turvopublicapi.ts","../src/client/turvoclient.ts","../src/shipmenttracking/index.ts","../src/shipmenttracking/trackingservice.ts","../src/types/common.ts","../src/types/config.ts","../src/types/errors.ts","../src/types/index.ts","../src/types/shipment.ts","../src/types/tracking.ts"],"version":"5.9.3"}
@@ -0,0 +1 @@
1
+ {"root":["../src/constants.ts","../src/index.ts","../src/api/turvointernalapi.ts","../src/api/turvopublicapi.ts","../src/client/turvoclient.ts","../src/shipmenttracking/index.ts","../src/shipmenttracking/trackingservice.ts","../src/types/common.ts","../src/types/config.ts","../src/types/errors.ts","../src/types/index.ts","../src/types/shipment.ts","../src/types/tracking.ts"],"version":"5.9.3"}
package/package.json ADDED
@@ -0,0 +1,126 @@
1
+ {
2
+ "name": "@veho/turvo-integration-sdk",
3
+ "description": "TypeScript SDK for Turvo API integration",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/veho-technologies/turvo-integration"
7
+ },
8
+ "scripts": {
9
+ "analyze-bundle": "npx projen analyze-bundle",
10
+ "build": "npx projen build",
11
+ "bump": "npx projen bump",
12
+ "compile": "npx projen compile",
13
+ "default": "npx projen default",
14
+ "eslint": "npx projen eslint",
15
+ "lint": "npx projen lint",
16
+ "lint:fix": "npx projen lint:fix",
17
+ "package": "npx projen package",
18
+ "post-compile": "npx projen post-compile",
19
+ "post-upgrade": "npx projen post-upgrade",
20
+ "postbuild": "npx projen postbuild",
21
+ "postprepare": "npx projen postprepare",
22
+ "postrelease": "npx projen postrelease",
23
+ "postupgrade": "npx projen postupgrade",
24
+ "pre-compile": "npx projen pre-compile",
25
+ "prewatch": "npx projen prewatch",
26
+ "release": "npx projen release",
27
+ "test": "npx projen test",
28
+ "test:watch": "npx projen test:watch",
29
+ "unbump": "npx projen unbump",
30
+ "update-event-studio-service": "npx projen update-event-studio-service",
31
+ "upgrade": "npx projen upgrade",
32
+ "watch": "npx projen watch",
33
+ "projen": "npx projen"
34
+ },
35
+ "devDependencies": {
36
+ "@types/jest": "^30.0.0",
37
+ "@types/node": "^22",
38
+ "@types/node-fetch": "^2.6.11",
39
+ "@typescript-eslint/eslint-plugin": "^6",
40
+ "@typescript-eslint/parser": "^6",
41
+ "@veho/dx-sdk": "^1.0.6",
42
+ "@veho/gaia-projen": "^9.0.0",
43
+ "esbuild-visualizer": "^0.7.0",
44
+ "eslint": "^8",
45
+ "eslint-config-prettier": "^10.1.8",
46
+ "eslint-import-resolver-typescript": "^4.4.4",
47
+ "eslint-plugin-import": "^2.32.0",
48
+ "eslint-plugin-prettier": "^5.0.1",
49
+ "eslint-plugin-simple-import-sort": "^12.1.1",
50
+ "jest": "^30.2.0",
51
+ "jest-junit": "^15",
52
+ "prettier": "^3.0.0",
53
+ "standard-version": "^9",
54
+ "ts-jest": "^29.4.6",
55
+ "ts-node": "^10.9.2",
56
+ "typescript": "^5.9.3",
57
+ "undici-types": "^6.21.0"
58
+ },
59
+ "dependencies": {
60
+ "lambda-params-secrets": "^1.0.3",
61
+ "node-fetch": "^2.7.0",
62
+ "p-retry": "^6.2.0",
63
+ "p-throttle": "^6.1.0",
64
+ "undici": "^7.19.2"
65
+ },
66
+ "engines": {
67
+ "node": ">= 22.20.0"
68
+ },
69
+ "main": "lib/cjs/index.js",
70
+ "license": "UNLICENSED",
71
+ "version": "0.1.0-beta.0",
72
+ "jest": {
73
+ "coverageProvider": "v8",
74
+ "transform": {
75
+ "^.+\\.[t]sx?$": [
76
+ "ts-jest",
77
+ {
78
+ "tsconfig": "tsconfig.dev.json"
79
+ }
80
+ ],
81
+ "^.+\\.(ts|tsx)$": [
82
+ "ts-jest",
83
+ {
84
+ "tsconfig": "tsconfig.dev.json"
85
+ }
86
+ ]
87
+ },
88
+ "modulePathIgnorePatterns": [
89
+ "/lib/"
90
+ ],
91
+ "testPathIgnorePatterns": [
92
+ "/lib/"
93
+ ],
94
+ "testMatch": [
95
+ "<rootDir>/src/**/__tests__/**/*.ts?(x)",
96
+ "<rootDir>/@(test|src)/**/*(*.)@(spec|test).ts?(x)"
97
+ ],
98
+ "clearMocks": true,
99
+ "collectCoverage": true,
100
+ "coverageReporters": [
101
+ "json",
102
+ "lcov",
103
+ "clover",
104
+ "cobertura",
105
+ "text"
106
+ ],
107
+ "coverageDirectory": "coverage",
108
+ "coveragePathIgnorePatterns": [
109
+ "/lib/"
110
+ ],
111
+ "watchPathIgnorePatterns": [
112
+ "/node_modules/"
113
+ ],
114
+ "reporters": [
115
+ "default",
116
+ [
117
+ "jest-junit",
118
+ {
119
+ "outputDirectory": "test-reports"
120
+ }
121
+ ]
122
+ ]
123
+ },
124
+ "module": "lib/esm/index.js",
125
+ "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
126
+ }