@collective-intelligence/external-apps-server-sdk 0.1.9 → 0.1.10

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.
@@ -65,13 +65,21 @@ export type ResourceDefinition<Entity, Create = Entity, Update = Partial<Entity>
65
65
  }>;
66
66
  }>;
67
67
  export type FilterValue = ResourceJsonValue | readonly ResourceJsonValue[];
68
+ /**
69
+ * A filter predicate. `field` names a declared filterable field, or a path
70
+ * through at most three fields that hold Entity References to a field of
71
+ * the last target, such as `company.industry` or
72
+ * `contacts.company.parent.industry`. On a field that holds Entity
73
+ * References, `is_empty` means no reference, and `contains_any` and
74
+ * `contains_all` compare the ids of a field that holds many.
75
+ */
68
76
  export type ResourceFilter = Readonly<{
69
77
  field: string;
70
- operator: "contains" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
78
+ operator: "contains" | "contains_all" | "contains_any" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
71
79
  value: FilterValue;
72
80
  }> | Readonly<{
73
81
  field: string;
74
- operator: "is_not_null" | "is_null";
82
+ operator: "is_empty" | "is_not_null" | "is_null";
75
83
  }> | Readonly<{
76
84
  filters: readonly ResourceFilter[];
77
85
  operator: "and" | "or";
@@ -94,6 +102,11 @@ export type ResourcePagination = Readonly<{
94
102
  }>;
95
103
  export type ResourceListQuery = Readonly<{
96
104
  filter?: ResourceFilter;
105
+ /**
106
+ * Include Paths, such as `["company", "contacts.company"]`: relation
107
+ * fields whose records each item carries in `included`.
108
+ */
109
+ include?: readonly string[];
97
110
  includeDeleted?: boolean;
98
111
  pagination: ResourcePagination;
99
112
  sort?: readonly ResourceSort[];
@@ -102,7 +115,15 @@ export type ResourceListQuery = Readonly<{
102
115
  export type ResourceRecord<Entity> = Readonly<{
103
116
  deletedAt?: string;
104
117
  id: ResourceRecordId;
118
+ /**
119
+ * The records of the read's Include Paths by relation field key: one
120
+ * record, or the records of a `many` field in reference order. Untyped:
121
+ * the target schemas are CI's.
122
+ */
123
+ included?: Readonly<Record<string, ResourceJsonValue>>;
105
124
  revision: ResourceRevision;
125
+ /** The keys whose included records were cut to the first 100. */
126
+ truncated?: readonly string[];
106
127
  value: Entity;
107
128
  }>;
108
129
  export type ResourceErrorCode = "capability_not_supported" | "conflict" | "forbidden" | "internal" | "invalid_request" | "not_found" | "rate_limited" | "transport_error" | "unauthenticated" | "unavailable" |
@@ -65,13 +65,21 @@ export type ResourceDefinition<Entity, Create = Entity, Update = Partial<Entity>
65
65
  }>;
66
66
  }>;
67
67
  export type FilterValue = ResourceJsonValue | readonly ResourceJsonValue[];
68
+ /**
69
+ * A filter predicate. `field` names a declared filterable field, or a path
70
+ * through at most three fields that hold Entity References to a field of
71
+ * the last target, such as `company.industry` or
72
+ * `contacts.company.parent.industry`. On a field that holds Entity
73
+ * References, `is_empty` means no reference, and `contains_any` and
74
+ * `contains_all` compare the ids of a field that holds many.
75
+ */
68
76
  export type ResourceFilter = Readonly<{
69
77
  field: string;
70
- operator: "contains" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
78
+ operator: "contains" | "contains_all" | "contains_any" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
71
79
  value: FilterValue;
72
80
  }> | Readonly<{
73
81
  field: string;
74
- operator: "is_not_null" | "is_null";
82
+ operator: "is_empty" | "is_not_null" | "is_null";
75
83
  }> | Readonly<{
76
84
  filters: readonly ResourceFilter[];
77
85
  operator: "and" | "or";
@@ -94,6 +102,11 @@ export type ResourcePagination = Readonly<{
94
102
  }>;
95
103
  export type ResourceListQuery = Readonly<{
96
104
  filter?: ResourceFilter;
105
+ /**
106
+ * Include Paths, such as `["company", "contacts.company"]`: relation
107
+ * fields whose records each item carries in `included`.
108
+ */
109
+ include?: readonly string[];
97
110
  includeDeleted?: boolean;
98
111
  pagination: ResourcePagination;
99
112
  sort?: readonly ResourceSort[];
@@ -102,7 +115,15 @@ export type ResourceListQuery = Readonly<{
102
115
  export type ResourceRecord<Entity> = Readonly<{
103
116
  deletedAt?: string;
104
117
  id: ResourceRecordId;
118
+ /**
119
+ * The records of the read's Include Paths by relation field key: one
120
+ * record, or the records of a `many` field in reference order. Untyped:
121
+ * the target schemas are CI's.
122
+ */
123
+ included?: Readonly<Record<string, ResourceJsonValue>>;
105
124
  revision: ResourceRevision;
125
+ /** The keys whose included records were cut to the first 100. */
126
+ truncated?: readonly string[];
106
127
  value: Entity;
107
128
  }>;
108
129
  export type ResourceErrorCode = "capability_not_supported" | "conflict" | "forbidden" | "internal" | "invalid_request" | "not_found" | "rate_limited" | "transport_error" | "unauthenticated" | "unavailable" |
@@ -102,13 +102,21 @@ export type ResourceDefinition<Entity, Create = Entity, Update = Partial<Entity>
102
102
  }>;
103
103
  }>;
104
104
  export type FilterValue = ResourceJsonValue | readonly ResourceJsonValue[];
105
+ /**
106
+ * A filter predicate. `field` names a declared filterable field, or a path
107
+ * through at most three fields that hold Entity References to a field of
108
+ * the last target, such as `company.industry` or
109
+ * `contacts.company.parent.industry`. On a field that holds Entity
110
+ * References, `is_empty` means no reference, and `contains_any` and
111
+ * `contains_all` compare the ids of a field that holds many.
112
+ */
105
113
  export type ResourceFilter = Readonly<{
106
114
  field: string;
107
- operator: "contains" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
115
+ operator: "contains" | "contains_all" | "contains_any" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
108
116
  value: FilterValue;
109
117
  }> | Readonly<{
110
118
  field: string;
111
- operator: "is_not_null" | "is_null";
119
+ operator: "is_empty" | "is_not_null" | "is_null";
112
120
  }> | Readonly<{
113
121
  filters: readonly ResourceFilter[];
114
122
  operator: "and" | "or";
@@ -131,6 +139,11 @@ export type ResourcePagination = Readonly<{
131
139
  }>;
132
140
  export type ResourceListQuery = Readonly<{
133
141
  filter?: ResourceFilter;
142
+ /**
143
+ * Include Paths, such as `["company", "contacts.company"]`: relation
144
+ * fields whose records each item carries in `included`.
145
+ */
146
+ include?: readonly string[];
134
147
  includeDeleted?: boolean;
135
148
  pagination: ResourcePagination;
136
149
  sort?: readonly ResourceSort[];
@@ -139,7 +152,15 @@ export type ResourceListQuery = Readonly<{
139
152
  export type ResourceRecord<Entity> = Readonly<{
140
153
  deletedAt?: string;
141
154
  id: ResourceRecordId;
155
+ /**
156
+ * The records of the read's Include Paths by relation field key: one
157
+ * record, or the records of a `many` field in reference order. Untyped:
158
+ * the target schemas are CI's.
159
+ */
160
+ included?: Readonly<Record<string, ResourceJsonValue>>;
142
161
  revision: ResourceRevision;
162
+ /** The keys whose included records were cut to the first 100. */
163
+ truncated?: readonly string[];
143
164
  value: Entity;
144
165
  }>;
145
166
  export type ResourceListResult<Entity> = Readonly<{
@@ -653,7 +674,9 @@ declare const definePlatformTables: (options?: PlatformTablesOptions) => {
653
674
  result: import("drizzle-orm/pg-core").PgBuildColumn<"resource_idempotency", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Readonly<{
654
675
  deletedAt?: string;
655
676
  id: ResourceRecordId;
677
+ included?: Readonly<Record<string, ResourceJsonValue>>;
656
678
  revision: ResourceRevision;
679
+ truncated?: readonly string[];
657
680
  value: unknown;
658
681
  }>>>, {
659
682
  name: string;
@@ -662,7 +685,9 @@ declare const definePlatformTables: (options?: PlatformTablesOptions) => {
662
685
  data: Readonly<{
663
686
  deletedAt?: string;
664
687
  id: ResourceRecordId;
688
+ included?: Readonly<Record<string, ResourceJsonValue>>;
665
689
  revision: ResourceRevision;
690
+ truncated?: readonly string[];
666
691
  value: unknown;
667
692
  }>;
668
693
  driverParam: unknown;
@@ -893,7 +918,9 @@ declare const makePlatformPersistence: (options: PlatformPersistenceOptions) =>
893
918
  result: import("drizzle-orm/pg-core").PgBuildColumn<"resource_idempotency", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Readonly<{
894
919
  deletedAt?: string;
895
920
  id: ResourceRecordId;
921
+ included?: Readonly<Record<string, ResourceJsonValue>>;
896
922
  revision: ResourceRevision;
923
+ truncated?: readonly string[];
897
924
  value: unknown;
898
925
  }>>>, {
899
926
  name: string;
@@ -902,7 +929,9 @@ declare const makePlatformPersistence: (options: PlatformPersistenceOptions) =>
902
929
  data: Readonly<{
903
930
  deletedAt?: string;
904
931
  id: ResourceRecordId;
932
+ included?: Readonly<Record<string, ResourceJsonValue>>;
905
933
  revision: ResourceRevision;
934
+ truncated?: readonly string[];
906
935
  value: unknown;
907
936
  }>;
908
937
  driverParam: unknown;
@@ -1320,7 +1349,9 @@ declare const definePlatformTables$1: (options?: PlatformTablesOptions) => {
1320
1349
  result: import("drizzle-orm/pg-core").PgBuildColumn<"resource_idempotency", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Readonly<{
1321
1350
  deletedAt?: string;
1322
1351
  id: ResourceRecordId;
1352
+ included?: Readonly<Record<string, ResourceJsonValue>>;
1323
1353
  revision: ResourceRevision;
1354
+ truncated?: readonly string[];
1324
1355
  value: unknown;
1325
1356
  }>>>, {
1326
1357
  name: string;
@@ -1329,7 +1360,9 @@ declare const definePlatformTables$1: (options?: PlatformTablesOptions) => {
1329
1360
  data: Readonly<{
1330
1361
  deletedAt?: string;
1331
1362
  id: ResourceRecordId;
1363
+ included?: Readonly<Record<string, ResourceJsonValue>>;
1332
1364
  revision: ResourceRevision;
1365
+ truncated?: readonly string[];
1333
1366
  value: unknown;
1334
1367
  }>;
1335
1368
  driverParam: unknown;
@@ -1482,7 +1515,9 @@ declare const makePlatformPersistence$1: (options: PlatformPersistenceOptions) =
1482
1515
  result: import("drizzle-orm/pg-core").PgBuildColumn<"resource_idempotency", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Readonly<{
1483
1516
  deletedAt?: string;
1484
1517
  id: ResourceRecordId;
1518
+ included?: Readonly<Record<string, ResourceJsonValue>>;
1485
1519
  revision: ResourceRevision;
1520
+ truncated?: readonly string[];
1486
1521
  value: unknown;
1487
1522
  }>>>, {
1488
1523
  name: string;
@@ -1491,7 +1526,9 @@ declare const makePlatformPersistence$1: (options: PlatformPersistenceOptions) =
1491
1526
  data: Readonly<{
1492
1527
  deletedAt?: string;
1493
1528
  id: ResourceRecordId;
1529
+ included?: Readonly<Record<string, ResourceJsonValue>>;
1494
1530
  revision: ResourceRevision;
1531
+ truncated?: readonly string[];
1495
1532
  value: unknown;
1496
1533
  }>;
1497
1534
  driverParam: unknown;