@automate.ax/integration-contracts 0.152.0 → 0.152.2

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.
@@ -1224,7 +1224,9 @@ export declare namespace HighLevelCalendars {
1224
1224
  * This is only to set the standard availability. For custom
1225
1225
  * availability, use the availabilities property
1226
1226
  */
1227
- openHours?: components["schemas"]["OpenHour"][];
1227
+ openHours?: components["schemas"]["OpenHour"][] | {
1228
+ [key: string]: unknown;
1229
+ };
1228
1230
  /**
1229
1231
  * Enable recurring appointments for the calendars. Please note that
1230
1232
  * only one member should be added in the calendar to enable this
@@ -1341,30 +1343,30 @@ export declare namespace HighLevelCalendars {
1341
1343
  * @example
1342
1344
  * 9NkT25Vor1v4aQatFsv2
1343
1345
  */
1344
- contactId: string;
1346
+ contactId?: string;
1345
1347
  /**
1346
1348
  * Group ID
1347
1349
  *
1348
1350
  * @example
1349
1351
  * 9NkT25Vor1v4aQatFsv2
1350
1352
  */
1351
- groupId: string;
1353
+ groupId?: string;
1352
1354
  /**
1353
1355
  * Appointment Status
1354
1356
  *
1355
1357
  * @example
1356
1358
  * confirmed
1357
1359
  */
1358
- appointmentStatus: string;
1360
+ appointmentStatus?: string;
1359
1361
  /**
1360
1362
  * AssignedUser - the primary owner of an appointment
1361
1363
  *
1362
1364
  * @example
1363
1365
  * YlWd2wuCAZQzh2cH1fVZ
1364
1366
  */
1365
- assignedUserId: string;
1367
+ assignedUserId?: string;
1366
1368
  /** Users - the secondary owners of an appointment. */
1367
- users: string[];
1369
+ users?: string[];
1368
1370
  /**
1369
1371
  * Notes
1370
1372
  *
@@ -1398,28 +1400,28 @@ export declare namespace HighLevelCalendars {
1398
1400
  * @example
1399
1401
  * 2023-09-25T16:00:00+05:30
1400
1402
  */
1401
- startTime: Record<string, never>;
1403
+ startTime: string;
1402
1404
  /**
1403
1405
  * End Time
1404
1406
  *
1405
1407
  * @example
1406
1408
  * 2023-09-25T16:00:00+05:30
1407
1409
  */
1408
- endTime: Record<string, never>;
1410
+ endTime: string;
1409
1411
  /**
1410
1412
  * Date Added
1411
1413
  *
1412
1414
  * @example
1413
1415
  * 2023-09-25T16:00:00+05:30
1414
1416
  */
1415
- dateAdded: Record<string, never>;
1417
+ dateAdded: string;
1416
1418
  /**
1417
1419
  * Date Updated
1418
1420
  *
1419
1421
  * @example
1420
1422
  * 2023-09-25T16:00:00+05:30
1421
1423
  */
1422
- dateUpdated: Record<string, never>;
1424
+ dateUpdated: string;
1423
1425
  /** Ids of associated resources rooms and/or equipments */
1424
1426
  assignedResources?: string[];
1425
1427
  /** Appointment booked by metadata */
@@ -1677,9 +1679,9 @@ export declare namespace HighLevelCalendars {
1677
1679
  };
1678
1680
  CreatedOrUpdatedBy: {
1679
1681
  /** The ID of the user who created or updated the appointment */
1680
- userId?: string;
1682
+ userId?: string | null;
1681
1683
  /** The source of the appointment */
1682
- source: string;
1684
+ source?: string;
1683
1685
  };
1684
1686
  DeleteAppointmentSchema: Record<string, never>;
1685
1687
  DeleteEventSuccessfulResponseDto: {
@@ -3115,12 +3117,12 @@ export declare namespace HighLevelContacts {
3115
3117
  * @example
3116
3118
  * JohnDeo@gmail.com
3117
3119
  */
3118
- email?: string;
3120
+ email?: string | null;
3119
3121
  /**
3120
3122
  * @example
3121
3123
  * Asia / Calcutta
3122
3124
  */
3123
- timezone?: string;
3125
+ timezone?: string | null;
3124
3126
  /**
3125
3127
  * @example
3126
3128
  * DE
@@ -3130,7 +3132,7 @@ export declare namespace HighLevelContacts {
3130
3132
  * @example
3131
3133
  * xyz form
3132
3134
  */
3133
- source?: string;
3135
+ source?: string | null;
3134
3136
  /**
3135
3137
  * @example
3136
3138
  * 2020-10-29T09:31:30.255Z
@@ -3142,7 +3144,7 @@ export declare namespace HighLevelContacts {
3142
3144
  * @example
3143
3145
  * 641c094001436dbc2081e642
3144
3146
  */
3145
- businessId?: string;
3147
+ businessId?: string | null;
3146
3148
  attributions?: components["schemas"]["AttributionSource"][];
3147
3149
  /**
3148
3150
  * @example
@@ -5030,6 +5032,28 @@ export declare namespace HighLevelConversations {
5030
5032
  patch?: never;
5031
5033
  trace?: never;
5032
5034
  };
5035
+ "/conversations/messages/email/{emailMessageId}/schedule": {
5036
+ parameters: {
5037
+ query?: never;
5038
+ header?: never;
5039
+ path?: never;
5040
+ cookie?: never;
5041
+ };
5042
+ get?: never;
5043
+ put?: never;
5044
+ post?: never;
5045
+ /**
5046
+ * Cancel a scheduled email message.
5047
+ *
5048
+ * Post the messageId for the API to delete a scheduled email message. <br
5049
+ * />
5050
+ */
5051
+ delete: operations["cancel-scheduled-email-message"];
5052
+ options?: never;
5053
+ head?: never;
5054
+ patch?: never;
5055
+ trace?: never;
5056
+ };
5033
5057
  "/conversations/messages/{id}": {
5034
5058
  parameters: {
5035
5059
  query?: never;
@@ -5372,7 +5396,7 @@ export declare namespace HighLevelConversations {
5372
5396
  * @example
5373
5397
  * This is a sample message body
5374
5398
  */
5375
- lastMessageBody: string;
5399
+ lastMessageBody?: string;
5376
5400
  /**
5377
5401
  * Channel/type of the most recent message (SMS, Email, Call, etc)
5378
5402
  *
@@ -5381,7 +5405,7 @@ export declare namespace HighLevelConversations {
5381
5405
  *
5382
5406
  * @enum {string}
5383
5407
  */
5384
- lastMessageType: "TYPE_CALL" | "TYPE_SMS" | "TYPE_RCS" | "TYPE_EMAIL" | "TYPE_SMS_REVIEW_REQUEST" | "TYPE_WEBCHAT" | "TYPE_SMS_NO_SHOW_REQUEST" | "TYPE_CAMPAIGN_SMS" | "TYPE_CAMPAIGN_CALL" | "TYPE_CAMPAIGN_EMAIL" | "TYPE_CAMPAIGN_VOICEMAIL" | "TYPE_FACEBOOK" | "TYPE_CAMPAIGN_FACEBOOK" | "TYPE_CAMPAIGN_MANUAL_CALL" | "TYPE_CAMPAIGN_MANUAL_SMS" | "TYPE_GMB" | "TYPE_CAMPAIGN_GMB" | "TYPE_REVIEW" | "TYPE_INSTAGRAM" | "TYPE_WHATSAPP" | "TYPE_CUSTOM_SMS" | "TYPE_CUSTOM_EMAIL" | "TYPE_CUSTOM_PROVIDER_SMS" | "TYPE_CUSTOM_PROVIDER_EMAIL" | "TYPE_IVR_CALL" | "TYPE_ACTIVITY_CONTACT" | "TYPE_ACTIVITY_INVOICE" | "TYPE_ACTIVITY_PAYMENT" | "TYPE_ACTIVITY_OPPORTUNITY" | "TYPE_LIVE_CHAT" | "TYPE_LIVE_CHAT_INFO_MESSAGE" | "TYPE_ACTIVITY_APPOINTMENT" | "TYPE_FACEBOOK_COMMENT" | "TYPE_INSTAGRAM_COMMENT" | "TYPE_CUSTOM_CALL" | "TYPE_INTERNAL_COMMENT" | "TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG" | "TYPE_TIKTOK" | "TYPE_TIKTOK_COMMENT" | "TYPE_ACTIVITY_WHATSAPP" | "TYPE_FORM_SUBMISSION" | "TYPE_SMS_REACTION";
5408
+ lastMessageType: "TYPE_CALL" | "TYPE_SMS" | "TYPE_RCS" | "TYPE_EMAIL" | "TYPE_SMS_REVIEW_REQUEST" | "TYPE_WEBCHAT" | "TYPE_SMS_NO_SHOW_REQUEST" | "TYPE_CAMPAIGN_SMS" | "TYPE_CAMPAIGN_CALL" | "TYPE_CAMPAIGN_EMAIL" | "TYPE_CAMPAIGN_VOICEMAIL" | "TYPE_FACEBOOK" | "TYPE_CAMPAIGN_FACEBOOK" | "TYPE_CAMPAIGN_MANUAL_CALL" | "TYPE_CAMPAIGN_MANUAL_SMS" | "TYPE_GMB" | "TYPE_CAMPAIGN_GMB" | "TYPE_REVIEW" | "TYPE_INSTAGRAM" | "TYPE_WHATSAPP" | "TYPE_CUSTOM_SMS" | "TYPE_CUSTOM_EMAIL" | "TYPE_CUSTOM_PROVIDER_SMS" | "TYPE_CUSTOM_PROVIDER_EMAIL" | "TYPE_IVR_CALL" | "TYPE_ACTIVITY_CONTACT" | "TYPE_ACTIVITY_INVOICE" | "TYPE_ACTIVITY_PAYMENT" | "TYPE_ACTIVITY_OPPORTUNITY" | "TYPE_LIVE_CHAT" | "TYPE_LIVE_CHAT_INFO_MESSAGE" | "TYPE_ACTIVITY_APPOINTMENT" | "TYPE_FACEBOOK_COMMENT" | "TYPE_INSTAGRAM_COMMENT" | "TYPE_CUSTOM_CALL" | "TYPE_INTERNAL_COMMENT" | "TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG" | "TYPE_TIKTOK" | "TYPE_TIKTOK_COMMENT" | "TYPE_ACTIVITY_WHATSAPP" | "TYPE_FORM_SUBMISSION" | "TYPE_SMS_REACTION" | "TYPE_NO_SHOW";
5385
5409
  /**
5386
5410
  * Primary channel/type of the conversation (Phone, Email, etc)
5387
5411
  *
@@ -5419,14 +5443,14 @@ export declare namespace HighLevelConversations {
5419
5443
  * @example
5420
5444
  * johndoe@mailingdomain.com
5421
5445
  */
5422
- email: string;
5446
+ email?: string | null;
5423
5447
  /**
5424
5448
  * Primary phone number of the contact
5425
5449
  *
5426
5450
  * @example
5427
5451
  * ;+15550001234
5428
5452
  */
5429
- phone: string;
5453
+ phone?: string | null;
5430
5454
  };
5431
5455
  CreateConversationDto: {
5432
5456
  /**
@@ -6103,7 +6127,9 @@ export declare namespace HighLevelConversations {
6103
6127
  *
6104
6128
  * @enum {string}
6105
6129
  */
6106
- status: "delivered" | "failed" | "pending" | "read";
6130
+ status?: "delivered" | "failed" | "pending" | "read";
6131
+ /** Email conversation thread ID. */
6132
+ threadId?: string;
6107
6133
  };
6108
6134
  StartAfterArrayNumberSchema: {
6109
6135
  /**
@@ -6316,6 +6342,29 @@ export declare namespace HighLevelConversations {
6316
6342
  };
6317
6343
  };
6318
6344
  };
6345
+ "cancel-scheduled-email-message": {
6346
+ parameters: {
6347
+ query?: never;
6348
+ header?: never;
6349
+ path: {
6350
+ /** Email Message Id */
6351
+ emailMessageId: string;
6352
+ };
6353
+ cookie?: never;
6354
+ };
6355
+ requestBody?: never;
6356
+ responses: {
6357
+ /** The scheduled email message was cancelled successfully */
6358
+ 200: {
6359
+ headers: {
6360
+ [name: string]: unknown;
6361
+ };
6362
+ content: {
6363
+ "application/json": components["schemas"]["CancelScheduledResponseDto"];
6364
+ };
6365
+ };
6366
+ };
6367
+ };
6319
6368
  "get-message": {
6320
6369
  parameters: {
6321
6370
  query?: never;
@@ -7467,7 +7516,16 @@ export declare namespace HighLevelOpportunities {
7467
7516
  * new pipeline()
7468
7517
  */
7469
7518
  name?: string;
7470
- stages?: unknown[][];
7519
+ stages?: ({
7520
+ id: string;
7521
+ name: string;
7522
+ position?: number;
7523
+ showInFunnel?: boolean;
7524
+ showInPieChart?: boolean;
7525
+ stageWinProbability?: number;
7526
+ } & {
7527
+ [key: string]: unknown;
7528
+ })[];
7471
7529
  /**
7472
7530
  * @example
7473
7531
  * false
@@ -7516,12 +7574,12 @@ export declare namespace HighLevelOpportunities {
7516
7574
  * @example
7517
7575
  * 3
7518
7576
  */
7519
- nextPage?: number;
7577
+ nextPage?: number | string | null;
7520
7578
  /**
7521
7579
  * @example
7522
7580
  * 1
7523
7581
  */
7524
- prevPage?: number;
7582
+ prevPage?: number | null;
7525
7583
  };
7526
7584
  SearchOpportunitiesContactResponseSchema: {
7527
7585
  /**
@@ -7538,17 +7596,17 @@ export declare namespace HighLevelOpportunities {
7538
7596
  * @example
7539
7597
  * Tesla Inc
7540
7598
  */
7541
- companyName?: string;
7599
+ companyName?: string | null;
7542
7600
  /**
7543
7601
  * @example
7544
7602
  * john@deo.com
7545
7603
  */
7546
- email?: string;
7604
+ email?: string | null;
7547
7605
  /**
7548
7606
  * @example
7549
7607
  * +1202-555-0107
7550
7608
  */
7551
- phone?: string;
7609
+ phone?: string | null;
7552
7610
  tags?: string[];
7553
7611
  };
7554
7612
  SearchOpportunitiesResponseSchema: {
@@ -7581,13 +7639,13 @@ export declare namespace HighLevelOpportunities {
7581
7639
  * @example
7582
7640
  * zT46WSCPbudrq4zhWMk6
7583
7641
  */
7584
- assignedTo?: string;
7642
+ assignedTo?: string | null;
7585
7643
  /**
7586
7644
  * @example
7587
7645
  * open
7588
7646
  */
7589
7647
  status?: string;
7590
- source?: string;
7648
+ source?: string | null;
7591
7649
  /**
7592
7650
  * @example
7593
7651
  * 2021-08-03T04:55:17.355Z
@@ -7636,7 +7694,7 @@ export declare namespace HighLevelOpportunities {
7636
7694
  * @example
7637
7695
  * zT46WSCPbudrq4zhWMk6
7638
7696
  */
7639
- lostReasonId?: string;
7697
+ lostReasonId?: string | null;
7640
7698
  customFields?: components["schemas"]["CustomFieldResponseSchema"][];
7641
7699
  followers?: unknown[][];
7642
7700
  externalObjectId?: string;
@@ -7753,7 +7811,7 @@ export declare namespace HighLevelOpportunities {
7753
7811
  * @example
7754
7812
  * 220
7755
7813
  */
7756
- monetaryValue?: Record<string, never>;
7814
+ monetaryValue?: number;
7757
7815
  /**
7758
7816
  * @example
7759
7817
  * 082goXVW3lIExEQPOnd3
@@ -9136,6 +9194,7 @@ export interface HighLevelOperationMap {
9136
9194
  "conversations:get-message": HighLevelConversations.operations["get-message"];
9137
9195
  "conversations:send-a-new-message": HighLevelConversations.operations["send-a-new-message"];
9138
9196
  "conversations:cancel-scheduled-message": HighLevelConversations.operations["cancel-scheduled-message"];
9197
+ "conversations:cancel-scheduled-email-message": HighLevelConversations.operations["cancel-scheduled-email-message"];
9139
9198
  "conversations:get-message-recording": HighLevelConversations.operations["get-message-recording"];
9140
9199
  "conversations:get-message-transcription": HighLevelConversations.operations["get-message-transcription"];
9141
9200
  "forms:get-forms": HighLevelForms.operations["get-forms"];
@@ -509,6 +509,14 @@ export declare const HIGH_LEVEL_OPERATION_DEFINITIONS: readonly [{
509
509
  readonly product: "conversations";
510
510
  readonly replaySafety: HighLevelReplaySafety;
511
511
  readonly title: string;
512
+ }, {
513
+ readonly alias: "cancelScheduledEmailMessage";
514
+ readonly description: string;
515
+ readonly exportName: "cancelScheduledHighLevelEmailMessage";
516
+ readonly operationId: "cancel-scheduled-email-message";
517
+ readonly product: "conversations";
518
+ readonly replaySafety: HighLevelReplaySafety;
519
+ readonly title: string;
512
520
  }, {
513
521
  readonly alias: "getMessageRecording";
514
522
  readonly description: string;
@@ -62,6 +62,7 @@ export const HIGH_LEVEL_OPERATION_DEFINITIONS = [
62
62
  operation("conversations", "get-message", "getMessage", "getHighLevelMessage", "Get HighLevel message", "Retrieves one message by ID.", "safe"),
63
63
  operation("conversations", "send-a-new-message", "sendMessage", "sendHighLevelMessage", "Send HighLevel message", "Sends a supported message through a contact conversation.", "unsafe"),
64
64
  operation("conversations", "cancel-scheduled-message", "cancelScheduledMessage", "cancelScheduledHighLevelMessage", "Cancel scheduled HighLevel message", "Cancels one scheduled message before delivery.", "safe"),
65
+ operation("conversations", "cancel-scheduled-email-message", "cancelScheduledEmailMessage", "cancelScheduledHighLevelEmailMessage", "Cancel scheduled HighLevel email message", "Cancels one scheduled email before delivery.", "safe"),
65
66
  operation("conversations", "get-message-recording", "getMessageRecording", "getHighLevelMessageRecording", "Get HighLevel message recording", "Returns the recording for a voice or call message.", "safe"),
66
67
  operation("conversations", "get-message-transcription", "getMessageTranscription", "getHighLevelMessageTranscription", "Get HighLevel message transcription", "Returns the transcription for a supported message.", "safe"),
67
68
  operation("locations", "get-location", "getLocation", "getHighLevelLocation", "Get HighLevel location", "Retrieves the connected sub-account's location record.", "safe"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/integration-contracts",
3
- "version": "0.152.0",
3
+ "version": "0.152.2",
4
4
  "description": "Shared integration payload contracts and provider primitives for Automate.ax.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "dependencies": {
74
74
  "@anthropic-ai/sdk": "0.123.0",
75
- "@automate.ax/codec": "0.152.0",
75
+ "@automate.ax/codec": "0.152.2",
76
76
  "@cfworker/json-schema": "^4.1.1",
77
77
  "@googleapis/calendar": "^16.0.0",
78
78
  "@googleapis/forms": "^6.0.1",
@@ -86,7 +86,12 @@ export function getHighLevelApi(account: HighLevelResolvedAccount) {
86
86
  pathValues.set(name, inputRecord[name])
87
87
  }
88
88
  for (const { name } of definition.queryParameters) {
89
- queryValues.set(name, inputRecord[name])
89
+ queryValues.set(
90
+ name,
91
+ inputRecord[name] === undefined
92
+ ? queryParameterDefault(definition.inputSchema, name)
93
+ : inputRecord[name],
94
+ )
90
95
  }
91
96
  for (const name of definition.bodyParameters) {
92
97
  if (inputRecord[name] !== undefined)
@@ -171,6 +176,28 @@ export function getHighLevelApi(account: HighLevelResolvedAccount) {
171
176
  }
172
177
  }
173
178
 
179
+ /**
180
+ * Reads one documented top-level query default from a generated input schema.
181
+ *
182
+ * @param schema - Generated operation input schema.
183
+ * @param name - Public query parameter name.
184
+ */
185
+ function queryParameterDefault(schema: Record<string, unknown>, name: string) {
186
+ const properties = schema.properties
187
+ if (!isRecord(properties)) return undefined
188
+ const property = properties[name]
189
+ return isRecord(property) ? property.default : undefined
190
+ }
191
+
192
+ /**
193
+ * Whether one unknown JSON value is an object record.
194
+ *
195
+ * @param value - Candidate value.
196
+ */
197
+ function isRecord(value: unknown): value is Record<string, unknown> {
198
+ return typeof value === "object" && value !== null && !Array.isArray(value)
199
+ }
200
+
174
201
  /**
175
202
  * Encodes one required path parameter.
176
203
  *