@seamapi/types 1.384.0 → 1.386.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 (46) hide show
  1. package/dist/connect.cjs +629 -150
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +4211 -445
  4. package/lib/seam/connect/models/access-grants/access-grant.d.ts +8 -5
  5. package/lib/seam/connect/models/access-grants/access-grant.js +3 -0
  6. package/lib/seam/connect/models/access-grants/access-grant.js.map +1 -1
  7. package/lib/seam/connect/models/access-grants/requested-access-method.d.ts +3 -3
  8. package/lib/seam/connect/models/access-grants/requested-access-method.js +2 -2
  9. package/lib/seam/connect/models/access-grants/requested-access-method.js.map +1 -1
  10. package/lib/seam/connect/models/action-attempts/action-attempt.d.ts +156 -0
  11. package/lib/seam/connect/models/action-attempts/action-attempt.js +4 -0
  12. package/lib/seam/connect/models/action-attempts/action-attempt.js.map +1 -1
  13. package/lib/seam/connect/models/action-attempts/simulate-keypad-code-entry.d.ts +80 -0
  14. package/lib/seam/connect/models/action-attempts/simulate-keypad-code-entry.js +28 -0
  15. package/lib/seam/connect/models/action-attempts/simulate-keypad-code-entry.js.map +1 -0
  16. package/lib/seam/connect/models/action-attempts/simulate-manual-lock-via-keypad.d.ts +80 -0
  17. package/lib/seam/connect/models/action-attempts/simulate-manual-lock-via-keypad.js +28 -0
  18. package/lib/seam/connect/models/action-attempts/simulate-manual-lock-via-keypad.js.map +1 -0
  19. package/lib/seam/connect/models/colors.d.ts +2 -0
  20. package/lib/seam/connect/models/colors.js +8 -0
  21. package/lib/seam/connect/models/colors.js.map +1 -0
  22. package/lib/seam/connect/models/events/access-grants.d.ts +277 -0
  23. package/lib/seam/connect/models/events/access-grants.js +60 -0
  24. package/lib/seam/connect/models/events/access-grants.js.map +1 -0
  25. package/lib/seam/connect/models/events/access-methods.d.ts +146 -0
  26. package/lib/seam/connect/models/events/access-methods.js +35 -0
  27. package/lib/seam/connect/models/events/access-methods.js.map +1 -0
  28. package/lib/seam/connect/models/workspaces/workspace.d.ts +33 -0
  29. package/lib/seam/connect/models/workspaces/workspace.js +8 -0
  30. package/lib/seam/connect/models/workspaces/workspace.js.map +1 -1
  31. package/lib/seam/connect/openapi.d.ts +523 -225
  32. package/lib/seam/connect/openapi.js +592 -171
  33. package/lib/seam/connect/openapi.js.map +1 -1
  34. package/lib/seam/connect/route-types.d.ts +3477 -198
  35. package/package.json +2 -2
  36. package/src/lib/seam/connect/models/access-grants/access-grant.ts +5 -0
  37. package/src/lib/seam/connect/models/access-grants/requested-access-method.ts +4 -2
  38. package/src/lib/seam/connect/models/action-attempts/action-attempt.ts +4 -0
  39. package/src/lib/seam/connect/models/action-attempts/simulate-keypad-code-entry.ts +39 -0
  40. package/src/lib/seam/connect/models/action-attempts/simulate-manual-lock-via-keypad.ts +37 -0
  41. package/src/lib/seam/connect/models/colors.ts +9 -0
  42. package/src/lib/seam/connect/models/events/access-grants.ts +92 -0
  43. package/src/lib/seam/connect/models/events/access-methods.ts +51 -0
  44. package/src/lib/seam/connect/models/workspaces/workspace.ts +9 -0
  45. package/src/lib/seam/connect/openapi.ts +615 -175
  46. package/src/lib/seam/connect/route-types.ts +3793 -36
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.384.0",
3
+ "version": "1.386.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -92,7 +92,7 @@
92
92
  "zod": "^3.24.0"
93
93
  },
94
94
  "devDependencies": {
95
- "@seamapi/blueprint": "^0.39.0",
95
+ "@seamapi/blueprint": "^0.40.0",
96
96
  "@types/node": "^20.8.10",
97
97
  "concurrently": "^8.2.0",
98
98
  "del-cli": "^5.0.0",
@@ -20,6 +20,11 @@ export const access_grant = z.object({
20
20
  requested_access_methods: z
21
21
  .array(requested_access_method)
22
22
  .describe('Access methods that the user requested for this access grant.'),
23
+ access_method_ids: z
24
+ .array(z.string().uuid())
25
+ .describe(
26
+ 'IDs of the access methods that were created for this access grant.',
27
+ ),
23
28
  display_name: z.string().describe('Display name of the access grant.'),
24
29
  created_at: z
25
30
  .string()
@@ -13,9 +13,11 @@ export const requested_access_method = z.object({
13
13
  .describe(
14
14
  'Date and time at which the requested access method was added to this access grant.',
15
15
  ),
16
- provisioned_access_method_ids: z
16
+ created_access_method_ids: z
17
17
  .array(z.string().uuid())
18
- .describe('IDs of the locations to which access is being given.'),
18
+ .describe(
19
+ 'IDs of the access methods that were created for this requested access method.',
20
+ ),
19
21
  }).describe(`
20
22
  ---
21
23
  undocumented: Unreleased.
@@ -8,6 +8,8 @@ import { reset_sandbox_workspace_action_attempt } from './reset-sandbox-workspac
8
8
  import { scan_credential_action_attempt } from './scan-credential.js'
9
9
  import { set_fan_mode_action_attempt } from './set-fan-mode.js'
10
10
  import { set_hvac_mode_action_attempt } from './set-hvac-mode.js'
11
+ import { simulate_keypad_code_entry_action_attempt } from './simulate-keypad-code-entry.js'
12
+ import { simulate_manual_lock_via_keypad_action_attempt } from './simulate-manual-lock-via-keypad.js'
11
13
  import { unlock_door_action_attempt } from './unlock-door.js'
12
14
 
13
15
  export const action_attempt = z.union([
@@ -19,6 +21,8 @@ export const action_attempt = z.union([
19
21
  ...set_fan_mode_action_attempt.options,
20
22
  ...set_hvac_mode_action_attempt.options,
21
23
  ...activate_climate_preset_action_attempt.options,
24
+ ...simulate_keypad_code_entry_action_attempt.options,
25
+ ...simulate_manual_lock_via_keypad_action_attempt.options,
22
26
  ...deprecated_action_attempts,
23
27
  ]).describe(`
24
28
  ---
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod'
2
+
3
+ import {
4
+ common_failed_action_attempt,
5
+ common_pending_action_attempt,
6
+ common_succeeded_action_attempt,
7
+ } from './common.js'
8
+
9
+ const action_type = z.literal('SIMULATE_KEYPAD_CODE_ENTRY')
10
+
11
+ const error = z.object({
12
+ type: z.string(),
13
+ message: z.string(),
14
+ })
15
+
16
+ const result = z.object({})
17
+
18
+ export const simulate_keypad_code_entry_action_attempt = z.discriminatedUnion(
19
+ 'status',
20
+ [
21
+ common_pending_action_attempt
22
+ .extend({
23
+ action_type,
24
+ })
25
+ .describe('Simulating keypad code entry.'),
26
+ common_succeeded_action_attempt
27
+ .extend({
28
+ action_type,
29
+ result,
30
+ })
31
+ .describe('Simulating keypad code entry succeeded.'),
32
+ common_failed_action_attempt
33
+ .extend({
34
+ action_type,
35
+ error,
36
+ })
37
+ .describe('Simulating keypad code entry failed.'),
38
+ ],
39
+ )
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod'
2
+
3
+ import {
4
+ common_failed_action_attempt,
5
+ common_pending_action_attempt,
6
+ common_succeeded_action_attempt,
7
+ } from './common.js'
8
+
9
+ const action_type = z.literal('SIMULATE_MANUAL_LOCK_VIA_KEYPAD')
10
+
11
+ const error = z.object({
12
+ type: z.string(),
13
+ message: z.string(),
14
+ })
15
+
16
+ const result = z.object({})
17
+
18
+ export const simulate_manual_lock_via_keypad_action_attempt =
19
+ z.discriminatedUnion('status', [
20
+ common_pending_action_attempt
21
+ .extend({
22
+ action_type,
23
+ })
24
+ .describe('Simulating manual lock via keypad.'),
25
+ common_succeeded_action_attempt
26
+ .extend({
27
+ action_type,
28
+ result,
29
+ })
30
+ .describe('Simulating manual lock via keypad succeeded.'),
31
+ common_failed_action_attempt
32
+ .extend({
33
+ action_type,
34
+ error,
35
+ })
36
+ .describe('Simulating manual lock via keypad failed.'),
37
+ ])
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod'
2
+
3
+ export const hex_color_code = z.string().refine((value) => {
4
+ if (value != null) {
5
+ return /^#[\da-fa-z]{3,6}$/i.test(value)
6
+ }
7
+
8
+ return true
9
+ }, 'Must be a hex color')
@@ -0,0 +1,92 @@
1
+ import { z } from 'zod'
2
+
3
+ import { common_event } from './common.js'
4
+
5
+ const access_grant_event = common_event.extend({
6
+ access_grant_id: z.string().uuid().describe('ID of the access grant.'),
7
+ })
8
+
9
+ export const access_grant_created_event = access_grant_event.extend({
10
+ event_type: z.literal('access_grant.created'),
11
+ }).describe(`
12
+ ---
13
+ route_path: /access_grants
14
+ ---
15
+ An access grant was created.
16
+ `)
17
+
18
+ export type AccessGrantCreatedEvent = z.infer<typeof access_grant_created_event>
19
+
20
+ export const access_grant_deleted_event = access_grant_event.extend({
21
+ event_type: z.literal('access_grant.deleted'),
22
+ }).describe(`
23
+ ---
24
+ route_path: /access_grants
25
+ ---
26
+ An access grant was deleted.
27
+ `)
28
+
29
+ export type AccessGrantDeleteddEvent = z.infer<
30
+ typeof access_grant_deleted_event
31
+ >
32
+
33
+ export const access_grant_access_granted_to_all_doors_event =
34
+ access_grant_event.extend({
35
+ event_type: z.literal('access_grant.access_granted_to_all_doors'),
36
+ }).describe(`
37
+ ---
38
+ route_path: /access_grants
39
+ ---
40
+ All access requested for an access grant was successfully granted.
41
+ `)
42
+
43
+ export type AccessGrantAccessGrantedToAllDoorsEvent = z.infer<
44
+ typeof access_grant_access_granted_to_all_doors_event
45
+ >
46
+
47
+ const acs_entrance_id = z
48
+ .string()
49
+ .uuid()
50
+ .describe(
51
+ 'ID of the door, an [ACS entrance](https://docs.seam.co/latest/capability-guides/retrieving-entrance-details).',
52
+ )
53
+
54
+ export const access_grant_access_granted_to_door_event =
55
+ access_grant_event.extend({
56
+ event_type: z.literal('access_grant.access_granted_to_door'),
57
+ acs_entrance_id,
58
+ }).describe(`
59
+ ---
60
+ route_path: /access_grants
61
+ ---
62
+ Access requested as part of an access grant to a particular door was successfully granted.
63
+ `)
64
+
65
+ export type AccessGrantAccessGrantedToDoorEvent = z.infer<
66
+ typeof access_grant_access_granted_to_door_event
67
+ >
68
+
69
+ export const access_grant_access_to_door_lost_event = access_grant_event.extend(
70
+ {
71
+ event_type: z.literal('access_grant.access_to_door_lost'),
72
+ acs_entrance_id,
73
+ },
74
+ ).describe(`
75
+ ---
76
+ route_path: /access_grants
77
+ ---
78
+ Access to a particular door that was requested as part of an access grant was lost.
79
+ `)
80
+
81
+ export type AccessGrantAccessToDoorLostEvent = z.infer<
82
+ typeof access_grant_access_to_door_lost_event
83
+ >
84
+
85
+ export const access_code_events = [
86
+ access_grant_created_event,
87
+ access_grant_deleted_event,
88
+ access_grant_access_granted_to_all_doors_event,
89
+ access_grant_access_granted_to_door_event,
90
+ access_grant_access_to_door_lost_event,
91
+ access_grant_deleted_event,
92
+ ] as const
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod'
2
+
3
+ import { common_event } from './common.js'
4
+
5
+ const access_method_event = common_event.extend({
6
+ access_method_id: z.string().uuid().describe('ID of the access method.'),
7
+ })
8
+
9
+ export const access_method_issued_event = access_method_event.extend({
10
+ event_type: z.literal('access_method.issued'),
11
+ }).describe(`
12
+ ---
13
+ route_path: /access_methods
14
+ ---
15
+ An access method was issued.
16
+ `)
17
+
18
+ export type AccessMethodIssuedEvent = z.infer<typeof access_method_issued_event>
19
+
20
+ export const access_method_card_encoding_required_event =
21
+ access_method_event.extend({
22
+ event_type: z.literal('access_method.card_encoding_required'),
23
+ }).describe(`
24
+ ---
25
+ route_path: /access_methods
26
+ ---
27
+ An access method representing a physical card requires encoding.
28
+ `)
29
+
30
+ export type AccessMethodCardEncodingRequiredEvent = z.infer<
31
+ typeof access_method_card_encoding_required_event
32
+ >
33
+
34
+ export const access_method_revoked_event = access_method_event.extend({
35
+ event_type: z.literal('access_method.revoked'),
36
+ }).describe(`
37
+ ---
38
+ route_path: /access_methods
39
+ ---
40
+ An access method was revoked.
41
+ `)
42
+
43
+ export type AccessMethodRevokedEvent = z.infer<
44
+ typeof access_method_revoked_event
45
+ >
46
+
47
+ export const access_code_events = [
48
+ access_method_issued_event,
49
+ access_method_revoked_event,
50
+ access_method_card_encoding_required_event,
51
+ ] as const
@@ -1,10 +1,19 @@
1
1
  import { z } from 'zod'
2
2
 
3
+ import { hex_color_code } from '../colors.js'
4
+
3
5
  export const workspace = z.object({
4
6
  workspace_id: z.string().uuid(),
5
7
  name: z.string(),
6
8
  company_name: z.string(),
7
9
  is_sandbox: z.boolean(),
10
+ connect_webview_customization: z.object({
11
+ primary_button_color: hex_color_code.optional(),
12
+ primary_button_text_color: hex_color_code.optional(),
13
+ success_message: z.string().optional(),
14
+ logo_shape: z.enum(['circle', 'square']).optional(),
15
+ inviter_logo_url: z.string().optional(),
16
+ }),
8
17
  is_suspended: z
9
18
  .boolean()
10
19
  .describe('True if a sandbox workspace has not been accessed in 14 days'),