@voyantjs/ground-react 0.2.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 (40) hide show
  1. package/dist/client.d.ts +14 -0
  2. package/dist/client.d.ts.map +1 -0
  3. package/dist/client.js +58 -0
  4. package/dist/hooks/index.d.ts +7 -0
  5. package/dist/hooks/index.d.ts.map +1 -0
  6. package/dist/hooks/index.js +6 -0
  7. package/dist/hooks/use-ground-driver-mutation.d.ts +48 -0
  8. package/dist/hooks/use-ground-driver-mutation.d.ts.map +1 -0
  9. package/dist/hooks/use-ground-driver-mutation.js +40 -0
  10. package/dist/hooks/use-ground-drivers.d.ts +23 -0
  11. package/dist/hooks/use-ground-drivers.d.ts.map +1 -0
  12. package/dist/hooks/use-ground-drivers.js +12 -0
  13. package/dist/hooks/use-ground-operator-mutation.d.ts +42 -0
  14. package/dist/hooks/use-ground-operator-mutation.d.ts.map +1 -0
  15. package/dist/hooks/use-ground-operator-mutation.js +40 -0
  16. package/dist/hooks/use-ground-operators.d.ts +21 -0
  17. package/dist/hooks/use-ground-operators.d.ts.map +1 -0
  18. package/dist/hooks/use-ground-operators.js +12 -0
  19. package/dist/hooks/use-ground-vehicle-mutation.d.ts +60 -0
  20. package/dist/hooks/use-ground-vehicle-mutation.d.ts.map +1 -0
  21. package/dist/hooks/use-ground-vehicle-mutation.js +40 -0
  22. package/dist/hooks/use-ground-vehicles.d.ts +27 -0
  23. package/dist/hooks/use-ground-vehicles.d.ts.map +1 -0
  24. package/dist/hooks/use-ground-vehicles.js +12 -0
  25. package/dist/index.d.ts +7 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +6 -0
  28. package/dist/provider.d.ts +2 -0
  29. package/dist/provider.d.ts.map +1 -0
  30. package/dist/provider.js +1 -0
  31. package/dist/query-keys.d.ts +35 -0
  32. package/dist/query-keys.d.ts.map +1 -0
  33. package/dist/query-keys.js +12 -0
  34. package/dist/query-options.d.ts +417 -0
  35. package/dist/query-options.d.ts.map +1 -0
  36. package/dist/query-options.js +63 -0
  37. package/dist/schemas.d.ts +212 -0
  38. package/dist/schemas.d.ts.map +1 -0
  39. package/dist/schemas.js +45 -0
  40. package/package.json +79 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;;;;iBAM7D,CAAA;AAEJ,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAA6B,CAAA;AAC3F,eAAO,MAAM,eAAe;;iBAAqC,CAAA;AAEjE,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAQrC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;iBAOnC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;iBAAgD,CAAA;AACvF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;iBAA6C,CAAA;AACtF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA+C,CAAA;AACrF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA4C,CAAA;AACpF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;iBAA8C,CAAA;AACnF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;iBAA2C,CAAA"}
@@ -0,0 +1,45 @@
1
+ import { insertGroundDriverSchema, insertGroundOperatorSchema, insertGroundVehicleSchema, } from "@voyantjs/ground";
2
+ import { z } from "zod";
3
+ export const paginatedEnvelope = (item) => z.object({
4
+ data: z.array(item),
5
+ total: z.number().int(),
6
+ limit: z.number().int(),
7
+ offset: z.number().int(),
8
+ });
9
+ export const singleEnvelope = (item) => z.object({ data: item });
10
+ export const successEnvelope = z.object({ success: z.boolean() });
11
+ export const groundOperatorRecordSchema = insertGroundOperatorSchema.extend({
12
+ id: z.string(),
13
+ supplierId: z.string().nullable(),
14
+ facilityId: z.string().nullable(),
15
+ code: z.string().nullable(),
16
+ notes: z.string().nullable(),
17
+ createdAt: z.string(),
18
+ updatedAt: z.string(),
19
+ });
20
+ export const groundVehicleRecordSchema = insertGroundVehicleSchema.extend({
21
+ id: z.string(),
22
+ operatorId: z.string().nullable(),
23
+ passengerCapacity: z.number().int().nullable(),
24
+ checkedBagCapacity: z.number().int().nullable(),
25
+ carryOnCapacity: z.number().int().nullable(),
26
+ wheelchairCapacity: z.number().int().nullable(),
27
+ childSeatCapacity: z.number().int().nullable(),
28
+ notes: z.string().nullable(),
29
+ createdAt: z.string(),
30
+ updatedAt: z.string(),
31
+ });
32
+ export const groundDriverRecordSchema = insertGroundDriverSchema.extend({
33
+ id: z.string(),
34
+ operatorId: z.string().nullable(),
35
+ licenseNumber: z.string().nullable(),
36
+ notes: z.string().nullable(),
37
+ createdAt: z.string(),
38
+ updatedAt: z.string(),
39
+ });
40
+ export const groundOperatorListResponse = paginatedEnvelope(groundOperatorRecordSchema);
41
+ export const groundOperatorSingleResponse = singleEnvelope(groundOperatorRecordSchema);
42
+ export const groundVehicleListResponse = paginatedEnvelope(groundVehicleRecordSchema);
43
+ export const groundVehicleSingleResponse = singleEnvelope(groundVehicleRecordSchema);
44
+ export const groundDriverListResponse = paginatedEnvelope(groundDriverRecordSchema);
45
+ export const groundDriverSingleResponse = singleEnvelope(groundDriverRecordSchema);
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@voyantjs/ground-react",
3
+ "version": "0.2.0",
4
+ "license": "FSL-1.1-Apache-2.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/voyantjs/voyant.git",
8
+ "directory": "packages/ground-react"
9
+ },
10
+ "type": "module",
11
+ "exports": {
12
+ ".": "./src/index.ts",
13
+ "./provider": "./src/provider.tsx",
14
+ "./hooks": "./src/hooks/index.ts",
15
+ "./client": "./src/client.ts",
16
+ "./query-keys": "./src/query-keys.ts"
17
+ },
18
+ "scripts": {
19
+ "build": "tsc -p tsconfig.json",
20
+ "clean": "rm -rf dist",
21
+ "prepack": "pnpm run build",
22
+ "typecheck": "tsc --noEmit",
23
+ "lint": "biome check src/",
24
+ "test": "vitest run --passWithNoTests"
25
+ },
26
+ "peerDependencies": {
27
+ "@voyantjs/ground": "workspace:*",
28
+ "@tanstack/react-query": "^5.0.0",
29
+ "react": "^19.0.0",
30
+ "react-dom": "^19.0.0",
31
+ "zod": "^4.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@tanstack/react-query": "^5.96.2",
35
+ "@types/react": "^19.2.14",
36
+ "@types/react-dom": "^19.2.3",
37
+ "@voyantjs/ground": "workspace:*",
38
+ "@voyantjs/react": "workspace:*",
39
+ "@voyantjs/voyant-typescript-config": "workspace:*",
40
+ "react": "^19.2.4",
41
+ "react-dom": "^19.2.4",
42
+ "typescript": "^6.0.2",
43
+ "vitest": "^4.1.2",
44
+ "zod": "^4.3.6"
45
+ },
46
+ "dependencies": {
47
+ "@voyantjs/react": "workspace:*"
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "exports": {
55
+ ".": {
56
+ "types": "./dist/index.d.ts",
57
+ "import": "./dist/index.js"
58
+ },
59
+ "./provider": {
60
+ "types": "./dist/provider.d.ts",
61
+ "import": "./dist/provider.js"
62
+ },
63
+ "./hooks": {
64
+ "types": "./dist/hooks/index.d.ts",
65
+ "import": "./dist/hooks/index.js"
66
+ },
67
+ "./client": {
68
+ "types": "./dist/client.d.ts",
69
+ "import": "./dist/client.js"
70
+ },
71
+ "./query-keys": {
72
+ "types": "./dist/query-keys.d.ts",
73
+ "import": "./dist/query-keys.js"
74
+ }
75
+ },
76
+ "main": "./dist/index.js",
77
+ "types": "./dist/index.d.ts"
78
+ }
79
+ }