@seamapi/types 1.263.1 → 1.264.1

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/connect.cjs +438 -84
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +3745 -454
  4. package/lib/seam/connect/models/acs/acs-credential.d.ts +83 -0
  5. package/lib/seam/connect/models/acs/acs-credential.js +38 -0
  6. package/lib/seam/connect/models/acs/acs-credential.js.map +1 -1
  7. package/lib/seam/connect/models/action-attempts/action-attempt.d.ts +862 -53
  8. package/lib/seam/connect/models/action-attempts/action-attempt.js +2 -2
  9. package/lib/seam/connect/models/action-attempts/action-attempt.js.map +1 -1
  10. package/lib/seam/connect/models/action-attempts/deprecated.d.ts +61 -21
  11. package/lib/seam/connect/models/action-attempts/deprecated.js +13 -5
  12. package/lib/seam/connect/models/action-attempts/deprecated.js.map +1 -1
  13. package/lib/seam/connect/models/action-attempts/encode-card.d.ts +3 -18
  14. package/lib/seam/connect/models/action-attempts/encode-card.js +1 -12
  15. package/lib/seam/connect/models/action-attempts/encode-card.js.map +1 -1
  16. package/lib/seam/connect/models/action-attempts/index.d.ts +1 -0
  17. package/lib/seam/connect/models/action-attempts/index.js +1 -0
  18. package/lib/seam/connect/models/action-attempts/index.js.map +1 -1
  19. package/lib/seam/connect/models/action-attempts/scan-card.d.ts +875 -0
  20. package/lib/seam/connect/models/action-attempts/{read-card.js → scan-card.js} +8 -12
  21. package/lib/seam/connect/models/action-attempts/scan-card.js.map +1 -0
  22. package/lib/seam/connect/openapi.d.ts +308 -38
  23. package/lib/seam/connect/openapi.js +368 -42
  24. package/lib/seam/connect/openapi.js.map +1 -1
  25. package/lib/seam/connect/route-types.d.ts +2522 -362
  26. package/lib/seam/connect/schemas.d.ts +1 -1
  27. package/lib/seam/connect/schemas.js +1 -1
  28. package/lib/seam/connect/schemas.js.map +1 -1
  29. package/package.json +2 -2
  30. package/src/lib/seam/connect/models/acs/acs-credential.ts +48 -0
  31. package/src/lib/seam/connect/models/action-attempts/action-attempt.ts +2 -2
  32. package/src/lib/seam/connect/models/action-attempts/deprecated.ts +13 -5
  33. package/src/lib/seam/connect/models/action-attempts/encode-card.ts +1 -12
  34. package/src/lib/seam/connect/models/action-attempts/index.ts +1 -0
  35. package/src/lib/seam/connect/models/action-attempts/{read-card.ts → scan-card.ts} +15 -12
  36. package/src/lib/seam/connect/openapi.ts +373 -44
  37. package/src/lib/seam/connect/route-types.ts +3362 -502
  38. package/src/lib/seam/connect/schemas.ts +3 -0
  39. package/lib/seam/connect/models/action-attempts/read-card.d.ts +0 -91
  40. package/lib/seam/connect/models/action-attempts/read-card.js.map +0 -1
@@ -1 +1 @@
1
- export { access_code, acs_access_group, acs_credential, acs_entrance, acs_system, acs_user, action_attempt, client_session, connect_webview, connected_account, custom_metadata, device, device_provider, noise_threshold, seam_event, thermostat_schedule, unmanaged_access_code, unmanaged_acs_access_group, unmanaged_acs_credential, unmanaged_acs_user, unmanaged_device, user_identity, webhook, workspace, } from './models/index.js';
1
+ export { access_code, acs_access_group, acs_credential, acs_entrance, acs_system, acs_user, action_attempt, client_session, common_failed_action_attempt, common_pending_action_attempt, common_succeeded_action_attempt, connect_webview, connected_account, custom_metadata, device, device_provider, noise_threshold, seam_event, thermostat_schedule, unmanaged_access_code, unmanaged_acs_access_group, unmanaged_acs_credential, unmanaged_acs_user, unmanaged_device, user_identity, webhook, workspace, } from './models/index.js';
@@ -1,2 +1,2 @@
1
- export { access_code, acs_access_group, acs_credential, acs_entrance, acs_system, acs_user, action_attempt, client_session, connect_webview, connected_account, custom_metadata, device, device_provider, noise_threshold, seam_event, thermostat_schedule, unmanaged_access_code, unmanaged_acs_access_group, unmanaged_acs_credential, unmanaged_acs_user, unmanaged_device, user_identity, webhook, workspace, } from './models/index.js';
1
+ export { access_code, acs_access_group, acs_credential, acs_entrance, acs_system, acs_user, action_attempt, client_session, common_failed_action_attempt, common_pending_action_attempt, common_succeeded_action_attempt, connect_webview, connected_account, custom_metadata, device, device_provider, noise_threshold, seam_event, thermostat_schedule, unmanaged_access_code, unmanaged_acs_access_group, unmanaged_acs_credential, unmanaged_acs_user, unmanaged_device, user_identity, webhook, workspace, } from './models/index.js';
2
2
  //# sourceMappingURL=schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,eAAe,EACf,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,SAAS,GACV,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,6BAA6B,EAC7B,+BAA+B,EAC/B,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,eAAe,EACf,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,SAAS,GACV,MAAM,mBAAmB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.263.1",
3
+ "version": "1.264.1",
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.21.4"
93
93
  },
94
94
  "devDependencies": {
95
- "@seamapi/blueprint": "^0.27.0",
95
+ "@seamapi/blueprint": "^0.28.0",
96
96
  "@types/node": "^20.8.10",
97
97
  "concurrently": "^8.2.0",
98
98
  "del-cli": "^5.0.0",
@@ -72,5 +72,53 @@ export const unmanaged_acs_credential = common_acs_credential.merge(
72
72
  }),
73
73
  )
74
74
 
75
+ export const acs_credential_on_encoder = z.object({
76
+ created_at: z
77
+ .string()
78
+ .datetime()
79
+ .describe('Date and time the credential was created.'),
80
+
81
+ is_issued: z.boolean().nullable(),
82
+
83
+ starts_at: z
84
+ .string()
85
+ .datetime()
86
+ .nullable()
87
+ .describe('Date and time the credential will become useable.'),
88
+ ends_at: z
89
+ .string()
90
+ .datetime()
91
+ .nullable()
92
+ .describe('Date and time the credential will stop being useable.'),
93
+
94
+ card_number: z
95
+ .string()
96
+ .nullable()
97
+ .describe('A number or string that physically identifies this card.'),
98
+
99
+ visionline_metadata: z
100
+ .object({
101
+ card_id: z.string(),
102
+ card_function_type: z.enum(['guest', 'staff']), // computed, looks at door ops, and checks is guest op is present.
103
+
104
+ cancelled: z.boolean(),
105
+ discarded: z.boolean(),
106
+ expired: z.boolean(),
107
+ overwritten: z.boolean(),
108
+ overridden: z.boolean().optional(),
109
+ pending_auto_update: z.boolean(),
110
+
111
+ card_format: z.enum(['TLCode', 'rfid48']),
112
+ card_holder: z.string().optional(),
113
+
114
+ number_of_issued_cards: z.number(),
115
+
116
+ // guest_acs_entrance_ids: z.array(z.string().uuid()).optional(), // computed
117
+ // common_acs_entrance_ids: z.array(z.string().uuid()).optional(), // computed
118
+ })
119
+ .optional(),
120
+ })
121
+
75
122
  export type AcsCredential = z.output<typeof acs_credential>
76
123
  export type UnmanagedAcsCredential = z.output<typeof unmanaged_acs_credential>
124
+ export type AcsCredentialOnEncoder = z.output<typeof acs_credential_on_encoder>
@@ -4,8 +4,8 @@ import { activate_climate_preset_action_attempt } from './activate-climate-prese
4
4
  import { deprecated_action_attempts } from './deprecated.js'
5
5
  import { encode_card_action_attempt } from './encode-card.js'
6
6
  import { lock_door_action_attempt } from './lock-door.js'
7
- import { read_card_action_attempt } from './read-card.js'
8
7
  import { reset_sandbox_workspace_action_attempt } from './reset-sandbox-workspace.js'
8
+ import { scan_card_action_attempt } from './scan-card.js'
9
9
  import { set_cool_action_attempt } from './set-cool.js'
10
10
  import { set_fan_mode_action_attempt } from './set-fan-mode.js'
11
11
  import { set_heat_action_attempt } from './set-heat.js'
@@ -16,7 +16,7 @@ import { unlock_door_action_attempt } from './unlock-door.js'
16
16
  export const action_attempt = z.union([
17
17
  ...lock_door_action_attempt.options,
18
18
  ...unlock_door_action_attempt.options,
19
- ...read_card_action_attempt.options,
19
+ ...scan_card_action_attempt.options,
20
20
  ...encode_card_action_attempt.options,
21
21
  ...reset_sandbox_workspace_action_attempt.options,
22
22
  ...set_cool_action_attempt.options,
@@ -11,7 +11,7 @@ const error = z.object({
11
11
  message: z.string(),
12
12
  })
13
13
 
14
- const result = z.any()
14
+ const result = z.object({})
15
15
 
16
16
  const sync_access_codes_action_attempt = z.discriminatedUnion('status', [
17
17
  common_pending_action_attempt.extend({
@@ -33,7 +33,9 @@ const create_access_code_action_attempt = z.discriminatedUnion('status', [
33
33
  }),
34
34
  common_succeeded_action_attempt.extend({
35
35
  action_type: z.literal('CREATE_ACCESS_CODE'),
36
- result,
36
+ result: z.object({
37
+ access_code: z.any(),
38
+ }),
37
39
  }),
38
40
  common_failed_action_attempt.extend({
39
41
  action_type: z.literal('CREATE_ACCESS_CODE'),
@@ -61,7 +63,9 @@ const update_access_code_action_attempt = z.discriminatedUnion('status', [
61
63
  }),
62
64
  common_succeeded_action_attempt.extend({
63
65
  action_type: z.literal('UPDATE_ACCESS_CODE'),
64
- result,
66
+ result: z.object({
67
+ access_code: z.any(),
68
+ }),
65
69
  }),
66
70
  common_failed_action_attempt.extend({
67
71
  action_type: z.literal('UPDATE_ACCESS_CODE'),
@@ -75,7 +79,9 @@ const create_noise_threshold_action_attempt = z.discriminatedUnion('status', [
75
79
  }),
76
80
  common_succeeded_action_attempt.extend({
77
81
  action_type: z.literal('CREATE_NOISE_THRESHOLD'),
78
- result,
82
+ result: z.object({
83
+ noise_threshold: z.any(),
84
+ }),
79
85
  }),
80
86
  common_failed_action_attempt.extend({
81
87
  action_type: z.literal('CREATE_NOISE_THRESHOLD'),
@@ -103,7 +109,9 @@ const update_noise_threshold_action_attempt = z.discriminatedUnion('status', [
103
109
  }),
104
110
  common_succeeded_action_attempt.extend({
105
111
  action_type: z.literal('UPDATE_NOISE_THRESHOLD'),
106
- result,
112
+ result: z.object({
113
+ noise_threshold: z.any(),
114
+ }),
107
115
  }),
108
116
  common_failed_action_attempt.extend({
109
117
  action_type: z.literal('UPDATE_NOISE_THRESHOLD'),
@@ -13,18 +13,7 @@ const error = z.object({
13
13
  message: z.string(),
14
14
  })
15
15
 
16
- const result = z.object({
17
- acs_credential_id: z
18
- .string()
19
- .uuid()
20
- .nullable()
21
- .describe('Matching acs_credential currently encoded on this card.'),
22
- card_number: z
23
- .string()
24
- .nullable()
25
- .describe('A number or string that physically identifies this card.'),
26
- // TODO visionline_metadata: visionline_credential_metadata,
27
- })
16
+ const result = z.object({})
28
17
 
29
18
  export const encode_card_action_attempt = z.discriminatedUnion('status', [
30
19
  common_pending_action_attempt
@@ -1 +1,2 @@
1
1
  export * from './action-attempt.js'
2
+ export * from './common.js'
@@ -1,32 +1,35 @@
1
1
  import { z } from 'zod'
2
2
 
3
+ import {
4
+ acs_credential,
5
+ acs_credential_on_encoder,
6
+ unmanaged_acs_credential,
7
+ } from '../acs/acs-credential.js'
3
8
  import {
4
9
  common_failed_action_attempt,
5
10
  common_pending_action_attempt,
6
11
  common_succeeded_action_attempt,
7
12
  } from './common.js'
8
13
 
9
- const action_type = z.literal('READ_CARD')
14
+ const action_type = z.literal('SCAN_CARD')
10
15
 
11
16
  const error = z.object({
12
17
  type: z.literal('no_card_on_encoder'),
13
18
  message: z.string(),
14
19
  })
15
20
 
21
+ const acs_credential_on_seam = acs_credential.or(unmanaged_acs_credential)
22
+
16
23
  const result = z.object({
17
- // TODO acs_credential_id: z
18
- // .string()
19
- // .uuid()
20
- // .nullable()
21
- // .describe("Matching acs_credential currently encoded on this card."),
22
- card_number: z
23
- .string()
24
+ acs_credential_on_encoder: acs_credential_on_encoder.describe(
25
+ 'Snapshot of the card data read from the physical encoder.',
26
+ ),
27
+ acs_credential_on_seam: acs_credential_on_seam
24
28
  .nullable()
25
- .describe('A number or string that physically identifies this card.'),
26
- // TODO visionline_metadata: visionline_credential_metadata,
29
+ .describe('Matching acs_credential currently encoded on this card.'),
27
30
  })
28
31
 
29
- export const read_card_action_attempt = z.discriminatedUnion('status', [
32
+ export const scan_card_action_attempt = z.discriminatedUnion('status', [
30
33
  common_pending_action_attempt
31
34
  .extend({
32
35
  action_type,
@@ -43,4 +46,4 @@ export const read_card_action_attempt = z.discriminatedUnion('status', [
43
46
  .describe('Reading card data from physical encoder failed.'),
44
47
  ])
45
48
 
46
- export type ReadCardActionAttempt = z.infer<typeof read_card_action_attempt>
49
+ export type ScanCardActionAttempt = z.infer<typeof scan_card_action_attempt>