@propertysimple/client 0.1.0 → 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 (41) hide show
  1. package/API.md +27 -73
  2. package/README.md +200 -57
  3. package/client/src/index.d.ts +257 -2422
  4. package/client/src/index.js +6 -69
  5. package/contracts/src/index.d.ts +0 -7
  6. package/contracts/src/index.js +0 -7
  7. package/contracts/src/openapi.js +1 -1
  8. package/contracts/src/operations.d.ts +950 -4678
  9. package/contracts/src/operations.js +6 -36
  10. package/contracts/src/opportunity-events.d.ts +2 -1
  11. package/contracts/src/opportunity-events.js +6 -1
  12. package/contracts/src/property-features.d.ts +2 -2
  13. package/contracts/src/property-features.js +62 -19
  14. package/contracts/src/routes.d.ts +28 -305
  15. package/contracts/src/routes.js +82 -354
  16. package/contracts/src/schemas.d.ts +1114 -1355
  17. package/contracts/src/schemas.js +45 -223
  18. package/contracts/src/search.d.ts +1366 -253
  19. package/contracts/src/search.js +117 -2
  20. package/openapi.json +19288 -38596
  21. package/package.json +1 -9
  22. package/client/src/directory-sync.d.ts +0 -123
  23. package/client/src/directory-sync.js +0 -404
  24. package/client/src/managed-sync.d.ts +0 -129
  25. package/client/src/managed-sync.js +0 -410
  26. package/contracts/src/directory-execution.d.ts +0 -320
  27. package/contracts/src/directory-execution.js +0 -122
  28. package/contracts/src/directory-identity.d.ts +0 -1255
  29. package/contracts/src/directory-identity.js +0 -129
  30. package/contracts/src/directory-sales.d.ts +0 -333
  31. package/contracts/src/directory-sales.js +0 -102
  32. package/contracts/src/directory.d.ts +0 -1088
  33. package/contracts/src/directory.js +0 -179
  34. package/contracts/src/intelligence.d.ts +0 -366
  35. package/contracts/src/intelligence.js +0 -157
  36. package/contracts/src/professional-intelligence.d.ts +0 -256
  37. package/contracts/src/professional-intelligence.js +0 -90
  38. package/contracts/src/publication.d.ts +0 -44
  39. package/contracts/src/publication.js +0 -42
  40. package/contracts/src/smart-feed.d.ts +0 -3731
  41. package/contracts/src/smart-feed.js +0 -109
@@ -1,109 +0,0 @@
1
- import { z } from 'zod';
2
- import { ListingSchema, CatalogSourceFreshnessSchema } from './schemas.js';
3
- import { DirectoryEntitySchema, DirectoryRelationshipSchema } from './directory.js';
4
- import { DirectoryIdentityResolutionSchema } from './directory-identity.js';
5
- const Id = z.string().min(1).max(256);
6
- const Sequence = z.string().regex(/^\d+$/);
7
- const Time = z.iso.datetime({ offset: true });
8
- const Page = {
9
- cursor: z.string().min(1).max(4096).optional(),
10
- limit: z.coerce.number().int().min(1).max(200).default(100),
11
- };
12
- /** The selector is immutable for the lifetime of a snapshot/replay stream. */
13
- export const SmartFeedSelectorSchema = z.strictObject({
14
- mode: z.enum(['directory', 'combined']).default('directory'),
15
- party_id: Id.optional(),
16
- inventory_basis: z.literal('listing_representation').default('listing_representation'),
17
- });
18
- export const SmartFeedResourceSchema = z
19
- .discriminatedUnion('resource_type', [
20
- z.strictObject({
21
- resource_type: z.literal('identity_resolution'),
22
- resource_id: Id,
23
- revision: Sequence,
24
- payload: z.lazy(() => DirectoryIdentityResolutionSchema),
25
- }),
26
- z.strictObject({
27
- resource_type: z.literal('listing'),
28
- resource_id: Id,
29
- revision: Sequence,
30
- payload: z.lazy(() => ListingSchema),
31
- }),
32
- z.strictObject({
33
- resource_type: z.literal('entity'),
34
- resource_id: Id,
35
- revision: Sequence,
36
- payload: z.lazy(() => DirectoryEntitySchema),
37
- }),
38
- z.strictObject({
39
- resource_type: z.literal('relationship'),
40
- resource_id: Id,
41
- revision: Sequence,
42
- payload: z.lazy(() => DirectoryRelationshipSchema),
43
- }),
44
- ])
45
- .superRefine((resource, context) => {
46
- if (resource.payload.id !== resource.resource_id ||
47
- resource.payload.revision !== resource.revision)
48
- context.addIssue({
49
- code: 'custom',
50
- message: 'Resource envelope must match payload identity and revision.',
51
- });
52
- });
53
- export const SmartFeedChangeSchema = z.strictObject({
54
- sequence: Sequence,
55
- group_id: Id,
56
- group_end_sequence: Sequence,
57
- group_index: z.number().int().min(0),
58
- group_size: z.number().int().positive(),
59
- resource_type: z.enum(['listing', 'entity', 'relationship', 'identity_resolution']),
60
- resource_id: Id,
61
- revision: Sequence,
62
- operation: z.enum(['upsert', 'remove']),
63
- resource: SmartFeedResourceSchema.nullable(),
64
- });
65
- export const SmartFeedSnapshotSchema = z.strictObject({
66
- id: Id,
67
- dataset_id: Id,
68
- status: z.enum(['ready', 'expired']),
69
- schema_version: z.literal('smart-feed-v2'),
70
- selector: SmartFeedSelectorSchema,
71
- entitlement_fingerprint: z.string(),
72
- snapshot_sequence: Sequence,
73
- replay_cursor: z.string(),
74
- created_at: Time,
75
- expires_at: Time,
76
- });
77
- export const SmartFeedSnapshotPageSchema = z.strictObject({
78
- data: z.array(SmartFeedResourceSchema),
79
- has_more: z.boolean(),
80
- next_cursor: z.string().nullable(),
81
- meta: z.strictObject({
82
- snapshot_sequence: Sequence,
83
- source_freshness: z.array(z.lazy(() => CatalogSourceFreshnessSchema)),
84
- }),
85
- });
86
- export const SmartFeedChangesSchema = z.strictObject({
87
- data: z.array(SmartFeedChangeSchema),
88
- has_more: z.boolean(),
89
- next_cursor: z.string(),
90
- meta: z.strictObject({
91
- published_sequence: Sequence,
92
- source_freshness: z.array(z.lazy(() => CatalogSourceFreshnessSchema)),
93
- }),
94
- });
95
- export const smartFeedOperations = {
96
- createDirectorySnapshot: {
97
- input: z.strictObject({ dataset_id: Id, ...SmartFeedSelectorSchema.shape }),
98
- output: SmartFeedSnapshotSchema,
99
- },
100
- getDirectorySnapshot: { input: z.strictObject({ id: Id }), output: SmartFeedSnapshotSchema },
101
- listDirectorySnapshotItems: {
102
- input: z.strictObject({ id: Id, ...Page }),
103
- output: SmartFeedSnapshotPageSchema,
104
- },
105
- listDirectoryChanges: {
106
- input: z.strictObject({ dataset_id: Id, ...SmartFeedSelectorSchema.shape, ...Page }),
107
- output: SmartFeedChangesSchema,
108
- },
109
- };