@propertysimple/client 0.1.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 (54) hide show
  1. package/API.md +79 -0
  2. package/README.md +348 -0
  3. package/client/src/directory-sync.d.ts +123 -0
  4. package/client/src/directory-sync.js +404 -0
  5. package/client/src/index.d.ts +5123 -0
  6. package/client/src/index.js +285 -0
  7. package/client/src/managed-sync.d.ts +129 -0
  8. package/client/src/managed-sync.js +410 -0
  9. package/contracts/src/catalog-derived.d.ts +7 -0
  10. package/contracts/src/catalog-derived.js +78 -0
  11. package/contracts/src/catalog-fields.d.ts +231 -0
  12. package/contracts/src/catalog-fields.js +194 -0
  13. package/contracts/src/catalog-inventory.d.ts +14 -0
  14. package/contracts/src/catalog-inventory.js +10 -0
  15. package/contracts/src/directory-execution.d.ts +320 -0
  16. package/contracts/src/directory-execution.js +122 -0
  17. package/contracts/src/directory-identity.d.ts +1255 -0
  18. package/contracts/src/directory-identity.js +129 -0
  19. package/contracts/src/directory-sales.d.ts +333 -0
  20. package/contracts/src/directory-sales.js +102 -0
  21. package/contracts/src/directory.d.ts +1088 -0
  22. package/contracts/src/directory.js +179 -0
  23. package/contracts/src/index.d.ts +18 -0
  24. package/contracts/src/index.js +18 -0
  25. package/contracts/src/intelligence.d.ts +366 -0
  26. package/contracts/src/intelligence.js +157 -0
  27. package/contracts/src/location-serving.d.ts +13 -0
  28. package/contracts/src/location-serving.js +89 -0
  29. package/contracts/src/location.d.ts +73 -0
  30. package/contracts/src/location.js +75 -0
  31. package/contracts/src/openapi.d.ts +22 -0
  32. package/contracts/src/openapi.js +109 -0
  33. package/contracts/src/operations.d.ts +8316 -0
  34. package/contracts/src/operations.js +56 -0
  35. package/contracts/src/opportunity-events.d.ts +38 -0
  36. package/contracts/src/opportunity-events.js +69 -0
  37. package/contracts/src/platform-api.d.ts +12 -0
  38. package/contracts/src/platform-api.js +1 -0
  39. package/contracts/src/professional-intelligence.d.ts +256 -0
  40. package/contracts/src/professional-intelligence.js +90 -0
  41. package/contracts/src/property-features.d.ts +94 -0
  42. package/contracts/src/property-features.js +398 -0
  43. package/contracts/src/publication.d.ts +44 -0
  44. package/contracts/src/publication.js +42 -0
  45. package/contracts/src/routes.d.ts +437 -0
  46. package/contracts/src/routes.js +496 -0
  47. package/contracts/src/schemas.d.ts +3198 -0
  48. package/contracts/src/schemas.js +674 -0
  49. package/contracts/src/search.d.ts +2630 -0
  50. package/contracts/src/search.js +223 -0
  51. package/contracts/src/smart-feed.d.ts +3731 -0
  52. package/contracts/src/smart-feed.js +109 -0
  53. package/openapi.json +43542 -0
  54. package/package.json +60 -0
@@ -0,0 +1,320 @@
1
+ import { z } from 'zod';
2
+ /** Separately provisioned authority. A recommendation policy never implicitly permits execution. */
3
+ export declare const DirectoryExecutionPolicySchema: z.ZodObject<{
4
+ reviewed: z.ZodBoolean;
5
+ allowed_executor_ids: z.ZodArray<z.ZodString>;
6
+ allowed_provider_ids: z.ZodArray<z.ZodString>;
7
+ channel: z.ZodLiteral<"email">;
8
+ allowed_hours_utc: z.ZodArray<z.ZodNumber>;
9
+ contact_cooldown_hours: z.ZodNumber;
10
+ max_actions_per_utc_day: z.ZodNumber;
11
+ preparation_lease_seconds: z.ZodNumber;
12
+ }, z.core.$strict>;
13
+ export declare const DirectoryActionStateSchema: z.ZodEnum<{
14
+ unknown: "unknown";
15
+ invalidated: "invalidated";
16
+ reserved: "reserved";
17
+ dispatching: "dispatching";
18
+ accepted: "accepted";
19
+ delivered: "delivered";
20
+ rejected: "rejected";
21
+ }>;
22
+ export declare const DirectoryActionSchema: z.ZodObject<{
23
+ id: z.ZodString;
24
+ plan_id: z.ZodString;
25
+ intent_id: z.ZodString;
26
+ subject_id: z.ZodString;
27
+ state: z.ZodEnum<{
28
+ unknown: "unknown";
29
+ invalidated: "invalidated";
30
+ reserved: "reserved";
31
+ dispatching: "dispatching";
32
+ accepted: "accepted";
33
+ delivered: "delivered";
34
+ rejected: "rejected";
35
+ }>;
36
+ provider: z.ZodString;
37
+ provider_idempotency_key: z.ZodString;
38
+ created_at: z.ZodISODateTime;
39
+ valid_until: z.ZodISODateTime;
40
+ lease_expires_at: z.ZodISODateTime;
41
+ accepted_at: z.ZodNullable<z.ZodISODateTime>;
42
+ attempt_id: z.ZodNullable<z.ZodString>;
43
+ simulation: z.ZodBoolean;
44
+ }, z.core.$strict>;
45
+ export declare const DirectoryClaimRequest: z.ZodObject<{
46
+ plan_id: z.ZodString;
47
+ intent_ids: z.ZodArray<z.ZodString>;
48
+ provider: z.ZodString;
49
+ }, z.core.$strict>;
50
+ export declare const DirectoryClaimResponse: z.ZodObject<{
51
+ plan_id: z.ZodString;
52
+ actions: z.ZodArray<z.ZodObject<{
53
+ id: z.ZodString;
54
+ plan_id: z.ZodString;
55
+ intent_id: z.ZodString;
56
+ subject_id: z.ZodString;
57
+ state: z.ZodEnum<{
58
+ unknown: "unknown";
59
+ invalidated: "invalidated";
60
+ reserved: "reserved";
61
+ dispatching: "dispatching";
62
+ accepted: "accepted";
63
+ delivered: "delivered";
64
+ rejected: "rejected";
65
+ }>;
66
+ provider: z.ZodString;
67
+ provider_idempotency_key: z.ZodString;
68
+ created_at: z.ZodISODateTime;
69
+ valid_until: z.ZodISODateTime;
70
+ lease_expires_at: z.ZodISODateTime;
71
+ accepted_at: z.ZodNullable<z.ZodISODateTime>;
72
+ attempt_id: z.ZodNullable<z.ZodString>;
73
+ simulation: z.ZodBoolean;
74
+ lease_token: z.ZodString;
75
+ endpoint: z.ZodEmail;
76
+ authority: z.ZodLiteral<"preparation_only">;
77
+ }, z.core.$strict>>;
78
+ exclusions: z.ZodArray<z.ZodObject<{
79
+ intent_id: z.ZodString;
80
+ code: z.ZodString;
81
+ }, z.core.$strict>>;
82
+ }, z.core.$strict>;
83
+ export declare const DirectoryStartRequest: z.ZodObject<{
84
+ id: z.ZodString;
85
+ lease_token: z.ZodString;
86
+ }, z.core.$strict>;
87
+ export declare const DirectoryAttemptSchema: z.ZodObject<{
88
+ id: z.ZodString;
89
+ action_id: z.ZodString;
90
+ provider: z.ZodString;
91
+ provider_idempotency_key: z.ZodString;
92
+ state: z.ZodEnum<{
93
+ unknown: "unknown";
94
+ invalidated: "invalidated";
95
+ reserved: "reserved";
96
+ dispatching: "dispatching";
97
+ accepted: "accepted";
98
+ delivered: "delivered";
99
+ rejected: "rejected";
100
+ }>;
101
+ started_at: z.ZodISODateTime;
102
+ replayed: z.ZodBoolean;
103
+ instruction: z.ZodEnum<{
104
+ execute_once: "execute_once";
105
+ reconcile_only: "reconcile_only";
106
+ }>;
107
+ simulation: z.ZodBoolean;
108
+ }, z.core.$strict>;
109
+ export declare const DirectoryOutcomeRequest: z.ZodObject<{
110
+ outcomes: z.ZodArray<z.ZodObject<{
111
+ event_id: z.ZodString;
112
+ action_id: z.ZodString;
113
+ attempt_id: z.ZodString;
114
+ provider: z.ZodString;
115
+ provider_event_id: z.ZodString;
116
+ outcome: z.ZodEnum<{
117
+ unknown: "unknown";
118
+ accepted: "accepted";
119
+ delivered: "delivered";
120
+ rejected: "rejected";
121
+ bounced: "bounced";
122
+ complained: "complained";
123
+ }>;
124
+ occurred_at: z.ZodISODateTime;
125
+ }, z.core.$strict>>;
126
+ }, z.core.$strict>;
127
+ export declare const DirectoryOutcomeResponse: z.ZodObject<{
128
+ results: z.ZodArray<z.ZodObject<{
129
+ event_id: z.ZodString;
130
+ status: z.ZodEnum<{
131
+ accepted: "accepted";
132
+ rejected: "rejected";
133
+ duplicate: "duplicate";
134
+ }>;
135
+ code: z.ZodNullable<z.ZodString>;
136
+ }, z.core.$strict>>;
137
+ }, z.core.$strict>;
138
+ export declare const DirectorySalesDiscoveryRequest: z.ZodObject<{
139
+ dataset_id: z.ZodString;
140
+ profile_id: z.ZodString;
141
+ audience_id: z.ZodString;
142
+ cursor: z.ZodOptional<z.ZodString>;
143
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
144
+ }, z.core.$strict>;
145
+ export declare const DirectorySalesDiscoveryResponse: z.ZodObject<{
146
+ data: z.ZodArray<z.ZodObject<{
147
+ id: z.ZodString;
148
+ kind: z.ZodEnum<{
149
+ office: "office";
150
+ professional: "professional";
151
+ organization: "organization";
152
+ }>;
153
+ revision: z.ZodString;
154
+ }, z.core.$strict>>;
155
+ next_cursor: z.ZodNullable<z.ZodString>;
156
+ selection_scope: z.ZodLiteral<"bounded_discovery_page">;
157
+ eligibility: z.ZodLiteral<"requires_plan_evaluation">;
158
+ }, z.core.$strict>;
159
+ export declare const directoryExecutionOperations: {
160
+ readonly discoverDirectorySalesCandidates: {
161
+ readonly input: z.ZodObject<{
162
+ dataset_id: z.ZodString;
163
+ profile_id: z.ZodString;
164
+ audience_id: z.ZodString;
165
+ cursor: z.ZodOptional<z.ZodString>;
166
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
167
+ }, z.core.$strict>;
168
+ readonly output: z.ZodObject<{
169
+ data: z.ZodArray<z.ZodObject<{
170
+ id: z.ZodString;
171
+ kind: z.ZodEnum<{
172
+ office: "office";
173
+ professional: "professional";
174
+ organization: "organization";
175
+ }>;
176
+ revision: z.ZodString;
177
+ }, z.core.$strict>>;
178
+ next_cursor: z.ZodNullable<z.ZodString>;
179
+ selection_scope: z.ZodLiteral<"bounded_discovery_page">;
180
+ eligibility: z.ZodLiteral<"requires_plan_evaluation">;
181
+ }, z.core.$strict>;
182
+ };
183
+ readonly claimDirectoryActions: {
184
+ readonly input: z.ZodObject<{
185
+ plan_id: z.ZodString;
186
+ intent_ids: z.ZodArray<z.ZodString>;
187
+ provider: z.ZodString;
188
+ }, z.core.$strict>;
189
+ readonly output: z.ZodObject<{
190
+ plan_id: z.ZodString;
191
+ actions: z.ZodArray<z.ZodObject<{
192
+ id: z.ZodString;
193
+ plan_id: z.ZodString;
194
+ intent_id: z.ZodString;
195
+ subject_id: z.ZodString;
196
+ state: z.ZodEnum<{
197
+ unknown: "unknown";
198
+ invalidated: "invalidated";
199
+ reserved: "reserved";
200
+ dispatching: "dispatching";
201
+ accepted: "accepted";
202
+ delivered: "delivered";
203
+ rejected: "rejected";
204
+ }>;
205
+ provider: z.ZodString;
206
+ provider_idempotency_key: z.ZodString;
207
+ created_at: z.ZodISODateTime;
208
+ valid_until: z.ZodISODateTime;
209
+ lease_expires_at: z.ZodISODateTime;
210
+ accepted_at: z.ZodNullable<z.ZodISODateTime>;
211
+ attempt_id: z.ZodNullable<z.ZodString>;
212
+ simulation: z.ZodBoolean;
213
+ lease_token: z.ZodString;
214
+ endpoint: z.ZodEmail;
215
+ authority: z.ZodLiteral<"preparation_only">;
216
+ }, z.core.$strict>>;
217
+ exclusions: z.ZodArray<z.ZodObject<{
218
+ intent_id: z.ZodString;
219
+ code: z.ZodString;
220
+ }, z.core.$strict>>;
221
+ }, z.core.$strict>;
222
+ };
223
+ readonly startDirectoryAttempt: {
224
+ readonly input: z.ZodObject<{
225
+ id: z.ZodString;
226
+ lease_token: z.ZodString;
227
+ }, z.core.$strict>;
228
+ readonly output: z.ZodObject<{
229
+ id: z.ZodString;
230
+ action_id: z.ZodString;
231
+ provider: z.ZodString;
232
+ provider_idempotency_key: z.ZodString;
233
+ state: z.ZodEnum<{
234
+ unknown: "unknown";
235
+ invalidated: "invalidated";
236
+ reserved: "reserved";
237
+ dispatching: "dispatching";
238
+ accepted: "accepted";
239
+ delivered: "delivered";
240
+ rejected: "rejected";
241
+ }>;
242
+ started_at: z.ZodISODateTime;
243
+ replayed: z.ZodBoolean;
244
+ instruction: z.ZodEnum<{
245
+ execute_once: "execute_once";
246
+ reconcile_only: "reconcile_only";
247
+ }>;
248
+ simulation: z.ZodBoolean;
249
+ }, z.core.$strict>;
250
+ };
251
+ readonly getDirectoryAction: {
252
+ readonly input: z.ZodObject<{
253
+ id: z.ZodString;
254
+ }, z.core.$strict>;
255
+ readonly output: z.ZodObject<{
256
+ id: z.ZodString;
257
+ plan_id: z.ZodString;
258
+ intent_id: z.ZodString;
259
+ subject_id: z.ZodString;
260
+ state: z.ZodEnum<{
261
+ unknown: "unknown";
262
+ invalidated: "invalidated";
263
+ reserved: "reserved";
264
+ dispatching: "dispatching";
265
+ accepted: "accepted";
266
+ delivered: "delivered";
267
+ rejected: "rejected";
268
+ }>;
269
+ provider: z.ZodString;
270
+ provider_idempotency_key: z.ZodString;
271
+ created_at: z.ZodISODateTime;
272
+ valid_until: z.ZodISODateTime;
273
+ lease_expires_at: z.ZodISODateTime;
274
+ accepted_at: z.ZodNullable<z.ZodISODateTime>;
275
+ attempt_id: z.ZodNullable<z.ZodString>;
276
+ simulation: z.ZodBoolean;
277
+ }, z.core.$strict>;
278
+ };
279
+ readonly recordDirectoryActionOutcomes: {
280
+ readonly input: z.ZodObject<{
281
+ outcomes: z.ZodArray<z.ZodObject<{
282
+ event_id: z.ZodString;
283
+ action_id: z.ZodString;
284
+ attempt_id: z.ZodString;
285
+ provider: z.ZodString;
286
+ provider_event_id: z.ZodString;
287
+ outcome: z.ZodEnum<{
288
+ unknown: "unknown";
289
+ accepted: "accepted";
290
+ delivered: "delivered";
291
+ rejected: "rejected";
292
+ bounced: "bounced";
293
+ complained: "complained";
294
+ }>;
295
+ occurred_at: z.ZodISODateTime;
296
+ }, z.core.$strict>>;
297
+ }, z.core.$strict>;
298
+ readonly output: z.ZodObject<{
299
+ results: z.ZodArray<z.ZodObject<{
300
+ event_id: z.ZodString;
301
+ status: z.ZodEnum<{
302
+ accepted: "accepted";
303
+ rejected: "rejected";
304
+ duplicate: "duplicate";
305
+ }>;
306
+ code: z.ZodNullable<z.ZodString>;
307
+ }, z.core.$strict>>;
308
+ }, z.core.$strict>;
309
+ };
310
+ };
311
+ export type DirectoryExecutionPolicy = z.infer<typeof DirectoryExecutionPolicySchema>;
312
+ export type DirectoryAction = z.infer<typeof DirectoryActionSchema>;
313
+ export type DirectoryClaimInput = z.output<typeof DirectoryClaimRequest>;
314
+ export type DirectoryClaim = z.infer<typeof DirectoryClaimResponse>;
315
+ export type DirectoryStartInput = z.infer<typeof DirectoryStartRequest>;
316
+ export type DirectoryAttempt = z.infer<typeof DirectoryAttemptSchema>;
317
+ export type DirectoryOutcomeInput = z.infer<typeof DirectoryOutcomeRequest>;
318
+ export type DirectoryOutcomeResult = z.infer<typeof DirectoryOutcomeResponse>;
319
+ export type DirectorySalesDiscoveryInput = z.output<typeof DirectorySalesDiscoveryRequest>;
320
+ export type DirectorySalesDiscovery = z.infer<typeof DirectorySalesDiscoveryResponse>;
@@ -0,0 +1,122 @@
1
+ import { z } from 'zod';
2
+ const Id = z.string().min(1).max(256);
3
+ const Time = z.iso.datetime({ offset: true });
4
+ /** Separately provisioned authority. A recommendation policy never implicitly permits execution. */
5
+ export const DirectoryExecutionPolicySchema = z.strictObject({
6
+ reviewed: z.boolean(),
7
+ allowed_executor_ids: z.array(Id).min(1).max(100),
8
+ allowed_provider_ids: z.array(Id).min(1).max(20),
9
+ channel: z.literal('email'),
10
+ allowed_hours_utc: z.array(z.number().int().min(0).max(23)).min(1).max(24),
11
+ contact_cooldown_hours: z.number().int().min(1).max(8760),
12
+ max_actions_per_utc_day: z.number().int().min(1).max(30000),
13
+ preparation_lease_seconds: z.number().int().min(30).max(300),
14
+ });
15
+ export const DirectoryActionStateSchema = z.enum([
16
+ 'reserved',
17
+ 'dispatching',
18
+ 'unknown',
19
+ 'accepted',
20
+ 'delivered',
21
+ 'rejected',
22
+ 'invalidated',
23
+ ]);
24
+ export const DirectoryActionSchema = z.strictObject({
25
+ id: Id,
26
+ plan_id: Id,
27
+ intent_id: Id,
28
+ subject_id: Id,
29
+ state: DirectoryActionStateSchema,
30
+ provider: Id,
31
+ provider_idempotency_key: Id,
32
+ created_at: Time,
33
+ valid_until: Time,
34
+ lease_expires_at: Time,
35
+ accepted_at: Time.nullable(),
36
+ attempt_id: Id.nullable(),
37
+ simulation: z.boolean(),
38
+ });
39
+ export const DirectoryClaimRequest = z.strictObject({
40
+ plan_id: Id,
41
+ intent_ids: z
42
+ .array(Id)
43
+ .min(1)
44
+ .max(50)
45
+ .refine((ids) => new Set(ids).size === ids.length),
46
+ provider: Id,
47
+ });
48
+ export const DirectoryClaimResponse = z.strictObject({
49
+ plan_id: Id,
50
+ actions: z.array(DirectoryActionSchema.extend({
51
+ lease_token: z.string().min(32).max(256),
52
+ endpoint: z.email(),
53
+ authority: z.literal('preparation_only'),
54
+ })),
55
+ exclusions: z.array(z.strictObject({ intent_id: Id, code: Id })),
56
+ });
57
+ export const DirectoryStartRequest = z.strictObject({
58
+ id: Id,
59
+ lease_token: z.string().min(32).max(256),
60
+ });
61
+ export const DirectoryAttemptSchema = z.strictObject({
62
+ id: Id,
63
+ action_id: Id,
64
+ provider: Id,
65
+ provider_idempotency_key: Id,
66
+ state: DirectoryActionStateSchema,
67
+ started_at: Time,
68
+ replayed: z.boolean(),
69
+ instruction: z.enum(['execute_once', 'reconcile_only']),
70
+ simulation: z.boolean(),
71
+ });
72
+ export const DirectoryOutcomeRequest = z.strictObject({
73
+ outcomes: z
74
+ .array(z.strictObject({
75
+ event_id: Id,
76
+ action_id: Id,
77
+ attempt_id: Id,
78
+ provider: Id,
79
+ provider_event_id: Id,
80
+ outcome: z.enum(['accepted', 'delivered', 'rejected', 'unknown', 'bounced', 'complained']),
81
+ occurred_at: Time,
82
+ }))
83
+ .min(1)
84
+ .max(100),
85
+ });
86
+ export const DirectoryOutcomeResponse = z.strictObject({
87
+ results: z.array(z.strictObject({
88
+ event_id: Id,
89
+ status: z.enum(['accepted', 'duplicate', 'rejected']),
90
+ code: Id.nullable(),
91
+ })),
92
+ });
93
+ export const DirectorySalesDiscoveryRequest = z.strictObject({
94
+ dataset_id: Id,
95
+ profile_id: Id,
96
+ audience_id: Id,
97
+ cursor: z.string().min(1).max(4096).optional(),
98
+ limit: z.coerce.number().int().min(1).max(500).default(100),
99
+ });
100
+ export const DirectorySalesDiscoveryResponse = z.strictObject({
101
+ data: z.array(z.strictObject({
102
+ id: Id,
103
+ kind: z.enum(['professional', 'office', 'organization']),
104
+ revision: z.string(),
105
+ })),
106
+ next_cursor: z.string().nullable(),
107
+ selection_scope: z.literal('bounded_discovery_page'),
108
+ eligibility: z.literal('requires_plan_evaluation'),
109
+ });
110
+ export const directoryExecutionOperations = {
111
+ discoverDirectorySalesCandidates: {
112
+ input: DirectorySalesDiscoveryRequest,
113
+ output: DirectorySalesDiscoveryResponse,
114
+ },
115
+ claimDirectoryActions: { input: DirectoryClaimRequest, output: DirectoryClaimResponse },
116
+ startDirectoryAttempt: { input: DirectoryStartRequest, output: DirectoryAttemptSchema },
117
+ getDirectoryAction: { input: z.strictObject({ id: Id }), output: DirectoryActionSchema },
118
+ recordDirectoryActionOutcomes: {
119
+ input: DirectoryOutcomeRequest,
120
+ output: DirectoryOutcomeResponse,
121
+ },
122
+ };