@apideck/unify 0.20.0 → 0.20.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 (57) hide show
  1. package/docs/sdks/connections/README.md +190 -42
  2. package/docs/sdks/connectionsettings/README.md +190 -42
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +4 -4
  5. package/lib/config.js +4 -4
  6. package/lib/security.d.ts +4 -3
  7. package/lib/security.d.ts.map +1 -1
  8. package/lib/security.js +6 -1
  9. package/lib/security.js.map +1 -1
  10. package/models/components/address.d.ts +8 -8
  11. package/models/components/address.d.ts.map +1 -1
  12. package/models/components/address.js +13 -14
  13. package/models/components/address.js.map +1 -1
  14. package/models/components/connectionimportdata.d.ts +15 -15
  15. package/models/components/connectionimportdata.d.ts.map +1 -1
  16. package/models/components/connectionimportdata.js +18 -19
  17. package/models/components/connectionimportdata.js.map +1 -1
  18. package/models/components/consumerconnection.d.ts +6 -26
  19. package/models/components/consumerconnection.d.ts.map +1 -1
  20. package/models/components/consumerconnection.js +3 -26
  21. package/models/components/consumerconnection.js.map +1 -1
  22. package/models/components/contact.d.ts +9 -9
  23. package/models/components/contact.d.ts.map +1 -1
  24. package/models/components/contact.js +16 -15
  25. package/models/components/contact.js.map +1 -1
  26. package/models/components/employee.d.ts +5 -0
  27. package/models/components/employee.d.ts.map +1 -1
  28. package/models/components/employee.js +4 -0
  29. package/models/components/employee.js.map +1 -1
  30. package/models/components/employeesfilter.d.ts +5 -0
  31. package/models/components/employeesfilter.d.ts.map +1 -1
  32. package/models/components/employeesfilter.js +2 -0
  33. package/models/components/employeesfilter.js.map +1 -1
  34. package/models/components/formfieldoption.d.ts +10 -2
  35. package/models/components/formfieldoption.d.ts.map +1 -1
  36. package/models/components/formfieldoption.js +12 -4
  37. package/models/components/formfieldoption.js.map +1 -1
  38. package/models/components/formfieldoptiongroup.d.ts +29 -4
  39. package/models/components/formfieldoptiongroup.d.ts.map +1 -1
  40. package/models/components/formfieldoptiongroup.js +34 -5
  41. package/models/components/formfieldoptiongroup.js.map +1 -1
  42. package/models/components/simpleformfieldoption.d.ts +27 -2
  43. package/models/components/simpleformfieldoption.d.ts.map +1 -1
  44. package/models/components/simpleformfieldoption.js +33 -3
  45. package/models/components/simpleformfieldoption.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/lib/config.ts +4 -4
  48. package/src/lib/security.ts +11 -3
  49. package/src/models/components/address.ts +15 -14
  50. package/src/models/components/connectionimportdata.ts +24 -33
  51. package/src/models/components/consumerconnection.ts +4 -53
  52. package/src/models/components/contact.ts +17 -18
  53. package/src/models/components/employee.ts +9 -0
  54. package/src/models/components/employeesfilter.ts +7 -0
  55. package/src/models/components/formfieldoption.ts +25 -7
  56. package/src/models/components/formfieldoptiongroup.ts +50 -8
  57. package/src/models/components/simpleformfieldoption.ts +42 -4
@@ -60,7 +60,7 @@ import {
60
60
  /**
61
61
  * The type of the contact.
62
62
  */
63
- export const Type = {
63
+ export const ContactType = {
64
64
  Customer: "customer",
65
65
  Supplier: "supplier",
66
66
  Employee: "employee",
@@ -69,7 +69,7 @@ export const Type = {
69
69
  /**
70
70
  * The type of the contact.
71
71
  */
72
- export type Type = ClosedEnum<typeof Type>;
72
+ export type ContactType = ClosedEnum<typeof ContactType>;
73
73
 
74
74
  /**
75
75
  * The gender of the contact.
@@ -100,7 +100,7 @@ export type Contact = {
100
100
  /**
101
101
  * The type of the contact.
102
102
  */
103
- type?: Type | null | undefined;
103
+ type?: ContactType | null | undefined;
104
104
  /**
105
105
  * The company the contact is associated with.
106
106
  */
@@ -239,7 +239,7 @@ export type ContactInput = {
239
239
  /**
240
240
  * The type of the contact.
241
241
  */
242
- type?: Type | null | undefined;
242
+ type?: ContactType | null | undefined;
243
243
  /**
244
244
  * The company the contact is associated with.
245
245
  */
@@ -343,23 +343,22 @@ export type ContactInput = {
343
343
  };
344
344
 
345
345
  /** @internal */
346
- export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
347
- Type,
348
- );
346
+ export const ContactType$inboundSchema: z.ZodNativeEnum<typeof ContactType> = z
347
+ .nativeEnum(ContactType);
349
348
 
350
349
  /** @internal */
351
- export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
352
- Type$inboundSchema;
350
+ export const ContactType$outboundSchema: z.ZodNativeEnum<typeof ContactType> =
351
+ ContactType$inboundSchema;
353
352
 
354
353
  /**
355
354
  * @internal
356
355
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
357
356
  */
358
- export namespace Type$ {
359
- /** @deprecated use `Type$inboundSchema` instead. */
360
- export const inboundSchema = Type$inboundSchema;
361
- /** @deprecated use `Type$outboundSchema` instead. */
362
- export const outboundSchema = Type$outboundSchema;
357
+ export namespace ContactType$ {
358
+ /** @deprecated use `ContactType$inboundSchema` instead. */
359
+ export const inboundSchema = ContactType$inboundSchema;
360
+ /** @deprecated use `ContactType$outboundSchema` instead. */
361
+ export const outboundSchema = ContactType$outboundSchema;
363
362
  }
364
363
 
365
364
  /** @internal */
@@ -389,7 +388,7 @@ export const Contact$inboundSchema: z.ZodType<Contact, z.ZodTypeDef, unknown> =
389
388
  id: z.string().optional(),
390
389
  name: z.nullable(z.string()),
391
390
  owner_id: z.nullable(z.string()).optional(),
392
- type: z.nullable(Type$inboundSchema).optional(),
391
+ type: z.nullable(ContactType$inboundSchema).optional(),
393
392
  company_id: z.nullable(z.string()).optional(),
394
393
  company_name: z.nullable(z.string()).optional(),
395
394
  lead_id: z.nullable(z.string()).optional(),
@@ -518,7 +517,7 @@ export const Contact$outboundSchema: z.ZodType<
518
517
  id: z.string().optional(),
519
518
  name: z.nullable(z.string()),
520
519
  ownerId: z.nullable(z.string()).optional(),
521
- type: z.nullable(Type$outboundSchema).optional(),
520
+ type: z.nullable(ContactType$outboundSchema).optional(),
522
521
  companyId: z.nullable(z.string()).optional(),
523
522
  companyName: z.nullable(z.string()).optional(),
524
523
  leadId: z.nullable(z.string()).optional(),
@@ -619,7 +618,7 @@ export const ContactInput$inboundSchema: z.ZodType<
619
618
  > = z.object({
620
619
  name: z.nullable(z.string()),
621
620
  owner_id: z.nullable(z.string()).optional(),
622
- type: z.nullable(Type$inboundSchema).optional(),
621
+ type: z.nullable(ContactType$inboundSchema).optional(),
623
622
  company_id: z.nullable(z.string()).optional(),
624
623
  company_name: z.nullable(z.string()).optional(),
625
624
  lead_id: z.nullable(z.string()).optional(),
@@ -718,7 +717,7 @@ export const ContactInput$outboundSchema: z.ZodType<
718
717
  > = z.object({
719
718
  name: z.nullable(z.string()),
720
719
  ownerId: z.nullable(z.string()).optional(),
721
- type: z.nullable(Type$outboundSchema).optional(),
720
+ type: z.nullable(ContactType$outboundSchema).optional(),
722
721
  companyId: z.nullable(z.string()).optional(),
723
722
  companyName: z.nullable(z.string()).optional(),
724
723
  leadId: z.nullable(z.string()).optional(),
@@ -205,6 +205,10 @@ export type Employee = {
205
205
  * A unique identifier for an object.
206
206
  */
207
207
  id?: string | null | undefined;
208
+ /**
209
+ * The third-party API ID of original entity
210
+ */
211
+ downstreamId?: string | null | undefined;
208
212
  /**
209
213
  * The first name of the person.
210
214
  */
@@ -882,6 +886,7 @@ export const Employee$inboundSchema: z.ZodType<
882
886
  unknown
883
887
  > = z.object({
884
888
  id: z.nullable(z.string()).optional(),
889
+ downstream_id: z.nullable(z.string()).optional(),
885
890
  first_name: z.nullable(z.string()).optional(),
886
891
  last_name: z.nullable(z.string()).optional(),
887
892
  middle_name: z.nullable(z.string()).optional(),
@@ -954,6 +959,7 @@ export const Employee$inboundSchema: z.ZodType<
954
959
  pass_through: z.array(PassThroughBody$inboundSchema).optional(),
955
960
  }).transform((v) => {
956
961
  return remap$(v, {
962
+ "downstream_id": "downstreamId",
957
963
  "first_name": "firstName",
958
964
  "last_name": "lastName",
959
965
  "middle_name": "middleName",
@@ -1002,6 +1008,7 @@ export const Employee$inboundSchema: z.ZodType<
1002
1008
  /** @internal */
1003
1009
  export type Employee$Outbound = {
1004
1010
  id?: string | null | undefined;
1011
+ downstream_id?: string | null | undefined;
1005
1012
  first_name?: string | null | undefined;
1006
1013
  last_name?: string | null | undefined;
1007
1014
  middle_name?: string | null | undefined;
@@ -1076,6 +1083,7 @@ export const Employee$outboundSchema: z.ZodType<
1076
1083
  Employee
1077
1084
  > = z.object({
1078
1085
  id: z.nullable(z.string()).optional(),
1086
+ downstreamId: z.nullable(z.string()).optional(),
1079
1087
  firstName: z.nullable(z.string()).optional(),
1080
1088
  lastName: z.nullable(z.string()).optional(),
1081
1089
  middleName: z.nullable(z.string()).optional(),
@@ -1146,6 +1154,7 @@ export const Employee$outboundSchema: z.ZodType<
1146
1154
  passThrough: z.array(PassThroughBody$outboundSchema).optional(),
1147
1155
  }).transform((v) => {
1148
1156
  return remap$(v, {
1157
+ downstreamId: "downstream_id",
1149
1158
  firstName: "first_name",
1150
1159
  lastName: "last_name",
1151
1160
  middleName: "middle_name",
@@ -62,6 +62,10 @@ export type EmployeesFilter = {
62
62
  * ID of the department to filter on
63
63
  */
64
64
  departmentId?: string | undefined;
65
+ /**
66
+ * City to filter on
67
+ */
68
+ city?: string | undefined;
65
69
  };
66
70
 
67
71
  /** @internal */
@@ -100,6 +104,7 @@ export const EmployeesFilter$inboundSchema: z.ZodType<
100
104
  employment_status: EmployeesFilterEmploymentStatus$inboundSchema.optional(),
101
105
  employee_number: z.string().optional(),
102
106
  department_id: z.string().optional(),
107
+ city: z.string().optional(),
103
108
  }).transform((v) => {
104
109
  return remap$(v, {
105
110
  "company_id": "companyId",
@@ -123,6 +128,7 @@ export type EmployeesFilter$Outbound = {
123
128
  employment_status?: string | undefined;
124
129
  employee_number?: string | undefined;
125
130
  department_id?: string | undefined;
131
+ city?: string | undefined;
126
132
  };
127
133
 
128
134
  /** @internal */
@@ -140,6 +146,7 @@ export const EmployeesFilter$outboundSchema: z.ZodType<
140
146
  employmentStatus: EmployeesFilterEmploymentStatus$outboundSchema.optional(),
141
147
  employeeNumber: z.string().optional(),
142
148
  departmentId: z.string().optional(),
149
+ city: z.string().optional(),
143
150
  }).transform((v) => {
144
151
  return remap$(v, {
145
152
  companyId: "company_id",
@@ -19,7 +19,9 @@ import {
19
19
  SimpleFormFieldOption$outboundSchema,
20
20
  } from "./simpleformfieldoption.js";
21
21
 
22
- export type FormFieldOption = SimpleFormFieldOption | FormFieldOptionGroup;
22
+ export type FormFieldOption =
23
+ | (SimpleFormFieldOption & { optionType: "simple" })
24
+ | (FormFieldOptionGroup & { optionType: "group" });
23
25
 
24
26
  /** @internal */
25
27
  export const FormFieldOption$inboundSchema: z.ZodType<
@@ -27,14 +29,22 @@ export const FormFieldOption$inboundSchema: z.ZodType<
27
29
  z.ZodTypeDef,
28
30
  unknown
29
31
  > = z.union([
30
- SimpleFormFieldOption$inboundSchema,
31
- FormFieldOptionGroup$inboundSchema,
32
+ SimpleFormFieldOption$inboundSchema.and(
33
+ z.object({ option_type: z.literal("simple") }).transform((v) => ({
34
+ optionType: v.option_type,
35
+ })),
36
+ ),
37
+ FormFieldOptionGroup$inboundSchema.and(
38
+ z.object({ option_type: z.literal("group") }).transform((v) => ({
39
+ optionType: v.option_type,
40
+ })),
41
+ ),
32
42
  ]);
33
43
 
34
44
  /** @internal */
35
45
  export type FormFieldOption$Outbound =
36
- | SimpleFormFieldOption$Outbound
37
- | FormFieldOptionGroup$Outbound;
46
+ | (SimpleFormFieldOption$Outbound & { option_type: "simple" })
47
+ | (FormFieldOptionGroup$Outbound & { option_type: "group" });
38
48
 
39
49
  /** @internal */
40
50
  export const FormFieldOption$outboundSchema: z.ZodType<
@@ -42,8 +52,16 @@ export const FormFieldOption$outboundSchema: z.ZodType<
42
52
  z.ZodTypeDef,
43
53
  FormFieldOption
44
54
  > = z.union([
45
- SimpleFormFieldOption$outboundSchema,
46
- FormFieldOptionGroup$outboundSchema,
55
+ SimpleFormFieldOption$outboundSchema.and(
56
+ z.object({ optionType: z.literal("simple") }).transform((v) => ({
57
+ option_type: v.optionType,
58
+ })),
59
+ ),
60
+ FormFieldOptionGroup$outboundSchema.and(
61
+ z.object({ optionType: z.literal("group") }).transform((v) => ({
62
+ option_type: v.optionType,
63
+ })),
64
+ ),
47
65
  ]);
48
66
 
49
67
  /**
@@ -3,7 +3,9 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
7
9
  import { Result as SafeParseResult } from "../../types/fp.js";
8
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
11
  import {
@@ -13,12 +15,41 @@ import {
13
15
  SimpleFormFieldOption$outboundSchema,
14
16
  } from "./simpleformfieldoption.js";
15
17
 
18
+ export const FormFieldOptionGroupOptionType = {
19
+ Group: "group",
20
+ } as const;
21
+ export type FormFieldOptionGroupOptionType = ClosedEnum<
22
+ typeof FormFieldOptionGroupOptionType
23
+ >;
24
+
16
25
  export type FormFieldOptionGroup = {
17
26
  id?: string | undefined;
18
- label?: string | undefined;
19
- options?: Array<SimpleFormFieldOption> | undefined;
27
+ label: string;
28
+ options: Array<SimpleFormFieldOption>;
29
+ optionType: FormFieldOptionGroupOptionType;
20
30
  };
21
31
 
32
+ /** @internal */
33
+ export const FormFieldOptionGroupOptionType$inboundSchema: z.ZodNativeEnum<
34
+ typeof FormFieldOptionGroupOptionType
35
+ > = z.nativeEnum(FormFieldOptionGroupOptionType);
36
+
37
+ /** @internal */
38
+ export const FormFieldOptionGroupOptionType$outboundSchema: z.ZodNativeEnum<
39
+ typeof FormFieldOptionGroupOptionType
40
+ > = FormFieldOptionGroupOptionType$inboundSchema;
41
+
42
+ /**
43
+ * @internal
44
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
45
+ */
46
+ export namespace FormFieldOptionGroupOptionType$ {
47
+ /** @deprecated use `FormFieldOptionGroupOptionType$inboundSchema` instead. */
48
+ export const inboundSchema = FormFieldOptionGroupOptionType$inboundSchema;
49
+ /** @deprecated use `FormFieldOptionGroupOptionType$outboundSchema` instead. */
50
+ export const outboundSchema = FormFieldOptionGroupOptionType$outboundSchema;
51
+ }
52
+
22
53
  /** @internal */
23
54
  export const FormFieldOptionGroup$inboundSchema: z.ZodType<
24
55
  FormFieldOptionGroup,
@@ -26,15 +57,21 @@ export const FormFieldOptionGroup$inboundSchema: z.ZodType<
26
57
  unknown
27
58
  > = z.object({
28
59
  id: z.string().optional(),
29
- label: z.string().optional(),
30
- options: z.array(SimpleFormFieldOption$inboundSchema).optional(),
60
+ label: z.string(),
61
+ options: z.array(SimpleFormFieldOption$inboundSchema),
62
+ option_type: FormFieldOptionGroupOptionType$inboundSchema,
63
+ }).transform((v) => {
64
+ return remap$(v, {
65
+ "option_type": "optionType",
66
+ });
31
67
  });
32
68
 
33
69
  /** @internal */
34
70
  export type FormFieldOptionGroup$Outbound = {
35
71
  id?: string | undefined;
36
- label?: string | undefined;
37
- options?: Array<SimpleFormFieldOption$Outbound> | undefined;
72
+ label: string;
73
+ options: Array<SimpleFormFieldOption$Outbound>;
74
+ option_type: string;
38
75
  };
39
76
 
40
77
  /** @internal */
@@ -44,8 +81,13 @@ export const FormFieldOptionGroup$outboundSchema: z.ZodType<
44
81
  FormFieldOptionGroup
45
82
  > = z.object({
46
83
  id: z.string().optional(),
47
- label: z.string().optional(),
48
- options: z.array(SimpleFormFieldOption$outboundSchema).optional(),
84
+ label: z.string(),
85
+ options: z.array(SimpleFormFieldOption$outboundSchema),
86
+ optionType: FormFieldOptionGroupOptionType$outboundSchema,
87
+ }).transform((v) => {
88
+ return remap$(v, {
89
+ optionType: "option_type",
90
+ });
49
91
  });
50
92
 
51
93
  /**
@@ -3,7 +3,9 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
7
9
  import { Result as SafeParseResult } from "../../types/fp.js";
8
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
11
 
@@ -16,8 +18,13 @@ export type SimpleFormFieldOptionValue =
16
18
  | boolean
17
19
  | Array<string | number | number>;
18
20
 
21
+ export const OptionType = {
22
+ Simple: "simple",
23
+ } as const;
24
+ export type OptionType = ClosedEnum<typeof OptionType>;
25
+
19
26
  export type SimpleFormFieldOption = {
20
- label?: string | undefined;
27
+ label: string;
21
28
  value?:
22
29
  | string
23
30
  | number
@@ -25,6 +32,7 @@ export type SimpleFormFieldOption = {
25
32
  | boolean
26
33
  | Array<string | number | number>
27
34
  | undefined;
35
+ optionType: OptionType;
28
36
  };
29
37
 
30
38
  /** @internal */
@@ -130,13 +138,32 @@ export function simpleFormFieldOptionValueFromJSON(
130
138
  );
131
139
  }
132
140
 
141
+ /** @internal */
142
+ export const OptionType$inboundSchema: z.ZodNativeEnum<typeof OptionType> = z
143
+ .nativeEnum(OptionType);
144
+
145
+ /** @internal */
146
+ export const OptionType$outboundSchema: z.ZodNativeEnum<typeof OptionType> =
147
+ OptionType$inboundSchema;
148
+
149
+ /**
150
+ * @internal
151
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
152
+ */
153
+ export namespace OptionType$ {
154
+ /** @deprecated use `OptionType$inboundSchema` instead. */
155
+ export const inboundSchema = OptionType$inboundSchema;
156
+ /** @deprecated use `OptionType$outboundSchema` instead. */
157
+ export const outboundSchema = OptionType$outboundSchema;
158
+ }
159
+
133
160
  /** @internal */
134
161
  export const SimpleFormFieldOption$inboundSchema: z.ZodType<
135
162
  SimpleFormFieldOption,
136
163
  z.ZodTypeDef,
137
164
  unknown
138
165
  > = z.object({
139
- label: z.string().optional(),
166
+ label: z.string(),
140
167
  value: z.union([
141
168
  z.string(),
142
169
  z.number().int(),
@@ -144,11 +171,16 @@ export const SimpleFormFieldOption$inboundSchema: z.ZodType<
144
171
  z.boolean(),
145
172
  z.array(z.union([z.string(), z.number().int(), z.number()])),
146
173
  ]).optional(),
174
+ option_type: OptionType$inboundSchema,
175
+ }).transform((v) => {
176
+ return remap$(v, {
177
+ "option_type": "optionType",
178
+ });
147
179
  });
148
180
 
149
181
  /** @internal */
150
182
  export type SimpleFormFieldOption$Outbound = {
151
- label?: string | undefined;
183
+ label: string;
152
184
  value?:
153
185
  | string
154
186
  | number
@@ -156,6 +188,7 @@ export type SimpleFormFieldOption$Outbound = {
156
188
  | boolean
157
189
  | Array<string | number | number>
158
190
  | undefined;
191
+ option_type: string;
159
192
  };
160
193
 
161
194
  /** @internal */
@@ -164,7 +197,7 @@ export const SimpleFormFieldOption$outboundSchema: z.ZodType<
164
197
  z.ZodTypeDef,
165
198
  SimpleFormFieldOption
166
199
  > = z.object({
167
- label: z.string().optional(),
200
+ label: z.string(),
168
201
  value: z.union([
169
202
  z.string(),
170
203
  z.number().int(),
@@ -172,6 +205,11 @@ export const SimpleFormFieldOption$outboundSchema: z.ZodType<
172
205
  z.boolean(),
173
206
  z.array(z.union([z.string(), z.number().int(), z.number()])),
174
207
  ]).optional(),
208
+ optionType: OptionType$outboundSchema,
209
+ }).transform((v) => {
210
+ return remap$(v, {
211
+ optionType: "option_type",
212
+ });
175
213
  });
176
214
 
177
215
  /**