@seamapi/types 1.5.0 → 1.7.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 (32) hide show
  1. package/lib/seam/connect/route-types.d.ts +129 -10
  2. package/lib/seam/connect/unstable/model-types.d.ts +1 -1
  3. package/lib/seam/connect/unstable/models/acs/access_group.d.ts +29 -0
  4. package/lib/seam/connect/unstable/models/acs/access_group.js +12 -0
  5. package/lib/seam/connect/unstable/models/acs/access_group.js.map +1 -0
  6. package/lib/seam/connect/unstable/models/acs/index.d.ts +3 -0
  7. package/lib/seam/connect/unstable/models/acs/index.js +4 -0
  8. package/lib/seam/connect/unstable/models/acs/index.js.map +1 -0
  9. package/lib/seam/connect/unstable/models/acs/system.d.ts +23 -0
  10. package/lib/seam/connect/unstable/models/acs/system.js +10 -0
  11. package/lib/seam/connect/unstable/models/acs/system.js.map +1 -0
  12. package/lib/seam/connect/unstable/models/acs/user.d.ts +30 -0
  13. package/lib/seam/connect/unstable/models/acs/user.js +25 -0
  14. package/lib/seam/connect/unstable/models/acs/user.js.map +1 -0
  15. package/lib/seam/connect/unstable/models/capability-properties/index.d.ts +42 -42
  16. package/lib/seam/connect/unstable/models/capability-properties/thermostat.d.ts +88 -88
  17. package/lib/seam/connect/unstable/models/index.d.ts +1 -0
  18. package/lib/seam/connect/unstable/models/index.js +1 -0
  19. package/lib/seam/connect/unstable/models/index.js.map +1 -1
  20. package/lib/seam/connect/unstable/models/managed-device.d.ts +90 -90
  21. package/lib/seam/connect/unstable/schemas.d.ts +1 -1
  22. package/lib/seam/connect/unstable/schemas.js +1 -1
  23. package/lib/seam/connect/unstable/schemas.js.map +1 -1
  24. package/package.json +8 -8
  25. package/src/lib/seam/connect/route-types.ts +129 -10
  26. package/src/lib/seam/connect/unstable/model-types.ts +5 -0
  27. package/src/lib/seam/connect/unstable/models/acs/access_group.ts +17 -0
  28. package/src/lib/seam/connect/unstable/models/acs/index.ts +3 -0
  29. package/src/lib/seam/connect/unstable/models/acs/system.ts +15 -0
  30. package/src/lib/seam/connect/unstable/models/acs/user.ts +31 -0
  31. package/src/lib/seam/connect/unstable/models/index.ts +1 -0
  32. package/src/lib/seam/connect/unstable/schemas.ts +5 -0
@@ -1 +1 @@
1
- export { access_code_code_constraint, any_device_type, battery_status, capabilities, climate_setting, climate_setting_schedule, common_device_properties, lock_device_type, managed_device, noise_sensor_device_type, thermostat_device_type, unmanaged_device, } from './models/index.js';
1
+ export { access_code_code_constraint, acs_access_group, acs_access_group_type, acs_system, acs_system_type, acs_user, any_device_type, battery_status, capabilities, climate_setting, climate_setting_schedule, common_device_properties, lock_device_type, managed_device, noise_sensor_device_type, thermostat_device_type, unmanaged_device, } from './models/index.js';
@@ -1,2 +1,2 @@
1
- export { access_code_code_constraint, any_device_type, battery_status, capabilities, climate_setting, climate_setting_schedule, common_device_properties, lock_device_type, managed_device, noise_sensor_device_type, thermostat_device_type, unmanaged_device, } from './models/index.js';
1
+ export { access_code_code_constraint, acs_access_group, acs_access_group_type, acs_system, acs_system_type, acs_user, any_device_type, battery_status, capabilities, climate_setting, climate_setting_schedule, common_device_properties, lock_device_type, managed_device, noise_sensor_device_type, thermostat_device_type, unmanaged_device, } from './models/index.js';
2
2
  //# sourceMappingURL=schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/unstable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/unstable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,QAAQ,EACR,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -65,26 +65,26 @@
65
65
  "peerDependencies": {
66
66
  "zod": "^3.21.4"
67
67
  },
68
+ "dependencies": {
69
+ "type-fest": "^4.1.0"
70
+ },
68
71
  "devDependencies": {
69
72
  "@types/node": "^18.11.18",
70
73
  "concurrently": "^8.2.0",
71
74
  "del-cli": "^5.0.0",
72
75
  "eslint": "^8.9.0",
73
- "eslint-config-prettier": "^8.4.0",
76
+ "eslint-config-prettier": "^9.0.0",
74
77
  "eslint-config-standard": "^17.1.0",
75
- "eslint-config-standard-with-typescript": "^36.0.0",
78
+ "eslint-config-standard-with-typescript": "^39.0.0",
76
79
  "eslint-plugin-node": "^11.1.0",
77
80
  "eslint-plugin-simple-import-sort": "^10.0.0",
78
- "eslint-plugin-unused-imports": "^2.0.0",
79
- "patch-package": "^7.0.1",
81
+ "eslint-plugin-unused-imports": "^3.0.0",
82
+ "patch-package": "^8.0.0",
80
83
  "prettier": "^3.0.0",
81
84
  "tsc-alias": "^1.8.2",
82
85
  "tsup": "^7.1.0",
83
86
  "tsx": "^3.12.1",
84
87
  "typescript": "^5.0.2",
85
88
  "zod": "^3.21.4"
86
- },
87
- "dependencies": {
88
- "type-fest": "^4.1.0"
89
89
  }
90
90
  }
@@ -478,11 +478,66 @@ export interface Routes {
478
478
  acs_system_id: string
479
479
  workspace_id: string
480
480
  name: string
481
- acs_access_group_type: 'pti_unit'
482
- created_at: string | Date
481
+ access_group_type: 'pti_unit'
482
+ access_group_type_display_name: string
483
+ created_at: string
483
484
  }
484
485
  }
485
486
  }
487
+ '/acs/access_groups/delete': {
488
+ route: '/acs/access_groups/delete'
489
+ method: 'DELETE' | 'POST'
490
+ queryParams: {}
491
+ jsonBody: {}
492
+ commonParams: {
493
+ acs_access_group_id: string
494
+ }
495
+ formData: {}
496
+ jsonResponse: {}
497
+ }
498
+ '/acs/access_groups/get': {
499
+ route: '/acs/access_groups/get'
500
+ method: 'GET' | 'POST'
501
+ queryParams: {}
502
+ jsonBody: {}
503
+ commonParams: {
504
+ acs_access_group_id: string
505
+ }
506
+ formData: {}
507
+ jsonResponse: {
508
+ acs_access_group: {
509
+ acs_access_group_id: string
510
+ acs_system_id: string
511
+ workspace_id: string
512
+ name: string
513
+ access_group_type: 'pti_unit'
514
+ access_group_type_display_name: string
515
+ created_at: string
516
+ }
517
+ }
518
+ }
519
+ '/acs/access_groups/list': {
520
+ route: '/acs/access_groups/list'
521
+ method: 'GET' | 'POST'
522
+ queryParams: {}
523
+ jsonBody: {}
524
+ commonParams: {
525
+ acs_access_system_id?: string | undefined
526
+ acs_user_id?: string | undefined
527
+ }
528
+ formData: {}
529
+ jsonResponse: {
530
+ acs_access_groups: Array<{
531
+ acs_access_group_id: string
532
+ acs_system_id: string
533
+ workspace_id: string
534
+ name: string
535
+ access_group_type: 'pti_unit'
536
+ access_group_type_display_name: string
537
+ created_at: string
538
+ }>
539
+ }
540
+ }
486
541
  '/acs/access_groups/update': {
487
542
  route: '/acs/access_groups/update'
488
543
  method: 'POST' | 'PATCH'
@@ -508,8 +563,9 @@ export interface Routes {
508
563
  acs_system: {
509
564
  acs_system_id: string
510
565
  system_type: 'pti_site' | 'alta_org'
566
+ system_type_display_name: string
511
567
  name: string
512
- created_at: string | Date
568
+ created_at: string
513
569
  }
514
570
  }
515
571
  }
@@ -524,8 +580,9 @@ export interface Routes {
524
580
  acs_systems: Array<{
525
581
  acs_system_id: string
526
582
  system_type: 'pti_site' | 'alta_org'
583
+ system_type_display_name: string
527
584
  name: string
528
- created_at: string | Date
585
+ created_at: string
529
586
  }>
530
587
  }
531
588
  }
@@ -548,9 +605,10 @@ export interface Routes {
548
605
  jsonBody: {}
549
606
  commonParams: {
550
607
  acs_system_id: string
551
- name?: string | undefined
552
- email?: string | undefined
553
608
  acs_access_group_ids?: string[]
609
+ full_name?: string | undefined
610
+ email?: string | undefined
611
+ phone_number?: string | undefined
554
612
  }
555
613
  formData: {}
556
614
  jsonResponse: {
@@ -558,11 +616,69 @@ export interface Routes {
558
616
  acs_user_id: string
559
617
  acs_system_id: string
560
618
  workspace_id: string
561
- name: string
562
- created_at: string | Date
619
+ created_at: string
620
+ display_name: string
621
+ full_name?: string | undefined
622
+ email?: string | undefined
623
+ phone_number?: string | undefined
563
624
  }
564
625
  }
565
626
  }
627
+ '/acs/users/delete': {
628
+ route: '/acs/users/delete'
629
+ method: 'DELETE' | 'POST'
630
+ queryParams: {}
631
+ jsonBody: {}
632
+ commonParams: {
633
+ acs_user_id: string
634
+ }
635
+ formData: {}
636
+ jsonResponse: {}
637
+ }
638
+ '/acs/users/get': {
639
+ route: '/acs/users/get'
640
+ method: 'GET' | 'POST'
641
+ queryParams: {}
642
+ jsonBody: {}
643
+ commonParams: {
644
+ acs_user_id: string
645
+ }
646
+ formData: {}
647
+ jsonResponse: {
648
+ acs_user: {
649
+ acs_user_id: string
650
+ acs_system_id: string
651
+ workspace_id: string
652
+ created_at: string
653
+ display_name: string
654
+ full_name?: string | undefined
655
+ email?: string | undefined
656
+ phone_number?: string | undefined
657
+ }
658
+ }
659
+ }
660
+ '/acs/users/list': {
661
+ route: '/acs/users/list'
662
+ method: 'GET' | 'POST'
663
+ queryParams: {}
664
+ jsonBody: {}
665
+ commonParams: {
666
+ acs_system_id: string
667
+ }
668
+ formData: {}
669
+ jsonResponse: {
670
+ acs_users: Array<{
671
+ acs_user_id: string
672
+ acs_system_id: string
673
+ workspace_id: string
674
+ created_at: string
675
+ display_name: string
676
+ full_name?: string | undefined
677
+ email?: string | undefined
678
+ phone_number?: string | undefined
679
+ }>
680
+ }
681
+ }
566
682
  '/acs/users/remove_from_access_group': {
567
683
  route: '/acs/users/remove_from_access_group'
568
684
  method: 'POST' | 'PATCH'
@@ -582,8 +698,9 @@ export interface Routes {
582
698
  jsonBody: {}
583
699
  commonParams: {
584
700
  acs_user_id: string
585
- name?: (string | null) | undefined
586
- email?: (string | null) | undefined
701
+ full_name?: string | undefined
702
+ email?: string | undefined
703
+ phone_number?: string | undefined
587
704
  }
588
705
  formData: {}
589
706
  jsonResponse: {}
@@ -948,6 +1065,7 @@ export interface Routes {
948
1065
  }
949
1066
  | undefined
950
1067
  account_type?: string | undefined
1068
+ account_type_display_name: string
951
1069
  errors?: any
952
1070
  warnings?: any
953
1071
  custom_metadata?:
@@ -977,6 +1095,7 @@ export interface Routes {
977
1095
  }
978
1096
  | undefined
979
1097
  account_type?: string | undefined
1098
+ account_type_display_name: string
980
1099
  errors?: any
981
1100
  warnings?: any
982
1101
  custom_metadata?:
@@ -1,5 +1,10 @@
1
1
  export type {
2
2
  AccessCodeConstraint,
3
+ AcsAccessGroup,
4
+ AcsAccessGroupType,
5
+ AcsSystem,
6
+ AcsSystemType,
7
+ AcsUser,
3
8
  AnyDeviceType,
4
9
  BatteryStatus,
5
10
  Capabilities,
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod'
2
+
3
+ export const acs_access_group_type = z.enum(['pti_unit'])
4
+
5
+ export type AcsAccessGroupType = z.infer<typeof acs_access_group_type>
6
+
7
+ export const acs_access_group = z.object({
8
+ acs_access_group_id: z.string().uuid(),
9
+ acs_system_id: z.string().uuid(),
10
+ workspace_id: z.string().uuid(),
11
+ name: z.string(),
12
+ access_group_type: acs_access_group_type,
13
+ access_group_type_display_name: z.string(),
14
+ created_at: z.string().datetime(),
15
+ })
16
+
17
+ export type AcsAccessGroup = z.output<typeof acs_access_group>
@@ -0,0 +1,3 @@
1
+ export * from './access_group.js'
2
+ export * from './system.js'
3
+ export * from './user.js'
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod'
2
+
3
+ export const acs_system_type = z.enum(['pti_site', 'alta_org'])
4
+
5
+ export type AcsSystemType = z.infer<typeof acs_system_type>
6
+
7
+ export const acs_system = z.object({
8
+ acs_system_id: z.string().uuid(),
9
+ system_type: acs_system_type,
10
+ system_type_display_name: z.string(),
11
+ name: z.string(),
12
+ created_at: z.string().datetime(),
13
+ })
14
+
15
+ export type AcsSystem = z.output<typeof acs_system>
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod'
2
+
3
+ const user_fields = z.object({
4
+ full_name: z.string().optional(),
5
+ email: z.string().email().optional(),
6
+ phone_number: z.coerce
7
+ .string()
8
+ .trim()
9
+ .refine(
10
+ (val) => {
11
+ // https://www.twilio.com/docs/glossary/what-e164
12
+ return /^\+[1-9]\d{1,14}$/.test(val)
13
+ },
14
+ {
15
+ message: 'Phone number must be in E.164 format: +14155552671',
16
+ },
17
+ )
18
+ .optional(),
19
+ })
20
+
21
+ export const acs_user = z
22
+ .object({
23
+ acs_user_id: z.string().uuid(),
24
+ acs_system_id: z.string().uuid(),
25
+ workspace_id: z.string().uuid(),
26
+ created_at: z.string().datetime(),
27
+ display_name: z.string(),
28
+ })
29
+ .merge(user_fields)
30
+
31
+ export type AcsUser = z.output<typeof acs_user>
@@ -1,3 +1,4 @@
1
+ export * from './acs/index.js'
1
2
  export * from './capabilities-supported.js'
2
3
  export * from './capability-properties/index.js'
3
4
  export * from './device-type.js'
@@ -1,5 +1,10 @@
1
1
  export {
2
2
  access_code_code_constraint,
3
+ acs_access_group,
4
+ acs_access_group_type,
5
+ acs_system,
6
+ acs_system_type,
7
+ acs_user,
3
8
  any_device_type,
4
9
  battery_status,
5
10
  capabilities,